Compare commits

...

52 Commits

Author SHA1 Message Date
yujialong 24b60d7468 fix 1 week ago
yujialong 796f802fc5 fix 2 weeks ago
yujialong 2af18aa23c fix 2 weeks ago
yujialong fe4a1b7900 fix 2 weeks ago
yujialong 66b4c21343 fix 2 weeks ago
yujialong 40327a423f fix 1 month ago
yujialong a089ad2943 fix 1 month ago
yujialong 734524aab2 赛事修复 1 month ago
yujialong 4779595867 fix 1 month ago
yujialong df33b0b5eb fix 1 month ago
yujialong b692519c5d fix 1 month ago
yujialong 996a611e03 fix 1 month ago
yujialong 37eb678280 fix 1 month ago
yujialong 46eaca3745 fix 2 months ago
yujialong 56361bdd11 fix 2 months ago
yujialong f3e795125d 竞赛修复 2 months ago
yujialong d0764a64a0 赛事成绩列表实训跟理论合并,线下单独一个页面 2 months ago
yujialong a033ef3565 fix 2 months ago
yujialong f07e4ccdb2 fix 2 months ago
yujialong bf8f4093f6 评阅中心 2 months ago
yujialong dabd2f9871 fix 3 months ago
yujialong 02b22578a4 赛事修复 3 months ago
yujialong e44b2ad9b9 fix 3 months ago
yujialong 0d952de033 fix 3 months ago
yujialong 45ff98f698 fix 3 months ago
yujialong 6747314cc9 fix 3 months ago
yujialong 645e52a679 fix 3 months ago
yujialong 5a21e78cac 赛事成绩相关 3 months ago
yujialong 5c7bb7eba0 fix 3 months ago
yujialong 8eb83be7c7 赛事列表、赛事理论成绩列表 3 months ago
yujialong 89a1a63f71 理论考试实验报告联调完成 3 months ago
yujialong 3668825847 赛事选择试卷相关 3 months ago
yujialong b8a41a5e23 登录调整 4 months ago
yujialong a2b4e242b4 fix 4 months ago
yujialong 58f007cfc9 oss上传秘钥加密 4 months ago
yujialong 812f1c916a 考试平台iframe,订单、客户修复 4 months ago
yujialong b831b14302 知识点、题库分类 4 months ago
yujialong 2669f15962 理论考试系统列表、题库管理 4 months ago
yujialong 300e917d1e 订单修复 5 months ago
yujialong 6fe4a41fa1 订单:一键发货、批量修改期限、试用默认1月 5 months ago
yujialong d611d682a2 fix 5 months ago
yujialong 6c2437e6f3 fix 6 months ago
yujialong c11eb9ca6b 赛事修复 6 months ago
yujialong 23986d7b7e 赛事修复 6 months ago
yujialong d3c9cc9876 赛事修复 6 months ago
yujialong 6599d982a4 赛事分配等 6 months ago
yujialong 0ba3475f1f fix 6 months ago
yujialong 56565ded13 大赛自动分配 6 months ago
yujialong 64d15ceab0 赛事分配等 6 months ago
yujialong 5fdb75fec9 fix 7 months ago
yujialong 267dd86ac0 fix 7 months ago
yujialong d5d594b967 编辑客户学校 7 months ago
  1. 10
      .prettierrc
  2. 10
      package-lock.json
  3. 2
      package.json
  4. 62
      src/App.vue
  5. 54
      src/assets/css/main.css
  6. BIN
      src/assets/img/ach1.png
  7. BIN
      src/assets/img/ach2.png
  8. 1
      src/assets/img/right.svg
  9. 1
      src/assets/img/shrink.svg
  10. 1
      src/assets/img/tag-active.svg
  11. 1
      src/assets/img/tag.svg
  12. 1
      src/assets/img/wrong.svg
  13. 125
      src/components/Header.vue
  14. 55
      src/components/Sidebar.vue
  15. 105
      src/components/quill/index.vue
  16. 37
      src/components/upload/config.js
  17. 42
      src/components/upload/index.vue
  18. 49
      src/components/upload/upload.js
  19. 50
      src/const/ques.js
  20. 34
      src/const/testPaper.js
  21. 38
      src/libs/route/addRoutes.js
  22. 193
      src/libs/util.js
  23. 552
      src/router/index.js
  24. 78
      src/setting.js
  25. 1009
      src/utils/api.js
  26. 134
      src/utils/editor.js
  27. 296
      src/utils/http.js
  28. 82
      src/utils/util.js
  29. 5
      src/views/Home.vue
  30. 469
      src/views/Login.vue
  31. 742
      src/views/course/AddCurriculum.vue
  32. 555
      src/views/course/contentSettings.vue
  33. 931
      src/views/customer/AddCustomer.vue
  34. 151
      src/views/customer/customer.vue
  35. 779
      src/views/devLogin.vue
  36. 271
      src/views/match/add/index.vue
  37. 355
      src/views/match/add/set.vue
  38. 700
      src/views/match/add/step1.vue
  39. 309
      src/views/match/add/step2.vue
  40. 371
      src/views/match/add/step3.vue
  41. 211
      src/views/match/add/template.vue
  42. 406
      src/views/match/list/index.vue
  43. 630
      src/views/match/manage/abnormalTeam.vue
  44. 51
      src/views/match/manage/index.vue
  45. 111
      src/views/match/manage/matchArch.vue
  46. 930
      src/views/match/manage/matchArchList.vue
  47. 435
      src/views/match/manage/matchInfo.vue
  48. 414
      src/views/match/manage/matchRank.vue
  49. 447
      src/views/match/manage/matchReport.vue
  50. 524
      src/views/match/manage/matchSignup.vue
  51. 675
      src/views/match/manage/otherArchList.vue
  52. 1059
      src/views/match/manage/theoryReport.vue
  53. 413
      src/views/match/manage/trialReport.vue
  54. 2035
      src/views/order/AddOrder.vue
  55. 197
      src/views/order/Order.vue
  56. 1249
      src/views/parner/staff.vue
  57. 50
      src/views/review/index.vue
  58. 106
      src/views/serve/Configure.vue
  59. 318
      src/views/serve/projectAdd.vue
  60. 1881
      src/views/setting/info.vue
  61. 1149
      src/views/shop/addProduct/index.vue
  62. 1425
      src/views/system/staff.vue
  63. 2
      src/views/theoreticalCourse/contentSettings/index.vue
  64. 158
      src/views/theoreticalCourse/list/buildPlatform/index.vue
  65. 10
      src/views/theoreticalCourse/list/index.vue
  66. 581
      src/views/theoreticalCourse/preview/index.vue
  67. 39
      src/views/theoryExam/index.vue
  68. 57
      src/views/theoryExam/list/index.vue
  69. 139
      src/views/theoryExam/list/program.vue
  70. 321
      src/views/theoryExam/list/system.vue
  71. 356
      src/views/user/AddUser.vue
  72. 269
      src/views/user/User.vue

@ -1,6 +1,6 @@
{
"tabWidth": 4,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 140
}
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 140
}

10
package-lock.json generated

@ -3871,6 +3871,11 @@
"randomfill": "^1.0.3"
}
},
"crypto-js": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz",
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="
},
"css": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz",
@ -9509,6 +9514,11 @@
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
},
"jsencrypt": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/jsencrypt/-/jsencrypt-3.3.2.tgz",
"integrity": "sha512-arQR1R1ESGdAxY7ZheWr12wCaF2yF47v5qpB76TtV64H1pyGudk9Hvw8Y9tb/FiTIaaTRUyaSnm5T/Y53Ghm/A=="
},
"jsesc": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",

@ -14,6 +14,7 @@
"babel-polyfill": "^6.26.0",
"blueimp-md5": "^2.19.0",
"clipboard": "^2.0.11",
"crypto-js": "^4.2.0",
"decimal.js": "^10.4.3",
"echarts": "^5.4.1",
"element-theme": "^2.0.1",
@ -22,6 +23,7 @@
"image-conversion": "^2.1.1",
"image-webpack-loader": "^8.1.0",
"js-cookie": "^3.0.1",
"jsencrypt": "^3.3.2",
"jszip": "^3.10.1",
"lodash": "^4.17.21",
"mavon-editor": "^2.10.4",

@ -1,30 +1,52 @@
<template>
<div id="app">
<router-view></router-view>
</div>
<div id="app">
<el-radio-group v-if="Setting.isDev" class="ip" v-model="ip" @change="ipChange">
<el-radio :label="0">刘榕ip</el-radio>
<el-radio :label="1">陈赓ip</el-radio>
<el-radio :label="2">测试服ip</el-radio>
</el-radio-group>
<router-view></router-view>
</div>
</template>
<script>
export default {
name: 'App',
created () {
//sessionStorage
if (sessionStorage.getItem("store") ) {
this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(sessionStorage.getItem("store"))))
}
//vuexsessionStorage
window.addEventListener("beforeunload",()=>{
sessionStorage.getItem("token") && sessionStorage.setItem("store",JSON.stringify(this.$store.state))
})
import Setting from '@/setting'
export default {
name: 'App',
data () {
return {
Setting,
ip: localStorage.getItem('ip') ? +localStorage.getItem('ip') : 0,
};
},
created () {
window.exitSystem = () => {
sessionStorage.removeItem('token')
location.reload()
}
//sessionStorage
if (sessionStorage.getItem("store")) {
this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem("store"))))
}
//vuexsessionStorage
window.addEventListener("beforeunload", () => {
sessionStorage.getItem("token") && sessionStorage.setItem("store", JSON.stringify(this.$store.state))
})
},
methods: {
ipChange (val) {
localStorage.setItem('ip', val)
location.reload()
},
}
}
</script>
<style>
@import "./assets/css/main.css";
/* @import "./assets/css/color-dark.css"; */
/*深色主题*/
@import "./assets/css/theme-green/color-green.css";
/* 浅绿色主题 */
@import "./assets/css/main.css";
/* @import "./assets/css/color-dark.css"; */
/*深色主题*/
@import "./assets/css/theme-green/color-green.css";
/* 浅绿色主题 */
</style>

@ -19,6 +19,12 @@ body {
font-size: 14px;
}
.ip {
z-index: 1;
position: fixed;
top: 0;
left: 0;
}
a {
text-decoration: none;
}
@ -442,12 +448,15 @@ li {
.el-switch__label span {
font-size: 12px;
}
.m-b-20 {
margin-bottom: 20px;
.m-r-5 {
margin-right: 5px;
}
.m-r-10 {
margin-right: 10px;
}
.m-b-20 {
margin-bottom: 20px;
}
@media (max-width: 720px) {
.el-message {
min-width: auto !important;
@ -455,7 +464,7 @@ li {
}
}
.el-tooltip__popper {
max-width: 500px !important;
max-width: 100% !important;
}
.no-atTheMoment > .el-picker-panel__footer > .el-button--text:first-child {
display: none;
@ -479,3 +488,42 @@ li {
.search-wrap .el-input__inner {
border-radius: 0;
}
.edui-default {
line-height: normal;
}
.html-parse {
table {
display: table;
margin-bottom: 10px;
border-collapse: collapse;
th,
td {
padding: 5px 10px;
border: 1px solid #DDD;
}
}
ol {
padding-left: 30px;
li {
list-style-type: decimal;
}
}
ul {
padding-left: 30px;
li {
list-style-type: disc;
}
}
}
.files-tip {
li {
line-height: 1.8;
cursor: pointer;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723792589398" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5839" width="20" height="20" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M874 150C674.09-50 349.91-50 150 150s-200 524.09 0 724 524.09 200 724 0 200-524.09 0-724zM760.57 440.57l-256 256a80 80 0 0 1-113.14 0l-128-128a80 80 0 0 1 113.14-113.14L448 526.86l199.43-199.43a80 80 0 0 1 113.14 113.14z" fill="#2abd8c" p-id="5840"></path></svg>

After

Width:  |  Height:  |  Size: 593 B

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723535697263" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5903" width="18" height="18" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M877.5 565.9l-367.6-340-367.6 340c-22.5 14.5-52.5 14.5-67.5 0-15-21.7-15-50.7 0-65.1L495 117.5c0-7.2 7.5-7.2 15-7.2s7.5 0 15 7.2l420.2 383.3c22.5 21.7 15 50.6 0 65.1-22.7 14.5-52.7 14.5-67.7 0zM494.8 450.1c0-7.2 7.5-7.2 15-7.2s15 0 15 7.2L945 833.4c22.5 21.7 15 50.6 0 65.1-22.5 14.4-52.5 14.4-67.5 0L509.8 558.6 142.2 905.8c-22.5 14.5-52.5 14.5-67.5 0-15-21.7-15-50.7 0-65.1l420.1-390.6z m0 0" fill="#666666" p-id="5904"></path></svg>

After

Width:  |  Height:  |  Size: 766 B

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723619200843" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7128" width="18" height="18" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M695.7 118.6H326.9c-58.2 0-105.4 47.2-105.4 105.4v579.6c0 58.2 47.2 105.4 105.4 105.4l184.4-184.4L695.7 909c58.2 0 105.4-47.2 105.4-105.4V224c0-58.2-47.1-105.4-105.4-105.4z" fill="#d81e06" p-id="7129"></path></svg>

After

Width:  |  Height:  |  Size: 545 B

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723619200843" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7128" width="18" height="18" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M695.7 118.6H326.9c-58.2 0-105.4 47.2-105.4 105.4v579.6c0 58.2 47.2 105.4 105.4 105.4l184.4-184.4L695.7 909c58.2 0 105.4-47.2 105.4-105.4V224c0-58.2-47.1-105.4-105.4-105.4z" fill="#bfbfbf" p-id="7129"></path></svg>

After

Width:  |  Height:  |  Size: 545 B

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1723792667165" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7415" width="20" height="20" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M480 64C217.6 64 0 281.6 0 544s217.6 480 480 480 480-217.6 480-480S742.4 64 480 64z m204.8 614.4c19.2 19.2 19.2 44.8 0 64-19.2 19.2-44.8 19.2-64 0L486.4 608 345.6 748.8c-19.2 19.2-51.2 19.2-70.4 0-19.2-19.2-19.2-51.2 0-70.4L416 537.6 281.6 403.2c-19.2-19.2-19.2-44.8 0-64 19.2-19.2 44.8-19.2 64 0L480 473.6l140.8-140.8c19.2-19.2 51.2-19.2 70.4 0 19.2 19.2 19.2 51.2 0 70.4L550.4 544l134.4 134.4z" fill="#e75050" p-id="7416"></path></svg>

After

Width:  |  Height:  |  Size: 768 B

@ -1,29 +1,16 @@
<template>
<div class="header flex-between">
<div class="logo">
<img class="cursor"
@click="goHome"
src="../assets/img/logo.png">
<img class="cursor" @click="goHome" src="../assets/img/logo.png">
</div>
<el-radio-group v-if="Setting.isDev"
v-model="ip"
@change="ipChange">
<el-radio :label="0">刘榕ip</el-radio>
<el-radio :label="1">陈赓ip</el-radio>
</el-radio-group>
<div class="header-right">
<div class="header-user-con">
<div class="user"
@click="toPerson">
<el-avatar :size="40"
:src="$store.state.avatar"></el-avatar>
<span class="user-avator">{{userName}}</span>
<div class="user" @click="toPerson">
<el-avatar :size="40" :src="$store.state.avatar"></el-avatar>
<span class="user-avator">{{ userName }}</span>
</div>
<el-divider class="ml20"
direction="vertical"></el-divider>
<el-button type="text"
class="ml20"
@click="loginout">退出</el-button>
<el-divider class="ml20" direction="vertical"></el-divider>
<el-button type="text" class="ml20" @click="logout">退出</el-button>
</div>
</div>
</div>
@ -34,9 +21,9 @@ import Setting from '@/setting'
export default {
data () {
return {
timer: null,
Setting,
userName: '',
ip: localStorage.getItem('nakadaiIp') ? +localStorage.getItem('nakadaiIp') : 0,
};
},
mounted () {
@ -48,9 +35,10 @@ export default {
this.$router.push('/person')
}
},
loginout () {
localStorage.removeItem('ms_username');
localStorage.removeItem('token');
async logout () {
await this.$post(this.api.logout)
localStorage.removeItem('ms_username')
localStorage.removeItem('token')
sessionStorage.clear()
location.reload()
},
@ -94,8 +82,8 @@ export default {
},
//
heartbeatDetection () {
setInterval(async () => {
await this.$get(this.api.heartbeatDetection)
this.timer = setInterval(async () => {
sessionStorage.getItem('token') ? await this.$get(this.api.heartbeatDetection) : clearInterval(this.timer)
}, 58 * 1000)
},
@ -112,72 +100,79 @@ export default {
Setting.isPro && this.heartbeatDetection()
}).catch(err => { })
},
ipChange (val) {
localStorage.setItem('nakadaiIp', val)
location.reload()
},
},
};
</script>
<style lang="scss" scoped>
.header {
position: relative;
box-sizing: border-box;
width: 100%;
height: 60px;
font-size: 16px;
color: #333;
position: relative;
box-sizing: border-box;
width: 100%;
height: 60px;
font-size: 16px;
color: #333;
}
.header .logo {
float: left;
width: 170px;
height: 40px;
margin-left: 20px;
float: left;
width: 170px;
height: 40px;
margin-left: 20px;
}
.header .logo img {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
.header-right {
float: right;
padding-right: 50px;
float: right;
padding-right: 50px;
}
.header-user-con {
display: flex;
height: 70px;
align-items: center;
display: flex;
height: 70px;
align-items: center;
}
.header-user-con .user {
display: inline-flex;
align-items: center;
cursor: pointer;
display: inline-flex;
align-items: center;
cursor: pointer;
}
.user-avator {
cursor: pointer;
margin-left: 10px;
font-size: 12px;
cursor: pointer;
margin-left: 10px;
font-size: 12px;
}
.ml20 {
margin-left: 20px;
margin-left: 20px;
}
.user-avator img {
display: block;
width: 40px;
height: 40px;
border-radius: 50%;
display: block;
width: 40px;
height: 40px;
border-radius: 50%;
}
/deep/.header-right .el-button--text {
color: #333;
span {
font-size: 12px;
}
color: #333;
span {
font-size: 12px;
}
}
.header-right .el-divider--vertical {
width: 2px;
height: 15px;
width: 2px;
height: 15px;
}
.header-right .el-divider {
background-color: #333;
background-color: #333;
}
</style>

@ -1,40 +1,27 @@
<template>
<div>
<el-menu class="sidebar-el-menu"
:default-active="onRoutes"
background-color="#324157"
text-color="#bfcbd9"
active-text-color="#9278FF"
unique-opened
mode="horizontal"
router
@select="handleSelect">
<el-menu class="sidebar-el-menu" :default-active="onRoutes" background-color="#324157" text-color="#bfcbd9"
active-text-color="#9278FF" unique-opened mode="horizontal" router @select="handleSelect">
<template v-for="item in menus">
<template v-if="item.subs">
<el-submenu :index="item.index"
:key="item.index">
<el-submenu :index="item.index" :key="item.index">
<template slot="title">
<i :class="item.icon"></i>
<span slot="title">{{ item.title }}</span>
</template>
<template v-for="subItem in item.subs">
<el-submenu v-if="subItem.subs"
:index="subItem.index"
:key="subItem.index">
<el-submenu v-if="subItem.subs" :index="subItem.index" :key="subItem.index">
<template slot="title">{{ subItem.title }}</template>
<el-menu-item v-for="(threeItem,i) in subItem.subs"
:key="i"
:index="threeItem.index">{{ threeItem.title }}</el-menu-item>
<el-menu-item v-for="(threeItem, i) in subItem.subs" :key="i" :index="threeItem.index">{{
threeItem.title
}}</el-menu-item>
</el-submenu>
<el-menu-item v-else
:index="subItem.index"
:key="subItem.index">{{ subItem.title }}</el-menu-item>
<el-menu-item v-else :index="subItem.index" :key="subItem.index">{{ subItem.title }}</el-menu-item>
</template>
</el-submenu>
</template>
<template v-else>
<el-menu-item :index="item.index"
:key="item.index">
<el-menu-item :index="item.index" :key="item.index">
<i :class="item.icon"></i>
<span slot="title">{{ item.title }}</span>
</el-menu-item>
@ -102,7 +89,7 @@ export default {
title: '系统配置'
},
{
icon: 'el-icon-s-check',
icon: 'el-icon-box',
index: '/parner',
title: '合伙管理'
},
@ -112,10 +99,20 @@ export default {
title: '合伙运营'
},
{
icon: 'el-icon-s-shop',
icon: 'el-icon-shopping-cart-2',
index: '/shop',
title: '商城管理'
},
{
icon: 'el-icon-data-board',
index: '/theoryExam',
title: '考试平台'
},
{
icon: 'el-icon-document-copy',
index: '/review',
title: '评阅平台'
},
],
menus: [],
onRoutes: this.$route.path
@ -176,12 +173,14 @@ export default {
<style scoped>
.sidebar::-webkit-scrollbar {
width: 0;
width: 0;
}
.sidebar-el-menu:not(.el-menu--collapse) {
width: 100%;
width: 100%;
}
.sidebar > ul {
height: 100%;
.sidebar>ul {
height: 100%;
}
</style>

@ -1,39 +1,21 @@
<template>
<div>
<el-radio-group v-if="!readonly && radio"
class="type-radio"
v-model="editorType"
@change="typeChange">
<el-radio-group v-if="!readonly && radio" class="type-radio" v-model="editorType" @change="typeChange">
<el-radio label="0">富文本</el-radio>
<el-radio label="1">markdown</el-radio>
</el-radio-group>
<div v-show="editorType == 0"
class="quill"
ref="quill"
:class="classes">
<div ref="editor"
:style="styles"
v-loading="loading"></div>
<Upload :max-size="1000"
:limit="100"
@beforeUpload="beforeUpload"
@onSuccess="editorUploadSuccess"
style="display: none">
<div v-show="editorType == 0" class="quill" ref="quill" :class="classes">
<div ref="editor" :style="styles" v-loading="loading"></div>
<Upload :max-size="1000" :limit="100" @beforeUpload="beforeUpload" @onSuccess="editorUploadSuccess"
style="display: none">
<div slot="trigger">
<el-button :id="'editorUpload' + index"
type="primary">点击上传</el-button>
<el-button :id="'editorUpload' + index" type="primary">点击上传</el-button>
</div>
</Upload>
</div>
<mavon-editor class="md"
v-model="mdVal"
v-show="editorType == 1"
ref="md"
:ishljs="true"
:subfield="false"
@change="mdChange"
@imgAdd="imgAdd" />
<mavon-editor class="md" v-model="mdVal" v-show="editorType == 1" ref="md" :ishljs="true" :subfield="false"
@change="mdChange" @imgAdd="imgAdd" />
</div>
</template>
@ -300,38 +282,63 @@ export default {
</script>
<style lang="scss" scoped>
.type-radio {
margin-bottom: 20px;
margin-bottom: 20px;
}
.quill-no-border {
.ql-toolbar.ql-snow {
border: none;
border-bottom: 1px solid #e8eaec;
}
.ql-container.ql-snow {
border: none;
}
.ql-toolbar.ql-snow {
border: none;
border-bottom: 1px solid #e8eaec;
}
.ql-container.ql-snow {
border: none;
}
}
.else {
.ql-toolbar.ql-snow {
height: 0;
overflow: hidden;
padding: 0;
border-top: 0;
}
.ql-toolbar.ql-snow {
height: 0;
overflow: hidden;
padding: 0;
border-top: 0;
}
}
/deep/.ql-snow {
position: relative;
.ql-tooltip {
position: absolute !important;
top: 0 !important;
left: -100px !important;
transform: translateY(10px);
}
position: relative;
.ql-tooltip {
position: absolute !important;
top: 0 !important;
left: -100px !important;
transform: translateY(10px);
}
}
.md {
max-height: 300px;
max-height: 300px;
}
/deep/.v-note-wrapper .v-note-panel {
min-height: 200px;
min-height: 200px;
}
/deep/.markdown-body {
ul {
list-style: disc;
li {
list-style: inherit;
}
}
ol {
list-style: decimal;
li {
list-style: inherit;
}
}
}
</style>

@ -2,14 +2,31 @@
* 阿里云oss配置
* */
export default {
// oss账号信息
config: {
region: 'oss-cn-shenzhen',
accessKeyId: 'LTAI4FzqQHnk4rozqLZ8jCNj',
accessKeySecret: 'mveW7B1OyFoKUkHm8WsxmrjHmkJWHq',
bucket: 'huoran'
},
// 上传成功url前置部分(成功回调没有返回url)
preUrl: 'https://huoran.oss-cn-shenzhen.aliyuncs.com/'
import router from '@/router/index'
import { Message } from 'element-ui'
export default async function () {
try {
let RE = localStorage.getItem('osc')
if (RE) {
RE = JSON.parse(RE)
} else {
sessionStorage.removeItem('token')
Message.error('登录过期,请重新登录!')
setTimeout(() => {
router.replace('/login')
}, 1500)
return false
}
return {
// oss账号信息
config: {
region: 'oss-cn-shenzhen',
accessKeyId: RE[0],
accessKeySecret: RE[1],
bucket: 'huoran'
},
// 上传成功url前置部分(成功回调没有返回url)
preUrl: 'https://huoran.oss-cn-shenzhen.aliyuncs.com/'
}
} catch (e) { }
}

@ -1,25 +1,13 @@
<template>
<el-upload :disabled="uploading"
:before-upload="beforeUpload"
:on-remove="onRemove"
:on-error="uploadError"
:limit="limit"
action=""
:on-exceed="handleExceed"
:show-file-list="showFiles"
:file-list="fileList"
:http-request="handleRequest"
name="file">
<el-upload :disabled="uploading" :before-upload="beforeUpload" :on-remove="onRemove" :on-error="uploadError"
:limit="limit" action="" :on-exceed="handleExceed" :show-file-list="showFiles" :file-list="fileList"
:http-request="handleRequest" name="file">
<slot name="trigger">
<el-button size="small"
:loading="uploading">{{ uploading ? '正在上传' : '上传文件' }}</el-button>
<el-button size="small" :loading="uploading">{{ uploading ? '正在上传' : '上传文件' }}</el-button>
</slot>
<div slot="tip"
class="el-upload__tip">
<el-progress v-if="uploading"
class="upload-progress"
:stroke-width="3"
:percentage="uploadProgress"></el-progress>
<div slot="tip" class="el-upload__tip">
<el-progress v-if="uploading" class="upload-progress" :stroke-width="3"
:percentage="uploadProgress"></el-progress>
<slot name="tip">
<p>支持扩展名.rar .zip .doc .docx .pdf .jpg...</p>
</slot>
@ -69,7 +57,8 @@ export default {
client: null,
uploading: false,
uploadProgress: 0,
showFiles: this.showFileList
showFiles: this.showFileList,
Oss: {},
};
},
mounted () {
@ -77,8 +66,9 @@ export default {
},
methods: {
// oss
initOss () {
this.client = new OSS(OssConfig.config)
async initOss () {
this.Oss = await OssConfig()
this.client = new OSS(this.Oss.config)
},
//
beforeUpload (file) {
@ -107,7 +97,7 @@ export default {
});
this.uploading = false
const url = OssConfig.preUrl + name
const url = this.Oss.preUrl + name
this.changeFileList && this.$emit('update:fileList', [
...this.fileList,
{
@ -143,8 +133,8 @@ export default {
</script>
<style lang="scss" scoped>
/deep/.upload-progress {
max-width: 300px;
margin: 10px 0;
white-space: nowrap;
max-width: 300px;
margin: 10px 0;
white-space: nowrap;
}
</style>

@ -5,33 +5,36 @@ import OssConfig from './config'
import Util from '@/libs/util'
let client = null
let Oss
// 初始化oss
const initOss = () => {
if (!client) client = new OSS(OssConfig.config)
const initOss = async () => {
Oss = await OssConfig()
if (!client) client = new OSS(Oss.config)
}
initOss()
export default {
// 上传文件
upload(file) {
initOss()
return new Promise(async (resolve, reject) => {
try {
// 上传到阿里云oss
const res = await client.multipartUpload(Date.now() + '.' + Util.getFileExt(file.name), file);
resolve({
format: Util.getFileExt(file.name),
// 上传文件
upload (file) {
initOss()
return new Promise(async (resolve, reject) => {
try {
// 上传到阿里云oss
const res = await client.multipartUpload(Date.now() + '.' + Util.getFileExt(file.name), file);
resolve({
format: Util.getFileExt(file.name),
name: file.name,
url: OssConfig.preUrl + res.name,
url: Oss.preUrl + res.name,
size: file.size,
})
} catch (error) {
reject()
}
})
},
// 删除文件(传完整url,不是没有https的name,因为很多接口没有存name,只存url,所以统一使用url)
async del(url) {
initOss()
await client.delete(url.replace(OssConfig.preUrl, ''));
}
})
} catch (error) {
reject()
}
})
},
// 删除文件(传完整url,不是没有https的name,因为很多接口没有存name,只存url,所以统一使用url)
async del (url) {
initOss()
await client.delete(url.replace(Oss.preUrl, ''));
}
}

@ -0,0 +1,50 @@
export default {
difficults: [
{
id: 'basic',
name: '基础',
coefficient: 0.2, // 难度系数,试卷里计算试卷难度专用
theme: 'success',
},
{
id: 'easy',
name: '普通',
coefficient: 0.4,
theme: '',
},
{
id: 'medium',
name: '较难',
coefficient: 0.6,
theme: 'warning',
},
{
id: 'hard',
name: '难',
coefficient: 0.8,
theme: 'danger',
},
],
questionTypes: [
{
id: 'single_choice',
name: '单选题'
},
{
id: 'multiple_choice',
name: '多选题'
},
{
id: 'judgement',
name: '判断题'
},
{
id: 'fill_blank',
name: '填空题'
},
{
id: 'essay',
name: '问答题'
},
],
}

@ -0,0 +1,34 @@
export default {
difficults: [
{
id: 1,
name: '简单'
},
{
id: 2,
name: '普通'
},
{
id: 3,
name: '较难'
},
{
id: 4,
name: '难'
},
],
paperTypes: [
{
id: 0,
name: '练习'
},
{
id: 1,
name: '考核'
},
{
id: 2,
name: '竞赛'
},
],
}

@ -3,27 +3,27 @@ import generateBtnPermission from '../auth/generateBtnPermission';
const newRoutes = []
function createMeta(item){
let meta = { title: item.name }
return meta
function createMeta (item) {
let meta = { title: item.name }
return meta
}
function createRoute(data){
data.map(e => {
if(e.path){
let meta = createMeta(e)
newRoutes.push({
path: e.path,
meta
})
}
// 递归生成路由集合
e.children && e.children.length && createRoute(e.children)
})
function createRoute (data) {
data.map(e => {
if (e.path) {
let meta = createMeta(e)
newRoutes.push({
path: e.path,
meta
})
}
// 递归生成路由集合
e.children && e.children.length && createRoute(e.children)
})
}
export default function(data,path){
generateBtnPermission(data)
createRoute(data)
store.commit('addRoutes',newRoutes)
export default function (data, path) {
generateBtnPermission(data)
createRoute(data)
store.commit('addRoutes', newRoutes)
}

@ -1,6 +1,9 @@
import cookies from './util.cookies'
import {_local,_session} from './util.db'
import { _local, _session } from './util.db'
import { Message } from 'element-ui'
import Setting from '@/setting'
import axios from 'axios'
import api from '@/utils/api'
// 文件后缀集合
const exts = {
@ -15,115 +18,115 @@ const util = {
local: _local,
session: _session,
// 传入身份证获取生日
getBirth(idCard) {
getBirth (idCard) {
var birthday = "";
if(idCard != null && idCard != ""){
if(idCard.length == 15){
birthday = "19"+idCard.slice(6,12);
} else if(idCard.length == 18){
birthday = idCard.slice(6,14);
}
birthday = birthday.replace(/(.{4})(.{2})/,"$1-$2-");
if (idCard != null && idCard != "") {
if (idCard.length == 15) {
birthday = "19" + idCard.slice(6, 12);
} else if (idCard.length == 18) {
birthday = idCard.slice(6, 14);
}
birthday = birthday.replace(/(.{4})(.{2})/, "$1-$2-");
//通过正则表达式来指定输出格式为:1990-01-01
}
}
return birthday;
},
// new Date('2020-11-12 00:00:00') 在IE下失效,因此把-替换成/
dateCompatible(date) {
dateCompatible (date) {
return date.replace(/\-/g, '/')
},
// 日期时间前面补零
formateTime(num) {
formateTime (num) {
return num < 10 ? `0${num}` : num
},
//返回格式化时间,传参例如:"yyyy-MM-dd hh:mm:ss"
formatDate(fmt,date) {
formatDate (fmt, date) {
var date = date ? date : new Date()
var o = {
"M+" : date.getMonth()+1, //月份
"d+" : date.getDate(), //日
"h+" : date.getHours(), //小时
"m+" : date.getMinutes(), //分
"s+" : date.getSeconds(), //秒
"q+" : Math.floor((date.getMonth()+3)/3), //季度
"S" : date.getMilliseconds() //毫秒
};
if(/(y+)/.test(fmt)) {
fmt=fmt.replace(RegExp.$1, (date.getFullYear()+"").substr(4 - RegExp.$1.length));
var o = {
"M+": date.getMonth() + 1, //月份
"d+": date.getDate(), //日
"h+": date.getHours(), //小时
"m+": date.getMinutes(), //分
"s+": date.getSeconds(), //秒
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
"S": date.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
}
for(var k in o) {
if(new RegExp("("+ k +")").test(fmt)){
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
}
for (var k in o) {
if (new RegExp("(" + k + ")").test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
}
}
return fmt;
return fmt;
},
// 移除数组中指定值
removeByValue(arr, val) {
for(var i=0; i<arr.length; i++) {
if(arr[i] == val) {
arr.splice(i, 1);
break;
}
removeByValue (arr, val) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] == val) {
arr.splice(i, 1);
break;
}
}
},
// 传入文件后缀判断是否是视频
isVideo(ext) {
if (exts.video.includes(ext)) return true;
return false;
isVideo (ext) {
if (exts.video.includes(ext)) return true;
return false;
},
// 传入文件后缀判断是否是音频
isAudio(ext) {
if (exts.audio.includes(ext)) return true;
return false;
isAudio (ext) {
if (exts.audio.includes(ext)) return true;
return false;
},
// 传入文件后缀判断是否是图片
isImg(ext) {
if (exts.img.includes(ext)) return true;
return false;
isImg (ext) {
if (exts.img.includes(ext)) return true;
return false;
},
// 传入文件后缀判断是否是pdf以外的文档
isDoc(ext) {
if (exts.doc.includes(ext)) return true;
return false;
isDoc (ext) {
if (exts.doc.includes(ext)) return true;
return false;
},
// 传入文件后缀判断是否是压缩包
isCompress(ext) {
if (exts.compress.includes(ext)) return true;
return false;
isCompress (ext) {
if (exts.compress.includes(ext)) return true;
return false;
},
// 判断是否能够预览
canPreview(ext) {
canPreview (ext) {
if (!util.isVideo(ext) && !util.isAudio(ext) && !util.isImg(ext) && !util.isDoc(ext)) return false
return true
},
// 循环去除html标签
removeHtmlTag(list,attr) {
removeHtmlTag (list, attr) {
list.map(n => {
n[attr] = n[attr].replace(/<\/?.+?>/gi,'')
n[attr] = n[attr].replace(/<\/?.+?>/gi, '')
})
return list
},
// 传入文件名获取文件后缀
getFileExt(fileName) {
getFileExt (fileName) {
return fileName.substring(fileName.lastIndexOf('.') + 1)
},
// 传入文件名和路径,下载图片视频,支持跨域,a标签加download不支持跨域
downloadFile(fileName, url) {
downloadFile (fileName, url) {
var x = new XMLHttpRequest()
x.open("GET", url, true)
x.responseType = 'blob'
x.onload=function(e) {
var url = window.URL.createObjectURL(x.response)
var a = document.createElement('a')
a.href = url
a.download = fileName
a.click()
x.onload = function (e) {
var url = window.URL.createObjectURL(x.response)
var a = document.createElement('a')
a.href = url
a.download = fileName
a.click()
}
x.send()
},
// 传入文件名和数据,下载文件
downloadFileDirect(fileName,data) {
downloadFileDirect (fileName, data) {
if ('download' in document.createElement('a')) { // 非IE下载
const elink = document.createElement('a')
elink.download = fileName
@ -138,26 +141,74 @@ const util = {
}
},
// 成功提示
successMsg(message,duration = 1500) {
return Message.success({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration})
successMsg (message, duration = 1500) {
return Message.success({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration })
},
// 警告提示
warningMsg(message,duration = 1500) {
return Message.warning({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration})
warningMsg (message, duration = 1500) {
return Message.warning({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration })
},
// 错误提示
errorMsg(message,duration = 1500) {
return Message.error({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration})
errorMsg (message, duration = 1500) {
return Message.error({ message, showClose: true, offset: (document.documentElement.clientHeight - 40) / 2, duration })
},
// 判断是否是移动端
isMobile() {
if(window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) return true
isMobile () {
if (window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) return true
return false
},
// 前置加0
preZero(num) {
preZero (num) {
return num > 9 ? num : `0${num}`
},
// 获取当前时间
getNow () {
return new Promise(async (resolve, reject) => {
const { data } = await axios.get(Setting.apiBaseURL + api.getCurrentTime, {
headers: {
token: sessionStorage.getItem('token')
}
})
resolve(new Date(data.currentTime))
})
},
// 阿拉伯数字转化为中文数字
arabicToChinese (num) {
const arr1 = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
const arr2 = ['', '十', '百', '千', '万', '亿', '点', ''];
const a = `${num}`.replace(/(^0*)/g, '').split('.');
let k = 0;
let re = '';
for (let i = a[0].length - 1; i >= 0; i--) {
switch (k) {
case 0:
re = arr2[7] + re;
break;
case 4:
if (!new RegExp(`0{4}//d{${a[0].length - i - 1}}$`).test(a[0])) re = arr2[4] + re;
break;
case 8:
re = arr2[5] + re;
arr2[7] = arr2[5];
k = 0;
break;
default:
}
if (k % 4 == 2 && a[0].charAt(i + 2) != 0 && a[0].charAt(i + 1) == 0) re = arr1[0] + re;
if (a[0].charAt(i) != 0) re = arr1[a[0].charAt(i)] + arr2[k % 4] + re;
k++;
}
return num > 9 && num < 20 ? re.slice(1) : re;
},
// 阿拉伯数字转化为英文字母
numToLetter (num) {
let result = ''
if (num > 26) {
result += numberToLetter((num / 26) >> 0 - 1)
}
result += String.fromCharCode(65 + (num % 26))
return result
},
}
export default util

@ -4,293 +4,279 @@ import Router from 'vue-router';
Vue.use(Router);
let router = new Router({
mode: 'hash',
base: process.env.BASE_URL,
routes: [
{
path: '/',
redirect: '/login'
},
{
path: '/',
component: () => import('../views/Home.vue'),
meta: { title: '自述文件' },
children: [
{
path: '/customer',
component: () => import( '../views/customer/customer.vue'),
// meta: { title: '客户管理' }
},
{
path: '/addcustomer',
component: () => import( '../views/customer/AddCustomer.vue'),
// meta: { title: '新增客户' }
},
{
path: '/bmOrder',
component: () => import( '../views/customer/Order.vue'),
// meta: { title: '新增客户' }
},
{
path: '/user',
component: () => import( '../views/user/User.vue'),
// meta: { title: '用户管理' }
},
{
path: '/adduser',
component: () => import( '../views/user/AddUser.vue'),
// meta: { title: '新增用户' }
},
{
path: '/info',
component: () => import( '../views/user/Info.vue'),
// meta: { title: '新增用户' }
},
{
path: '/order',
component: () => import( '../views/order/Order.vue'),
// meta: { title: '订单管理' }
},
{
path: '/addorder',
component: () => import( '../views/order/AddOrder.vue'),
// meta: { title: '新增订单' }
},
{
path: '/selectClient',
component: () => import( '../views/order/selectClient.vue'),
// meta: { title: '选择订单客户' }
},
mode: 'hash',
base: process.env.BASE_URL,
routes: [
{
path: '/',
redirect: '/login'
},
{
path: '/',
component: () => import('../views/Home.vue'),
meta: { title: '自述文件' },
children: [
{
path: '/customer',
component: () => import('../views/customer/customer.vue'),
},
{
path: '/addcustomer',
component: () => import('../views/customer/AddCustomer.vue'),
},
{
path: '/bmOrder',
component: () => import('../views/customer/Order.vue'),
},
{
path: '/user',
component: () => import('../views/user/User.vue'),
},
{
path: '/adduser',
component: () => import('../views/user/AddUser.vue'),
},
{
path: '/info',
component: () => import('../views/user/Info.vue'),
},
{
path: '/order',
component: () => import('../views/order/Order.vue'),
},
{
path: '/addorder',
component: () => import('../views/order/AddOrder.vue'),
},
{
path: '/selectClient',
component: () => import('../views/order/selectClient.vue'),
},
{
path: '/configure',
component: () => import( '../views/serve/Configure.vue'),
// meta: { title: '服务配置' }
},
{
path: '/backstage',
component: () => import( '../views/serve/backstage'),
// meta: { title: '服务配置' }
},
{
path: '/addModel',
component: () => import( '../views/serve/addModel'),
// meta: { title: '服务配置' }
},
{
path: '/addconfigure',
component: () => import( '../views/serve/AddConfigure.vue'),
// meta: { title: '新增配置' }
},
{
path: '/projectList',
component: () => import( '../views/serve/projectList.vue'),
// meta: { title: '项目管理' }
},
{
path: '/projectAdd',
component: () => import( '../views/serve/projectAdd.vue'),
// meta: { title: '项目配置' }
},
{
path: '/curriculum',
component: () => import( '../views/course/Curriculum.vue'),
// meta: { title: '课程管理' }
},
{
path: '/addcurriculum',
component: () => import( '../views/course/AddCurriculum.vue'),
// meta: { title: '新建课程' }
},
{
path: '/contentSettings',
component: () => import( '../views/course/contentSettings.vue'),
// meta: { title: '内容设置' }
},
{
path: '/addlink',
component: () => import( '../views/course/AddLink.vue'),
// meta: { title: '添加环节' }
},
{
path: '/data',
component: () => import( '../views/data/Data.vue'),
// meta: { title: '数据管理' }
},
{
path: '/match',
component: () => import( '../views/match/list'),
// meta: { title: '数据管理' }
},
{
path: '/addMatch',
component: () => import( '../views/match/add'),
// meta: { title: '数据管理' }
},
{
path: '/matchManage',
component: () => import( '../views/match/manage'),
// meta: { title: '数据管理' }
},
{
path: '/noticeDetail',
component: () => import( '../views/match/manage/noticeDetail'),
// meta: { title: '数据管理' }
},
{
path: '/matchArchList',
component: () => import( '../views/match/manage/matchArchList'),
// meta: { title: '数据管理' }
},
{
path: '/matchRank',
component: () => import( '../views/match/manage/matchRank'),
// meta: { title: '数据管理' }
},
{
path: '/matchReport',
component: () => import( '../views/match/manage/matchReport'),
// meta: { title: '数据管理' }
},
{
path: '/matchInfo',
component: () => import( '../views/match/manage/matchInfo'),
// meta: { title: '数据管理' }
},
{
path: `/theoreticalCourse`,
component: () => import("../views//theoreticalCourse/list"),
meta: { title: "理论课程" }
},
{
path: `/addTheoreticalCourse`,
component: () => import("../views//theoreticalCourse/add"),
meta: { title: "理论课程详情" }
},
{
path: `/previewTheoreticalCourse`,
component: () => import("../views//theoreticalCourse/preview"),
meta: { title: "理论课程预览" }
},
{
path: `/setTheoreticalCourse`,
component: () => import("../views//theoreticalCourse/contentSettings"),
meta: { title: "理论课程内容设置" }
},
{
path: `/information`,
component: () => import("../views//information/list"),
meta: { title: "资讯管理" }
},
{
path: `/addArticle`,
component: () => import("../views//information/addArticle"),
meta: { title: "新增文章" }
},
{
path: '/system',
component: () => import( '../views/system'),
// meta: { title: '数据管理' }
},
{
path: '/manageLog',
component: () => import( '../views/system/manageLog'),
// meta: { title: '数据管理' }
},
{
path: '/addLog',
component: () => import( '../views/system/addLog'),
// meta: { title: '数据管理' }
},
{
path: '/permission',
component: () => import('../views/customer/Permission.vue'),
// meta: { title: '应用权限', permission: true }
},
{
path: '/person',
component: () => import('../views/setting'),
// meta: { title: '个人中心' }
},
{
path: '/parner',
component: () => import('../views/parner'),
// meta: { title: '个人中心' }
},
{
path: '/parnerOperation',
component: () => import('../views/parnerOperation'),
},
{
path: '/learnMg',
component: () => import('../views/parnerOperation/learnMg'),
},
{
path: '/schemeSet',
component: () => import('../views/parnerOperation/schemeSet'),
},
{
path: '/shop',
component: () => import('../views/shop/list'),
},
{
path: '/shop/addProduct',
component: () => import('../views/shop/addProduct'),
},
{
path: '/404',
component: () => import('../views/404.vue'),
// meta: { title: '404' }
},
{
path: '/403',
component: () => import('../views/403.vue'),
// meta: { title: '403' }
}
]
},
{
path: '/login',
component: () => import('../views/Login.vue'),
meta: { title: '登录' }
},
{
path: '/devLogin',
component: () => import('../views/devLogin.vue'),
meta: { title: '开发者登录' }
},
{
path: '/join',
component: () => import('../views/join'),
meta: { title: '城市合伙人运营管理平台' }
},
{
path: '/matchPreview',
component: () => import( '../views/match/preview'),
// meta: { title: '数据管理' }
},
{
path: '/success',
component: () => import('../views/join/success'),
meta: { title: '城市合伙人运营管理平台' }
},
{
path: '*',
redirect: '/404'
{
path: '/configure',
component: () => import('../views/serve/Configure.vue'),
},
{
path: '/backstage',
component: () => import('../views/serve/backstage'),
},
{
path: '/addModel',
component: () => import('../views/serve/addModel'),
},
{
path: '/addconfigure',
component: () => import('../views/serve/AddConfigure.vue'),
},
{
path: '/projectList',
component: () => import('../views/serve/projectList.vue'),
},
{
path: '/projectAdd',
component: () => import('../views/serve/projectAdd.vue'),
},
{
path: '/curriculum',
component: () => import('../views/course/Curriculum.vue'),
},
{
path: '/addcurriculum',
component: () => import('../views/course/AddCurriculum.vue'),
},
{
path: '/contentSettings',
component: () => import('../views/course/contentSettings.vue'),
},
{
path: '/addlink',
component: () => import('../views/course/AddLink.vue'),
},
{
path: '/data',
component: () => import('../views/data/Data.vue'),
},
{
path: '/match',
component: () => import('../views/match/list'),
},
{
path: '/addMatch',
component: () => import('../views/match/add'),
},
{
path: '/matchManage',
component: () => import('../views/match/manage'),
},
{
path: '/noticeDetail',
component: () => import('../views/match/manage/noticeDetail'),
},
{
path: '/otherArchList',
component: () => import('../views/match/manage/otherArchList'),
},
{
path: '/matchRank',
component: () => import('../views/match/manage/matchRank'),
},
{
path: '/trialReport',
component: () => import('../views/match/manage/trialReport'),
},
{
path: '/matchArchList',
component: () => import('../views/match/manage/matchArchList'),
},
{
path: '/theoryReport',
component: () => import('../views/match/manage/theoryReport'),
},
{
path: '/matchInfo',
component: () => import('../views/match/manage/matchInfo'),
},
{
path: `/theoreticalCourse`,
component: () => import("../views//theoreticalCourse/list"),
meta: { title: "理论课程" }
},
{
path: `/addTheoreticalCourse`,
component: () => import("../views//theoreticalCourse/add"),
meta: { title: "理论课程详情" }
},
{
path: `/previewTheoreticalCourse`,
component: () => import("../views//theoreticalCourse/preview"),
meta: { title: "理论课程预览" }
},
{
path: `/setTheoreticalCourse`,
component: () => import("../views//theoreticalCourse/contentSettings"),
meta: { title: "理论课程内容设置" }
},
{
path: `/information`,
component: () => import("../views//information/list"),
meta: { title: "资讯管理" }
},
{
path: `/addArticle`,
component: () => import("../views//information/addArticle"),
meta: { title: "新增文章" }
},
{
path: '/system',
component: () => import('../views/system'),
},
{
path: '/manageLog',
component: () => import('../views/system/manageLog'),
},
{
path: '/addLog',
component: () => import('../views/system/addLog'),
},
{
path: '/permission',
component: () => import('../views/customer/Permission.vue'),
},
{
path: '/person',
component: () => import('../views/setting'),
},
{
path: '/parner',
component: () => import('../views/parner'),
},
{
path: '/parnerOperation',
component: () => import('../views/parnerOperation'),
},
{
path: '/learnMg',
component: () => import('../views/parnerOperation/learnMg'),
},
{
path: '/schemeSet',
component: () => import('../views/parnerOperation/schemeSet'),
},
{
path: '/shop',
component: () => import('../views/shop/list'),
},
{
path: '/shop/addProduct',
component: () => import('../views/shop/addProduct'),
},
{
path: '/theoryExam/list',
component: () => import('../views/theoryExam/list/index'),
},
{
path: '/theoryExam',
component: () => import('../views/theoryExam'),
},
{
path: '/review',
component: () => import('../views/review'),
},
{
path: '/404',
component: () => import('../views/404.vue'),
// meta: { title: '404' }
},
{
path: '/403',
component: () => import('../views/403.vue'),
// meta: { title: '403' }
}
]
]
},
{
path: '/login',
component: () => import('../views/Login.vue'),
meta: { title: '登录' }
},
{
path: '/devLogin',
component: () => import('../views/devLogin.vue'),
meta: { title: '开发者登录' }
},
{
path: '/join',
component: () => import('../views/join'),
meta: { title: '城市合伙人运营管理平台' }
},
{
path: '/matchPreview',
component: () => import('../views/match/preview'),
// meta: { title: '数据管理' }
},
{
path: '/success',
component: () => import('../views/join/success'),
meta: { title: '城市合伙人运营管理平台' }
},
{
path: '*',
redirect: '/404'
}
]
});
router.beforeEach(function(to, from, next) {
// 根据路由元信息设置文档标题
window.document.title = to.meta.title || '中台';
//使用钩子函数对路由进行权限跳转
const login = location.href.includes('dev.huorantech.cn') ? '/devLogin' : '/login'
if (!sessionStorage.getItem('token') && to.path !== login && to.path !== '/join' && to.path !== '/success') {
next(login);
} else {
next();
}
router.beforeEach(function (to, from, next) {
// 根据路由元信息设置文档标题
window.document.title = to.meta.title || '中台';
//使用钩子函数对路由进行权限跳转
const login = location.href.includes('dev.huorantech.cn') ? '/devLogin' : '/login'
if (!sessionStorage.getItem('token') && to.path !== login && to.path !== '/join' && to.path !== '/success') {
next(login);
} else {
next();
}
});
export default router;

@ -5,57 +5,57 @@ const url = location.host;
const isDev = process.env.NODE_ENV === 'development' // 开发环境
const isPro = url.includes('huorantech.cn') //正式服
let jumpPath = `${location.origin}/judgmentPoint/`
let jumpPath = `${location.origin}/panfen/`
let sandPath = `http://121.37.12.51/sandbox` // 沙盘地址
let host = `${location.origin}/`
if (isDev) {
console.log("🚀 ~ localStorage.getItem('nakadaiIp'):",localStorage.getItem('nakadaiIp'))
jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统
// jumpPath = 'https://judgment.huorantech.cn/'
sandPath = `http://${location.hostname}:9520`
sandPath = `http://${location.hostname}:9520`
host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/'
host = localStorage.getItem('nakadaiIp') == 1 ? 'http://192.168.31.51:9000/' : 'http://192.168.31.217:9000/'
const ips = ['http://192.168.31.217:9000/', 'http://192.168.31.51:9000/', 'http://121.37.12.51/']
host = ips[+localStorage.getItem('ip')]
} else if (isPro) {
sandPath = `https://izhixinyun.com/sandbox`
jumpPath = 'https://judgment.huorantech.cn/'
sandPath = `https://izhixinyun.com/sandbox`
// jumpPath = 'https://judgment.huorantech.cn/'
}
const Setting = {
/**
* 基础配置
* */
platformId: 3, // 平台标识,1职站,2数据平台,3中台,4合伙人
platformSource: 0, // 平台来源(0中台,1职站)
autoLogoutTime: 1000 * 60 * 60 * 3, // 长时间未操作,自动退出登录时间
jumpPath, // 判分点系统跳转路径前缀
sandPath, // 沙盘地址
apiBaseURL: host, // 请求路径前缀
uploadURL: isDev ? 'http://121.37.12.51/' : location.origin + '/', // 阿里云oss域名
// 平台列表
platformList: [
{
id: 1,
name: '职站'
},
{
id: 2,
name: '数据平台'
},
{
id: 3,
name: '中台'
}
],
isDev,
isPro,
// 是否使用动态路由
dynamicRoute: true,
/**
* @description 默认密码
*/
initialPassword: '1122aa',
/**
* 基础配置
* */
platformId: 3, // 平台标识,1职站,2数据平台,3中台,4合伙人
platformSource: 0, // 平台来源(0中台,1职站)
autoLogoutTime: 1000 * 60 * 60 * 3, // 长时间未操作,自动退出登录时间
jumpPath, // 判分点系统跳转路径前缀
sandPath, // 沙盘地址
apiBaseURL: host, // 请求路径前缀
uploadURL: isDev ? 'http://121.37.12.51/' : location.origin + '/', // 阿里云oss域名
// 平台列表
platformList: [
{
id: 1,
name: '职站'
},
{
id: 2,
name: '数据平台'
},
{
id: 3,
name: '中台'
}
],
isDev,
isPro,
// 是否使用动态路由
dynamicRoute: true,
/**
* @description 默认密码
*/
initialPassword: '1122aa',
};
export default Setting;

File diff suppressed because it is too large Load Diff

@ -3,12 +3,12 @@ import { Loading } from 'element-ui'
export default {
//skin:'oxide-dark',
language:'zh_CN',
language: 'zh_CN',
language_url: './styles/tinymce/langs/zh_CN.js',
plugins: 'print powerpaste preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template advcode codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave autoresize formatpainter',
toolbar: 'code undo redo restoredraft | cut copy powerpaste pastetext | forecolor backcolor headings fontsize lineHeight bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify | \
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autoresize',
toolbar: 'code undo redo restoredraft | cut copy pastetext | forecolor backcolor headings fontsize lineHeight bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify | \
styleselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \
table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | indent2em formatpainter',
table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | indent2em',
style_formats: [
//新增 首行缩进与行高 配置
{
@ -21,40 +21,40 @@ export default {
{
title: '行高',
items: [{
title: '1',
styles: {
'line-height': '1'
},
inline: 'span'
title: '1',
styles: {
'line-height': '1'
},
{
title: '1.5',
styles: {
'line-height': '1.5'
},
inline: 'span'
inline: 'span'
},
{
title: '1.5',
styles: {
'line-height': '1.5'
},
{
title: '2',
styles: {
'line-height': '2'
},
inline: 'span'
inline: 'span'
},
{
title: '2',
styles: {
'line-height': '2'
},
{
title: '2.5',
styles: {
'line-height': '2.5'
},
inline: 'span'
inline: 'span'
},
{
title: '2.5',
styles: {
'line-height': '2.5'
},
{
title: '3',
styles: {
'line-height': '3'
},
inline: 'span'
}
inline: 'span'
},
{
title: '3',
styles: {
'line-height': '3'
},
inline: 'span'
}
]
},
//默认的配置
@ -187,16 +187,16 @@ export default {
fontsize_formats: '12px 14px 16px 19px 24px 36px 48px 56px 72px',
font_formats: '苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats;知乎配置=BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;小米配置=Helvetica Neue,Helvetica,Arial,Microsoft Yahei,Hiragino Sans GB,Heiti SC,WenQuanYi Micro Hei,sans-serif',
link_list: [
{ title: '预置链接1', value: 'http://www.tinymce.com' },
{ title: '预置链接2', value: 'http://tinymce.ax-z.cn' }
{ title: '预置链接1', value: 'http://www.tinymce.com' },
{ title: '预置链接2', value: 'http://tinymce.ax-z.cn' }
],
image_list: [
{ title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' },
{ title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' }
{ title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' },
{ title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' }
],
image_class_list: [
{ title: 'None', value: '' },
{ title: 'Some class', value: 'class-name' }
{ title: 'None', value: '' },
{ title: 'Some class', value: 'class-name' }
],
//为内容模板插件提供预置模板
templates: [],
@ -206,7 +206,7 @@ export default {
// template_cdate_format: '[CDATE: %m/%d/%Y : %H:%M:%S]',
// template_mdate_format: '[MDATE: %m/%d/%Y : %H:%M:%S]',
// autosave_ask_before_unload: false,
toolbar_mode : 'wrap',
toolbar_mode: 'wrap',
// automatic_uploads: true,
// images_upload_base_path: '/demo',
// images_upload_url: 'http://10.10.11.7:10000/iasf/sysFiles/upload',
@ -214,25 +214,25 @@ export default {
powerpaste_allow_local_images: true,
powerpaste_word_import: 'clean',
powerpaste_html_import: 'clean',
urlconverter_callback: (url, node, onSave, name) => {
if (node === 'img' && url.startsWith('blob:')) {
// Do some custom URL conversion
tinymce.activeEditor && tinymce.activeEditor.uploadImages()
}
// Return new URL
return url
},
urlconverter_callback: (url, node, onSave, name) => {
if (node === 'img' && url.startsWith('blob:')) {
// Do some custom URL conversion
tinymce.activeEditor && tinymce.activeEditor.uploadImages()
}
// Return new URL
return url
},
// 自定义上传
images_upload_handler: function (blobInfo, succFun, failFun) {
const blob = blobInfo.blob()
// blob转换为file
const file = new File([blob], blobInfo.filename(), {
type: 'application/json',
lastModified: Date.now()
});
Oss.upload(file).then(res => {
succFun(res.url)
})
const blob = blobInfo.blob()
// blob转换为file
const file = new File([blob], blobInfo.filename(), {
type: 'application/json',
lastModified: Date.now()
});
Oss.upload(file).then(res => {
succFun(res.url)
})
},
//自定义文件选择器的回调内容 此方法只有在点击上方图片按钮才会触发
file_picker_callback: function (callback, value, meta) {
@ -248,23 +248,23 @@ export default {
let input = document.createElement('input');//创建一个隐藏的input
input.setAttribute('type', 'file');
input.setAttribute("accept", ".mp4");
input.onchange = function(){
input.onchange = function () {
let file = this.files[0];
const load = Loading.service()
Oss.upload(file).then(res => {
load.close()
callback(res.url)
}).catch(e => {
load.close()
})
Oss.upload(file).then(res => {
load.close()
callback(res.url)
}).catch(e => {
load.close()
})
}
//触发点击
input.click();
}
},
// 初始化事件
setup: function(editor) {
editor.on('init', function(ed) {
setup: function (editor) {
editor.on('init', function (ed) {
// 设置默认字体
ed.target.editorCommands.execCommand("fontName", false, "PingFang SC")
ed.target.editorCommands.execCommand("fontSize", false, "16px")

@ -13,162 +13,182 @@ axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8';
// 请求拦截器
axios.interceptors.request.use(config => {
let token = sessionStorage.getItem('token')
if(token){
config.headers.token = token
}
let schoolId = store.state.schoolId
if(schoolId) config.headers.schoolId = store.state.schoolId
return config;
let token = sessionStorage.getItem('token')
if (token) {
config.headers.token = token
}
let schoolId = store.state.schoolId
if (schoolId) config.headers.schoolId = store.state.schoolId
return config;
}, err => {
Message.error({
message: '退出登陆',
onClose: function () {
router.push({name: 'login'});
}
})
return Promise.reject(err);
Message.error({
message: '退出登陆',
onClose: function () {
router.push({ name: 'login' });
}
})
return Promise.reject(err);
})
let logouted = 0;
// 响应拦截器
axios.interceptors.response.use(
response => {
if (response.status === 200) {
const { status } = response.data
if (status) {
// 接口定义的非正常返回的时候,应当处于报错状态
if (status === 10020) {
// 该状态为用户列表启用用户的接口返回的状态,特殊处理
return Promise.reject(response)
} else if (status !== 200) {
Message.error(response.data.message)
return Promise.reject(response)
} else {
return Promise.resolve(response)
}
} else {
return Promise.resolve(response)
}
response => {
if (response.status === 200) {
const { status, code, msg } = response.data
if (status) {
// 接口定义的非正常返回的时候,应当处于报错状态
if (status === 10020) {
// 该状态为用户列表启用用户的接口返回的状态,特殊处理
return Promise.reject(response)
} else if (status !== 200) {
Message.error(response.data.message)
return Promise.reject(response)
} else {
Message.error(response.message,'res');
return Promise.reject(response);
return Promise.resolve(response)
}
},
// 服务器状态码不是200的情况
error => {
if (error.response.status) {
switch (error.response.status) {
// 401: 未登录
// 未登录则跳转登录页面,并携带当前页面的路径
// 在登录成功后返回当前页面,这一步需要在登录页操作。
case 401:
Message.error('登录过期,请重新登录!');
setTimeout(() => {
router.replace({
path: '/login',
query: {
redirect: router.currentRoute.fullPath
}
});
}, 1000);
break;
// 403 token过期
// 登录过期对用户进行提示
// 清除本地token和清空vuex中token对象
// 跳转登录页面
case 403:
// 清除token
sessionStorage.removeItem('token');
store.commit('loginSuccess', null);
// 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
setTimeout(() => {
router.replace({
path: '/login',
query: {
redirect: router.currentRoute.fullPath
}
});
}, 1000);
break;
// 404请求不存在
case 404:
Message.error('404网络请求不存在!');
break;
case 500:// 网络错误
Message.error('网络错误!');
// router.replace({
// path: '/login',
// query: { redirect: router.currentRoute.fullPath }
// });
break;
// 其他错误,直接抛出错误提示
default:
Message.error(error.response.data.message);
break;
}
return Promise.reject(error.response);
} else if (code === 401) {
// 账号互踢
if (!logouted) {
sessionStorage.removeItem('token')
Message.error(msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!')
setTimeout(() => {
router.replace({
path: '/login',
query: {
redirect: router.currentRoute.fullPath
}
})
logouted = 0
}, 1500)
logouted = 1
}
} else {
return Promise.resolve(response)
}
} else {
Message.error(response.message, 'res');
return Promise.reject(response);
}
},
// 服务器状态码不是200的情况
error => {
if (error.response.status) {
switch (error.response.status) {
// 401: 未登录
// 未登录则跳转登录页面,并携带当前页面的路径
// 在登录成功后返回当前页面,这一步需要在登录页操作。
case 401:
if (!logouted) {
Message.error('登录过期,请重新登录!');
setTimeout(() => {
router.replace({
path: '/login',
query: {
redirect: router.currentRoute.fullPath
}
});
}, 1000);
logouted = 1
}
break;
// 403 token过期
// 登录过期对用户进行提示
// 清除本地token和清空vuex中token对象
// 跳转登录页面
case 403:
// 清除token
sessionStorage.removeItem('token');
store.commit('loginSuccess', null);
// 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
setTimeout(() => {
router.replace({
path: '/login',
query: {
redirect: router.currentRoute.fullPath
}
});
}, 1000);
break;
// 404请求不存在
case 404:
Message.error('404网络请求不存在!');
break;
case 500:// 网络错误
Message.error('网络错误!');
// router.replace({
// path: '/login',
// query: { redirect: router.currentRoute.fullPath }
// });
break;
// 其他错误,直接抛出错误提示
default:
Message.error(error.response.data.message);
break;
}
return Promise.reject(error.response);
}
}
);
function logouts(){
store.replaceState({})
localStorage.clear()
sessionStorage.clear()
location.reload()
function logouts () {
store.replaceState({})
localStorage.clear()
sessionStorage.clear()
location.reload()
}
let tokenStatus = {
0: '用户未登录,请登录后操作!',
1: 'token错误,请重新登录!'
0: '用户未登录,请登录后操作!',
1: 'token错误,请重新登录!'
}
/**
* get方法对应get请求
*/
export function get(url, params){
return new Promise((resolve, reject) =>{
axios.get(url, {
params: params
})
.then(res => {
resolve(res.data)
})
.catch(err => {
reject(err.data)
})
});
export function get (url, params) {
return new Promise((resolve, reject) => {
axios.get(url, {
params: params
})
.then(res => {
resolve(res.data)
})
.catch(err => {
reject(err.data)
})
});
}
/**
* post方法对应post请求
*/
export function post(url, params, config) {
return new Promise((resolve, reject) => {
axios.post(url,params, config)
.then(res => {
return resolve(res.data);
})
.catch(err => {
return reject(err.data)
})
});
export function post (url, params, config) {
return new Promise((resolve, reject) => {
axios.post(url, params, config)
.then(res => {
return resolve(res.data);
})
.catch(err => {
return reject(err.data)
})
});
}
/**
* delete方法对应delete请求
*/
export function del(url, params){
return new Promise((resolve, reject) =>{
axios.delete(url, {
params: params
})
.then(res => {
resolve(res.data);
})
.catch(err => {
reject(err.data)
})
});
export function del (url, params) {
return new Promise((resolve, reject) => {
axios.delete(url, {
params: params
})
.then(res => {
resolve(res.data);
})
.catch(err => {
reject(err.data)
})
});
}
/**
@ -176,14 +196,14 @@ export function post(url, params, config) {
* @param {} url
* @param {*} params
*/
export function put(url, params){
return new Promise((resolve, reject) =>{
axios.put(url, params)
.then(res => {
resolve(res.data);
})
.catch(err => {
reject(err.data)
})
});
export function put (url, params) {
return new Promise((resolve, reject) => {
axios.put(url, params)
.then(res => {
resolve(res.data);
})
.catch(err => {
reject(err.data)
})
});
}

@ -1,45 +1,45 @@
const util = {
deepCopy(obj) { // 深拷贝
if (obj == null) {
return null;
}
if (typeof obj !== "object") return obj;
let result;
if (Array.isArray(obj)) {
result = [];
obj.forEach(item => {
result.push(
typeof item === "object" && !(item instanceof Date)
? util.deepCopy(item)
: item
);
});
} else {
result = {};
Object.keys(obj).forEach(key => {
result[key] =
typeof obj[key] === "object" && !(obj[key] instanceof Date)
? util.deepCopy(obj[key])
: obj[key];
});
}
return result;
},
// 传入文件名和数据,下载文件
downloadFileDirect(fileName,data) {
if ('download' in document.createElement('a')) { // 非IE下载
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(data)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
} else { // IE10+下载
navigator.msSaveBlob(data, fileName)
}
},
deepCopy (obj) { // 深拷贝
if (obj == null) {
return null;
}
if (typeof obj !== "object") return obj;
let result;
if (Array.isArray(obj)) {
result = [];
obj.forEach(item => {
result.push(
typeof item === "object" && !(item instanceof Date)
? util.deepCopy(item)
: item
);
});
} else {
result = {};
Object.keys(obj).forEach(key => {
result[key] =
typeof obj[key] === "object" && !(obj[key] instanceof Date)
? util.deepCopy(obj[key])
: obj[key];
});
}
return result;
},
// 传入文件名和数据,下载文件
downloadFileDirect (fileName, data) {
if ('download' in document.createElement('a')) { // 非IE下载
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(data)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
} else { // IE10+下载
navigator.msSaveBlob(data, fileName)
}
},
};
export default util;

@ -4,8 +4,7 @@
<v-sidebar></v-sidebar>
<div class="content-box">
<div class="content">
<transition name="move"
mode="out-in">
<transition name="move" mode="out-in">
<!-- <keep-alive> -->
<router-view></router-view>
<!-- </keep-alive> -->
@ -32,7 +31,7 @@ export default {
vSidebar,
},
created () {
this.autoLogout()
// this.autoLogout()
},
methods: {
// ,退

@ -9,125 +9,93 @@
<div class="ms-login">
<div class="ms-title">
<!-- <p class="title">账号登录</p> -->
<el-menu :default-active="activeIndex"
class="el-menu-demo"
mode="horizontal"
@select="handleSelect">
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
<el-menu-item index="1">账号登录</el-menu-item>
<el-menu-item index="2">手机号/邮箱登录</el-menu-item>
</el-menu>
<el-form v-show="activeIndex==='1'"
:model="param"
:rules="rules"
ref="login"
label-width="0px"
style="margin-top: 20px">
<el-form v-show="activeIndex === '1'" :model="param" :rules="rules" ref="login" label-width="0px"
style="margin-top: 20px">
<el-form-item prop="account">
<el-input @blur="blur"
v-model="param.account"
placeholder="请输入账号"></el-input>
<el-input @blur="blur" v-model="param.account" placeholder="请输入账号"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input type="password"
placeholder="请输入密码"
v-model="param.password">
<el-input type="password" placeholder="请输入密码" v-model="param.password">
</el-input>
</el-form-item>
<el-form-item prop="code"
v-if="showVerify">
<el-input placeholder="请输入验证码"
v-model="param.code"
@keyup.enter.native="submitForm()">
<el-form-item prop="code" v-if="showVerify">
<el-input placeholder="请输入验证码" v-model="param.code" @keyup.enter.native="submitForm()">
</el-input>
<img @click="blur"
:src="verificationIMG"
class="verification"
alt="">
<img @click="blur" :src="verificationIMG" class="verification" alt="">
</el-form-item>
<div style="width:100%;display:flex;justify-content: flex-end;">
<el-button type="text"
class="forget">忘记密码?</el-button>
<el-button type="text" class="forget">忘记密码?</el-button>
</div>
<div class="login-btn">
<el-button type="primary"
@click="submitForm()">马上登录</el-button>
<el-button type="primary" @click="submitForm()">马上登录</el-button>
</div>
</el-form>
<el-form v-show="activeIndex==='2'"
:model="phoneOrEmail"
:rules="phoneOrEmailrules"
ref="phoneOrEmail"
label-width="0px"
style="margin-top: 20px">
<el-form v-show="activeIndex === '2'" :model="phoneOrEmail" :rules="phoneOrEmailrules" ref="phoneOrEmail"
label-width="0px" style="margin-top: 20px">
<el-form-item prop="account">
<el-input @blur="phoneBlur"
v-model="phoneOrEmail.account"
placeholder="请输入电话/邮箱"></el-input>
<el-input @blur="phoneBlur" v-model="phoneOrEmail.workNumber" placeholder="请输入电话/邮箱"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input type="password"
placeholder="请输入密码"
v-model="phoneOrEmail.password">
<el-input type="password" placeholder="请输入密码" v-model="phoneOrEmail.password">
</el-input>
</el-form-item>
<el-form-item prop="code"
v-if="showPhoneVerify">
<el-input placeholder="请输入验证码"
v-model="phoneOrEmail.code"
@keyup.enter.native="submitForm('phone')">
<el-form-item prop="code" v-if="showPhoneVerify">
<el-input placeholder="请输入验证码" v-model="phoneOrEmail.code" @keyup.enter.native="submitForm('phone')">
</el-input>
<img @click="phoneBlur"
:src="PhoneVerificationIMG"
class="verification"
alt="">
<img @click="phoneBlur" :src="PhoneVerificationIMG" class="verification" alt="">
</el-form-item>
<div style="width:100%;display:flex;justify-content: flex-end;">
<el-button type="text"
class="forget">忘记密码?</el-button>
<el-button type="text" class="forget">忘记密码?</el-button>
</div>
<div class="login-btn">
<el-button type="primary"
@click="submitForm('phone')">马上登录</el-button>
<el-button type="primary" @click="submitForm('phone')">马上登录</el-button>
</div>
</el-form>
</div>
</div>
<el-dialog title="绑定手机号"
:visible.sync="phoneVisible"
:close-on-click-modal="false"
width="576px">
<el-dialog title="绑定手机号" :visible.sync="phoneVisible" :close-on-click-modal="false" width="576px">
<p class="tips">依据国家政策法规需绑定手机号进行网络实名才可登录使用本平台</p>
<el-form ref="form"
label-width="60px">
<el-form ref="form" label-width="60px">
<el-form-item label="手机号">
<el-input placeholder="请输入手机号"
v-model="phone"
maxlength="11"></el-input>
<el-input placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>
</el-form-item>
<el-form-item label="验证码">
<div style="display:flex;">
<el-input v-model="phoneCode"
placeholder="请输入验证码"
maxlength="6"></el-input>
<el-button style="margin-left:10px"
@click="sendPhoneCode"
:disabled="phoneDisabled">{{phoneBtnText}}</el-button>
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input>
<el-button style="margin-left:10px" @click="sendPhoneCode" :disabled="phoneDisabled">{{ phoneBtnText
}}</el-button>
</div>
</el-form-item>
</el-form>
<span slot="footer"
class="dialog-footer">
<span slot="footer" class="dialog-footer">
<el-button @click="phoneVisible = false"> </el-button>
<el-button type="primary"
@click="phoneSubmit"> </el-button>
<el-button type="primary" @click="phoneSubmit"> </el-button>
</span>
</el-dialog>
<v-footer class="footer"
ref="footer"></v-footer>
<el-dialog title="请选择您要登录的用户" :visible.sync="userVisible" :close-on-click-modal="false" custom-class="user-dia"
width="500px">
<p class="tips">该手机号已绑定以下用户信息</p>
<ul class="users">
<li :class="{ isEnable: !user.isEnable }" v-for="(user, i) in users" :key="i" @click="chooseUser(user)">
<span>{{ user.schoolName }}{{ user.userName }}{{ user.workNumber }}{{
user.isEnable
? ''
: '(已禁用)' }}</span>
<i class="el-icon-right"></i>
</li>
</ul>
</el-dialog>
<v-footer class="footer" ref="footer"></v-footer>
</div>
</template>
@ -135,6 +103,8 @@
import vFooter from '../components/Footer'
import Setting from '@/setting'
import addRoutes from '@/libs/route/addRoutes'
import CryptoJS from 'crypto-js'
import JSEncrypt from 'jsencrypt'
export default {
data: function () {
var regPhoneOrEmail = (rule, value, callback) => {//
@ -162,7 +132,6 @@ export default {
platform: 3,
random: '',
distinguish: 1,
type: 2
},
rules: {
account: [{ required: true, message: '请输入账号', trigger: 'blur' }],
@ -174,16 +143,15 @@ export default {
showPhoneVerify: true,// -
PhoneVerificationIMG: '',//
phoneOrEmail: {
account: '',
workNumber: '',
password: '',
code: '',
platform: 3,
random: '',
distinguish: 2,
type: 2
distinguish: 1,
},
phoneOrEmailrules: {
account: [{ validator: regPhoneOrEmail, trigger: 'blur' }],
workNumber: [{ validator: regPhoneOrEmail, trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
code: [{ required: true, message: '请输入验证码', trigger: 'blur' }],
},
@ -194,8 +162,11 @@ export default {
phoneDisabled: false,
phoneBtnText: '发送验证码',
phoneTimer: '',
phoneOpener: ''
phoneOpener: '',
userVisible: false,
users: [],
};
},
components: {
@ -229,27 +200,29 @@ export default {
let param = val === 'phone' ? this.phoneOrEmail : this.param
this.$refs[ref].validate(valid => {
if (valid) {
this.$post(this.api.logins, param).then(res => {
const { message } = res
sessionStorage.setItem('token', res.data.token)
this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`).then(res => {
const list = res.permissionMenu
addRoutes(res.permissionMenu[0].children)
this.$store.commit('setDataPer', res.dataPermissionList)
this.$message.success(message);
this.$router.push({
path: list[0].children[0].path
});
localStorage.setItem('ms_username', this.param.username);
}).catch(err => {
if (err.status === 500) {
sessionStorage.clear()
this.$post(this.api.logins, param).then(({ status, data, message }) => {
localStorage.removeItem('examPath')
localStorage.removeItem('reviewPath')
this.getOss()
if (status == 200) {
const accounts = data.userAccounts
//
if (accounts instanceof Array) {
this.users = accounts
this.userVisible = true
} else {
sessionStorage.setItem('token', data.token)
this.setLogin()
}
})
} else {
param.code = ''
this.$message.error(message)
}
}).catch(err => {
if (err.status === 30001) {
this.phoneVisible = true
} else if (err.status == 10004) {
} else if (err.status == 10004 || err.status == 10005) {
param.code = ''
this.blur()
}
});
@ -258,7 +231,54 @@ export default {
return false;
}
});
},
// oss
async getOss () {
const A = (key, encryptedData) => {
const keyHex = CryptoJS.enc.Base64.parse(key)
const decrypted = CryptoJS.AES.decrypt(encryptedData, keyHex, {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
})
return decrypted.toString(CryptoJS.enc.Utf8)
}
const R = (encryptedKey, privateKey) => {
const decrypt = new JSEncrypt()
decrypt.setPrivateKey(privateKey)
const decryptedKey = decrypt.decrypt(encryptedKey)
return decryptedKey
}
const res = await this.$get(this.api.encrypt)
const RE = A(R(res.encryptedKey, res.privateKey), res.encryptedData).split('/')
localStorage.setItem('osc', JSON.stringify(RE))
},
//
chooseUser (user) {
user.isEnable && this.$post(`${this.api.getToken}?id=${user.id}`).then(({ data }) => {
sessionStorage.setItem('token', data.token)
this.token = data.token
this.setLogin()
}).catch(res => { })
},
//
async setLogin () {
try {
const res = await this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`)
const list = res.permissionMenu
addRoutes(res.permissionMenu[0].children)
this.$store.commit('setDataPer', res.dataPermissionList)
this.$message.success('登录成功!')
this.$router.push({
path: list[0].children[0].path
});
localStorage.setItem('ms_username', this.param.username);
} catch (e) {
if (e.status === 500) {
sessionStorage.clear()
}
}
},
blur () {
this.param.random = Math.floor(Math.random() * 999999999)
@ -343,143 +363,206 @@ export default {
<style scoped lang="scss">
.login-wrap {
position: relative;
width: 100%;
background-image: url(../assets/img/login-bg.png);
background-size: 100%;
position: relative;
width: 100%;
background-image: url(../assets/img/login-bg.png);
background-size: 100%;
}
.ms-title {
width: 548px;
position: absolute;
left: 50%;
top: 30px;
transform: translate(-50%, 0);
width: 548px;
position: absolute;
left: 50%;
top: 30px;
transform: translate(-50%, 0);
}
/deep/ .ms-login {
position: relative;
width: 1200px;
height: calc(92vh - 40px);
margin: 60px auto 0;
background-image: url(../assets/img/login-input.png);
box-shadow: 0px 0px 79px 0px rgba(11, 15, 65, 0.36);
background-repeat: no-repeat;
overflow: hidden;
.el-input__inner {
height: 80px;
line-height: 80px;
border: 1px solid rgba(220, 220, 220, 1);
border-radius: 2px;
}
.verification {
position: absolute;
top: 1px;
right: 1px;
width: 160px;
height: 78px;
cursor: pointer;
}
position: relative;
width: 1200px;
height: calc(92vh - 40px);
margin: 60px auto 0;
background-image: url(../assets/img/login-input.png);
box-shadow: 0px 0px 79px 0px rgba(11, 15, 65, 0.36);
background-repeat: no-repeat;
overflow: hidden;
.el-input__inner {
height: 80px;
line-height: 80px;
border: 1px solid rgba(220, 220, 220, 1);
border-radius: 2px;
}
.verification {
position: absolute;
top: 1px;
right: 1px;
width: 160px;
height: 78px;
cursor: pointer;
}
}
.title {
font-size: 16px;
text-align: center;
font-weight: bold;
font-size: 16px;
text-align: center;
font-weight: bold;
}
.login-btn {
text-align: center;
text-align: center;
}
.login-btn button {
width: 100%;
height: 88px;
margin-bottom: 50px;
font-weight: bold;
background: linear-gradient(90deg, rgba(94, 206, 253, 1), rgba(91, 67, 231, 1));
box-shadow: 0px 7px 27px 0px rgba(50, 129, 255, 0.51);
border-radius: 10px;
width: 100%;
height: 88px;
margin-bottom: 50px;
font-weight: bold;
background: linear-gradient(90deg, rgba(94, 206, 253, 1), rgba(91, 67, 231, 1));
box-shadow: 0px 7px 27px 0px rgba(50, 129, 255, 0.51);
border-radius: 10px;
}
.login-tips {
text-align: center;
color: #999;
font-weight: bold;
text-align: center;
color: #999;
font-weight: bold;
}
.forget {
margin-bottom: 28px;
text-align: right;
color: #999;
font-weight: bold;
&:hover {
color: #0092ff;
}
margin-bottom: 28px;
text-align: right;
color: #999;
font-weight: bold;
&:hover {
color: #0092ff;
}
}
.thirdParty {
width: 100%;
display: flex;
justify-content: center;
margin-top: 33px;
width: 100%;
display: flex;
justify-content: center;
margin-top: 33px;
}
/* 头部 */
.header {
height: 60px;
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 18px;
height: 60px;
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 18px;
}
.logo {
width: 171px;
height: 40px;
margin-left: 20px;
width: 171px;
height: 40px;
margin-left: 20px;
}
img {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
.header_title {
width: 33%;
display: flex;
justify-content: space-between;
align-items: center;
width: 33%;
display: flex;
justify-content: space-between;
align-items: center;
}
.header_title a {
cursor: pointer;
cursor: pointer;
}
.header_title a:hover {
color: blueviolet;
color: blueviolet;
}
.nul {
width: 80px;
margin-right: 30px;
width: 80px;
margin-right: 30px;
}
.el-menu-demo {
display: flex;
justify-content: space-between;
border-bottom: 0;
background-color: transparent;
display: flex;
justify-content: space-between;
border-bottom: 0;
background-color: transparent;
}
.tips {
margin: -20px 0 20px 5px;
font-size: 14px;
margin: -20px 0 20px 5px;
font-size: 14px;
text-align: center;
color: #666;
}
/deep/.user-dia {
.tips {
margin-bottom: 20px;
text-align: center;
color: #666;
}
.users {
li {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 15px;
margin-bottom: 10px;
line-height: 40px;
font-size: 14px;
background-color: #ebeef5;
cursor: pointer;
&.isEnable {
color: #c0c4cc;
background-color: #f5f7fa;
cursor: not-allowed;
}
&:last-child {
margin-bottom: 0;
}
&:hover {
background-color: #d3e0ff;
}
i {
font-size: 16px;
}
}
}
}
@media (max-width: 1600px) {
/deep/.ms-login {
width: 1000px;
.el-input__inner {
height: 50px;
line-height: 50px;
}
.verification {
height: 48px;
}
}
.ms-title {
width: 480px;
/deep/.ms-login {
width: 1000px;
.el-input__inner {
height: 50px;
line-height: 50px;
}
.login-btn button {
height: 60px;
.verification {
height: 48px;
}
}
.ms-title {
width: 480px;
}
.login-btn button {
height: 60px;
}
}
</style>

File diff suppressed because it is too large Load Diff

@ -1,343 +1,215 @@
<template>
<div>
<el-card shadow="hover"
class="mgb20">
<el-card shadow="hover" class="mgb20">
<div class="flex-between">
<el-page-header @back="back"
:content="name + '/' + (sorting? '编辑排序' : '内容设置')"></el-page-header>
<el-page-header @back="back" :content="name + '/' + (sorting ? '编辑排序' : '内容设置')"></el-page-header>
</div>
</el-card>
<!--内容设置-->
<el-card shadow="hover"
class="mgb20">
<el-card shadow="hover" class="mgb20">
<div class="page">
<div class="relative">
<div class="p-title">内容设置</div>
<div class="btns">
<template v-if="!sorting">
<el-button type="primary"
round
@click="addChapter"
v-auth="'/curriculum:内容设置:添加章节'">添加章节</el-button>
<el-button type="primary"
round
@click="sort"
v-auth="'/curriculum:内容设置:编辑排序'">编辑顺序</el-button>
<el-button type="primary" round @click="addChapter" v-auth="'/curriculum:内容设置:添加章节'">添加章节</el-button>
<el-button type="primary" round @click="sort" v-auth="'/curriculum:内容设置:编辑排序'">编辑顺序</el-button>
</template>
<template v-else>
<el-button type="primary"
round
@click="move">批量移动</el-button>
<el-button type="primary"
round
@click="cancelSort">取消</el-button>
<el-button type="primary"
round
@click="saveSort">保存</el-button>
<el-button type="primary" round @click="move">批量移动</el-button>
<el-button type="primary" round @click="cancelSort">取消</el-button>
<el-button type="primary" round @click="saveSort">保存</el-button>
</template>
</div>
</div>
<el-divider></el-divider>
<div class="page-content">
<div class="mgb20"
v-for="(chapter,index) in chapters"
:key="chapter.id">
<div class="mgb20" v-for="(chapter, index) in chapters" :key="chapter.id">
<div class="flex-between mgb10">
<div>{{ chapter.name }}</div>
<div>
<template v-if="!sorting">
<el-button class="action-btn"
plain
@click="editChapter(chapter)"
v-auth="'/curriculum:内容设置:修改章节名称'">修改章节名称</el-button>
<el-button class="action-btn"
plain
@click="addSection(chapter.id)"
v-auth="'/curriculum:内容设置:添加小节'">添加小节</el-button>
<el-button class="action-btn"
plain
@click="delChapter(chapter.id)"
v-auth="'/curriculum:内容设置:删除章节'">删除</el-button>
<el-button class="action-btn" plain @click="editChapter(chapter)"
v-auth="'/curriculum:内容设置:修改章节名称'">修改章节名称</el-button>
<el-button class="action-btn" plain @click="addSection(chapter.id)"
v-auth="'/curriculum:内容设置:添加小节'">添加小节</el-button>
<el-button class="action-btn" plain @click="delChapter(chapter.id)"
v-auth="'/curriculum:内容设置:删除章节'">删除</el-button>
</template>
<template v-else>
<i class="el-icon-top sort-icon"
:class="{disabled: index == 0}"
style="margin-right: 5px"
@click="sortChapter(chapter,'up',index == 0,index)"></i>
<i class="el-icon-bottom sort-icon"
:class="{disabled: index == chapters.length-1}"
@click="sortChapter(chapter,'down',index == chapter.length-1,index)"></i>
<i class="el-icon-top sort-icon" :class="{ disabled: index == 0 }" style="margin-right: 5px"
@click="sortChapter(chapter, 'up', index == 0, index)"></i>
<i class="el-icon-bottom sort-icon" :class="{ disabled: index == chapters.length - 1 }"
@click="sortChapter(chapter, 'down', index == chapter.length - 1, index)"></i>
</template>
</div>
</div>
<el-table :data="chapter.subsectionList"
class="table"
stripe
header-align="center"
row-key="id">
<el-table-column v-if="sorting"
width="55"
align="center">
<el-table :data="chapter.subsectionList" class="table" stripe header-align="center" row-key="id">
<el-table-column v-if="sorting" width="55" align="center">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.check"></el-checkbox>
</template>
</el-table-column>
<el-table-column type="index"
width="100"
label="序号"
align="center"></el-table-column>
<el-table-column prop="name"
label="资源名称">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="name" label="资源名称">
</el-table-column>
<el-table-column prop="fileType"
label="资源类型"
align="center">
<el-table-column prop="fileType" label="资源类型" align="center">
<template slot-scope="scope">
{{ transferType(scope.row.fileType) }}
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="300">
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<template v-if="!sorting">
<el-button type="text"
@click="download(scope.row)"
v-auth="'/curriculum:内容设置:下载'">下载</el-button>
<el-button type="text"
@click="preview(scope.row)"
v-auth="'/curriculum:内容设置:查看'">查看</el-button>
<el-button type="text"
@click="delSection(scope.row)"
v-auth="'/curriculum:内容设置:删除小节'">删除</el-button>
<el-button type="text"
@click="editSectionName(scope.row,chapter.id)"
v-auth="'/curriculum:内容设置:修改小节名称'">修改小节名称</el-button>
<el-button type="text"
@click="switchFile(scope.row,chapter.id)"
v-auth="'/curriculum:内容设置:更换文件'">更换文件</el-button>
<el-button type="text" @click="download(scope.row)" v-auth="'/curriculum:内容设置:下载'">下载</el-button>
<el-button type="text" @click="preview(scope.row)" v-auth="'/curriculum:内容设置:查看'">查看</el-button>
<el-button type="text" @click="delSection(scope.row)"
v-auth="'/curriculum:内容设置:删除小节'">删除</el-button>
<el-button type="text" @click="editSectionName(scope.row, chapter.id)"
v-auth="'/curriculum:内容设置:修改小节名称'">修改小节名称</el-button>
<el-button type="text" @click="switchFile(scope.row, chapter.id)"
v-auth="'/curriculum:内容设置:更换文件'">更换文件</el-button>
</template>
<template v-else>
<i class="el-icon-top sort-icon"
:class="{disabled: scope.$index == 0}"
style="margin-right: 5px"
@click="sortSection(index,'up',scope.$index == 0,scope.$index)"></i>
<i class="el-icon-top sort-icon" :class="{ disabled: scope.$index == 0 }" style="margin-right: 5px"
@click="sortSection(index, 'up', scope.$index == 0, scope.$index)"></i>
<i class="el-icon-bottom sort-icon"
:class="{disabled: scope.$index == chapter.subsectionList.length-1}"
@click="sortSection(index,'down',scope.$index == chapter.subsectionList.length-1,scope.$index)"></i>
:class="{ disabled: scope.$index == chapter.subsectionList.length - 1 }"
@click="sortSection(index, 'down', scope.$index == chapter.subsectionList.length - 1, scope.$index)"></i>
</template>
</template>
</el-table-column>
</el-table>
</div>
<el-dialog :title="chapterId ? '编辑章节' : '新增章节'"
:visible.sync="chapterVisible"
width="540px"
:close-on-click-modal="false">
<el-dialog :title="chapterId ? '编辑章节' : '新增章节'" :visible.sync="chapterVisible" width="540px"
:close-on-click-modal="false">
<el-form>
<el-form-item>
<el-input placeholder="请输入章节名称,便于对小节归类"
v-model="chapterName"
maxlength="50"></el-input>
<el-input placeholder="请输入章节名称,便于对小节归类" v-model="chapterName" maxlength="50"></el-input>
</el-form-item>
</el-form>
<span slot="footer"
class="dialog-footer">
<span slot="footer" class="dialog-footer">
<el-button @click="chapterVisible = false">取消</el-button>
<el-button type="primary"
@click="chapterSubmit">确定</el-button>
<el-button type="primary" @click="chapterSubmit">确定</el-button>
</span>
</el-dialog>
<el-dialog title="添加小节"
:visible.sync="sectionVisible"
width="540px"
@close="closeSection"
:close-on-click-modal="false">
<el-form ref="form"
:model="sectionForm"
label-width="80px"
@submit.native.prevent>
<el-dialog title="添加小节" :visible.sync="sectionVisible" width="540px" @close="closeSection"
:close-on-click-modal="false">
<el-form ref="form" :model="sectionForm" label-width="80px" @submit.native.prevent>
<el-form-item label="资源添加">
<Upload :max-size="100000"
:file-list="uploadList"
:on-remove="handleRemove"
@beforeUpload="beforeUpload"
@onSuccess="uploadSuccess">
<Upload :max-size="100000" :file-list="uploadList" :on-remove="handleRemove"
@beforeUpload="beforeUpload" @onSuccess="uploadSuccess">
<template slot="tip">
<p>视频请上传MP4格式大小不超过150Moffice文件大小不要超过10M</p>
</template>
</Upload>
</el-form-item>
<el-form-item label="小节名称">
<el-input placeholder="请输入小节名称"
v-model.trim="sectionForm.sectionName"
maxlength="50"
@keyup.enter.native="sectionSubmit()"></el-input>
<el-input placeholder="请输入小节名称" v-model.trim="sectionForm.sectionName" maxlength="50"
@keyup.enter.native="sectionSubmit()"></el-input>
</el-form-item>
</el-form>
<span slot="footer"
class="dialog-footer">
<span slot="footer" class="dialog-footer">
<el-button @click="sectionVisible = false">取消</el-button>
<el-button type="primary"
@click="sectionSubmit">确定</el-button>
<el-button type="primary" @click="sectionSubmit">确定</el-button>
</span>
</el-dialog>
<el-dialog title="更换文件"
:visible.sync="switchVisible"
width="540px"
:close-on-click-modal="false"
@close="closeSwitch">
<el-dialog title="更换文件" :visible.sync="switchVisible" width="540px" :close-on-click-modal="false"
@close="closeSwitch">
<div style="text-align: center">
<Upload :max-size="100000"
:file-list="uploadList"
:on-remove="handleRemove"
@beforeUpload="beforeUpload"
@onSuccess="uploadSuccess">
<Upload :max-size="100000" :file-list="uploadList" :on-remove="handleRemove" @beforeUpload="beforeUpload"
@onSuccess="uploadSuccess">
<div slot="tip"></div>
</Upload>
</div>
<span slot="footer"
class="dialog-footer">
<span slot="footer" class="dialog-footer">
<el-button @click="switchVisible = false">取消</el-button>
<el-button type="primary"
@click="switchSubmit">确定</el-button>
<el-button type="primary" @click="switchSubmit">确定</el-button>
</span>
</el-dialog>
<el-dialog title="修改小节名称"
:visible.sync="sectionNameVisible"
width="540px"
:close-on-click-modal="false">
<el-dialog title="修改小节名称" :visible.sync="sectionNameVisible" width="540px" :close-on-click-modal="false">
<el-form @submit.native.prevent>
<el-form-item>
<el-input placeholder="请输入小节名称"
v-model="sectionForm.sectionName"
maxlength="50"
@keyup.enter.native="sectionNameSubmit()"></el-input>
<el-input placeholder="请输入小节名称" v-model="sectionForm.sectionName" maxlength="50"
@keyup.enter.native="sectionNameSubmit()"></el-input>
</el-form-item>
</el-form>
<span slot="footer"
class="dialog-footer">
<span slot="footer" class="dialog-footer">
<el-button @click="sectionNameVisible = false">取消</el-button>
<el-button type="primary"
@click="sectionNameSubmit">确定</el-button>
<el-button type="primary" @click="sectionNameSubmit">确定</el-button>
</span>
</el-dialog>
<div v-show="previewImg"
class="el-image-viewer__wrapper"
:class="{active: previewImg}"
style="z-index: 2000">
<div v-show="previewImg" class="el-image-viewer__wrapper" :class="{ active: previewImg }"
style="z-index: 2000">
<div class="el-image-viewer__mask"></div>
<span class="el-image-viewer__btn el-image-viewer__close"
@click="previewImg = ''"><i class="el-icon-circle-close"
style="color: #fff"></i></span>
<span class="el-image-viewer__btn el-image-viewer__close" @click="previewImg = ''"><i
class="el-icon-circle-close" style="color: #fff"></i></span>
<div class="el-image-viewer__canvas">
<img :src="previewImg"
class="el-image-viewer__img"
style="transform: scale(1) rotate(0deg);margin-top: -1px; max-height: 100%; max-width: 100%;">
<img :src="previewImg" class="el-image-viewer__img"
style="transform: scale(1) rotate(0deg);margin-top: -1px; max-height: 100%; max-width: 100%;">
</div>
</div>
<div v-show="iframeSrc || videoSrc"
class="el-image-viewer__wrapper"
:class="{active: iframeSrc}"
style="z-index: 2000">
<div v-show="iframeSrc || videoSrc" class="el-image-viewer__wrapper" :class="{ active: iframeSrc }"
style="z-index: 2000">
<div class="el-image-viewer__mask"></div>
<span class="el-image-viewer__btn el-image-viewer__close"
:class="{'doc-close': isWord}"
:style="{top: isWord ? '50px' : '5px'}"
@click="closeIframe"><i class="el-icon-circle-close"
style="color: #fff"></i></span>
<span class="el-image-viewer__btn el-image-viewer__close" :class="{ 'doc-close': isWord }"
:style="{ top: isWord ? '50px' : '5px' }" @click="closeIframe"><i class="el-icon-circle-close"
style="color: #fff"></i></span>
<div class="el-image-viewer__canvas">
<iframe v-if="iframeSrc"
class="fileIframe"
id="fileIframe"
:src="iframeSrc"
frameborder="0"></iframe>
<video v-if="videoSrc"
class="video"
width="1200"
height="600"
autoplay
controls>
<source :src="videoSrc"
type="video/mp4">
<iframe v-if="iframeSrc" class="fileIframe" id="fileIframe" :src="iframeSrc" frameborder="0"></iframe>
<video v-if="videoSrc" class="video" width="1200" height="600" autoplay controls>
<source :src="videoSrc" type="video/mp4">
您的浏览器不支持 video 标签
</video>
<template v-if="showMask">
<div class="mask"
style="width: 200px;height: 30px;top: 53px;right: 320px"></div>
<div class="mask"
style="width: 175px;height: 30px;top: 53px;right: 5px"></div>
<div class="mask" style="width: 200px;height: 30px;top: 53px;right: 320px"></div>
<div class="mask" style="width: 175px;height: 30px;top: 53px;right: 5px"></div>
</template>
<template v-if="showMask1">
<div class="word-mask1"
style="width: 200px;height: 50px;"></div>
<div class="word-mask"
style="height: 40px;top: 48px;"></div>
<div class="word-mask2"
style="top: 55px;left: 28%;width: 44%;height: calc(100% - 80px);"></div>
<div class="word-mask1" style="width: 200px;height: 50px;"></div>
<div class="word-mask" style="height: 40px;top: 48px;"></div>
<div class="word-mask2" style="top: 55px;left: 28%;width: 44%;height: calc(100% - 80px);"></div>
</template>
<template v-if="showMask2 && iframeSrc">
<div class="excel-mask1"
style="height: 48px;"></div>
<div class="excel-mask1" style="height: 48px;"></div>
</template>
</div>
</div>
<div v-show="playAuth"
class="el-image-viewer__wrapper"
:class="{active: playAuth}"
style="z-index: 2000">
<div v-show="playAuth" class="el-image-viewer__wrapper" :class="{ active: playAuth }" style="z-index: 2000">
<div class="el-image-viewer__mask"></div>
<span class="el-image-viewer__btn el-image-viewer__close"
@click="closePlayer"><i class="el-icon-circle-close"
style="color: #fff"></i></span>
<div class="player"
id="player"></div>
<span class="el-image-viewer__btn el-image-viewer__close" @click="closePlayer"><i
class="el-icon-circle-close" style="color: #fff"></i></span>
<div class="player" id="player"></div>
</div>
<Pdf :visible.sync="pdfVisible"
:src.sync="pdfSrc" />
<Pdf :visible.sync="pdfVisible" :src.sync="pdfSrc" />
</div>
</div>
</el-card>
<div class="player-download"
id="playerDownload"></div>
<div class="player-download" id="playerDownload"></div>
<el-dialog title="资源移动"
:visible.sync="moveVisible"
:close-on-click-modal="false"
width="330px">
<el-dialog title="资源移动" :visible.sync="moveVisible" :close-on-click-modal="false" width="330px">
<el-form>
<el-form-item label="目标章节">
<el-select v-model="moveForm.id"
placeholder="请选择目标章节"
@change="chapterChange">
<el-option v-for="(item, i) in chapters"
:key="i"
:label="item.name"
:value="item.id"></el-option>
<el-select v-model="moveForm.id" placeholder="请选择目标章节" @change="chapterChange">
<el-option v-for="(item, i) in chapters" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="目标排序">
<el-select v-model="moveForm.sort"
placeholder="请选择目标排序">
<el-option v-for="(item, i) in sortList"
:key="i"
:label="item.name"
:value="item.id"></el-option>
<el-select v-model="moveForm.sort" placeholder="请选择目标排序">
<el-option v-for="(item, i) in sortList" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer"
class="dialog-footer">
<span slot="footer" class="dialog-footer">
<el-button @click="moveVisible = false">取消</el-button>
<el-button type="primary"
@click="moveConfirm">确定</el-button>
<el-button type="primary" @click="moveConfirm">确定</el-button>
</span>
</el-dialog>
</div>
@ -753,7 +625,7 @@ export default {
const { fileType, fileId } = row
// ppt
if (fileType === 'pptx') {
this.downloadFile(row.name, row.fileUrl)
this.downloadFile(row.originalFileName || row.name, row.fileUrl)
} else if (fileId) {
//
this.$get(`${this.api.getPlayAuth}/${fileId}`).then(res => {
@ -762,7 +634,7 @@ export default {
width: "100%",
autoplay: false,
vid: fileId,
playauth: res.data.playAuth,
playauth: res.playAuth,
encryptType: 1 //
}, player => {
this.downloadFile(row.name, player._urls[0].Url)
@ -777,7 +649,7 @@ export default {
//
if (row.fileId) {
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => {
this.playAuth = res.data.playAuth;
this.playAuth = res.playAuth;
if (this.player) {
this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth);
} else {
@ -949,172 +821,177 @@ export default {
<style scoped lang="scss">
.page-content {
max-height: calc(100vh - 420px);
overflow: auto;
max-height: calc(100vh - 420px);
overflow: auto;
}
.action-btn {
color: #9076ff;
font-size: 14px;
border: #9076ff 1px solid;
background-color: #fff;
border-radius: 4px;
color: #9076ff;
font-size: 14px;
border: #9076ff 1px solid;
background-color: #fff;
border-radius: 4px;
}
.btns {
position: absolute;
top: 12px;
right: 24px;
position: absolute;
top: 12px;
right: 24px;
.el-button {
font-size: 14px;
}
.el-button {
font-size: 14px;
}
}
.sort-icon {
font-size: 24px;
cursor: pointer;
font-size: 24px;
cursor: pointer;
&.disabled {
color: #ccc;
cursor: not-allowed;
}
&.disabled {
color: #ccc;
cursor: not-allowed;
}
}
/deep/.el-progress-bar {
padding-right: 70px;
margin-right: -70px;
padding-right: 70px;
margin-right: -70px;
}
.el-upload__tip {
position: absolute;
top: -4px;
right: 0;
width: 300px;
line-height: 1.4;
position: absolute;
top: -4px;
right: 0;
width: 300px;
line-height: 1.4;
}
.el-image-viewer__wrapper {
transform: translateY(-10px);
transition: transform 0.5s;
transform: translateY(-10px);
transition: transform 0.5s;
&.active {
transform: translateY(0);
}
&.active {
transform: translateY(0);
}
}
.el-image-viewer__close {
z-index: 10000;
top: 15px;
right: 15px;
z-index: 10000;
top: 15px;
right: 15px;
&.doc-close {
i {
color: #000 !important;
}
&.doc-close {
i {
color: #000 !important;
}
}
}
.player {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 1200px !important;
height: 600px !important;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 1200px !important;
height: 600px !important;
}
.player-download {
position: absolute;
top: -9999px;
position: absolute;
top: -9999px;
}
.fileIframe {
z-index: 1;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
z-index: 1;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
}
.mask {
z-index: 1000;
position: fixed;
background-color: rgb(57, 58, 61);
z-index: 1000;
position: fixed;
background-color: rgb(57, 58, 61);
}
.word-mask {
z-index: 1000;
position: fixed;
right: 0;
width: 100%;
background-color: rgb(243, 242, 241);
z-index: 1000;
position: fixed;
right: 0;
width: 100%;
background-color: rgb(243, 242, 241);
}
.word-mask1 {
z-index: 1000;
position: fixed;
top: 0;
right: 0;
background-color: #2b579a;
z-index: 1000;
position: fixed;
top: 0;
right: 0;
background-color: #2b579a;
}
.word-mask2 {
z-index: 1000;
position: fixed;
background-color: transparent;
z-index: 1000;
position: fixed;
background-color: transparent;
}
.excel-mask1 {
z-index: 9;
position: absolute;
top: 0;
left: 20%;
width: 80%;
background-color: #107c41;
z-index: 9;
position: absolute;
top: 0;
left: 20%;
width: 80%;
background-color: #107c41;
}
.page {
position: relative;
padding: 24px;
background-color: #fff;
border-radius: 8px;
.tool {
display: flex;
justify-content: space-between;
margin-bottom: 24px;
.filter {
display: inline-flex;
flex-wrap: wrap;
align-items: center;
flex: 1;
li {
display: inline-flex;
align-items: center;
margin-right: 30px;
label {
margin-right: 6px;
font-size: 14px;
line-height: 14px;
color: rgba(0, 0, 0, 0.65);
white-space: nowrap;
}
}
position: relative;
padding: 24px;
background-color: #fff;
border-radius: 8px;
.tool {
display: flex;
justify-content: space-between;
margin-bottom: 24px;
.filter {
display: inline-flex;
flex-wrap: wrap;
align-items: center;
flex: 1;
li {
display: inline-flex;
align-items: center;
margin-right: 30px;
label {
margin-right: 6px;
font-size: 14px;
line-height: 14px;
color: rgba(0, 0, 0, 0.65);
white-space: nowrap;
}
}
}
&.mul {
margin-bottom: 0;
&.mul {
margin-bottom: 0;
.filter {
width: 1200px;
.filter {
width: 1200px;
li {
margin-bottom: 24px;
}
}
li {
margin-bottom: 24px;
}
}
}
}
}
</style>

File diff suppressed because it is too large Load Diff

@ -1,7 +1,6 @@
<template>
<div v-loading="loading">
<el-card shadow="hover"
class="mgb20">
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
@ -11,50 +10,34 @@
<el-form label-width="80px">
<el-col :span="4">
<el-form-item label="省份">
<el-select v-model="form.provinces"
clearable
placeholder="请选择省份"
@change="getCity"
@clear="clearprovince">
<el-option v-for="(item,index) in provinceList"
:key="index"
:label="item.provinceName"
:value="item.provinceId"></el-option>
<el-select v-model="form.provinces" clearable placeholder="请选择省份" @change="getCity"
@clear="clearprovince">
<el-option v-for="(item, index) in provinceList" :key="index" :label="item.provinceName"
:value="item.provinceId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="城市">
<el-select v-model="form.city"
clearable
placeholder="请选择城市"
:disabled="form.provinces ? false : true"
@change="initData">
<el-option v-for="(item,index) in cityList"
:key="index"
:label="item.cityName"
:value="item.cityId"></el-option>
<el-select v-model="form.city" clearable placeholder="请选择城市" :disabled="form.provinces ? false : true"
@change="initData">
<el-option v-for="(item, index) in cityList" :key="index" :label="item.cityName"
:value="item.cityId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="客户类型">
<el-select v-model="form.customerType"
placeholder="请选择客户类型"
@change="initData">
<el-option v-for="(item,index) in customerTypeList"
:key="index"
:label="item.name"
:value="item.value"></el-option>
<el-select v-model="form.customerType" placeholder="请选择客户类型" @change="initData">
<el-option v-for="(item, index) in customerTypeList" :key="index" :label="item.name"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="支持客户,联系人,账号搜索"
prefix-icon="el-icon-search"
v-model="form.keyword"
clearable></el-input>
<el-input placeholder="支持客户,联系人,账号搜索" prefix-icon="el-icon-search" v-model="form.keyword"
clearable></el-input>
</el-form-item>
</el-col>
</el-form>
@ -62,110 +45,61 @@
</div>
</el-card>
<el-card shadow="hover"
class="card">
<el-card shadow="hover" class="card">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="hr_tag"></p>
<span>客户列表</span>
</div>
<div>
<el-button type="primary"
round
class="mag"
@click="exportData">导出客户列表</el-button>
<el-button type="primary"
round
class="mag"
@click="addcustomer"
v-auth>新增</el-button>
<el-button type="primary"
round
@click="delAllSelection"
v-auth>批量删除</el-button>
<el-button type="primary" round class="mag" @click="exportData">导出客户列表</el-button>
<el-button type="primary" round class="mag" @click="addcustomer" v-auth>新增</el-button>
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
</div>
</div>
<el-table :data="listData"
class="table"
ref="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="customerId">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="100"
label="序号"
align="center">
<el-table :data="listData" class="table" ref="table" stripe header-align="center"
@selection-change="handleSelectionChange" row-key="customerId">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
{{scope.$index + (page - 1) * pageSize + 1}}
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="customerName"
label="客户名称"
align="center">
<el-table-column prop="customerName" label="客户名称" align="center">
</el-table-column>
<el-table-column label="行业"
align="center">
<el-table-column label="行业" align="center">
<template slot-scope="scope">
<span class="ellipsis">{{scope.row.industryName}}</span>
<span class="ellipsis">{{ scope.row.industryName }}</span>
</template>
</el-table-column>
<el-table-column prop="countries"
label="客户类型"
align="center">
<el-table-column prop="countries" label="客户类型" align="center">
<template slot-scope="scope">
<span v-if="scope.row.customerType">{{ customerTypeList.find(e => e.value == scope.row.customerType).name }}</span>
<span v-if="scope.row.customerType">{{ customerTypeList.find(e => e.value == scope.row.customerType).name
}}</span>
</template>
</el-table-column>
<el-table-column prop="provinceName"
label="省份"
align="center">
<el-table-column prop="provinceName" label="省份" align="center">
</el-table-column>
<el-table-column prop="cityName"
label="城市"
align="center">
<el-table-column prop="cityName" label="城市" align="center">
</el-table-column>
<el-table-column prop="name"
label="联系人"
align="center">
<el-table-column prop="name" label="联系人" align="center">
</el-table-column>
<el-table-column prop="account"
label="账号"
align="center">
<el-table-column prop="account" label="账号" align="center">
</el-table-column>
<el-table-column prop="loginNumber"
label="登录次数"
align="center">
<el-table-column prop="loginNumber" label="登录次数" align="center">
</el-table-column>
<el-table-column label="操作"
width="270"
align="center">
<el-table-column label="操作" width="270" align="center">
<template slot-scope="scope">
<el-button type="text"
@click="resetPassword(scope.row)"
v-auth>重置密码</el-button>
<el-button type="text"
@click="show(scope.row)"
v-auth>查看</el-button>
<el-button type="text"
@click="edit(scope.row)"
v-auth>管理</el-button>
<el-button type="text"
@click="handleDelete(scope.row)"
v-auth>删除</el-button>
<el-button type="text" @click="resetPassword(scope.row)" v-auth>重置密码</el-button>
<el-button type="text" @click="show(scope.row)" v-auth>查看</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth>管理</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange"
:current-page="page">
</el-pagination>
</div>
</el-card>
@ -401,7 +335,6 @@ export default {
<style lang="scss" scoped>
.card {
min-height: calc(100vh - 300px);
min-height: calc(100vh - 300px);
}
</style>

@ -5,80 +5,81 @@
<div class="box">
<h1>欢迎使用开发者平台</h1>
<div class="form">
<ul class="tab">
<li v-for="(item, i) in tabList" :key="i" :class="{active: activeIndex == item.id}" @click="handleSelect(item.id)">{{item.label}}</li>
</ul>
<el-form v-show="activeIndex==='1'" :model="param" :rules="rules" ref="login" label-width="0px">
<el-form-item prop="account">
<el-input @blur="blur" v-model="param.account" placeholder="请输入账号"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
type="password"
placeholder="请输入密码"
v-model="param.password"
>
</el-input>
</el-form-item>
<el-form-item prop="code" v-if="showVerify">
<el-input
placeholder="请输入验证码"
v-model="param.code"
@keyup.enter.native="submitForm()"
>
</el-input>
<img @click="blur" :src="verificationIMG" class="verification" alt="">
</el-form-item>
<div class="login-btn">
<el-button type="primary" @click="submitForm()">马上登录</el-button>
</div>
</el-form>
<el-form v-show="activeIndex==='2'" :model="phoneOrEmail" :rules="phoneOrEmailrules" ref="phoneOrEmail" label-width="0px">
<el-form-item prop="account">
<el-input @blur="phoneBlur" v-model="phoneOrEmail.account" placeholder="请输入电话/邮箱"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
type="password"
placeholder="请输入密码"
v-model="phoneOrEmail.password"
>
</el-input>
</el-form-item>
<el-form-item prop="code" v-if="showPhoneVerify">
<el-input
placeholder="请输入验证码"
v-model="phoneOrEmail.code"
@keyup.enter.native="submitForm('phone')"
>
</el-input>
<img @click="phoneBlur" :src="PhoneVerificationIMG" class="verification" alt="">
</el-form-item>
<div class="login-btn">
<el-button type="primary" @click="submitForm('phone')">马上登录</el-button>
</div>
</el-form>
<ul class="tab">
<li v-for="(item, i) in tabList" :key="i" :class="{ active: activeIndex == item.id }"
@click="handleSelect(item.id)">{{ item.label }}</li>
</ul>
<el-form v-show="activeIndex === '1'" :model="param" :rules="rules" ref="login" label-width="0px">
<el-form-item prop="account">
<el-input @blur="blur" v-model="param.account" placeholder="请输入账号"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input type="password" placeholder="请输入密码" v-model="param.password">
</el-input>
</el-form-item>
<el-form-item prop="code" v-if="showVerify">
<el-input placeholder="请输入验证码" v-model="param.code" @keyup.enter.native="submitForm()">
</el-input>
<img @click="blur" :src="verificationIMG" class="verification" alt="">
</el-form-item>
<div class="login-btn">
<el-button type="primary" @click="submitForm()">马上登录</el-button>
</div>
</el-form>
<el-form v-show="activeIndex === '2'" :model="phoneOrEmail" :rules="phoneOrEmailrules" ref="phoneOrEmail"
label-width="0px">
<el-form-item prop="account">
<el-input @blur="phoneBlur" v-model="phoneOrEmail.account" placeholder="请输入电话/邮箱"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input type="password" placeholder="请输入密码" v-model="phoneOrEmail.password">
</el-input>
</el-form-item>
<el-form-item prop="code" v-if="showPhoneVerify">
<el-input placeholder="请输入验证码" v-model="phoneOrEmail.code" @keyup.enter.native="submitForm('phone')">
</el-input>
<img @click="phoneBlur" :src="PhoneVerificationIMG" class="verification" alt="">
</el-form-item>
<div class="login-btn">
<el-button type="primary" @click="submitForm('phone')">马上登录</el-button>
</div>
</el-form>
</div>
</div>
</div>
<el-dialog title="绑定手机号" :visible.sync="phoneVisible" :close-on-click-modal="false" width="576px">
<p class="tips">依据国家政策法规需绑定手机号进行网络实名才可登录使用本平台</p>
<el-form ref="form" label-width="60px">
<el-form-item label="手机号">
<el-input placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>
</el-form-item>
<el-form-item label="验证码">
<div style="display:flex;">
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input>
<el-button style="margin-left:10px" @click="sendPhoneCode" :disabled="phoneDisabled">{{phoneBtnText}}</el-button>
</div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="phoneVisible = false"> </el-button>
<el-button type="primary" @click="phoneSubmit"> </el-button>
</span>
<p class="tips">依据国家政策法规需绑定手机号进行网络实名才可登录使用本平台</p>
<el-form ref="form" label-width="60px">
<el-form-item label="手机号">
<el-input placeholder="请输入手机号" v-model="phone" maxlength="11"></el-input>
</el-form-item>
<el-form-item label="验证码">
<div style="display:flex;">
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input>
<el-button style="margin-left:10px" @click="sendPhoneCode" :disabled="phoneDisabled">{{ phoneBtnText
}}</el-button>
</div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="phoneVisible = false"> </el-button>
<el-button type="primary" @click="phoneSubmit"> </el-button>
</span>
</el-dialog>
<el-dialog title="请选择您要登录的用户" :visible.sync="userVisible" :close-on-click-modal="false" custom-class="user-dia"
width="500px">
<p class="tips">该手机号已绑定以下用户信息</p>
<ul class="users">
<li :class="{ isEnable: !user.isEnable }" v-for="(user, i) in users" :key="i" @click="chooseUser(user)">
<span>{{ user.schoolName }}{{ user.userName }}{{ user.workNumber }}{{
user.isEnable
? ''
: '(已禁用)' }}</span>
<i class="el-icon-right"></i>
</li>
</ul>
</el-dialog>
<v-footer class="footer" ref="footer"></v-footer>
</div>
@ -87,217 +88,272 @@
<script>
import vFooter from '../components/Footer'
import Setting from '@/setting'
import addRoutes from '@/libs/route/addRoutes'
import CryptoJS from 'crypto-js'
import JSEncrypt from 'jsencrypt'
export default {
data: function() {
var regPhoneOrEmail = (rule, value, callback) => {//
let emailReg = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
let phoneReg = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/
if (value === '') {
callback(new Error('请输入手机或邮箱!'));
} else if (!emailReg.test(value)&&!phoneReg.test(value)) {
callback(new Error('输入的手机/邮箱格式不正确!'));
} else {
callback();
}
};
return {
tabList: [
{
id: '1',
label: '账号登录'
}, {
id: '2',
label: '手机号/邮箱登录'
}
],
activeIndex:"1",
showVerify: true,// -
verificationIMG:'',//
//
param: {
account: '',
password: '',
code:'',
platform:3,
random:'',
distinguish:1,
type: 2
},
rules: {
account: [{ required: true, message: '请输入账号', trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
code: [{ required: true, message: '请输入验证码', trigger: 'blur' }],
},
// +
showPhoneVerify:true,// -
PhoneVerificationIMG:'',//
phoneOrEmail: {
account: '',
password: '',
code:'',
platform:3,
random:'',
distinguish:2,
type: 2
},
phoneOrEmailrules:{
account: [{ validator: regPhoneOrEmail, trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
code: [{ required: true, message: '请输入验证码', trigger: 'blur' }],
},
phoneVisible:false,
phone:'',
phoneCode:'',
phoneDisabled:false,
phoneBtnText: '发送验证码',
phoneTimer:'',
phoneOpener:''
};
data: function () {
var regPhoneOrEmail = (rule, value, callback) => {//
let emailReg = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
let phoneReg = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/
if (value === '') {
callback(new Error('请输入手机或邮箱!'));
} else if (!emailReg.test(value) && !phoneReg.test(value)) {
callback(new Error('输入的手机/邮箱格式不正确!'));
} else {
callback();
}
};
return {
tabList: [
{
id: '1',
label: '账号登录'
}, {
id: '2',
label: '手机号/邮箱登录'
}
],
activeIndex: "1",
showVerify: true,// -
verificationIMG: '',//
//
param: {
account: '',
password: '',
code: '',
platform: 3,
random: '',
distinguish: 1,
type: 2
},
rules: {
account: [{ required: true, message: '请输入账号', trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
code: [{ required: true, message: '请输入验证码', trigger: 'blur' }],
},
// +
showPhoneVerify: true,// -
PhoneVerificationIMG: '',//
phoneOrEmail: {
account: '',
password: '',
code: '',
platform: 3,
random: '',
distinguish: 2,
type: 2
},
phoneOrEmailrules: {
account: [{ validator: regPhoneOrEmail, trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
code: [{ required: true, message: '请输入验证码', trigger: 'blur' }],
},
phoneVisible: false,
phone: '',
phoneCode: '',
phoneDisabled: false,
phoneBtnText: '发送验证码',
phoneTimer: '',
phoneOpener: '',
userVisible: false,
users: [],
};
},
components: {
vFooter
},
watch: {
verificationIMG: function (val) {// --
if (val) {
this.showVerify = true
} else {
this.showVerify = false
}
},
components: {
vFooter
PhoneVerificationIMG: function (val) {// --
if (val) {
this.showPhoneVerify = true
} else {
this.showPhoneVerify = false
}
},
watch:{
verificationIMG:function(val){// --
if(val){
this.showVerify = true
}else{
this.showVerify = false
},
created () {
if (this.param.account) {
this.showVerify = true
}
this.blur()
},
methods: {
submitForm (val) {
let ref = val === 'phone' ? 'phoneOrEmail' : 'login'
let param = val === 'phone' ? this.phoneOrEmail : this.param
this.$refs[ref].validate(valid => {
if (valid) {
this.$post(this.api.logins, param).then(({ status, data, message }) => {
localStorage.removeItem('examPath')
localStorage.removeItem('reviewPath')
this.getOss()
if (status == 200) {
const accounts = data.userAccounts
//
if (accounts instanceof Array) {
this.users = accounts
this.userVisible = true
} else {
sessionStorage.setItem('token', data.token)
this.setLogin()
}
} else {
param.code = ''
this.$message.error(message)
}
},
PhoneVerificationIMG:function(val){// --
if(val){
this.showPhoneVerify = true
}else{
this.showPhoneVerify = false
}).catch(err => {
if (err.status === 30001) {
this.phoneVisible = true
} else if (err.status == 10004 || err.status == 10005) {
param.code = ''
this.blur()
}
},
});
} else {
this.$message.error('请输入账号/密码/验证码');
return false;
}
});
},
// oss
async getOss () {
const A = (key, encryptedData) => {
const keyHex = CryptoJS.enc.Base64.parse(key)
const decrypted = CryptoJS.AES.decrypt(encryptedData, keyHex, {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
})
return decrypted.toString(CryptoJS.enc.Utf8)
}
const R = (encryptedKey, privateKey) => {
const decrypt = new JSEncrypt()
decrypt.setPrivateKey(privateKey)
const decryptedKey = decrypt.decrypt(encryptedKey)
return decryptedKey
}
const res = await this.$get(this.api.encrypt)
const RE = A(R(res.encryptedKey, res.privateKey), res.encryptedData).split('/')
localStorage.setItem('osc', JSON.stringify(RE))
},
created(){
if(this.param.account){
this.showVerify = true
//
chooseUser (user) {
user.isEnable && this.$post(`${this.api.getToken}?id=${user.id}`).then(({ data }) => {
sessionStorage.setItem('token', data.token)
this.token = data.token
this.setLogin()
}).catch(res => { })
},
//
async setLogin () {
try {
const res = await this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`)
const list = res.permissionMenu
addRoutes(res.permissionMenu[0].children)
this.$store.commit('setDataPer', res.dataPermissionList)
this.$message.success('登录成功!')
this.$router.push({
path: list[0].children[0].path
});
localStorage.setItem('ms_username', this.param.username);
} catch (e) {
if (e.status === 500) {
sessionStorage.clear()
}
this.blur()
}
},
methods: {
submitForm(val) {
let ref = val==='phone'?'phoneOrEmail':'login'
let param = val==='phone'?this.phoneOrEmail:this.param
this.$refs[ref].validate(valid => {
if (valid) {
this.$post(this.api.logins,param).then(res => {
const { message } = res
sessionStorage.setItem('token',res.data.token)
this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`).then(res => {
const list = res.permissionMenu
this.$store.commit('setDataPer', res.dataPermissionList)
this.$message.success(message);
this.$router.push({
path: list[0].children[0].path
});
localStorage.setItem('ms_username', this.param.username);
}).catch(err => {
if (err.status === 500) {
sessionStorage.clear()
}
})
}).catch(err => {
if(err.status===30001){
this.phoneVisible = true
}else if(err.status == 10004){
this.blur()
}
});
} else {
this.$message.error('请输入账号/密码/验证码');
return false;
}
});
},
blur(){
this.param.random = Math.floor(Math.random()*999999999)
this.verificationIMG = this.api.verification+'?random='+`${this.param.random}`
},
phoneBlur(){
this.phoneOrEmail.random = Math.floor(Math.random()*999999999)
this.PhoneVerificationIMG = this.api.verification+'?random='+`${this.phoneOrEmail.random}`
},
handleSelect(val){
this.activeIndex = val
this.param.account = "";
this.param.password = "";
this.param.code = "";
this.phoneOrEmail.account = "";
this.phoneOrEmail.password = "";
this.phoneOrEmail.code = "";
this.$refs.phoneOrEmail.clearValidate()
// this.blur()
this.phoneBlur()
},
sendPhoneCode(){
if(!this.phone) return this.$message.warning('请输入手机号')
if(!/^1[3456789]\d{9}$/.test(this.phone)) return this.$message.warning('请输入正确的手机号')
let data = {
phone: this.phone,
types: 2
}
this.$post(this.api.sendPhoneOrEmailCode,data).then(res => {
this.phoneCountdown()//
if(res.message.opener){
this.phoneOpener = res.message.opener
}else{
this.$message(res.message)
}
}).catch(res => {})
},
phoneSubmit(){
if(!this.phone) return this.$message.warning('请输入手机号')
if(!/^1[3456789]\d{9}$/.test(this.phone)) return this.$message.warning('请输入正确的手机号')
if(!this.phoneCode) return this.$message.warning('请输入验证码')
let data = {
phone: this.phone,
types: 2,
code: this.phoneCode,
opener: this.phoneOpener,
platform: 3,
account: this.param.account
}
this.$post(this.api.bindPhoneOrEmail,data).then(res => {
sessionStorage.setItem('token',res.token)
this.$router.push({
path:'/customer'
});
localStorage.setItem('ms_username', this.param.username);
this.$message.success('绑定成功')
// this.form.phone = this.phone
// this.phoneVisible = false
}).catch(res => {})
},
phoneCountdown(){
let count = 60
if(!this.phoneTimer){
this.phoneDisabled = true
this.phoneTimer = setInterval(() => {
if(count > 0){
count--
this.phoneBtnText = `${count}秒后重试`
}else{
this.phoneDisabled = false
clearInterval(this.phoneTimer)
this.phoneTimer = null
this.phoneBtnText = `发送验证码`
}
},1000)
}
},
blur () {
this.param.random = Math.floor(Math.random() * 999999999)
this.verificationIMG = this.api.verification + '?random=' + `${this.param.random}`
},
phoneBlur () {
this.phoneOrEmail.random = Math.floor(Math.random() * 999999999)
this.PhoneVerificationIMG = this.api.verification + '?random=' + `${this.phoneOrEmail.random}`
},
handleSelect (val) {
this.activeIndex = val
this.param.account = "";
this.param.password = "";
this.param.code = "";
this.phoneOrEmail.account = "";
this.phoneOrEmail.password = "";
this.phoneOrEmail.code = "";
this.$refs.phoneOrEmail.clearValidate()
// this.blur()
this.phoneBlur()
},
sendPhoneCode () {
if (!this.phone) return this.$message.warning('请输入手机号')
if (!/^1[3456789]\d{9}$/.test(this.phone)) return this.$message.warning('请输入正确的手机号')
let data = {
phone: this.phone,
types: 2
}
this.$post(this.api.sendPhoneOrEmailCode, data).then(res => {
this.phoneCountdown()//
if (res.message.opener) {
this.phoneOpener = res.message.opener
} else {
this.$message(res.message)
}
}).catch(res => { })
},
phoneSubmit () {
if (!this.phone) return this.$message.warning('请输入手机号')
if (!/^1[3456789]\d{9}$/.test(this.phone)) return this.$message.warning('请输入正确的手机号')
if (!this.phoneCode) return this.$message.warning('请输入验证码')
let data = {
phone: this.phone,
types: 2,
code: this.phoneCode,
opener: this.phoneOpener,
platform: 3,
account: this.param.account
}
this.$post(this.api.bindPhoneOrEmail, data).then(res => {
sessionStorage.setItem('token', res.token)
this.$router.push({
path: '/customer'
});
localStorage.setItem('ms_username', this.param.username);
this.$message.success('绑定成功')
// this.form.phone = this.phone
// this.phoneVisible = false
}).catch(res => { })
},
phoneCountdown () {
let count = 60
if (!this.phoneTimer) {
this.phoneDisabled = true
this.phoneTimer = setInterval(() => {
if (count > 0) {
count--
this.phoneBtnText = `${count}秒后重试`
} else {
this.phoneDisabled = false
clearInterval(this.phoneTimer)
this.phoneTimer = null
this.phoneBtnText = `发送验证码`
}
}, 1000)
}
},
},
};
</script>
@ -305,24 +361,28 @@ export default {
.wrap {
min-height: 100%;
}
.logo {
z-index: 2;
position: absolute;
top: 50px;
left: 50px;
}
.login {
position: relative;
height: 100%;
background-image: url(../assets/img/devLogin.jpg);
background-size: 100%;
}
.box {
width: 448px;
position: absolute;
right: 20%;
top: 50%;
transform: translateY(-50%);
h1 {
margin-bottom: 20px;
font-size: 34px;
@ -330,76 +390,129 @@ export default {
text-align: center;
}
}
/deep/ .form {
padding: 20px 60px 0;
background-color: rgba(255, 255, 255, .3);
border-radius: 4px;
box-sizing: border-box;
border: 4px solid rgba(255, 255, 255, .2);
.el-input__inner {
height: 50px;
line-height: 50px;
border: 1px solid rgba(220, 220, 220, 1);
border-radius: 2px;
}
.el-form-item {
margin-bottom: 25px;
}
.verification{
position: absolute;
top: 1px;
right: 1px;
width: 160px;
height: 47px;
cursor: pointer;
}
padding: 20px 60px 0;
background-color: rgba(255, 255, 255, .3);
border-radius: 4px;
box-sizing: border-box;
border: 4px solid rgba(255, 255, 255, .2);
.el-input__inner {
height: 50px;
line-height: 50px;
border: 1px solid rgba(220, 220, 220, 1);
border-radius: 2px;
}
.el-form-item {
margin-bottom: 25px;
}
.verification {
position: absolute;
top: 1px;
right: 1px;
width: 160px;
height: 47px;
cursor: pointer;
}
}
.tab{
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 24px;
li{
padding: 18px 5px;
margin: 0 20px;
font-size: 16px;
font-weight: 600;
color: #fff;
cursor: pointer;
border-bottom: 2px solid transparent;
&:last-child{
margin-right: 0;
}
&.active{
color: #fff;
border-bottom-color: #ccc;
}
.tab {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 24px;
li {
padding: 18px 5px;
margin: 0 20px;
font-size: 16px;
font-weight: 600;
color: #fff;
cursor: pointer;
border-bottom: 2px solid transparent;
&:last-child {
margin-right: 0;
}
&.active {
color: #fff;
border-bottom-color: #ccc;
}
}
}
.title{
font-size: 16px;
text-align: center;
font-weight: bold;
.title {
font-size: 16px;
text-align: center;
font-weight: bold;
}
.login-btn {
text-align: center;
text-align: center;
}
.login-btn button {
width: 100%;
height: 48px;
margin-bottom: 50px;
font-weight: bold;
background: #1dabff;
border-radius: 4px;
border: 0;
width: 100%;
height: 48px;
margin-bottom: 50px;
font-weight: bold;
background: #1dabff;
border-radius: 4px;
border: 0;
}
.forget{
margin-bottom: 28px;
text-align: right;
color: #999;
font-weight:bold;
&:hover{
color: #0092FF;
.forget {
margin-bottom: 28px;
text-align: right;
color: #999;
font-weight: bold;
&:hover {
color: #0092FF;
}
}
/deep/.user-dia {
.tips {
margin-bottom: 20px;
text-align: center;
color: #666;
}
.users {
li {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 15px;
margin-bottom: 10px;
line-height: 40px;
font-size: 14px;
background-color: #ebeef5;
cursor: pointer;
&.isEnable {
color: #c0c4cc;
background-color: #f5f7fa;
cursor: not-allowed;
}
&:last-child {
margin-bottom: 0;
}
&:hover {
background-color: #d3e0ff;
}
i {
font-size: 16px;
}
}
}
}
</style>

@ -1,56 +1,38 @@
<template>
<div>
<el-card v-if="!id"
shadow="hover"
class="m-b-20">
<el-card v-if="!id" shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="back"
:content="'创建赛事'"></el-page-header>
<el-page-header @back="back" :content="'创建赛事'"></el-page-header>
</div>
</el-card>
<div v-if="step === 1 || (id && !editing)"
:class="['type-wrap', {pd: !id}]">
<div v-if="step === 1 || (id && !editing)" :class="['type-wrap', { pd: !id }]">
<div class="p-title">大赛发布类型</div>
<el-form label-width="100px"
label-suffix=":"
size="small"
:disabled="!editing && id != ''">
<el-form label-width="100px" label-suffix=":" size="small" :disabled="!editing && id != ''">
<el-form-item label="请选择类型">
<el-radio v-model="releaseType"
:label="0">仅发布信息</el-radio>
<el-radio v-model="releaseType"
:label="1">设置完整比赛</el-radio>
<el-radio v-for="(item, i) in releaseTypes" :key="i" v-model="releaseType" :label="item.id">{{ item.name
}}</el-radio>
</el-form-item>
</el-form>
<el-button v-if="!editing && id"
class="edit"
type="primary"
@click="editing = 1"
v-auth="'/match:管理:大赛详情:编辑'">编辑</el-button>
<el-button v-if="!editing && id" class="edit" type="primary" @click="editing = 1"
v-auth="'/match:管理:大赛详情:编辑'">编辑</el-button>
</div>
<el-card v-if="step !== 4"
shadow="hover"
class="m-b-20"
style="position: relative;margin-top: 20px">
<ul :class="['steps', {pointer: !editing && id && publishStatus}]">
<li :class="{active: step === 1,done: step > 1}"
@click="toStep(1)">
<el-card v-if="step !== 4" shadow="hover" class="m-b-20" style="position: relative;margin-top: 20px">
<ul :class="['steps', { pointer: !editing && id && publishStatus }]">
<li :class="{ active: step === 1, done: step > 1 }" @click="toStep(1)">
<span class="circle">1</span>
<p class="text">大赛信息填写</p>
</li>
<template v-if="releaseType">
<li :class="{active: step === 2,done: step > 2}"
@click="toStep(2)">
<li :class="{ active: step === 2, done: step > 2 }" @click="toStep(2)">
<span class="circle circle2">2</span>
<p class="text">赛程与规则设置</p>
</li>
<li :class="{active: step === 3,done: step > 3}"
@click="toStep(3)">
<li :class="{ active: step === 3, done: step > 3 }" @click="toStep(3)">
<span class="circle circle3">3</span>
<p class="text">比赛内容设置</p>
</li>
</template>
<li :class="{done: step > 3}">
<li :class="{ done: step > 3 }">
<span class="circle circle4">{{ releaseType ? 4 : 2 }}</span>
<p class="text">发布{{ !editing && id ? '成功' : '' }}</p>
</li>
@ -58,43 +40,21 @@
</el-card>
<div class="page">
<div class="page-content">
<step1 v-show="step === 1"
ref="step1"
:editing.sync="editing"
@next="next" />
<step2 v-if="step === 2"
ref="step2"
:editing.sync="editing"
:setupId.sync="setupId"
@next="next" />
<step3 v-if="step === 3"
ref="step3"
:editing.sync="editing"
:setupId.sync="setupId"
:competitionId.sync="competitionId"
@next="next" />
<step4 v-if="step === 4"
ref="step4" />
<step1 v-show="step === 1" ref="step1" :editing.sync="editing" @next="next" />
<step2 v-if="step === 2" ref="step2" :editing.sync="editing" :setupId.sync="setupId" @next="next" />
<step3 v-if="step === 3" ref="step3" :editing.sync="editing" :setupId.sync="setupId"
:competitionId.sync="competitionId" @next="next" />
<step4 v-if="step === 4" ref="step4" />
<div v-if="step !== 4 && showBtns"
class="btns">
<div v-if="step !== 4 && showBtns" class="btns">
<!-- 处于编辑状态(列表点编辑按钮进来默认是查看状态不可编辑点了编辑按钮才可编辑)或者新增才显示这几个按钮 -->
<template v-if="editing || !id">
<el-button v-if="!publishStatus"
@click="save(0)">保存{{ releaseType ? '草稿' : '' }}</el-button>
<el-button v-if="step === 2 || step === 3"
type="primary"
@click="prev">上一步</el-button>
<el-button v-if="!releaseType || (releaseType && step === 3)"
type="primary"
@click="save(1)">发布</el-button>
<el-button v-else
type="primary"
@click="save(0, 2)">保存并下一步</el-button>
<el-button v-if="!publishStatus" @click="save(0)">保存{{ releaseType ? '草稿' : '' }}</el-button>
<el-button v-if="step === 2 || step === 3" type="primary" @click="prev">上一步</el-button>
<el-button v-if="!releaseType || (releaseType && step === 3)" type="primary" @click="save(1)">发布</el-button>
<el-button v-else type="primary" @click="save(0, 2)">保存并下一步</el-button>
</template>
<el-button type="danger"
@click="preview"
v-auth="'/match:管理:大赛详情:预览'">预览</el-button>
<el-button type="danger" @click="preview" v-auth="'/match:管理:大赛详情:预览'">预览</el-button>
<el-button @click="cancel">{{ editing ? '取消' : '返回' }}</el-button>
</div>
</div>
@ -123,6 +83,20 @@ export default {
updateTime: 0,
setupId: '',
releaseType: 0,
releaseTypes: [
{
id: 0,
name: '仅发布信息'
},
{
id: 1,
name: '设置完整比赛'
},
// {
// id: 2,
// name: ''
// },
],
editing: this.$route.query.id ? 0 : 1,
showBtns: true,
loadIns: null
@ -179,7 +153,15 @@ export default {
//
next (next, setupId, competitionId) {
if (!next) {
this.$router.push(`/match`)
if (this.step === 3 && this.$refs['step' + this.step].form[0].contentId) {
// &&
this.editing = 0
this.step = 1
this.$parent.initTabs && this.$parent.initTabs()
} else {
//
this.$router.push(`/match`)
}
} else if (next === 2) {
if (setupId) this.setupId = setupId
if (competitionId) {
@ -190,6 +172,12 @@ export default {
this.step++
} else if (next === 1) {
this.step--
} else {
if (typeof setupId === 'function') {
setupId()
} else if (typeof type === 'function') {
type()
}
}
},
//
@ -248,87 +236,104 @@ export default {
<style scoped lang="scss">
.type-wrap {
position: relative;
margin-top: 20px;
background: #fff;
&.pd {
padding: 15px;
}
position: relative;
padding: 10px;
margin-top: 20px;
background: #fff;
&.pd {
padding: 15px;
}
}
.edit {
position: absolute;
top: 30px;
right: 30px;
position: absolute;
top: 30px;
right: 30px;
}
.el-steps {
justify-content: center;
justify-content: center;
}
.steps {
display: flex;
justify-content: center;
&.pointer {
li {
cursor: pointer;
}
}
display: flex;
justify-content: center;
&.pointer {
li {
position: relative;
margin-right: 100px;
text-align: center;
cursor: pointer;
}
.circle {
display: inline-flex;
justify-content: center;
align-items: center;
width: 35px;
margin: 0 auto 10px;
line-height: 35px;
font-size: 18px;
color: #333;
background: #f9f9f9;
border: 5px solid #e1e1e1;
border-radius: 50%;
&:after {
content: '';
position: absolute;
left: 64px;
width: 146px;
height: 3px;
background: #e1e1e1;
}
}
li {
position: relative;
margin-right: 100px;
text-align: center;
}
.circle {
display: inline-flex;
justify-content: center;
align-items: center;
width: 35px;
margin: 0 auto 10px;
line-height: 35px;
font-size: 18px;
color: #333;
background: #f9f9f9;
border: 5px solid #e1e1e1;
border-radius: 50%;
&:after {
content: '';
position: absolute;
left: 64px;
width: 146px;
height: 3px;
background: #e1e1e1;
}
.active {
.circle {
color: #fff;
border-color: #459ffb;
background: #007eff;
}
.text {
color: #007eff;
}
}
.active {
.circle {
color: #fff;
border-color: #459ffb;
background: #007eff;
}
.done {
.circle {
color: #fff;
background: #9c86ff;
border-color: #bbacff;
&:after {
background: #bbacff;
}
}
.text {
color: #9178ff;
}
.text {
color: #007eff;
}
.circle2:after {
left: 71px;
width: 147px;
}
.done {
.circle {
color: #fff;
background: #9c86ff;
border-color: #bbacff;
&:after {
background: #bbacff;
}
}
.circle4:after {
display: none;
.text {
color: #9178ff;
}
}
.circle2:after {
left: 71px;
width: 147px;
}
.circle4:after {
display: none;
}
}
.btns {
text-align: center;
text-align: center;
}
</style>

@ -1,146 +1,192 @@
<template>
<div>
<el-card shadow="hover"
class="m-b-20">
<el-card shadow="hover" class="m-b-20">
<div>
<p class="m-b-20">比赛名称</p>
{{ form.stageName }}
</div>
</el-card>
<el-card shadow="hover"
class="m-b-20">
<el-card shadow="hover" class="m-b-20">
<div>
<p class="m-b-20">比赛时间</p>
<div class="date-inputs">
起止时间
<div style="display: inline-flex;align-items: center;">
<el-date-picker v-model="form.time"
type="datetimerange"
range-separator="~"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
@change="timeChange">
<el-date-picker v-model="form.time" type="datetimerange" range-separator="~" start-placeholder="开始日期"
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
@change="timeChange">
</el-date-picker>
<el-alert style="width: auto;padding: 4px 16px;margin-left: 10px;"
:title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'"
type="error"
:closable="false"
effect="dark">
:title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'" type="error" :closable="false"
effect="dark">
</el-alert>
</div>
</div>
</div>
</el-card>
<el-card shadow="hover"
class="mgr20 m-b-20">
<div>
<p class="m-b-20">课程</p>
<div class="inline-input">
<el-cascader ref="cur"
v-model="mallIds"
:options="curs"
:props="{ checkStrictly: true, value: 'id' }"
popper-class="course-cas"
@expand-change="curChange"
@change="curChange"></el-cascader>
<!-- 理论系统 -->
<template v-if="isTheory">
<!-- 理论系统选择试卷库非理论则选择系统 -->
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">试卷库</p>
<div class="inline-input">
<el-select v-model="libraryId" placeholder="请选择试卷库" @change="getProject">
<el-option v-for="(item, i) in paperLibraries" :key="i" :label="item.libraryName" :value="item.libraryId">
</el-option>
</el-select>
</div>
</div>
</div>
</el-card>
<el-card shadow="hover"
class="m-b-20">
<div class="flex-between m-b-20">
<span>实训项目</span>
<div style="display: inline-flex;">
<div>
<el-input placeholder="请输入项目名称"
prefix-icon="el-icon-search"
v-model.trim="keyword"
clearable></el-input>
</el-card>
<el-card shadow="hover" class="m-b-20">
<div class="flex-between m-b-20">
<span>理论试卷</span>
<div style="display: inline-flex;">
<div>
<el-input placeholder="请输入试卷名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input>
</div>
</div>
<el-button style="margin-left: 5px"
type="primary"
round
@click="toProject">自定义实验项目</el-button>
</div>
</div>
<!-- 实训项目表格 -->
<el-table :data="projects"
class="table"
stripe
header-align="center">
<el-table-column width="60"
label="选择"
align="center">
<template slot-scope="scope">
<el-radio v-model="form.projectId"
:label="scope.row.projectId">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column prop="projectName"
label="项目名称"
align="center"></el-table-column>
<el-table-column prop="auth"
label="项目权限"
align="center">
<template slot-scope="scope">
{{ permissionsKeys[scope.row.permissions] }}
</template>
</el-table-column>
<el-table-column prop="founder"
label="创建人"
align="center">
<template slot-scope="scope">
{{ scope.row.founder ? '老师创建' : '系统内置' }}
</template>
</el-table-column>
<el-table-column prop="createTime"
label="创建时间"
align="center"></el-table-column>
<!-- <el-table-column label="操作" align="center">
<p v-if="form.paperName" style="margin-bottom: 20px">
已选试卷{{ form.paperName }}
<el-button type="primary" size="mini" @click="previewPaper(form)">预览</el-button>
</p>
<el-table :data="projects" class="table" stripe header-align="center">
<el-table-column width="60" label="选择" align="center">
<template slot-scope="scope">
<el-radio v-model="form.paperId" :label="scope.row.paperId" @change="paperChange">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="name" label="试卷名称" min-width="140" align="center"></el-table-column>
<el-table-column prop="questionCount" label="试题总数" align="center" min-width="70"></el-table-column>
<el-table-column prop="score" label="总分" align="center" min-width="70"></el-table-column>
<el-table-column prop="difficult" label="试卷难度" align="center" min-width="70" sortable="custom">
<template slot-scope="scope">{{ difficults.find(e => e.id === scope.row.difficult) ? difficults.find(e =>
e.id === scope.row.difficult).name : '' }}</template>
</el-table-column>
<el-table-column prop="suggestTime" label="建议用时" align="center" min-width="70">
<template slot-scope="scope">{{ scope.row.suggestTime }}min</template>
</el-table-column>
<el-table-column prop="classificationPath" label="试卷分类" align="center" min-width="70"
show-overflow-tooltip></el-table-column>
<el-table-column label="建议用途" align="center" min-width="70">
<template slot-scope="scope">{{ paperTypes.find(e => e.id === scope.row.paperType) ? paperTypes.find(e =>
e.id === scope.row.paperType).name : '' }}</template>
</el-table-column>
<el-table-column prop="updateTime" label="最近编辑时间" align="center" width="170"></el-table-column>
<el-table-column prop="createUser" label="最近编辑人" align="center" width="110"></el-table-column>
<el-table-column label="操作" align="center" width="80">
<template slot-scope="scope">
<el-button type="text" @click="previewPaper(scope.row)">预览</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background :page-size="pageSize" @current-change="handleCurrentChange"
layout="total,prev, pager, next" :total="total"></el-pagination>
</div>
</el-card>
</template>
<template v-else>
<el-card shadow="hover" class="mgr20 m-b-20">
<div>
<p class="m-b-20">课程</p>
<div class="inline-input">
<el-cascader ref="cur" v-model="mallIds" :options="curs" :props="{ checkStrictly: true, value: 'id' }"
popper-class="course-cas" @expand-change="curChange" @change="curChange"></el-cascader>
</div>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<div class="flex-between m-b-20">
<span>实训项目</span>
<div style="display: inline-flex;">
<div>
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input>
</div>
<el-button style="margin-left: 5px" type="primary" round @click="toProject">自定义实验项目</el-button>
</div>
</div>
<!-- 实训项目表格 -->
<el-table :data="projects" class="table" stripe header-align="center">
<el-table-column width="60" label="选择" align="center">
<template slot-scope="scope">
<el-radio v-model="form.projectId" :label="scope.row.projectId">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
<el-table-column prop="auth" label="项目权限" align="center">
<template slot-scope="scope">
{{ permissionsKeys[scope.row.permissions] }}
</template>
</el-table-column>
<el-table-column prop="founder" label="创建人" align="center">
<template slot-scope="scope">
{{ scope.row.founder ? '老师创建' : '系统内置' }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
<!-- <el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="showProject(scope.row)">查看</el-button>
</template>
</el-table-column> -->
</el-table>
<div class="pagination">
<el-pagination background
:page-size="pageSize"
@current-change="handleCurrentChange"
layout="total,prev, pager, next"
:total="total"></el-pagination>
</div>
</el-card>
</el-table>
<div class="pagination">
<el-pagination background :page-size="pageSize" @current-change="handleCurrentChange"
layout="total,prev, pager, next" :total="total"></el-pagination>
</div>
</el-card>
</template>
<div style="text-align: center">
<el-button @click="back">返回</el-button>
<el-button type="primary"
@click="save">保存</el-button>
<el-button type="primary" @click="save">保存</el-button>
</div>
</div>
</template>
<script>
import Setting from '@/setting'
import util from "@/libs/util";
import { Loading } from 'element-ui'
import TestPaperConst from '@/const/testPaper'
export default {
props: ['form', 'step1'],
data () {
return {
difficults: TestPaperConst.difficults,
paperTypes: TestPaperConst.paperTypes,
loadIns: null,
mallIds: [],
curs: [],
paperLibraries: [],
testPapers: [],
keyword: '',
projects: [],
page: 1,
pageSize: 5,
total: 0,
libraryId: '',
sysId: '',
paperId: '',
paperName: '',
permissionsKeys: ['练习', '考核', '竞赛'],
timeInvalid: false
timeInvalid: false,
};
},
computed: {
//
isTheory () {
return this.form.method === 1
},
},
watch: {
// ,
form: {
@ -157,7 +203,7 @@ export default {
}
},
mounted () {
this.getCourse()
this.isTheory ? this.getLibrary() : this.getCourse()
},
methods: {
//
@ -186,7 +232,7 @@ export default {
records.map(e => {
e.id = +e.mallId
e.label = e.productName
e.children = serviceList.records.filter(n => e.systemId.split(',').includes(n.systemId)) //
e.children = serviceList.records.filter(n => e.systemId && e.systemId.split(',').includes(n.systemId)) //
})
this.curs = records
@ -216,31 +262,65 @@ export default {
this.loadIns = Loading.service()
this.getProject()
},
//
async getLibrary () {
try {
const res = await this.$post(this.api.libraryList, {
pageNum: 1,
pageSize: 10000,
type: 1,
isDisable: 0,
})
const { records } = res.pageList
if (records.length) {
this.paperLibraries = records
this.libraryId = records[0].libraryId
this.loadIns = Loading.service()
this.getProject()
}
} finally { }
},
//
getProject () {
this.$post(this.api.getProjectAssessmentByCompetition, {
pageNum: this.page,
pageSize: this.pageSize,
cid: this.form.cid,
projectName: this.keyword,
systemId: this.sysId,
permissions: 2
}).then(({ data }) => {
this.projects = data.records
this.total = data.total
this.loadIns.close()
}).catch(err => {
// /
async getProject () {
try {
//
if (this.isTheory) {
const res = await this.$post(this.api.examPaperList, {
pageNum: this.page,
pageSize: this.pageSize,
type: 1,
keyWord: this.keyword,
libraryId: this.libraryId,
isDisable: 0,
status: 1
})
this.projects = res.pageList.records
this.total = res.pageList.total
} else {
//
const { data } = await this.$post(this.api.getProjectAssessmentByCompetition, {
pageNum: this.page,
pageSize: this.pageSize,
cid: this.form.cid,
projectName: this.keyword,
systemId: this.sysId,
permissions: 2,
})
this.projects = data.records
this.total = data.total
}
} finally {
this.loadIns.close()
});
}
},
initData () {
this.page = 1;
this.getProject();
this.page = 1
this.getProject()
},
handleCurrentChange (val) {
this.page = val;
this.getProject();
this.page = val
this.getProject()
},
//
toProject () {
@ -277,22 +357,58 @@ export default {
}
}
},
//
previewPaper (row) {
this.$parent.previewPaper(row)
},
//
paperChange (id) {
const item = this.projects.find(e => e.paperId === id)
if (item) this.form.paperName = item.name
},
//
save () {
const { form } = this
if (!form.time.length) return util.warningMsg('请选择比赛时间')
const { playStartTime, playEndTime } = this.step1
if (new Date(form.time[0]) < new Date(playStartTime) || new Date(form.time[1]) > new Date(playEndTime)) return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
if (!form.cid) return util.warningMsg('请选择课程')
if (!form.projectId) return util.warningMsg('请选择项目')
const { systemId, systemName, projectName } = this.projects.find(e => e.projectId == form.projectId)
if (systemId) form.systemId = systemId
if (projectName) form.projectName = projectName
if (systemName) form.systemName = systemName
//
if (this.isTheory) {
if (!this.libraryId) return util.warningMsg('请选择试卷库')
if (!form.paperId) return util.warningMsg('请选择试卷')
form.libraryId = this.libraryId
const curPaper = this.projects.find(e => e.paperId === form.paperId)
if (curPaper) form.paperName = curPaper.name
} else {
if (!form.cid) return util.warningMsg('请选择课程')
if (!form.projectId) return util.warningMsg('请选择项目')
const { systemId, systemName, projectName } = this.projects.find(e => e.projectId == form.projectId)
if (systemId) form.systemId = systemId
if (projectName) form.projectName = projectName
if (systemName) form.systemName = systemName
}
form.startTime = form.time[0]
form.endTime = form.time[1]
this.handlePaper()
this.$emit('hideSet', this.form)
},
//
async handlePaper () {
const { form } = this
// id
if (form.paperName !== form.originPaperName) {
const res = await this.$post(this.api.copyExamPaper, {
associatedID: form.stageId,
paperId: form.paperId,
typeId: 1
})
if (res.examPaper) {
form.paperId = res.examPaper.paperId
}
}
},
//
back () {
this.$emit('update:form', this.$parent.curOriginForm)
@ -302,5 +418,4 @@ export default {
};
</script>
<style scoped lang="scss">
</style>
<style scoped lang="scss"></style>

@ -3,272 +3,220 @@
<div class="page">
<div class="page-content">
<div class="p-title">大赛信息</div>
<el-form label-width="170px"
label-suffix=":"
size="small"
:disabled="!editing && form.id !== ''">
<el-form label-width="170px" label-suffix=":" size="small" :disabled="!editing && form.id !== ''">
<el-form-item label="竞赛封面(选填)">
<el-upload class="avatar-uploader"
accept=".jpg,.png,.jpeg,.gif"
:on-remove="handleRemove"
:on-error="uploadError"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
action=""
:http-request="handleRequest">
<img v-if="form.coverUrl"
:src="form.coverUrl"
class="avatar">
<div class="uploader-default"
v-else>
<el-upload class="avatar-uploader" accept=".jpg,.png,.jpeg,.gif" :on-remove="handleRemove"
:on-error="uploadError" :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" action=""
:http-request="handleRequest">
<img v-if="form.coverUrl" :src="form.coverUrl" class="avatar">
<div class="uploader-default" v-else>
<i class="el-icon-plus"></i>
<p>上传封面</p>
</div>
<div slot="tip"
class="el-upload__tip">
<div slot="tip" class="el-upload__tip">
<p>展示宽度为220高度140JPG/PNG/GIF3MB以内</p>
</div>
</el-upload>
</el-form-item>
<el-form-item label="竞赛封面长图(选填)">
<el-upload class="avatar-uploader avatar-uploader-lg"
accept=".jpg,.png,.jpeg,.gif"
:on-remove="handleLgRemove"
:on-error="uploadError"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
action=""
:http-request="handleRequestLg">
<img v-if="form.carouselUrl"
:src="form.carouselUrl"
class="avatar-lg">
<div class="uploader-default"
v-else>
<el-upload class="avatar-uploader avatar-uploader-lg" accept=".jpg,.png,.jpeg,.gif"
:on-remove="handleLgRemove" :on-error="uploadError" :before-remove="beforeRemove" :limit="1"
:on-exceed="handleExceed" action="" :http-request="handleRequestLg">
<img v-if="form.carouselUrl" :src="form.carouselUrl" class="avatar-lg">
<div class="uploader-default" v-else>
<i class="el-icon-plus"></i>
<p>上传封面</p>
</div>
<div slot="tip"
class="el-upload__tip">
<div slot="tip" class="el-upload__tip">
<p>展示宽度为1920高度300JPG/PNG/GIF3MB以内</p>
</div>
</el-upload>
</el-form-item>
<el-form-item class="req"
label="竞赛名称">
<el-form-item class="req" label="竞赛名称">
<div class="d-inline-block">
<el-input placeholder="请输入竞赛名称"
v-model="form.name"
clearable></el-input>
<el-input placeholder="请输入竞赛名称" v-model="form.name" clearable></el-input>
</div>
</el-form-item>
<el-form-item class="req"
label="主办方">
<div class="inline-input">
<div class="input-wrap"
v-for="(item,index) in sponsorList"
:key="index">
<el-input placeholder="主办方名称"
v-model="sponsorList[index]"></el-input>
<i v-if="sponsorList.length > 1"
class="remove"
@click="delSponsor(index)"></i>
<button v-if="index == 0"
class="add-btn"
type="button"
:disabled="!editing && form.id !== ''"
@click="addSponsor">
<i class="el-icon-plus"></i>
<span>添加</span>
</button>
</div>
</div>
</el-form-item>
<el-form-item label="承办方(选填)">
<div class="inline-input">
<div class="input-wrap"
v-for="(item,index) in undertakerList"
:key="index">
<el-input placeholder="承办方名称"
v-model="undertakerList[index]"></el-input>
<i v-if="undertakerList.length > 1"
class="remove"
@click="delOrganizer(index)"></i>
<button v-if="index == 0"
class="add-btn"
type="button"
:disabled="!editing && form.id !== ''"
@click="addOrganizer">
<i class="el-icon-plus"></i>
<span>添加</span>
</button>
<template v-if="!isPractice">
<el-form-item class="req" label="主办方">
<div class="inline-input">
<div class="input-wrap" v-for="(item, index) in sponsorList" :key="index">
<el-input placeholder="主办方名称" v-model="sponsorList[index]"></el-input>
<i v-if="sponsorList.length > 1" class="remove" @click="delSponsor(index)"></i>
<button v-if="index == 0" class="add-btn" type="button" :disabled="!editing && form.id !== ''"
@click="addSponsor">
<i class="el-icon-plus"></i>
<span>添加</span>
</button>
</div>
</div>
</div>
<button v-if="!undertakerList.length"
class="add-btn"
type="button"
</el-form-item>
<el-form-item label="承办方(选填)">
<div class="inline-input">
<div class="input-wrap" v-for="(item, index) in undertakerList" :key="index">
<el-input placeholder="承办方名称" v-model="undertakerList[index]"></el-input>
<i v-if="undertakerList.length > 1" class="remove" @click="delOrganizer(index)"></i>
<button v-if="index == 0" class="add-btn" type="button" :disabled="!editing && form.id !== ''"
@click="addOrganizer">
<i class="el-icon-plus"></i>
<span>添加</span>
</button>
</el-form-item>
<el-form-item class="req"
label="报名时间">
<el-date-picker v-model="signupTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions"></el-date-picker>
</el-form-item>
<el-form-item class="req"
label="竞赛时间">
<el-date-picker v-model="playTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions"></el-date-picker>
<i class="el-icon-plus"></i>
<span>添加</span>
</button>
</div>
</div>
<button v-if="!undertakerList.length" class="add-btn" type="button" @click="addOrganizer">
<i class="el-icon-plus"></i>
<span>添加</span>
</button>
</el-form-item>
<el-form-item class="req" label="报名时间">
<el-date-picker v-model="signupTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:picker-options="pickerOptions"></el-date-picker>
</el-form-item>
</template>
<el-form-item class="req" label="竞赛时间">
<el-date-picker v-model="playTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:picker-options="pickerOptions"></el-date-picker>
</el-form-item>
<el-form-item class="req"
label="比赛范围">
<el-form-item class="req" label="比赛范围">
<div v-if="form.id">
<el-radio v-model="form.competitionScope"
:label="0"
disabled>本校内</el-radio>
<el-radio v-model="form.competitionScope" :label="0" disabled>本校内</el-radio>
</div>
<div>
<el-radio v-model="form.competitionScope"
:label="1">全平台</el-radio>
<el-radio v-model="form.competitionScope" :label="1">全平台</el-radio>
</div>
<div>
<el-radio v-model="form.competitionScope"
:label="2">指定区域院校</el-radio>
<el-radio v-model="form.competitionScope" :label="2">指定区域院校</el-radio>
<template v-if="form.competitionScope === 2">
<el-button type="primary"
size="mini"
@click="showRange">选择院校</el-button>
<el-button type="primary" size="mini" @click="showRange">选择院校</el-button>
<span style="margin-left: 20px">{{ rangeName }}</span>
</template>
</div>
</el-form-item>
<el-form-item class="req"
label="竞赛类型">
<el-radio v-model="form.completeCompetitionSetup.competitionType"
:label="0">个人赛</el-radio>
<el-radio v-model="form.completeCompetitionSetup.competitionType"
:label="1">团队赛</el-radio>
</el-form-item>
<el-form-item class="req"
v-if="!form.completeCompetitionSetup.competitionType"
label="报名人数上限">
<div class="input-center">
<el-input placeholder="请输入人数"
v-model.number="form.completeCompetitionSetup.quantityLimit"
type="number"></el-input>
</div>
</el-form-item>
<template v-if="form.completeCompetitionSetup.competitionType">
<el-form-item class="req"
label="报名团队数上限">
<template v-if="!isPractice">
<el-form-item class="req" label="竞赛类型">
<el-radio v-model="form.completeCompetitionSetup.competitionType" :label="0">个人赛</el-radio>
<el-radio v-model="form.completeCompetitionSetup.competitionType" :label="1">团队赛</el-radio>
</el-form-item>
<el-form-item class="req" v-if="!form.completeCompetitionSetup.competitionType" label="报名人数上限">
<div class="input-center">
<el-input placeholder="请输入团队数"
v-model.number="form.completeCompetitionSetup.quantityLimit"
type="number"></el-input>
<el-input placeholder="请输入人数" v-model.number="form.completeCompetitionSetup.quantityLimit"
type="number"></el-input>
</div>
</el-form-item>
<el-form-item class="req"
label="团队人数">
<div class="input-center"
style="width: 250px;">
<el-input v-model.number="form.completeCompetitionSetup.minTeamSize"
type="number"></el-input>
<el-input style="margin-left: 5px;"
v-model.number="form.completeCompetitionSetup.maxTeamSize"
type="number"></el-input> /
<template v-if="form.completeCompetitionSetup.competitionType">
<el-form-item class="req" label="报名团队数上限">
<div class="input-center">
<el-input placeholder="请输入团队数" v-model.number="form.completeCompetitionSetup.quantityLimit"
type="number"></el-input>
</div>
</el-form-item>
<el-form-item class="req" label="团队人数">
<div class="input-center" style="width: 250px;">
<el-input v-model.number="form.completeCompetitionSetup.minTeamSize" type="number"></el-input>
<el-input style="margin-left: 5px;" v-model.number="form.completeCompetitionSetup.maxTeamSize"
type="number"></el-input> /
</div>
</el-form-item>
</template>
<el-form-item class="req" label="报名邀请码">
<div class="input-center" style="width: 550px;">
<el-radio v-model="form.completeCompetitionSetup.isNeedCode" :label="0">不需要</el-radio>
<el-radio v-model="form.completeCompetitionSetup.isNeedCode" :label="1">需要</el-radio>
<el-input style="width: 250px" placeholder="请输入4位邀请码或点击随机生成"
v-model="form.completeCompetitionSetup.invitationCode"
:disabled="form.completeCompetitionSetup.isNeedCode === 0"></el-input>
<el-button v-if="form.completeCompetitionSetup.isNeedCode === 1" @click="randomInv">随机</el-button>
</div>
</el-form-item>
</template>
<el-form-item class="req"
label="报名邀请码">
<div class="input-center"
style="width: 550px;">
<el-radio v-model="form.completeCompetitionSetup.isNeedCode"
:label="0">不需要</el-radio>
<el-radio v-model="form.completeCompetitionSetup.isNeedCode"
:label="1">需要</el-radio>
<el-input style="width: 250px"
placeholder="请输入4位邀请码或点击随机生成"
v-model="form.completeCompetitionSetup.invitationCode"
:disabled="form.completeCompetitionSetup.isNeedCode === 0"></el-input>
<el-button v-if="form.completeCompetitionSetup.isNeedCode === 1"
@click="randomInv">随机</el-button>
</div>
</el-form-item>
<el-form-item class="req"
label="竞赛详情">
<quill v-if="quillShow"
:border="true"
v-model="form.description"
:height="400"
:readonly="!editing && form.id !== ''" />
<el-form-item class="req" label="竞赛详情">
<quill v-if="quillShow" :border="true" v-model="form.description" :height="400"
:readonly="!editing && form.id !== ''" />
</el-form-item>
<el-form-item label="附件">
<Upload :limit="5"
:file-list.sync="fileList"
:on-remove="handleAnnexRemove"
@onSuccess="uploadAnnexSuccess" />
<Upload :limit="5" :file-list.sync="fileList" :on-remove="handleAnnexRemove"
@onSuccess="uploadAnnexSuccess" />
</el-form-item>
<template v-if="isPractice">
<el-form-item label="比赛方式">
<el-radio-group v-model="form.type">
<el-radio :label="0">实训</el-radio>
<el-radio :label="1">理论</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="比赛内容">
<el-button style="margin-bottom: 10px;" size="small" type="primary">选择理论试卷</el-button>
<el-table :data="list" class="table" ref="table" stripe header-align="center" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="name" label="试卷名称" align="center" min-width="100"></el-table-column>
<el-table-column prop="questionCount" label="试题总数" align="center" width="70"></el-table-column>
<el-table-column prop="score" label="总分" align="center" width="60"></el-table-column>
<el-table-column prop="questionType" label="题型" align="center" min-width="90"
show-overflow-tooltip></el-table-column>
<el-table-column prop="difficult" label="试卷难度" align="center" width="100" sortable="custom">
<!-- <template slot-scope="scope">{{ difficults.find(e => e.id === scope.row.difficult) ? difficults.find(e
=>
e.id === scope.row.difficult).name : '' }}</template> -->
</el-table-column>
<el-table-column prop="suggestTime" label="建议用时" align="center" width="70">
<template slot-scope="scope">{{ scope.row.suggestTime }}min</template>
</el-table-column>
<el-table-column prop="classificationPath" label="试卷分类" align="center" width="90"
show-overflow-tooltip></el-table-column>
<el-table-column label="建议用途" align="center" width="70">
<!-- <template slot-scope="scope">{{ paperTypes.find(e => e.id === scope.row.paperType) ? paperTypes.find(e
=>
e.id === scope.row.paperType).name : '' }}</template> -->
</el-table-column>
<el-table-column prop="updateTime" label="最近编辑时间" align="center" width="160"
sortable="custom"></el-table-column>
<el-table-column prop="createUser" label="最近编辑人" align="center" width="90"></el-table-column>
<el-table-column label="操作" align="center" width="240">
<template slot-scope="scope">
<el-button type="text" @click="toDetail(scope.row, 1)">复制</el-button>
<!-- <el-button type="text" @click="edit(scope.row)">预览</el-button> -->
<el-button type="text" @click="toDetail(scope.row)">编辑</el-button>
<el-button type="text" @click="del(scope.row)">删除</el-button>
<el-switch v-if="!scope.row.status" v-model="scope.row.isDisable" :active-value="false"
:inactive-value="true" style="margin: 0 10px 0 5px" :active-text="scope.row.isDisable ? '关' : '开'"
@change="switchOff($event, scope.row, scope.$index)"></el-switch>
</template>
</el-table-column>
</el-table>
</el-form-item>
</template>
</el-form>
</div>
</div>
<el-dialog title="请勾选院校"
:visible.sync="rangeVisible"
width="580px"
custom-class="range-dia"
:close-on-click-modal="false">
<el-dialog title="请勾选院校" :visible.sync="rangeVisible" width="580px" custom-class="range-dia"
:close-on-click-modal="false">
<div class="range-wrap">
<el-cascader ref="range"
class="range-cas"
key="range"
v-model="range"
:props="props"
:show-all-levels="false"
clearable
filterable
:before-filter="beforeFilter"
:options="rangeList"
@change="rangeChange"
@visible-change="rangeViChange"
@input.native="rangeSearch"></el-cascader>
<el-tag v-for="(tag, i) in rangeChecked"
:key="tag.value"
class="range-check"
closable
:disable-transitions="false"
@close="val => closeRange(i)">
{{tag.label}}
<el-cascader ref="range" class="range-cas" key="range" v-model="range" :props="props" :show-all-levels="false"
clearable filterable :before-filter="beforeFilter" :options="rangeList" @change="rangeChange"
@visible-change="rangeViChange" @input.native="rangeSearch"></el-cascader>
<el-tag v-for="(tag, i) in rangeChecked" :key="tag.value" class="range-check" closable
:disable-transitions="false" @close="val => closeRange(i)">
{{ tag.label }}
</el-tag>
</div>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
@click="rangeVisible = false"> </el-button>
<el-button size="small"
type="primary"
@click="rangeSubmit"> </el-button>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="rangeVisible = false"> </el-button>
<el-button size="small" type="primary" @click="rangeSubmit"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from "@/libs/util";
import Util from "@/libs/util";
import quill from "@/components/quill";
import Upload from '@/components/upload';
import Oss from '@/components/upload/upload.js'
@ -392,13 +340,19 @@ export default {
},
submiting: false,
updateTime: 0,
quillShow: true
quillShow: true,
originSignUpEndTime: '',
};
},
components: {
quill,
Upload
},
computed: {
isPractice () {
return this.$parent.releaseType === 2
},
},
watch: {
editing: function (val) {
this.quillShow = false
@ -440,7 +394,7 @@ export default {
},
methods: {
getData () {
const { id } = this.form
const { id } = this.$route.query
id && this.$post(`${this.api.getCompetition}?competitionId=${id}`).then(({ competition }) => {
this.$parent.publishStatus = competition.publishStatus
this.$parent.releaseType = competition.releaseType
@ -488,6 +442,7 @@ export default {
})
this.rangeName = range.join(',')
}
this.originSignUpEndTime = competition.signUpEndTime
this.form = competition
this.$parent.resumeData()
this.$nextTick(() => {
@ -580,7 +535,7 @@ export default {
this.rangeVisible = false
},
handleExceed (files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
Util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
},
//
async handleRequest ({ file }) {
@ -647,33 +602,33 @@ export default {
const form = JSON.parse(JSON.stringify(this.form))
form.sponsor = this.sponsorList.filter(d => d).join();
form.undertaker = this.undertakerList.filter(d => d).join();
if (!form.name) return util.warningMsg("请填写竞赛名称");
if (!form.name) return Util.warningMsg("请填写竞赛名称");
//
if (next === 2) {
if (form.competitionScope == 2 && (!form.competitionRangeList || !form.competitionRangeList.length)) return util.warningMsg('请选择区域、院校')
if (!form.sponsor) return util.warningMsg("请填写主办方");
if (!form.signUpStartTime) return util.warningMsg("请选择报名时间");
if (form.competitionScope == 2 && (!form.competitionRangeList || !form.competitionRangeList.length)) return Util.warningMsg('请选择区域、院校')
if (!form.sponsor) return Util.warningMsg("请填写主办方");
if (!form.signUpStartTime) return Util.warningMsg("请选择报名时间");
let now = new Date().getTime();
let signUpStartTime = new Date(form.signUpStartTime).getTime();
let signUpEndTime = new Date(form.signUpEndTime).getTime();
let playStartTime = new Date(form.playStartTime).getTime();
if (!form.playStartTime) return util.warningMsg("请选择竞赛时间");
if (playStartTime && signUpEndTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
if (!form.playStartTime) return Util.warningMsg("请选择竞赛时间");
if (playStartTime && signUpEndTime && playStartTime < signUpEndTime) return Util.warningMsg("竞赛时间不能早于报名结束时间");
const { competitionType, quantityLimit, minTeamSize, maxTeamSize, isNeedCode, invitationCode } = form.completeCompetitionSetup
//
if (competitionType) {
if (quantityLimit === '') return util.warningMsg('请填写报名团队数上限')
if (quantityLimit < 0) return util.warningMsg('报名团队数上限不得小于0')
if (minTeamSize === '') return util.warningMsg('请填写团队人数下限')
if (minTeamSize < 2) return util.warningMsg('团队人数下限不得小于2')
if (maxTeamSize === '') return util.warningMsg('请填写团队人数上限')
if (minTeamSize > maxTeamSize) return util.warningMsg('团队人数上限不得小于下限')
if (quantityLimit === '') return Util.warningMsg('请填写报名团队数上限')
if (quantityLimit < 0) return Util.warningMsg('报名团队数上限不得小于0')
if (minTeamSize === '') return Util.warningMsg('请填写团队人数下限')
if (minTeamSize < 2) return Util.warningMsg('团队人数下限不得小于2')
if (maxTeamSize === '') return Util.warningMsg('请填写团队人数上限')
if (minTeamSize > maxTeamSize) return Util.warningMsg('团队人数上限不得小于下限')
} else { //
if (quantityLimit === '') return util.warningMsg('请填写报名人数上限')
if (quantityLimit < 0) return util.warningMsg('报名人数上限不得小于0')
if (quantityLimit === '') return Util.warningMsg('请填写报名人数上限')
if (quantityLimit < 0) return Util.warningMsg('报名人数上限不得小于0')
}
if (isNeedCode && (!invitationCode || invitationCode.length !== 4)) return util.warningMsg('请填写四位数邀请码')
if (!form.description) return util.warningMsg("请填写竞赛详情");
if (isNeedCode && (!invitationCode || invitationCode.length !== 4)) return Util.warningMsg('请填写四位数邀请码')
if (!form.description) return Util.warningMsg("请填写竞赛详情");
} else {
if (form.competitionScope == 2 && (!form.competitionRangeList || !form.competitionRangeList.length)) form.competitionScope = 1
}
@ -681,14 +636,15 @@ export default {
// delete form.publishStatus
// if (status === 1) form.publishStatus = 1
form.publishStatus = status
form.id = this.$route.query.id
form.ztOpen = form.id ? form.ztOpen : (status ? 0 : 1) //
form.releaseType = releaseType
form.id = this.$route.query.id
if (form.id) {
this.$post(this.api.editCompetition, form).then(res => {
this.$post(this.api.editCompetition, form).then(async () => {
this.$parent.hideLoad()
this.updateTime && util.successMsg("修改成功");
this.updateTime && Util.successMsg("修改成功")
this.updateTime = 0
await this.automaticAllocation(status)
this.$emit('next', next)
}).catch(err => {
this.$parent.hideLoad()
@ -697,29 +653,47 @@ export default {
this.$post(this.api.addCompetition, form).then(({ competitionId, setupId }) => {
this.updateTime = 0
this.$parent.hideLoad()
util.successMsg("创建成功");
Util.successMsg("创建成功")
this.$emit('next', next, setupId, competitionId)
}).catch(err => {
this.$parent.hideLoad()
});
}
},
//
async automaticAllocation (status) {
//
if (this.form.completeCompetitionSetup.competitionType) {
const { signUpEndTime } = this.form
const { id } = this.$route.query
const now = await Util.getNow()
//
if (this.originSignUpEndTime && signUpEndTime !== this.originSignUpEndTime && (new Date(signUpEndTime) < now || (new Date(this.originSignUpEndTime) < now && new Date(signUpEndTime) > now))) {
await this.$post(this.api.updateEventAllocationRecord, {
competitionId: id,
whetherToModifyTheRule: 1,
})
this.originSignUpEndTime = signUpEndTime
}
}
},
//
preview () {
util.local.set('match', this.form)
Util.local.set('match', this.form)
window.open(this.$router.resolve('/matchPreview').href)
},
addSponsor () {
this.sponsorList.push("");
this.sponsorList.push('')
},
delSponsor (index) {
this.sponsorList.splice(index, 1);
this.sponsorList.splice(index, 1)
},
addOrganizer () {
this.undertakerList.push("");
this.undertakerList.push('')
},
delOrganizer (index) {
this.undertakerList.splice(index, 1);
this.undertakerList.splice(index, 1)
}
}
};
@ -729,164 +703,172 @@ export default {
$upload-width: 220px;
$upload-height: 140px;
$upload-lg-height: 150px;
/deep/ .avatar-uploader {
.el-upload {
position: relative;
width: $upload-width;
height: $upload-height;
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
overflow: hidden;
&:hover {
border-color: #cb221c;
}
.el-upload {
position: relative;
width: $upload-width;
height: $upload-height;
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
overflow: hidden;
.uploader-default {
display: flex;
height: $upload-height;
flex-direction: column;
justify-content: center;
text-align: center;
background: rgba(0, 0, 0, 0.04);
i {
font-size: 20px;
font-weight: bold;
color: #8c939d;
}
p {
margin-top: 10px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
line-height: 1;
}
}
&:hover {
border-color: #cb221c;
}
&.avatar-uploader-lg {
.el-upload {
width: 100%;
max-width: 960px;
height: $upload-lg-height;
.uploader-default {
display: flex;
height: $upload-height;
flex-direction: column;
justify-content: center;
text-align: center;
background: rgba(0, 0, 0, 0.04);
.uploader-default {
height: $upload-lg-height;
}
}
}
i {
font-size: 20px;
font-weight: bold;
color: #8c939d;
}
.avatar {
display: block;
width: $upload-width;
height: $upload-height;
p {
margin-top: 10px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
line-height: 1;
}
}
}
&.avatar-uploader-lg {
.el-upload {
width: 100%;
max-width: 960px;
height: $upload-lg-height;
.avatar-lg {
display: block;
width: 100%;
.uploader-default {
height: $upload-lg-height;
}
}
}
.el-upload__tip {
margin-top: 0;
.avatar {
display: block;
width: $upload-width;
height: $upload-height;
}
p {
font-size: 14px;
color: rgba(0, 0, 0, 0.45);
line-height: 1;
.avatar-lg {
display: block;
width: 100%;
height: $upload-lg-height;
}
&:first-child {
margin-bottom: 5px;
}
}
.el-upload__tip {
margin-top: 0;
p {
font-size: 14px;
color: rgba(0, 0, 0, 0.45);
line-height: 1;
&:first-child {
margin-bottom: 5px;
}
}
}
}
/deep/ .d-inline-block {
width: 216px;
width: 216px;
.el-select,
.el-input {
width: 100%;
}
.el-select,
.el-input {
width: 100%;
}
}
.inline-input {
.input-wrap {
display: flex;
align-items: center;
margin-bottom: 10px;
.el-input {
display: inline-block;
width: 216px;
margin-right: 8px;
}
.input-wrap {
display: flex;
align-items: center;
margin-bottom: 10px;
.remove {
width: 16px;
height: 16px;
background: url('../../../assets/img/close.png') 0 0 / cover no-repeat;
cursor: pointer;
}
.el-input {
display: inline-block;
width: 216px;
margin-right: 8px;
}
.add-btn {
margin-left: 32px;
.remove {
width: 16px;
height: 16px;
background: url('../../../assets/img/close.png') 0 0 / cover no-repeat;
cursor: pointer;
}
}
.add-btn {
margin-left: 32px;
}
}
.add-btn {
display: flex;
justify-content: center;
align-items: center;
width: 216px;
line-height: 32px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
background-color: transparent;
border: 1px dashed rgba(0, 0, 0, 0.15);
border-radius: 4px;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
width: 216px;
line-height: 32px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
background-color: transparent;
border: 1px dashed rgba(0, 0, 0, 0.15);
border-radius: 4px;
cursor: pointer;
i {
margin-right: 8px;
font-size: 14px;
font-weight: bold;
}
i {
margin-right: 8px;
font-size: 14px;
font-weight: bold;
}
}
.range-check {
display: inline-block;
margin: 0 0 10px 10px;
display: inline-block;
margin: 0 0 10px 10px;
}
/deep/.range-cas {
.el-tag {
display: none;
}
.el-tag {
display: none;
}
}
.input-center {
display: flex;
align-items: center;
width: 216px;
white-space: nowrap;
.el-input {
margin-right: 5px;
}
display: flex;
align-items: center;
width: 216px;
white-space: nowrap;
.el-input {
margin-right: 5px;
}
}
.el-steps {
justify-content: center;
justify-content: center;
}
/deep/.req {
.el-form-item__label {
&:before {
content: '*';
margin-right: 5px;
font-size: 18px;
vertical-align: middle;
color: #f00;
}
.el-form-item__label {
&:before {
content: '*';
margin-right: 5px;
font-size: 18px;
vertical-align: middle;
color: #f00;
}
}
}
</style>

@ -3,169 +3,115 @@
<div class="page">
<div class="page-content">
<div class="p-title">赛程与规则设置</div>
<el-form :model="form"
:rules="validRules"
label-width="170px"
label-suffix=":"
size="small"
:disabled="!!(!editing && id)">
<el-form :model="form" :rules="validRules" label-width="170px" label-suffix=":" size="small"
:disabled="!!(!editing && id)">
<el-form-item label="竞赛类型">
{{ step1.completeCompetitionSetup.competitionType ? '团队赛(' + step1.completeCompetitionSetup.minTeamSize + '-' + step1.completeCompetitionSetup.maxTeamSize + '人/队)' : '个人赛' }} <span class="tips">如需修改请返回上一步</span>
{{ step1.completeCompetitionSetup.competitionType ? '团队赛(' + step1.completeCompetitionSetup.minTeamSize +
'-' + step1.completeCompetitionSetup.maxTeamSize + '人/队)' : '个人赛' }} <span
class="tips">如需修改请返回上一步</span>
</el-form-item>
<el-form-item prop="rule"
label="赛制">
<el-radio v-for="(rule, i) in rules"
:key="i"
v-model="form.rule"
:label="rule.id">{{ rule.name }}</el-radio>
<el-form-item prop="rule" label="赛制">
<el-radio v-for="(rule, i) in rules" :key="i" v-model="form.rule" :label="rule.id">{{ rule.name
}}</el-radio>
<p class="tips">积分赛包含多个竞赛阶段每个阶段的成绩都包含在最终总成绩里最后一轮结束后总成绩排名靠前的参赛者得到获奖资格</p>
<p class="tips">淘汰赛包含多个竞赛阶段每个阶段结束后之后只有部分参赛者能晋级下一阶段晋级最后一轮且在最后一轮排名靠前的参赛者得到获奖资格</p>
<p class="tips">单项赛仅包含一个竞赛阶段单项的成绩排名即为最终排名排名靠前的参赛者得到获奖资格</p>
<p class="tips">系统默认排名规则优先按分数排名分数高则排名靠前分数相同则按用时排名用时短则排名靠前</p>
</el-form-item>
<template v-if="form.rule !== 2">
<el-form-item prop="stageNum"
label="阶段数量">
<el-form-item prop="stageNum" label="阶段数量">
<div class="input-center">
<el-select v-model="form.stageNum"
@change="stageChange">
<el-option v-for="i in 10"
:key="i"
:label="i"
:value="i"></el-option>
<el-select v-model="form.stageNum" @change="stageChange">
<el-option v-for="i in 10" :key="i" :label="i" :value="i"></el-option>
</el-select>
</div>
<div v-if="step1.completeCompetitionSetup.competitionType"
class="tips">
<div v-if="step1.completeCompetitionSetup.competitionType" class="tips">
(团队赛是否限制队内每个成员只能参加一个阶段赛项
<el-radio v-model="form.teamLimit"
:label="1"></el-radio>
<el-radio v-model="form.teamLimit"
:label="0"></el-radio>
<el-radio v-model="form.teamLimit" :label="1"></el-radio>
<el-radio v-model="form.teamLimit" :label="0"></el-radio>
)
</div>
</el-form-item>
<el-form-item v-if="!form.rule"
prop="resultCalculationMethod"
label="总成绩计算方式">
<el-radio v-model="form.resultCalculationMethod"
:label="0">各阶段成绩加权求和</el-radio>
<el-radio v-model="form.resultCalculationMethod"
:label="1">各阶段成绩直接求和</el-radio>
<el-radio v-model="form.resultCalculationMethod"
:label="2">各阶段成绩取平均值</el-radio>
<el-form-item v-if="!form.rule" prop="resultCalculationMethod" label="总成绩计算方式">
<el-radio v-model="form.resultCalculationMethod" :label="0">各阶段成绩加权求和</el-radio>
<el-radio v-model="form.resultCalculationMethod" :label="1">各阶段成绩直接求和</el-radio>
<el-radio v-model="form.resultCalculationMethod" :label="2">各阶段成绩取平均值</el-radio>
<p class="tips">若选择加权求和则需要设置每个阶段成绩所占权重且权重总和须为100%</p>
</el-form-item>
<el-form-item prop="stageNum"
label="阶段设置">
<div v-for="(item, i) in form.competitionStageList"
:key="i"
class="step-set">
<el-form-item prop="stageNum" label="阶段设置">
<div v-for="(item, i) in form.competitionStageList" :key="i" class="step-set">
<div class="line">
{{ serials[i] }}阶段 <el-input v-model="item.stageName"
clearable
placeholder="请输入阶段名称,如“初赛”"
style="width: 200px"></el-input>
{{ serials[i] }}阶段 <el-input v-model="item.stageName" clearable placeholder="请输入阶段名称,如“初赛”"
style="width: 200px"></el-input>
</div>
<div class="line">
<span class="req">*</span>
比赛方式
<el-radio v-for="(method, i) in methods"
:key="i"
v-model="item.method"
:label="method.id">{{ method.name }}</el-radio>
<el-radio v-for="(method, i) in methods" :key="i" v-model="item.method" :label="method.id">{{
method.name }}</el-radio>
</div>
<div v-if="step1.completeCompetitionSetup.competitionType"
class="line">
<div v-if="step1.completeCompetitionSetup.competitionType" class="line">
<span class="req">*</span>
团队参赛人数限制
<el-radio v-model="item.teamNumLimit"
:label="0">不限制</el-radio>
<el-radio v-model="item.teamNumLimit"
:label="1">自定义</el-radio>
<el-input v-model.number="item.customNumber"
type="number"
min="0"
style="width: 150px;"
:disabled="item.teamNumLimit === 0"></el-input>
<el-radio v-model="item.teamNumLimit" :label="0">不限制</el-radio>
<el-radio v-model="item.teamNumLimit" :label="1">自定义</el-radio>
<el-input v-model.number="item.customNumber" type="number" min="0" style="width: 150px;"
:disabled="item.teamNumLimit === 0"></el-input>
<span class="tips">可限制本阶段单个团队的出战人数</span>
</div>
<div v-if="step1.completeCompetitionSetup.competitionType"
class="line">
<div v-if="step1.completeCompetitionSetup.competitionType" class="line">
<span class="req">*</span>
团队成绩计算方式
<el-radio v-for="(j, i) in teamCalculationMethods"
:key="i"
v-model="item.teamCalculationMethod"
:label="j.id">{{ j.name }}</el-radio>
<el-radio v-for="(j, i) in teamCalculationMethods" :key="i" v-model="item.teamCalculationMethod"
:label="j.id">{{ j.name }}</el-radio>
<span class="tips">可设置本阶段的团队取分规则</span>
</div>
<div v-if="form.rule === 1 && i !== form.competitionStageList.length - 1"
class="line"
style="display: flex;">
<div v-if="form.rule === 1 && i !== form.competitionStageList.length - 1" class="line"
style="display: flex;">
<p>
<span class="req">*</span>晋级规则
</p>
<div>
<div class="line">
本阶段成绩排名前
<el-input v-model.number="item.peopleLimit"
type="number"
min="0"
style="width: 100px"></el-input>
<el-input v-model.number="item.peopleLimit" type="number" min="0" style="width: 100px"></el-input>
可晋级下一阶段比赛
</div>
<div class="line">
本阶段成绩排名前
<el-input v-model.number="item.percentageLimit"
type="number"
min="0"
style="width: 100px"></el-input>
<el-input v-model.number="item.percentageLimit" type="number" min="0"
style="width: 100px"></el-input>
%可晋级下一阶段比赛
</div>
<div>
本阶段成绩
<el-select v-model="item.operator"
style="width: 80px;margin-right: 10px">
<el-option v-for="i in operators"
:key="i"
:label="i"
:value="i"></el-option>
<el-select v-model="item.operator" style="width: 80px;margin-right: 10px">
<el-option v-for="i in operators" :key="i" :label="i" :value="i"></el-option>
</el-select>
<el-input v-model="item.score"
type="number"
min="0"
style="width: 100px"></el-input>
<el-input v-model="item.score" type="number" min="0" style="width: 100px"></el-input>
可晋级下一阶段比赛
</div>
</div>
</div>
<div v-if="!form.rule"
class="line">
<div v-if="!form.rule" class="line">
<span class="req">*</span>
占总成绩权重
<el-input v-model.number="item.pointWeight"
type="number"
min="0"
:disabled="form.resultCalculationMethod != 0"
style="width: 150px;"></el-input> %
<el-input v-model.number="item.pointWeight" type="number" min="0"
:disabled="form.resultCalculationMethod != 0" style="width: 150px;"></el-input> %
</div>
<div class="line">
成绩公布时间
阶段比赛结束后
<el-input v-model.number="item.resultAnnouncementTime"
type="number"
min="0"
style="width: 120px"></el-input>
小时公布阶段比赛成绩
<el-input v-model.number="item.resultAnnouncementTime" type="number" min="0"
style="width: 120px"></el-input>
小时公布阶段比赛成绩为空则不公布成绩为0则阶段比赛结束后立马公布成绩
</div>
<div v-if="item.resultAnnouncementTime !== '' && item.resultAnnouncementTime !== null && item.resultAnnouncementTime !== undefined"
class="line">
<div
v-if="item.resultAnnouncementTime !== '' && item.resultAnnouncementTime !== null && item.resultAnnouncementTime !== undefined"
class="line">
是否公布成绩详情
<el-radio v-model="item.resultsDetails"
:label="0"></el-radio>
<el-radio v-model="item.resultsDetails"
:label="1"></el-radio>
<el-radio v-model="item.resultsDetails" :label="0"></el-radio>
<el-radio v-model="item.resultsDetails" :label="1"></el-radio>
<p class="tips">若选择则公布成绩详情竞赛结束后参赛者可查看自己的比赛成绩得分详情</p>
<p class="tips">若选择则不公布成绩详情参赛者只能知晓自己的分数及排名不能查看得分详情</p>
</div>
@ -173,44 +119,34 @@
</el-form-item>
</template>
<template v-else>
<el-form-item prop="stageNum"
label="规则设置">
<el-form-item prop="stageNum" label="规则设置">
<div class="step-set">
<div class="line">
<span class="req">*</span>
比赛方式
<el-radio v-for="(method, i) in methods"
:key="i"
v-model="form.competitionStageList[0].method"
:label="method.id">{{ method.name }}</el-radio>
<el-radio v-for="(method, i) in methods" :key="i" v-model="form.competitionStageList[0].method"
:label="method.id">{{ method.name }}</el-radio>
</div>
<div v-if="step1.completeCompetitionSetup.competitionType"
class="line">
<div v-if="step1.completeCompetitionSetup.competitionType" class="line">
<span class="req">*</span>
团队成绩计算方式
<el-radio v-for="(j, i) in teamCalculationMethods"
:key="i"
v-model="form.competitionStageList[0].teamCalculationMethod"
:label="j.id">{{ j.name }}</el-radio>
<el-radio v-for="(j, i) in teamCalculationMethods" :key="i"
v-model="form.competitionStageList[0].teamCalculationMethod" :label="j.id">{{ j.name }}</el-radio>
<span class="tips">可设置本阶段的团队取分规则</span>
</div>
</div>
</el-form-item>
<el-form-item prop="rule"
label="成绩公布时间">
<el-form-item label="成绩公布时间">
阶段比赛结束后
<el-input v-model.number="form.competitionStageList[0].resultAnnouncementTime"
type="number"
min="0"
style="width: 120px"></el-input>
小时公布阶段比赛成绩
<el-input v-model.number="form.competitionStageList[0].resultAnnouncementTime" type="number" min="0"
style="width: 120px"></el-input>
小时公布阶段比赛成绩为空则不公布成绩为0则阶段比赛结束后立马公布成绩
</el-form-item>
<el-form-item prop="resultsDetails"
label="是否公布成绩详情">
<el-radio v-model="form.competitionStageList[0].resultsDetails"
:label="0"></el-radio>
<el-radio v-model="form.competitionStageList[0].resultsDetails"
:label="1"></el-radio>
<el-form-item
v-if="form.competitionStageList[0].resultAnnouncementTime !== '' && form.competitionStageList[0].resultAnnouncementTime !== null && form.competitionStageList[0].resultAnnouncementTime !== undefined"
prop="resultsDetails" label="是否公布成绩详情">
<el-radio v-model="form.competitionStageList[0].resultsDetails" :label="0"></el-radio>
<el-radio v-model="form.competitionStageList[0].resultsDetails" :label="1"></el-radio>
<p class="tips">若选择则公布成绩详情竞赛结束后参赛者可查看自己的比赛成绩得分详情</p>
<p class="tips">若选择则不公布成绩详情参赛者只能知晓自己的分数及排名不能查看得分详情</p>
</el-form-item>
@ -306,6 +242,7 @@ export default {
{ required: true, trigger: 'change' }
],
},
originForm: null,
ruleForm: {},
rules: Const.rules,
methods: Const.methods,
@ -348,6 +285,7 @@ export default {
if (!e.percentageLimit) e.percentageLimit = ''
e.teamCalculationMethod = +e.teamCalculationMethod
})
this.originForm = _.cloneDeep(rule)
this.form = rule
}
this.$nextTick(() => {
@ -379,6 +317,35 @@ export default {
this.form.competitionStageList = stages.slice(0, val)
}
},
//
async automaticAllocation (next) {
//
if (this.step1.completeCompetitionSetup.competitionType) {
const { form, originForm } = this
// 34
let changeLimit = 0
for (const i in form.competitionStageList) {
const e = form.competitionStageList[i]
const originStage = originForm.competitionStageList[i]
if (!originStage || e.teamNumLimit !== originStage.teamNumLimit || e.customNumber !== originStage.customNumber) {
changeLimit = 1
break
}
}
// new Date(this.$parent.$refs.step1.form.signUpEndTime)
if (form.rule !== originForm.rule || form.stageNum !== originForm.stageNum || form.teamLimit !== originForm.teamLimit || changeLimit) {
await this.$post(this.api.updateEventAllocationRecord, {
competitionId: +this.id,
whetherToModifyTheRule: 1,
})
this.$emit('next', next)
} else {
this.$emit('next', next)
}
} else {
this.$emit('next', next)
}
},
//
save (status, next = 0) {
const form = _.cloneDeep(this.form)
@ -477,7 +444,7 @@ export default {
this.$post(this.api.editCompetitionRule, form).then(res => {
this.$parent.hideLoad()
this.updateTime && util.successMsg("修改成功");
this.$emit('next', next)
this.automaticAllocation(next)
}).catch(err => {
this.$parent.hideLoad()
})
@ -498,57 +465,65 @@ export default {
<style scoped lang="scss">
/deep/ .d-inline-block {
width: 216px;
.el-select,
.el-input {
width: 100%;
}
width: 216px;
.el-select,
.el-input {
width: 100%;
}
}
.inline-input {
.input-wrap {
display: flex;
align-items: center;
margin-bottom: 10px;
.el-input {
display: inline-block;
width: 216px;
margin-right: 8px;
}
.inline-input {
.input-wrap {
display: flex;
align-items: center;
margin-bottom: 10px;
.remove {
width: 16px;
height: 16px;
background: url('../../../assets/img/close.png') 0 0 / cover no-repeat;
cursor: pointer;
}
.el-input {
display: inline-block;
width: 216px;
margin-right: 8px;
}
.add-btn {
margin-left: 32px;
.remove {
width: 16px;
height: 16px;
background: url('../../../assets/img/close.png') 0 0 / cover no-repeat;
cursor: pointer;
}
}
.add-btn {
margin-left: 32px;
}
}
.input-center {
display: flex;
align-items: center;
width: 216px;
white-space: nowrap;
.el-input {
margin-right: 5px;
}
display: flex;
align-items: center;
width: 216px;
white-space: nowrap;
.el-input {
margin-right: 5px;
}
}
.step-set {
padding: 15px;
background-color: #fbfbfb;
padding: 15px;
background-color: #fbfbfb;
}
.tips {
font-size: 13px;
color: #959595;
font-size: 13px;
color: #959595;
}
.req {
color: #f00;
color: #f00;
}
.line {
margin-bottom: 10px;
margin-bottom: 10px;
}
</style>

@ -1,75 +1,48 @@
<template>
<div>
<div v-show="!setVisible"
class="page">
<div v-show="!setVisible" class="page">
<div class="page-content">
<div class="p-title">比赛内容设置</div>
<el-form label-width="170px"
label-suffix=":"
size="small"
:disabled="!!(!editing && id)">
<div v-for="(item, i) in form"
:key="i"
class="step">
<el-form label-width="170px" label-suffix=":" size="small" :disabled="!!(!editing && id)">
<div v-for="(item, i) in form" :key="i" class="step">
<div class="title">
<span>{{ item.stageName }}{{ nums[i] }}阶段 | {{ methods.find(e => e.id === item.method).name }} </span>
<el-button v-if="item.method !== 2"
type="primary"
@click="toSet(i)">设置</el-button>
<el-button v-if="item.method !== 2" type="primary" @click="toSet(i)">设置</el-button>
</div>
<el-form-item class="req"
prop="time"
label="比赛时间">
<el-form-item class="req" prop="time" label="比赛时间">
<span v-if="item.method !== 2 && item.startTime">{{ item.startTime + ' ' + item.endTime }}</span>
<div style="display: flex;align-items: center;"
v-if="item.method === 2">
<el-date-picker v-model="item.time"
type="datetimerange"
range-separator="~"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
@change="timeChange">
<div style="display: flex;align-items: center;" v-if="item.method === 2">
<el-date-picker v-model="item.time" type="datetimerange" range-separator="~" start-placeholder="开始日期"
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
@change="timeChange">
</el-date-picker>
<el-alert style="width: auto;padding: 0px 16px;margin-left: 10px;"
:title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'"
type="error"
:closable="false"
effect="dark">
:title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'" type="error"
:closable="false" effect="dark">
</el-alert>
</div>
</el-form-item>
<!-- 其他赛事 -->
<template v-if="item.method === 2">
<el-form-item class="req"
label="比赛地点">
<el-input v-model="item.offlineAddress"
style="width: 80%"></el-input>
<el-form-item class="req" label="比赛地点">
<el-input v-model="item.offlineAddress" style="width: 80%"></el-input>
</el-form-item>
<el-form-item label="系统链接">
<el-input v-model="item.competitionStageContentSetting.systemLink"
style="width: 80%"></el-input>
<el-input v-model="item.competitionStageContentSetting.systemLink" style="width: 80%"></el-input>
</el-form-item>
<el-form-item label="是否支持上传文件">
<div>
<el-radio v-model="item.competitionStageContentSetting.whetherToUploadFiles"
:label="0"></el-radio>
<el-radio v-model="item.competitionStageContentSetting.whetherToUploadFiles" :label="0"></el-radio>
</div>
<div class="flex a-center">
<el-radio v-model="item.competitionStageContentSetting.whetherToUploadFiles"
:label="1"></el-radio>
<el-radio v-model="item.competitionStageContentSetting.whetherToUploadFiles" :label="1"></el-radio>
<template v-if="item.competitionStageContentSetting.whetherToUploadFiles">
<el-upload class="file-upload"
:on-remove="(file, fileList) => handleRemove(file, fileList, item)"
:on-error="uploadError"
:before-remove="beforeRemove"
:on-preview="handlePreview"
action=""
:file-list="item.competitionStageContentSetting.fileList"
:http-request="res => handleRequest(res, item)">
<el-button size="small"
type="primary">上传文件</el-button>
<el-upload class="file-upload" :on-remove="(file, fileList) => handleRemove(file, fileList, item)"
:on-error="uploadError" :before-remove="beforeRemove" :on-preview="handlePreview" action=""
:file-list="item.competitionStageContentSetting.fileList"
:http-request="res => handleRequest(res, item)">
<el-button size="small" type="primary">上传文件</el-button>
<!-- <div slot="tip"
class="el-upload__tip"
style="position: relative">
@ -85,55 +58,48 @@
</div>
<div style="display: flex;align-items: flex-start;margin-top: 10px">
<span style="margin: 0 10px 0 30px;">说明</span>
<el-input maxlength="1000"
placeholder="请输入内容"
type="textarea"
v-model="item.competitionStageContentSetting.stageExplain"
style="width: calc(80% - 216px);"></el-input>
<el-input maxlength="1000" placeholder="请输入内容" type="textarea"
v-model="item.competitionStageContentSetting.stageExplain"
style="width: calc(80% - 216px);"></el-input>
</div>
</el-form-item>
<el-form-item class="req"
label="比赛内容">
<el-input v-model="item.contentDescription"
type="textarea"
style="width: 80%"></el-input>
<el-form-item class="req" label="比赛内容">
<el-input v-model="item.contentDescription" type="textarea" style="width: 80%"></el-input>
</el-form-item>
<el-form-item class="req"
label="评分规则">
<el-input v-model="item.scoreRule"
type="textarea"
style="width: 80%"></el-input>
<el-form-item class="req" label="评分规则">
<el-input v-model="item.scoreRule" type="textarea" style="width: 80%"></el-input>
</el-form-item>
</template>
<template v-else>
<el-form-item class="req"
prop="cid"
label="课程系统">
{{ item.systemName }}
</el-form-item>
<el-form-item class="req"
prop="assessmentId"
label="已选择考核">
{{ item.projectName }}
</el-form-item>
<el-form-item class="req"
prop="resultAnnouncementTime"
label="比赛地点">
<template v-if="item.method === 0">
<el-form-item class="req" prop="cid" label="课程系统">
{{ item.systemName }}
</el-form-item>
<el-form-item class="req" prop="assessmentId" label="已选择考核">
{{ item.projectName }}
</el-form-item>
</template>
<template v-else>
<el-form-item class="req" label="已选择试卷">
<div class="flex">
{{ item.paperName }}&emsp;
<el-form>
<el-button v-if="item.paperName" type="primary" size="mini" :disabled="false"
@click="previewPaper(item)">预览</el-button>
</el-form>
</div>
</el-form-item>
</template>
<el-form-item class="req" prop="resultAnnouncementTime" label="比赛地点">
<div class="line">
<el-checkbox v-model="item.onlineButton">线上</el-checkbox>
<el-input v-model="item.onlineAddress"
clearable
placeholder="请输入比赛网址"
:disabled="!item.onlineButton"
style="width: 400px;margin-left: 10px"></el-input>
<el-input v-model="item.onlineAddress" clearable placeholder="请输入比赛网址" :disabled="!item.onlineButton"
style="width: 400px;margin-left: 10px"></el-input>
</div>
<div class="line">
<el-checkbox v-model="item.offlineButton">线下</el-checkbox>
<el-input v-model="item.offlineAddress"
clearable
placeholder="请输入地址"
:disabled="!item.offlineButton"
style="width: 400px;margin-left: 10px"></el-input>
<el-input v-model="item.offlineAddress" clearable placeholder="请输入地址" :disabled="!item.offlineButton"
style="width: 400px;margin-left: 10px"></el-input>
</div>
</el-form-item>
</template>
@ -142,19 +108,31 @@
</div>
</div>
<set v-if="setVisible"
:form.sync="form[curStep]"
:step1.sync="step1"
@hideSet="hideSet" />
<Set v-if="setVisible" :form.sync="form[curStep]" :step1.sync="step1" @hideSet="hideSet" />
<el-dialog title="提示" :visible.sync="tipsVisible" width="500px" :close-on-click-modal="false"
custom-class="tips-dia">
<p style="font-size: 17px;text-align: center;color: #9076ff;">编辑发布成功</p>
<p style="margin: 5px 0px 10px;line-height: 1.6">
温馨提示报名结束后更改报名时间或赛程规则不影响已分配的阶段参赛人员且后续添加的人员不会自动分配如需重新自动分配所有团队请到报名列表执行全员重新分配操作
</p>
<el-checkbox v-model="closeStatus">不再提示</el-checkbox>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="closePopup">关闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Set from './set'
import Oss from '@/components/upload/upload.js'
import util from "@/libs/util";
import set from './set'
import Setting from '@/setting'
import Util from '@/libs/util'
export default {
props: ['setupId', 'competitionId', 'editing'],
components: { Set },
data () {
return {
headers: {
@ -188,6 +166,8 @@ export default {
stageId: '',
startTime: '',
systemId: '',
paperId: '',
paperName: '',
offlineAddress: '',
offlineButton: 0,
onlineAddress: '',
@ -198,11 +178,11 @@ export default {
setVisible: false,
curStep: 0,
curOriginForm: {},
closeStatus: false,
tipsVisible: false,
};
},
components: {
set
},
watch: {
// ,
form: {
@ -271,8 +251,10 @@ export default {
form.method = e.method
form.stageId = e.stageId
form.stageName = e.stageName
if (form.paperName) form.originPaperName = form.paperName //
this.form.push(form)
})
this.resumeData()
this.$nextTick(() => {
this.updateTime = 0
@ -292,13 +274,26 @@ export default {
this.setVisible = false
this.$parent.showBtns = true
},
//
previewPaper (row) {
let url = `${location.origin}/examination`
if (Setting.isDev) {
url = `http://192.168.31.125:8098/`
} else if (Setting.isPro) {
const { host } = location
url = `https://${host === 'dev.huorantech.cn' ? host : 'www.huorantech.cn'}/examination/`
}
url += `#/testPaper/preview?id=${row.paperId}&token=${sessionStorage.getItem('token')}`
localStorage.setItem('exam_token', sessionStorage.getItem('token'))
window.open(url)
},
//
timeChange (val) {
if (val.length) {
const startTime = new Date(val[0])
const endTime = new Date(val[1])
const { playStartTime, playEndTime } = this.step1
if (startTime < new Date(playStartTime) || endTime > new Date(playEndTime)) return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
if (startTime < new Date(playStartTime) || endTime > new Date(playEndTime)) return Util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
const { form, curStep } = this
for (const i in form) {
//
@ -306,7 +301,7 @@ export default {
const time1 = new Date(form[i].startTime)
const time2 = new Date(form[i].endTime)
if ((startTime >= time1 && startTime <= time2) || (endTime >= time1 && endTime <= time2)) {
util.warningMsg('请注意,所设置的时间与已设置的阶段时间重合。')
Util.warningMsg('请注意,所设置的时间与已设置的阶段时间重合。')
break
}
}
@ -317,7 +312,7 @@ export default {
//
beforeUpload (file) {
const isLt2M = file.size / 1024 / 1024 < 10
if (!isLt2M) util.warningMsg('请上传小于10MB的附件!')
if (!isLt2M) Util.warningMsg('请上传小于10MB的附件!')
if (isLt2M) {
this.fileName = file.name
return true
@ -334,10 +329,10 @@ export default {
},
downloadFile () {
// const { name, url } = this.fileList[0]
// util.downloadFile(name, url)
// Util.downloadFile(name, url)
},
handlePreview (file) {
window.open((util.isDoc(util.getFileExt(file.name)) ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + file.url)
window.open((Util.isDoc(Util.getFileExt(file.name)) ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + file.url)
},
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
@ -359,23 +354,69 @@ export default {
publish () {
this.competitionId && this.$post(`${this.api.publishCompetition}?competitionId=${this.competitionId}&publishStatus=1`).then(res => { }).catch(err => { })
},
//
autoAllocation () {
this.$confirm('团队赛已发布,是否要自动分配阶段人员?', '提示', {
// confirmButtonText: '',
// cancelButtonText: '',
type: 'success'
}).then(() => {
}).catch(() => { });
//
async closePopup () {
if (this.closeStatus) await this.$post(`${this.api.closePopup}?competitionId=${this.competitionId}`)
this.$emit('next', 0)
},
//
async automaticAllocation (assignOrNot, next) {
await this.$post(this.api.updateEventAllocationRecord, {
assignOrNot,
competitionId: this.competitionId,
})
this.$emit('next', next)
},
//
async autoAllocationConfirm (next) {
//
const { data } = await this.$post(`${this.api.viewEventAllocationInformation}?competitionId=${this.competitionId}`)
if (!data || data.assignOrNot === undefined || !this.form[0].contentId) {
// or
const now = await Util.getNow()
//
if (new Date(this.$parent.$refs.step1.form.signUpEndTime) > now) {
this.$confirm('<p>团队赛发布成功,您是否要启用自动分配阶段参赛人员功能?</p><p style="margin-top: 10px;color: #a9a9a9;">(点击“是”将会在报名截止时清空已有分配,并为所有团队重新自动分配。)</p>', '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'success',
closeOnClickModal: false,
dangerouslyUseHTMLString: true,
}).then(() => {
this.automaticAllocation(1, next)
}).catch(() => {
this.automaticAllocation(0, next)
})
} else {
this.$confirm('团队赛发布成功,由于您设置的报名时间已结束,如需自动分配阶段参赛人员,请前往报名人员列表进行设置', '提示', {
confirmButtonText: '关闭',
type: 'success',
showCancelButton: false,
closeOnClickModal: false,
dangerouslyUseHTMLString: true,
showClose: false,
}).then(() => {
this.$emit('next', next)
}).catch(() => { })
}
} else if (data.whetherToHidePopUps) {
//
this.tipsVisible = true
} else {
this.$emit('next', next)
}
},
// websocket
async sendSocket () {
await this.$post(`${this.api.refreshPageNotification}?content=1`)
},
//
save (status, next = 0) {
// return console.log(this.$parent.$refs.step1.form.completeCompetitionSetup.competitionType)
const { form } = this
if (!form.length) {
this.$parent.hideLoad()
util.successMsg('保存成功')
Util.successMsg('保存成功')
this.$emit('next', next)
return
}
@ -386,54 +427,59 @@ export default {
if (status) {
if (!e.time.length) {
invalid = 1
util.errorMsg('请选择比赛时间')
Util.errorMsg('请选择比赛时间')
break
}
if (new Date(e.time[0]) < new Date(playStartTime) || new Date(e.time[1]) > new Date(playEndTime)) {
invalid = 1
util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
Util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
break
}
if (e.method !== 2 && !e.cid) {
if (e.method === 0 && !e.cid) {
invalid = 1
util.errorMsg('请选择课程')
Util.errorMsg('请选择课程')
break
}
if (e.method === 1 && !e.paperId) {
invalid = 1
Util.errorMsg('请选择试卷')
break
}
if (e.method === 2) { // 线
if (!e.offlineAddress) {
invalid = 1
util.errorMsg('请输入比赛地点')
Util.errorMsg('请输入比赛地点')
break
}
if (!e.contentDescription) {
invalid = 1
util.errorMsg('请输入比赛内容')
Util.errorMsg('请输入比赛内容')
break
}
if (!e.scoreRule) {
invalid = 1
util.errorMsg('请输入评分规则')
Util.errorMsg('请输入评分规则')
break
}
// if (e.competitionStageContentSetting.whetherToUploadFiles && !e.competitionStageContentSetting.stageExplain) {
// invalid = 1
// util.errorMsg('')
// Util.errorMsg('')
// break
// }
} else {
if (e.onlineButton && !e.onlineAddress) {
invalid = 1
util.errorMsg('请输入线上地点')
Util.errorMsg('请输入线上地点')
break
}
if (e.offlineButton && !e.offlineAddress) {
invalid = 1
util.errorMsg('请输入线下地点')
Util.errorMsg('请输入线下地点')
break
}
if (!e.onlineAddress && !e.offlineAddress) {
invalid = 1
util.errorMsg('请输入比赛地点')
Util.errorMsg('请输入比赛地点')
break
}
}
@ -463,10 +509,17 @@ export default {
}).then(res => {
this.$parent.hideLoad()
//
status && this.publish(status)
// this.$parent.$refs.step1.form.completeCompetitionSetup.competitionType && this.autoAllocation() //
util.successMsg((status ? '发布' : '保存') + '成功')
this.$emit('next', next)
if (status) {
this.publish(status)
this.sendSocket()
}
Util.successMsg((status ? '发布' : '保存') + '成功')
this.updateTime = 0
if (status && this.$parent.$refs.step1.form.completeCompetitionSetup.competitionType) {
this.autoAllocationConfirm() //
} else {
this.$emit('next', next)
}
}).catch(err => {
this.$parent.hideLoad()
})
@ -477,41 +530,51 @@ export default {
<style scoped lang="scss">
.step {
padding-bottom: 10px;
background-color: #f9f9f9;
.title {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 15px;
margin-bottom: 10px;
background-color: #ededed;
}
padding-bottom: 10px;
background-color: #f9f9f9;
.title {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 15px;
margin-bottom: 10px;
background-color: #ededed;
}
}
.line {
margin-bottom: 10px;
margin-bottom: 10px;
}
/deep/.req {
.el-form-item__label {
&:before {
content: '*';
margin-right: 5px;
font-size: 18px;
vertical-align: middle;
color: #f00;
}
.el-form-item__label {
&:before {
content: '*';
margin-right: 5px;
font-size: 18px;
vertical-align: middle;
color: #f00;
}
}
}
/deep/.file-upload {
width: 500px;
.download {
position: absolute;
bottom: -63px;
right: 0;
font-size: 12px;
color: #007eff;
cursor: pointer;
}
width: 500px;
.download {
position: absolute;
bottom: -63px;
right: 0;
font-size: 12px;
color: #007eff;
cursor: pointer;
}
}
/deep/.tips-dia {
.el-dialog__body {
padding: 10px 20px;
}
}
</style>

@ -0,0 +1,211 @@
<template>
<!-- 理论考试选择试卷 -->
<div>
<el-dialog title="请选择试卷" :visible.sync="listVisible" width="1200px" :close-on-click-modal="false"
@closed="closeDia">
<div class="tool">
<ul class="filter">
<li>
<label>试卷库</label>
<el-select v-model="filter.libraryId" placeholder="请选择试卷库" @change="initData">
<el-option v-for="(item, i) in paperLibraries" :key="i" :label="item.libraryName" :value="item.libraryId">
</el-option>
</el-select>
</li>
<li>
<label>建议用途</label>
<el-select v-model="filter.paperType" clearable placeholder="请选择状态" @change="initData">
<el-option v-for="(item, i) in paperTypes" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
<li>
<label>试卷难度</label>
<el-select v-model="filter.difficult" clearable multiple placeholder="请选择试卷难度" @change="initData">
<el-option v-for="(item, i) in difficults" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
<li>
<label>题目类型</label>
<el-select v-model="questionType" clearable multiple placeholder="请选择题目类型" @change="initData">
<el-option v-for="(item, i) in questionTypes" :key="i" :label="item.name" :value="item.name"></el-option>
</el-select>
</li>
<li>
<label>搜索</label>
<el-input style="width: 250px;" placeholder="请输入试卷名称" prefix-icon="el-icon-search" v-model="filter.keyWord"
clearable />
</li>
</ul>
<div>
<!-- <el-button type="primary" @click="add">自定义理论试卷</el-button> -->
</div>
</div>
<el-table :data="papers" class="table" stripe header-align="center" @sort-change="sortChange">
<el-table-column width="60" label="选择" align="center">
<template slot-scope="scope">
<el-radio v-model="form.paperId" :label="scope.row.paperId">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="name" label="试卷名称" min-width="140" align="center"></el-table-column>
<el-table-column prop="questionCount" label="试题总数" align="center" min-width="70"></el-table-column>
<el-table-column prop="score" label="总分" align="center" min-width="70"></el-table-column>
<el-table-column prop="questionType" label="题型" align="center" min-width="90"
show-overflow-tooltip></el-table-column>
<el-table-column prop="difficult" label="试卷难度" align="center" min-width="70" sortable="custom">
<template slot-scope="scope">{{ difficults.find(e => e.id === scope.row.difficult) ? difficults.find(e =>
e.id === scope.row.difficult).name : '' }}</template>
</el-table-column>
<el-table-column prop="suggestTime" label="建议用时" align="center" min-width="70">
<template slot-scope="scope">{{ scope.row.suggestTime }}min</template>
</el-table-column>
<el-table-column prop="classificationPath" label="试卷分类" align="center" min-width="70"
show-overflow-tooltip></el-table-column>
<el-table-column label="建议用途" align="center" min-width="70">
<template slot-scope="scope">{{ paperTypes.find(e => e.id === scope.row.paperType) ? paperTypes.find(e =>
e.id === scope.row.paperType).name : '' }}</template>
</el-table-column>
<el-table-column prop="updateTime" label="最近编辑时间" align="center" width="170"
sortable="custom"></el-table-column>
<el-table-column prop="createUser" label="最近编辑人" align="center" width="110"></el-table-column>
<el-table-column label="操作" align="center" width="80">
<template slot-scope="scope">
<el-button type="text" @click="previewPaper(scope.row)">预览</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background :page-size="pageSize" @current-change="handleCurrentChange"
layout="total,prev, pager, next" :total="total"></el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="listVisible = false">取消</el-button>
<el-button type="primary" :loading="submiting" @click="submit">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Setting from '@/setting'
import Util from '@/libs/util'
import _ from 'lodash'
import QuesConst from '@/const/ques'
import TestPaperConst from '@/const/testPaper'
export default {
props: ['visible', 'form'],
data () {
return {
arabicToChinese: Util.arabicToChinese,
questionTypes: QuesConst.questionTypes,
difficults: TestPaperConst.difficults,
paperTypes: TestPaperConst.paperTypes,
listVisible: false,
searchTimer: null,
questionType: [],
paperLibraries: [],
filter: {
libraryId: '',
paperType: '',
difficult: [],
keyWord: '',
},
list: [],
page: 1,
pageSize: 10,
total: 0,
paperId: '',
submiting: false,
};
},
watch: {
'filter.keyWord': function (val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(this.initData, 500)
},
visible () {
this.listVisible = this.visible
this.visible && this.getList()
}
},
mounted () {
this.originForm = _.cloneDeep(this.form)
},
methods: {
//
async getList () {
try {
const res = await this.$post(this.api.examPaperList, {
...this.filter,
pageNum: this.page,
pageSize: this.pageSize,
type: 1,
keyWord: this.keyword,
libraryId: this.systemId
})
this.papers = res.pageList.records
this.total = res.pageList.total
} catch (e) { }
},
//
currentChange (val) {
this.page = val
this.getList()
},
handleCurrentChange (val) {
this.page = val
this.getList()
},
initData () {
this.page = 1
this.getList()
},
//
sortChange (column) {
if (column.prop === 'updateTime') this.filter.updateTimeOrder = column.order ? column.order === 'ascending' ? 1 : 2 : ''
this.getList()
},
//
add () {
this.form = _.cloneDeep(this.originForm)
this.detailVisible = true
},
//
previewPaper (row) {
this.$parent.previewPaper(row)
},
//
async submit () {
const { paperId } = this.form
if (!paperId) return Util.warningMsg('请选择试卷')
const curPaper = this.papers.find(e => e.paperId === paperId)
if (curPaper) this.form.paperName = curPaper.name
this.handlePaper()
},
//
async handlePaper () {
const { form } = this
// id
if (form.paperName !== form.originPaperName) {
const res = await this.$post(this.api.copyExamPaper, {
associatedID: form.stageId,
paperId: form.paperId,
typeId: 1
})
if (res.examPaper) {
form.paperId = res.examPaper.paperId
}
}
},
//
closeDia () {
this.$emit('update:visible', false)
}
}
};
</script>
<style lang="scss" scoped></style>

@ -1,6 +1,5 @@
<template>
<div class="page"
v-loading="loading">
<div class="page" v-loading="loading">
<h6 class="p-title">筛选</h6>
<div class="tool mul">
<ul class="filter">
@ -9,12 +8,9 @@
<div class="single-choice">
<dl>
<dd>
<el-radio-group v-model="form.month"
@change="changeType">
<el-radio v-for="(item,index) in dateList"
:key="index"
:label="item.id"
border>{{ item.name }}</el-radio>
<el-radio-group v-model="form.month" @change="changeType">
<el-radio v-for="(item, index) in dateList" :key="index" :label="item.id" border>{{ item.name
}}</el-radio>
</el-radio-group>
</dd>
</dl>
@ -22,216 +18,140 @@
</li>
<li>
<label>创建区间</label>
<el-date-picker v-model="date"
align="right"
unlink-panels
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
clearable></el-date-picker>
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期"
end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</li>
<li>
<el-input placeholder="请输入竞赛名称/创建人"
suffix-icon="el-icon-search"
v-model="form.keyWord"
clearable></el-input>
<el-input placeholder="请输入竞赛名称/创建人" suffix-icon="el-icon-search" v-model="form.keyWord" clearable></el-input>
</li>
</ul>
</div>
<div class="tool mul">
<ul class="filter">
<li>
<label>大赛来源</label>
<el-select v-model="form.platformSource"
clearable
@change="sourceChange">
<el-option v-for="(item, i) in sourceList"
:key="i"
:label="item.name"
:value="item.id"></el-option>
<label>竞赛来源</label>
<el-select v-model="form.platformSource" clearable @change="initData">
<el-option v-for="(item, i) in sourceList" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
<li>
<label>大赛范围</label>
<el-select v-model="form.competitionScope"
clearable
@change="initData">
<el-option v-for="(item, i) in rangeList"
:key="i"
:label="item.name"
:value="item.id"></el-option>
<label>发布类型</label>
<el-select v-model="form.releaseType" clearable @change="initData">
<el-option v-for="(item, i) in releaseTypes" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
<li>
<label>竞赛范围</label>
<el-select v-model="form.competitionScope" @change="initData">
<el-option v-for="(item, i) in rangeList" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
<li>
<label>竞赛类型</label>
<el-select v-model="form.competitionType" clearable @change="initData">
<el-option v-for="(item, i) in competitionTypes" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
<li>
<label>状态</label>
<el-select v-model="form.publishStatus" clearable @change="initData">
<el-option v-for="(item, i) in publishStatus" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
</ul>
<div>
<el-button type="primary"
round
@click="add"
v-auth>创建竞赛</el-button>
<el-button type="primary"
round
@click="delAllSelection"
v-auth>批量删除</el-button>
<el-button type="primary" round @click="add" v-auth>创建竞赛</el-button>
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
</div>
</div>
<el-table ref="table"
:data="matchData"
class="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="60"
label="序号"
align="center">
<el-table ref="table" :data="matchData" class="table" stripe header-align="center"
@selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="competitionName"
label="竞赛名称"
align="center"></el-table-column>
<el-table-column prop="name"
label="竞赛类型"
width="90"
align="center">
<el-table-column prop="competitionName" label="竞赛名称" align="center"></el-table-column>
<el-table-column prop="name" label="竞赛来源" width="90" align="center">
<template slot-scope="scope">
{{ scope.row.competitionType ? '团队赛' : '个人赛' }}
{{ sourceList.find(e => e.id === scope.row.platformSource).name }}
</template>
</el-table-column>
<el-table-column prop="founderName"
label="创建人"
align="center"></el-table-column>
<el-table-column prop="name"
label="大赛来源"
width="110"
align="center">
<el-table-column prop="name" label="发布类型" width="110" align="center">
<template slot-scope="scope">
{{ sourceList.find(e => e.id === scope.row.platformSource).name }}
{{ scope.row.releaseType ? '设置完整比赛' : '练习赛' }}
</template>
</el-table-column>
<el-table-column prop="name"
label="大赛范围"
align="center">
<el-table-column prop="name" label="竞赛范围" width="100" align="center">
<template slot-scope="scope">
{{ rangeList.find(e => e.id === scope.row.competitionScope).name }}
</template>
</el-table-column>
<el-table-column prop="applicantNum"
label="报名人数"
align="center"
width="100"></el-table-column>
<el-table-column prop="status"
label="状态"
align="center"
width="80">
<el-table-column prop="name" label="竞赛类型" width="90" align="center">
<template slot-scope="scope">
{{ scope.row.competitionType ? '团队赛' : '个人赛' }}
</template>
</el-table-column>
<el-table-column prop="applicantNum" label="报名人数" align="center" width="100"></el-table-column>
<el-table-column prop="status" label="状态" align="center" width="80">
<template slot-scope="scope">
{{ scope.row.publishStatus ? '已发布' : '未发布' }}
</template>
</el-table-column>
<el-table-column prop="time"
label="竞赛时间"
align="center"
width="290">
<el-table-column prop="time" label="比赛时间" align="center" width="290">
<template slot-scope="scope">
{{ scope.row.playStartTime }} ~ {{ scope.row.playEndTime }}
</template>
</el-table-column>
<el-table-column prop="createTime"
label="创建时间"
align="center"
width="160"></el-table-column>
<el-table-column label="操作"
align="center"
width="280">
<el-table-column prop="createTime" label="创建时间" align="center" width="160"></el-table-column>
<el-table-column prop="founderName" label="创建人" width="130" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="280">
<template slot-scope="scope">
<el-button type="text"
@click="copy(scope.row)">复制</el-button>
<el-button type="text" @click="copy(scope.row)">复制</el-button>
<el-button v-if="scope.row.publishStatus && scope.row.playingStages && scope.row.playingStages.length"
type="text"
@click="editEndTime(scope.row)"
v-auth>修改结束时间</el-button>
<el-button type="text"
@click="manage(scope.row)"
v-auth>管理</el-button>
<el-button type="text"
@click="delData(scope.row)"
v-auth>删除</el-button>
<el-switch v-if="scope.row.publishStatus"
v-auth="'/match:启用'"
v-model="scope.row.ztOpen"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
:active-text="scope.row.ztOpen ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)"></el-switch>
type="text" @click="editEndTime(scope.row)" v-auth>修改结束时间</el-button>
<el-button type="text" @click="manage(scope.row)" v-auth>管理</el-button>
<el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button>
<el-switch v-if="scope.row.publishStatus" v-auth="'/match:启用'" v-model="scope.row.ztOpen" :active-value="0"
:inactive-value="1" style="margin: 0 10px 0 5px" :active-text="scope.row.ztOpen ? '关' : '开'"
@change="switchOff($event, scope.row, scope.$index)"></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange"
:current-page="page">
</el-pagination>
</div>
<el-dialog title="修改当前阶段结束时间"
:visible.sync="modifyVisible"
width="900px"
:close-on-click-modal="false">
<el-table :data="curRow.playingStages"
class="table"
ref="table"
stripe
header-align="center">
<el-table-column prop="stageName"
label="阶段名称"
min-width="100"
align="center"></el-table-column>
<el-table-column label="竞赛起止时间"
width="300"
align="center">
<el-dialog title="修改当前阶段结束时间" :visible.sync="modifyVisible" width="900px" :close-on-click-modal="false">
<el-table :data="curRow.playingStages" class="table" ref="table" stripe header-align="center">
<el-table-column prop="stageName" label="阶段名称" min-width="100" align="center"></el-table-column>
<el-table-column label="竞赛起止时间" width="300" align="center">
<template slot-scope="scope">
{{ scope.row.startTime + ' ~ ' + scope.row.endTime }}
</template>
</el-table-column>
<el-table-column label="结束时间调整为"
align="center"
width="280">
<el-table-column label="结束时间调整为" align="center" width="280">
<template slot-scope="scope">
<el-date-picker popper-class="no-atTheMoment"
v-model="scope.row.newEndTime"
placeholder="请选择结束时间"
type="datetime"
:picker-options="pickerOptions">
<el-date-picker popper-class="no-atTheMoment" v-model="scope.row.newEndTime" placeholder="请选择结束时间"
type="datetime" :picker-options="pickerOptions">
</el-date-picker>
</template>
</el-table-column>
</el-table>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
@click="modifyVisible = false"> </el-button>
<el-button size="small"
type="primary"
@click="modifySubmit"> </el-button>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="modifyVisible = false"> </el-button>
<el-button size="small" type="primary" @click="modifySubmit"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from "@/libs/util";
import Util from '@/libs/util'
import Bus from '@/libs/bus'
import qs from 'qs'
export default {
@ -253,11 +173,25 @@ export default {
name: "院校创建"
}
],
rangeList: [
releaseTypes: [
{
id: '',
name: "不限"
},
{
id: 0,
name: '发布信息'
},
{
id: 1,
name: '完整比赛'
}
],
rangeList: [
{
id: null,
name: "不限"
},
{
id: 1,
name: "全平台"
@ -271,14 +205,45 @@ export default {
name: "校内"
}
],
competitionTypes: [
{
id: '',
name: '不限'
},
{
id: 0,
name: '个人赛'
},
{
id: 1,
name: '团队赛'
}
],
publishStatus: [
{
id: '',
name: '不限'
},
{
id: 0,
name: '未发布'
},
{
id: 1,
name: '已发布'
}
],
matchData: [],
form: {
keyWord: this.$route.query.keyWord || null,
month: +this.$route.query.month || '',
startTime: this.$route.query.startTime || '',
endTime: this.$route.query.endTime || '',
platformSource: this.$route.query.platformSource === 'null' ? null : (+this.$route.query.platformSource || 0), // (01)
competitionScope: this.$route.query.competitionScope ? +this.$route.query.competitionScope : '', // (0: 1: 2.)
keyWord: null,
month: '',
startTime: null,
endTime: null,
releaseType: '',
publishStatus: '',
competitionType: '',
platformSource: 0, // (01)
competitionScope: null, // (0: 1: 2.)
},
multipleSelection: [],
dateList: [
@ -318,13 +283,14 @@ export default {
}]
},
loading: false,
now: '',
};
},
watch: {
"form.month": function (val) {
if (val) {
let unit = 24 * 60 * 60 * 1000;
this.date = [util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() - unit * 30 * val)), util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() + unit))];
this.date = [Util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() - unit * 30 * val)), Util.formatDate("yyyy-MM-dd", new Date(new Date().getTime() + unit))];
} else {
this.date = [];
}
@ -349,6 +315,18 @@ export default {
mounted () {
const { query } = this.$route
if (query.page) {
const { keyWord, month, startTime, endTime, platformSource, competitionScope, competitionType, publishStatus, releaseType } = query
this.form = {
keyWord: keyWord || null,
month: +month || '',
startTime: startTime || null,
endTime: endTime || null,
competitionType: competitionType || '',
publishStatus: publishStatus || '',
releaseType: releaseType || '',
platformSource: platformSource === 'null' ? null : (+platformSource || 0), // (01)
competitionScope: competitionScope ? +competitionScope : null, // (0: 1: 2.)
}
this.$router.push('/match').catch(() => { })
}
@ -363,43 +341,25 @@ export default {
})
},
methods: {
getData () {
async getData () {
this.loading = true
const { form } = this
this.$post(this.api.CompetitionPageConditionQueryByNakadai, {
pageNum: this.page,
pageSize: this.pageSize,
competitionScope: form.competitionScope === '' ? null : form.competitionScope,
endTime: form.endTime || null,
keyWord: form.keyWord,
platformSource: form.platformSource,
startTime: form.startTime || null,
}).then(({ data }) => {
const list = data.records
//
try {
const { form } = this
const { data } = await this.$post(this.api.CompetitionPageConditionQueryByNakadai, {
pageNum: this.page,
pageSize: this.pageSize,
...form
})
this.matchData = data.records
this.now = await Util.getNow()
clearInterval(this.timer)
this.handleBeganStage()
this.timer = setInterval(() => {
const now = new Date()
list.map(e => {
if (!e.playingStages) {
this.$set(e, 'playingStages', [])
} else {
e.playingStages = []
}
//
if (now >= new Date(e.playStartTime) && now <= new Date(e.playEndTime)) {
//
if (e.competitionStageList) {
for (const n of e.competitionStageList) {
//
if (now >= new Date(n.startTime) && now <= new Date(n.endTime)) {
e.playingStages.push(n)
}
}
}
}
})
this.now = new Date(this.now.setSeconds(this.now.getSeconds() + 1))
this.handleBeganStage()
}, 1000)
this.matchData = list
this.total = data.total
this.$refs.table.clearSelection()
this.loading = false
@ -407,8 +367,30 @@ export default {
this.page--
this.getData()
}
}).catch(res => {
} catch (e) {
this.loading = false
}
},
//
async handleBeganStage () {
this.matchData.map(e => {
if (!e.playingStages) {
this.$set(e, 'playingStages', [])
} else {
e.playingStages = []
}
//
if (this.now >= new Date(e.playStartTime) && this.now <= new Date(e.playEndTime)) {
//
if (e.competitionStageList) {
for (const n of e.competitionStageList) {
//
if (this.now >= new Date(n.startTime) && this.now <= new Date(n.endTime)) {
e.playingStages.push(n)
}
}
}
}
})
},
initData () {
@ -429,7 +411,7 @@ export default {
type: "warning"
}).then(async () => {
await this.$post(`${this.api.copyCompetition}?competitionId=${row.id}`)
util.successMsg('复制成功')
Util.successMsg('复制成功')
this.initData()
}).catch(() => { })
},
@ -452,7 +434,7 @@ export default {
competitionContents: data
}).then(async res => {
await this.$post(`${this.api.refreshPageNotification}?content=1`)
util.successMsg('修改成功')
Util.successMsg('修改成功')
this.modifyVisible = false
this.getData()
}).catch(err => { })
@ -477,7 +459,7 @@ export default {
})
.then(() => {
this.$post(`${this.api.batchDeleteCompetition}?competitionIds=${row.id}`).then(res => {
util.successMsg("删除成功");
Util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
@ -522,7 +504,7 @@ export default {
isOpen: val,
type: 0 // (01)
}).then(res => {
util.successMsg(val == 1 ? '禁用成功' : '启用成功')
Util.successMsg(val == 1 ? '禁用成功' : '启用成功')
}).catch(err => { })
await this.$post(`${this.api.refreshPageNotification}?content=1`)
@ -533,22 +515,22 @@ export default {
<style lang="scss" scoped>
/deep/ .tool {
.filter {
.el-input {
min-width: 190px;
}
.filter {
.el-input {
min-width: 190px;
}
}
}
@media (max-width: 1640px) {
.page .page-content .tool .filter {
flex-wrap: wrap;
margin-bottom: -15px;
.page .page-content .tool .filter {
flex-wrap: wrap;
margin-bottom: -15px;
li {
min-width: 34%;
margin-bottom: 15px;
}
li {
min-width: 34%;
margin-bottom: 15px;
}
}
}
</style>

@ -0,0 +1,630 @@
<template>
<!-- 报名人员 -->
<div class="page-content" style="padding: 24px">
<div class="tool">
<ul class="filter">
<li>
<label>搜索</label>
<el-input
:placeholder="'请输入姓名、手机号、' + (info.completeCompetitionSetup.competitionType ? '团队名称、' : '') + '学号、学校'"
prefix-icon="el-icon-search" v-model="keyword" clearable size="mini" style="width: 350px"></el-input>
</li>
<li v-if="info.releaseType">
<label>参赛人员状态</label>
<el-select v-model="isDisable" @change="initData">
<el-option v-for="(item, i) in statusList" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
</ul>
<div>
<el-button type="primary" round :loading="exporting" @click="exportAll"
v-auth="'/match:管理:报名人员:导出'">批量导出</el-button>
<el-button type="primary" @click="batchDel" round v-auth="'/match:管理:报名人员:导出'">批量删除</el-button>
</div>
</div>
<el-table ref="table" :data="listData" class="table" stripe header-align="center"
@selection-change="handleSelectionChange" row-key="id" v-loading="loading" @sort-change="sortChange">
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="school" label="学生账号归属" sortable="custom" min-width="180" align="center"></el-table-column>
<el-table-column prop="realSchool" label="学生所在院校" min-width="180" align="center"></el-table-column>
<el-table-column v-if="info.completeCompetitionSetup.competitionType" prop="teamName" label="团队名称"
sortable="custom" min-width="140" align="center">
</el-table-column>
<el-table-column prop="username" label="队长" min-width="140" align="center">
</el-table-column>
<el-table-column prop="workNumber" label="队长学号" min-width="140" align="center">
</el-table-column>
<el-table-column prop="phone" label="队长手机号" min-width="140" align="center">
</el-table-column>
<el-table-column prop="captain" label="是否为队长" min-width="90" align="center"></el-table-column>
<el-table-column prop="teachers" label="指导老师" min-width="200" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<template v-if="scope.row.teachers">
<el-tooltip placement="top">
<div slot="content" style="line-height: 1.8">
<div v-for="(item, i) in scope.row.teachers" :key="i">
{{ item.name }}{{ item.phone ? ',' + item.phone : '' }}{{ item.position ? ',' + item.position : '' }}
</div>
</div>
<p>{{ scope.row.teachers[0].name }}{{ scope.row.teachers[0].phone ? ',' + scope.row.teachers[0].phone : ''
}}{{ scope.row.teachers[0].position ? ',' + scope.row.teachers[0].position : '' }}</p>
</el-tooltip>
</template>
</template>
</el-table-column>
<el-table-column prop="captain" label="团队状态" min-width="80" align="center">
<template slot-scope="scope">
<el-link type="danger" style="font-size: 16px" @click="toInfo(scope.row)">异常</el-link>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="270">
<template slot-scope="scope">
<el-button v-auth="'/match:管理:报名人员:编辑'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="del(scope.row)">删除</el-button>
<template v-if="info.releaseType">
<el-button v-auth="'/match:管理:报名人员:参赛信息与成绩'" type="text" @click="toInfo(scope.row)">参赛信息与成绩</el-button>
<el-switch v-auth="'/match:管理:报名人员:禁用'" v-model="scope.row.isDisable"
:active-text="scope.row.isDisable ? '禁用' : '启用'" :active-value="0" :inactive-value="1"
style="margin: 0 10px 0 5px" @change="switchOff($event, scope.row, scope.$index)"></el-switch>
</template>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange"
:current-page="page">
</el-pagination>
</div>
<el-dialog :title="(!isAdd ? '编辑' : '新增') + '参赛人员'" :visible.sync="addVisible" width="440px" class="dialog"
:close-on-click-modal="false" @close="closeAdd">
<el-form ref="form" :model="form" :rules="rules" label-width="110px" style='margin-right: 10px;'>
<el-form-item v-if="!schoolDisable" prop="schoolId" label="学生账号归属">
<el-select v-model="form.schoolId" filterable :disabled="!isAdd" @change="schoolChange" style="width: 100%">
<el-option v-for="(item, i) in clients" :key="i" :label="item.schoolName"
:value="item.schoolId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="studentAffiliatedInstitutionId" label="学生所在院校">
<el-select v-model="form.studentAffiliatedInstitutionId" filterable style="width: 100%">
<el-option v-for="(item, i) in schools" :key="i" :label="item.schoolName"
:value="item.schoolId"></el-option>
</el-select>
<p style="margin-top: 10px;line-height: 1.4;font-size: 12px;">学生所属院校为学生实际院校</p>
</el-form-item>
<el-form-item prop="workNumber" label="学生学号">
<el-input v-model="form.workNumber" placeholder="请输入学生学号" @change="workNumberChange"></el-input>
</el-form-item>
<el-form-item prop="userName" label="学生姓名">
<el-input v-model="form.userName" placeholder="请输入学生姓名" :disabled="isAdd"></el-input>
</el-form-item>
<el-form-item label="账号角色">
学生
</el-form-item>
<el-form-item v-if="info.completeCompetitionSetup.competitionType" prop="teamId" label="所属团队">
<div style="display: flex;align-items: center">
<el-select v-model="form.teamId" :disabled="formEnable && isAdd" filterable
style="width: 240px;margin-right: 10px">
<el-option v-for="(item, i) in teams" :key="i" :label="item.teamName" :value="item.teamId"></el-option>
</el-select>
<el-button v-if="isAdd && !formEnable" type="text" @click="createTeam">创建团队</el-button>
</div>
</el-form-item>
<el-form-item prop="phone" label="手机号">
<el-input v-model="form.phone" maxlength="11" placeholder="请输入手机号" :disabled="isAdd"></el-input>
</el-form-item>
<el-form-item prop="email" label="邮箱">
<el-input v-model="form.email" placeholder="请输入邮箱" :disabled="isAdd"></el-input>
</el-form-item>
</el-form>
<p v-if="!isAdd" class="tips" style="margin-left: 13px">当前页面信息修改会同步修改掉学生账号信息</p>
<span slot="footer" class="dialog-footer">
<el-button @click="addVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确定</el-button>
</span>
</el-dialog>
<el-dialog title="创建团队" :visible.sync="teamVisible" :close-on-click-modal="false" width="300px">
<el-form class="dia-form">
<el-form-item>
<el-input placeholder="请输入团队名称" maxlength="10" v-model="teamForm.teamName"></el-input>
</el-form-item>
<el-form-item>
<el-input placeholder="请设置团队邀请码" maxlength="6" v-model="teamForm.invitationCode"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="teamSubmit">确定并使用</el-button>
<el-button size="small" @click="teamVisible = false">取消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from "@/libs/util";
import axios from 'axios'
import Setting from "@/setting";
export default {
data () {
return {
token: sessionStorage.getItem('token'),
id: +this.$route.query.id,
info: {
completeCompetitionSetup: {
competitionType: 1,
}
},
isDisable: this.$route.query.isDisable ? +this.$route.query.isDisable : '',
statusList: [
{
id: '',
name: '不限'
},
{
id: 1,
name: '已禁用'
},
{
id: 0,
name: '未禁用'
}
],
keyword: this.$route.query.keyword || '',
listData: [],
multipleSelection: [],
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
schoolOrder: '',
teamOrder: '',
clients: [],
schools: [],
addVisible: false,
formEnable: true,
isAdd: false,
form: {
captain: 0,
competitionId: this.$route.query.id,
userName: '',
workNumber: '',
schoolId: '',
studentAffiliatedInstitutionId: '',
teamId: '',
whetherSignUp: 0,
phone: '',
email: '',
identification: 1,
uniqueIdentification: Date.now(),
password: Setting.initialPassword
},
rules: {
schoolId: [
{ required: true, message: "请选择所属院校", trigger: "change" }
],
workNumber: [
{ required: true, message: "请输入学号", trigger: "blur" }
],
teamId: [
{ required: true, message: "请选择所属团队", trigger: "change" }
]
},
submiting: false,
teamVisible: false,
teams: [],
teamNameRepeat: false,
teamForm: {
competitionId: this.$route.query.id,
registrationInvitationCode: '',
teamName: '',
invitationCode: '',
whetherSignUp: 1,
identification: 1
},
originForm: {},
exitMember: 0,
notExit: 0,
schoolDisable: false,
importVisible: false,
uploadList: [],
uploadFaild: false,
uploadTips: '',
exportCode: '',
headers: {
token: sessionStorage.getItem("token")
},
uploading: false,
isBackstage: 0,
exporting: false,
loading: false,
};
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
this.getData()
this.getInfo()
this.getTeam()
},
methods: {
init () {
this.initData()
this.getTeam()
this.getClient()
},
async getData () {
this.loading = true
const { data } = await this.$post(this.api.queryAbnormalTeam, {
pageNum: this.page,
pageSize: this.pageSize,
competitionId: this.id,
keyWord: this.keyword,
isDisable: this.isDisable,
schoolOrder: this.schoolOrder,
teamOrder: this.teamOrder,
})
const list = data.records;
list.map(e => {
if (e.teacherDetails) {
e.teachers = JSON.parse(e.teacherDetails)
}
})
this.listData = list
this.total = data.total;
this.$refs.table.clearSelection();
this.loading = false
},
//
getInfo () {
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => {
this.info = competition
this.getSchool()
//
if (competition.competitionScope) {
this.getClient()
} else {
this.schoolDisable = true
this.form.schoolId = competition.schoolId
}
}).catch(err => { })
},
initData () {
this.page = 1
this.getData()
},
handleSelectionChange (val) {
this.multipleSelection = val;
},
handleCurrentChange (val) {
this.page = val;
this.getData();
},
switchOff (val, row, index) {
this.$put(`${this.api.disableRegistration}?competitionRegistrationId=${row.id}&isDisable=${val}`).then(res => { }).catch(err => { });
},
//
sortChange (column) {
// 12
if (column.prop === 'school') this.schoolOrder = column.order ? column.order === 'ascending' ? 2 : 1 : ''
if (column.prop === 'teamName') this.teamOrder = column.order ? column.order === 'ascending' ? 2 : 1 : ''
this.getData()
},
//
edit (row) {
this.notExit = 0
this.isAdd = false
this.addVisible = true
row.userName = row.username
this.exitMember = 0
row.id = row.accountId
this.originForm = JSON.parse(JSON.stringify(row))
this.form = JSON.parse(JSON.stringify(row))
},
del (row) {
this.$confirm(!this.info.completeCompetitionSetup.competitionType || row.captain === '否' ? '删除后该参赛人员已有的成绩会一并删除,成绩排名将会受影响,是否确定要删除?' : '删除队长后,该团队下所有成员都会同步移除报名,已有的成绩也会一并删除,成绩排名将会受影响,是否确认删除?', "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.batchDeleteApplicants, { registrationVOS: [row] }).then(res => {
util.successMsg("删除成功");
this.init()
}).catch(res => { });
}).catch(() => { });
},
//
schoolChange () {
if (!this.form.studentAffiliatedInstitutionId) this.form.studentAffiliatedInstitutionId = this.form.schoolId
},
//
workNumberChange () {
const { form } = this
if (this.originForm.workNumber !== form.workNumber) {
form.schoolId && form.workNumber && this.$get(`${this.api.enquireAboutSchoolStudents}?schoolId=${form.schoolId}&workNumber=${form.workNumber}${this.isAdd ? '' : '&applyFor=1'}`).then(({ account }) => {
this.notExit = 0
this.exitMember = 0
if (account) {
const { studentAffiliatedInstitutionId } = form
account.studentAffiliatedInstitutionId = studentAffiliatedInstitutionId
this.form = account
}
this.formEnable = !account
}).catch(res => {
if (res.message === '学生不存在') this.notExit = 1
if (!this.isAdd) this.exitMember = 1
})
} else {
this.exitMember = 0
}
},
//
submitForm () {
const { form } = this
if (!this.isAdd) { //
this.$post(this.api.updateUser, {
hrUserAccount: {
...form,
id: form.id,
lastTimeInstitutionId: this.originForm.studentAffiliatedInstitutionId
},
hrUserInfo: {
userId: form.userId,
schoolId: form.schoolId,
email: form.email,
userName: form.userName
}
}).then(res => {
//
if (this.originForm.teamId !== form.teamId) {
this.$post(this.api.joinCompetitionTeam, {
schoolId: form.schoolId,
studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId,
accountId: form.id,
competitionId: this.id,
teamId: form.teamId,
identification: 1,
whetherSignUp: 1
}).then(res => {
this.addVisible = false
this.init()
this.submiting = false
util.successMsg('编辑成功!')
}).catch(res => {
this.submiting = false
})
} else {
this.addVisible = false
this.init()
this.submiting = false
util.successMsg('编辑成功!')
}
}).catch(res => {
this.submiting = false
})
} else {
//
this.$post(this.api[this.info.completeCompetitionSetup.competitionType ? 'joinCompetitionTeam' : 'addCompetitionRegistration'], {
schoolId: form.schoolId,
studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId,
accountId: form.id,
competitionId: this.id,
teamId: this.form.teamId,
identification: 1,
whetherSignUp: 1
}).then(res => {
this.addVisible = false
this.init()
this.submiting = false
util.successMsg('报名成功!')
}).catch(res => {
this.submiting = false
})
}
},
//
submit () {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.submiting) return false
const { form } = this
const team = this.teams.find(e => e.teamId == form.teamId)
if (team && team.invitationCode) form.invitationCode = team.invitationCode
// id-id-schoolId-workNumber
form.account = `${Setting.platformId}-3-${form.schoolId}-${form.workNumber}`
const { phone, email } = form
if (phone && !/^1[3456789]\d{9}$/.test(phone)) {
return util.errorMsg("请输入正确的手机号")
} else if (email && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email)) {
return util.errorMsg("请输入正确的邮箱")
} else if (this.notExit) {
return util.errorMsg('学生不存在,无法添加!')
} else if (this.exitMember) {
return util.errorMsg('学生已存在')
} else {
this.submiting = true
this.submitForm()
}
}
})
},
//
closeAdd () {
this.form = {
captain: 0,
competitionId: this.id,
userName: '',
workNumber: '',
schoolId: '',
teamId: '',
whetherSignUp: 0,
phone: '',
email: '',
identification: 1,
uniqueIdentification: Date.now(),
password: Setting.initialPassword
}
},
//
createTeam () {
this.teamForm = {
competitionId: this.id,
registrationInvitationCode: '',
teamName: '',
invitationCode: '',
whetherSignUp: 1,
identification: 1
}
this.teamVisible = true
},
//
async getSchool () {
const { list } = await this.$get(this.api.querySchoolData)
this.schools = list
},
//
async getClient () {
if (this.info.competitionScope === 2) {
//
this.$get(`${this.api.schoolsInCompetitionArea}?competitionId=${this.id}`).then(({ schools }) => {
this.clients = schools
}).catch(res => { })
} else {
//
const sid = this.$store.state.dataPer.find(e => e.permissionName === '客户管理')
this.$post(this.api.queryCustomer, {
customerType: '',
page: 1,
size: 10000,
supplierId: (sid && !sid.all) ? sid.supplierId : ''
}).then(res => {
const { list } = res.message
list.map(e => {
e.schoolName = e.customerName
})
this.clients = list
}).catch(res => { })
}
},
//
getTeam () {
this.$get(this.api.searchTeam, {
teamName: '',
competitionId: this.id
}).then(({ teamList }) => {
this.teams = teamList
}).catch(res => { })
},
//
teamSubmit () {
const form = this.teamForm
if (!form.teamName) return util.errorMsg('请输入团队名称')
if (form.invitationCode.length !== 6) return util.errorMsg('请输入6位数团队邀请码')
form.accountId = this.form.id
form.schoolId = this.form.schoolId
form.studentAffiliatedInstitutionId = this.form.studentAffiliatedInstitutionId
this.$post(this.api.addCompetitionTeam, form).then(res => {
this.teamVisible = false
this.addVisible = false
this.init()
util.successMsg('报名成功!')
}).catch(res => { })
},
//
toInfo (row) {
this.$store.commit('setInnerReferrer', `${this.$route.path}?id=${this.id}&tab=tab6&name=${this.$route.query.name}&keyword=${this.keyword}&page=${this.page}&isDisable=${this.isDisable}`)
this.$router.push(`/matchInfo?id=${this.id}&accountId=${row.accountId}`)
},
exportAll () {
if (this.listData.length) {
this.exporting = true
const data = this.multipleSelection
if (data.length) {
data.map((e, i) => e.id = i + 1)
axios.post(this.api.exportDataInBatches, data, {
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
const name = res.headers['content-disposition']
util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data]))
this.exporting = false
}).catch(res => {
this.exporting = false
})
} else {
axios.get(`${this.api.exportAbnormalData}?competitionId=${this.id}`, {
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
const name = res.headers['content-disposition']
util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data]))
this.exporting = false
}).catch(res => {
this.exporting = false
})
}
}
},
//
async batchDel () {
const list = this.multipleSelection
const tips = list.length ? (this.info.completeCompetitionSetup.competitionType && list.find(e => e.captain === '是') ? '删除队长后,该团队下所有成员都会同步移除报名,已有的成绩也会一并删除,成绩排名将会受影响,是否确认删除?' : '删除后该参赛人员已有的成绩会一并删除,成绩排名将会受影响,是否确定要删除?') : '删除后参赛人员已有的成绩会一并删除,成绩排名将会受影响,<span style="font-size: 15px;color: #f00">是否确定删除全部报名人员?</span>'
this.$confirm(tips, "提示", {
type: "warning",
dangerouslyUseHTMLString: true
}).then(async () => {
if (list.length) {
await this.$post(this.api.batchDeleteApplicants, { registrationVOS: list })
} else {
await this.$post(`${this.api.deleteAllData}?competitionId=${this.id}`)
}
this.init()
this.$message.success("删除成功");
this.$refs.table.clearSelection()
}).catch(() => { });
},
}
};
</script>
<style lang="scss" scoped>
/deep/.dia-form {
.w-100 {
width: 100%;
}
.tips {
display: flex;
justify-content: center;
align-items: center;
}
}
.tips {
font-size: 12px;
color: #e90000;
}
/deep/.import-file {
.el-progress__text,
.el-progress,
.el-upload-list__item-status-label {
display: none !important;
}
}
</style>

@ -1,28 +1,22 @@
<template>
<!-- 赛事管理 -->
<div>
<el-card shadow="hover"
class="m-b-20">
<el-card shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="back"
:content="name + '/管理'"></el-page-header>
<el-page-header @back="back" :content="name + '/管理'"></el-page-header>
</div>
</el-card>
<div class="page"
style="margin-bottom: 24px">
<div class="page" style="margin-bottom: 24px">
<div class="tabs">
<a class="item"
v-for="(item,index) in tabs"
:key="index"
:class="{active: index == active}"
@click="tabChange(index)">{{ item }}</a>
<a class="item" v-for="(item, index) in tabs" :key="index" :class="{ active: index == active }"
@click="tabChange(index)">{{ item }}</a>
</div>
<MatchDetail v-if="active == 'tab1'"
ref="detail" />
<MatchDetail v-if="active == 'tab1'" ref="detail" />
<MatchArch v-if="active == 'tab2'" />
<MatchProgress v-else-if="active == 'tab3'" />
<notice v-else-if="active == 'tab4'" />
<Notice v-else-if="active == 'tab4'" />
<MatchSignup v-else-if="active == 'tab5'" />
<AbnormalTeam v-else-if="active == 'tab6'" />
</div>
</div>
@ -33,8 +27,9 @@ import Setting from "@/setting";
import MatchDetail from "../add";
import MatchArch from "./matchArch";
import MatchProgress from "./matchProgress";
import notice from "./notice";
import MatchSignup from "./matchSignup";
import Notice from "./notice";
import MatchSignup from './matchSignup'
import AbnormalTeam from './abnormalTeam'
export default {
name: "matchManage",
data () {
@ -46,7 +41,7 @@ export default {
tab2: "大赛成绩管理",
tab3: "竞赛进展",
tab4: "公告通知",
tab5: "报名人员"
tab5: "报名人员",
}
};
},
@ -54,11 +49,16 @@ export default {
MatchDetail,
MatchArch,
MatchProgress,
notice,
MatchSignup
Notice,
MatchSignup,
AbnormalTeam
},
mounted () {
Setting.dynamicRoute && this.initTabs()
// if (Setting.dynamicRoute) {
this.initTabs()
// } else {
// this.active = this.$route.query.tab || 'tab1'
// }
},
methods: {
async initTabs () {
@ -77,6 +77,12 @@ export default {
tab4 || this.$delete(this.tabs, 'tab4')
tab5 || this.$delete(this.tabs, 'tab5')
if (res.competition.completeCompetitionSetup.competitionType) {
this.tabs.tab6 || this.$set(this.tabs, 'tab6', '查看异常团队')
} else {
this.tabs.tab6 && this.$delete(this.tabs, 'tab6')
}
const type = this.$route.query.tab
const keys = Object.keys(this.tabs)
if (keys.length) this.active = keys.includes(type) ? type : keys[0]
@ -119,7 +125,7 @@ export default {
// tab
tabSwitch (i) {
this.active = i
this.$router.push(`/matchManage?id=${this.$route.query.id}&tab=${i}&name=${this.name}`)
this.$router.push(`/matchManage?id=${this.$route.query.id}&tab=${i}&name=${this.name}`).catch(e => { })
},
// tab
backOrTab (i) {
@ -133,5 +139,4 @@ export default {
};
</script>
<style scoped>
</style>
<style scoped></style>

@ -1,61 +1,57 @@
<template>
<!-- 报名人员 -->
<div class="page-content"
style="padding: 24px">
<el-table ref="table"
:data="list"
class="table"
stripe
header-align="center"
row-key="stageId">
<el-table-column type="index"
width="60"
label="序号"
align="center">
<div class="page-content" style="padding: 24px">
<el-table ref="table" :data="list" class="table" stripe header-align="center" row-key="stageId">
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="stageName"
label="阶段名称"
align="center"></el-table-column>
<el-table-column prop="methodName"
label="比赛方式"
align="center"></el-table-column>
<el-table-column prop="founderName"
label="比赛形式"
align="center">
<el-table-column prop="stageName" label="阶段名称" align="center"></el-table-column>
<el-table-column prop="competitionContent" label="比赛内容" align="center"></el-table-column>
<el-table-column prop="methodName" label="比赛方式" align="center"></el-table-column>
<el-table-column label="竞赛类型" align="center">
<template slot-scope="scope">
{{ scope.row.competitionType ? '团队赛' : '个人赛' }}
</template>
</el-table-column>
<el-table-column prop="ruleName"
label="赛制"
align="center"></el-table-column>
<el-table-column prop="status"
label="状态"
align="center"></el-table-column>
<el-table-column label="竞赛起止时间"
width="290"
align="center">
<el-table-column prop="ruleName" label="赛制" align="center"></el-table-column>
<el-table-column prop="status" label="大赛状态" align="center"></el-table-column>
<el-table-column prop="reviewStatus" label="评阅情况" align="center"></el-table-column>
<el-table-column label="竞赛时间" width="290" align="center">
<template slot-scope="scope">
{{ scope.row.startTime + ' ~ ' + scope.row.endTime }}
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="260">
<el-table-column label="操作" align="center" width="280">
<template slot-scope="scope">
<el-button type="primary"
@click="toRank(scope.row, scope.$index)">排名</el-button>
<el-button @click="toArch(scope.row, scope.$index)">成绩管理</el-button>
<el-button type="text" @click="toRank(scope.row, scope.$index)">排名</el-button>
<el-button type="text" @click="toArch(scope.row, scope.$index)">成绩统计</el-button>
<!-- <el-button @click="toArch(scope.row, scope.$index)">编辑试卷</el-button> -->
<template v-if="scope.row.method === 1">
<el-button v-if="scope.row.showMyReviewTask" type="text"
@click="showReview(scope.row, '/myReview/records')">我的评阅任务</el-button>
<el-button v-auth="'/review:分配评阅任务'" type="text"
@click="showReview(scope.row, '/allocationReview')">分配评阅任务</el-button>
</template>
</template>
</el-table-column>
</el-table>
<el-drawer title="" :visible.sync="reviewVisible" size="100%" :close-on-click-modal="false" :withHeader="false"
custom-class="review-dia">
<div>
<button type="button" class="el-drawer__close-btn" @click="reviewVisible = false">
<i class="el-dialog__close el-icon el-icon-close"></i>
</button>
</div>
<iframe :src="reviewUrl" frameborder="0" width="100%"></iframe>
</el-drawer>
</div>
</template>
<script>
import Setting from '@/setting'
import Const from '@/const/match'
export default {
name: "matchArch",
@ -66,6 +62,8 @@ export default {
form: {},
timer: null,
curStep: [],
reviewVisible: false,
reviewUrl: '',
};
},
mounted () {
@ -125,7 +123,16 @@ export default {
this.$store.commit('setInnerReferrer', this.$route.fullPath)
const cur = this.form.competitionStage[i]
const showFile = !!(cur.method === 2 && cur.competitionStageContentSetting && cur.competitionStageContentSetting.whetherToUploadFiles)
this.$router.push(`/matchArchList?id=${this.id}&stageId=${row.stageId}&method=${row.method}&competitionType=${row.competitionType}&showFile=${showFile}`)
this.$router.push(`/${cur.method === 2 ? 'otherArchList' : 'matchArchList'}?id=${this.id}&stageId=${row.stageId}&method=${row.method}&competitionType=${row.competitionType}&showFile=${showFile}&showMyReviewTask=${row.showMyReviewTask}`)
},
//
showReview (row, path) {
let url = `${location.origin}/reviewCenter/`
if (Setting.isDev) url = `http://192.168.31.125:8099/`
url += `#${path}?token=${sessionStorage.getItem('token')}&v=${Date.now()}&competitionId=${this.id}&stageId=${row.stageId}`
localStorage.setItem('review_token', sessionStorage.getItem('token'))
this.reviewUrl = url
this.reviewVisible = true
}
}
};
@ -133,15 +140,29 @@ export default {
<style lang="scss" scoped>
/deep/.el-collapse-item__header {
font-size: 16px;
color: #333;
font-size: 16px;
color: #333;
}
.line {
display: flex;
justify-content: space-around;
align-items: center;
span {
margin-right: 30px;
}
display: flex;
justify-content: space-around;
align-items: center;
span {
margin-right: 30px;
}
}
/deep/.review-dia {
.el-drawer__close-btn {
position: absolute;
top: 20px;
right: 20px;
}
iframe {
height: 100%;
}
}
</style>

File diff suppressed because it is too large Load Diff

@ -1,36 +1,27 @@
<template>
<div style="padding: 0 100px;">
<el-card shadow="hover"
class="m-b-20 head-card">
<el-card shadow="hover" class="m-b-20 head-card">
<div class="flex-between">
<el-page-header @back="$router.back()"
content="参赛信息与成绩"></el-page-header>
<el-page-header @back="back" content="参赛信息与成绩"></el-page-header>
</div>
</el-card>
<el-card shadow="hover"
class="m-b-20">
<el-card shadow="hover" class="m-b-20" v-loading="loading">
<div style="display: flex;align-items: center">
<table v-if="form.completeCompetitionSetup.competitionType"
class="table m-b-20 m-r-10">
<table v-if="form.completeCompetitionSetup.competitionType" class="table m-b-20 m-r-10">
<tr>
<th width="150">团队名称</th>
<td>
<el-input :disabled="!editing"
v-model="info.team.teamName"></el-input>
<el-input :disabled="!editing" v-model="info.team.teamName"></el-input>
</td>
<th width="150">团队邀请码</th>
<td>
<el-input :disabled="!editing"
maxlength="6"
v-model="info.team.invitationCode"></el-input>
<el-input :disabled="!editing" maxlength="6" v-model="info.team.invitationCode"></el-input>
</td>
</tr>
</table>
<div v-if="form.completeCompetitionSetup.competitionType && status < 4"
class="m-b-20 text-center">
<el-button type="primary"
@click="edit(1)">{{ editing ? '保存' : '编辑' }}</el-button>
<div v-if="form.completeCompetitionSetup.competitionType && status < 4" class="m-b-20 text-center">
<el-button type="primary" @click="edit(1)">{{ editing ? '保存' : '编辑' }}</el-button>
</div>
</div>
<table class="table">
@ -45,21 +36,21 @@
</tr>
<tr>
<th>学校</th>
<td>{{ info.person.schoolName }}</td>
<td>{{ info.person.realSchool }}</td>
</tr>
</template>
<template v-if="form.completeCompetitionSetup.competitionType">
<template>
<tr>
<th>队长</th>
<td>{{ info.caption.userName }}{{ info.caption.schoolName && ',' + info.caption.schoolName }}{{ info.caption.workNumber && ',' + info.caption.workNumber }}</td>
<td>{{ info.captain.userName }}{{ info.captain.realSchool && ',' + info.captain.realSchool }}{{
info.captain.workNumber && ',' + info.captain.workNumber }}</td>
</tr>
<tr>
<th>团队成员</th>
<td>
<el-tag v-for="(item, i) in info.teamDetail"
:key="i"
style="margin-right: 5px">{{ item.userName }}</el-tag>
<el-tag v-for="(item, i) in info.teamDetail" :key="i" style="margin-right: 5px">{{ item.userName
}}</el-tag>
</td>
</tr>
</template>
@ -68,38 +59,18 @@
<th width="130">指导老师</th>
<td>
<div class="plus">
<i class="el-icon-circle-plus-outline icon"
@click="addAdvisor"></i>
<i class="el-icon-circle-plus-outline icon" @click="addAdvisor"></i>
</div>
<div v-for="(item, i) in info.teamInstructors"
:key="i"
class="line">
<el-input placeholder="请输入姓名"
v-model="item.name"
clearable
size="mini"
:disabled="!item.edit"></el-input>
<el-input placeholder="请输入职务"
maxlength="10"
v-model="item.position"
clearable
size="mini"
:disabled="!item.edit"></el-input>
<el-input placeholder="请输入手机号"
maxlength="11"
v-model="item.phone"
clearable
size="mini"
:disabled="!item.edit"></el-input>
<div v-for="(item, i) in info.teamInstructors" :key="i" class="line">
<el-input placeholder="请输入姓名" v-model="item.name" clearable size="mini" :disabled="!item.edit"></el-input>
<el-input placeholder="请输入职务" maxlength="10" v-model="item.position" clearable size="mini"
:disabled="!item.edit"></el-input>
<el-input placeholder="请输入手机号" maxlength="11" v-model="item.phone" clearable size="mini"
:disabled="!item.edit"></el-input>
<template>
<i v-if="item.edit"
class="el-icon-check icon"
@click="submitAdvisor(item, i)"></i>
<i v-else
class="el-icon-edit icon"
@click="editAdvisor(item)"></i>
<i class="el-icon-delete icon"
@click="delAdvisor(item, i)"></i>
<i v-if="item.edit" class="el-icon-check icon" @click="submitAdvisor(item, i)"></i>
<i v-else class="el-icon-edit icon" @click="editAdvisor(item)"></i>
<i class="el-icon-delete icon" @click="delAdvisor(item, i)"></i>
</template>
</div>
</td>
@ -113,42 +84,44 @@
<th>赛项阶段名称</th>
<template v-if="form.completeCompetitionSetup.competitionType">
<th width="110">参赛人数限制</th>
<th>允许参赛人员</th>
<th>
允许参赛人员
<el-tooltip v-if="stageTip" effect="dark" content="阶段参赛人员异常,请尽快按照阶段赛规则调整,否则可能影响比赛成绩!"
placement="bottom">
<i class="info el-icon-warning" style="margin-right: 10px;color: #ff1650;"></i>
</el-tooltip>
</th>
</template>
<th v-if="form.rule === 0">总分</th>
<th>竞赛成绩</th>
</tr>
<template v-if="info.stages.length">
<tr v-for="(item, i) in info.stages"
:key="i">
<tr v-for="(item, i) in info.stages" :key="i">
<td>{{ i + 1 }}</td>
<td>{{ item.stageName }}</td>
<template v-if="form.completeCompetitionSetup.competitionType">
<td>{{ item.teamNumLimit || '不限制' }}</td>
<td>{{ item.customNumber || '不限制' }}</td>
<td>
<template v-if="item.participants">
<el-tag v-for="tag in item.participants"
:key="tag.name"
class="m-r-5"
closable
@close="removePar(tag, item)">
{{tag.name}}
<el-tag v-for="tag in item.participants" :key="tag.name" class="m-r-5" closable
@close="removePar(tag, item)">
{{ tag.name }}
</el-tag>
</template>
<span v-else
class="m-r-5"></span>
<i class="el-icon-edit icon"
@click="selectPar(item)"></i>
<span v-else class="m-r-5"></span>
<i class="el-icon-edit icon" @click="selectPar(item)"></i>
<el-tooltip v-if="stageTip && stageTip[i + 1]" effect="dark" :content="stageTip[i + 1]"
placement="bottom">
<el-tag type="danger" class="m-l-5">异常</el-tag>
</el-tooltip>
</td>
</template>
<td v-if="form.rule === 0 && !i"
:rowspan="info.stages.length">{{ info.totalScore }}</td>
<td v-if="form.rule === 0 && !i" :rowspan="info.stages.length">{{ info.totalScore }}</td>
<td>
<span v-if="item.score >= 0"
class="m-r-10">分数{{item.score}}</span>
<el-button v-if="form.completeCompetitionSetup.competitionType || (!form.completeCompetitionSetup.competitionType && item.resultsDetails === 0 && item.reportId)"
type="text"
@click="show(item)">查看成绩详情</el-button>
<span v-if="item.score >= 0" class="m-r-10">分数{{ item.score }}</span>
<el-button
v-if="form.completeCompetitionSetup.competitionType || (!form.completeCompetitionSetup.competitionType && item.reportId)"
type="text" @click="show(item)">查看成绩详情</el-button>
</td>
</tr>
</template>
@ -156,100 +129,63 @@
<td colspan="6">暂无数据</td>
</tr>
</table>
<el-alert v-if="form.completeCompetitionSetup.competitionType"
style="margin-top: 10px;"
:title="'注:请团长(团队创建人)设置各阶段参赛成员,只有被选择的允许参赛成员可进入对应阶段比赛' + (info.teamLimit ? ',每个团队成员只能参加一个赛项阶段' : '') + '!'"
type="warning"
show-icon>
<el-alert v-if="form.completeCompetitionSetup.competitionType && form.rule !== 2" style="margin-top: 10px;"
:title="'注:请团长(团队创建人)设置各阶段参赛成员,只有被选择的允许参赛成员可进入对应阶段比赛' + (info.teamLimit ? ',每个团队成员只能参加一个赛项阶段' : '') + '!'"
type="warning" show-icon>
</el-alert>
</td>
</tr>
</table>
<template v-if="form.completeCompetitionSetup.competitionType">
<div class="l-title m-t-20">团队成员</div>
<div class="flex a-center" style="margin: 20px 0">
<div class="l-title" style="margin: 0 20px 0 0">团队成员</div>
<el-tag v-for="(item, i) in teamErrors" :key="i" type="danger" style="margin-right: 5px">{{ item
}}</el-tag>
</div>
<div class="flex-center">
<p>队长{{ info.caption.userName }}</p>
<el-button type="primary"
@click="transfer">转让队长</el-button>
<p>队长{{ info.captain.userName }}</p>
<el-button type="primary" @click="transfer">转让队长</el-button>
</div>
<el-table :data="info.teamDetail"
stripe
header-align="center">
<el-table-column prop="userName"
label="成员姓名"
min-width="100"
align="center"></el-table-column>
<el-table-column prop="schoolName"
label="学校"
min-width="100"
align="center"></el-table-column>
<el-table-column prop="workNumber"
label="学号"
min-width="100"
align="center"></el-table-column>
<el-table-column prop="createTime"
label="加入时间"
width="180"
align="center"></el-table-column>
<el-table-column label="操作"
align="center"
width="160">
<el-table :data="info.teamDetail" stripe header-align="center">
<el-table-column prop="userName" label="成员姓名" min-width="100" align="center"></el-table-column>
<el-table-column prop="realSchool" label="学校" min-width="100" align="center"></el-table-column>
<el-table-column prop="phone" label="手机号" min-width="100" align="center"></el-table-column>
<el-table-column prop="workNumber" label="学号" min-width="100" align="center"></el-table-column>
<el-table-column prop="createTime" label="加入时间" width="180" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="160">
<template slot-scope="scope">
<el-button v-if="scope.row.captain"
type="text"
@click="removeLine(scope.row)">踢出团队</el-button>
<el-button v-if="scope.row.captain" type="text" @click="removeLine(scope.row)">踢出团队</el-button>
</template>
</el-table-column>
</el-table>
</template>
</el-card>
<el-dialog title="选择参赛成员"
:visible.sync="transferVisible"
:close-on-click-modal="false"
width="400px">
<el-dialog title="选择参赛成员" :visible.sync="transferVisible" :close-on-click-modal="false" width="400px">
<template v-for="(item, i) in info.teamDetail">
<el-radio v-if="item.captain"
:key="i"
v-model="checkedPlayer"
:label="item.teamId">{{ item.userName }}</el-radio>
<el-radio v-if="item.captain" :key="i" v-model="checkedPlayer" :label="item.teamId">{{ item.userName
}}</el-radio>
</template>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
type="primary"
@click="transferSubmit">确定</el-button>
<el-button size="small"
@click="transferVisible = false">取消</el-button>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="transferSubmit">确定</el-button>
<el-button size="small" @click="transferVisible = false">取消</el-button>
</span>
</el-dialog>
<el-dialog title="选择参赛成员"
:visible.sync="chooseVisible"
:close-on-click-modal="false"
width="400px">
<el-dialog title="选择参赛成员" :visible.sync="chooseVisible" :close-on-click-modal="false" width="400px">
<el-checkbox-group v-model="checkedMembers">
<el-checkbox v-for="(item, i) in chooses"
:key="i"
:label="item.accountId">{{ item.userName }}</el-checkbox>
<el-checkbox v-for="(item, i) in chooses" :key="i" :label="item.accountId">{{ item.userName }}</el-checkbox>
</el-checkbox-group>
<p v-if="info.teamLimit && curRow.teamNumLimit"
style="margin-top: 15px;font-size: 12px;">当前阶段限制{{ curRow.teamNumLimit }}人参赛且此竞赛每个成员只能参加一个阶段赛项</p>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
type="primary"
@click="chooseSubmit">确定</el-button>
<el-button size="small"
@click="chooseVisible = false">取消</el-button>
<p v-if="info.teamLimit && curRow.customNumber" style="margin-top: 15px;font-size: 12px;">当前阶段限制{{
curRow.customNumber }}人参赛且此竞赛每个成员只能参加一个阶段赛项</p>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="chooseSubmit">确定</el-button>
<el-button size="small" @click="chooseVisible = false">取消</el-button>
</span>
</el-dialog>
<el-dialog title="团队得分详情"
:visible.sync="memberVisible"
width="900px"
:close-on-click-modal="false">
<h6 v-if="members.length"
style="margin-bottom: 10px;font-size: 16px;">团队名称{{ members[0].teamName }} 阶段名称{{ curRow.stageName }}</h6>
<el-dialog title="团队得分详情" :visible.sync="memberVisible" width="900px" :close-on-click-modal="false">
<h6 v-if="members.length" style="margin-bottom: 10px;font-size: 16px;">团队名称{{ members[0].teamName }} 阶段名称{{
curRow.stageName }}</h6>
<table class="table tc">
<tr>
<th width="60">序号</th>
@ -260,17 +196,14 @@
<th width="100">得分详情</th>
</tr>
<template v-if="members.length">
<tr v-for="(item, i) in members"
:key="i">
<tr v-for="(item, i) in members" :key="i">
<td>{{ i + 1 }}</td>
<td>{{ item.userName }}</td>
<td>{{ item.schoolName }}</td>
<td>{{ item.realSchool }}</td>
<td>{{ item.timeSum }}min</td>
<td>{{ item.score }}</td>
<td>
<el-button v-if="curRow.resultsDetails === 0 && item.reportId"
type="text"
@click="toReport(item)">查看</el-button>
<el-button :disabled="!item.reportId" type="text" @click="toReport(item)">查看</el-button>
</td>
</tr>
</template>
@ -278,24 +211,26 @@
<td colspan="6">暂无数据</td>
</tr>
</table>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
type="primary"
@click="memberVisible = false">确定</el-button>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange"
:current-page="page" :page-size="pageSize">
</el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="memberVisible = false">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Setting from "@/setting";
import Util from "@/libs/util";
export default {
data () {
return {
id: +this.$route.query.id,
accountId: +this.$route.query.accountId,
loading: false,
status: 5,
form: {
competitionStage: [],
@ -305,7 +240,7 @@ export default {
info: {
isCaption: 0,
person: {},
caption: {},
captain: {},
team: {
captain: 1,
invitationCode: ''
@ -316,6 +251,9 @@ export default {
},
memberVisible: false,
members: [],
page: 1,
pageSize: 10,
total: 0,
curRow: {},
teamVisible: false,
teams: [],
@ -347,22 +285,20 @@ export default {
checkedMember: '',
checkedMembers: [],
chooses: [],
timerList: [],
timer: null
timer: null,
teamErrors: [],
stageTip: null,
};
},
mounted () {
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
this.timerList.forEach(n => {
clearTimeout(n)
})
this.timerList = []
})
this.getData()
},
methods: {
getData () {
this.loading = true
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => {
this.form = competition
this.timer = setInterval(this.handleStatus, 1000)
@ -379,10 +315,10 @@ export default {
info.team = {}
info.teamDetail = []
} else {
info.isCaption = info.team.caption
info.isCaption = info.team.captain
}
const caption = info.teamDetail.find(e => !e.caption)
info.caption = caption ? caption : {}
const captain = info.teamDetail.find(e => !e.captain)
info.captain = captain ? captain : {}
info.person = info.personalDetail || info.teamDetail.find(e => e.accountId == info.team.accountId)
this.originInfo = JSON.parse(JSON.stringify(info))
// accountId
@ -400,22 +336,24 @@ export default {
e.participants = participants
}
})
//
const now = Date.now()
this.form.competitionStage.map(e => {
//
if (!e.resultsDetails) {
const endTime = new Date(e.endTime).getTime() + e.resultAnnouncementTime * 3600000 // +
if (now > endTime) { //
info.stages.find(n => n.stageId == e.stageId).showDetail = 1
} else if (endTime - now < 86400000) { //
this.timerList.push(setTimeout(this.getInfo, endTime - now))
}
}
})
this.info = info
this.form.completeCompetitionSetup.competitionType && this.getErrorInfo()
this.loading = false
}).catch(err => { });
},
//
async getErrorInfo () {
const res = await this.$get(this.api.checkTeamStatus, {
competitionId: this.id,
teamId: this.info.teamId
})
this.teamErrors = res.teamTip.split(';').filter(e => e)
if (Object.keys(res.stageTip).length) {
this.stageTip = res.stageTip
} else {
this.stageTip = null
}
},
//
handleStatus () {
let status
@ -515,7 +453,7 @@ export default {
transferSubmit () {
if (!this.checkedPlayer) return Util.errorMsg('请选择成员')
this.$post(this.api.captainOfTransfer, {
captainId: this.info.caption.teamId,
captainId: this.info.captain.teamId,
playerId: this.checkedPlayer
}).then(res => {
this.checkedPlayer = ''
@ -597,7 +535,7 @@ export default {
this.chooses = this.info.teamDetail
}
this.curRow = row
this.checkedMembers = row.participants.map(e => e.id)
this.checkedMembers = row.participants ? row.participants.map(e => e.id) : []
this.chooseVisible = true
}
},
@ -605,8 +543,8 @@ export default {
chooseSubmit () {
const accountIds = this.checkedMembers
if (!accountIds.length) return Util.errorMsg('请选择参赛成员!')
const limit = this.curRow.teamNumLimit //
if (limit && accountIds.length > limit) return Util.errorMsg(`请选择${limit}个以下参赛成员!`) //
const { customNumber, teamNumLimit } = this.curRow //
if (teamNumLimit && accountIds.length > customNumber) return Util.errorMsg(`请选择${this.curRow.customNumber}个以下参赛成员!`) //
this.$post(this.api.stageSelectParticipants, {
accountIds,
competitionId: this.id,
@ -619,23 +557,27 @@ export default {
this.chooseVisible = false
}).catch(res => { })
},
async getMembers () {
try {
const { page } = await this.$post(this.api.stageTeamScoreDetails, {
pageNum: this.page,
pageSize: this.pageSize,
competitionId: this.id,
stageId: this.curRow.stageId,
teamId: this.info.teamId
})
this.members = page.records
this.total = page.total
} catch (e) { }
},
//
show (row) {
this.curRow = row
//
if (this.form.completeCompetitionSetup.competitionType) { //
this.curRow = row
this.memberVisible = true
const teamId = this.info.teamId
if (teamId) {
this.$post(this.api.frontOfficeCompetitionRanking, {
pageNum: 1,
pageSize: 1000,
competitionId: this.id,
isOverallRanking: 0,
teamId
}).then(({ list }) => {
this.members = list
}).catch(res => { })
if (this.info.teamId) {
this.getMembers()
} else {
this.members = []
}
@ -643,66 +585,85 @@ export default {
this.toReport(row)
}
},
handleCurrentChange (val) {
this.page = val;
this.getMembers()
},
//
toReport (row) {
this.$router.push(`/matchReport?reportId=${row.reportId}`)
this.$router.push(`/${this.curRow.method === 1 ? 'theoryReport' : 'trialReport'}?reportId=${row.reportId}`)
},
back () {
this.$router.push(this.$store.state.innerReferrer)
}
}
};
</script>
<style lang="scss" scoped>
.m-r-5 {
margin-right: 5px;
margin-right: 5px;
}
.l-title {
margin-top: 20px;
font-size: 18px;
margin-top: 20px;
font-size: 18px;
}
.table {
width: 100%;
border-collapse: collapse;
th,
td {
padding: 12px;
border: 1px solid #ebeef5;
}
&.tc {
text-align: center;
}
th {
text-align: center;
background-color: #f8faff;
}
.icon {
margin-right: 10px;
font-size: 16px;
color: #7a7a7a;
cursor: pointer;
&:hover {
color: #007eff;
}
}
.plus {
margin-bottom: 10px;
text-align: right;
width: 100%;
border-collapse: collapse;
th,
td {
padding: 12px;
border: 1px solid #ebeef5;
}
&.tc {
text-align: center;
}
th {
text-align: center;
background-color: #f8faff;
}
.icon {
margin-right: 10px;
font-size: 16px;
color: #7a7a7a;
cursor: pointer;
&:hover {
color: #007eff;
}
.line {
display: flex;
align-items: center;
margin-bottom: 10px;
.el-input {
margin-right: 15px;
}
}
.plus {
margin-bottom: 10px;
text-align: right;
}
.line {
display: flex;
align-items: center;
margin-bottom: 10px;
.el-input {
margin-right: 15px;
}
}
}
.flex-center {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
}
.text-center {
text-align: center;
text-align: center;
}
</style>

@ -1,141 +1,105 @@
<template>
<div>
<el-card shadow="hover"
class="m-b-20 head-card">
<div class="flex-between m-b-20">
<el-page-header v-if="grades.length"
@back="back"
:content="grades[index].stageName + '/排名'"></el-page-header>
<el-card shadow="hover" class="m-b-20 head-card">
<div class="flex-between">
<el-page-header v-if="grades.length" @back="back" :content="grades[index].stageName + '/排名'"></el-page-header>
</div>
</el-card>
<el-card shadow="hover"
v-loading="loading"
class="m-b-20">
<el-card shadow="hover" v-loading="loading" class="m-b-20">
<div class="tabs">
<template v-for="(item, i) in grades">
<a v-if="i === index || !item.stageId"
:key="i"
class="item"
:class="{active: item.stageId == active}"
@click="tabChange(item.stageId)">{{ item.stageName }}排名</a>
<a v-if="i === index || !item.stageId" :key="i" class="item" :class="{ active: item.stageId == active }"
@click="tabChange(item.stageId)">{{ item.stageName }}排名</a>
</template>
</div>
<div class="flex-between"
style="margin: 20px 0">
<div class="tool flex-between" style="margin-top: 20px">
<div style="display: inline-flex;align-items: center">
<el-radio v-model="type"
:label="0"
@change="typeChange">默认系统排序</el-radio>
<el-radio v-model="type"
:label="1"
@change="typeChange">手动上传</el-radio>
<el-button type="primary"
:disabled="type === 0"
class="ml20"
@click="batchImport">上传文件</el-button>
<el-radio v-model="type" :label="0" @change="typeChange">默认系统排序</el-radio>
<el-radio v-model="type" :label="1" @change="typeChange">手动上传</el-radio>
<el-button type="primary" :disabled="type === 0" class="ml20" @click="batchImport">上传文件</el-button>
</div>
<div style="display: inline-flex;align-items: center">
<el-input style="margin-right: 15px"
:placeholder="'请输入' + (competitionType ? '团队名称/队长' : '学生姓名') + '/学校'"
prefix-icon="el-icon-search"
v-model="keyword"
clearable></el-input>
<el-button v-if="!published"
type="primary"
@click="cancelPublish(1)">发布排名</el-button>
<ul class="filter" style="flex: none;">
<li>
<label>省份</label>
<el-select v-model="filter.provinceId" clearable filterable placeholder="请选择省份" @change="provinceChange"
@clear="clearProvince">
<el-option v-for="(item, i) in provinces" :key="i" :label="item.provinceName"
:value="item.provinceId"></el-option>
</el-select>
</li>
<li>
<label>城市</label>
<el-select v-model="filter.cityId" clearable filterable placeholder="请选择城市" :disabled="!filter.provinceId"
@change="initData">
<el-option v-for="(item, i) in cities" :key="i" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</li>
<li>
<label>学校</label>
<el-select v-model="filter.realSchoolId" clearable filterable placeholder="请选择学校" @change="initData">
<el-option v-for="(item, i) in schools" :key="i" :label="item.schoolName"
:value="item.schoolId"></el-option>
</el-select>
</li>
<li>
<el-input style="margin-right: 15px" :placeholder="'请输入' + (competitionType ? '团队名称/队长' : '学生姓名') + '/学校'"
prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</li>
<el-button v-if="!published" type="primary" @click="cancelPublish(1)">发布排名</el-button>
<template v-else>
<span style="margin-right: 10px;white-space: nowrap;">{{ publishTime }}发布排名</span>
<el-button type="primary"
@click="cancelPublish(0)">取消发布</el-button>
<el-button type="primary" @click="cancelPublish(0)">取消发布</el-button>
</template>
<el-button v-if="list.length"
type="primary"
:loading="exporting"
@click="exportData">{{ exporting ? '正在导出' : '批量导出' }}</el-button>
</div>
<el-button v-if="list.length" type="primary" :loading="exporting" @click="exportData">{{ exporting ? '正在导出' :
'批量导出'
}}</el-button>
</ul>
</div>
<el-table :data="list"
class="table"
ref="table"
stripe
row-key="scoreId"
@selection-change="handleSelectionChange"
header-align="center">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="60"
label="排名"
align="center">
<el-table :data="list" class="table" ref="table" stripe row-key="scoreId"
@selection-change="handleSelectionChange" header-align="center">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="排名" align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<template v-if="competitionType == 1">
<el-table-column prop="teamName"
label="团队名称"
min-width="150"
align="center"></el-table-column>
<el-table-column prop="leaderName"
label="队长"
min-width="150"
align="center"></el-table-column>
<el-table-column prop="teamName" label="团队名称" min-width="150" align="center"></el-table-column>
<el-table-column prop="leaderName" label="队长" min-width="150" align="center"></el-table-column>
</template>
<el-table-column v-else
prop="userName"
label="学生姓名"
min-width="100"
align="center"></el-table-column>
<el-table-column prop="schoolName"
label="学生账号归属"
min-width="100"
align="center"></el-table-column>
<el-table-column prop="realSchool"
label="学生所属院校"
min-width="100"
align="center"></el-table-column>
<el-table-column prop="timeSum"
label="用时"
width="90"
align="center">
<el-table-column v-else prop="userName" label="学生姓名" min-width="100" align="center"></el-table-column>
<el-table-column prop="provinceName" label="省份" min-width="100" align="center"></el-table-column>
<el-table-column prop="cityName" label="城市" min-width="100" align="center"></el-table-column>
<el-table-column prop="schoolName" label="学生账号归属" min-width="100" align="center"></el-table-column>
<el-table-column prop="realSchool" label="学生所在院校" min-width="100" align="center"></el-table-column>
<el-table-column prop="timeSum" label="用时" width="90" align="center">
<template slot-scope="scope">
{{ scope.row.timeSum + (scope.row.timeSum === '—' ? '' : 'min') }}
</template>
</el-table-column>
<el-table-column prop="score"
label="分数"
width="90"
align="center"></el-table-column>
<el-table-column label="得分详情"
align="center"
width="160">
<el-table-column prop="score" label="分数" width="90" align="center"></el-table-column>
<el-table-column label="得分详情" align="center" width="160">
<template slot-scope="scope">
<el-button v-if="(!competitionType && scope.row.reportId) || competitionType"
type="text"
@click="show(scope.row, scope.$index)">查看</el-button>
<el-button v-if="(!competitionType && scope.row.reportId) || competitionType" type="text"
@click="show(scope.row, scope.$index)">查看</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange"
:current-page="page">
</el-pagination>
</div>
</el-card>
<el-dialog title="团队得分详情"
:visible.sync="teamVisible"
width="900px"
:close-on-click-modal="false">
<h6 v-if="active"
style="margin-bottom: 10px;font-size: 16px;">团队名称{{ curRow.teamName }} 阶段名称{{ stageName }}</h6>
<el-dialog title="团队得分详情" :visible.sync="teamVisible" width="900px" :close-on-click-modal="false">
<h6 v-if="active" style="margin-bottom: 10px;font-size: 16px;">团队名称{{ curRow.teamName }} 阶段名称{{ stageName }}
</h6>
<table class="table tc">
<tr>
<template v-if="!active">
@ -150,12 +114,10 @@
<th width="100">得分详情</th>
</tr>
<template v-if="teams.length">
<tr v-for="(item, i) in teams"
:key="i">
<tr v-for="(item, i) in teams" :key="i">
<template v-if="!active && item.rowspan">
<td :rowspan="item.rowspan">{{ item.stageName }}</td>
<td class="scores"
:rowspan="item.rowspan">
<td class="scores" :rowspan="item.rowspan">
<p class="score">{{ item.teamScore }}</p>
<p>{{ item.teamCalculationMethodName }}</p>
<template v-if="isPointWeight">
@ -167,17 +129,14 @@
<template v-if="item.accountId">
<td>{{ i + 1 }}</td>
<td>{{ item.userName }}</td>
<td>{{ item.schoolName }}</td>
<td>{{ item.realSchool }}</td>
<td>{{ item.timeSum }}min</td>
<td>{{ item.score }}</td>
<td>
<el-button v-if="item.reportId"
type="text"
@click="toReport(item)">查看</el-button>
<el-button v-if="item.reportId" type="text" @click="toReport(item)">查看</el-button>
</td>
</template>
<td v-else
colspan="6"></td>
<td v-else colspan="6"></td>
</tr>
</template>
<tr v-else>
@ -189,101 +148,77 @@
<td colspan="6">总排名{{ curRow.index }}</td>
</tr>
</table>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
type="primary"
@click="teamVisible = false">确定</el-button>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="teamVisible = false">确定</el-button>
</span>
</el-dialog>
<el-dialog title="批量导入"
:visible.sync="importVisible"
width="24%"
:close-on-click-modal="false"
@close="cancelUpload">
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false"
@close="cancelUpload">
<div style="text-align: center">
<template v-if="!uploadFaild">
<div style="margin-bottom: 10px;">
<el-button type="primary"
@click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button>
<el-button type="primary" @click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button>
</div>
<el-upload ref="upload"
name="file"
accept=".xls,.xlsx"
class="import-file"
:before-upload="beforeUpload"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.batchImportRanking"
:file-list="uploadList"
:headers="headers"
:disabled="uploading"
:data="{
competitionId: this.id,
stageId: this.stageId,
isOverallRanking: active ? 0 : 1,
schoolId: ''
}">
<el-button type="primary"
:loading="uploading"
class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
<el-upload ref="upload" name="file" accept=".xls,.xlsx" class="import-file" :before-upload="beforeUpload"
:on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove"
:limit="1" :on-exceed="handleExceed" :action="this.api.batchImportRanking" :file-list="uploadList"
:headers="headers" :disabled="uploading" :data="{
competitionId: this.id,
stageId: this.stageId,
isOverallRanking: active ? 0 : 1,
schoolId: ''
}">
<el-button type="primary" :loading="uploading" class="ml20">上传文件<i
class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload>
</template>
<template v-else>
<p style="margin: -10px 0 13px;font-size: 14px;color: #e90000;">{{ faildData.tip }}</p>
<p type="primary"
style="margin-bottom: 10px;font-size: 14px;color: #9076FF;text-decoration: underline;cursor: pointer;"
@click="showFaild">部分数据导入失败查看失败原因</p>
style="margin-bottom: 10px;font-size: 14px;color: #9076FF;text-decoration: underline;cursor: pointer;"
@click="showFaild">部分数据导入失败查看失败原因</p>
</template>
</div>
<span v-if="uploading"
slot="footer"
class="dialog-footer">
<span v-if="uploading" slot="footer" class="dialog-footer">
<el-button @click="cancelUpload">停止导入</el-button>
</span>
</el-dialog>
<el-dialog title="请选择发布排名时间"
:visible.sync="publishVisible"
width="260px"
:close-on-click-modal="false"
custom-class="publish-dia">
<el-date-picker popper-class="no-atTheMoment"
v-model="publishTime"
placeholder="请选择结束时间"
type="datetime"
:picker-options="pickerOptions">
<el-dialog title="请选择发布排名时间" :visible.sync="publishVisible" width="260px" :close-on-click-modal="false"
custom-class="publish-dia">
<el-date-picker popper-class="no-atTheMoment" v-model="publishTime" placeholder="请选择结束时间" type="datetime"
:picker-options="pickerOptions">
</el-date-picker>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
@click="publishVisible = false"> </el-button>
<el-button size="small"
type="primary"
@click="publishTimeSubmit"> </el-button>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="publishVisible = false"> </el-button>
<el-button size="small" type="primary" @click="publishTimeSubmit"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from "@/libs/util";
import axios from 'axios';
import Util from '@/libs/util'
import axios from 'axios'
export default {
data () {
return {
id: +this.$route.query.id,
stageId: +this.$route.query.stageId,
index: +this.$route.query.index,
method: this.$route.query.method,
method: +this.$route.query.method,
competitionType: +this.$route.query.competitionType,
rule: +this.$route.query.rule,
searchTimer: null,
filter: {
provinceId: '',
cityId: '',
realSchoolId: '',
},
provinces: [],
cities: [],
schools: [],
keyword: this.$route.query.keyword || '',
teamCalculationMethods: [
{
@ -364,6 +299,8 @@ export default {
}
},
mounted () {
this.getProvince()
this.getSchool()
this.getStage()
},
methods: {
@ -377,6 +314,7 @@ export default {
},
//
getRank () {
const { filter } = this
this.loading = true
//
if (this.type) {
@ -386,7 +324,8 @@ export default {
competitionId: this.id,
isOverallRanking: this.active ? 0 : 1,
stageId: this.active || this.stageId,
keyword: this.keyword
keyword: this.keyword,
...filter
}).then(({ message, publishStatus }) => {
// isRelease 01
this.published = publishStatus
@ -409,7 +348,8 @@ export default {
publicationType: this.type,
locationStageId: this.stageId,
stageIds: ids.splice(0, ids.length - 1),
keyword: this.keyword
keyword: this.keyword,
...filter
}).then(({ page, publishStatus, total }) => {
this.published = publishStatus
this.list = page || []
@ -421,7 +361,7 @@ export default {
})
} else {
//
this.$post(`${this.api.stageRaceRanking}?competitionId=${this.id}&stageId=${this.active}&pageNum=${this.page}&pageSize=${this.pageSize}&publicationType=${this.type}&keyword=${this.keyword}`).then(({ page, total, publishStatus }) => {
this.$post(`${this.api.stageRaceRanking}?competitionId=${this.id}&stageId=${this.active}&pageNum=${this.page}&pageSize=${this.pageSize}&publicationType=${this.type}&keyword=${this.keyword}&provinceId=${filter.provinceId}&cityId=${filter.cityId}&realSchoolId=${filter.realSchoolId}`).then(({ page, total, publishStatus }) => {
this.published = publishStatus
this.list = page
this.total = total
@ -469,6 +409,39 @@ export default {
this.active = i
this.initData()
},
//
async getProvince () {
const { list } = await this.$get(this.api.queryProvince)
this.provinces = list
},
//
clearProvince () {
this.filter.cityId = ''
},
//
provinceChange () {
this.clearProvince()
this.getCity()
this.initData()
},
//
async getCity () {
const id = this.filter.provinceId
if (id) {
const { list } = await this.$get(this.api.queryCity, {
provinceId: id
})
this.cities = list
}
},
//
async getSchool () {
const { list } = await this.$get(this.api.querySchoolData)
this.schools = list
},
//
show (row, i) {
this.teams = []
@ -551,7 +524,7 @@ export default {
},
//
toReport (row) {
this.$router.push(`/matchReport?reportId=${row.reportId}`)
this.$router.push(`/${this.method !== 1 ? 'trialReport' : 'theoryReport'}?reportId=${row.reportId}`)
},
handleSelectionChange (val) { //
this.multipleSelection = val;
@ -613,7 +586,7 @@ export default {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`${this.grades.find(e => e.stageId == this.active).stageName}排名.xls`, new Blob([res.data]))
Util.downloadFileDirect(`${this.grades.find(e => e.stageId == this.active).stageName}排名.xls`, new Blob([res.data]))
this.exporting = false
}).catch(res => { })
},
@ -623,7 +596,7 @@ export default {
competitionId: this.id,
isOverallRanking: this.active ? 0 : 1,
publicationType: this.type,
releaseTime: util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime),
releaseTime: Util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime),
stageId: this.active || this.stageId,
})
this.uploadData = []
@ -662,7 +635,8 @@ export default {
//
async publishTimeSubmit () {
const { startTime, endTime } = this.grades[this.index]
if (Date.now() <= new Date(endTime)) return util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!')
const now = await Util.getNow()
if (now <= new Date(endTime)) return Util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!')
this.publishSubmit()
// await this.$post(this.api.addCompetitionStageRankingTime, {
@ -670,10 +644,10 @@ export default {
// isOverallRanking: this.active ? 0 : 1,
// publicationType: this.type,
// stageId: this.active || this.stageId,
// releaseTime: util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime)
// releaseTime: Util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime)
// })
util.successMsg('发布成功')
Util.successMsg('发布成功')
this.getData()
this.uploaded = 0
this.publishVisible = false
@ -691,7 +665,7 @@ export default {
if (publish) {
//
if (this.type && !this.uploaded && !this.list.length) {
return util.errorMsg('请先上传数据!')
return Util.errorMsg('请先上传数据!')
} else {
this.publishTime = new Date()
this.publishVisible = true
@ -707,7 +681,7 @@ export default {
this.sourceType = ''
this.type = 0
this.getData()
util.successMsg('取消发布成功!')
Util.successMsg('取消发布成功!')
} catch (error) { }
}
},
@ -723,7 +697,7 @@ export default {
},
//
handleExceed (files, fileList) {
util.warningMsg(
Util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
)
},
@ -733,7 +707,7 @@ export default {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`批量导入排名管理失败数据导出.xls`, new Blob([res.data]))
Util.downloadFileDirect(`批量导入排名管理失败数据导出.xls`, new Blob([res.data]))
}).catch(res => { })
},
uploadSuccess (res) {
@ -749,11 +723,11 @@ export default {
} else {
this.uploaded = 1
this.importVisible = false
util.successMsg(data.tip, 3000)
// util.successMsg('')
Util.successMsg(data.tip, 3000)
// Util.successMsg('')
}
} else {
util.errorMsg(res.message || "上传失败,请检查数据")
Util.errorMsg(res.message || "上传失败,请检查数据")
}
},
uploadError (err, file, fileList) {
@ -793,34 +767,40 @@ export default {
<style lang="scss" scoped>
.table {
width: 100%;
border-collapse: collapse;
th,
td {
padding: 12px;
border: 1px solid #ebeef5;
}
&.tc {
text-align: center;
}
th {
text-align: center;
background-color: #f8faff;
}
.scores {
line-height: 1.6;
}
.score {
font-size: 16px;
font-weight: 600;
color: #9076ff;
}
width: 100%;
border-collapse: collapse;
th,
td {
padding: 12px;
border: 1px solid #ebeef5;
}
&.tc {
text-align: center;
}
th {
text-align: center;
background-color: #f8faff;
}
.scores {
line-height: 1.6;
}
.score {
font-size: 16px;
font-weight: 600;
color: #9076ff;
}
}
/deep/.import-file {
.el-progress__text,
.el-progress,
.el-upload-list__item-status-label {
display: none !important;
}
.el-progress__text,
.el-progress,
.el-upload-list__item-status-label {
display: none !important;
}
}
</style>

@ -1,447 +0,0 @@
<template>
<div class="wrap">
<el-card shadow="hover"
class="m-b-20">
<el-page-header @back="$router.back()"
content="查看报告"></el-page-header>
</el-card>
<div class="content">
<div class="text-right">
<el-button type="primary"
@click="exportPage">导出报告</el-button>
</div>
<h6 class="r-title">标准实验报告</h6>
<div class="info">
<h6 class="l-title">
<img src="@/assets/img/info1.png"
alt="">
基本信息
</h6>
<ul :class="['info-list', {edit: editing}]">
<li>
<label>学生姓名</label>
<el-input v-if="editing"
v-model="infoData.userName"
disabled></el-input>
<span v-else>{{ infoData.userName }}</span>
</li>
<li>
<label>学生学号</label>
<el-input v-if="editing"
v-model="infoData.workNumber"
disabled></el-input>
<span v-else>{{ infoData.workNumber }}</span>
</li>
<li>
<label>实验时间</label>
<el-input v-if="editing"
v-model="infoData.submitTime"
disabled></el-input>
<span v-else>{{ infoData.submitTime }}</span>
</li>
<li>
<label>实验成绩</label>
<el-input v-if="editing"
v-model="infoData.score"
disabled></el-input>
<div v-else
class="score-wrap">
<em>{{ infoData.score }}</em>
<img src="@/assets/img/point.png"
alt="">
</div>
</li>
<li>
<label>学生班级</label>
<el-input v-if="editing"
v-model="infoData.className"></el-input>
<span v-else>{{ infoData.className }}</span>
</li>
<li>
<label>指导老师</label>
<el-input v-if="editing"
v-model="infoData.instructor"></el-input>
<span v-else>{{ infoData.instructor }}</span>
</li>
<li>
<label>实验学时</label>
<el-input v-if="editing"
v-model="infoData.period"></el-input>
<span v-else>{{ infoData.period }}</span>
</li>
</ul>
<div class="m-b-20">
<h6 class="l-title">
<img src="@/assets/img/report2.png"
alt="">
实验项目名称
</h6>
<el-input v-if="editing"
v-model="form.projectName"
type="textarea"></el-input>
<div v-else
class="pre-wrap"
v-html="form.projectName"></div>
</div>
<div class="m-b-20">
<h6 class="l-title">
<img src="@/assets/img/report3.png"
alt="">
实验目的
</h6>
<div :class="['pre-wrap', {edit: editing}]"
v-html="form.purpose"></div>
</div>
<div class="m-b-20">
<h6 class="l-title">
<img src="@/assets/img/report4.png"
alt="">
实验数据
</h6>
<el-table :data="expData"
class="table"
border
stripe
header-align="center">
<el-table-column type="index"
label="序号"
align="center"
width="60">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="judgmentName"
label="判分点"
width="270"
align="center"></el-table-column>
<el-table-column v-if='project'
prop="judgmentName"
label="考核点"
align="center"
width="150">
<template slot-scope="scope">
<div v-for="(item, index) in scope.row.lcRuleRecords"
:key="index">
<span>
<span>{{index+1}}. </span>{{item.name}}
</span>
</div>
</template>
</el-table-column>
<el-table-column prop="ruleAnswer"
label="参考答案"
style='word-wrap: break-word'>
<template slot-scope="scope">
<div v-if='scope.row.lcRuleRecords'>
<div v-for="(item, index) in scope.row.lcRuleRecords"
:key="index">
<span>
<span>{{index+1}}. </span>{{item.ruleAnswer}}
</span>
</div>
</div>
<div v-else
v-html="scope.row.referenceAnswer"></div>
</template>
</el-table-column>
<el-table-column prop="userAnswer"
label="学生答案">
<template slot-scope="scope">
<div v-if='scope.row.lcRuleRecords'>
<div v-for="(item, index) in scope.row.lcRuleRecords"
:key="index">
<span v-if='item.userAnswer'>
<span>{{index+1}}. </span>{{item.userAnswer}}
</span>
<span v-else>
<span>{{index+1}}. </span>未填写
</span>
</div>
</div>
<div v-else
v-html='scope.row.answer'
style='white-space: pre-wrap'></div>
<template v-if="scope.row.runThePictureList">
<img v-for="(img, i) in scope.row.runThePictureList"
:key="i"
width="200"
class="result-pic"
:src="img"
alt="">
</template>
</template>
</el-table-column>
<el-table-column prop="quesScore"
label="分值"
:key="6"
width="80"
align="center"></el-table-column>
<el-table-column prop="score"
label="得分"
width="80"
align="center"></el-table-column>
</el-table>
</div>
<div class="m-b-20">
<h6 class="l-title">
<img src="@/assets/img/report5.png"
alt="">
实验总结与体会
</h6>
<quill v-if="editing"
:border="true"
v-model="form.summarize"
:minHeight="150"
:height="150" />
<div v-else
class="pre-wrap"
v-html="form.summarize"></div>
</div>
</div>
</div>
</div>
</template>
<script>
import util from "@/libs/util";
export default {
data () {
return {
reportId: this.$route.query.reportId,
title: "实验报告",
form: {
className: "",
instructor: "",
period: "",
projectName: "",
summarize: "",
},
infoData: {},
expData: [],
editing: false,
loadIns: null,
loading: false,
project: false,
userScores: []
};
},
mounted () {
this.getData()
},
methods: {
getData () { //
this.$get(`${this.api.reportDetail}?reportId=${this.reportId}`).then(({ report, userScores }) => {
this.form = report
this.expData = userScores
this.project = this.expData.find(e => e.lcRuleRecords) // lcRuleRecords
let form = this.form;
this.infoData = {
workNumber: form.workNumber,
experimentalClassName: form.experimentalClassName,
instructor: form.instructor,
period: form.period,
laboratory: form.laboratory,
submitTime: form.submitTime,
score: form.score,
className: form.className,
userName: form.userName
}
const data = report.data
this.userScores = userScores
// data使
if (!data) {
this.handleList(userScores)
this.$post(this.api.editExperimentalData, {
reportId,
data: JSON.stringify(userScores)
}).then(res => { }).catch(err => { })
} else {
this.handleList(userScores.find(e => e.lcRuleRecords) ? userScores : JSON.parse(data))
}
}).catch(res => { })
},
//
handleList (list) {
this.project = list.find(e => e.lcRuleRecords) // lcRuleRecords
if (this.project) {
list.map(e => {
e.assessmentPoint = ''
e.referenceAnswer = ''
e.answer = ''
e.lcRuleRecords.map((n, i) => {
e.assessmentPoint += `${i + 1}.${n.name}`
e.referenceAnswer += `${i + 1}.${n.ruleAnswer}`
e.answer += `${i + 1}.${n.userAnswer}`
})
})
} else { // pythonuserScores
list.forEach(e => {
const item = this.userScores.find(n => n.judgmentId == e.judgmentId)
if (item && item.runThePictureList) e.runThePictureList = item.runThePictureList
})
}
this.expData = list
},
exportPage () {
const form = Object.assign(this.form, this.infoData)
const list = JSON.parse(JSON.stringify(this.expData))
list.map((e, i) => {
const item = this.userScores.find(n => n.judgmentId == e.judgmentId)
if (item && item.runThePicture) e.runThePicture = item.runThePicture
if (item && item.runThePictureList) e.runThePictureList = item.runThePictureList
e.id = i + 1
// if (e.referenceAnswer && typeof e.referenceAnswer === 'string') e.referenceAnswer = e.referenceAnswer.replace(/<[^>]+>/g, '').replace(/(&nbsp;|&amp;|%s)/g, '').replace(/>/g, '&gt;').replace(/</g, '&lt;')
if (e.answer && typeof e.answer === 'string') e.answer = e.answer.replace(/<[^>]+>/g, '').replace(/(&nbsp;|&amp;|%s)/g, '').replace(/>/g, '&gt;').replace(/</g, '&lt;')
})
for (const i in form) {
if (form[i] && typeof form[i] === 'string') form[i] = form[i].replace(/<[^>]+>/g, '')
}
form.purpose = form.purpose.replace(/<[^>]+>/g, '')
this.$post(this.project ? this.api.exportBankExperimentReport : this.api.exportLabReport, {
...form,
experimentalData: list
}).then(res => {
console.log(res)
util.downloadFileDirect(`实验报告.docx`, new Blob([res]))
}).catch(res => { })
},
}
};
</script>
<style lang="scss" scoped>
.wrap {
padding: 12px 300px 20px;
}
.text-right {
text-align: right;
}
code,
kbd,
samp {
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif;
word-wrap: break-word;
white-space: pre-wrap;
}
/deep/ pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
word-break: break-all;
overflow: hidden;
font-size: 12px;
font-weight: 400;
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif;
}
.content {
padding: 16px 40px;
background: #fff;
&.loading {
padding-top: 30px;
}
.r-title {
margin-bottom: 40px;
font-size: 24px;
text-align: center;
color: #333;
}
.info {
padding: 20px 16px;
border: 1px solid #e1e6f2;
}
.l-title {
display: flex;
align-items: center;
padding: 5px 8px;
margin-bottom: 12px;
font-size: 14px;
color: #333;
background-color: #f7f5ff;
}
.info-list {
display: flex;
flex-wrap: wrap;
padding: 10px 0 0 20px;
li {
display: inline-flex;
width: 23%;
padding: 0 10px;
margin-bottom: 34px;
}
&.edit {
li {
align-items: center;
}
}
label {
font-size: 14px;
color: #333;
white-space: nowrap;
}
span {
min-width: 150px;
padding: 0 10px 3px;
border-bottom: 1px solid #e1e6f2;
}
/deep/.el-input {
width: 174px;
}
}
.score-wrap {
position: relative;
min-width: 150px;
border-bottom: 1px solid #e1e6f2;
em {
position: absolute;
top: -12px;
left: 30px;
font-family: din;
font-size: 30px;
font-weight: 600;
color: #0b1d30;
}
img {
position: absolute;
bottom: -15px;
left: 0;
}
}
/deep/.el-textarea .el-textarea__inner,
.pre-wrap {
min-height: 72px;
padding: 10px 16px;
font-size: 14px;
color: #333;
&.edit {
color: #abb3c6;
border: 1px solid #cacfdb;
border-radius: 4px;
background-color: #f6f7f9;
}
}
/deep/ .table th {
background-color: #e5dfff !important;
.cell {
line-height: 35px;
color: #fff;
}
}
}
.result-pic {
margin: 10px 0;
}
@media (max-width: 1650px) {
.wrap {
padding: 12px 200px 20px;
}
}
@media (max-width: 1430px) {
.wrap {
padding: 12px 100px 20px;
}
}
</style>

@ -1,331 +1,197 @@
<template>
<!-- 报名人员 -->
<div class="page-content"
style="padding: 24px">
<div class="page-content" style="padding: 24px">
<div class="tool">
<ul class="filter">
<li>
<label>搜索</label>
<el-input :placeholder="'请输入姓名、手机号、' + (info.completeCompetitionSetup.competitionType ? '团队名称、' : '') + '学号、学校'"
prefix-icon="el-icon-search"
v-model="keyword"
clearable
size="mini"
style="width: 350px"></el-input>
<el-input
:placeholder="'请输入姓名、手机号、' + (info.completeCompetitionSetup.competitionType ? '团队名称、' : '') + '学号、学校'"
prefix-icon="el-icon-search" v-model="keyword" clearable size="mini" style="width: 350px"></el-input>
</li>
<li v-if="info.releaseType">
<label>参赛人员状态</label>
<el-select v-model="isDisable"
@change="initData">
<el-option v-for="(item, i) in statusList"
:key="i"
:label="item.name"
:value="item.id"></el-option>
<el-select v-model="isDisable" @change="initData">
<el-option v-for="(item, i) in statusList" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
</ul>
<div>
<el-button type="primary"
round
@click="autoAllocation">自动分配阶段成员</el-button>
<el-button type="primary"
round
@click="batchImport">导入</el-button>
<el-button type="primary"
round
@click="add"
v-auth="'/match:管理:报名人员:新增'">新增</el-button>
<el-button type="primary"
round
:loading="exporting"
@click="exportAll"
v-auth="'/match:管理:报名人员:导出'">批量导出</el-button>
<el-button type="primary"
@click="batchDel"
round
v-auth="'/match:管理:报名人员:导出'">批量删除</el-button>
<template v-if="loaded && info.completeCompetitionSetup.competitionType">
<el-button type="primary" round :disabled="hasReport" :loading="allocating" @click="autoAllocationConfirm">{{
!notBeginSign && allocated ?
'取消' : '' }}自动分配阶段成员</el-button>
<el-tooltip placement="top">
<div slot="content">
<p>报名结束前设置的自动分配将在报名结束时触发一次系统自动分配取消则不触发</p>
<p style="margin: 5px 0;">报名结束后也可以手动点击自动分配按钮来立即触发系统自动分配并且点击一次就触发一次</p>
<p></p>
<p style="margin: 5px 0;">&emsp;&emsp;1. 自动分配仅对触发时已报名的人员进行对于分配后才报名的人员如需自动分配则需手动再次触发自动分配</p>
<p>&emsp;&emsp;2. 若已有学生提交了成绩报告则无法启用自动分配功能</p>
</div>
<i class="el-icon-question"
style="margin: 0 10px 0 5px;font-size: 16px;color: #8f8f8f;cursor: pointer;"></i>
</el-tooltip>
</template>
<el-button type="primary" round @click="batchImport">导入</el-button>
<el-button type="primary" round @click="add" v-auth="'/match:管理:报名人员:新增'">新增</el-button>
<el-button type="primary" round :loading="exporting" @click="exportAll"
v-auth="'/match:管理:报名人员:导出'">批量导出</el-button>
<el-button type="primary" @click="batchDel" round v-auth="'/match:管理:报名人员:导出'">批量删除</el-button>
</div>
</div>
<el-table ref="table"
:data="listData"
class="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="id"
v-loading="loading"
@sort-change="sortChange">
<el-table-column type="selection"
width="80"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="60"
label="序号"
align="center">
<el-table ref="table" :data="listData" class="table" stripe header-align="center"
@selection-change="handleSelectionChange" row-key="id" v-loading="loading" @sort-change="sortChange">
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="school"
label="学生账号归属"
sortable="custom"
min-width="180"
align="center"></el-table-column>
<el-table-column prop="realSchool"
label="学生所属院校"
min-width="180"
align="center"></el-table-column>
<el-table-column v-if="info.completeCompetitionSetup.competitionType"
prop="teamName"
label="团队名称"
sortable="custom"
min-width="140"
align="center">
<el-table-column prop="school" label="学生账号归属" sortable="custom" min-width="180" align="center"></el-table-column>
<el-table-column prop="realSchool" label="学生所在院校" min-width="180" align="center"></el-table-column>
<el-table-column v-if="info.completeCompetitionSetup.competitionType" prop="teamName" label="团队名称"
sortable="custom" min-width="140" align="center">
</el-table-column>
<el-table-column prop="username"
:label="info.completeCompetitionSetup.competitionType ? '队长/成员' : '学生姓名'"
min-width="140"
align="center">
<el-table-column prop="username" :label="info.completeCompetitionSetup.competitionType ? '队长/成员' : '学生姓名'"
min-width="140" align="center">
</el-table-column>
<el-table-column prop="workNumber"
:label="info.completeCompetitionSetup.competitionType ? '队长/成员学号' : '学号'"
min-width="140"
align="center">
<el-table-column prop="workNumber" :label="info.completeCompetitionSetup.competitionType ? '队长/成员学号' : '学号'"
min-width="140" align="center">
</el-table-column>
<el-table-column prop="phone"
:label="info.completeCompetitionSetup.competitionType ? '队长/成员手机号' : '手机号'"
min-width="140"
align="center">
<el-table-column prop="phone" :label="info.completeCompetitionSetup.competitionType ? '队长/成员手机号' : '手机号'"
min-width="140" align="center">
</el-table-column>
<el-table-column v-if="info.completeCompetitionSetup.competitionType"
prop="captain"
label="是否为队长"
min-width="80"
align="center"></el-table-column>
<el-table-column prop="teachers"
label="指导老师"
min-width="200"
align="center"
show-overflow-tooltip>
<el-table-column v-if="info.completeCompetitionSetup.competitionType" prop="captain" label="是否为队长" min-width="80"
align="center"></el-table-column>
<el-table-column prop="teachers" label="指导老师" min-width="200" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<template v-if="scope.row.teachers">
<el-tooltip placement="top">
<div slot="content"
style="line-height: 1.8">
<div v-for="(item, i) in scope.row.teachers"
:key="i">
<div slot="content" style="line-height: 1.8">
<div v-for="(item, i) in scope.row.teachers" :key="i">
{{ item.name }}{{ item.phone ? ',' + item.phone : '' }}{{ item.position ? ',' + item.position : '' }}
</div>
</div>
<p>{{ scope.row.teachers[0].name }}{{ scope.row.teachers[0].phone ? ',' + scope.row.teachers[0].phone : '' }}{{ scope.row.teachers[0].position ? ',' + scope.row.teachers[0].position : '' }}</p>
<p>{{ scope.row.teachers[0].name }}{{ scope.row.teachers[0].phone ? ',' + scope.row.teachers[0].phone : ''
}}{{ scope.row.teachers[0].position ? ',' + scope.row.teachers[0].position : '' }}</p>
</el-tooltip>
</template>
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="270">
<el-table-column label="操作" align="center" width="270">
<template slot-scope="scope">
<el-button v-auth="'/match:管理:报名人员:编辑'"
type="text"
@click="edit(scope.row)">编辑</el-button>
<el-button type="text"
@click="del(scope.row)">删除</el-button>
<template v-if="!scope.row.isDel">
<el-button v-auth="'/match:管理:报名人员:编辑'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="del(scope.row)">删除</el-button>
</template>
<template v-if="info.releaseType">
<el-button v-auth="'/match:管理:报名人员:参赛信息与成绩'"
type="text"
@click="toInfo(scope.row)">参赛信息与成绩</el-button>
<el-switch v-auth="'/match:管理:报名人员:禁用'"
v-model="scope.row.isDisable"
:active-text="scope.row.isDisable ? '禁用' : '启用'"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
@change="switchOff($event,scope.row,scope.$index)"></el-switch>
<el-button v-auth="'/match:管理:报名人员:参赛信息与成绩'" type="text" @click="toInfo(scope.row)">参赛信息与成绩</el-button>
<el-switch v-if="!scope.row.isDel" v-auth="'/match:管理:报名人员:禁用'" v-model="scope.row.isDisable"
:active-text="scope.row.isDisable ? '禁用' : '启用'" :active-value="0" :inactive-value="1"
style="margin: 0 10px 0 5px" @change="switchOff($event, scope.row, scope.$index)"></el-switch>
</template>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange"
:current-page="page">
</el-pagination>
</div>
<el-dialog :title="(!isAdd ? '编辑' : '新增') + '参赛人员'"
:visible.sync="addVisible"
width="440px"
class="dialog"
:close-on-click-modal="false"
@close="closeAdd">
<el-form ref="form"
:model="form"
:rules="rules"
label-width="110px"
style='margin-right: 10px;'>
<el-form-item v-if="!schoolDisable"
prop="schoolId"
label="学生账号归属">
<el-select v-model="form.schoolId"
filterable
:disabled="!isAdd"
@change="schoolChange"
style="width: 100%">
<el-option v-for="(item, i) in clients"
:key="i"
:label="item.schoolName"
:value="item.schoolId"></el-option>
<el-dialog :title="(!isAdd ? '编辑' : '新增') + '参赛人员'" :visible.sync="addVisible" width="440px" class="dialog"
:close-on-click-modal="false" @close="closeAdd">
<el-form ref="form" :model="form" :rules="rules" label-width="110px" style='margin-right: 10px;'>
<el-form-item v-if="!schoolDisable" prop="schoolId" label="学生账号归属">
<el-select v-model="form.schoolId" filterable :disabled="!isAdd" @change="schoolChange" style="width: 100%">
<el-option v-for="(item, i) in clients" :key="i" :label="item.schoolName"
:value="item.schoolId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="studentAffiliatedInstitutionId"
label="学生所属院校">
<el-select v-model="form.studentAffiliatedInstitutionId"
filterable
style="width: 100%">
<el-option v-for="(item, i) in schools"
:key="i"
:label="item.schoolName"
:value="item.schoolId"></el-option>
<el-form-item prop="studentAffiliatedInstitutionId" label="学生所在院校">
<el-select v-model="form.studentAffiliatedInstitutionId" filterable style="width: 100%">
<el-option v-for="(item, i) in schools" :key="i" :label="item.schoolName"
:value="item.schoolId"></el-option>
</el-select>
<p style="margin-top: 10px;line-height: 1.4;font-size: 12px;">学生所院校为学生实际院校</p>
<p style="margin-top: 10px;line-height: 1.4;font-size: 12px;">学生所在院校为学生实际院校</p>
</el-form-item>
<el-form-item prop="workNumber"
label="学生学号">
<el-input v-model="form.workNumber"
placeholder="请输入学生学号"
@change="workNumberChange"></el-input>
<el-form-item prop="workNumber" label="学生学号">
<el-input v-model="form.workNumber" placeholder="请输入学生学号" @change="workNumberChange"></el-input>
</el-form-item>
<el-form-item prop="userName"
label="学生姓名">
<el-input v-model="form.userName"
placeholder="请输入学生姓名"
:disabled="isAdd"></el-input>
<el-form-item prop="userName" label="学生姓名">
<el-input v-model="form.userName" placeholder="请输入学生姓名" :disabled="isAdd"></el-input>
</el-form-item>
<el-form-item label="账号角色">
学生
</el-form-item>
<el-form-item v-if="info.completeCompetitionSetup.competitionType"
prop="teamId"
label="所属团队">
<el-form-item v-if="info.completeCompetitionSetup.competitionType" prop="teamId" label="所属团队">
<div style="display: flex;align-items: center">
<el-select v-model="form.teamId"
:disabled="formEnable && isAdd"
filterable
style="width: 240px;margin-right: 10px">
<el-option v-for="(item, i) in teams"
:key="i"
:label="item.teamName"
:value="item.teamId"></el-option>
<el-select v-model="form.teamId" :disabled="formEnable && isAdd" filterable
style="width: 240px;margin-right: 10px">
<el-option v-for="(item, i) in teams" :key="i" :label="item.teamName" :value="item.teamId"></el-option>
</el-select>
<el-button v-if="isAdd && !formEnable"
type="text"
@click="createTeam">创建团队</el-button>
<el-button v-if="isAdd && !formEnable" type="text" @click="createTeam">创建团队</el-button>
</div>
</el-form-item>
<el-form-item prop="phone"
label="手机号">
<el-input v-model="form.phone"
maxlength="11"
placeholder="请输入手机号"
:disabled="isAdd"></el-input>
<el-form-item prop="phone" label="手机号">
<el-input v-model="form.phone" maxlength="11" placeholder="请输入手机号" :disabled="isAdd"></el-input>
</el-form-item>
<el-form-item prop="email"
label="邮箱">
<el-input v-model="form.email"
placeholder="请输入邮箱"
:disabled="isAdd"></el-input>
<el-form-item prop="email" label="邮箱">
<el-input v-model="form.email" placeholder="请输入邮箱" :disabled="isAdd"></el-input>
</el-form-item>
</el-form>
<p v-if="!isAdd"
class="tips"
style="margin-left: 13px">当前页面信息修改会同步修改掉学生账号信息</p>
<span slot="footer"
class="dialog-footer">
<p v-if="!isAdd" class="tips" style="margin-left: 13px">当前页面信息修改会同步修改掉学生账号信息</p>
<span slot="footer" class="dialog-footer">
<el-button @click="addVisible = false">取消</el-button>
<el-button type="primary"
@click="submit">确定</el-button>
<el-button type="primary" @click="submit">确定</el-button>
</span>
</el-dialog>
<el-dialog title="创建团队"
:visible.sync="teamVisible"
:close-on-click-modal="false"
width="300px">
<el-dialog title="创建团队" :visible.sync="teamVisible" :close-on-click-modal="false" width="300px">
<el-form class="dia-form">
<el-form-item>
<el-input placeholder="请输入团队名称"
maxlength="10"
v-model="teamForm.teamName"></el-input>
<el-input placeholder="请输入团队名称" maxlength="10" v-model="teamForm.teamName"></el-input>
</el-form-item>
<el-form-item>
<el-input placeholder="请设置团队邀请码"
maxlength="6"
v-model="teamForm.invitationCode"></el-input>
<el-input placeholder="请设置团队邀请码" maxlength="6" v-model="teamForm.invitationCode"></el-input>
</el-form-item>
</el-form>
<span slot="footer"
class="dialog-footer">
<el-button size="small"
type="primary"
@click="teamSubmit">确定并使用</el-button>
<el-button size="small"
@click="teamVisible = false">取消</el-button>
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="teamSubmit">确定并使用</el-button>
<el-button size="small" @click="teamVisible = false">取消</el-button>
</span>
</el-dialog>
<el-dialog title="批量导入"
:visible.sync="importVisible"
width="24%"
:close-on-click-modal="false"
:modal-append-to-body="false"
@close="cancelUpload">
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false"
:modal-append-to-body="false" @close="cancelUpload">
<div style="text-align: center">
<template v-if="!uploadFaild">
<div style="margin-bottom: 10px;">
<el-button type="primary"
@click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button>
<el-button type="primary" @click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button>
</div>
<el-upload name="file"
accept=".xls,.xlsx"
ref="upload"
class="import-file"
:before-upload="beforeUpload"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:data="{
competitionId: id,
platformId: 2
}"
:disabled="uploading"
:on-exceed="handleExceed"
:action="info.completeCompetitionSetup.competitionType ? this.api.batchImportTeamData : this.api.batchImportPersonalData"
:file-list="uploadList"
:headers="headers">
<el-button type="primary"
:loading="uploading"
class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
<div slot="tip"
class="el-upload__tip">建议文件数据在5000条以内导入5000名学生大致需要10分钟</div>
<el-upload name="file" accept=".xls,.xlsx" ref="upload" class="import-file" :before-upload="beforeUpload"
:on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove"
:limit="1" :data="{
competitionId: id,
platformId: 2
}" :disabled="uploading" :on-exceed="handleExceed"
:action="info.completeCompetitionSetup.competitionType ? this.api.batchImportTeamData : this.api.batchImportPersonalData"
:file-list="uploadList" :headers="headers">
<el-button type="primary" :loading="uploading" class="ml20">上传文件<i
class="el-icon-upload2 el-icon--right"></i></el-button>
<div slot="tip" class="el-upload__tip">建议文件数据在5000条以内导入5000名学生大致需要10分钟</div>
</el-upload>
</template>
<template v-else>
<p style="margin: -10px 0 13px;font-size: 14px;color: #e90000;">{{ uploadTips }}</p>
<p type="primary"
style="margin-bottom: 10px;font-size: 14px;color: #9076FF;text-decoration: underline;cursor: pointer;"
@click="showFaild">部分数据导入失败查看失败原因</p>
style="margin-bottom: 10px;font-size: 14px;color: #9076FF;text-decoration: underline;cursor: pointer;"
@click="showFaild">部分数据导入失败查看失败原因</p>
</template>
</div>
<span v-if="uploading"
slot="footer"
class="dialog-footer">
<span v-if="uploading" slot="footer" class="dialog-footer">
<el-button @click="cancelUpload">停止导入</el-button>
</span>
</el-dialog>
@ -333,7 +199,7 @@
</template>
<script>
import util from "@/libs/util";
import Util from "@/libs/util";
import axios from 'axios'
import Setting from "@/setting";
export default {
@ -343,7 +209,9 @@ export default {
token: sessionStorage.getItem('token'),
id: +this.$route.query.id,
info: {
completeCompetitionSetup: {}
completeCompetitionSetup: {
competitionType: 1,
}
},
isDisable: this.$route.query.isDisable ? +this.$route.query.isDisable : '',
statusList: [
@ -429,6 +297,13 @@ export default {
isBackstage: 0,
exporting: false,
loading: false,
timer: null,
now: '',
notBeginSign: true,
allocated: true,
hasReport: false,
allocating: false,
loaded: 0,
};
},
watch: {
@ -440,7 +315,11 @@ export default {
}
},
mounted () {
this.initData()
this.$once('hook:beforeDestroy', function () {
clearInterval(this.timer)
})
this.getData()
this.getInfo()
this.getTeam()
},
@ -473,18 +352,72 @@ export default {
this.loading = false
},
//
getInfo () {
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => {
this.info = competition
this.getSchool()
//
if (competition.competitionScope) {
this.getClient()
} else {
this.schoolDisable = true
this.form.schoolId = competition.schoolId
}
}).catch(err => { })
async getInfo () {
const { competition } = await this.$post(`${this.api.getCompetition}?competitionId=${this.id}`)
this.info = competition
this.getSchool()
//
if (competition.competitionScope) {
this.getClient()
} else {
this.schoolDisable = true
this.form.schoolId = competition.schoolId
}
//
if (this.info.completeCompetitionSetup.competitionType) {
// /
clearInterval(this.timer)
this.now = await Util.getNow()
this.notBeginSign = this.now > new Date(this.info.signUpEndTime) //
this.getAutomaticAllocation()
this.timer = setInterval(() => {
this.now = new Date(this.now.setSeconds(this.now.getSeconds() + 1))
this.notBeginSign = this.now > new Date(this.info.signUpEndTime) //
}, 1000)
}
},
//
async getAutomaticAllocation () {
//
const res = await this.$post(`${this.api.viewEventAllocationInformation}?competitionId=${this.id}`)
this.allocated = res.data && res.data.assignOrNot
//
const res1 = await this.$post(`${this.api.whetherThereIsReport}?competitionId=${this.id}`)
this.hasReport = res1.hasReport
this.allocating = false
this.loaded = 1
},
//
async automaticAllocation (assignOrNot) {
await this.$post(this.api.updateEventAllocationRecord, {
assignOrNot,
competitionId: this.id,
})
this.getAutomaticAllocation()
},
//
async autoAllocationConfirm () {
//
if (this.notBeginSign) {
this.$confirm('<p>您确定要立即为所有已报名团队自动分配阶段参赛人员吗?</p><p style="font-size: 13px;color: #f00;">此操作将清除现有分配,并为所有团队重新分配。</p>', '提示', {
closeOnClickModal: false,
dangerouslyUseHTMLString: true,
}).then(async () => {
await this.$post(`${this.api.automaticAllocation}?competitionId=${this.id}`) //
}).catch(() => { })
} else {
this.$confirm(this.allocated ? '您确定取消自动分配阶段参赛人员功能吗?<p style="margin-top: 5px;font-size: 13px;color: #f00;">取消后,报名截止时将不再自动分配。</p>' : '<p>您确定启用自动分配阶段参赛人员功能吗?</p><p style="margin-top: 5px;font-size: 13px;color: #f00;line-height: 1.6;">启用后,报名截止时系统将清空已有分配,并为所有团队重新自动分配。</p>', {
type: 'success',
closeOnClickModal: false,
dangerouslyUseHTMLString: true,
}).then(async () => {
this.allocating = true
this.automaticAllocation(this.allocated ? 0 : 1)
}).catch(() => { })
}
},
initData () {
this.page = 1
@ -507,10 +440,6 @@ export default {
if (column.prop === 'teamName') this.teamOrder = column.order ? column.order === 'ascending' ? 2 : 1 : ''
this.getData()
},
//
autoAllocation () {
},
//
batchImport () {
@ -524,7 +453,7 @@ export default {
},
//
handleExceed (files, fileList) {
util.warningMsg(
Util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
)
},
@ -535,7 +464,7 @@ export default {
responseType: 'blob'
}).then((res) => {
const name = res.headers['content-disposition']
util.downloadFileDirect(name ? decodeURI(name) : '批量导入报名人员失败数据导出.xlsx', new Blob([res.data]))
Util.downloadFileDirect(name ? decodeURI(name) : '批量导入报名人员失败数据导出.xlsx', new Blob([res.data]))
}).catch(res => { })
},
uploadSuccess ({ data, status }) {
@ -550,11 +479,11 @@ export default {
this.uploadFaild = true
this.uploadTips = tip
} else {
util[tip.includes('5000') ? 'errorMsg' : 'successMsg'](tip, 3000)
Util[tip.includes('5000') ? 'errorMsg' : 'successMsg'](tip, 3000)
this.importVisible = false
}
} else {
util.errorMsg(res.message || '上传失败,请检查数据', 3000)
Util.errorMsg(res.message || '上传失败,请检查数据', 3000)
}
},
uploadError (err, file, fileList) {
@ -609,7 +538,7 @@ export default {
type: "warning"
}).then(() => {
this.$post(this.api.batchDeleteApplicants, { registrationVOS: [row] }).then(res => {
util.successMsg("删除成功");
Util.successMsg("删除成功");
this.init()
}).catch(res => { });
}).catch(() => { });
@ -670,7 +599,7 @@ export default {
this.addVisible = false
this.init()
this.submiting = false
util.successMsg('编辑成功!')
Util.successMsg('编辑成功!')
}).catch(res => {
this.submiting = false
})
@ -678,7 +607,7 @@ export default {
this.addVisible = false
this.init()
this.submiting = false
util.successMsg('编辑成功!')
Util.successMsg('编辑成功!')
}
}).catch(res => {
this.submiting = false
@ -697,7 +626,7 @@ export default {
this.addVisible = false
this.init()
this.submiting = false
util.successMsg('报名成功!')
Util.successMsg('报名成功!')
}).catch(res => {
this.submiting = false
})
@ -715,13 +644,13 @@ export default {
form.account = `${Setting.platformId}-3-${form.schoolId}-${form.workNumber}`
const { phone, email } = form
if (phone && !/^1[3456789]\d{9}$/.test(phone)) {
return util.errorMsg("请输入正确的手机号")
return Util.errorMsg("请输入正确的手机号")
} else if (email && !/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email)) {
return util.errorMsg("请输入正确的邮箱")
return Util.errorMsg("请输入正确的邮箱")
} else if (this.notExit) {
return util.errorMsg('学生不存在,无法添加!')
return Util.errorMsg('学生不存在,无法添加!')
} else if (this.exitMember) {
return util.errorMsg('学生已存在')
return Util.errorMsg('学生已存在')
} else {
this.submiting = true
this.submitForm()
@ -799,8 +728,8 @@ export default {
//
teamSubmit () {
const form = this.teamForm
if (!form.teamName) return util.errorMsg('请输入团队名称')
if (form.invitationCode.length !== 6) return util.errorMsg('请输入6位数团队邀请码')
if (!form.teamName) return Util.errorMsg('请输入团队名称')
if (form.invitationCode.length !== 6) return Util.errorMsg('请输入6位数团队邀请码')
form.accountId = this.form.id
form.schoolId = this.form.schoolId
form.studentAffiliatedInstitutionId = this.form.studentAffiliatedInstitutionId
@ -808,12 +737,12 @@ export default {
this.teamVisible = false
this.addVisible = false
this.init()
util.successMsg('报名成功!')
Util.successMsg('报名成功!')
}).catch(res => { })
},
//
toInfo (row) {
this.$store.commit('setInnerReferrer', `${this.$route.fullPath}&keyword=${this.keyword}&page=${this.page}&isDisable=${this.isDisable}`)
this.$store.commit('setInnerReferrer', `${this.$route.path}?id=${this.id}&tab=tab5&name=${this.$route.query.name}&keyword=${this.keyword}&page=${this.page}&isDisable=${this.isDisable}`)
this.$router.push(`/matchInfo?id=${this.id}&accountId=${row.accountId}`)
},
exportAll () {
@ -829,7 +758,7 @@ export default {
responseType: 'blob'
}).then((res) => {
const name = res.headers['content-disposition']
util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data]))
Util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data]))
this.exporting = false
}).catch(res => {
this.exporting = false
@ -842,7 +771,7 @@ export default {
responseType: 'blob'
}).then((res) => {
const name = res.headers['content-disposition']
util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data]))
Util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data]))
this.exporting = false
}).catch(res => {
this.exporting = false
@ -874,24 +803,27 @@ export default {
<style lang="scss" scoped>
/deep/.dia-form {
.w-100 {
width: 100%;
}
.tips {
display: flex;
justify-content: center;
align-items: center;
}
.w-100 {
width: 100%;
}
.tips {
display: flex;
justify-content: center;
align-items: center;
}
}
.tips {
font-size: 12px;
color: #e90000;
font-size: 12px;
color: #e90000;
}
/deep/.import-file {
.el-progress__text,
.el-progress,
.el-upload-list__item-status-label {
display: none !important;
}
.el-progress__text,
.el-progress,
.el-upload-list__item-status-label {
display: none !important;
}
}
</style>

@ -0,0 +1,675 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20 head-card">
<div class="flex-between m-b-20">
<el-page-header @back="back" content="成绩管理"></el-page-header>
</div>
</el-card>
<div v-loading="loading">
<el-card v-if="method != 2" shadow="hover" class="m-b-20">
<div class="stat">
<div class="nums">
<div class="item">
<p class="name">已参加/应参加人数</p>
<p class="val">{{ isNaN(statData.totalNumber) ? '' : statData.attendance + '/' + statData.totalNumber }}
</p>
</div>
<div class="item">
<p class="name">实验平均分</p>
<p class="val">{{ avgScore }}</p>
</div>
</div>
<div class="chart" id="chart"></div>
</div>
</el-card>
<el-card shadow="hover" class="m-b-20">
<div v-if="showFile" class="tabs m-b-20">
<a class="item" v-for="(item, i) in tabs" :key="i" :class="{ active: i === active }" @click="tabChange(i)">{{
item }}</a>
</div>
<div class="tool flex-between">
<ul class="filter">
<li>
<label>省份</label>
<el-select v-model="filter.provinceId" filterable clearable placeholder="请选择省份" @change="provinceChange"
@clear="clearProvince">
<el-option v-for="(item, i) in provinces" :key="i" :label="item.provinceName"
:value="item.provinceId"></el-option>
</el-select>
</li>
<li>
<label>城市</label>
<el-select v-model="filter.cityId" filterable clearable placeholder="请选择城市" :disabled="!filter.provinceId"
@change="initData">
<el-option v-for="(item, i) in cities" :key="i" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</li>
<li>
<label>学校</label>
<el-select v-model="filter.realSchoolId" clearable filterable placeholder="请选择学校" @change="initData">
<el-option v-for="(item, i) in schools" :key="i" :label="item.schoolName"
:value="item.schoolId"></el-option>
</el-select>
</li>
<li>
<el-input size="small" placeholder="请输入学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable
style="width: 300px"></el-input>
</li>
</ul>
<div v-if="!active">
<el-button v-if="method == 2" type="primary" @click="batchImport">上传成绩</el-button>
<el-button type="primary" :disabled="!!multipleSelection.find(e => method != 2 && !e.reportId)"
@click="delAllData">批量删除</el-button>
<el-button type="primary" :loading="exporting" @click="exportData">{{ exporting ? '正在导出' : '批量导出'
}}</el-button>
</div>
<div v-else>
<el-button type="primary" :loading="exporting1" @click="exportData1">{{ exporting1 ? '正在导出' : '批量导出'
}}</el-button>
</div>
</div>
<template v-if="!active">
<el-table :data="list" class="table" :key="1" ref="table" stripe header-align="center"
@selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="provinceName" label="省份" min-width="100" align="center"></el-table-column>
<el-table-column prop="cityName" label="城市" min-width="100" align="center"></el-table-column>
<el-table-column prop="schoolName" label="学生账号归属" min-width="100" align="center"></el-table-column>
<el-table-column prop="realSchool" label="学生所在院校" min-width="100" align="center"></el-table-column>
<el-table-column v-if="competitionType" prop="teamName" label="团队名称" min-width="100"
align="center"></el-table-column>
<el-table-column prop="userName" label="学生姓名" min-width="100" align="center"></el-table-column>
<el-table-column prop="workNumber" label="学号" min-width="100" align="center"></el-table-column>
<el-table-column prop="score" label="分数" width="90" align="center">
<template slot-scope="scope">
{{ scope.row.submitTime ? scope.row.score : '--' }}
</template>
</el-table-column>
<el-table-column prop="timeSum" label="耗时" width="90" align="center">
<template slot-scope="scope">
{{ scope.row.timeSum ? scope.row.timeSum + 'min' : '--' }}
</template>
</el-table-column>
<el-table-column prop="submitTime" label="提交时间" min-width="150" align="center">
<template slot-scope="scope">
{{ scope.row.submitTime || '--' }}
</template>
</el-table-column>
<el-table-column label="状态" width="100" align="center">
<template slot-scope="scope">
{{ scope.row.reportId || method == 2 ? '已参加' : '未参加' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="160">
<template slot-scope="scope">
<el-button v-if="method != 2 && scope.row.reportId" type="text"
@click="show(scope.row)">查看成绩报告</el-button>
<el-button v-if="scope.row.reportId" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total"
@current-change="handleCurrentChange" :current-page="page">
</el-pagination>
</div>
</template>
<template v-else>
<el-table :data="list1" class="table" :key="2" stripe header-align="center"
@selection-change="handleSelectionChange1" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (page1 - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="provinceName" label="省份" align="center"></el-table-column>
<el-table-column prop="cityName" label="城市" align="center"></el-table-column>
<el-table-column prop="schoolName" label="学生账号归属" align="center"></el-table-column>
<el-table-column prop="realSchool" label="学生所在院校" align="center"></el-table-column>
<el-table-column v-if="competitionType" prop="teamName" label="团队名称" align="center"></el-table-column>
<el-table-column prop="userName" label="学生姓名" align="center"></el-table-column>
<el-table-column prop="workNumber" label="学号" align="center"></el-table-column>
<el-table-column prop="fileName" label="文件名" align="center"></el-table-column>
<el-table-column prop="fileSize" label="文件大小" align="center"></el-table-column>
<el-table-column prop="fileType" label="文件类型" align="center"></el-table-column>
<el-table-column prop="fileFormat" label="文件格式" align="center"></el-table-column>
<el-table-column prop="createTime" label="提交时间" width="150" align="center">
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button v-if="!isCompress(scope.row.fileFormat)" type="text"
@click="preview(scope.row)">预览文件</el-button>
<el-button type="primary" size="mini" :loading="scope.row.loading"
@click="exportFile(scope.row)">导出文件</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total1"
@current-change="handleCurrentChange1" :current-page="page1">
</el-pagination>
</div>
</template>
</el-card>
</div>
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false"
@close="cancelUpload">
<div style="text-align: center">
<template v-if="!uploadFaild">
<div style="margin-bottom: 10px;">
<el-button type="primary" @click="download">模板下载<i class="el-icon-download el-icon--right"></i></el-button>
</div>
<el-upload ref="upload" name="file" accept=".xls,.xlsx" class="import-file" :before-upload="beforeUpload"
:on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove"
:limit="1" :on-exceed="handleExceed" :action="this.api.batchImportGrades" :file-list="uploadList"
:headers="headers" :disabled="uploading" :data="{
competitionId: this.id,
stageId: this.stageId,
systemId: 0
}">
<el-button type="primary" :loading="uploading" class="ml20">上传文件<i
class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload>
</template>
<template v-else>
<p style="margin: -10px 0 13px;font-size: 14px;color: #e90000;">{{ faildData.tip }}</p>
<p type="primary"
style="margin-bottom: 10px;font-size: 14px;color: #9076FF;text-decoration: underline;cursor: pointer;"
@click="showFaild">部分数据导入失败查看失败原因</p>
</template>
</div>
<span v-if="uploading" slot="footer" class="dialog-footer">
<el-button @click="cancelUpload">停止导入</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from "@/libs/util";
import * as echarts from "echarts";
import axios from 'axios';
import Zip from '@/libs/zip'
export default {
data () {
return {
id: +this.$route.query.id,
stageId: +this.$route.query.stageId,
method: +this.$route.query.method,
competitionType: +this.$route.query.competitionType,
showFile: this.$route.query.showFile === 'true',
isCompress: util.isCompress,
filter: {
provinceId: '',
cityId: '',
realSchoolId: '',
reviewStatus: '',
scoreSortOrder: '',
submitTimeSortOrder: '',
},
provinces: [],
cities: [],
schools: [],
keyword: this.$route.query.keyword || '',
searchTimer: null,
list: [],
multipleSelection: [],
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
list1: [],
multipleSelection1: [],
page1: 1,
total1: 0,
avgScore: 0, //
importVisible: false,
uploadList: [],
uploadFaild: false,
uploading: false,
faildData: null,
headers: {
token: sessionStorage.getItem("token")
},
statData: {},
tabs: ['成绩列表', '文件列表'],
active: 0,
loading: false,
exporting: false,
exporting1: false,
};
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.$router.push({
path: '/otherArchList',
query: {
...this.$route.query,
keyword: val
}
})
this.initData();
}, 500);
}
},
mounted () {
this.getData()
this.getProvince()
this.getSchool()
},
methods: {
async getData () {
this.loading = true
//
if (this.active) {
const { data } = await this.$post(this.api.cCompetitionStageFileList, {
pageNum: this.page1,
pageSize: this.pageSize,
competitionId: this.id,
stageId: this.stageId,
keyWord: this.keyword,
...this.filter
})
data.records.forEach(e => {
e.loading = false
e.fileType = '其他'
if (util.isVideo(e.fileFormat)) {
e.fileType = '视频'
} else if (util.isAudio(e.fileFormat)) {
e.fileType = '音频'
} else if (util.isImg(e.fileFormat)) {
e.fileType = '图片'
} else if (util.isDoc(e.fileFormat)) {
e.fileType = '文档'
} else if (util.isCompress(e.fileFormat)) {
e.fileType = '压缩包'
} else if (e.fileType === 'pdf') {
e.fileType = 'pdf'
}
})
this.list1 = data.records
this.total1 = data.total
this.loading = false
} else { //
const { data, page } = await this.$post(this.api.stageGradeManagementList, {
pageNum: this.page,
pageSize: this.pageSize,
competitionId: this.id,
keyWord: this.keyword,
stageId: this.stageId,
isNakadai: 1,
...this.filter
})
this.loading = false
this.total = page.total
this.list = page.records
this.statData = data
this.avgScore = (+data.avgScore).toFixed(2)
this.method != 2 && this.getChart()
}
},
initData () {
this.page = 1
this.getData()
},
//
async getProvince () {
const { list } = await this.$get(this.api.queryProvince)
this.provinces = list
},
//
clearProvince () {
this.filter.cityId = ''
},
//
provinceChange () {
this.clearProvince()
this.getCity()
this.initData()
},
//
async getCity () {
const id = this.filter.provinceId
if (id) {
const { list } = await this.$get(this.api.queryCity, {
provinceId: id
})
this.cities = list
}
},
//
async getSchool () {
const { list } = await this.$get(this.api.querySchoolData)
this.schools = list
},
//
show (row) {
this.$router.push(`/trialReport?reportId=${row.reportId}`)
},
// ()
async exportData () {
if (this.list.length) {
this.exporting = true
//
if (this.multipleSelection.length) {
const res = await axios.post(this.api.exportExperimentalResultsInBatch, this.multipleSelection, {
headers: this.headers,
responseType: 'blob'
})
util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data]))
this.exporting = false
} else if (this.list.length) {
const res = await axios.post(this.api.allExperimentalResultsAreDerived, {
pageNum: 1,
pageSize: 10000,
competitionId: this.id,
isNakadai: 1,
stageId: this.stageId,
}, {
headers: this.headers,
responseType: 'blob'
})
util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data]))
this.exporting = false
}
}
},
// ()
exportData1 () {
this.exporting1 = true
let list = this.list1
if (this.multipleSelection1.length) {
list = this.multipleSelection1
}
Zip('批量导出', list, () => {
this.exporting1 = false
})
},
handleDelete (row) { //
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(this.api.batchDeleteContestGrade, {
ids: [this.method == 2 ? row.scoreId : row.reportId],
competitionId: this.id,
stageId: this.stageId
}).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
}).catch(() => { });
},
delAllData () { //
const list = this.multipleSelection
this.$confirm(list.length ? '该项目下的所有成绩报告将会删除,是否继续?' : '是否确定删除列表所有成绩数据?', "提示", {
type: "warning"
}).then(async () => {
let ids = []
if (list.length) {
ids = list.map(item => {
return this.method == 2 ? item.scoreId : item.reportId
});
ids = ids.filter(e => e)
}
const data = {
competitionId: this.id,
stageId: this.stageId
}
if (list.length) data.ids = ids
await this.$post(this.api.batchDeleteContestGrade, data)
this.multipleSelection = [];
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
}).catch(() => { });
},
handleSelectionChange (val) { //
this.multipleSelection = val;
},
handleCurrentChange (val) { //
this.$router.push({
path: '/otherArchList',
query: {
...this.$route.query,
page: val
}
})
this.page = val;
this.getData();
},
handleSelectionChange1 (val) { //
this.multipleSelection1 = val;
},
handleCurrentChange1 (val) { //
this.page1 = val;
this.getData();
},
getChart () { // 线
const data = []
const { statData } = this
for (let i = 1; i <= 10; i++) {
data.push(statData['num' + i])
}
let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({
title: { text: "实验分数分布图" },
tooltip: {},
xAxis: {
name: "分数",
type: "category",
boundaryGap: false,
interval: 10,
data: ["0-10", "10-20", "20-30", "30-40", "40-50", "50-60", "60-70", "70-80", "80-90", "90-100"]
},
yAxis: {
name: "人数",
type: "value",
minInterval: 10
},
series: [{
data,
type: "line",
areaStyle: {},
label: {
show: true,
position: 'top'
},
color: ["#8191fd"]
}]
});
},
//
batchImport () {
this.importVisible = true
this.uploadList = []
this.uploadFaild = false
},
//
download () {
axios.get(`${this.api.gradeDownloadExcel}?competitionId=${this.id}&stageId=${this.stageId}`, {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect('赛事成绩导入模板.xlsx', new Blob([res.data]))
}).catch(res => { })
},
//
handleExceed (files, fileList) {
util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
)
},
//
showFaild () {
axios.get(`${this.api.performanceExportFailure}?exportCode=${this.faildData.exportCode}&competitionType=${this.faildData.competitionType}`, {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`批量导入成绩管理失败数据导出.xls`, new Blob([res.data]))
}).catch(res => { })
},
uploadSuccess (res) {
this.uploading = false
this.uploadFaild = false
if (res.status === 200) {
this.initData()
const { data } = res
if (data.exportCode) {
this.faildData = data
this.uploadFaild = true
} else {
util.successMsg(data.tip, 3000)
this.importVisible = false
}
} else {
util.errorMsg(res.message || '上传失败,请检查数据')
}
},
uploadError (err, file, fileList) {
this.uploading = false
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
})
},
beforeUpload (file) {
this.uploading = true
},
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`)
},
handleRemove (file, fileList) {
this.uploadList = fileList
this.uploadFaild = false
},
cancelUpload () {
this.uploading = false
if (this.$refs.upload) this.$refs.upload.abort()
this.keyword = ''
this.initData()
this.importVisible = false
},
// tab
tabChange (i) {
this.active = i
this.getData()
},
//
preview (item) {
window.open((util.isDoc(item.fileFormat) ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + item.filePath)
},
//
exportFile (item) {
item.loading = true
const url = item.filePath
var x = new XMLHttpRequest()
x.open("GET", url, true)
x.responseType = "blob"
x.onload = function (e) {
var url = window.URL.createObjectURL(x.response)
var a = document.createElement("a")
a.href = url
a.download = item.userName + '-' + item.fileName
a.click()
item.loading = false
}
x.send()
},
back () {
this.$router.push(this.$store.state.innerReferrer)
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .head-card {
.el-card__body {
padding-bottom: 0px;
.el-tabs__header {
margin-bottom: 1px;
.el-tabs__nav-wrap::after {
display: none;
}
.el-tabs__item {
font-size: 18px;
}
}
}
}
.stat {
display: flex;
.nums {
display: flex;
align-items: center;
margin-right: 20px;
.item:nth-child(1) {
background-image: url('../../../assets/img/total.png');
}
.item:nth-child(2) {
background-image: url('../../../assets/img/avg.png');
}
.item {
width: 300px;
min-height: 145px;
padding: 30px 30px;
margin: 0 10px;
box-sizing: border-box;
border-radius: 8px;
background-size: 100% 100%;
background-repeat: no-repeat;
p {
font-size: 18px;
color: #ffffff;
}
.val {
margin-top: 10px;
color: #ffffff;
font-size: 36px;
}
}
}
.chart {
flex: 1;
height: 300px;
}
}
/deep/.import-file {
.el-progress__text,
.el-progress,
.el-upload-list__item-status-label {
display: none !important;
}
}
</style>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,413 @@
<template>
<div class="wrap">
<el-card shadow="hover" class="m-b-20">
<el-page-header @back="$router.back()" content="查看报告"></el-page-header>
</el-card>
<div class="content" v-loading="loading">
<div class="text-right">
<el-button type="primary" @click="exportPage">导出报告</el-button>
</div>
<h6 class="r-title">标准实验报告</h6>
<div class="info">
<h6 class="l-title">
<img src="@/assets/img/info1.png" alt="">
基本信息
</h6>
<ul :class="['info-list', { edit: editing }]">
<li>
<label>学生姓名</label>
<el-input v-if="editing" v-model="infoData.userName" disabled></el-input>
<span v-else>{{ infoData.userName }}</span>
</li>
<li>
<label>学生学号</label>
<el-input v-if="editing" v-model="infoData.workNumber" disabled></el-input>
<span v-else>{{ infoData.workNumber }}</span>
</li>
<li>
<label>实验时间</label>
<el-input v-if="editing" v-model="infoData.submitTime" disabled></el-input>
<span v-else>{{ infoData.submitTime }}</span>
</li>
<li>
<label>实验成绩</label>
<el-input v-if="editing" v-model="infoData.score" disabled></el-input>
<div v-else class="score-wrap">
<em>{{ infoData.score }}</em>
<img src="@/assets/img/point.png" alt="">
</div>
</li>
<li>
<label>学生班级</label>
<el-input v-if="editing" v-model="infoData.className"></el-input>
<span v-else>{{ infoData.className }}</span>
</li>
<li>
<label>指导老师</label>
<el-input v-if="editing" v-model="infoData.instructor"></el-input>
<span v-else>{{ infoData.instructor }}</span>
</li>
<li>
<label>实验学时</label>
<el-input v-if="editing" v-model="infoData.period"></el-input>
<span v-else>{{ infoData.period }}</span>
</li>
</ul>
<div class="m-b-20">
<h6 class="l-title">
<img src="@/assets/img/report2.png" alt="">
实验项目名称
</h6>
<el-input v-if="editing" v-model="form.projectName" type="textarea"></el-input>
<div v-else class="pre-wrap" v-html="form.projectName"></div>
</div>
<div class="m-b-20">
<h6 class="l-title">
<img src="@/assets/img/report3.png" alt="">
实验目的
</h6>
<div :class="['pre-wrap', { edit: editing }]" v-html="form.purpose"></div>
</div>
<div class="m-b-20">
<h6 class="l-title">
<img src="@/assets/img/report4.png" alt="">
实验数据
</h6>
<el-table :data="expData" class="table" border stripe header-align="center">
<el-table-column type="index" label="序号" align="center" width="60">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="judgmentName" label="判分点" width="270" align="center"></el-table-column>
<el-table-column v-if='project' prop="judgmentName" label="考核点" align="center" width="150">
<template slot-scope="scope">
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index">
<span>
<span>{{ index + 1 }}. </span>{{ item.name }}
</span>
</div>
</template>
</el-table-column>
<el-table-column prop="ruleAnswer" label="参考答案" style='word-wrap: break-word'>
<template slot-scope="scope">
<div v-if='scope.row.lcRuleRecords'>
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index">
<span>
<span>{{ index + 1 }}. </span>{{ item.ruleAnswer }}
</span>
</div>
</div>
<div v-else v-html="scope.row.referenceAnswer"></div>
</template>
</el-table-column>
<el-table-column prop="userAnswer" label="学生答案">
<template slot-scope="scope">
<div v-if='scope.row.lcRuleRecords'>
<div v-for="(item, index) in scope.row.lcRuleRecords" :key="index">
<span v-if='item.userAnswer'>
<span>{{ index + 1 }}. </span>{{ item.userAnswer }}
</span>
<span v-else>
<span>{{ index + 1 }}. </span>未填写
</span>
</div>
</div>
<div v-else class="pre-code">{{ scope.row.answer }}</div>
<template v-if="scope.row.runThePictureList">
<img v-for="(img, i) in scope.row.runThePictureList" :key="i" width="200" class="result-pic"
:src="img" alt="">
</template>
</template>
</el-table-column>
<el-table-column prop="quesScore" label="分值" :key="6" width="80" align="center"></el-table-column>
<el-table-column prop="score" label="得分" width="80" align="center"></el-table-column>
</el-table>
</div>
<div class="m-b-20">
<h6 class="l-title">
<img src="@/assets/img/report5.png" alt="">
实验总结与体会
</h6>
<quill v-if="editing" :border="true" v-model="form.summarize" :minHeight="150" :height="150" />
<div v-else class="pre-wrap" v-html="form.summarize"></div>
</div>
</div>
</div>
</div>
</template>
<script>
import util from "@/libs/util";
export default {
data () {
return {
reportId: this.$route.query.reportId,
title: "实验报告",
form: {
className: "",
instructor: "",
period: "",
projectName: "",
summarize: "",
},
infoData: {},
expData: [],
editing: false,
loadIns: null,
loading: false,
project: false,
userScores: []
};
},
mounted () {
this.getData()
},
methods: {
getData () { //
this.loading = true
this.$get(`${this.api.reportDetail}?reportId=${this.reportId}`).then(({ report, userScores }) => {
this.form = report
this.project = this.expData.find(e => e.lcRuleRecords) // lcRuleRecords
let form = this.form;
this.infoData = {
workNumber: form.workNumber,
experimentalClassName: form.experimentalClassName,
instructor: form.instructor,
period: form.period,
laboratory: form.laboratory,
submitTime: form.submitTime,
score: form.score,
className: form.className,
userName: form.userName
}
const { data } = report
// data使
if (!data) {
this.userScores = userScores
this.handleList(userScores)
this.$post(this.api.editExperimentalData, {
reportId,
data: JSON.stringify(userScores)
}).then(res => { }).catch(err => { })
} else {
this.handleList(JSON.parse(data))
}
}).catch(res => {
this.loading = false
})
},
//
handleList (list) {
this.project = list.find(e => e.lcRuleRecords) // lcRuleRecords
if (this.project) {
list.map(e => {
e.assessmentPoint = ''
e.referenceAnswer = ''
e.answer = ''
e.lcRuleRecords && e.lcRuleRecords.map((n, i) => {
e.assessmentPoint += `${i + 1}.${n.name}`
e.referenceAnswer += `${i + 1}.${n.ruleAnswer}`
e.answer += `${i + 1}.${n.userAnswer}`
})
})
} else { // pythonuserScores
list.forEach(e => {
const item = this.userScores.find(n => n.judgmentId == e.judgmentId)
if (item && item.runThePictureList) e.runThePictureList = item.runThePictureList
})
}
this.expData = list
this.loading = false
},
exportPage () {
const form = Object.assign(this.form, this.infoData)
const list = JSON.parse(JSON.stringify(this.expData))
list.map((e, i) => {
const item = this.userScores.find(n => n.judgmentId == e.judgmentId)
if (item && item.runThePicture) e.runThePicture = item.runThePicture
if (item && item.runThePictureList) e.runThePictureList = item.runThePictureList
e.id = i + 1
// if (e.referenceAnswer && typeof e.referenceAnswer === 'string') e.referenceAnswer = e.referenceAnswer.replace(/<[^>]+>/g, '').replace(/(&nbsp;|&amp;|%s)/g, '').replace(/>/g, '&gt;').replace(/</g, '&lt;')
if (e.answer && typeof e.answer === 'string') e.answer = e.answer.replace(/<[^>]+>/g, '').replace(/(&nbsp;|&amp;|%s)/g, '').replace(/>/g, '&gt;').replace(/</g, '&lt;')
})
for (const i in form) {
if (form[i] && typeof form[i] === 'string') form[i] = form[i].replace(/<[^>]+>/g, '')
}
form.purpose = form.purpose.replace(/<[^>]+>/g, '')
this.$post(this.project ? this.api.exportBankExperimentReport : this.api.exportLabReport, {
...form,
experimentalData: list
}).then(res => {
console.log(res)
util.downloadFileDirect(`实验报告.docx`, new Blob([res]))
}).catch(res => { })
},
}
};
</script>
<style lang="scss" scoped>
.wrap {
padding: 12px 300px 20px;
}
.pre-code {
white-space: pre-wrap;
}
.text-right {
text-align: right;
}
code,
kbd,
samp {
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif;
word-wrap: break-word;
white-space: pre-wrap;
}
/deep/ pre {
white-space: pre-wrap;
/* css-3 */
white-space: -moz-pre-wrap;
/* Mozilla, since 1999 */
white-space: pre-wrap;
/* Opera 4-6 */
white-space: -o-pre-wrap;
/* Opera 7 */
word-wrap: break-word;
/* Internet Explorer 5.5+ */
word-break: break-all;
overflow: hidden;
font-size: 12px;
font-weight: 400;
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif;
}
.content {
padding: 16px 40px;
background: #fff;
.r-title {
margin-bottom: 40px;
font-size: 24px;
text-align: center;
color: #333;
}
.info {
padding: 20px 16px;
border: 1px solid #e1e6f2;
}
.l-title {
display: flex;
align-items: center;
padding: 5px 8px;
margin-bottom: 12px;
font-size: 14px;
color: #333;
background-color: #f7f5ff;
}
.info-list {
display: flex;
flex-wrap: wrap;
padding: 10px 0 0 20px;
li {
display: inline-flex;
width: 23%;
padding: 0 10px;
margin-bottom: 34px;
}
&.edit {
li {
align-items: center;
}
}
label {
font-size: 14px;
color: #333;
white-space: nowrap;
}
span {
min-width: 150px;
padding: 0 10px 3px;
border-bottom: 1px solid #e1e6f2;
}
/deep/.el-input {
width: 174px;
}
}
.score-wrap {
position: relative;
min-width: 150px;
border-bottom: 1px solid #e1e6f2;
em {
position: absolute;
top: -12px;
left: 30px;
font-family: din;
font-size: 30px;
font-weight: 600;
color: #0b1d30;
}
img {
position: absolute;
bottom: -15px;
left: 0;
}
}
/deep/.el-textarea .el-textarea__inner,
.pre-wrap {
min-height: 72px;
padding: 10px 16px;
font-size: 14px;
color: #333;
&.edit {
color: #abb3c6;
border: 1px solid #cacfdb;
border-radius: 4px;
background-color: #f6f7f9;
}
}
/deep/ .table th {
background-color: #e5dfff !important;
.cell {
line-height: 35px;
color: #fff;
}
}
}
.result-pic {
margin: 10px 0;
}
@media (max-width: 1650px) {
.wrap {
padding: 12px 200px 20px;
}
}
@media (max-width: 1430px) {
.wrap {
padding: 12px 100px 20px;
}
}
</style>

File diff suppressed because it is too large Load Diff

@ -1,7 +1,6 @@
<template>
<div>
<el-card shadow="hover"
class="mgb20">
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
@ -11,64 +10,42 @@
<el-form label-width="80px">
<el-col :span="4">
<el-form-item label="省份">
<el-select v-model="form.provinceId"
clearable
placeholder="请选择省份"
@change="getCity()"
@clear="clearprovince()">
<el-option v-for="(item,index) in provinceList"
:key="index"
:label="item.provinceName"
:value="item.provinceId"></el-option>
<el-select v-model="form.provinceId" clearable placeholder="请选择省份" @change="getCity()"
@clear="clearprovince()">
<el-option v-for="(item, index) in provinceList" :key="index" :label="item.provinceName"
:value="item.provinceId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="城市">
<el-select v-model="form.cityId"
clearable
placeholder="请选择城市"
:disabled="form.provinceId ? false : true"
@change="getData()">
<el-option v-for="(item,index) in cityList"
:key="index"
:label="item.cityName"
:value="item.cityId"></el-option>
<el-select v-model="form.cityId" clearable placeholder="请选择城市"
:disabled="form.provinceId ? false : true" @change="getData()">
<el-option v-for="(item, index) in cityList" :key="index" :label="item.cityName"
:value="item.cityId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="订单类型">
<el-select v-model="form.orderType"
clearable
placeholder="请选择订单类型"
@change="getData()">
<el-option v-for="(item,index) in orderTypeList"
:key="index"
:label="item.name"
:value="item.value"></el-option>
<el-select v-model="form.orderType" clearable placeholder="请选择订单类型" @change="getData()">
<el-option v-for="(item, index) in orderTypeList" :key="index" :label="item.name"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="订单状态">
<el-select v-model="form.orderStatus"
clearable
placeholder="请选择订单状态"
@change="getData()">
<el-option v-for="(item,index) in orderStatusList"
:key="index"
:label="item.name"
:value="item.value"></el-option>
<el-select v-model="form.orderStatus" clearable placeholder="请选择订单状态" @change="getData()">
<el-option v-for="(item, index) in orderStatusList" :key="index" :label="item.name"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="请输入订单号/客户名称/订单名称"
prefix-icon="el-icon-search"
v-model="form.customerName"
clearable></el-input>
<el-input placeholder="请输入订单号/客户名称/订单名称" prefix-icon="el-icon-search" v-model="form.customerName"
clearable></el-input>
</el-form-item>
</el-col>
</el-form>
@ -76,104 +53,56 @@
</div>
</el-card>
<el-card shadow="hover"
class="card">
<el-card shadow="hover" class="card">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="hr_tag"></p>
<span>订单列表</span>
</div>
<div>
<el-button type="primary"
round
@click="addOrder"
v-auth>新建订单</el-button>
<el-button type="primary"
round
@click="delAllSelection"
v-auth>批量删除</el-button>
<el-button type="primary" round @click="addOrder" v-auth>新建订单</el-button>
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
</div>
</div>
<el-table :data="orderData"
class="table"
ref="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="orderId">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="100"
label="序号"
align="center">
<el-table :data="orderData" class="table" ref="table" stripe header-align="center"
@selection-change="handleSelectionChange" row-key="orderId">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
</el-table-column>
<el-table-column prop="orderNumber"
label="订单编号"
align="center">
<el-table-column prop="orderNumber" label="订单编号" align="center">
</el-table-column>
<el-table-column prop="customerName"
label="客户名称"
align="center">
<el-table-column prop="customerName" label="客户名称" align="center">
</el-table-column>
<el-table-column prop="orderContent"
label="订单内容"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="orderAmount"
label="订单金额(元)"
align="center">
<el-table-column prop="orderContent" label="订单内容" align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="orderAmount" label="订单金额(元)" align="center">
<template slot-scope="scope">
{{ scope.row.orderType === '试用' ? 0 : scope.row.orderAmount }}
</template>
</el-table-column>
<el-table-column prop="createTime"
label="订单日期"
align="center">
<el-table-column prop="createTime" label="订单日期" align="center">
</el-table-column>
<el-table-column prop="orderType"
label="订单类型"
align="center">
<el-table-column prop="orderType" label="订单类型" align="center">
</el-table-column>
<el-table-column prop="orderStatus"
label="订单状态"
align="center">
<el-table-column prop="orderStatus" label="订单状态" align="center">
</el-table-column>
<el-table-column prop="orderNature"
label="订单性质"
align="center">
<el-table-column prop="orderNature" label="订单性质" align="center">
</el-table-column>
<el-table-column label="操作"
align="center">
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text"
v-if="scope.row.isDel!==1"
@click="handle('edit',scope.row)"
v-auth="'/order:修改'">
<el-button type="text" v-if="scope.row.isDel !== 1" @click="handle('edit', scope.row)" v-auth="'/order:修改'">
{{ scope.row.orderStatus === "已完成" ? "修改" : "处理" }}
</el-button>
<el-button type="text"
@click="handle('watch',scope.row)"
v-auth>查看</el-button>
<el-button type="text"
@click="handleDelete(scope.row)"
v-auth>删除</el-button>
<el-button type="text"
v-if="scope.row.orderStatus==='已完成'&&scope.row.isDel!==1"
@click="handle('renew',scope.row)"
v-auth>续费
<el-button type="text" @click="handle('watch', scope.row)" v-auth>查看</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
<el-button type="text" v-if="scope.row.orderStatus === '已完成' && scope.row.isDel !== 1"
@click="handle('renew', scope.row)" v-auth>续费
</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
@current-change="handleCurrentChange"
:current-page="page"
:total="totals">
<el-pagination background layout="total, prev, pager, next" @current-change="handleCurrentChange"
:current-page="page" :total="totals">
</el-pagination>
</div>
</el-card>
@ -402,33 +331,35 @@ export default {
<style scoped>
.card {
min-height: calc(100vh - 300px);
min-height: calc(100vh - 300px);
}
.mag {
margin-right: 20px;
margin-right: 20px;
}
.cell {
white-space: pre-wrap;
width: 140px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
white-space: pre-wrap;
width: 140px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
.tags {
border: none;
background: none;
color: #000;
white-space: pre-wrap;
width: 140px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
border: none;
background: none;
color: #000;
white-space: pre-wrap;
width: 140px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
</style>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,50 @@
<template>
<div>
<iframe :src="url" frameborder="0" width="100%"></iframe>
</div>
</template>
<script>
import Setting from '@/setting'
export default {
data () {
return {
url: ''
};
},
mounted () {
const token = sessionStorage.getItem('token')
const cache = localStorage.getItem('reviewPath') // localStorage
let url = `${location.origin}/reviewCenter/`
if (Setting.isDev) url = `http://192.168.31.125:8099/`
if (cache) {
url += '#' + this.replaceParam(cache, Date.now())
} else {
url += `#/myReview?nakadai=1${Setting.isDev ? `&token=${token}` : ''}&v=${Date.now()}`
}
console.log("🚀 ~ mounted ~ url:", url)
localStorage.setItem('review_token', token)
this.url = url
},
methods: {
replaceParam (url, newVValue) {
const vParamRegex = /v=[^&]+/g
let newUrl = url.replace(vParamRegex, `v=${newVValue}`)
const [baseUrl, hash] = newUrl.split('#');
if (hash) {
newUrl = `${baseUrl}#${hash.replace(vParamRegex, `v=${newVValue}`)}`
}
return newUrl
}
}
};
</script>
<style lang="scss" scoped>
iframe {
height: calc(100vh - 167px);
}
</style>

@ -1,7 +1,6 @@
<template>
<div>
<el-card shadow="hover"
class="mgb20">
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
@ -12,37 +11,23 @@
<div>
<el-col :span="4">
<el-form-item label="系统归属">
<el-select v-model="form.belong"
clearable
placeholder="请选择系统归属"
@change="initData">
<el-option v-for="(item, i) in belongs"
:key="i"
:label="item"
:value="i"></el-option>
<el-select v-model="form.belong" clearable placeholder="请选择系统归属" @change="initData">
<el-option v-for="(item, i) in belongs" :key="i" :label="item" :value="i"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="系统类型">
<el-select v-model="form.type"
clearable
placeholder="请选择系统类型"
@change="initData">
<el-option v-for="(item, i) in types"
:key="i"
:label="item"
:value="i"></el-option>
<el-select v-model="form.type" clearable placeholder="请选择系统类型" @change="initData">
<el-option v-for="(item, i) in types" :key="i" :label="item" :value="i"></el-option>
</el-select>
</el-form-item>
</el-col>
</div>
<el-col :span="6">
<el-form-item>
<el-input placeholder="请输入系统名称"
prefix-icon="el-icon-search"
v-model.trim="form.systemName"
clearable></el-input>
<el-input placeholder="请输入系统名称" prefix-icon="el-icon-search" v-model.trim="form.systemName"
clearable></el-input>
</el-form-item>
</el-col>
</el-form>
@ -50,84 +35,53 @@
</div>
</el-card>
<el-card shadow="hover"
class="card">
<el-card shadow="hover" class="card">
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>服务列表</span>
</div>
<el-table :data="list"
class="table"
stripe
header-align="center">
<el-table :data="list" class="table" stripe header-align="center">
<!-- <el-table-column type="selection" width="55" align="center"></el-table-column> -->
<el-table-column type="index"
width="100"
label="序号"
align="center">
<el-table-column type="index" width="100" label="序号" align="center">
</el-table-column>
<el-table-column prop="systemName"
label="系统名称"
align="center"></el-table-column>
<el-table-column prop="type"
label="系统类型"
align="center">
<el-table-column prop="systemName" label="系统名称" align="center"></el-table-column>
<el-table-column prop="type" label="系统类型" align="center">
<template slot-scope="scope">
{{ types[scope.row.type] }}
</template>
</el-table-column>
<el-table-column prop="supplierName"
label="供应商"
align="center"></el-table-column>
<el-table-column prop="belong"
label="系统归属"
align="center">
<el-table-column prop="supplierName" label="供应商" align="center"></el-table-column>
<el-table-column prop="belong" label="系统归属" align="center">
<template slot-scope="scope">
{{ belongs[scope.row.belong] }}
</template>
</el-table-column>
<el-table-column prop="state"
label="系统状态"
align="center">
<el-table-column prop="state" label="系统状态" align="center">
<template slot-scope="scope">
{{ states[scope.row.state] }}
</template>
</el-table-column>
<el-table-column prop="payamount"
label="系统后台"
align="center">
<el-table-column prop="payamount" label="系统后台" align="center">
<template slot-scope="scope">
<el-button type="text"
@click="toBackstage(scope.row)"
v-if="scope.row.systemId !== '11' && scope.row.systemId !== '12'"
v-auth="'/configure:系统后台进入'">进入</el-button>
<el-button type="text" @click="toBackstage(scope.row)"
v-if="scope.row.systemId !== '11' && scope.row.systemId !== '12'"
v-auth="'/configure:系统后台进入'">进入</el-button>
</template>
</el-table-column>
<el-table-column prop="payamount"
label="项目系统"
align="center">
<el-table-column prop="payamount" label="项目系统" align="center">
<template slot-scope="scope">
<el-button type="text"
@click="getIntoProject(scope.row)"
v-auth="'/configure:项目系统进入'">进入</el-button>
<el-button type="text" @click="getIntoProject(scope.row)" v-auth="'/configure:项目系统进入'">进入</el-button>
</template>
</el-table-column>
<el-table-column prop="payamount"
label="判分系统"
align="center">
<el-table-column prop="payamount" label="判分系统" align="center">
<template slot-scope="scope">
<el-button type="text"
@click="getIntoJudgement(scope.row)"
v-auth="'/configure:判分系统进入'">进入</el-button>
<el-button type="text" @click="getIntoJudgement(scope.row)" v-auth="'/configure:判分系统进入'">进入</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
@current-change="handleCurrentChange"
layout="total, prev, pager, next"
:current-page="page"
:total="total">
<el-pagination background @current-change="handleCurrentChange" layout="total, prev, pager, next"
:current-page="page" :total="total">
</el-pagination>
</div>
</el-card>
@ -154,7 +108,7 @@ export default {
1: '外部产品',
0: '内部系统'
},
types: ['编程类', '流程类'],
types: ['编程类', '流程类', 'AI类'],
states: ['运行中', '默认'],
page: +this.$route.query.page || 1,
pageSize: 10
@ -207,7 +161,7 @@ export default {
//
toBackstage (row) {
this.setReferrer()
if (row.systemId == 19) {
if (row.systemId == 19 || row.systemId == 30) {
location.href = `${Setting.sandPath}/#/config?token=${sessionStorage.getItem('token')}&admin=1&referrer=${encodeURIComponent(location.href)}`
} else {
this.$router.push(`/backstage?systemId=${row.systemId}&show=1&name=${row.systemName}`)
@ -227,10 +181,10 @@ export default {
<style lang="scss" scoped>
.card {
min-height: calc(100vh - 300px);
min-height: calc(100vh - 300px);
}
.mag {
margin-right: 20px;
margin-right: 20px;
}
</style>

@ -1,28 +1,20 @@
<template>
<div ref="main"
class="main"
v-loading="loading">
<div ref="main" class="main" v-loading="loading">
<el-row :gutter="20">
<el-col :span="24">
<el-card shadow="hover"
class="mgb20">
<el-card shadow="hover" class="mgb20">
<div class="flex-between">
<el-page-header @back="back"
content="项目配置"></el-page-header>
<el-page-header @back="back" content="项目配置"></el-page-header>
<div v-if="!isDetail">
<el-button type="success"
:loading="submiting === 0"
@click="handleSubmit(0,projectManage.isOpen=1,projectManage.ztOpen = 1)">保存为草稿
<el-button type="success" :loading="submiting === 0"
@click="handleSubmit(0, projectManage.isOpen = 1, projectManage.ztOpen = 1)">保存为草稿
</el-button>
<el-button type="primary"
:loading="submiting === 1"
@click="handleSubmit(1)">确定并发布</el-button>
<el-button type="primary" :loading="submiting === 1" @click="handleSubmit(1)">确定并发布</el-button>
</div>
</div>
</el-card>
<el-card shadow="hover"
class="mgb20">
<el-card shadow="hover" class="mgb20">
<div class="flex-center mgb20">
<p class="addhr_tag"></p>
<span>课程信息</span>
@ -33,26 +25,18 @@
<el-form label-width="80px">
<div style="display: flex">
<el-form-item label="项目名称">
<el-input :disabled="isDetail"
v-model.trim="projectManage.projectName"
placeholder="20个字符以内"
@blur="projectNameExistis"></el-input>
<el-input :disabled="isDetail" v-model.trim="projectManage.projectName" placeholder="20个字符以内"
@blur="projectNameExistis"></el-input>
</el-form-item>
<el-form-item label="备注">
<el-input v-model.trim="projectManage.remark"
placeholder="20个字符以内"></el-input>
<el-input v-model.trim="projectManage.remark" placeholder="20个字符以内"></el-input>
</el-form-item>
<el-form-item label="项目用途">
<el-select :disabled="isDetail"
v-model="projectManage.permissions"
placeholder="请选择"
@change="permissionChange">
<el-option label="练习"
:value="0"></el-option>
<el-option label="考核"
:value="1"></el-option>
<el-option label="竞赛"
:value="2"></el-option>
<el-select :disabled="isDetail" v-model="projectManage.permissions" placeholder="请选择"
@change="permissionChange">
<el-option label="练习" :value="0"></el-option>
<el-option label="考核" :value="1"></el-option>
<el-option label="竞赛" :value="2"></el-option>
</el-select>
</el-form-item>
</div>
@ -60,8 +44,7 @@
</div>
</el-card>
<el-card shadow="hover"
class="mgb20">
<el-card shadow="hover" class="mgb20">
<div class="flex-center mgb20">
<p class="addhr_tag"></p>
<span>实验目标</span>
@ -70,20 +53,14 @@
<div>
<el-form label-width="0">
<el-form-item>
<quill :border="true"
:readonly="isDetail"
v-model="projectManage.experimentTarget"
:type.sync="projectManage.experimentTargetType"
radio
:minHeight="150"
:height="150" />
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentTarget"
:type.sync="projectManage.experimentTargetType" radio :minHeight="150" :height="150" />
</el-form-item>
</el-form>
</div>
</el-card>
<el-card shadow="hover"
class="mgb20">
<el-card shadow="hover" class="mgb20">
<div class="flex-center mgb20">
<p class="addhr_tag"></p>
<span>项目背景</span>
@ -92,30 +69,22 @@
<div>
<el-form label-width="0">
<el-form-item>
<quill :border="true"
:readonly="isDetail"
v-model="projectManage.experimentDescription"
:type.sync="projectManage.experimentDescriptionType"
radio
:minHeight="150"
:height="150"
:index="1" />
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentDescription"
:type.sync="projectManage.experimentDescriptionType" radio :minHeight="150" :height="150"
:index="1" />
</el-form-item>
</el-form>
</div>
</el-card>
<el-card shadow="hover"
class="mgb20">
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>实验任务</span>
</div>
<div>
<el-button :disabled="isDetail"
type="primary"
@click="toJudgePoint('home')">进入判分点
<el-button :disabled="isDetail" type="primary" @click="toJudgePoint('home')">进入判分点
</el-button>
</div>
</div>
@ -123,120 +92,67 @@
<div class="mgb20 flex-between">
<div class="flex-center">
<div class="m-r-20"
style="color: #f00">项目总分值100</div>
<div class="m-r-20" style="color: #f00">项目总分值100</div>
<!-- <div>权重&emsp;<div class="dib"><el-input></el-input></div></div> -->
</div>
<div>
<el-button :disabled="isDetail"
class="m-r-20"
type="text"
@click="avgDistributionScore">
<el-button :disabled="isDetail" class="m-r-20" type="text" @click="avgDistributionScore">
平均分配分值
</el-button>
<el-button :disabled="isDetail"
class="m-r-20"
type="text"
@click="manualDistributionScore">
<el-button :disabled="isDetail" class="m-r-20" type="text" @click="manualDistributionScore">
手动分配分值
</el-button>
<span>(待分配分值: {{ handDistributionScore }}/100)</span>
</div>
</div>
<el-button :disabled="isDetail"
type="primary"
icon="el-icon-plus"
round
@click="handleAddJudgment"
style="margin-bottom: 10px">判分点
<el-button :disabled="isDetail" type="primary" icon="el-icon-plus" round @click="handleAddJudgment"
style="margin-bottom: 10px">判分点
</el-button>
<el-button :disabled="isDetail"
type="primary"
icon="el-icon-delete"
round
@click="batchDeleteProjectJudgment"
style="margin-bottom: 10px">批量删除
<el-button :disabled="isDetail" type="primary" icon="el-icon-delete" round @click="batchDeleteProjectJudgment"
style="margin-bottom: 10px">批量删除
</el-button>
<div class="draggable">
<u-table ref="projectJudgementTable"
:data="projectJudgmentData"
class="table"
stripe
header-align="center"
:use-virtual="isLc"
:max-height="600"
:row-height="60"
:border="false"
@selection-change="handleSelectionProjectJudgment"
row-key="judgmentId"
v-loading="listLoading">
<u-table-column type="selection"
width="55"
align="center"></u-table-column>
<u-table-column prop="sort"
label="序号"
width="80"
align="center">
<el-table ref="projectJudgementTable" :data="projectJudgmentData" class="table" stripe header-align="center"
:use-virtual="isLc" :max-height="600" :row-height="60" :border="false"
@selection-change="handleSelectionProjectJudgment" row-key="judgmentId" v-loading="listLoading">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column prop="sort" label="序号" width="80" align="center">
<template slot-scope="scope">
{{ scope.row.sort }}
</template>
</u-table-column>
<u-table-column prop="name"
label="判分指标"
align="center"
show-overflow-tooltip
min-width="140"></u-table-column>
<u-table-column prop="name"
label="判分点名称"
align="center"
show-overflow-tooltip
min-width="140"></u-table-column>
<u-table-column label="实验要求"
align="center"
width="600">
</el-table-column>
<el-table-column prop="name" label="判分指标" align="center" show-overflow-tooltip
min-width="140"></el-table-column>
<el-table-column prop="name" label="判分点名称" align="center" show-overflow-tooltip
min-width="140"></el-table-column>
<el-table-column label="实验要求" align="center" width="600">
<template slot-scope="scope">
<quill :readonly="true"
elseRead="true"
v-model="scope.row.experimentalRequirements"
:index="2" />
<quill :readonly="true" elseRead="true" v-model="scope.row.experimentalRequirements" :index="2" />
</template>
</u-table-column>
<u-table-column prop="score"
label="分数"
align="center"
width="120">
</el-table-column>
<el-table-column prop="score" label="分数" align="center" width="120">
<template slot-scope="scope">
<el-input :disabled="isDetail"
:key="scope.$index"
type="number"
step="0.1"
v-model.trim="scope.row.score"></el-input>
<el-input :disabled="isDetail" :key="scope.$index" type="number" step="0.1"
v-model.trim="scope.row.score"></el-input>
<!--
@input="scoreChange(scope.row, scope.$index)" -->
</template>
</u-table-column>
<u-table-column label="操作"
width="140"
align="center">
</el-table-column>
<el-table-column label="操作" width="140" align="center">
<template slot-scope="scope">
<el-button :disabled="isDetail"
type="text"
style="margin-right: 10px"
@click="toJudgePoint('edit', scope.row)">自定义</el-button>
<el-button :disabled="isDetail"
type="text"
@click="delJudgePoint(scope.$index)">
<el-button :disabled="isDetail" type="text" style="margin-right: 10px"
@click="toJudgePoint('edit', scope.row)">自定义</el-button>
<el-button :disabled="isDetail" type="text" @click="delJudgePoint(scope.$index)">
删除
</el-button>
</template>
</u-table-column>
</u-table>
</el-table-column>
</el-table>
</div>
</el-card>
<el-card shadow="hover"
class="mgb20">
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="addhr_tag"></p>
@ -244,25 +160,16 @@
</div>
<div>
启用
<el-switch :disabled="isDetail"
:active-value="0"
:inactive-value="1"
v-model="projectManage.hintOpen"></el-switch>
<el-switch :disabled="isDetail" :active-value="0" :inactive-value="1"
v-model="projectManage.hintOpen"></el-switch>
</div>
</div>
<div class="border-b-dashed"></div>
<div>
<el-form label-width="0">
<el-form-item prop="tips"
label="">
<quill :border="true"
:readonly="isDetail"
v-model="projectManage.experimentHint"
:type.sync="projectManage.experimentHintType"
radio
:minHeight="150"
:height="400"
:index="3" />
<el-form-item prop="tips" label="">
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentHint"
:type.sync="projectManage.experimentHintType" radio :minHeight="150" :height="400" :index="3" />
</el-form-item>
</el-form>
</div>
@ -271,62 +178,34 @@
</el-row>
<!--选择判分点对话框-->
<el-dialog title="添加判分点"
:visible.sync="dialogVisible"
width="40%"
:close-on-click-modal="false"
@close="closeJudgment">
<el-dialog title="添加判分点" :visible.sync="dialogVisible" width="40%" :close-on-click-modal="false"
@close="closeJudgment">
<div class="text-right mgb10">
<div>
<el-input placeholder="请输入需要查找的判分点"
prefix-icon="el-icon-search"
v-model.trim="judgementpointsquery"
clearable></el-input>
<el-input placeholder="请输入需要查找的判分点" prefix-icon="el-icon-search" v-model.trim="judgementpointsquery"
clearable></el-input>
</div>
</div>
<u-table v-loading="visibleLoading"
:data="judgementData"
ref="judgementTable"
class="table"
stripe
header-align="center"
use-virtual
:row-height="45"
:max-height="400"
:border="false"
@selection-change="handleSelectionJudgment"
:row-key="rowKey">
<u-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></u-table-column>
<u-table-column prop="id"
label="序号"
align="center"
width="100">
<el-table v-loading="visibleLoading" :data="judgementData" ref="judgementTable" class="table" stripe
header-align="center" use-virtual :row-height="45" :max-height="400" :border="false"
@selection-change="handleSelectionJudgment" :row-key="rowKey">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column prop="id" label="序号" align="center" width="100">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</u-table-column>
<u-table-column prop="name"
label="判分点名称"
align="center"></u-table-column>
<u-table-column label="操作"
align="center"
width="100">
</el-table-column>
<el-table-column prop="name" label="判分点名称" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button size="mini"
@click="toJudgePoint('view', scope.row)">查看</el-button>
<el-button size="mini" @click="toJudgePoint('view', scope.row)">查看</el-button>
</template>
</u-table-column>
</u-table>
<div slot="footer"
class="dialog-footer">
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click="closeJudgment"> </el-button>
<el-button type="primary"
:loading="savingJud"
@click="saveJudgment"> </el-button>
<el-button type="primary" :loading="savingJud" @click="saveJudgment"> </el-button>
</div>
</el-dialog>
</div>
@ -440,6 +319,8 @@ export default {
if (this.$route.query.projectId) {
this.projectId = this.$route.query.projectId;
this.getInfoData();
} else {
this.rowDrop()
}
//
if (JSON.stringify(this.projectFields) != "{}") {
@ -447,7 +328,6 @@ export default {
this.projectManage = projectManage;
this.projectJudgmentData = projectJudgmentData;
}
this.rowDrop();
this.$refs.main.scrollTop = 0;
},
beforeDestroy () {
@ -482,6 +362,7 @@ export default {
this.$nextTick(() => {
this.updateTime = 0
this.$refs.main.scrollTop = 0;
this.rowDrop();
});
}).catch(err => {
this.loading = false
@ -785,24 +666,16 @@ export default {
//
rowDrop () {
//
const tbody = document.querySelector(".draggable .el-table__body-wrapper tbody");
const _this = this;
Sortable.create(tbody, {
const tbody = document.querySelector(".el-table__body tbody");
const that = this;
this.$refs.projectJudgementTable && Sortable.create(tbody, {
//
draggable: ".draggable .el-table__row",
onEnd ({ newIndex, oldIndex }) {
// : vue$nextTick
_this.projectJudgmentData.splice(newIndex, 0, _this.projectJudgmentData.splice(oldIndex, 1)[0]);
let newArray = _this.projectJudgmentData.slice(0);
_this.projectJudgmentData = [];
_this.$nextTick(function () {
newArray.forEach((e, i) => {
_this.$set(e, "sort", i + 1);//
_this.$set(e, "name", e.name + "?");
_this.$set(e, "name", e.name.slice(0, e.name.length - 1)); //
});
_this.projectJudgmentData = newArray;
});
// draggable: ".draggable .el-table__row",
onUpdate ({ newIndex, oldIndex }) {
console.log("🚀 ~ onEnd ~ newIndex, oldIndex:", newIndex, oldIndex)
if (newIndex == oldIndex) return false
const currentRow = that.projectJudgmentData.splice(oldIndex, 1)[0]
that.projectJudgmentData.splice(newIndex, 0, currentRow)
}
});
},
@ -911,13 +784,14 @@ export default {
<style lang="scss" scoped>
/deep/ .readonly .ql-toolbar {
height: 0;
padding: 0;
border-bottom: 0;
height: 0;
padding: 0;
border-bottom: 0;
}
.main {
overflow: auto;
overflow-x: hidden;
height: calc(100vh - 161px);
overflow: auto;
overflow-x: hidden;
height: calc(100vh - 161px);
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -705,7 +705,7 @@ export default {
//
if (row.fileId) {
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => {
this.playAuth = res.data.playAuth;
this.playAuth = res.playAuth;
if (this.player) {
this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth);
} else {

@ -2,162 +2,88 @@
<!-- 平台自建 -->
<div style="padding-top: 24px">
<div class="tool">
<ul class="filter"
style="align-items: flex-start">
<ul class="filter" style="align-items: flex-start">
<li>
<label>可见范围</label>
<el-select v-model="form.visibleRange"
clearable
placeholder="请选择可见范围"
@change="getData">
<el-option v-for="(item,index) in regions"
:key="index"
:label="item.name"
:value="item.id"></el-option>
<el-select v-model="form.visibleRange" clearable placeholder="请选择可见范围" @change="getData">
<el-option v-for="(item, index) in regions" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
<li>
<label>课程分类</label>
<el-select v-model="form.categoryId"
clearable
placeholder="请选择课程分类"
@change="getData">
<el-option label="不限"
value=""></el-option>
<el-option label="暂无分类"
value="0"></el-option>
<el-option v-for="(item,index) in classificationList"
:key="index"
:label="item.classificationName"
:value="item.id"></el-option>
<el-select v-model="form.categoryId" clearable placeholder="请选择课程分类" @change="getData">
<el-option label="不限" value=""></el-option>
<el-option label="暂无分类" value="0"></el-option>
<el-option v-for="(item, index) in classificationList" :key="index" :label="item.classificationName"
:value="item.id"></el-option>
</el-select>
</li>
<li>
<label>课程类型</label>
<el-select v-model="form.courseType"
clearable
placeholder="请选择课程类型"
@change="getData">
<el-option v-for="(item,index) in types"
:key="index"
:label="item.name"
:value="item.id"></el-option>
<el-select v-model="form.courseType" clearable placeholder="请选择课程类型" @change="getData">
<el-option v-for="(item, index) in types" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
<li>
<label>搜索</label>
<el-input placeholder="请输入理论课程名称/创建人"
suffix-icon="el-icon-search"
v-model="form.keyWord"
clearable
size="small"></el-input>
<el-input placeholder="请输入理论课程名称/创建人" suffix-icon="el-icon-search" v-model="form.keyWord" clearable
size="small"></el-input>
</li>
</ul>
<div>
<el-button v-auth="'平台自建:新增'"
type="primary"
round
@click="addCourse">新增</el-button>
<el-button v-auth="'平台自建:批量删除'"
type="primary"
round
@click="delAllData">批量删除</el-button>
<el-button v-auth="'平台自建:新增'" type="primary" round @click="addCourse">新增</el-button>
<el-button v-auth="'平台自建:批量删除'" type="primary" round @click="delAllData">批量删除</el-button>
</div>
</div>
<el-table :data="list"
class="table"
ref="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="selection"
width="80"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="100"
label="序号"
align="center">
<el-table :data="list" class="table" ref="table" stripe header-align="center"
@selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="courseName"
label="课程名称"
align="center">
<el-table-column prop="courseName" label="课程名称" align="center">
</el-table-column>
<el-table-column label="可见范围"
align="center">
<el-table-column label="可见范围" align="center">
<template slot-scope="scope">
{{ regionName[scope.row.visibleRange] }}
</template>
</el-table-column>
<el-table-column prop="createTime"
label="创建时间"
align="center">
<el-table-column prop="createTime" label="创建时间" align="center">
</el-table-column>
<el-table-column prop="courseClassification"
label="课程类型"
align="center">
<el-table-column prop="courseClassification" label="课程类型" align="center">
<template slot-scope="scope">
{{ scope.row.courseType == 1 ? '付费' : '免费' }}
</template>
</el-table-column>
<el-table-column prop="founder"
label="创建人"
align="center">
<el-table-column prop="founder" label="创建人" align="center">
</el-table-column>
<el-table-column prop="courseClassification"
label="课程分类"
align="center"
show-overflow-tooltip>
<el-table-column prop="courseClassification" label="课程分类" align="center" show-overflow-tooltip>
</el-table-column>
<el-table-column label="操作"
align="center"
width="250">
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope">
<el-button v-auth="'平台自建:编辑信息'"
type="text"
@click="editCourse(scope.row)">编辑信息</el-button>
<el-divider v-auth="'平台自建:编辑信息'"
direction="vertical"></el-divider>
<el-button v-auth="'平台自建:内容设置'"
type="text"
@click="config(scope.row)">内容设置</el-button>
<el-divider v-auth="'平台自建:内容设置'"
direction="vertical"></el-divider>
<el-button v-auth="'平台自建:预览'"
type="text"
@click="preview(scope.row)">预览</el-button>
<el-divider v-auth="'平台自建:预览'"
direction="vertical"></el-divider>
<el-button v-auth="'平台自建:删除'"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
<el-button v-auth="'平台自建:编辑信息'" type="text" @click="editCourse(scope.row)">编辑信息</el-button>
<el-divider v-auth="'平台自建:编辑信息'" direction="vertical"></el-divider>
<el-button v-auth="'平台自建:内容设置'" type="text" @click="config(scope.row)">内容设置</el-button>
<el-divider v-auth="'平台自建:内容设置'" direction="vertical"></el-divider>
<el-button v-auth="'平台自建:预览'" type="text" @click="preview(scope.row)">预览</el-button>
<el-divider v-auth="'平台自建:预览'" direction="vertical"></el-divider>
<el-button v-auth="'平台自建:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
<el-table-column label="可授权状态"
align="center"
width="120">
<el-table-column label="可授权状态" align="center" width="120">
<template slot-scope="scope">
<el-switch v-auth="'平台自建:禁用'"
v-model="scope.row.ztOpen"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 5px"
:active-text="scope.row.ztOpen ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)"></el-switch>
<el-switch v-auth="'平台自建:禁用'" v-model="scope.row.ztOpen" :active-value="0" :inactive-value="1"
style="margin: 0 10px 0 5px" :active-text="scope.row.ztOpen ? '关' : '开'"
@change="switchOff($event, scope.row, scope.$index)"></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange"
:current-page="page">
</el-pagination>
</div>
</div>
@ -349,10 +275,10 @@ export default {
<style lang="scss" scoped>
/deep/ .tool {
.filter {
.el-input {
min-width: 215px;
}
.filter {
.el-input {
min-width: 215px;
}
}
}
</style>

@ -2,11 +2,8 @@
<!-- 理论课程管理 -->
<div class="page">
<div class="tabs">
<a class="item"
v-for="(item, i) in tabs"
:key="i"
:class="{active: i == active}"
@click="tabChange(i)">{{ item }}</a>
<a class="item" v-for="(item, i) in tabs" :key="i" :class="{ active: i == active }" @click="tabChange(i)">{{ item
}}</a>
</div>
<div class="page-content">
<!-- 平台自建 -->
@ -61,5 +58,4 @@ export default {
};
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>

@ -1,78 +1,46 @@
<template>
<!-- 课程预览 -->
<div class="wrap">
<el-card shadow="hover"
class="m-b-20">
<el-card shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="back"
:content="'课程预览'"></el-page-header>
<el-page-header @back="back" :content="'课程预览'"></el-page-header>
</div>
</el-card>
<div class="flex">
<div class="cover"
:class="{'is-word': showMask1}">
<img v-if="coverUrl"
:src="coverUrl"
alt=""
width="100%"
height="100%">
<div class="cover" :class="{ 'is-word': showMask1 }">
<img v-if="coverUrl" :src="coverUrl" alt="" width="100%" height="100%">
<template v-else-if="iframeSrc">
<iframe class="inner fileIframe"
id="fileIframe"
:src="iframeSrc"
frameborder="0"></iframe>
<iframe class="inner fileIframe" id="fileIframe" :src="iframeSrc" frameborder="0"></iframe>
<template v-if="showMask">
<div class="mask"
style="width: 500px;height: 30px;top: 53px;right: 320px"></div>
<div class="mask"
style="width: 175px;height: 30px;top: 53px;right: 5px"></div>
<div class="mask" style="width: 500px;height: 30px;top: 53px;right: 320px"></div>
<div class="mask" style="width: 175px;height: 30px;top: 53px;right: 5px"></div>
</template>
<template v-if="showMask1">
<div class="word-mask"
style="height: 40px;"></div>
<div class="word-mask2"
style="top: 55px;left: 28%;width: 44%;height: calc(100% - 80px);"></div>
<div class="word-mask" style="height: 40px;"></div>
<div class="word-mask2" style="top: 55px;left: 28%;width: 44%;height: calc(100% - 80px);"></div>
</template>
<template v-if="showMask2">
<div class="excel-mask1"
style="height: 48px;"></div>
<div class="excel-mask1" style="height: 48px;"></div>
</template>
</template>
<div class="pdf inner"
v-else-if="pdfSrc">
<div class="pdf inner" v-else-if="pdfSrc">
<p class="arrow">
<span @click="changePdfPage(0)"
class="turn el-icon-arrow-left"
:class="{grey: currentPage==1}"></span>
<span @click="changePdfPage(0)" class="turn el-icon-arrow-left" :class="{ grey: currentPage == 1 }"></span>
{{ currentPage }} / {{ pageCount }}
<span @click="changePdfPage(1)"
class="turn el-icon-arrow-right"
:class="{grey: currentPage==pageCount}"></span>
<span @click="changePdfPage(1)" class="turn el-icon-arrow-right"
:class="{ grey: currentPage == pageCount }"></span>
</p>
<pdf class="pdf-wrap"
:src="pdfSrc"
:page="currentPage"
@num-pages="pageCount=$event"
@page-loaded="currentPage=$event"
@loaded="loadPdfHandler">
<pdf class="pdf-wrap" :src="pdfSrc" :page="currentPage" @num-pages="pageCount = $event"
@page-loaded="currentPage = $event" @loaded="loadPdfHandler">
</pdf>
</div>
<div class="inner"
v-else-if="playAuth">
<div class="video_wid"
id="player"></div>
<div class="inner" v-else-if="playAuth">
<div class="video_wid" id="player"></div>
</div>
<div class="inner"
v-else-if="videoSrc">
<video class="video"
:key="videoSrc"
width="100%"
height="100%"
autoplay
controls>
<source :src="videoSrc"
type="video/mp4">
<div class="inner" v-else-if="videoSrc">
<video class="video" :key="videoSrc" width="100%" height="100%" autoplay controls>
<source :src="videoSrc" type="video/mp4">
您的浏览器不支持 video 标签
</video>
</div>
@ -81,49 +49,26 @@
<div class="list">
<h4 class="title">{{ courseName }}</h4>
<div class="desc-wrap">
<div class="desc"
:class="{active: desShrink}"
v-html="description"></div>
<i class="arrow"
:class="{active: desShrink}"
v-if="description.length > 40">
<div class="desc" :class="{ active: desShrink }" v-html="description"></div>
<i class="arrow" :class="{ active: desShrink }" v-if="description.length > 40">
<span>...</span>
<img src="@/assets/img/arrow-down.png"
alt=""
@click="desShrink = !desShrink">
<img src="@/assets/img/arrow-down.png" alt="" @click="desShrink = !desShrink">
</i>
</div>
<div class="chapters">
<template v-if="videoList.length">
<div class="chapter"
v-for="(item,index) in videoList"
:key="index">
<div class="chapter" v-for="(item, index) in videoList" :key="index">
<div class="chapterName">{{ item.name }}</div>
<div class="section"
v-if="item.subsectionList.length">
<div v-for="(section,i) in item.subsectionList"
:key="i"
@click="preview(section, item.name)">
<p class="sectionName ellipsis"
:class="{active: curLink === `${item.name}${section.name}`}">
<img v-if="section.fileType === 'pptx'"
src="@/assets/img/exts/ppt.png"
alt="">
<img v-else-if="section.fileType === 'mp4'"
src="@/assets/img/exts/video.png"
alt="">
<div class="section" v-if="item.subsectionList.length">
<div v-for="(section, i) in item.subsectionList" :key="i" @click="preview(section, item.name)">
<p class="sectionName ellipsis" :class="{ active: curLink === `${item.name}${section.name}` }">
<img v-if="section.fileType === 'pptx'" src="@/assets/img/exts/ppt.png" alt="">
<img v-else-if="section.fileType === 'mp4'" src="@/assets/img/exts/video.png" alt="">
<img v-else-if="section.fileType === 'doc' || section.fileType === 'docx'"
src="@/assets/img/exts/word.png"
alt="">
<img v-else-if="section.fileType === 'txt'"
src="@/assets/img/exts/txt.png"
alt="">
<img v-else-if="section.fileType === 'pdf'"
src="@/assets/img/exts/pdf.png"
alt="">
<img v-else
src="@/assets/img/exts/pic.png"
alt="">
src="@/assets/img/exts/word.png" alt="">
<img v-else-if="section.fileType === 'txt'" src="@/assets/img/exts/txt.png" alt="">
<img v-else-if="section.fileType === 'pdf'" src="@/assets/img/exts/pdf.png" alt="">
<img v-else src="@/assets/img/exts/pic.png" alt="">
{{ section.name }}
</p>
</div>
@ -222,7 +167,7 @@ export default {
//
if (row.fileId) {
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => {
this.playAuth = res.data.playAuth;
this.playAuth = res.playAuth;
this.$nextTick(() => {
if (this.player) {
this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth);
@ -320,265 +265,317 @@ export default {
<style lang="scss" scoped>
.wrap {
padding: 0 200px;
padding: 0 200px;
}
$height: 700px;
.video_wid,
.cover {
position: relative;
width: 76%;
height: $height !important;
border: 0;
position: relative;
width: 76%;
height: $height !important;
border: 0;
}
.page {
/deep/.des {
overflow: auto;
div,
p,
span {
font-family: PingFangSC-Regular !important;
}
/deep/.des {
overflow: auto;
div,
p,
span {
font-family: PingFangSC-Regular !important;
}
}
}
.l-title {
font-size: 17px;
font-size: 17px;
}
.cover {
background-color: #252528;
img {
border-radius: 8px;
}
&.is-word {
overflow: hidden;
}
background-color: #252528;
img {
border-radius: 8px;
}
&.is-word {
overflow: hidden;
}
}
.fileIframe {
height: $height !important;
height: $height !important;
}
.video_wid,
.inner {
width: 100%;
height: 100% !important;
border: 0;
overflow: auto;
width: 100%;
height: 100% !important;
border: 0;
overflow: auto;
}
.cover.is-word {
.inner {
height: calc(100% + 38px) !important;
margin-top: -38px;
}
.inner {
height: calc(100% + 38px) !important;
margin-top: -38px;
}
}
.video_wid:focus {
outline: none;
outline: none;
}
.catalog {
width: 296px;
padding: 16px;
margin-left: 12px;
background-color: #252528;
width: 296px;
padding: 16px;
margin-left: 12px;
background-color: #252528;
}
.list {
height: calc(700px - 82px);
overflow-y: auto;
.title {
margin-bottom: 11px;
color: #fff;
font-size: 16px;
}
.pro-title {
margin-bottom: 5px;
color: #fff;
font-size: 12px;
}
/deep/.el-progress-bar {
width: 92%;
}
/deep/.el-progress__text {
color: #fff;
height: calc(700px - 82px);
overflow-y: auto;
.title {
margin-bottom: 11px;
color: #fff;
font-size: 16px;
}
.pro-title {
margin-bottom: 5px;
color: #fff;
font-size: 12px;
}
/deep/.el-progress-bar {
width: 92%;
}
/deep/.el-progress__text {
color: #fff;
}
.desc-wrap {
position: relative;
.desc {
font-size: 12px;
color: #fff;
line-height: 22px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
text-overflow: ellipsis;
overflow: hidden;
&.active {
display: block;
overflow: visible;
}
}
.desc-wrap {
position: relative;
.desc {
font-size: 12px;
color: #fff;
line-height: 22px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
text-overflow: ellipsis;
overflow: hidden;
&.active {
display: block;
overflow: visible;
}
.arrow {
position: absolute;
bottom: 2px;
right: 0;
display: flex;
justify-content: space-between;
width: 46px;
background-color: #fff;
span {
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
}
img {
width: 16px;
cursor: pointer;
}
&.active {
span {
opacity: 0;
}
.arrow {
position: absolute;
bottom: 2px;
right: 0;
display: flex;
justify-content: space-between;
width: 46px;
background-color: #fff;
span {
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
}
img {
width: 16px;
cursor: pointer;
}
&.active {
span {
opacity: 0;
}
img {
transform: rotate(180deg);
}
}
img {
transform: rotate(180deg);
}
}
}
.chapters {
margin-top: 16px;
max-height: calc(100% - 53px);
overflow: auto;
}
.chapter {
margin-bottom: 20px;
}
.chapters {
margin-top: 16px;
max-height: calc(100% - 53px);
overflow: auto;
}
.chapter {
margin-bottom: 20px;
}
.chapterName {
color: #fff;
font-size: 14px;
}
.section {
padding: 5px 15px;
margin-top: 12px;
background-color: #121214;
}
.sectionName {
position: relative;
display: flex;
align-items: center;
padding-right: 15px;
margin: 12px 0;
font-size: 12px;
color: #999;
cursor: pointer;
img {
margin-right: 8px;
}
.chapterName {
color: #fff;
font-size: 14px;
.icon {
position: absolute;
right: 0;
font-size: 14px;
color: #00c935;
}
.section {
padding: 5px 15px;
margin-top: 12px;
background-color: #121214;
.circle {
width: 14px;
height: 14px;
border-radius: 50%;
border: 1px solid #ccc;
}
.sectionName {
position: relative;
display: flex;
align-items: center;
padding-right: 15px;
margin: 12px 0;
font-size: 12px;
color: #999;
cursor: pointer;
img {
margin-right: 8px;
}
.icon {
position: absolute;
right: 0;
font-size: 14px;
color: #00c935;
}
.circle {
width: 14px;
height: 14px;
border-radius: 50%;
border: 1px solid #ccc;
}
&.active {
color: #fff;
}
&.active {
color: #fff;
}
}
}
.buy {
text-align: center;
.tips {
margin-bottom: 10px;
font-size: 14px;
}
img {
width: 85%;
}
text-align: center;
.tips {
margin-bottom: 10px;
font-size: 14px;
}
img {
width: 85%;
}
}
.el-image-viewer__wrapper {
transform: translateY(-10px);
transition: transform 0.5s;
transform: translateY(-10px);
transition: transform 0.5s;
&.active {
transform: translateY(0);
}
&.active {
transform: translateY(0);
}
}
.el-image-viewer__close {
z-index: 2000;
top: 15px;
right: 15px;
&.doc-close {
i {
color: #000 !important;
}
z-index: 2000;
top: 15px;
right: 15px;
&.doc-close {
i {
color: #000 !important;
}
}
}
.list::-webkit-scrollbar {
width: 4px;
width: 4px;
}
.list::-webkit-scrollbar-thumb {
border-radius: 10px;
background: rgba(0, 0, 0, 0.06);
border-radius: 10px;
background: rgba(0, 0, 0, 0.06);
}
.mask {
z-index: 9;
position: absolute;
background-color: rgb(57, 58, 61);
z-index: 9;
position: absolute;
background-color: rgb(57, 58, 61);
}
.word-mask {
z-index: 9;
position: absolute;
top: 0;
right: 0;
width: 100%;
background-color: rgb(243, 242, 241);
z-index: 9;
position: absolute;
top: 0;
right: 0;
width: 100%;
background-color: rgb(243, 242, 241);
}
.word-mask1 {
z-index: 9;
position: absolute;
top: 0;
right: 0;
width: 100%;
background-color: #185abd;
z-index: 9;
position: absolute;
top: 0;
right: 0;
width: 100%;
background-color: #185abd;
}
.word-mask2 {
z-index: 9;
position: absolute;
background-color: transparent;
z-index: 9;
position: absolute;
background-color: transparent;
}
.excel-mask1 {
z-index: 9;
position: absolute;
top: 0;
left: 20%;
width: 60%;
background-color: #107c41;
z-index: 9;
position: absolute;
top: 0;
left: 20%;
width: 60%;
background-color: #107c41;
}
.pdf {
position: relative;
.full {
position: absolute;
top: 7px;
right: 10px;
cursor: pointer;
}
.arrow {
padding: 10px 0;
display: flex;
justify-content: center;
align-items: center;
font-size: 16px;
color: #fff;
background-color: #333;
.turn {
margin: 0 10px;
font-size: 18px;
cursor: pointer;
}
}
.pdf-wrap {
width: 80%;
margin: 0 auto;
position: relative;
.full {
position: absolute;
top: 7px;
right: 10px;
cursor: pointer;
}
.arrow {
padding: 10px 0;
display: flex;
justify-content: center;
align-items: center;
font-size: 16px;
color: #fff;
background-color: #333;
.turn {
margin: 0 10px;
font-size: 18px;
cursor: pointer;
}
}
.pdf-wrap {
width: 80%;
margin: 0 auto;
}
}
</style>

@ -0,0 +1,39 @@
<template>
<div>
<iframe :src="url" frameborder="0" width="100%"></iframe>
</div>
</template>
<script>
import Util from '@/libs/util'
import Setting from '@/setting'
export default {
data () {
return {
url: ''
};
},
mounted () {
const cache = localStorage.getItem('examPath') // localStorage
let url = `${location.origin}/examination/`
if (Setting.isDev) url = `http://192.168.31.125:8098/`
if (cache) {
url += `#${cache}${cache.includes('?') ? `&` : '?'}token=${sessionStorage.getItem('token')}`
} else {
url += `#/quesBankType?token=${sessionStorage.getItem('token')}`
}
url += `&v=${Date.now()}`
localStorage.setItem('exam_token', sessionStorage.getItem('token'))
this.url = url
},
methods: {
}
};
</script>
<style lang="scss" scoped>
iframe {
height: calc(100vh - 167px);
}
</style>

@ -0,0 +1,57 @@
<template>
<div>
<el-card shadow="hover" class="m-b-20">
<div class="flex-between">
<el-page-header @back="back" content="理论考试系统程序"></el-page-header>
</div>
</el-card>
<div class="page">
<div class="tabs m-b-20">
<a class="item" v-for="(item, i) in tabs" :key="i" :class="{ active: i == active }" @click="tabChange(i)">{{
item
}}</a>
</div>
<System v-if="active == 'tab1'" />
<Program v-if="active == 'tab2'" />
</div>
</div>
</template>
<script>
import System from './system'
import Program from './program'
export default {
components: {
System,
Program,
},
data () {
return {
active: 'tab1',
tabs: {
tab1: '系统列表',
tab2: '程序后台',
},
};
},
mounted () {
},
methods: {
tabChange (i) {
this.active = i
},
back () {
this.$router.back()
},
}
};
</script>
<style scoped>
.card {
min-height: calc(100vh - 300px);
}
</style>

@ -0,0 +1,139 @@
<template>
<div>
<el-table v-loading="loading" :data="list" class="table" ref="table" stripe header-align="center" row-key="id">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="curriculumName" label="程序名称" align="center"></el-table-column>
<el-table-column prop="curriculumType" label="供应商" align="center"></el-table-column>
<el-table-column prop="userName" label="程序类型" align="center"></el-table-column>
<el-table-column prop="orderVolume" label="程序归属" align="center"></el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page"
layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
</div>
</template>
<script>
import qs from 'qs'
export default {
data () {
return {
list: [],
form: {
curriculumName: this.$route.query.curriculumName || ''
},
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
loading: false,
searchTimer: null
};
},
watch: {
"form.curriculumName": function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
this.getData()
},
methods: {
//
getData () {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
let data = {
...this.form,
pageNum: this.page,
pageSize: this.pageSize,
supplierId: sid ? sid.supplierId : ''
};
this.$post(this.api.curriculumList, data).then(res => {
this.list = res.page.records
this.total = res.page.total
this.loading = false
}).catch(err => { })
},
initData () {
this.page = 1
this.getData()
},
// url
setReferrer () {
this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`)
},
//
addcourse () {
this.setReferrer()
this.$router.push("/addcurriculum");
},
//
edit (row) {
this.setReferrer()
this.$router.push(`/addcurriculum?cid=${row.cid}`);
},
//
config (row) {
this.setReferrer()
this.$router.push(`/contentSettings?cid=${row.cid}&name=${row.curriculumName}`);
},
//
handleDelete (row) {
this.$post(`${this.api.deleteCoursePrompt}?cids=${row.cid}`).then(({ status }) => {
if (status === 200) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.delCourse}?cids=${row.cid}`).then(res => {
this.getData();
this.$message.success("删除成功");
}).catch(err => { })
}).catch(() => {
});
}
}).catch(err => { })
},
//
delAllSelection () {
if (this.multipleSelection.length) {
let cids = []
this.multipleSelection.forEach(i => {
cids.push('cids=' + i.cid)
});
this.$post(`${this.api.deleteCoursePrompt}?${cids.join('&')}`).then(({ status }) => {
if (status === 200) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(i => i.cid);
this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => {
if (ids.length == this.list.length) {
if (this.page > 1) {
this.page = this.page - 1
}
}
this.getData();
this.$message.success("删除成功");
this.$refs.table.clearSelection()
}).catch(err => { })
}).catch(() => { })
}
}).catch(err => { })
} else {
this.$message.warning("请先选择课程 !");
}
},
//
handleCurrentChange (val) {
this.page = val;
this.$router.push(`/curriculum?page=${val}`)
this.getData();
},
}
};
</script>
<style scoped></style>

@ -0,0 +1,321 @@
<template>
<div>
<div class="tool">
<ul class="filter">
<li>
<label>搜索</label>
<el-input placeholder="请输入系统名称" suffix-icon="el-icon-search" v-model="curriculumName" clearable
size="small"></el-input>
</li>
</ul>
<div>
<el-button type="primary" round @click="add">新增系统</el-button>
</div>
</div>
<el-table v-loading="loading" :data="list" class="table" ref="table" stripe header-align="center" row-key="id">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="curriculumName" label="系统名称" align="center"></el-table-column>
<el-table-column prop="curriculumType" label="系统分类" align="center"></el-table-column>
<el-table-column prop="userName" label="系统描述" align="center"></el-table-column>
<el-table-column label="创建时间" align="center"></el-table-column>
<el-table-column prop="orderVolume" label="创建人" align="center"></el-table-column>
<el-table-column prop="expectedCourse" label="系统后台" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">进入</el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page"
layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
<!-- 新增编辑系统 -->
<el-dialog :title="(form.accountId ? '编辑' : '新增') + '系统'" :visible.sync="systemVisible" width="400px"
:close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item prop="workNumber" label="关联程序">
<el-input value="理论考试系统程序" disabled class="m-r-10" style="width: 240px;" />
<el-button type="text" @click="showProgram">查看</el-button>
</el-form-item>
<el-form-item prop="userName" label="系统名称">
<el-input v-model.trim="form.userName" placeholder="请输入系统名称"></el-input>
</el-form-item>
<el-form-item prop="account" label="系统分类">
<el-select v-model="form.operator" class="m-r-10" style="width: 230px;">
<!-- <el-option v-for="i in operators" :key="i" :label="i" :value="i"></el-option> -->
</el-select>
<el-button type="text" @click="customType">自定义</el-button>
</el-form-item>
<el-form-item prop="email" label="系统描述">
<el-input v-model.trim="form.email" type="textarea" :rows="4" placeholder="请输入系统描述"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="systemVisible = false">取消</el-button>
<el-button type="primary" @click="submitSystem">确定</el-button>
</span>
</el-dialog>
<!-- 程序列表 -->
<el-dialog title="程序列表" :visible.sync="programVisible" width="600px" :close-on-click-modal="false">
<Program />
<span slot="footer" class="dialog-footer">
<el-button @click="programVisible = false">关闭</el-button>
</span>
</el-dialog>
<!-- 系统分类设置 -->
<el-dialog title="系统分类设置" :visible.sync="typeVisible" width="600px" :close-on-click-modal="false"
class="manage-dia">
<div class="plus">
<i class="el-icon-circle-plus-outline" @click="addClass"></i>
</div>
<el-table :data="types" ref="table" header-align="center" row-key="id">
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="classificationName" label="分类名称" align="center" min-width="130">
<template slot-scope="scope">
<el-input v-if="scope.row.edit" placeholder="请输入分类名称" v-model="scope.row.classificationName" clearable
maxlength="30"></el-input>
<span v-else>{{ scope.row.classificationName }}</span>
</template>
</el-table-column>
<el-table-column prop="updateTime1" label="已引用系统数量" align="center" min-width="60"></el-table-column>
<el-table-column label="操作" align="center" min-width="60">
<template slot-scope="scope">
<i v-if="scope.row.edit" class="el-icon-check action m-r-10" @click="submitClass(scope.row)"></i>
<i v-else class="el-icon-edit action m-r-10" @click="editClass(scope.row)"></i>
<i class="el-icon-delete action" @click="delClass(scope.row, scope.$index)"></i>
</template>
</el-table-column>
</el-table>
<span slot="footer">
<el-button @click="closeClass">返回</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Program from './program'
export default {
components: {
Program,
},
data () {
return {
list: [],
curriculumName: this.$route.query.curriculumName || '',
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
loading: false,
searchTimer: null,
systemVisible: false,
form: {},
rules: {
roleList: [
{ required: true, message: '请输入系统名称', trigger: 'blur' }
],
type: [
{ required: true, message: '请选择系统分类', trigger: 'change' }
],
},
programVisible: false,
types: [],
typeVisible: false,
};
},
watch: {
curriculumName: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
// this.getData()
},
methods: {
//
getData () {
let data = {
curriculumName: this.curriculumName,
pageNum: this.page,
pageSize: this.pageSize,
};
this.$post(this.api.curriculumList, data).then(res => {
this.list = res.page.records
this.total = res.page.total
this.loading = false
}).catch(err => { })
},
initData () {
this.page = 1
this.getData()
},
//
add () {
this.systemVisible = true
},
//
edit (row) {
this.$router.push(`/addcurriculum?cid=${row.cid}`);
},
//
config (row) {
this.$router.push(`/contentSettings?cid=${row.cid}&name=${row.curriculumName}`);
},
//
handleDelete (row) {
this.$post(`${this.api.deleteCoursePrompt}?cids=${row.cid}`).then(({ status }) => {
if (status === 200) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.delCourse}?cids=${row.cid}`).then(res => {
this.getData();
this.$message.success("删除成功");
}).catch(err => { })
}).catch(() => {
});
}
}).catch(err => { })
},
//
delAllSelection () {
if (this.multipleSelection.length) {
let cids = []
this.multipleSelection.forEach(i => {
cids.push('cids=' + i.cid)
});
this.$post(`${this.api.deleteCoursePrompt}?${cids.join('&')}`).then(({ status }) => {
if (status === 200) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(i => i.cid);
this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => {
if (ids.length == this.list.length) {
if (this.page > 1) {
this.page = this.page - 1
}
}
this.getData();
this.$message.success("删除成功");
this.$refs.table.clearSelection()
}).catch(err => { })
}).catch(() => { })
}
}).catch(err => { })
} else {
this.$message.warning("请先选择课程 !");
}
},
//
handleCurrentChange (val) {
this.page = val;
this.$router.push(`/curriculum?page=${val}`)
this.getData();
},
//
showProgram () {
this.programVisible = true
},
//
customType () {
this.typeVisible = true
},
//
getType (detail) {
this.$post(`${this.api.queryClassificationByType}?typeId=${this.typeId}`).then(({ data }) => {
this.types = data
// id
if (detail) {
const id = this.form.classificationId
if (!data.find(e => e.id == id)) this.form.classificationId = ''
setTimeout(() => {
this.updateTime = 0
}, 500)
}
}).catch(err => { })
},
//
addClass () {
this.types.find(e => e.edit) ?
Util.errorMsg('请先保存分类!') :
this.types.push({
edit: true,
id: '',
classificationName: ''
})
},
//
editClass (row) {
this.types.find(e => e.edit) ?
Util.errorMsg('请先保存分类!') :
this.$set(row, 'edit', 1)
},
//
delClass (row, i) {
if (row.id) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.batchDeletionParnerClass}?ids=${row.id}`).then(res => {
Util.successMsg('删除成功')
this.getType()
}).catch(res => { })
}).catch(() => { })
} else {
this.types.splice(i, 1)
}
},
//
submitClass (row, showMsg = 1) {
if (!row.classificationName) return Util.errorMsg('请输入分类名称')
this.$post(`${this.api.checkForHeavyParnerClass}?classificationName=${row.classificationName}&typeId=${this.typeId}&classificationId=${row.id}`).then(res => {
this.$post(this.api[row.id ? 'updateParnerClass' : 'saveParnerClass'], {
classificationName: row.classificationName,
typeId: this.typeId, // (1.2.)
id: row.id,
}).then(res => {
showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功')
this.getType()
}).catch(res => { })
}).catch(res => { })
},
//
submitSystem () {
},
}
};
</script>
<style lang="scss" scoped>
.plus {
margin-bottom: 10px;
font-size: 18px;
color: #9278ff;
text-align: right;
cursor: pointer;
}
.action {
cursor: pointer;
}
</style>

@ -2,11 +2,9 @@
<div>
<el-row :gutter="20">
<el-col :span="24">
<el-card shadow="hover"
class="mgb20">
<el-card shadow="hover" class="mgb20">
<div class="flex-between">
<div class="per_title"
@click="goback">
<div class="per_title" @click="goback">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">{{ isDetail ? '查看' : '编辑' }}用户信息</span>
@ -15,8 +13,7 @@
</el-card>
<!-- 账号信息 -->
<el-card shadow="hover"
class="mgb20">
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-between mgb20 user_header">
<div class="flex-center">
@ -26,33 +23,20 @@
</div>
<div>
<el-form ref="form"
:model="form"
:rules="rules"
label-width="120px"
:disabled="isDetail">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" :disabled="isDetail">
<el-col :span="24">
<el-col :span="6"
:offset="5">
<el-form-item prop="phone"
label="个人手机">
<el-input v-model="form.phone"
placeholder="请输入手机号"
maxlength="11"></el-input>
<el-col :span="6" :offset="5">
<el-form-item prop="phone" label="个人手机">
<el-input v-model="form.phone" placeholder="请输入手机号" maxlength="11"></el-input>
</el-form-item>
<el-form-item prop="email"
label="邮箱">
<el-input v-model="form.email"
placeholder="请输入邮箱"
maxlength="11"></el-input>
<el-form-item prop="email" label="邮箱">
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="11"></el-input>
</el-form-item>
</el-col>
<el-col :span="6"
:offset="2">
<el-col :span="6" :offset="2">
<el-form-item label="唯一识别码">
<el-input v-model="form.uniqueIdentification"
disabled></el-input>
<el-input v-model="form.uniqueIdentification" disabled></el-input>
</el-form-item>
</el-col>
</el-col>
@ -62,8 +46,7 @@
</el-card>
<!-- 个人信息 -->
<el-card shadow="hover"
class="mgb20">
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-between mgb20 user_header">
<div class="flex-center">
@ -73,45 +56,26 @@
</div>
<div>
<el-form ref="form"
:model="form"
:rules="rules"
label-width="120px"
:disabled="isDetail">
<el-col :span="6"
:offset="5">
<el-form-item prop="userName"
label="用户姓名">
<el-input v-model="form.userName"
placeholder="请输入"></el-input>
<el-form ref="form" :model="form" :rules="rules" label-width="120px" :disabled="isDetail">
<el-col :span="6" :offset="5">
<el-form-item prop="userName" label="用户姓名">
<el-input v-model="form.userName" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="证件类型"
prop="documentType">
<el-select value="1"
clearable
placeholder="请选择证件类型"
style="width: 100%">
<el-option label="身份证"
value="1"></el-option>
<el-form-item label="证件类型" prop="documentType">
<el-select value="1" clearable placeholder="请选择证件类型" style="width: 100%">
<el-option label="身份证" value="1"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6"
:offset="2">
<el-form-item prop="phone"
label="手机号">
<el-input v-model="form.phone"
placeholder="请输入手机号"
maxlength="11"></el-input>
<el-col :span="6" :offset="2">
<el-form-item prop="phone" label="手机号">
<el-input v-model="form.phone" placeholder="请输入手机号" maxlength="11"></el-input>
</el-form-item>
<el-form-item prop="idNumber"
label="证件号码">
<el-input v-model="form.idNumber"
placeholder="请输入证件号码"
maxlength="18"></el-input>
<el-form-item prop="idNumber" label="证件号码">
<el-input v-model="form.idNumber" placeholder="请输入证件号码" maxlength="18"></el-input>
</el-form-item>
</el-col>
</el-form>
@ -120,8 +84,7 @@
</el-card>
<!-- 已绑定系统 -->
<el-card shadow="hover"
class="mgb20">
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="addhr_tag"></p>
@ -129,54 +92,23 @@
</div>
</div>
<el-table :data="platformList"
class="table"
stripe
header-align="center"
row-key="accountId">
<el-table-column type="index"
width="100"
label="序号"
align="center"></el-table-column>
<el-table-column prop="platformName"
label="平台名称"
align="center"></el-table-column>
<el-table-column prop="schoolName"
label="绑定组织名称"
align="center"></el-table-column>
<el-table-column prop="userName"
label="姓名"
align="center"></el-table-column>
<el-table-column prop="workNumber"
label="工号/学号"
align="center"></el-table-column>
<el-table-column prop="roleName"
label="角色"
align="center"></el-table-column>
<el-table-column prop="phoneBindingTime"
label="绑定时间"
align="center"></el-table-column>
<el-table-column prop="logInNumber"
label="登录次数"
align="center"></el-table-column>
<el-table-column prop="lastLoginTime"
label="上一次的登录时间"
align="center"></el-table-column>
<el-table-column label="操作"
align="center">
<el-table :data="platformList" class="table" stripe header-align="center" row-key="accountId">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="platformName" label="平台名称" align="center"></el-table-column>
<el-table-column prop="schoolName" label="绑定组织名称" align="center"></el-table-column>
<el-table-column prop="userName" label="姓名" align="center"></el-table-column>
<el-table-column prop="workNumber" label="工号/学号" align="center"></el-table-column>
<el-table-column prop="roleName" label="角色" align="center"></el-table-column>
<el-table-column prop="phoneBindingTime" label="绑定时间" align="center"></el-table-column>
<el-table-column prop="logInNumber" label="登录次数" align="center"></el-table-column>
<el-table-column prop="lastLoginTime" label="上一次的登录时间" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text"
@click="show(scope.row)">查看</el-button>
<el-button type="text"
@click="del(scope.row)">删除</el-button>
<el-switch v-if="scope.row.userId!==1"
v-model="scope.row.isEnable"
:active-value="1"
:inactive-value="0"
style="margin: 0 10px 0 5px"
:active-text="scope.row.isEnable ? '启用' : '禁用'"
@change="switchUser($event,scope.row,scope.$index)"
v-auth="'/user:启用'"></el-switch>
<el-button type="text" @click="show(scope.row)">查看</el-button>
<el-button type="text" @click="del(scope.row)">删除</el-button>
<el-switch v-if="scope.row.userId !== 1" v-model="scope.row.isEnable" :active-value="1"
:inactive-value="0" style="margin: 0 10px 0 5px" :active-text="scope.row.isEnable ? '启用' : '禁用'"
@change="switchUser($event, scope.row, scope.$index)" v-auth="'/user:启用'"></el-switch>
</template>
</el-table-column>
</el-table>
@ -215,8 +147,8 @@ export default {
methods: {
getdata () {
this.$get(this.api.viewUserDetailsforNakadai, { userId: this.userId }).then(({ result }) => {
const info = result.hrUserInfo
info.phone = result.userAccount.phone
const info = result.hrUserInfo || {}
if (result.userAccount) info.phone = result.userAccount.phone
// MD51313
if (info.phone) info.uniqueIdentification = md5(info.phone).slice(0, 13)
this.form = info
@ -245,9 +177,9 @@ export default {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.delUserAccounts, [row.userId]).then(res => {
this.$post(this.api.delUserAccountsByNakadai, [row.accountId]).then(res => {
this.$message.success('删除成功')
this.getData()
this.getdata()
}).catch(res => { })
}).catch(() => { })
},
@ -258,150 +190,184 @@ export default {
<style lang="scss" scoped>
.fold {
margin-top: 20px;
text-align: center;
img {
cursor: pointer;
&:hover {
opacity: 0.8;
}
margin-top: 20px;
text-align: center;
img {
cursor: pointer;
&:hover {
opacity: 0.8;
}
}
}
.arrowTransform {
transition: 0.5s;
transform-origin: center;
transform: rotateZ(180deg);
transition: 0.5s;
transform-origin: center;
transform: rotateZ(180deg);
}
.arrowTransformReturn {
transition: 0.5s;
transform-origin: center;
transform: rotateZ(0deg);
transition: 0.5s;
transform-origin: center;
transform: rotateZ(0deg);
}
//
.card ::v-deep .el-card {
border-radius: 15px;
border-radius: 15px;
}
.card_m {
margin: 10px 0 20px 0;
margin: 10px 0 20px 0;
}
::v-deep .el-dialog__title {
font-weight: 600;
font-weight: 600;
}
.region ::v-deep .el-form-item__label {
font-weight: 600;
font-weight: 600;
}
.region ::v-deep .el-input {
width: 30%;
width: 30%;
}
.numberInput {
display: inline-flex;
align-items: center;
span {
white-space: nowrap;
}
display: inline-flex;
align-items: center;
span {
white-space: nowrap;
}
}
.numberInput ::v-deep .el-input {
width: 80%;
width: 80%;
}
.stu_input ::v-deep .el-input {
width: 80%;
width: 80%;
}
.radio {
margin: 0 15px 0 30px;
font-weight: 600;
margin: 0 15px 0 30px;
font-weight: 600;
}
.jobNumber {
margin: 10px 0;
margin: 10px 0;
}
.jobNumber ::v-deep .el-input {
margin-left: 20px;
margin-left: 20px;
}
.icon_btn {
margin: 5px 5px 15px 0;
margin: 5px 5px 15px 0;
}
.flex_start {
display: flex;
justify-content: flex-start;
align-items: center;
display: flex;
justify-content: flex-start;
align-items: center;
}
.flex_end {
display: flex;
justify-content: flex-end;
align-items: center;
display: flex;
justify-content: flex-end;
align-items: center;
}
.flex {
display: flex;
align-items: center;
display: flex;
align-items: center;
}
.from_card {
margin-bottom: 20px;
margin-bottom: 20px;
}
.mgb20_top {
margin-top: 400px;
margin-top: 400px;
}
.mag {
margin-right: 20px;
margin-right: 20px;
}
.magr50 {
margin-left: 50px;
margin-left: 50px;
}
.font_same {
margin-left: 40px;
color: rgb(155, 179, 245);
font-size: 14px;
margin-left: 40px;
color: rgb(155, 179, 245);
font-size: 14px;
}
.school-item {
margin-bottom: 20px;
.school-name {
font-size: 16px;
font-weight: bold;
margin-bottom: 20px;
.school-name {
font-size: 16px;
font-weight: bold;
}
.port {
.port-name {
margin: 10px 0;
font-size: 15px;
color: #9076ff;
}
.port {
.port-name {
margin: 10px 0;
font-size: 15px;
color: #9076ff;
}
.fields {
.line {
display: flex;
margin-bottom: 10px;
li {
display: flex;
align-items: center;
margin-right: 80px;
.name {
font-size: 14px;
}
.val {
font-size: 14px;
font-weight: bold;
}
}
}
.fields {
.line {
display: flex;
margin-bottom: 10px;
li {
display: flex;
align-items: center;
margin-right: 80px;
.name {
font-size: 14px;
}
.val {
font-size: 14px;
font-weight: bold;
}
}
}
}
}
}
//
.scrollbar ::-webkit-scrollbar {
width: 2px; //
height: 6px; //
width: 2px; //
height: 6px; //
}
//
.scrollbar ::-webkit-scrollbar-thumb {
background-color: #9278ff;
border-radius: 3px;
box-shadow: inset 0 0 5px #dddddd;
background-color: #9278ff;
border-radius: 3px;
box-shadow: inset 0 0 5px #dddddd;
}
.scrollbar ::-webkit-scrollbar-track {
/*滚动条里面轨道*/
box-shadow: inset 0 0 5px #dddddd;
border-radius: 0;
background: #dddddd;
/*滚动条里面轨道*/
box-shadow: inset 0 0 5px #dddddd;
border-radius: 0;
background: #dddddd;
}
/deep/.el-input__inner {
height: 40px !important;
height: 40px !important;
}
</style>

@ -1,8 +1,6 @@
<template>
<div class="wrap"
v-loading="loading">
<el-card shadow="hover"
class="mgb20">
<div class="wrap" v-loading="loading">
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
@ -13,57 +11,35 @@
<el-row>
<el-col :span="5">
<el-form-item label="省份">
<el-select v-model="form.provinces"
clearable
placeholder="请选择省份"
@change="getCity"
@clear="clearprovince()">
<el-option v-for="(item,index) in provinceList"
:key="index"
:label="item.provinceName"
:value="item.provinceId"></el-option>
<el-select v-model="form.provinces" clearable placeholder="请选择省份" @change="getCity"
@clear="clearprovince()">
<el-option v-for="(item, index) in provinceList" :key="index" :label="item.provinceName"
:value="item.provinceId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="城市">
<el-select v-model="form.city"
clearable
placeholder="请选择城市"
:disabled="form.provinces ? false : true"
@clear="clearcity()"
@change="initData">
<el-option v-for="(item,index) in cityList"
:key="index"
:label="item.cityName"
:value="item.cityId"></el-option>
<el-select v-model="form.city" clearable placeholder="请选择城市" :disabled="form.provinces ? false : true"
@clear="clearcity()" @change="initData">
<el-option v-for="(item, index) in cityList" :key="index" :label="item.cityName"
:value="item.cityId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="来源">
<el-select v-model="form.platformId"
clearable
placeholder="请选择来源"
@change="initData">
<el-option v-for="item in platformList"
:key="item.value"
:label="item.label"
:value="item.value"></el-option>
<el-select v-model="form.platformId" clearable placeholder="请选择来源" @change="initData">
<el-option v-for="item in platformList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="学校">
<el-select v-model="form.schoolId"
clearable
filterable
placeholder="请选择学校"
@change="initData">
<el-option v-for="(item,index) in schoolList"
:key="index"
:label="item.schoolName"
:value="item.schoolId"></el-option>
<el-select v-model="form.schoolId" clearable filterable placeholder="请选择学校" @change="initData">
<el-option v-for="(item, index) in schoolList" :key="index" :label="item.schoolName"
:value="item.schoolId"></el-option>
</el-select>
</el-form-item>
</el-col>
@ -77,35 +53,24 @@
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="创建时间"
class="userRadio">
<el-form-item label="创建时间" class="userRadio">
<el-radio-group v-model="form.month">
<el-radio v-for="(item,index) in dateList"
:key="index"
:label="item.id"
border>{{item.name}}</el-radio>
<el-radio v-for="(item, index) in dateList" :key="index" :label="item.id" border>{{ item.name
}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="自定义">
<el-date-picker v-model="form.date"
align="right"
unlink-panels
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
clearable></el-date-picker>
<el-date-picker v-model="form.date" align="right" unlink-panels type="daterange"
start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
clearable></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="支持手机号,姓名"
prefix-icon="el-icon-search"
v-model="form.keyword"
clearable></el-input>
<el-input placeholder="支持手机号,姓名" prefix-icon="el-icon-search" v-model="form.keyword"
clearable></el-input>
</el-form-item>
</el-col>
</el-row>
@ -115,88 +80,45 @@
</div>
</el-card>
<el-card shadow="hover"
class="card">
<el-card shadow="hover" class="card">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="hr_tag"></p>
<span>用户列表</span>
</div>
<div>
<el-button type="primary"
round
@click="delAllSelection"
v-auth>批量删除</el-button>
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
</div>
</div>
<el-table :data="userData"
class="table"
ref="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="userId">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="100"
label="序号"
align="center"></el-table-column>
<el-table-column prop="userName"
label="姓名"
align="center"></el-table-column>
<el-table-column prop="phone"
label="手机号"
align="center"></el-table-column>
<el-table-column prop="schoolName"
label="学校"
align="center"></el-table-column>
<el-table-column prop="platformName"
label="来源"
align="center"></el-table-column>
<el-table-column prop="createTime"
label="创建时间"
width="150"
align="center"></el-table-column>
<el-table-column prop="logInNumber"
label="登录次数"
align="center"></el-table-column>
<el-table-column prop="lastLoginTime"
label="最近登录时间"
align="center"></el-table-column>
<el-table-column label="操作"
width="300"
align="center">
<el-table :data="userData" class="table" ref="table" stripe header-align="center"
@selection-change="handleSelectionChange" row-key="userId">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="userName" label="姓名" align="center"></el-table-column>
<el-table-column prop="phone" label="手机号" align="center"></el-table-column>
<el-table-column prop="schoolName" label="学校" align="center"></el-table-column>
<el-table-column prop="platformName" label="来源" align="center"></el-table-column>
<el-table-column prop="createTime" label="创建时间" width="150" align="center"></el-table-column>
<el-table-column prop="logInNumber" label="登录次数" align="center"></el-table-column>
<el-table-column prop="lastLoginTime" label="最近登录时间" align="center"></el-table-column>
<el-table-column label="操作" width="300" align="center">
<template slot-scope="scope">
<el-button type="text"
@click="toDetail(scope.row, 1)"
v-auth>查看</el-button>
<el-button v-if="scope.row.userId!==1"
type="text"
@click="handleDelete(scope.row)"
v-auth>删除</el-button>
<el-button type="text"
@click="resetPassword(scope.row)"
v-auth>重置密码</el-button>
<el-switch v-if="scope.row.userId!==1"
v-model="scope.row.isEnable"
:active-value="1"
:inactive-value="0"
style="margin: 0 10px 0 5px"
:active-text="scope.row.isEnable ? '启用' : '禁用'"
@change="switchOff($event,scope.row,scope.$index)"
v-auth="'/user:启用'"></el-switch>
<el-button type="text" @click="toDetail(scope.row, 1)" v-auth>查看</el-button>
<el-button v-if="scope.row.userId !== 1" type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
<el-button type="text" @click="resetPassword(scope.row)" v-auth>重置密码</el-button>
<!-- displayState 0禁用1启用2至少有一个状态为禁用变颜色展示为启用状态 -->
<el-switch v-if="scope.row.userId !== 1" :key="loading" v-model="scope.row.enable" :active-value="1"
:inactive-value="0" :class="{ error: scope.row.displayState === 2 }" style="margin: 0 10px 0 5px"
:active-text="scope.row.enable ? '启用' : '禁用'"
:active-color="scope.row.displayState === 2 ? '#ff552c' : '#9076FF'"
:inactive-color="scope.row.displayState === 2 ? '#ff552c' : '#dcdfe6'"
@change="switchOff($event, scope.row, scope.$index)" v-auth="'/user:启用'"></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background
@current-change="currentChange"
:current-page="page"
layout="total, prev, pager, next"
:total="totals">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next"
:total="totals">
</el-pagination>
</div>
</el-card>
@ -286,7 +208,8 @@ export default {
pageSize: 10,
totals: 0,
multipleSelection: [],
loading: false
loading: false,
};
},
watch: {
@ -326,7 +249,8 @@ export default {
},
methods: {
getData () {
let data = {
this.loading = true
this.$post(this.api.userManagementList, {
countries: this.form.countries,
provinceId: this.form.provinces,
cityId: this.form.city,
@ -339,29 +263,17 @@ export default {
searchContent: this.form.keyword,
pageNum: this.page,
pageSize: this.pageSize
}
this.loading = true
this.$post(this.api.queryUserInfoList, data).then(({ page, total }) => {
const promises = []
page.map(e => {
promises.push(new Promise((resolve, reject) => {
//
this.$get(this.api.viewUserDetailsforNakadai, { userId: e.userId }).then(({ result }) => {
const platList = result.bindingPlatformAndUserList
// 1->0->
e.isEnable = platList.find(e => e.isEnable) ? 1 : 0
e.userIds = platList.map(e => e.userId) // userId
resolve()
}).catch((res) => {
reject()
})
}))
})
Promise.all(promises).then(_ => {
this.userData = page
this.totals = total
this.loading = false
}).then(({ page }) => {
const { records, total } = page
records.map(e => {
e.enable = e.displayState
if (e.enable === 2) {
e.enable = 1
}
})
this.userData = records
this.totals = total
this.loading = false
}).catch(res => {
this.loading = false
})
@ -423,7 +335,7 @@ export default {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.delUserAccounts, row.userIds).then(res => {
this.$post(this.api.delUserAccountsByNakadai, row.accountIds).then(res => {
this.$message.success('删除成功')
this.getData()
}).catch(res => { })
@ -452,6 +364,7 @@ export default {
phone: row.phone
}).then(res => {
this.$message.success(val ? '启用成功' : '禁用成功')
this.getData()
}).catch(res => { })
},
//
@ -459,7 +372,7 @@ export default {
//
if (val) {
//
this.$post(`${this.api.oneClickEnableVerification}?accountId=${row.accountId}`).then(({ result }) => {
this.$post(`${this.api.oneClickEnableVerification}?accountIds=${row.accountIds}`).then(({ result }) => {
this.switchUser(val, row)
}).catch((res) => {
//
@ -482,16 +395,14 @@ export default {
},
delAllSelection () {
if (this.multipleSelection.length) {
let delList = this.multipleSelection.map(e => e.userId);
let ids = []
this.multipleSelection.map(e => {
ids.push(...e.accountIds)
})
this.$confirm('确定要删除选中用户吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.delUserAccounts, delList).then(res => {
if (delList.length == this.userData.length) {
if (this.page > 1) {
this.page = this.page - 1
}
}
this.$post(this.api.delUserAccountsByNakadai, ids).then(res => {
this.$message.success('删除成功')
this.$refs.table.clearSelection()
this.getData()
@ -509,23 +420,33 @@ export default {
<style lang="scss" scoped>
.el-form {
min-width: 1800px;
min-width: 1800px;
}
.card {
min-height: calc(100vh - 380px);
min-height: calc(100vh - 380px);
}
.el-form-item {
margin-bottom: 0;
/deep/.el-radio {
width: 87px;
text-align: center;
.el-radio__label {
padding-left: 0;
}
}
.el-radio.is-bordered + .el-radio.is-bordered {
margin-left: 0;
margin-bottom: 0;
/deep/.el-radio {
width: 87px;
text-align: center;
.el-radio__label {
padding-left: 0;
}
}
.el-radio.is-bordered+.el-radio.is-bordered {
margin-left: 0;
}
}
</style>
/deep/.error {
.el-switch__label.is-active {
color: #ff552c;
}
}
</style>

Loading…
Cancel
Save