Compare commits

..

No commits in common. 'master' and 'V2.4.8' have entirely different histories.

  1. 2
      .prettierrc
  2. 3518
      package-lock.json
  3. 13
      package.json
  4. 11
      public/index.html
  5. 22
      src/App.vue
  6. 65
      src/assets/css/main.css
  7. BIN
      src/assets/img/ach1.png
  8. BIN
      src/assets/img/ach2.png
  9. BIN
      src/assets/img/exts/pdf.png
  10. BIN
      src/assets/img/exts/pic.png
  11. BIN
      src/assets/img/exts/ppt.png
  12. BIN
      src/assets/img/exts/txt.png
  13. BIN
      src/assets/img/exts/video.png
  14. BIN
      src/assets/img/exts/word.png
  15. BIN
      src/assets/img/mini.jpg
  16. 1
      src/assets/img/right.svg
  17. 1
      src/assets/img/shrink.svg
  18. 1
      src/assets/img/tag-active.svg
  19. 1
      src/assets/img/tag.svg
  20. 1
      src/assets/img/wrong.svg
  21. 50
      src/components/Header.vue
  22. 53
      src/components/Sidebar.vue
  23. 28
      src/components/img-upload/Cropper.vue
  24. 139
      src/components/quill/index.vue
  25. 32
      src/components/upload/config.js
  26. 140
      src/components/upload/index.vue
  27. 40
      src/components/upload/upload.js
  28. 2
      src/const/match.js
  29. 50
      src/const/ques.js
  30. 34
      src/const/testPaper.js
  31. 4
      src/libs/aliyun/aliyun-oss-sdk-6.17.1.min.js
  32. 7
      src/libs/aliyun/aliyun-upload-sdk-1.5.6.min.js
  33. 59
      src/libs/util.js
  34. 56
      src/libs/zip.js
  35. 62
      src/router/index.js
  36. 14
      src/setting.js
  37. 32
      src/store/index.js
  38. 75
      src/utils/api.js
  39. 4
      src/utils/core.js
  40. 163
      src/utils/editor.js
  41. 22
      src/utils/http.js
  42. 25
      src/views/Home.vue
  43. 233
      src/views/Login.vue
  44. 480
      src/views/course/AddCurriculum.vue
  45. 208
      src/views/course/Curriculum.vue
  46. 284
      src/views/course/contentSettings.vue
  47. 816
      src/views/customer/AddCustomer.vue
  48. 96
      src/views/customer/Order.vue
  49. 115
      src/views/customer/customer.vue
  50. 69
      src/views/data/Introduce.vue
  51. 193
      src/views/devLogin.vue
  52. 99
      src/views/information/addArticle/index.vue
  53. 79
      src/views/information/columnManage/index.vue
  54. 95
      src/views/information/contentManage/contentList.vue
  55. 18
      src/views/information/contentManage/index.vue
  56. 22
      src/views/information/list/index.vue
  57. 144
      src/views/match/add/index.vue
  58. 299
      src/views/match/add/set.vue
  59. 334
      src/views/match/add/step1.vue
  60. 178
      src/views/match/add/step2.vue
  61. 351
      src/views/match/add/step3.vue
  62. 9
      src/views/match/add/step4.vue
  63. 211
      src/views/match/add/template.vue
  64. 406
      src/views/match/list/index.vue
  65. 630
      src/views/match/manage/abnormalTeam.vue
  66. 51
      src/views/match/manage/index.vue
  67. 93
      src/views/match/manage/matchArch.vue
  68. 660
      src/views/match/manage/matchArchList.vue
  69. 276
      src/views/match/manage/matchInfo.vue
  70. 69
      src/views/match/manage/matchProgress.vue
  71. 566
      src/views/match/manage/matchRank.vue
  72. 375
      src/views/match/manage/matchReport.vue
  73. 481
      src/views/match/manage/matchSignup.vue
  74. 64
      src/views/match/manage/notice.vue
  75. 69
      src/views/match/manage/noticeDetail.vue
  76. 675
      src/views/match/manage/otherArchList.vue
  77. 1059
      src/views/match/manage/theoryReport.vue
  78. 413
      src/views/match/manage/trialReport.vue
  79. 7
      src/views/match/preview/index.vue
  80. 1762
      src/views/order/AddOrder.vue
  81. 116
      src/views/order/Order.vue
  82. 156
      src/views/parner/rate.vue
  83. 113
      src/views/parner/staff.vue
  84. 49
      src/views/parnerOperation/index.vue
  85. 339
      src/views/parnerOperation/info.vue
  86. 339
      src/views/parnerOperation/learn.vue
  87. 139
      src/views/parnerOperation/learnMg.vue
  88. 221
      src/views/parnerOperation/mobileRole.vue
  89. 269
      src/views/parnerOperation/pcRole.vue
  90. 279
      src/views/parnerOperation/plan.vue
  91. 56
      src/views/parnerOperation/schemeSet.vue
  92. 268
      src/views/parnerOperation/staff.vue
  93. 50
      src/views/review/index.vue
  94. 125
      src/views/serve/Configure.vue
  95. 3
      src/views/serve/addModel.vue
  96. 2
      src/views/serve/backstage/index.vue
  97. 10
      src/views/serve/backstage/model.vue
  98. 9
      src/views/serve/backstage/sourceModel.vue
  99. 186
      src/views/serve/projectAdd.vue
  100. 87
      src/views/serve/projectList.vue
  101. Some files were not shown because too many files have changed in this diff Show More

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

3518
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -9,31 +9,21 @@
}, },
"dependencies": { "dependencies": {
"@tinymce/tinymce-vue": "^3.2.8", "@tinymce/tinymce-vue": "^3.2.8",
"ali-oss": "^6.18.1",
"axios": "^0.18.0", "axios": "^0.18.0",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"blueimp-md5": "^2.19.0", "blueimp-md5": "^2.19.0",
"clipboard": "^2.0.11", "clipboard": "^2.0.11",
"crypto-js": "^4.2.0",
"decimal.js": "^10.4.3",
"echarts": "^5.4.1", "echarts": "^5.4.1",
"element-theme": "^2.0.1", "element-theme": "^2.0.1",
"element-ui": "^2.13.0", "element-ui": "^2.13.0",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"image-conversion": "^2.1.1", "image-conversion": "^2.1.1",
"image-webpack-loader": "^8.1.0",
"js-cookie": "^3.0.1", "js-cookie": "^3.0.1",
"jsencrypt": "^3.3.2", "mavon-editor": "^2.6.17",
"jszip": "^3.10.1",
"lodash": "^4.17.21",
"mavon-editor": "^2.10.4",
"postcss-px2rem": "^0.3.0", "postcss-px2rem": "^0.3.0",
"px2rem-loader": "^0.1.9", "px2rem-loader": "^0.1.9",
"qs": "^6.11.2", "qs": "^6.11.2",
"sortablejs": "^1.14.0", "sortablejs": "^1.14.0",
"stompjs": "^2.3.3",
"tinymce-plugin": "0.0.3-beta.22",
"umy-ui": "^1.1.6",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-codemirror": "^4.0.6", "vue-codemirror": "^4.0.6",
"vue-cropper": "^0.5.8", "vue-cropper": "^0.5.8",
@ -42,7 +32,6 @@
"vue-quill-editor": "^3.0.6", "vue-quill-editor": "^3.0.6",
"vue-router": "^3.5.1", "vue-router": "^3.5.1",
"vue-schart": "^2.0.0", "vue-schart": "^2.0.0",
"vue-ueditor-wrap": "^2.5.6",
"vue-uuid": "^2.0.2", "vue-uuid": "^2.0.2",
"vuedraggable": "^2.17.0", "vuedraggable": "^2.17.0",
"vuex": "^3.1.2" "vuex": "^3.1.2"

@ -1,11 +1,11 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="深圳或然科技中台" /> <meta name="keywords" content="深圳或然科技中台">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<meta name="viewport" content="width=device-width, user-scalable=yes, shrink-to-fit=no" /> <script src="/styles/tinymce/tinymce.min.js"></script>
<title>深圳或然科技中台</title> <title>深圳或然科技中台</title>
</head> </head>
<body> <body>
@ -14,6 +14,5 @@
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
<script src="/dev/styles/tinymce/tinymce.min.js"></script>
</body> </body>
</html> </html>

@ -1,29 +1,13 @@
<template> <template>
<div id="app"> <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> <router-view></router-view>
</div> </div>
</template> </template>
<script> <script>
import Setting from '@/setting'
export default { export default {
name: 'App', name: 'App',
data () {
return {
Setting,
ip: localStorage.getItem('ip') ? +localStorage.getItem('ip') : 0,
};
},
created () { created () {
window.exitSystem = () => {
sessionStorage.removeItem('token')
location.reload()
}
//sessionStorage //sessionStorage
if (sessionStorage.getItem("store") ) { if (sessionStorage.getItem("store") ) {
this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(sessionStorage.getItem("store")))) this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(sessionStorage.getItem("store"))))
@ -33,12 +17,6 @@ export default {
window.addEventListener("beforeunload",()=>{ window.addEventListener("beforeunload",()=>{
sessionStorage.getItem("token") && sessionStorage.setItem("store",JSON.stringify(this.$store.state)) sessionStorage.getItem("token") && sessionStorage.setItem("store",JSON.stringify(this.$store.state))
}) })
},
methods: {
ipChange (val) {
localStorage.setItem('ip', val)
location.reload()
},
} }
} }
</script> </script>

@ -14,17 +14,10 @@ body,
} }
body { body {
min-width: 1200px;
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif; font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif;
font-size: 14px; font-size: 14px;
} }
.ip {
z-index: 1;
position: fixed;
top: 0;
left: 0;
}
a { a {
text-decoration: none; text-decoration: none;
} }
@ -276,6 +269,16 @@ li {
font-style: normal; font-style: normal;
} }
/* .link_upload .el-upload-list{
width: 30%;
} */
/*VueEditor*/
.ql-container {
min-height: 400px;
}
.ql-snow .ql-tooltip { .ql-snow .ql-tooltip {
transform: translateX(117.5px) translateY(10px) !important; transform: translateX(117.5px) translateY(10px) !important;
} }
@ -448,15 +451,12 @@ li {
.el-switch__label span { .el-switch__label span {
font-size: 12px; font-size: 12px;
} }
.m-r-5 { .m-b-20 {
margin-right: 5px; margin-bottom: 20px;
} }
.m-r-10 { .m-r-10 {
margin-right: 10px; margin-right: 10px;
} }
.m-b-20 {
margin-bottom: 20px;
}
@media (max-width: 720px) { @media (max-width: 720px) {
.el-message { .el-message {
min-width: auto !important; min-width: auto !important;
@ -464,7 +464,7 @@ li {
} }
} }
.el-tooltip__popper { .el-tooltip__popper {
max-width: 100% !important; max-width: 500px !important;
} }
.no-atTheMoment > .el-picker-panel__footer > .el-button--text:first-child { .no-atTheMoment > .el-picker-panel__footer > .el-button--text:first-child {
display: none; display: none;
@ -488,42 +488,3 @@ li {
.search-wrap .el-input__inner { .search-wrap .el-input__inner {
border-radius: 0; 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.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 88 KiB

@ -1 +0,0 @@
<?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>

Before

Width:  |  Height:  |  Size: 593 B

@ -1 +0,0 @@
<?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>

Before

Width:  |  Height:  |  Size: 766 B

@ -1 +0,0 @@
<?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>

Before

Width:  |  Height:  |  Size: 545 B

@ -1 +0,0 @@
<?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>

Before

Width:  |  Height:  |  Size: 545 B

@ -1 +0,0 @@
<?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>

Before

Width:  |  Height:  |  Size: 768 B

@ -1,29 +1,33 @@
<template> <template>
<div class="header flex-between"> <div class="header flex-between">
<div class="logo"> <div class="logo">
<img class="cursor" @click="goHome" src="../assets/img/logo.png"> <img class="cursor"
@click="goHome"
src="../assets/img/logo.png">
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="header-user-con"> <div class="header-user-con">
<div class="user" @click="toPerson"> <div class="user"
<el-avatar :size="40" :src="$store.state.avatar"></el-avatar> @click="toPerson">
<el-avatar :size="40"
:src="$store.state.avatar"></el-avatar>
<span class="user-avator">{{userName}}</span> <span class="user-avator">{{userName}}</span>
</div> </div>
<el-divider class="ml20" direction="vertical"></el-divider> <el-divider class="ml20"
<el-button type="text" class="ml20" @click="logout">退出</el-button> direction="vertical"></el-divider>
<el-button type="text"
class="ml20"
@click="loginout">退出</el-button>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import Bus from '@/libs/bus' import Bus from '@/libs/bus'
import Setting from '@/setting'
export default { export default {
data () { data () {
return { return {
timer: null, userName: ''
Setting,
userName: '',
}; };
}, },
mounted () { mounted () {
@ -35,10 +39,9 @@ export default {
this.$router.push('/person') this.$router.push('/person')
} }
}, },
async logout () { loginout () {
await this.$post(this.api.logout) localStorage.removeItem('ms_username');
localStorage.removeItem('ms_username') localStorage.removeItem('token');
localStorage.removeItem('token')
sessionStorage.clear() sessionStorage.clear()
location.reload() location.reload()
}, },
@ -80,24 +83,17 @@ export default {
// socket // socket
this.socket.onmessage = this.getMessage; this.socket.onmessage = this.getMessage;
}, },
//
heartbeatDetection () {
this.timer = setInterval(async () => {
sessionStorage.getItem('token') ? await this.$get(this.api.heartbeatDetection) : clearInterval(this.timer)
}, 58 * 1000)
},
getUserInfo () { getUserInfo () {
this.$get(this.api.queryUserInfoDetails).then(({ result }) => { this.$get(this.api.queryUserInfoDetails).then(({ result }) => {
this.initSocket(result.userAccount)
let userInfo = result.hrUserInfo let userInfo = result.hrUserInfo
if (userInfo.userAvatars) this.$store.commit('userAvatar', { avatar: userInfo.userAvatars }) if (userInfo.userAvatars) this.$store.commit('userAvatar', { avatar: userInfo.userAvatars })
this.userName = userInfo.userName this.userName = userInfo.userName
const { id } = result.userAccount const { id } = result.userAccount
id && this.$store.commit('SET_ACCOUNTID', id) id && this.$store.commit('SET_ACCOUNTID', id)
this.$store.commit('SET_USERNAME', this.userName) this.$store.commit('SET_USERNAME', this.userName)
this.initSocket(result.userAccount)
Setting.isPro && this.heartbeatDetection()
}).catch(err => { }) }).catch(err => { })
}, },
}, },
@ -112,66 +108,54 @@ export default {
font-size: 16px; font-size: 16px;
color: #333; color: #333;
} }
.header .logo { .header .logo {
float: left; float: left;
width: 170px; width: 170px;
height: 40px; height: 40px;
margin-left: 20px; margin-left: 20px;
} }
.header .logo img { .header .logo img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.header-right { .header-right {
float: right; float: right;
padding-right: 50px; padding-right: 50px;
} }
.header-user-con { .header-user-con {
display: flex; display: flex;
height: 70px; height: 70px;
align-items: center; align-items: center;
} }
.header-user-con .user { .header-user-con .user {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
} }
.user-avator { .user-avator {
cursor: pointer; cursor: pointer;
margin-left: 10px; margin-left: 10px;
font-size: 12px; font-size: 12px;
} }
.ml20 { .ml20 {
margin-left: 20px; margin-left: 20px;
} }
.user-avator img { .user-avator img {
display: block; display: block;
width: 40px; width: 40px;
height: 40px; height: 40px;
border-radius: 50%; border-radius: 50%;
} }
/deep/.header-right .el-button--text { /deep/.header-right .el-button--text {
color: #333; color: #333;
span { span {
font-size: 12px; font-size: 12px;
} }
} }
.header-right .el-divider--vertical { .header-right .el-divider--vertical {
width: 2px; width: 2px;
height: 15px; height: 15px;
} }
.header-right .el-divider { .header-right .el-divider {
background-color: #333; background-color: #333;
} }

@ -1,7 +1,16 @@
<template> <template>
<div> <div>
<el-menu class="sidebar-el-menu" :default-active="onRoutes" background-color="#324157" text-color="#bfcbd9" <el-menu
active-text-color="#9278FF" unique-opened mode="horizontal" router @select="handleSelect"> 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-for="item in menus">
<template v-if="item.subs"> <template v-if="item.subs">
<el-submenu :index="item.index" :key="item.index"> <el-submenu :index="item.index" :key="item.index">
@ -10,13 +19,23 @@
<span slot="title">{{ item.title }}</span> <span slot="title">{{ item.title }}</span>
</template> </template>
<template v-for="subItem in item.subs"> <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> <template slot="title">{{ subItem.title }}</template>
<el-menu-item v-for="(threeItem, i) in subItem.subs" :key="i" :index="threeItem.index">{{ <el-menu-item
threeItem.title v-for="(threeItem,i) in subItem.subs"
}}</el-menu-item> :key="i"
:index="threeItem.index"
>{{ threeItem.title }}</el-menu-item>
</el-submenu> </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> </template>
</el-submenu> </el-submenu>
</template> </template>
@ -89,7 +108,7 @@ export default {
title: '系统配置' title: '系统配置'
}, },
{ {
icon: 'el-icon-box', icon: 'el-icon-s-check',
index: '/parner', index: '/parner',
title: '合伙管理' title: '合伙管理'
}, },
@ -99,20 +118,10 @@ export default {
title: '合伙运营' title: '合伙运营'
}, },
{ {
icon: 'el-icon-shopping-cart-2', icon: 'el-icon-s-shop',
index: '/shop', index: '/shop',
title: '商城管理' title: '商城管理'
}, },
{
icon: 'el-icon-data-board',
index: '/theoryExam',
title: '考试平台'
},
{
icon: 'el-icon-document-copy',
index: '/review',
title: '评阅平台'
},
], ],
menus: [], menus: [],
onRoutes: this.$route.path onRoutes: this.$route.path
@ -129,15 +138,15 @@ export default {
} }
}, },
mounted() { mounted() {
// sessionStorage.getItem('sideBar') && this.handleSelect(sessionStorage.getItem('sideBar')) sessionStorage.getItem('sideBar') && this.handleSelect(sessionStorage.getItem('sideBar'))
sessionStorage.getItem('token') && this.getPer() // sessionStorage.getItem('token') && this.getPer() //
}, },
methods:{ methods:{
handleSelect(index){ handleSelect(index){
this.onRoutes = index this.onRoutes = index
this.$store.commit('setOrderParam', null)
this.$store.commit('setInfoTab', '1') this.$store.commit('setInfoTab', '1')
this.$store.commit('setColumnId', '') this.$store.commit('setColumnId', '')
this.$store.commit('setCompetitionCache', null)
sessionStorage.setItem('sideBar',index) sessionStorage.setItem('sideBar',index)
}, },
initMenu() { initMenu() {
@ -175,11 +184,9 @@ export default {
.sidebar::-webkit-scrollbar { .sidebar::-webkit-scrollbar {
width: 0; width: 0;
} }
.sidebar-el-menu:not(.el-menu--collapse) { .sidebar-el-menu:not(.el-menu--collapse) {
width: 100%; width: 100%;
} }
.sidebar > ul { .sidebar > ul {
height: 100%; height: 100%;
} }

@ -13,8 +13,8 @@
:can-move-box="option.canMoveBox" :can-move-box="option.canMoveBox"
:original="option.original" :original="option.original"
:auto-crop="option.autoCrop" :auto-crop="option.autoCrop"
:auto-crop-width="autoCropWidth" :auto-crop-width="option.autoCropWidth"
:auto-crop-height="autoCropHeight" :auto-crop-height="option.autoCropHeight"
:fixed-box="option.fixedBox" :fixed-box="option.fixedBox"
:fixed="fixed" :fixed="fixed"
:fixed-number="fixedNumber" :fixed-number="fixedNumber"
@ -85,16 +85,6 @@ export default {
fixed: { fixed: {
type: Boolean, type: Boolean,
default: true default: true
},
// (:80%)
autoCropWidth: {
type: Number,
default: 480
},
// (:80%)
autoCropHeight: {
type: Number,
default: 124
} }
}, },
data () { data () {
@ -102,13 +92,15 @@ export default {
previews: {}, // previews: {}, //
option: { option: {
img: '', // () img: '', // ()
size: 1, // (:1) size: 0.8, // (:1)
full: true, // true (:false) full: true, // true (:false)
outputType: 'png', // (:jpg) outputType: 'jpg', // (:jpg)
canMove: true, // (:true) canMove: true, // (:true)
original: false, // (:false) original: false, // (:false)
canMoveBox: true, // (:true) canMoveBox: true, // (:true)
autoCrop: true, // (:false) autoCrop: true, // (:false)
autoCropWidth: 480, // (:80%)
autoCropHeight: 124, // (:80%)
fixedBox: false, // (:false) fixedBox: false, // (:false)
fixed: true, // (:true) fixed: true, // (:true)
fixedNumber: [1, 0.26], // (:[1:1]) fixedNumber: [1, 0.26], // (:[1:1])
@ -133,7 +125,7 @@ export default {
}, },
updateImg (file) { updateImg (file) {
this.option.img = file.url this.option.img = file.url
// this.option.size = file.size / 1024 > 200 ? 0.9 : 0.95 this.option.size = file.size / 1024 > 200 ? 0.9 : 0.95
}, },
realTime (data) { realTime (data) {
// //
@ -147,9 +139,9 @@ export default {
const that = this const that = this
if (type === 'blob') { if (type === 'blob') {
this.$refs.cropper.getCropBlob(data => { this.$refs.cropper.getCropBlob(data => {
// compress(data, 1).then(res => { compress(data, 0.8).then(res => {
that.$emit('upload', data) that.$emit('upload', res)
// }) })
}) })
} else { } else {
this.$refs.cropper.getCropData(data => { this.$refs.cropper.getCropData(data => {

@ -1,21 +1,14 @@
<template> <template>
<div> <div class="quill" ref="quill" :class="classes">
<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> <div ref="editor" :style="styles" v-loading="loading"></div>
<Upload :max-size="1000" :limit="100" @beforeUpload="beforeUpload" @onSuccess="editorUploadSuccess" <el-upload
:headers="headers"
:action="this.api.fileupload"
:before-upload="beforeUpload"
:on-success="editorUploadSuccess"
style="display: none"> style="display: none">
<div slot="trigger"> <el-button class="editorUpload" type="primary">点击上传</el-button>
<el-button :id="'editorUpload' + index" type="primary">点击上传</el-button> </el-upload>
</div>
</Upload>
</div>
<mavon-editor class="md" v-model="mdVal" v-show="editorType == 1" ref="md" :ishljs="true" :subfield="false"
@change="mdChange" @imgAdd="imgAdd" />
</div> </div>
</template> </template>
@ -25,17 +18,9 @@ import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css'; import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css'; import 'quill/dist/quill.bubble.css';
import toolbarOptions from './options' import toolbarOptions from './options'
import { mavonEditor } from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
import Upload from '@/components/upload';
import Oss from '@/components/upload/upload.js'
export default { export default {
name: 'quill', name: 'quill',
components: {
Upload,
mavonEditor
},
props: { props: {
value: { value: {
type: String, type: String,
@ -65,31 +50,13 @@ export default {
*/ */
elseRead:{ elseRead:{
type:String,default:'false' type:String,default:'false'
}, }
//
index: {
type: Number,
default: 0
},
//
radio: {
type: Boolean,
default: false
},
//
type: {
type: String,
default: '0'
},
}, },
data () { data () {
const that = this
return { return {
headers: { headers: {
token: sessionStorage.getItem('token') token: sessionStorage.getItem('token')
}, },
editorType: '0',
mdVal: '',
Quill: null, Quill: null,
currentValue: '', currentValue: '',
options: { options: {
@ -103,7 +70,7 @@ export default {
'image': function (value) { 'image': function (value) {
if (value) { if (value) {
// iview // iview
document.querySelector("#editorUpload" + that.index).click(); document.querySelector('.editorUpload').click()
} else { } else {
this.Quill.format('image', false); this.Quill.format('image', false);
} }
@ -138,27 +105,20 @@ export default {
}, },
watch: { watch: {
type: {
handler (val) {
this.editorType = val
},
immediate: true
},
value: { value: {
handler (val) { handler (val) {
if (this.type == 0) {
if (val !== this.currentValue) { if (val !== this.currentValue) {
this.currentValue = val; this.currentValue = val;
if (this.Quill) { if (this.Quill) {
this.Quill.pasteHTML(this.value); this.Quill.pasteHTML(this.value);
} }
} }
}
if (!this.mdVal) this.mdVal = val
}, },
immediate: true immediate: true
} }
}, },
created(){
},
mounted () { mounted () {
this.init(); this.init();
// //
@ -167,7 +127,7 @@ export default {
children.padding = '0' children.padding = '0'
children.overflow = 'hidden' children.overflow = 'hidden'
children.height = '0' children.height = '0'
children.border = '0' children.borderTop = '0'
} }
}, },
beforeDestroy () { beforeDestroy () {
@ -175,12 +135,6 @@ export default {
this.Quill = null; this.Quill = null;
}, },
methods: { methods: {
//
typeChange (val) {
this.$emit('update:type', val)
if (!this.mdVal) this.mdVal = this.value
},
init () { init () {
const editor = this.$refs.editor; const editor = this.$refs.editor;
// //
@ -224,16 +178,20 @@ export default {
if (!file.type.match(/^image\/(gif|jpe?g|a?png|bmp)/i)) { if (!file.type.match(/^image\/(gif|jpe?g|a?png|bmp)/i)) {
return return
} }
// ossbase64 const param = new FormData()
Oss.upload(file).then(res => { param.append('file', file)
// base64
this.$post(this.api.fileupload, param, {
headers: { "Content-Type": "multipart/form-data" }
}).then(res => {
var range = ins.getSelection() var range = ins.getSelection()
if (range) { if (range) {
// //
ins.insertEmbed(range.index, 'image', res.url) ins.insertEmbed(range.index, 'image', res.data.filesResult.fileUrl)
// //
ins.setSelection(range.index + 1) ins.setSelection(range.index + 1)
} }
}) }).catch(res => {})
}); });
} }
}, false) }, false)
@ -241,12 +199,11 @@ export default {
beforeUpload(file){ beforeUpload(file){
this.loading = true this.loading = true
}, },
// quill editorUploadSuccess (res) {
editorUploadSuccess (file) {
// //
let quill = this.Quill let quill = this.Quill
// //
if (file.url) { if (res.data.filesResult.fileUrl) {
// //
let lengths; let lengths;
if ( quill.getSelection() == null){ if ( quill.getSelection() == null){
@ -255,7 +212,7 @@ export default {
lengths = quill.getSelection().index; lengths = quill.getSelection().index;
} }
// res // res
quill.insertEmbed(lengths, 'image', file.url) quill.insertEmbed(lengths, 'image', res.data.filesResult.fileUrl)
// //
quill.setSelection(lengths + 1) quill.setSelection(lengths + 1)
} else { } else {
@ -263,39 +220,19 @@ export default {
} }
this.loading = false this.loading = false
}, },
//
mdChange (val) {
this.$emit('input', val)
},
// markdown
imgAdd (pos, $file) {
let $vm = this.$refs.md
// oss
Oss.upload($file).then(res => {
$vm.$img2Url(pos, res.url);
})
},
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.type-radio {
margin-bottom: 20px;
}
.quill-no-border{ .quill-no-border{
.ql-toolbar.ql-snow{ .ql-toolbar.ql-snow{
border: none; border: none;
border-bottom: 1px solid #e8eaec; border-bottom: 1px solid #e8eaec;
} }
.ql-container.ql-snow{ .ql-container.ql-snow{
border: none; border: none;
} }
} }
.else{ .else{
.ql-toolbar.ql-snow{ .ql-toolbar.ql-snow{
height: 0; height: 0;
@ -304,10 +241,8 @@ export default {
border-top: 0; border-top: 0;
} }
} }
/deep/.ql-snow { /deep/.ql-snow {
position: relative; position: relative;
.ql-tooltip { .ql-tooltip {
position: absolute !important; position: absolute !important;
top: 0 !important; top: 0 !important;
@ -315,30 +250,4 @@ export default {
transform: translateY(10px); transform: translateY(10px);
} }
} }
.md {
max-height: 300px;
}
/deep/.v-note-wrapper .v-note-panel {
min-height: 200px;
}
/deep/.markdown-body {
ul {
list-style: disc;
li {
list-style: inherit;
}
}
ol {
list-style: decimal;
li {
list-style: inherit;
}
}
}
</style> </style>

@ -1,32 +0,0 @@
/**
* 阿里云oss配置
* */
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,140 +0,0 @@
<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">
<slot name="trigger">
<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>
<slot name="tip">
<p>支持扩展名.rar .zip .doc .docx .pdf .jpg...</p>
</slot>
</div>
</el-upload>
</template>
<script>
import OSS from 'ali-oss'
import OssConfig from './config.js'
import Util from '@/libs/util'
export default {
props: {
//
limit: {
type: Number,
default: 1
},
// (: Mb)
maxSize: {
type: Number,
default: 10
},
//
showFileList: {
type: Boolean,
default: true
},
//
fileList: {
type: Array,
default: () => []
},
// fileList使fileListfalse
changeFileList: {
type: Boolean,
default: true
},
//
onRemove: {
type: Function,
default: new Function()
},
},
data () {
return {
client: null,
uploading: false,
uploadProgress: 0,
showFiles: this.showFileList,
Oss: {},
};
},
mounted () {
this.initOss()
},
methods: {
// oss
async initOss () {
this.Oss = await OssConfig()
this.client = new OSS(this.Oss.config)
},
//
beforeUpload (file) {
const oversize = file.size / 1024 / 1024 < this.maxSize
if (!oversize) Util.warningMsg(`请上传小于${this.maxSize}MB的附件!`)
if (oversize) {
this.$emit('beforeUpload', file)
return true
} else {
return false
}
},
//
handleProgress (progress) {
this.uploadProgress = Number((progress * 100).toFixed(2))
},
//
async handleRequest ({ file }) {
try {
this.uploadProgress = 0
this.uploading = true
this.showFiles = false
// oss
const { name } = await this.client.multipartUpload(Date.now() + '.' + Util.getFileExt(file.name), file, {
progress: this.handleProgress
});
this.uploading = false
const url = this.Oss.preUrl + name
this.changeFileList && this.$emit('update:fileList', [
...this.fileList,
{
name: name,
url
}
])
this.showFiles = true
this.$emit('onSuccess', {
format: Util.getFileExt(file.name),
name: file.name,
url,
size: file.size,
})
} catch (error) { }
},
uploadError (err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
})
},
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleExceed (files, fileList) {
Util.warningMsg(`当前限制选择 ${this.limit} 个文件,如需更换,请删除上一个文件再重新选择!`);
},
}
};
</script>
<style lang="scss" scoped>
/deep/.upload-progress {
max-width: 300px;
margin: 10px 0;
white-space: nowrap;
}
</style>

@ -1,40 +0,0 @@
// 阿里云oss上传
import OSS from 'ali-oss'
import OssConfig from './config'
import Util from '@/libs/util'
let client = null
let Oss
// 初始化oss
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),
name: file.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(Oss.preUrl, ''));
}
}

@ -28,7 +28,7 @@
}, },
{ {
id: 2, id: 2,
name: '其它' name: '线下'
} }
], ],
teamCalculationMethods: [ teamCalculationMethods: [

@ -1,50 +0,0 @@
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: '问答题'
},
],
}

@ -1,34 +0,0 @@
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: '竞赛'
},
],
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,17 +1,13 @@
import cookies from './util.cookies' import cookies from './util.cookies'
import {_local,_session} from './util.db' import {_local,_session} from './util.db'
import { Message } from 'element-ui' import { Message } from 'element-ui'
import Setting from '@/setting'
import axios from 'axios'
import api from '@/utils/api'
// 文件后缀集合 // 文件后缀集合
const exts = { const exts = {
video: 'mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv', video: 'mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv',
audio: 'mp3,aac,ape,flac,wav,wma,amr,mid', audio: 'mp3,aac,ape,flac,wav,wma,amr,mid',
img: 'jpg,jpeg,png,gif,svg,psd', img: 'jpg,jpeg,png,gif,svg,psd',
doc: 'doc,docx,txt,xls,xlsx,csv,xml,ppt,pptx', doc: 'doc,docx,txt,xls,xlsx,csv,xml,ppt,pptx'
compress: 'zip,rar,7z,tar,gz,bz2',
} }
const util = { const util = {
cookies, cookies,
@ -90,11 +86,6 @@ const util = {
if (exts.doc.includes(ext)) return true; if (exts.doc.includes(ext)) return true;
return false; 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 if (!util.isVideo(ext) && !util.isAudio(ext) && !util.isImg(ext) && !util.isDoc(ext)) return false
@ -161,54 +152,6 @@ const util = {
preZero(num) { preZero(num) {
return num > 9 ? num : `0${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 export default util

@ -1,56 +0,0 @@
// 导出压缩包
import JSZip from 'jszip'
import FileSaver from 'file-saver'
//文件以流的形式获取(参数url为文件链接地址)
const getImgArrayBuffer = url => {
return new Promise((resolve, reject) => {
//通过请求获取文件blob格式
let xmlhttp = new XMLHttpRequest();
xmlhttp.open('GET', url, true);
xmlhttp.responseType = 'blob'
xmlhttp.onload = function () {
if (xmlhttp.status == 200) {
resolve(xmlhttp.response);
} else {
reject(xmlhttp.response);
}
};
xmlhttp.send();
});
}
/**
* @param {String} zipName 压缩包名字
* @param {Array} files 需要压缩的文件数组
* @param {Function | undefined} callback 回调
*/
export default function (zipName, files, callback) {
var zip = new JSZip();
var promises = [];
let cache = {};
for (let item of files) {
// item.filePath为文件链接地址
// item.fileName为文件名称
if(item.filePath) {
const promise = getImgArrayBuffer(item.filePath).then((data) => {
// 下载文件, 并存成ArrayBuffer对象(blob)
zip.file(item.fileName, data, { binary: true }); // 逐个添加文件
cache[item.fileName] = data;
});
promises.push(promise);
} else {
// 地址不存在时提示
console.log(`附件${item.fileName}地址错误,下载失败`);
}
}
Promise.all(promises).then(() => {
zip.generateAsync({ type: "blob" }).then((content) => {
// 生成二进制流
FileSaver.saveAs(content, zipName); // 利用file-saver保存文件 zipName: 自定义文件名
callback && callback()
});
}).catch((res) => {
console.log("文件压缩失败");
});
}

@ -19,123 +19,143 @@ let router = new Router({
{ {
path: '/customer', path: '/customer',
component: () => import( '../views/customer/customer.vue'), component: () => import( '../views/customer/customer.vue'),
// meta: { title: '客户管理' }
}, },
{ {
path: '/addcustomer', path: '/addcustomer',
component: () => import( '../views/customer/AddCustomer.vue'), component: () => import( '../views/customer/AddCustomer.vue'),
// meta: { title: '新增客户' }
}, },
{ {
path: '/bmOrder', path: '/bmOrder',
component: () => import( '../views/customer/Order.vue'), component: () => import( '../views/customer/Order.vue'),
// meta: { title: '新增客户' }
}, },
{ {
path: '/user', path: '/user',
component: () => import( '../views/user/User.vue'), component: () => import( '../views/user/User.vue'),
// meta: { title: '用户管理' }
}, },
{ {
path: '/adduser', path: '/adduser',
component: () => import( '../views/user/AddUser.vue'), component: () => import( '../views/user/AddUser.vue'),
// meta: { title: '新增用户' }
}, },
{ {
path: '/info', path: '/info',
component: () => import( '../views/user/Info.vue'), component: () => import( '../views/user/Info.vue'),
// meta: { title: '新增用户' }
}, },
{ {
path: '/order', path: '/order',
component: () => import( '../views/order/Order.vue'), component: () => import( '../views/order/Order.vue'),
// meta: { title: '订单管理' }
}, },
{ {
path: '/addorder', path: '/addorder',
component: () => import( '../views/order/AddOrder.vue'), component: () => import( '../views/order/AddOrder.vue'),
// meta: { title: '新增订单' }
}, },
{ {
path: '/selectClient', path: '/selectClient',
component: () => import( '../views/order/selectClient.vue'), component: () => import( '../views/order/selectClient.vue'),
// meta: { title: '选择订单客户' }
}, },
{ {
path: '/configure', path: '/configure',
component: () => import( '../views/serve/Configure.vue'), component: () => import( '../views/serve/Configure.vue'),
// meta: { title: '服务配置' }
}, },
{ {
path: '/backstage', path: '/backstage',
component: () => import( '../views/serve/backstage'), component: () => import( '../views/serve/backstage'),
// meta: { title: '服务配置' }
}, },
{ {
path: '/addModel', path: '/addModel',
component: () => import( '../views/serve/addModel'), component: () => import( '../views/serve/addModel'),
// meta: { title: '服务配置' }
}, },
{ {
path: '/addconfigure', path: '/addconfigure',
component: () => import( '../views/serve/AddConfigure.vue'), component: () => import( '../views/serve/AddConfigure.vue'),
// meta: { title: '新增配置' }
}, },
{ {
path: '/projectList', path: '/projectList',
component: () => import( '../views/serve/projectList.vue'), component: () => import( '../views/serve/projectList.vue'),
// meta: { title: '项目管理' }
}, },
{ {
path: '/projectAdd', path: '/projectAdd',
component: () => import( '../views/serve/projectAdd.vue'), component: () => import( '../views/serve/projectAdd.vue'),
// meta: { title: '项目配置' }
}, },
{ {
path: '/curriculum', path: '/curriculum',
component: () => import( '../views/course/Curriculum.vue'), component: () => import( '../views/course/Curriculum.vue'),
// meta: { title: '课程管理' }
}, },
{ {
path: '/addcurriculum', path: '/addcurriculum',
component: () => import( '../views/course/AddCurriculum.vue'), component: () => import( '../views/course/AddCurriculum.vue'),
// meta: { title: '新建课程' }
}, },
{ {
path: '/contentSettings', path: '/contentSettings',
component: () => import( '../views/course/contentSettings.vue'), component: () => import( '../views/course/contentSettings.vue'),
// meta: { title: '内容设置' }
}, },
{ {
path: '/addlink', path: '/addlink',
component: () => import( '../views/course/AddLink.vue'), component: () => import( '../views/course/AddLink.vue'),
// meta: { title: '添加环节' }
}, },
{ {
path: '/data', path: '/data',
component: () => import( '../views/data/Data.vue'), component: () => import( '../views/data/Data.vue'),
// meta: { title: '数据管理' }
}, },
{ {
path: '/match', path: '/match',
component: () => import( '../views/match/list'), component: () => import( '../views/match/list'),
// meta: { title: '数据管理' }
}, },
{ {
path: '/addMatch', path: '/addMatch',
component: () => import( '../views/match/add'), component: () => import( '../views/match/add'),
// meta: { title: '数据管理' }
}, },
{ {
path: '/matchManage', path: '/matchManage',
component: () => import( '../views/match/manage'), component: () => import( '../views/match/manage'),
// meta: { title: '数据管理' }
}, },
{ {
path: '/noticeDetail', path: '/noticeDetail',
component: () => import( '../views/match/manage/noticeDetail'), component: () => import( '../views/match/manage/noticeDetail'),
// meta: { title: '数据管理' }
}, },
{ {
path: '/otherArchList', path: '/matchArchList',
component: () => import('../views/match/manage/otherArchList'), component: () => import( '../views/match/manage/matchArchList'),
// meta: { title: '数据管理' }
}, },
{ {
path: '/matchRank', path: '/matchRank',
component: () => import( '../views/match/manage/matchRank'), component: () => import( '../views/match/manage/matchRank'),
// meta: { title: '数据管理' }
}, },
{ {
path: '/trialReport', path: '/matchReport',
component: () => import('../views/match/manage/trialReport'), component: () => import( '../views/match/manage/matchReport'),
}, // meta: { title: '数据管理' }
{
path: '/matchArchList',
component: () => import('../views/match/manage/matchArchList'),
},
{
path: '/theoryReport',
component: () => import('../views/match/manage/theoryReport'),
}, },
{ {
path: '/matchInfo', path: '/matchInfo',
component: () => import( '../views/match/manage/matchInfo'), component: () => import( '../views/match/manage/matchInfo'),
// meta: { title: '数据管理' }
}, },
{ {
path: `/theoreticalCourse`, path: `/theoreticalCourse`,
@ -170,26 +190,32 @@ let router = new Router({
{ {
path: '/system', path: '/system',
component: () => import( '../views/system'), component: () => import( '../views/system'),
// meta: { title: '数据管理' }
}, },
{ {
path: '/manageLog', path: '/manageLog',
component: () => import( '../views/system/manageLog'), component: () => import( '../views/system/manageLog'),
// meta: { title: '数据管理' }
}, },
{ {
path: '/addLog', path: '/addLog',
component: () => import( '../views/system/addLog'), component: () => import( '../views/system/addLog'),
// meta: { title: '数据管理' }
}, },
{ {
path: '/permission', path: '/permission',
component: () => import('../views/customer/Permission.vue'), component: () => import('../views/customer/Permission.vue'),
// meta: { title: '应用权限', permission: true }
}, },
{ {
path: '/person', path: '/person',
component: () => import('../views/setting'), component: () => import('../views/setting'),
// meta: { title: '个人中心' }
}, },
{ {
path: '/parner', path: '/parner',
component: () => import('../views/parner'), component: () => import('../views/parner'),
// meta: { title: '个人中心' }
}, },
{ {
path: '/parnerOperation', path: '/parnerOperation',
@ -211,18 +237,6 @@ let router = new Router({
path: '/shop/addProduct', path: '/shop/addProduct',
component: () => import('../views/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', path: '/404',
component: () => import('../views/404.vue'), component: () => import('../views/404.vue'),

@ -5,20 +5,16 @@ const url = location.host;
const isDev = process.env.NODE_ENV === 'development' // 开发环境 const isDev = process.env.NODE_ENV === 'development' // 开发环境
const isPro = url.includes('huorantech.cn') //正式服 const isPro = url.includes('huorantech.cn') //正式服
let jumpPath = `${location.origin}/panfen/` let jumpPath = `${location.origin}/judgmentPoint`
let sandPath = `http://121.37.12.51/sandbox` // 沙盘地址
let host = `${location.origin}/` let host = `${location.origin}/`
if (isDev) { if (isDev) {
jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统 jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统
// jumpPath = 'https://judgment.huorantech.cn/'
sandPath = `http://${location.hostname}:9520`
host = 'http://121.37.12.51/' host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/' // host = 'https://huorantech.cn/'
const ips = ['http://192.168.31.217:9000/', 'http://192.168.31.51:9000/', 'http://121.37.12.51/'] // host = 'http://192.168.31.152:9000/'// 榕
host = ips[+localStorage.getItem('ip')] // host = 'http://192.168.31.51:9000/'// 赓
} else if (isPro) { } else if (isPro) {
sandPath = `https://izhixinyun.com/sandbox` jumpPath = 'https://www.huorantech.cn/judgmentPoint/'
// jumpPath = 'https://judgment.huorantech.cn/'
} }
@ -28,9 +24,7 @@ const Setting = {
* */ * */
platformId: 3, // 平台标识,1职站,2数据平台,3中台,4合伙人 platformId: 3, // 平台标识,1职站,2数据平台,3中台,4合伙人
platformSource: 0, // 平台来源(0中台,1职站) platformSource: 0, // 平台来源(0中台,1职站)
autoLogoutTime: 1000 * 60 * 60 * 3, // 长时间未操作,自动退出登录时间
jumpPath, // 判分点系统跳转路径前缀 jumpPath, // 判分点系统跳转路径前缀
sandPath, // 沙盘地址
apiBaseURL: host, // 请求路径前缀 apiBaseURL: host, // 请求路径前缀
uploadURL: isDev ? 'http://121.37.12.51/' : location.origin + '/', // 阿里云oss域名 uploadURL: isDev ? 'http://121.37.12.51/' : location.origin + '/', // 阿里云oss域名
// 平台列表 // 平台列表

@ -21,13 +21,14 @@ const store = new Vuex.Store({
projectFields: {}, projectFields: {},
btns: [], btns: [],
routes: [], routes: [],
customerPage: 1,
matchPage: 1,
platformSource: 0,
columnId: '', columnId: '',
tabId: '1', tabId: '1',
dataPer: [], dataPer: [],
competitionCache: null,
referrer: '',
innerReferrer: '',
orderParam: null, orderParam: null,
competitionCache: null
}, },
actions: { actions: {
setSystemId({ state,commit },systemId) { setSystemId({ state,commit },systemId) {
@ -53,6 +54,15 @@ const store = new Vuex.Store({
SET_USERNAME (state, userName) { SET_USERNAME (state, userName) {
state.userName = userName state.userName = userName
}, },
SET_C_PAGE: (state, page) => {
state.customerPage = page
},
SET_M_PAGE: (state, page) => {
state.matchPage = page
},
SET_M_SOURCE: (state, platformSource) => {
state.platformSource = platformSource
},
courseData (state, payload) { courseData (state, payload) {
state.courseId = payload.course_id state.courseId = payload.course_id
}, },
@ -65,6 +75,10 @@ const store = new Vuex.Store({
configData (state, payload) { configData (state, payload) {
state.configId = payload.config_id state.configId = payload.config_id
}, },
systemData (state, payload) {
state.systemId = payload.system_id
state.orderId = payload.order_id
},
userLoginData (state, payload) { userLoginData (state, payload) {
state.userLoginId = payload.userLogin_id state.userLoginId = payload.userLogin_id
state.userName = payload.userName state.userName = payload.userName
@ -91,18 +105,12 @@ const store = new Vuex.Store({
setInfoTab: (state, tabId) => { setInfoTab: (state, tabId) => {
state.tabId = tabId state.tabId = tabId
}, },
setOrderParam: (state, orderParam) => {
state.orderParam = orderParam
},
setCompetitionCache: (state, param) => { setCompetitionCache: (state, param) => {
state.competitionCache = param state.competitionCache = param
}, },
setReferrer: (state, val) => {
state.referrer = val
},
setInnerReferrer: (state, val) => {
state.innerReferrer = val
},
setOrderParam: (state, val) => {
state.orderParam = val
},
} }
}); });

@ -1,7 +1,8 @@
import Setting from "@/setting"; import Setting from "@/setting";
const { uploadURL, apiBaseURL: host } = Setting const host = Setting.apiBaseURL
const jumpApi = Setting.isDev ? `http://121.37.12.51/` : Setting.isPro ? `https://judgment.huorantech.cn/` : `http://121.37.12.51/` const uploadURL = Setting.uploadURL
export default { export default {
logins: `users/users/user/login`, //登录 logins: `users/users/user/login`, //登录
@ -11,18 +12,8 @@ export default {
getUserRolesPermissionMenu: `users/users/user-role/getUserRolesPermissionMenu`, getUserRolesPermissionMenu: `users/users/user-role/getUserRolesPermissionMenu`,
deleteProfile : `users/users/userInfo/deleteProfile`, deleteProfile : `users/users/userInfo/deleteProfile`,
refreshPageNotification : `nakadai/message/refreshPageNotification`, refreshPageNotification : `nakadai/message/refreshPageNotification`,
heartbeatDetection: `nakadai/message/heartbeatDetection`,
getCurrentTime: `competition/competition/management/getCurrentTime`,
getToken: `users/users/user/getToken`,
logout: `users/users/user/logout`,
// 阿里云文件/视频管理
getPlayAuth: `nakadai/nakadai/oss/getPlayAuth`, // 获取播放凭证
encrypt: `nakadai/data/encrypt`,
staffTemplate: `https://occupationlab.com/template/%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E5%91%98%E5%B7%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 后台账号模板 staffTemplate: `http://www.huorantech.cn/template/%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E5%91%98%E5%B7%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 后台账号模板
competionPersonTemplate: `https://huoran.oss-cn-shenzhen.aliyuncs.com/%E4%B8%AD%E5%8F%B0%E4%B8%AA%E4%BA%BA%E8%B5%9B%E6%8A%A5%E5%90%8D%E4%BA%BA%E5%91%98%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 中台个人报名人员模板
competionTeamTemplate: `https://huoran.oss-cn-shenzhen.aliyuncs.com/%E4%B8%AD%E5%8F%B0%E5%9B%A2%E9%98%9F%E8%B5%9B%E6%8A%A5%E5%90%8D%E4%BA%BA%E5%91%98%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 中台团队报名人员模板
checkEmailOrPhone: `occupationlab/occupationlab/architecture/checkEmailOrPhone`, // 新增学生前:校验手机号或者邮箱 checkEmailOrPhone: `occupationlab/occupationlab/architecture/checkEmailOrPhone`, // 新增学生前:校验手机号或者邮箱
checkWorkNumOrAccount: `occupationlab/occupationlab/architecture/checkWorkNumOrAccount`, // 新增/编辑学生前:校验学号或者学生账号 checkWorkNumOrAccount: `occupationlab/occupationlab/architecture/checkWorkNumOrAccount`, // 新增/编辑学生前:校验学号或者学生账号
@ -39,7 +30,6 @@ export default {
getOrderOtherTime: `nakadai/nakadai/orderOther/getOrderOtherTime`, getOrderOtherTime: `nakadai/nakadai/orderOther/getOrderOtherTime`,
refreshCache: `data/data/myDate/refreshCache`, refreshCache: `data/data/myDate/refreshCache`,
getPartnerTeamRates: `nakadai/nakadai/partner-team/getPartnerTeamRates`, getPartnerTeamRates: `nakadai/nakadai/partner-team/getPartnerTeamRates`,
getCustomerOrderRecord: `nakadai/nakadai/order/getCustomerOrderRecord`,
// 客户管理 // 客户管理
delCustomers: `nakadai/nakadai/customer/delCustomers`, delCustomers: `nakadai/nakadai/customer/delCustomers`,
@ -55,12 +45,6 @@ export default {
orderBulkDisableEnable: `nakadai/nakadai/orderOther/orderBulkDisableEnable`, orderBulkDisableEnable: `nakadai/nakadai/orderOther/orderBulkDisableEnable`,
exportSubscribedRecords: `nakadai/nakadai/order/exportSubscribedRecords`, exportSubscribedRecords: `nakadai/nakadai/order/exportSubscribedRecords`,
addNewCustomersByOneself: `nakadai/nakadai/school/addNewCustomersByOneself`, addNewCustomersByOneself: `nakadai/nakadai/school/addNewCustomersByOneself`,
exportClient: `${host}nakadai/nakadai/customer/exportClient`,
customerSettingsList: `nakadai/nakadai/customer/customerSettingsList`,
clientSettingsEditClient: `nakadai/nakadai/customer/clientSettingsEditClient`,
delClientsOrSchools: `nakadai/nakadai/school/delClientsOrSchools`,
editClientsOrSchools: `nakadai/nakadai/school/editClientsOrSchools`,
userManagementList: `users/users/userAccount/userManagementList`,
resetPwdCustomer: `nakadai/nakadai/customer/resetPwd`, resetPwdCustomer: `nakadai/nakadai/customer/resetPwd`,
queryCustomerIsExists: `nakadai/nakadai/customer/queryCustomerIsExists`, queryCustomerIsExists: `nakadai/nakadai/customer/queryCustomerIsExists`,
@ -72,7 +56,7 @@ export default {
getBusinessManagerOrder: `nakadai/nakadai/customer/getBusinessManagerOrder`, getBusinessManagerOrder: `nakadai/nakadai/customer/getBusinessManagerOrder`,
// 用户管理 // 用户管理
delUserAccountsByNakadai: `users/users/userAccount/delUserAccountsByNakadai`, delUserAccounts: `users/users/userAccount/delUserAccounts`,
queryUserInfoDetails: `users/users/userAccount/queryUserInfoDetails`, queryUserInfoDetails: `users/users/userAccount/queryUserInfoDetails`,
personalFile: `users/users/userAccount/personalFile`, personalFile: `users/users/userAccount/personalFile`,
@ -106,8 +90,8 @@ export default {
editProjectDraft: `occupationlab/occupationlab/projectManage/editProjectDraft`, // 修改项目管理 editProjectDraft: `occupationlab/occupationlab/projectManage/editProjectDraft`, // 修改项目管理
copyProjectManage: `occupationlab/occupationlab/projectManage/copyProjectManage`, // 复制项目管理 copyProjectManage: `occupationlab/occupationlab/projectManage/copyProjectManage`, // 复制项目管理
// 判分点 // 判分点
getBcJudgmentPoint: `${host}judgment/judgment/bcJudgmentPoint/getBcJudgmentPoint`, // 获取编程类判分点列表(分页) getBcJudgmentPoint: `judgment/judgment/bcJudgmentPoint/getBcJudgmentPoint`, // 获取编程类判分点列表(分页)
getLcJudgmentPoint: `${host}judgment/judgment/lcJudgmentPoint/queryAllJudgmentPoint`, // 获取流程类判分点列表(分页) getLcJudgmentPoint: `judgment/judgment/lcJudgmentPoint/queryAllJudgmentPoint`, // 获取流程类判分点列表(分页)
addProjectJudgment: `occupationlab/occupationlab/projectJudgment/addProjectJudgment`, // 添加项目管理、判分点中间表 addProjectJudgment: `occupationlab/occupationlab/projectJudgment/addProjectJudgment`, // 添加项目管理、判分点中间表
updateProjectJudgment: `occupationlab/occupationlab/projectJudgment/updateProjectJudgment`, // 判分点中间表批量更新 updateProjectJudgment: `occupationlab/occupationlab/projectJudgment/updateProjectJudgment`, // 判分点中间表批量更新
deleteProjectJudgment: `occupationlab/occupationlab/projectJudgment/deleteProjectJudgment`, // 判分点中间表批量删除 deleteProjectJudgment: `occupationlab/occupationlab/projectJudgment/deleteProjectJudgment`, // 判分点中间表批量删除
@ -223,6 +207,14 @@ export default {
queryArticleByCondition: `occupationlab/occupationlab/information/article/queryArticleByCondition`, queryArticleByCondition: `occupationlab/occupationlab/information/article/queryArticleByCondition`,
articleSort: `occupationlab/occupationlab/information/article/articleSort`, articleSort: `occupationlab/occupationlab/information/article/articleSort`,
// 阿里云文件/视频管理
fileDeletion: `${uploadURL}oss/manage/fileDeletion`, // 删除OSS文件
fileupload: `${uploadURL}oss/manage/fileupload`, // 文件上传
getPlayAuth: `${uploadURL}oss/manage/getPlayAuth`, // 获取播放凭证
removeMoreVideo: `${uploadURL}oss/manage/removeMoreVideo`, // 批量删除视频文件
removeVideo: `${uploadURL}oss/manage/removeVideo`, // 删除视频文件
fileUploadNakadai: `${host}nakadai/nakadai/oss/fileUpload`,
queryProvince: `nakadai/nakadai/province/queryProvince`, //查询省份 queryProvince: `nakadai/nakadai/province/queryProvince`, //查询省份
queryCity: `nakadai/nakadai/city/queryCity`, //查询城市 queryCity: `nakadai/nakadai/city/queryCity`, //查询城市
@ -297,8 +289,6 @@ export default {
checkRepeat: `nakadai/nakadai/log/checkRepeat`, checkRepeat: `nakadai/nakadai/log/checkRepeat`,
logWithdrawal: `nakadai/nakadai/log/logWithdrawal`, logWithdrawal: `nakadai/nakadai/log/logWithdrawal`,
sysLogs: `occupationlab/sys/logs`,
// 合伙人 // 合伙人
deleteParner: `nakadai/nakadai/partnerClassification/delete`, deleteParner: `nakadai/nakadai/partnerClassification/delete`,
saveParner: `nakadai/nakadai/partnerClassification/save`, saveParner: `nakadai/nakadai/partnerClassification/save`,
@ -333,22 +323,6 @@ export default {
detailsOfCompetitionStage: `competition/competition/management/detailsOfCompetitionStage`, detailsOfCompetitionStage: `competition/competition/management/detailsOfCompetitionStage`,
entryInformation: `competition/competition/team/entryInformation`, entryInformation: `competition/competition/team/entryInformation`,
getRedisCacheCompetition: `competition/competition/management/getRedisCache`, getRedisCacheCompetition: `competition/competition/management/getRedisCache`,
copyCompetition: `competition/competition/management/copyCompetition`,
checkCustomerBySchool: `competition/competition/team/checkCustomerBySchool`,
updateEventAllocationRecord: `competition/competitionAutomaticAllocationRecord/updateEventAllocationRecord`,
editWhetherPopUpsAppear: `competition/competitionAutomaticAllocationRecord/editWhetherPopUpsAppear`,
automaticAllocation: `competition/competition/automaticAllocation/automaticAllocation`,
checkTeamStatus: `competition/teamAbnormalInformation/checkTeamStatus`,
queryAbnormalTeam: `competition/teamAbnormalInformation/queryAbnormalTeam`,
viewEventAllocationInformation: `competition/competitionAutomaticAllocationRecord/viewEventAllocationInformation`,
getCompetitionProjectByMiddleGround: `occupationlab/occupationlab/projectManage/getCompetitionProjectByMiddleGround`,
libraryList: `exam/exam/paperLibrary/libraryList`,
examPaperList: `exam/exam/paper/examPaperList`,
copyExamPaper: `exam/exam/paper/copyExamPaper`,
getDetailedExamScores: `exam/exam/paper/getDetailedExamScores`,
exportExamPaperReport: `exam/exam/paper/exportExamPaperReport`,
exportLabReport: `occupationlab/occupationlab/achievement/exportLabReport`,
exportBankExperimentReport: `occupationlab/occupationlab/achievement/exportBankExperimentReport`,
// 赛事内容 // 赛事内容
addCompetitionContent: `competition/competition/content/addCompetitionContent`, addCompetitionContent: `competition/competition/content/addCompetitionContent`,
@ -396,14 +370,6 @@ export default {
enquireAboutSchoolStudents: `users/users/userAccount/enquireAboutSchoolStudents`, enquireAboutSchoolStudents: `users/users/userAccount/enquireAboutSchoolStudents`,
cancelParticipant: `competition/competition/teamParticipant/cancelParticipant`, cancelParticipant: `competition/competition/teamParticipant/cancelParticipant`,
schoolsInCompetitionArea: `competition/competition/range/schoolsInCompetitionArea`, schoolsInCompetitionArea: `competition/competition/range/schoolsInCompetitionArea`,
batchDeleteApplicants: `competition/competition/registration/batchDeleteApplicants`,
deleteAllData: `competition/competition/registration/deleteAllData`,
whetherThereIsReport: `competition/competitionAutomaticAllocationRecord/whetherThereIsReport`,
closePopup: `competition/competitionAutomaticAllocationRecord/closePopup`,
batchImportPersonalData: `${host}competition/competition/registration/batchImportPersonalData`,
batchImportTeamData: `${host}competition/competition/registration/batchImportTeamData`,
TeamDataExportFailure: `${host}competition/competition/registration/exportFailure`,
exportAbnormalData: `${host}competition/teamAbnormalInformation/exportAbnormalData`,
// 赛事公告 // 赛事公告
addAnnouncement: `competition/competition/announcement/addAnnouncement`, addAnnouncement: `competition/competition/announcement/addAnnouncement`,
amendmentAnnouncement: `competition/competition/announcement/amendmentAnnouncement`, amendmentAnnouncement: `competition/competition/announcement/amendmentAnnouncement`,
@ -416,12 +382,9 @@ export default {
batchDeleteContestGrade: `competition/competition/performance/batchDeleteContestGrade`, batchDeleteContestGrade: `competition/competition/performance/batchDeleteContestGrade`,
batchImportGrades: `${host}competition/competition/performance/batchImportGrades`, batchImportGrades: `${host}competition/competition/performance/batchImportGrades`,
exportExperimentalResultsInBatch: `${host}competition/competition/performance/exportExperimentalResultsInBatch`, exportExperimentalResultsInBatch: `${host}competition/competition/performance/exportExperimentalResultsInBatch`,
exportExamPaperReports: `${host}exam/exam/paper/exportExamPaperReports`,
batchExportReportsAsZip: `${host}occupationlab/occupationlab/achievement/batchExportReportsAsZip`,
performanceExportFailure: `${host}competition/competition/performance/exportFailure`, performanceExportFailure: `${host}competition/competition/performance/exportFailure`,
rankExportFailure: `${host}competition/competition/rank/exportFailure`, rankExportFailure: `${host}competition/competition/rank/exportFailure`,
batchImportRanking: `${host}competition/competition/rank/batchImportRanking`, batchImportRanking: `${host}competition/competition/rank/batchImportRanking`,
getPaperUploadFileZip: `${host}exam/exam/paper/question/userAnswer/getPaperUploadFileZip`,
stageGradeManagementList: `competition/competition/performance/stageGradeManagementList`, stageGradeManagementList: `competition/competition/performance/stageGradeManagementList`,
stageRaceRanking: `competition/competition/rank/stageRaceRanking`, stageRaceRanking: `competition/competition/rank/stageRaceRanking`,
overallStandingsInThePointsRace: `competition/competition/rank/overallStandingsInThePointsRace`, overallStandingsInThePointsRace: `competition/competition/rank/overallStandingsInThePointsRace`,
@ -446,13 +409,6 @@ export default {
cancelCompetitionStageRankingTime: `competition/competitionReleaseTime/cancelCompetitionStageRankingTime`, cancelCompetitionStageRankingTime: `competition/competitionReleaseTime/cancelCompetitionStageRankingTime`,
getCompetitionStageRankingTime: `competition/competitionReleaseTime/getCompetitionStageRankingTime`, getCompetitionStageRankingTime: `competition/competitionReleaseTime/getCompetitionStageRankingTime`,
frontOfficeCompetitionRanking: `competition/competition/rank/frontOfficeCompetitionRanking`, frontOfficeCompetitionRanking: `competition/competition/rank/frontOfficeCompetitionRanking`,
cCompetitionStageFileList: `competition/cCompetitionStageFile/listByEntity`,
getPaperUploadFile: `exam/exam/paper/question/userAnswer/getPaperUploadFile`,
derive: `${host}competition/cCompetitionStageFile/deriveAll`,
allExperimentalResultsAreDerived: `${host}competition/competition/performance/allExperimentalResultsAreDerived`,
derivedRanking: `${host}competition/competition/rank/derivedRanking`,
individualDerivedRanking: `${host}competition/competition/rank/individualDerivedRanking`,
gradeDownloadExcel: `${host}competition/competition/performance/downloadExcel`,
gradeImport: `https://www.occupationlab.com/template/赛事成绩导入模板.xlsx`, gradeImport: `https://www.occupationlab.com/template/赛事成绩导入模板.xlsx`,
rankImportTeam: `https://www.occupationlab.com/template/赛事排名导入模板(团队赛).xlsx`, rankImportTeam: `https://www.occupationlab.com/template/赛事排名导入模板(团队赛).xlsx`,
rankImportPerson: `https://www.occupationlab.com/template/赛事排名导入模板(个人赛).xlsx`, rankImportPerson: `https://www.occupationlab.com/template/赛事排名导入模板(个人赛).xlsx`,
@ -515,7 +471,6 @@ export default {
goodsOffTheShelf: `nakadai/mall/goodsOffTheShelf`, goodsOffTheShelf: `nakadai/mall/goodsOffTheShelf`,
goodsSelection: `nakadai/mall/goodsSelection`, goodsSelection: `nakadai/mall/goodsSelection`,
queryCitySettlementPrice: `nakadai/mallPrice/queryCitySettlementPrice`, queryCitySettlementPrice: `nakadai/mallPrice/queryCitySettlementPrice`,
allSubjects: `nakadai/productTheme/allSubjects`,
// 营销推广 // 营销推广
delMarketing: `nakadai/nakadai/mall/marketing/promotion/batchDeletion`, delMarketing: `nakadai/nakadai/mall/marketing/promotion/batchDeletion`,

@ -1,3 +1,5 @@
import { Loading } from 'element-ui'
const pad2 = str => ('0' + str).substr(-2) const pad2 = str => ('0' + str).substr(-2)
function fMoney (s, n) { function fMoney (s, n) {
@ -203,6 +205,7 @@ function formatDate(fmt,date) {
// 传入文件名和路径,下载图片视频,支持跨域,a标签加download不支持跨域 // 传入文件名和路径,下载图片视频,支持跨域,a标签加download不支持跨域
function downloadFile(fileName, url) { function downloadFile(fileName, url) {
const loadIns = Loading.service()
var x = new XMLHttpRequest() var x = new XMLHttpRequest()
x.open("GET", url, true) x.open("GET", url, true)
x.responseType = "blob" x.responseType = "blob"
@ -212,6 +215,7 @@ function downloadFile(fileName, url) {
a.href = url a.href = url
a.download = fileName a.download = fileName
a.click() a.click()
loadIns.close()
} }
x.send() x.send()
} }

@ -1,14 +1,16 @@
import Oss from '@/components/upload/upload.js' import Axios from 'axios'
import Api from '@/utils/api'
import Setting from '@/setting'
import Util from '@/libs/util'
import { Loading } from 'element-ui' import { Loading } from 'element-ui'
export default { export default {
//skin:'oxide-dark', //skin:'oxide-dark',
language:'zh_CN', language:'zh_CN',
language_url: './styles/tinymce/langs/zh_CN.js', language_url: './styles/tinymce/langs/zh_CN.js',
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', 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 pastetext | forecolor backcolor headings fontsize lineHeight bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify | \ toolbar: 'code undo redo restoredraft | cut copy powerpaste 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 | \ styleselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \
table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | indent2em', table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | indent2em formatpainter',
style_formats: [ style_formats: [
//新增 首行缩进与行高 配置 //新增 首行缩进与行高 配置
{ {
@ -198,8 +200,107 @@ export default {
{ title: 'None', value: '' }, { title: 'None', value: '' },
{ title: 'Some class', value: 'class-name' } { title: 'Some class', value: 'class-name' }
], ],
//importcss_append: true,
//自定义文件选择器的回调内容
file_picker_callback: function (callback, value, meta) {
if (meta.filetype === 'file') {
callback('https://www.baidu.com/img/bd_logo1.png', { text: 'My text' });
}
if (meta.filetype === 'image') {
callback('https://www.baidu.com/img/bd_logo1.png', { alt: 'My alt text' });
}
if (meta.filetype === 'media') {
callback('movie.mp4', { source2: 'alt.ogg', poster: 'https://www.baidu.com/img/bd_logo1.png' });
}
},
//为内容模板插件提供预置模板 //为内容模板插件提供预置模板
templates: [], templates: [
{ title: '中文文章模板1', description: '图片文字流', content: `
<div class="tiny-wrap">
<div class="block">
<div class="fl">
<img class="pic" src="images/default.png"/>
<p class="img-des">图片描述</p>
</div>
<div class="texts">
<p>S³FEL主要由一台超导直线加速器波荡器光束线和实验站组成可产生重复频率达1MHz电子束能量达2.5 GeV的软X 射线自由电子激光可在百飞秒内级实现原子分子及外壳层电子结构的无损动态监测是科学家认识和了解物质微观结构及动态变化的高速摄像机S³FEL为科学家和企业用户提供了一种具有超高时间分辨空间分辨和能量分辨的新方法新技术 S³FEL在量子材料能源催化生物医药大气与星际科学原子分子科学等领域的应用研究将为促进我国战略性新兴产业创新发展和关键S³FEL主要由一台超导直线加速器波荡器光束线和实验站组成可产生重复频率达1MHz电子束能量达2.5 GeV的软X 射线自由电子激光可在百飞秒内级实现原子分子及外壳层电子结构的无损动态监测是科学家认识和了解物质微观结构及动态变化的高速摄像机S³FEL为科学家和企业用户提供了一种具有超高时间分辨空间分辨和能量分辨的新方法新技术 S³FEL在量子材料能源催化生物医药大气与星际科学原子分子科学等领域的应用研究将为促进我国战略性新兴产业创新发展和关键S³FEL主要由一台超导直线加速器波荡器光束线和实验站组成可产生重复频率达1MHz电子束能量达2.5 GeV的软X 射线自由电子激光可在百飞秒内级实现原子分子及外壳层电子结构的无损动态监测是科学家认识和了解物质微观结构及动态变化的高速摄像机S³FEL为科学家和企业用户提供了一种具有超高时间分辨空间分辨和能量分辨的新方法新技术 S³FEL在量子材料能源催化生物医药大气与星际科学原子分子科学等领域的应用研究将为促进我国战略性新兴产业创新发展和关键S³FEL主要由一台超导直线加速器波荡器光束线和实验站组成可产生重复频率达1MHz电子束能量达2.5 GeV的软X 射线自由电子激光可在百飞秒内级实现原子分子及外壳层电子结构的无损动态监测是科学家认识和了解物质微观结构及动态变化的高速摄像机S³FEL在量子材料能源催化生物医药大气与星际科学原子分子科学等领域的应用研究将为促进我国战略性新兴产业创新发展和关键S³FEL主要由一台超导直线加速器波荡器光束线和实验站组成可产生重复频率达1MHz电子束能量达2.5 GeV的软X 射线自由电子激光可在百飞秒内级实现原子分子及外壳层电子结构的无损动态监测是科学家认识和了解物质微观结构及动态变化的高速摄像机
</p>
</div>
</div>
<div class="block">
<div class="fr">
<img class="pic" src="images/default.png"/>
<p class="img-des">图片描述</p>
</div>
<div>
<p>集聚世界前沿和原创性科学技术及产业研发将推动一批高水平大学和科研机构的科技人才队伍建设及相关学科的高质量发展营造粤港澳大湾区人才高地并助力粤港澳大湾区国际科技创新中心的建设此外 S³FEL作为重要的科普教育基地</p>
<p>S³FEL汇聚并培养信息生命材料能源等学科领域的国际水平科技领军人才集聚世界前沿和原创性科学技术及产业研发将推动一批高水平大学和科研机构的科技人才队伍建设及相关学科的高质量发展营造粤港澳大湾区人才高地并助力粤港澳大湾区国际科技创新中心的建设此外 S³FEL作为重要的科普教育基地是展示我国科技实力提高全民族科学素质和民族自信的重要宣传窗口 S³FEL主体建筑将成为深圳市地标式建筑促进提升深圳市的城市形象和国际化知名度S³FEL汇聚并培养信息生命材料能源等学科领域的国际水平科技领军人才集聚世界前沿和原创性科学技术及产业研发将推动一批高水平大学和科研机构的科技人才队伍建设及相关学科的高质量发展营造粤港澳大湾区人才高地并助力粤港澳大湾区国际科技创新中心的建设此外 S³FEL作为重要的科普教育基地是展示我国科技实力提高全民族科学素质和民族自信的重要宣传窗口 S³FEL主体建筑将成为深圳市地标式建筑促进提升深圳市的城市形象和国际化知名度S³FEL汇聚并培养信息生命材料能源等学科领域的国际水平科技领军人才集聚世界前沿和原创性科学技术及产业研发将推动一批高水平大学和科研机构的科技人才队伍建设及相关学科的高质量发展营造粤港澳大湾区人才高地并助力粤港澳大湾区国际科技创新中心的建设此外 S³FEL作为重要的科普教育基地是展示我国科技实力提高全民族科学素质和民族自信的重要宣传窗口 S³FEL主体建筑将成为深圳市地标式建筑促进提升深圳市的城市形象和国际化知名度</p>
</div>
</div>
</div>
`
},
{ title: '英文文章模板1', description: '图片文字流', content: `
<div class="tiny-wrap">
<div class="block en-block">
<div class="fr">
<img class="pic" src="images/default.png"/>
<p class="img-des">Picture description</p>
</div>
<div>
<p>One of the major barriers to treating pain effectively is rooted in providers fear of killing their patients. This includes caregivers who may be family or friends. In a 2014 study I led of nonprofessional hospice caregivers, we found that the majority of pain medication errors caregivers made involved administering less than the prescribed dose, which makes it difficult for patients to achieve optimal pain relief.</p>
<p>Meanwhile, more than 11 million Americans  often family members or friends provide unpaid care for people with Alzheimer's or other dementias, according to calculations by the Alzheimers Association. In 2021, caregivers for people with Alzheimers or other dementias provided an estimated 16 billion hours of unpaid care valued at nearly $272 billion.My father took her to the emergency room. A doctor found a severe knee infection and took her into surgery. She was hospitalized for two weeks, followed by two months of rehabilitation at a skilled nursing facility.</p>
<p>If you heated the salt on your kitchen table up to 801 C (1,474 F), it would melt, and youd have molten salt. However, for making and storing energy, not just any salt will do. Scientists are exploring different combinations of salts to get the exact properties needed to cool and fuel a nuclear power reactor efficiently for decades. These properties include lower melting temperatures, the right consistency, and the ability to absorb high amounts of heat, among others.</p>
<div class="quote">We used experimental results to validate our simulation. At the same time, the simulation results provided us more details about which salts to study further. They work with each other. Jicheng Guo, chemical engineer at Argonne National Laboratory</div>
<p>Which molten salt blueprints will deliver the desired traits for a nuclear reactor? The potential variations are nearly endless. The study set out to determine whether computer simulations driven by machine learning could guide and refine real-world experiments at the Advanced Photon Source (APS), a DOE Office of Science user facility at Argonne. The results were recently published in the journal Physical Review B.</p>
<p>We used experimental results from the APS to validate our simulation. At the same time, the simulation results provided us more details about which salts to study further. They work with each other, said Jicheng Guo, a chemical engineer at Argonne and the papers lead author. This allows us to study multiple compositions at the same time.</p>
</div>
</div>
</div>
`
},
{ title: '新闻模板', description: '', content: `
<div class="tiny-wrap">
<div class="block" style="margin-bottom: 70px;">
<div class="fr">
<img class="pic" src="images/default.png"/>
<p class="img-des">图片描述</p>
</div>
<div>
<p style="text-indent: 2em">S³FEL汇聚并培养信息生命材料能源等学科领域的国际水平科技领军人才集聚世界前沿和原创性科学技术及产业研发将推动一批高水平大学和科研机构的科技人才队伍建设及相关学科的高质量发展营造粤港澳大湾区人才高地并助力粤港澳大湾区国际科技创新中心的建设此外 S³FEL作为重要的科普教育基地是展示我国科技实力提高全民族科学素质和民族自信的重要宣传窗口 S³FEL主体建筑将成为深圳市地标式建筑促进提升深圳市的城市形象和国际化知名度S³FEL汇聚并培养信息生命材料能源等学科领域的国际水平科技领军人才集聚世界前沿和原创性科学技术及产业研发将推动一批高水平大学和科研机构的科技人才队伍建设及相关学科的高质量发展营造粤港澳大湾区人才高地并助力粤港澳大湾区国际科技创新中心的建设此外 S³FEL作为重要的科普教育基地是展示我国科技实力提高全民族科学素质和民族自信的重要宣传窗口 S³FEL主体建筑将成为深圳市地标式建筑促进提升深圳市的城市形象和国际化知名度S³FEL汇聚并培养信息生命材料能源等学科领域的国际水平科技领军人才集聚世界前沿和原创性科学技术及产业研发将推动一批高水平大学和科研机构的科技人才队伍建设及相关学科的高质量发展营造粤港澳大湾区人才高地并助力粤港澳大湾区国际科技创新中心的建设此外 S³FEL作为重要的科普教育基地是展示我国科技实力提高全民族科学素质和民族自信的重要宣传窗口 S³FEL主体建筑将成为深圳市地标式建筑促进提升深圳市的城市形象和国际化知名度</p>
<div class="quote">
Here is a long quotation here is a long quotation here is a long quotation
here is a long quotation here is a long quotation here is a long quotation
here is a long quotation here is a long quotation here is a long quotation.
</div>
</div>
</div>
<div class="block">
<div class="img-wrap">
<img class="pic" src="images/default.png"/>
<p class="img-des">图片描述</p>
</div>
<div class="texts">
<h6 class="tiny-title">小标题</h6>
<p style="text-indent: 2em">S³FEL主要由一台超导直线加速器波荡器光束线和实验站组成可产生重复频率达1MHz电子束能量达2.5 GeV的软X 射线自由电子激光可在百飞秒内级实现原子分子及外壳层电子结构的无损动态监测是科学家认识和了解物质微观结构及动态变化的高速摄像机S³FEL为科学家和企业用户提供了一种具有超高时间分辨空间分辨和能量分辨的新方法新技术 S³FEL在量子材料能源催化生物医药大气与星际科学原子分子科学等领域的应用研究将为促进我国战略性新兴产业创新发展和关键S³FEL主要由一台超导直线加速器波荡器光束线和实验站组成可产生重复频率达1MHz电子束能量达2.5 GeV的软X 射线自由电子激光可在百飞秒内级实现原子分子及外壳层电子结构的无损动态监测是科学家认识和了解物质微观结构及动态变化的高速摄像机S³FEL为科学家和企业用户提供了一种具有超高时间分辨空间分辨和能量分辨的新方法新技术 S³FEL在量子材料能源催化生物医药大气与星际科学原子分子科学等领域的应用研究将为促进我国战略性新兴产业创新发展和关键
</p>
</div>
</div>
</div>
`
},
{ title: '图片描述', description: '', content: `
<div class="tiny-wrap">
<div class="block">
<div class="img-wrap">
<img class="pic" src="images/default.png"/>
<p class="img-des">图片描述</p>
</div>
</div>
</div>
`
}
],
// content_security_policy: "https://cdn.tiny.cloud/1/rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda/tinymce/6/tinymce.min.js", // content_security_policy: "https://cdn.tiny.cloud/1/rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda/tinymce/6/tinymce.min.js",
// extended_valid_elements:'script[src]', // extended_valid_elements:'script[src]',
// //
@ -214,25 +315,21 @@ export default {
powerpaste_allow_local_images: true, powerpaste_allow_local_images: true,
powerpaste_word_import: 'clean', powerpaste_word_import: 'clean',
powerpaste_html_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
},
// 自定义上传 // 自定义上传
images_upload_handler: function (blobInfo, succFun, failFun) { images_upload_handler: function (blobInfo, succFun, failFun) {
const blob = blobInfo.blob() const form = new FormData()
// blob转换为file form.append('file', blobInfo.blob()),
const file = new File([blob], blobInfo.filename(), { Axios({
type: 'application/json', method: 'post',
lastModified: Date.now() url: Api.fileUploadNakadai,
}); data: form,
Oss.upload(file).then(res => { headers: {
succFun(res.url) 'Content-Type': 'multipart/form-data',
}) token: Util.local.get(Setting.tokenKey)
},
}).then(({ data }) => {
succFun(data.filesResult.fileUrl)
}).catch(res => {})
}, },
//自定义文件选择器的回调内容 此方法只有在点击上方图片按钮才会触发 //自定义文件选择器的回调内容 此方法只有在点击上方图片按钮才会触发
file_picker_callback: function (callback, value, meta) { file_picker_callback: function (callback, value, meta) {
@ -250,11 +347,21 @@ export default {
input.setAttribute("accept", ".mp4"); input.setAttribute("accept", ".mp4");
input.onchange = function(){ input.onchange = function(){
let file = this.files[0]; let file = this.files[0];
let fd = new FormData();
fd.append("file", file);
const load = Loading.service() const load = Loading.service()
Oss.upload(file).then(res => { Axios({
method: 'post',
url: Api.fileUploadNakadai,
data: fd,
headers: {
'Content-Type': 'multipart/form-data',
token: Util.local.get(Setting.tokenKey)
},
}).then(({ data }) => {
load.close() load.close()
callback(res.url) callback(data.filesResult.fileUrl)
}).catch(e => { }).catch(res => {
load.close() load.close()
}) })
} }
@ -266,8 +373,8 @@ export default {
setup: function(editor) { setup: function(editor) {
editor.on('init', function(ed) { editor.on('init', function(ed) {
// 设置默认字体 // 设置默认字体
ed.target.editorCommands.execCommand("fontName", false, "PingFang SC") ed.target.editorCommands.execCommand("fontName", false, "Microsoft Yahei")
ed.target.editorCommands.execCommand("fontSize", false, "16px") ed.target.editorCommands.execCommand("fontSize", false, "19px")
ed.target.editorCommands.execCommand("lineHeight", false, "1.5") ed.target.editorCommands.execCommand("lineHeight", false, "1.5")
const el = top.document.querySelector('#focus-el') const el = top.document.querySelector('#focus-el')
el && el.focus() // 第一个字段聚焦 el && el.focus() // 第一个字段聚焦

@ -30,12 +30,11 @@ axios.interceptors.request.use(config => {
return Promise.reject(err); return Promise.reject(err);
}) })
let logouted = 0;
// 响应拦截器 // 响应拦截器
axios.interceptors.response.use( axios.interceptors.response.use(
response => { response => {
if (response.status === 200) { if (response.status === 200) {
const { status, code, msg } = response.data const { status } = response.data
if (status) { if (status) {
// 接口定义的非正常返回的时候,应当处于报错状态 // 接口定义的非正常返回的时候,应当处于报错状态
if (status === 10020) { if (status === 10020) {
@ -47,22 +46,6 @@ axios.interceptors.response.use(
} else { } else {
return Promise.resolve(response) return Promise.resolve(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 { } else {
return Promise.resolve(response) return Promise.resolve(response)
} }
@ -79,7 +62,6 @@ axios.interceptors.response.use(
// 未登录则跳转登录页面,并携带当前页面的路径 // 未登录则跳转登录页面,并携带当前页面的路径
// 在登录成功后返回当前页面,这一步需要在登录页操作。 // 在登录成功后返回当前页面,这一步需要在登录页操作。
case 401: case 401:
if (!logouted) {
Message.error('登录过期,请重新登录!'); Message.error('登录过期,请重新登录!');
setTimeout(() => { setTimeout(() => {
router.replace({ router.replace({
@ -89,8 +71,6 @@ axios.interceptors.response.use(
} }
}); });
}, 1000); }, 1000);
logouted = 1
}
break; break;
// 403 token过期 // 403 token过期
// 登录过期对用户进行提示 // 登录过期对用户进行提示

@ -18,8 +18,6 @@
<script> <script>
import vHead from '../components/Header.vue'; import vHead from '../components/Header.vue';
import vSidebar from '../components/Sidebar.vue'; import vSidebar from '../components/Sidebar.vue';
import Setting from "@/setting";
import util from "@/libs/util";
export default { export default {
data() { data() {
return { return {
@ -31,29 +29,6 @@ export default {
vSidebar, vSidebar,
}, },
created() { created() {
// this.autoLogout()
},
methods: {
// ,退
autoLogout () {
let lastTime = new Date().getTime();
document.onmousedown = () => {
lastTime = new Date().getTime();
};
const timer = setInterval(() => {
if (sessionStorage.getItem('token') && (new Date().getTime() - lastTime) > Setting.autoLogoutTime) {
clearInterval(timer)
util.errorMsg("由于您已经有三个小时没有操作,系统自动登出,请重新登录。页面刷新到登录页。");
setTimeout(() => {
localStorage.removeItem('ms_username');
localStorage.removeItem('token');
sessionStorage.clear()
location.reload()
}, 1500);
}
}, 1000);
}
} }
}; };
</script> </script>

@ -13,17 +13,24 @@
<el-menu-item index="1">账号登录</el-menu-item> <el-menu-item index="1">账号登录</el-menu-item>
<el-menu-item index="2">手机号/邮箱登录</el-menu-item> <el-menu-item index="2">手机号/邮箱登录</el-menu-item>
</el-menu> </el-menu>
<el-form v-show="activeIndex === '1'" :model="param" :rules="rules" ref="login" label-width="0px" <el-form v-show="activeIndex==='1'" :model="param" :rules="rules" ref="login" label-width="0px" style="margin-top: 40px">
style="margin-top: 20px">
<el-form-item prop="account"> <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>
<el-form-item prop="password"> <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-input>
</el-form-item> </el-form-item>
<el-form-item prop="code" v-if="showVerify"> <el-form-item prop="code" v-if="showVerify">
<el-input placeholder="请输入验证码" v-model="param.code" @keyup.enter.native="submitForm()"> <el-input
placeholder="请输入验证码"
v-model="param.code"
@keyup.enter.native="submitForm()"
>
</el-input> </el-input>
<img @click="blur" :src="verificationIMG" class="verification" alt=""> <img @click="blur" :src="verificationIMG" class="verification" alt="">
</el-form-item> </el-form-item>
@ -36,17 +43,24 @@
</div> </div>
</el-form> </el-form>
<el-form v-show="activeIndex === '2'" :model="phoneOrEmail" :rules="phoneOrEmailrules" ref="phoneOrEmail" <el-form v-show="activeIndex==='2'" :model="phoneOrEmail" :rules="phoneOrEmailrules" ref="phoneOrEmail" label-width="0px" style="margin-top: 40px">
label-width="0px" style="margin-top: 20px">
<el-form-item prop="account"> <el-form-item prop="account">
<el-input @blur="phoneBlur" v-model="phoneOrEmail.workNumber" placeholder="请输入电话/邮箱"></el-input> <el-input @blur="phoneBlur" v-model="phoneOrEmail.account" placeholder="请输入电话/邮箱"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <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-input>
</el-form-item> </el-form-item>
<el-form-item prop="code" v-if="showPhoneVerify"> <el-form-item prop="code" v-if="showPhoneVerify">
<el-input placeholder="请输入验证码" v-model="phoneOrEmail.code" @keyup.enter.native="submitForm('phone')"> <el-input
placeholder="请输入验证码"
v-model="phoneOrEmail.code"
@keyup.enter.native="submitForm('phone')"
>
</el-input> </el-input>
<img @click="phoneBlur" :src="PhoneVerificationIMG" class="verification" alt=""> <img @click="phoneBlur" :src="PhoneVerificationIMG" class="verification" alt="">
</el-form-item> </el-form-item>
@ -70,8 +84,7 @@
<el-form-item label="验证码"> <el-form-item label="验证码">
<div style="display:flex;"> <div style="display:flex;">
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input> <el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input>
<el-button style="margin-left:10px" @click="sendPhoneCode" :disabled="phoneDisabled">{{ phoneBtnText <el-button style="margin-left:10px" @click="sendPhoneCode" :disabled="phoneDisabled">{{phoneBtnText}}</el-button>
}}</el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -80,21 +93,6 @@
<el-button type="primary" @click="phoneSubmit"> </el-button> <el-button type="primary" @click="phoneSubmit"> </el-button>
</span> </span>
</el-dialog> </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> <v-footer class="footer" ref="footer"></v-footer>
</div> </div>
</template> </template>
@ -103,8 +101,6 @@
import vFooter from '../components/Footer' import vFooter from '../components/Footer'
import Setting from '@/setting' import Setting from '@/setting'
import addRoutes from '@/libs/route/addRoutes' import addRoutes from '@/libs/route/addRoutes'
import CryptoJS from 'crypto-js'
import JSEncrypt from 'jsencrypt'
export default { export default {
data: function() { data: function() {
var regPhoneOrEmail = (rule, value, callback) => {// var regPhoneOrEmail = (rule, value, callback) => {//
@ -132,6 +128,7 @@ export default {
platform:3, platform:3,
random:'', random:'',
distinguish:1, distinguish:1,
type: 2
}, },
rules: { rules: {
account: [{ required: true, message: '请输入账号', trigger: 'blur' }], account: [{ required: true, message: '请输入账号', trigger: 'blur' }],
@ -143,15 +140,16 @@ export default {
showPhoneVerify:true,// - showPhoneVerify:true,// -
PhoneVerificationIMG:'',// PhoneVerificationIMG:'',//
phoneOrEmail: { phoneOrEmail: {
workNumber: '', account: '',
password: '', password: '',
code:'', code:'',
platform:3, platform:3,
random:'', random:'',
distinguish: 1, distinguish:2,
type: 2
}, },
phoneOrEmailrules:{ phoneOrEmailrules:{
workNumber: [{ validator: regPhoneOrEmail, trigger: 'blur' }], account: [{ validator: regPhoneOrEmail, trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }], password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
code: [{ required: true, message: '请输入验证码', trigger: 'blur' }], code: [{ required: true, message: '请输入验证码', trigger: 'blur' }],
}, },
@ -162,11 +160,8 @@ export default {
phoneDisabled:false, phoneDisabled:false,
phoneBtnText: '发送验证码', phoneBtnText: '发送验证码',
phoneTimer:'', phoneTimer:'',
phoneOpener: '', phoneOpener:''
userVisible: false,
users: [],
}; };
}, },
components: { components: {
@ -200,29 +195,27 @@ export default {
let param = val==='phone'?this.phoneOrEmail:this.param let param = val==='phone'?this.phoneOrEmail:this.param
this.$refs[ref].validate(valid => { this.$refs[ref].validate(valid => {
if (valid) { if (valid) {
this.$post(this.api.logins, param).then(({ status, data, message }) => { this.$post(this.api.logins,param).then(res => {
localStorage.removeItem('examPath') const { message } = res
localStorage.removeItem('reviewPath') sessionStorage.setItem('token',res.data.token)
this.getOss() this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`).then(res => {
if (status == 200) { const list = res.permissionMenu
const accounts = data.userAccounts addRoutes(res.permissionMenu[0].children)
// this.$store.commit('setDataPer', res.dataPermissionList)
if (accounts instanceof Array) { this.$message.success(message);
this.users = accounts this.$router.push({
this.userVisible = true path: list[0].children[0].path
} else { });
sessionStorage.setItem('token', data.token) localStorage.setItem('ms_username', this.param.username);
this.setLogin() }).catch(err => {
} if (err.status === 500) {
} else { sessionStorage.clear()
param.code = ''
this.$message.error(message)
} }
})
}).catch(err => { }).catch(err => {
if(err.status===30001){ if(err.status===30001){
this.phoneVisible = true this.phoneVisible = true
} else if (err.status == 10004 || err.status == 10005) { }else if(err.status == 10004){
param.code = ''
this.blur() this.blur()
} }
}); });
@ -231,54 +224,7 @@ export default {
return false; 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(){ blur(){
this.param.random = Math.floor(Math.random()*999999999) this.param.random = Math.floor(Math.random()*999999999)
@ -368,15 +314,13 @@ export default {
background-image: url(../assets/img/login-bg.png); background-image: url(../assets/img/login-bg.png);
background-size: 100%; background-size: 100%;
} }
.ms-title { .ms-title {
width: 548px; width: 548px;
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 30px; top: 50px;
transform: translate(-50%,0); transform: translate(-50%,0);
} }
/deep/ .ms-login { /deep/ .ms-login {
position: relative; position: relative;
width: 1200px; width: 1200px;
@ -386,14 +330,12 @@ export default {
box-shadow:0px 0px 79px 0px rgba(11,15,65,0.36); box-shadow:0px 0px 79px 0px rgba(11,15,65,0.36);
background-repeat: no-repeat; background-repeat: no-repeat;
overflow: hidden; overflow: hidden;
.el-input__inner { .el-input__inner {
height: 80px; height: 80px;
line-height: 80px; line-height: 80px;
border: 1px solid rgba(220, 220, 220, 1); border: 1px solid rgba(220, 220, 220, 1);
border-radius: 2px; border-radius: 2px;
} }
.verification{ .verification{
position: absolute; position: absolute;
top: 1px; top: 1px;
@ -403,17 +345,14 @@ export default {
cursor: pointer; cursor: pointer;
} }
} }
.title{ .title{
font-size: 16px; font-size: 16px;
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
} }
.login-btn { .login-btn {
text-align: center; text-align: center;
} }
.login-btn button { .login-btn button {
width: 100%; width: 100%;
height: 88px; height: 88px;
@ -423,24 +362,20 @@ export default {
box-shadow:0px 7px 27px 0px rgba(50,129,255,0.51); box-shadow:0px 7px 27px 0px rgba(50,129,255,0.51);
border-radius:10px; border-radius:10px;
} }
.login-tips { .login-tips {
text-align: center; text-align: center;
color: #999; color: #999;
font-weight:bold; font-weight:bold;
} }
.forget{ .forget{
margin-bottom: 28px; margin-bottom: 28px;
text-align: right; text-align: right;
color: #999; color: #999;
font-weight:bold; font-weight:bold;
&:hover{ &:hover{
color: #0092ff; color: #0092FF;
} }
} }
.thirdParty{ .thirdParty{
width: 100%; width: 100%;
display: flex; display: flex;
@ -457,33 +392,27 @@ export default {
align-items: center; align-items: center;
font-size: 18px; font-size: 18px;
} }
.logo{ .logo{
width: 171px; width: 171px;
height: 40px; height: 40px;
margin-left: 20px; margin-left: 20px;
} }
img{ img{
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.header_title{ .header_title{
width: 33%; width: 33%;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.header_title a{ .header_title a{
cursor: pointer; cursor: pointer;
} }
.header_title a:hover{ .header_title a:hover{
color: blueviolet; color: blueviolet;
} }
.nul{ .nul{
width:80px; width:80px;
margin-right: 30px; margin-right: 30px;
@ -495,74 +424,10 @@ img {
border-bottom: 0; border-bottom: 0;
background-color: transparent; background-color: transparent;
} }
.tips { .tips {
margin: -20px 0 20px 5px; margin: -20px 0 20px 5px;
font-size: 14px; font-size: 14px;
text-align: center; text-align: center;
color: #666; 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;
}
.login-btn button {
height: 60px;
}
}
</style> </style>

@ -2,19 +2,28 @@
<div> <div>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover"
class="mgb20">
<div class="flex-between"> <div class="flex-between">
<div class="per_title" v-preventReClick @click="back"> <div class="per_title"
v-preventReClick
@click="goback()">
<i class="el-icon-arrow-left"></i> <i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span> <span class="per_back">返回</span>
<span class="per_school" v-text="form.cid ? '编辑课程' : '新建课程'"></span> <span class="per_school"
v-text="form.cid ? '编辑课程' : '新建课程'"></span>
</div> </div>
<el-button type="primary" round class="mag" v-preventReClick @click="saveAdd">确定 <el-button type="primary"
round
class="mag"
v-preventReClick
@click="saveAdd">确定
</el-button> </el-button>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="mgb20 "> <el-card shadow="hover"
class="mgb20 ">
<div class="flex-center mgb20"> <div class="flex-center mgb20">
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>课程信息</span> <span>课程信息</span>
@ -22,65 +31,111 @@
<div class="border-b-dashed"></div> <div class="border-b-dashed"></div>
<div> <div>
<el-form :model="form" :rules="rules" ref="form" label-width="100px"> <el-form :model="form"
<el-col :span="6" :offset="5"> :rules="rules"
<el-form-item label="课程名称" prop="curriculumName"> ref="form"
<el-input placeholder="请输入课程名称" v-model.trim="form.curriculumName"></el-input> label-width="100px">
<el-col :span="6"
:offset="5">
<el-form-item label="课程名称"
prop="curriculumName">
<el-input placeholder="请输入课程名称"
v-model.trim="form.curriculumName"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="学科类别" prop="categoryId"> <el-form-item label="学科类别"
<el-select v-model="form.categoryId" clearable placeholder="请选择学科类别" @change="getProfessionalClass()" prop="categoryId">
<el-select v-model="form.categoryId"
clearable
placeholder="请选择学科类别"
@change="getProfessionalClass()"
@clear="clearsubjectType()"> @clear="clearsubjectType()">
<el-option v-for="(item, index) in subjectList" :key="index" :label="item.disciplineName" <el-option v-for="(item,index) in subjectList"
:key="index"
:label="item.disciplineName"
:value="item.disciplineId"></el-option> :value="item.disciplineId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="专业" prop="professionalId"> <el-form-item label="专业"
<el-select v-model="form.professionalId" clearable placeholder="请选择专业" prop="professionalId">
<el-select v-model="form.professionalId"
clearable
placeholder="请选择专业"
:disabled="form.professionalCategoryId ? false : true"> :disabled="form.professionalCategoryId ? false : true">
<el-option v-for="(item, index) in ProfessionalList" :key="index" :label="item.professionalName" <el-option v-for="(item,index) in ProfessionalList"
:key="index"
:label="item.professionalName"
:value="item.professionalId"></el-option> :value="item.professionalId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="供应厂商" prop="supplier"> <el-form-item label="供应厂商"
<el-select v-model="form.supplier" clearable placeholder="请选择供应厂商" multiple> prop="supplier">
<el-option v-for="(item, i) in suppliers" :key="i" :label="item.supplierName" <el-select v-model="form.supplier"
clearable
placeholder="请选择供应厂商"
multiple>
<el-option v-for="(item, i) in suppliers"
:key="i"
:label="item.supplierName"
:value="item.supplierId"></el-option> :value="item.supplierId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" :offset="2"> <el-col :span="6"
<el-form-item label="课程类别" prop="curriculumType"> :offset="2">
<el-select v-model="form.curriculumType" clearable placeholder="请选择课程类型"> <el-form-item label="课程类别">
<el-option label="理论课程" :value="0"></el-option> <el-select v-model="form.curriculumType"
<el-option label="实训课程" :value="1"></el-option> clearable
placeholder="请选择课程类型">
<el-option label="理论课程"
:value="0"></el-option>
<el-option label="实训课程"
:value="1"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="专业类" prop="professionalCategoryId"> <el-form-item label="专业类"
<el-select v-model="form.professionalCategoryId" clearable placeholder="请选择专业类" prop="professionalCategoryId">
:disabled="form.categoryId ? false : true" @change="getProfessional()" <el-select v-model="form.professionalCategoryId"
clearable
placeholder="请选择专业类"
:disabled="form.categoryId ? false : true"
@change="getProfessional()"
@clear="clearProfessionalClass()"> @clear="clearProfessionalClass()">
<el-option v-for="(item, index) in ProfessionalClassList" :key="index" <el-option v-for="(item,index) in ProfessionalClassList"
:label="item.professionalClassName" :value="item.professionalClassId"></el-option> :key="index"
:label="item.professionalClassName"
:value="item.professionalClassId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="预计课时" prop="expectedCourse"> <el-form-item label="预计课时"
<el-select v-model="form.expectedCourse" clearable placeholder="请选择预计课时"> prop="expectedCourse">
<el-option label="32课时" value="32课时"></el-option> <el-select v-model="form.expectedCourse"
<el-option label="64课时" value="64课时"></el-option> clearable
placeholder="请选择预计课时">
<el-option label="32课时"
value="32课时"></el-option>
<el-option label="64课时"
value="64课时"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="14" :offset="5"> <el-col :span="14"
<el-form-item label="课程简介" prop="briefIntroduction"> :offset="5">
<el-input type="textarea" :autosize="{ minRows: 4 }" placeholder="请输入课程简介" <el-form-item label="课程简介"
prop="briefIntroduction">
<el-input type="textarea"
:autosize="{ minRows: 4 }"
placeholder="请输入课程简介"
v-model.trim="form.briefIntroduction"></el-input> v-model.trim="form.briefIntroduction"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="教学目标" prop="teachingObjectives"> <el-form-item label="教学目标"
<el-input type="textarea" :autosize="{ minRows: 4 }" placeholder="请输入教学目标" prop="teachingObjectives">
<el-input type="textarea"
:autosize="{ minRows: 4 }"
placeholder="请输入教学目标"
v-model.trim="form.teachingObjectives"></el-input> v-model.trim="form.teachingObjectives"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -88,45 +143,71 @@
</div> </div>
</el-card> </el-card>
<!-- 练习项目配置 --> <!-- 练习配置 -->
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover"
class="mgb20">
<div class="mgb20 flex-between"> <div class="mgb20 flex-between">
<div class="flex-center "> <div class="flex-center ">
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>练习项目配置</span> <span>练习配置</span>
</div> </div>
<div> <div>
<el-button @click="handleBatchDelete(0)">批量移除</el-button> <el-button @click="handleBatchDelete(0)">批量移除</el-button>
<el-button @click="handleConfig(0)" icon="el-icon-plus" circle></el-button> <el-button @click="handleConfig(0)"
icon="el-icon-plus"
circle></el-button>
</div> </div>
</div> </div>
<div class="border-b-dashed"></div> <div class="border-b-dashed"></div>
<div> <div>
<el-table :data="practiceData" class="table" stripe header-align="center" max-height="400" <el-table :data="practiceData"
class="table"
stripe
header-align="center"
max-height="400"
@selection-change="handleSelectionPractice"> @selection-change="handleSelectionPractice">
<el-table-column type="selection" width="55" align="center"></el-table-column> <el-table-column type="selection"
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> width="55"
<el-table-column prop="projectName" label="项目名称" align="center"> align="center"></el-table-column>
<el-table-column type="index"
width="100"
label="序号"
align="center"></el-table-column>
<el-table-column prop="projectName"
label="项目名称"
align="center"></el-table-column>
<el-table-column prop="remark"
label="备注名称"
align="center"></el-table-column>
<el-table-column prop="applicationName"
label="系统名称"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.projectName || scope.row.paperName }} {{ scope.row.applicationName || systemAll.find(e => e.systemId == scope.row.systemId).systemName }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注名称" align="center"></el-table-column> <el-table-column label="排序"
<el-table-column prop="systemName" label="系统名称" align="center"></el-table-column> align="center"
<el-table-column label="排序" align="center" width="100"> width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model.trim="scope.row.sort" <el-input v-model.trim="scope.row.sort"
@input="practiceSortChange(scope.row, scope.$index)"></el-input> @input="practiceSortChange(scope.row, scope.$index)"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="展示控制" align="center" width="100"> <el-table-column label="展示控制"
align="center"
width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch v-model="scope.row.isShow" :active-value="0" :inactive-value="1" <el-switch v-model="scope.row.isShow"
:active-value="0"
:inactive-value="1"
:disabled="scope.row.disabled"> :disabled="scope.row.disabled">
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="100"> <el-table-column label="操作"
align="center"
width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button :disabled="scope.row.disabled" <el-button :disabled="scope.row.disabled"
@click.native.prevent="handleDelete(scope.$index, practiceData)">移除 @click.native.prevent="handleDelete(scope.$index, practiceData)">移除
@ -137,46 +218,72 @@
</div> </div>
</el-card> </el-card>
<!-- 考核项目配置 --> <!-- 考核配置 -->
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover"
class="mgb20">
<div class="mgb20 flex-between"> <div class="mgb20 flex-between">
<div class="flex-center "> <div class="flex-center ">
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>考核项目配置</span> <span>考核配置</span>
</div> </div>
<div> <div>
<el-button @click="handleBatchDelete(1)">批量移除</el-button> <el-button @click="handleBatchDelete(1)">批量移除</el-button>
<el-button @click="handleConfig(1)" icon="el-icon-plus" circle></el-button> <el-button @click="handleConfig(1)"
icon="el-icon-plus"
circle></el-button>
</div> </div>
</div> </div>
<div class="border-b-dashed"></div> <div class="border-b-dashed"></div>
<!-- 实训配置 --> <!-- 实训配置 -->
<div> <div>
<el-table :data="assessmentData" class="table" stripe header-align="center" max-height="400" <el-table :data="assessmentData"
class="table"
stripe
header-align="center"
max-height="400"
@selection-change="handleSelectionAssessment"> @selection-change="handleSelectionAssessment">
<el-table-column type="selection" width="55" align="center"></el-table-column> <el-table-column type="selection"
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> width="55"
<el-table-column prop="projectName" label="项目名称" align="center"> align="center"></el-table-column>
<el-table-column type="index"
width="100"
label="序号"
align="center"></el-table-column>
<el-table-column prop="projectName"
label="项目名称"
align="center"></el-table-column>
<el-table-column prop="remark"
label="备注名称"
align="center"></el-table-column>
<el-table-column prop="applicationName"
label="系统名称"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.projectName || scope.row.paperName }} {{ scope.row.applicationName || systemAll.find(e => e.systemId == scope.row.systemId).systemName }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注名称" align="center"></el-table-column> <el-table-column label="排序"
<el-table-column prop="systemName" label="系统名称" align="center"></el-table-column> align="center"
<el-table-column label="排序" align="center" width="100"> width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model.trim="scope.row.sort" <el-input v-model.trim="scope.row.sort"
@input="assessmentSortChange(scope.row, scope.$index)"></el-input> @input="assessmentSortChange(scope.row, scope.$index)"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="展示控制" align="center" width="100"> <el-table-column label="展示控制"
align="center"
width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch v-model="scope.row.isShow" :active-value="0" :inactive-value="1" <el-switch v-model="scope.row.isShow"
:active-value="0"
:inactive-value="1"
:disabled="scope.row.disabled"> :disabled="scope.row.disabled">
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="100"> <el-table-column label="操作"
align="center"
width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button :disabled="scope.row.disabled" <el-button :disabled="scope.row.disabled"
@click.native.prevent="handleDelete(scope.$index, assessmentData)">移除</el-button> @click.native.prevent="handleDelete(scope.$index, assessmentData)">移除</el-button>
@ -186,45 +293,69 @@
</div> </div>
</el-card> </el-card>
<!-- 大赛项目配置 --> <!-- 竞赛配置 -->
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover"
class="mgb20">
<div class="mgb20 flex-between"> <div class="mgb20 flex-between">
<div class="flex-center "> <div class="flex-center ">
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>大赛项目配置</span> <span>竞赛配置</span>
</div> </div>
<div> <div>
<el-button @click="handleBatchDelete(2)">批量移除</el-button> <el-button @click="handleBatchDelete(2)">批量移除</el-button>
<el-button @click="handleConfig(2)" icon="el-icon-plus" circle></el-button> <el-button @click="handleConfig(2)"
icon="el-icon-plus"
circle></el-button>
</div> </div>
</div> </div>
<div class="border-b-dashed"></div> <div class="border-b-dashed"></div>
<!-- 实训配置 --> <!-- 实训配置 -->
<div> <div>
<el-table :data="matches" class="table" stripe header-align="center" max-height="400" <el-table :data="matches"
class="table"
stripe
header-align="center"
max-height="400"
@selection-change="handleSelectionMatch"> @selection-change="handleSelectionMatch">
<el-table-column type="selection" width="55" align="center"></el-table-column> <el-table-column type="selection"
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> width="55"
<el-table-column prop="projectName" label="项目名称" align="center"> align="center"></el-table-column>
<el-table-column type="index"
width="100"
label="序号"
align="center"></el-table-column>
<el-table-column prop="projectName"
label="项目名称"
align="center"></el-table-column>
<el-table-column prop="applicationName"
label="系统名称"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.projectName || scope.row.paperName }} {{ scope.row.applicationName || systemAll.find(e => e.systemId == scope.row.systemId).systemName }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="systemName" label="系统名称" align="center"></el-table-column> <el-table-column label="排序"
<el-table-column label="排序" align="center" width="100"> align="center"
width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model.trim="scope.row.sort" <el-input v-model.trim="scope.row.sort"
@input="assessmentSortChange(scope.row, scope.$index)"></el-input> @input="assessmentSortChange(scope.row, scope.$index)"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="展示控制" align="center" width="100"> <el-table-column label="展示控制"
align="center"
width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch v-model="scope.row.isShow" :active-value="0" :inactive-value="1" <el-switch v-model="scope.row.isShow"
:active-value="0"
:inactive-value="1"
:disabled="scope.row.disabled"> :disabled="scope.row.disabled">
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="100"> <el-table-column label="操作"
align="center"
width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button :disabled="scope.row.disabled" <el-button :disabled="scope.row.disabled"
@click.native.prevent="handleDelete(scope.$index, matches)">移除</el-button> @click.native.prevent="handleDelete(scope.$index, matches)">移除</el-button>
@ -238,20 +369,29 @@
</el-row> </el-row>
<!-- 配置弹窗 --> <!-- 配置弹窗 -->
<el-dialog :visible.sync="configVisible" width="1200px" center custom-class="config-dia"> <el-dialog :visible.sync="configVisible"
width="1200px"
center
custom-class="config-dia">
<div class="config-wrap"> <div class="config-wrap">
<div class="item system"> <div class="item system">
<div class="title-wrap flex-center"> <div class="title-wrap flex-center">
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>系统列表</span> <span>系统列表</span>
</div> </div>
<el-input placeholder="请输入系统名称" prefix-icon="el-icon-search" v-model.trim="systemKeyword" <el-input placeholder="请输入系统名称"
prefix-icon="el-icon-search"
v-model.trim="systemKeyword"
clearable></el-input> clearable></el-input>
<ul class="systems"> <ul class="systems">
<li v-for="(item, i) in systems" :key="i" :title="item.systemName"> <li v-for="(item, i) in systems"
<el-checkbox v-model="item.check" @change="val => systemChange(val, item)"></el-checkbox> :key="i"
<div :class="['name', { active: curSystem == item.systemId }]" @click="getProject(item)"> :title="item.systemName">
<el-checkbox v-model="item.check"
@change="val => systemChange(val, item)"></el-checkbox>
<div :class="['name', {active: curSystem == item.systemId}]"
@click="getProject(item)">
<span>{{ item.systemName }}</span> <span>{{ item.systemName }}</span>
<i class="el-icon-arrow-right"></i> <i class="el-icon-arrow-right"></i>
</div> </div>
@ -264,15 +404,21 @@
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>项目列表</span> <span>项目列表</span>
</div> </div>
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="projectKeyword" <el-input placeholder="请输入项目名称"
prefix-icon="el-icon-search"
v-model.trim="projectKeyword"
clearable></el-input> clearable></el-input>
<ul class="systems"> <ul class="systems">
<el-checkbox v-if="projects.length" v-model="checkAll" label="全选" <el-checkbox v-if="projects.length"
v-model="checkAll"
label="全选"
@change="val => checkAllChange(val, projects[0].systemId)"></el-checkbox> @change="val => checkAllChange(val, projects[0].systemId)"></el-checkbox>
<li v-for="(item, i) in projects" :key="i" :title="item.projectName"> <li v-for="(item, i) in projects"
:key="i"
:title="item.projectName">
<el-checkbox v-model="item.check" <el-checkbox v-model="item.check"
:label="item.remark ? item.remark + '(' + item.projectName + ')' : (item.projectName || item.paperName)" :label="item.remark ? item.remark + '(' + item.projectName + ')' : item.projectName"
@change="val => projectChange(val, item)"></el-checkbox> @change="val => projectChange(val, item)"></el-checkbox>
</li> </li>
</ul> </ul>
@ -283,23 +429,44 @@
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>已选择项目{{ checkeds.length }}</span> <span>已选择项目{{ checkeds.length }}</span>
</div> </div>
<el-input style="width: 200px;margin-bottom: 20px;" placeholder="请输入项目名称" prefix-icon="el-icon-search" <el-input style="width: 200px;margin-bottom: 20px;"
v-model.trim="checkedKeyword" clearable></el-input> placeholder="请输入项目名称"
<el-table :data="checkeds" class="table" stripe header-align="center" max-height="470"> prefix-icon="el-icon-search"
<el-table-column type="index" width="55" label="序号" align="center"></el-table-column> v-model.trim="checkedKeyword"
<el-table-column prop="systemName" label="系统名称" align="center"></el-table-column> clearable></el-input>
<el-table-column prop="projectName" width="80" label="系统类型" align="center"> <el-table :data="checkeds"
class="table"
stripe
header-align="center"
max-height="470">
<el-table-column type="index"
width="55"
label="序号"
align="center"></el-table-column>
<el-table-column prop="applicationName"
label="系统名称"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.type === 1 ? '流程类' : scope.row.type === 3 ? '理论' : '编程类' }} {{ scope.row.applicationName || systemAll.find(e => e.systemId == scope.row.systemId).systemName }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注名称" align="center"></el-table-column> <el-table-column prop="projectName"
<el-table-column prop="projectName" label="项目名称" align="center"> width="80"
label="系统类型"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.projectName || scope.row.paperName }} {{ scope.row.type ? '流程类' : '编程类' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="55"> <el-table-column prop="remark"
label="备注名称"
align="center"></el-table-column>
<el-table-column prop="projectName"
label="项目名称"
align="center"></el-table-column>
<el-table-column label="操作"
align="center"
width="55">
<template slot-scope="scope"> <template slot-scope="scope">
<i :class="['el-icon-delete rm', {disabled: scope.row.disabled}]" <i :class="['el-icon-delete rm', {disabled: scope.row.disabled}]"
@click="delProject(scope.$index, scope.row)"></i> @click="delProject(scope.$index, scope.row)"></i>
@ -309,9 +476,11 @@
</div> </div>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer"
class="dialog-footer">
<el-button @click="configVisible = false"> </el-button> <el-button @click="configVisible = false"> </el-button>
<el-button type="primary" @click="handleConfirm"> </el-button> <el-button type="primary"
@click="handleConfirm"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -328,7 +497,6 @@ export default {
form: { form: {
cid: this.$route.query.cid, cid: this.$route.query.cid,
curriculumName: "", curriculumName: "",
curriculumType: '',
courseType: "", courseType: "",
categoryId: 1, categoryId: 1,
professionalCategoryId: 1, professionalCategoryId: 1,
@ -356,9 +524,6 @@ export default {
expectedCourse: [ expectedCourse: [
{ required: true, message: "请选择预计课时", trigger: "change" } { required: true, message: "请选择预计课时", trigger: "change" }
], ],
curriculumType: [
{ required: true, message: "请选择课程类别", trigger: "change" }
],
professionalCategoryId: [ professionalCategoryId: [
{ required: true, message: "请选择专业类", trigger: "change" } { required: true, message: "请选择专业类", trigger: "change" }
], ],
@ -415,6 +580,7 @@ export default {
systemChecked: [], systemChecked: [],
curSystem: '', curSystem: '',
projects: [], projects: [],
projectAll: [],
projectKeyword: '', projectKeyword: '',
checkedKeyword: '', checkedKeyword: '',
checkeds: [], checkeds: [],
@ -441,7 +607,7 @@ export default {
projectKeyword: function (val) { projectKeyword: function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.getProject(); this.filterProject();
}, 500); }, 500);
}, },
checkedKeyword: function (val) { checkedKeyword: function (val) {
@ -576,7 +742,6 @@ export default {
this.pageNo = 1; this.pageNo = 1;
this.getConfig(); this.getConfig();
this.checkeds = JSON.parse(JSON.stringify(type == 1 ? this.assessmentData : type == 2 ? this.matches : this.practiceData)) this.checkeds = JSON.parse(JSON.stringify(type == 1 ? this.assessmentData : type == 2 ? this.matches : this.practiceData))
this.checkedAll = JSON.parse(JSON.stringify(this.checkeds))
}, },
// //
getConfig () { getConfig () {
@ -609,23 +774,26 @@ export default {
}).catch(err => { }) }).catch(err => { })
}, },
// //
async getProject (item, fromSystemChange) { getProject (item) {
const checked = this.checkeds const checked = this.checkeds
if (item) this.curSystem = item.systemId this.curSystem = item.systemId
let res this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}`).then(res => {
if (!fromSystemChange) { this.projectAll = JSON.parse(JSON.stringify(res)) //
res = await this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${this.curSystem}&keyword=${this.projectKeyword}`)
}
const result = [] const result = []
const projects = fromSystemChange ? this.projects : res res.map(e => {
projects.map(e => {
// //
const include = checked.some(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && n.paperId == e.paperId)) const include = checked.some(n => n.projectId == e.projectId && n.systemId == e.systemId)
e.check = include e.check = include
result.push(e) result.push(e)
}) })
this.checkAll = !result.filter(e => !e.check).length this.checkAll = !result.filter(e => !e.check).length
this.projects = result this.projects = result
}).catch(err => { })
},
//
filterProject () {
const val = this.projectKeyword
this.projects = this.projectAll.filter(e => e.projectName.includes(val))
}, },
// //
systemChange (val, item) { systemChange (val, item) {
@ -637,7 +805,7 @@ export default {
}) })
} }
this.projectKeyword = '' this.projectKeyword = ''
this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}&keyword=${this.projectKeyword}`).then(res => { this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}`).then(res => {
if (val) { if (val) {
// //
if (!this.mulSystem) { if (!this.mulSystem) {
@ -645,18 +813,18 @@ export default {
item.check = true item.check = true
} }
res.map(e => { res.map(e => {
if (!checkeds.find(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && e.paperId == n.paperId))) { if (!checkeds.find(n => n.projectId == e.projectId && n.systemId == e.systemId)) {
checkeds.push(e) checkeds.push(e)
} }
}) })
} else { } else {
res.map(e => { res.map(e => {
const i = checkeds.findIndex(n => (e.projectId && n.projectId == e.projectId && n.systemId == e.systemId) || (e.paperId && e.paperId == n.paperId)) const i = checkeds.findIndex(n => n.projectId == e.projectId && n.systemId == e.systemId)
i === -1 || checkeds.splice(i, 1) i === -1 || checkeds.splice(i, 1)
}) })
} }
this.checkedAll = JSON.parse(JSON.stringify(checkeds)) // this.checkedAll = JSON.parse(JSON.stringify(checkeds)) //
this.getProject(item, 1) this.getProject(item)
}).catch(err => { }) }).catch(err => { })
}, },
// //
@ -668,8 +836,8 @@ export default {
}, },
// //
projectChange (val, item) { projectChange (val, item) {
const { systemId, paperId } = item const { systemId } = item
const i = this.checkeds.findIndex(e => (item.projectId && e.projectId == item.projectId && e.systemId == systemId) || (paperId && paperId == e.paperId)) const i = this.checkeds.findIndex(e => e.projectId == item.projectId && e.systemId == systemId)
// push // push
if (val) { if (val) {
this.checkeds.push(item) this.checkeds.push(item)
@ -682,11 +850,12 @@ export default {
}) })
this.checkAll = !this.projects.find(e => !e.check) // this.checkAll = !this.projects.find(e => !e.check) //
this.checkedAll = JSON.parse(JSON.stringify(this.checkeds)) // this.checkedAll = JSON.parse(JSON.stringify(this.checkeds)) //
console.log("🚀 ~ file: AddCurriculum.vue ~ line 728 ~ projectChange ~ checkedAll", this.checkeds, item)
}, },
// //
filterChecked () { filterChecked () {
const val = this.checkedKeyword const val = this.checkedKeyword
this.checkeds = this.checkedAll.filter(e => (e.projectName && e.projectName.includes(val)) || (e.paperName && e.paperName.includes(val))) this.checkeds = this.checkedAll.filter(e => e.projectName.includes(val))
}, },
// //
delProject (i, e) { delProject (i, e) {
@ -697,9 +866,9 @@ export default {
this.checkeds.splice(i, 1) this.checkeds.splice(i, 1)
// checkdisabled // checkdisabled
if (e.systemId == this.curSystem) { if (e.systemId == this.curSystem) {
const { projectId, paperId } = e const { projectId } = e
this.projects.map(n => { this.projects.map(n => {
if ((projectId && n.projectId == projectId) || (paperId && n.paperId == paperId)) { if (n.projectId == projectId) {
n.check = false n.check = false
} }
}) })
@ -805,21 +974,20 @@ export default {
this.$message.info("已取消移除"); this.$message.info("已取消移除");
}); });
}, },
saveAdd () { saveAdd (fromBack) {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
if (this.submiting) return false if (this.submiting) return false
const form = JSON.parse(JSON.stringify(this.form)) const form = JSON.parse(JSON.stringify(this.form))
form.supplier = form.supplier.join() form.supplier = form.supplier.join()
if (!this.practiceData.length) { if (!this.practiceData.length) {
this.$message.warning("请添加练习项目配置"); this.$message.warning("请添加练习配置");
return; return;
} else { } else {
form.systemIdByPractice = this.practiceData.map(i => { form.systemIdByPractice = this.practiceData.map(i => {
let obj = { let obj = {
isShow: i.isShow, isShow: i.isShow,
projectId: i.projectId || '', projectId: i.projectId,
paperId: i.paperId || '',
sort: Number(i.sort), sort: Number(i.sort),
systemId: i.systemId systemId: i.systemId
}; };
@ -828,14 +996,13 @@ export default {
form.systemIdByPractice.sort((a, b) => a.sort - b.sort) form.systemIdByPractice.sort((a, b) => a.sort - b.sort)
} }
if (!this.assessmentData.length) { if (!this.assessmentData.length) {
this.$message.warning("请添加考核项目配置"); this.$message.warning("请添加考核配置");
return; return;
} else { } else {
form.systemIdByAssessment = this.assessmentData.map(i => { form.systemIdByAssessment = this.assessmentData.map(i => {
let obj = { let obj = {
isShow: i.isShow, isShow: i.isShow,
projectId: i.projectId, projectId: i.projectId,
paperId: i.paperId || '',
sort: Number(i.sort), sort: Number(i.sort),
systemId: i.systemId systemId: i.systemId
}; };
@ -843,12 +1010,11 @@ export default {
}); });
form.systemIdByAssessment.sort((a, b) => a.sort - b.sort) form.systemIdByAssessment.sort((a, b) => a.sort - b.sort)
} }
// //
form.systemIdByCompetition = this.matches.map(i => { form.systemIdByCompetition = this.matches.map(i => {
let obj = { let obj = {
isShow: i.isShow, isShow: i.isShow,
projectId: i.projectId, projectId: i.projectId,
paperId: i.paperId || '',
sort: Number(i.sort), sort: Number(i.sort),
systemId: i.systemId systemId: i.systemId
}; };
@ -863,7 +1029,6 @@ export default {
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}) })
debugger
if (form.cid) { if (form.cid) {
this.$post(this.api.modifyCourse, form).then((res) => { this.$post(this.api.modifyCourse, form).then((res) => {
this.$message.success("编辑成功"); this.$message.success("编辑成功");
@ -874,17 +1039,15 @@ export default {
}); });
} else { } else {
this.$post(this.api.createCurriculum, form).then((res) => { this.$post(this.api.createCurriculum, form).then((res) => {
this.loadIns.close() !fromBack ? this.$confirm("课程创建成功,是否马上进行课程内容设置?", "提示", {
this.$confirm("课程创建成功,是否马上进行课程内容设置?", "提示", {
type: "success", type: "success",
confirmButtonText: "马上设置", confirmButtonText: "马上设置",
cancelButtonText: "稍后操作", cancelButtonText: "稍后操作"
closeOnClickModal: false
}).then(() => { }).then(() => {
this.$router.push(`/contentSettings?cid=${res.cid}&name=${form.curriculumName}`); this.$router.push(`/contentSettings?cid=${res.cid}`);
}).catch(() => { }).catch(() => {
this.$router.push('/curriculum') this.backPage()
}) }) : this.backPage()
}).catch((res) => { }).catch((res) => {
this.submiting = false this.submiting = false
this.loadIns.close() this.loadIns.close()
@ -895,16 +1058,15 @@ export default {
} }
}); });
}, },
back () { goback () {
const id = this.form.cid const id = this.form.cid
const updateTime = this.updateTime const updateTime = this.updateTime
// //
if ((id && updateTime > 2) || (!id && updateTime)) { if ((id && updateTime > 2) || (!id && updateTime)) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning', type: 'warning'
closeOnClickModal: false
}).then(() => { }).then(() => {
this.saveAdd() this.saveAdd(1)
}).catch(() => { }).catch(() => {
this.backPage() this.backPage()
}) })
@ -914,8 +1076,8 @@ export default {
}, },
// //
backPage () { backPage () {
this.loadIns && this.loadIns.close() this.$router.back()
this.$router.push(this.$store.state.referrer || '/curriculum') this.loadIns.close()
} }
} }
}; };
@ -923,7 +1085,6 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
$avatar-width: 104px; $avatar-width: 104px;
/deep/ .avatar-uploader { /deep/ .avatar-uploader {
.el-upload { .el-upload {
position: relative; position: relative;
@ -982,34 +1143,28 @@ $avatar-width: 104px;
} }
} }
} }
.settlement { .settlement {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 10px; margin-bottom: 10px;
.label { .label {
margin-right: 10px; margin-right: 10px;
white-space: nowrap; white-space: nowrap;
color: #606266; color: #606266;
font-size: 14px; font-size: 14px;
} }
.el-input { .el-input {
width: 150px; width: 150px;
margin-right: 30px; margin-right: 30px;
} }
} }
/deep/.config-dia { /deep/.config-dia {
.config-wrap { .config-wrap {
display: flex; display: flex;
} }
.title-wrap { .title-wrap {
margin-bottom: 15px; margin-bottom: 15px;
} }
.item { .item {
width: 250px; width: 250px;
max-height: 600px; max-height: 600px;
@ -1017,22 +1172,18 @@ $avatar-width: 104px;
margin-right: 20px; margin-right: 20px;
overflow: hidden; overflow: hidden;
} }
.system { .system {
background-color: #f9f9f9; background-color: #f9f9f9;
} }
.systems { .systems {
margin-top: 10px; margin-top: 10px;
max-height: 520px; max-height: 550px;
overflow: auto; overflow: auto;
li { li {
display: flex; display: flex;
align-items: center; align-items: center;
margin: 10px 0; margin: 10px 0;
} }
.name { .name {
display: inline-flex; display: inline-flex;
flex: 1; flex: 1;
@ -1040,12 +1191,10 @@ $avatar-width: 104px;
align-items: center; align-items: center;
margin-left: 5px; margin-left: 5px;
cursor: pointer; cursor: pointer;
&.active, &.active,
&:hover { &:hover {
color: #9076ff; color: #9076ff;
} }
span { span {
max-width: 200px; max-width: 200px;
text-overflow: ellipsis; text-overflow: ellipsis;
@ -1054,25 +1203,20 @@ $avatar-width: 104px;
} }
} }
} }
.checked { .checked {
flex: 1; flex: 1;
width: auto; width: auto;
.el-table .cell { .el-table .cell {
font-size: 12px; font-size: 12px;
} }
} }
.rm { .rm {
font-size: 14px; font-size: 14px;
cursor: pointer; cursor: pointer;
&.disabled { &.disabled {
color: #ccc; color: #ccc;
cursor: not-allowed; cursor: not-allowed;
} }
&:hover { &:hover {
color: #17161f; color: #17161f;
} }

@ -1,7 +1,6 @@
<template> <template>
<div> <div>
<el-card shadow="hover" <el-card shadow="hover" class="mgb20">
class="mgb20">
<div> <div>
<div class="flex-center mgb20"> <div class="flex-center mgb20">
<p class="hr_tag"></p> <p class="hr_tag"></p>
@ -11,12 +10,9 @@
<el-form label-width="80px"> <el-form label-width="80px">
<el-col :span="4"> <el-col :span="4">
<el-form-item label="学科类别"> <el-form-item label="学科类别">
<el-select v-model="form.categoryId" <el-select v-model="form.categoryId" clearable
clearable @change="getProfessionalClass()" @clear="clearClass()">
@change="getProfessionalClass()" <el-option v-for="(item,index) in subjectList" :key="index"
@clear="clearClass()">
<el-option v-for="(item,index) in subjectList"
:key="index"
:label="item.disciplineName" :label="item.disciplineName"
:value="item.disciplineId"></el-option> :value="item.disciplineId"></el-option>
</el-select> </el-select>
@ -24,13 +20,10 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="专业类"> <el-form-item label="专业类">
<el-select v-model="form.professionalCategoryId" <el-select v-model="form.professionalCategoryId" clearable
clearable
:disabled="form.categoryId ? false : true" :disabled="form.categoryId ? false : true"
@change="getProfessional()" @change="getProfessional()" @clear="clearProfess()">
@clear="clearProfess()"> <el-option v-for="(item,index) in ProfessionalClassList" :key="index"
<el-option v-for="(item,index) in ProfessionalClassList"
:key="index"
:label="item.professionalClassName" :label="item.professionalClassName"
:value="item.professionalClassId"></el-option> :value="item.professionalClassId"></el-option>
</el-select> </el-select>
@ -38,12 +31,10 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="专业"> <el-form-item label="专业">
<el-select v-model="form.professionalId" <el-select v-model="form.professionalId" clearable
clearable
:disabled="form.professionalCategoryId ? false : true" :disabled="form.professionalCategoryId ? false : true"
@change="getData()"> @change="getData()">
<el-option v-for="(item,index) in ProfessionalList" <el-option v-for="(item,index) in ProfessionalList" :key="index"
:key="index"
:label="item.professionalName" :label="item.professionalName"
:value="item.professionalId"></el-option> :value="item.professionalId"></el-option>
</el-select> </el-select>
@ -51,22 +42,17 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="课程类别"> <el-form-item label="课程类别">
<el-select v-model="form.curriculumType" <el-select v-model="form.curriculumType" clearable
clearable
@change="getData()"> @change="getData()">
<el-option label="理论课程" <el-option label="理论课程" :value="0"></el-option>
:value="0"></el-option> <el-option label="实训课程" :value="1"></el-option>
<el-option label="实训课程"
:value="1"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item>
<el-input placeholder="请输入课程名称" <el-input placeholder="请输入课程名称" prefix-icon="el-icon-search"
prefix-icon="el-icon-search" v-model="form.curriculumName" clearable
v-model="form.curriculumName"
clearable
@keyup.enter.native="onSearch"></el-input> @keyup.enter.native="onSearch"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -75,69 +61,40 @@
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" <el-card shadow="hover" class="card">
class="card">
<div class="flex-between mgb20"> <div class="flex-between mgb20">
<div class="flex-center"> <div class="flex-center">
<p class="hr_tag"></p> <p class="hr_tag"></p>
<span>课程列表</span> <span>课程列表</span>
</div> </div>
<div> <div>
<el-button type="primary" <el-button type="primary" round @click="addcourse" v-auth>新增课程</el-button>
round <el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
@click="addcourse"
v-auth>新增课程</el-button>
<el-button type="primary"
round
@click="delAllSelection"
v-auth>批量删除</el-button>
</div> </div>
</div> </div>
<el-table v-loading="loading" <el-table v-loading="loading" :data="courseData" class="table" ref="table" stripe header-align="center"
:data="courseData" @selection-change="handleSelectionChange" :row-key="getRowKeys">
class="table" <el-table-column type="selection" width="55" align="center"
ref="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
:row-key="getRowKeys">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column> :reserve-selection="true"></el-table-column>
<el-table-column type="index" <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
width="100" <el-table-column prop="curriculumName" label="课程名称" align="center"></el-table-column>
label="序号" <el-table-column prop="curriculumType" label="课程类型" align="center">
align="center"></el-table-column>
<el-table-column prop="curriculumName"
label="课程名称"
align="center"></el-table-column>
<el-table-column prop="curriculumType"
label="课程类型"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="ellipsis">{{ courseTypeStatus[scope.row.curriculumType] }}</span> <span class="ellipsis">{{ courseTypeStatus[scope.row.curriculumType] }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="userName" <el-table-column prop="userName" label="创建人" align="center"></el-table-column>
label="创建人" <el-table-column label="配置的实训应用" align="center">
align="center"></el-table-column>
<el-table-column label="配置的实训应用"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="ellipsis">{{ scope.row.sysName }}</span> <span class="ellipsis">{{ scope.row.sysName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="orderVolume" <el-table-column prop="orderVolume" label="订单量" align="center"></el-table-column>
label="订单量" <el-table-column prop="expectedCourse" label="预计课时" align="center"></el-table-column>
align="center"></el-table-column> <el-table-column label="上架/下架" align="center">
<el-table-column prop="expectedCourse"
label="预计课时"
align="center"></el-table-column>
<el-table-column label="上架/下架"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch v-model="scope.row.isShelves" <el-switch
v-model="scope.row.isShelves"
:active-value="1" :active-value="1"
:inactive-value="0" :inactive-value="0"
@change="changeSwitch($event, scope.row)" @change="changeSwitch($event, scope.row)"
@ -145,35 +102,25 @@
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作" align="center">
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" <el-button type="text" @click="edit(scope.row)" v-auth>编辑</el-button>
@click="edit(scope.row)" <el-button type="text" @click="config(scope.row)" v-auth>内容设置</el-button>
v-auth>编辑</el-button> <el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
<el-button type="text"
@click="config(scope.row)"
v-auth>内容设置</el-button>
<el-button type="text"
@click="handleDelete(scope.row)"
v-auth>删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background <el-pagination background @current-change="handleCurrentChange" :current-page="pageNo"
@current-change="handleCurrentChange" layout="total, prev, pager, next" :total="totals"></el-pagination>
:current-page="page"
layout="total, prev, pager, next"
:total="totals"></el-pagination>
</div> </div>
</el-card> </el-card>
</div> </div>
</template> </template>
<script> <script>
import qs from 'qs'
export default { export default {
name: "customer",
data() { data() {
return { return {
courseTypeStatus: { courseTypeStatus: {
@ -183,13 +130,13 @@ export default {
name: localStorage.getItem("ms_username"), name: localStorage.getItem("ms_username"),
courseData: [], courseData: [],
form: { form: {
categoryId: +this.$route.query.categoryId || '', categoryId: "",
professionalCategoryId: +this.$route.query.professionalCategoryId || '', professionalCategoryId: "",
professionalId: +this.$route.query.professionalId || '', professionalId: "",
curriculumType: this.$route.query.curriculumType ? +this.$route.query.curriculumType : '', curriculumType: "",
curriculumName: this.$route.query.curriculumName || '' curriculumName: ""
}, },
page: +this.$route.query.page || 1, pageNo: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
totals: 0, totals: 0,
subjectList: [], // subjectList: [], //
@ -221,7 +168,7 @@ export default {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理') const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
let data = { let data = {
...this.form, ...this.form,
pageNum: this.page, pageNum: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
supplierId: sid ? sid.supplierId : '' supplierId: sid ? sid.supplierId : ''
}; };
@ -229,71 +176,71 @@ export default {
this.courseData = res.page.records; this.courseData = res.page.records;
this.totals = res.page.total; this.totals = res.page.total;
this.loading = false; this.loading = false;
}).catch(err => { }); }).catch(err => {
});
}, },
initData() { initData() {
this.page = 1; this.pageNo = 1;
this.getData(); this.getData();
}, },
// //
async getSubject () { getSubject() {
const { list } = await this.$get(this.api.courseDiscipline) this.$get(this.api.courseDiscipline).then(res => {
this.subjectList = list this.subjectList = res.list;
this.form.professionalCategoryId && this.getProfessionalClassData() }).catch(err => {
});
}, },
// //
clearClass() { clearClass() {
this.form.professionalCategoryId = '' this.form.professionalCategoryId = "";
this.form.professionalId = '' this.form.professionalId = "";
}, },
// //
getProfessionalClass() { getProfessionalClass() {
this.clearClass(); this.clearClass();
this.getProfessionalClassData(); this.getProfessionalClassData();
this.page = 1; this.pageNo = 1;
this.getData(); this.getData();
}, },
async getProfessionalClassData () { getProfessionalClassData() {
const { list } = await this.$get(this.api.courseProfessionalClass, { let data = {
disciplineId: this.form.categoryId disciplineId: this.form.categoryId
}) };
this.ProfessionalClassList = list this.$get(this.api.courseProfessionalClass, data).then(res => {
this.form.professionalId && this.getProfessionalData() this.ProfessionalClassList = res.list;
}).catch(err => {
});
}, },
// //
clearProfess() { clearProfess() {
this.form.professionalId = '' this.form.professionalId = "";
}, },
// //
getProfessional() { getProfessional() {
this.clearProfess(); this.clearProfess();
this.getProfessionalData(); this.getProfessionalData();
this.page = 1; this.pageNo = 1;
this.getData(); this.getData();
}, },
async getProfessionalData () { getProfessionalData() {
const { list } = await this.$get(this.api.courseProfessional, { let data = {
professionalClassId: this.form.professionalCategoryId professionalClassId: this.form.professionalCategoryId
}) };
this.ProfessionalList = list this.$get(this.api.courseProfessional, data).then(res => {
}, this.ProfessionalList = res.list;
// url }).catch(err => {
setReferrer () { });
this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`)
}, },
// //
addcourse() { addcourse() {
this.setReferrer()
this.$router.push("/addcurriculum"); this.$router.push("/addcurriculum");
}, },
// //
edit(row) { edit(row) {
this.setReferrer()
this.$router.push(`/addcurriculum?cid=${row.cid}`); this.$router.push(`/addcurriculum?cid=${row.cid}`);
}, },
// //
config(row) { config(row) {
this.setReferrer()
this.$router.push(`/contentSettings?cid=${row.cid}&name=${row.curriculumName}`); this.$router.push(`/contentSettings?cid=${row.cid}&name=${row.curriculumName}`);
}, },
// //
@ -331,8 +278,8 @@ export default {
let ids = this.multipleSelection.map(i => i.cid); let ids = this.multipleSelection.map(i => i.cid);
this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => { this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => {
if(ids.length == this.courseData.length){ if(ids.length == this.courseData.length){
if (this.page > 1) { if(this.pageNo > 1){
this.page = this.page - 1 this.pageNo = this.pageNo-1
} }
} }
this.getData(); this.getData();
@ -348,13 +295,13 @@ export default {
}, },
// //
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val; this.pageNo = val;
this.$router.push(`/curriculum?page=${val}`) this.$router.push(`curriculum?page=${val}`)
this.getData(); this.getData();
}, },
// //
onSearch() { onSearch() {
this.page = 1; this.pageNo = 1;
this.getData(); this.getData();
}, },
// //
@ -373,5 +320,8 @@ export default {
.card { .card {
min-height: calc(100vh - 300px); min-height: calc(100vh - 300px);
} }
.mag {
margin-right: 20px;
}
</style> </style>

@ -2,7 +2,7 @@
<div> <div>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="mgb20">
<div class="flex-between"> <div class="flex-between">
<el-page-header @back="back" :content="name + '/' + (sorting ? '编辑排序' : '内容设置')"></el-page-header> <el-page-header @back="goBack" :content="name + '/' + (sorting? '编辑排序' : '内容设置')"></el-page-header>
</div> </div>
</el-card> </el-card>
<!--内容设置--> <!--内容设置-->
@ -29,18 +29,13 @@
<div>{{ chapter.name }}</div> <div>{{ chapter.name }}</div>
<div> <div>
<template v-if="!sorting"> <template v-if="!sorting">
<el-button class="action-btn" plain @click="editChapter(chapter)" <el-button class="action-btn" plain @click="editChapter(chapter)" v-auth="'/curriculum:内容设置:修改章节名称'">修改章节名称</el-button>
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="addSection(chapter.id)" <el-button class="action-btn" plain @click="delChapter(chapter.id)" v-auth="'/curriculum:内容设置:删除章节'">删除</el-button>
v-auth="'/curriculum:内容设置:添加小节'">添加小节</el-button>
<el-button class="action-btn" plain @click="delChapter(chapter.id)"
v-auth="'/curriculum:内容设置:删除章节'">删除</el-button>
</template> </template>
<template v-else> <template v-else>
<i class="el-icon-top sort-icon" :class="{ disabled: index == 0 }" style="margin-right: 5px" <i class="el-icon-top sort-icon" :class="{disabled: index == 0}" style="margin-right: 5px" @click="sortChapter(chapter,'up',index == 0,index)"></i>
@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-bottom sort-icon" :class="{ disabled: index == chapters.length - 1 }"
@click="sortChapter(chapter, 'down', index == chapter.length - 1, index)"></i>
</template> </template>
</div> </div>
</div> </div>
@ -64,27 +59,20 @@
<template v-if="!sorting"> <template v-if="!sorting">
<el-button type="text" @click="download(scope.row)" 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="preview(scope.row)" v-auth="'/curriculum:内容设置:查看'">查看</el-button>
<el-button type="text" @click="delSection(scope.row)" <el-button type="text" @click="delSection(scope.row)" v-auth="'/curriculum:内容设置:删除小节'">删除</el-button>
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="editSectionName(scope.row, chapter.id)" <el-button type="text" @click="switchFile(scope.row,chapter.id)" v-auth="'/curriculum:内容设置:更换文件'">更换文件</el-button>
v-auth="'/curriculum:内容设置:修改小节名称'">修改小节名称</el-button>
<el-button type="text" @click="switchFile(scope.row, chapter.id)"
v-auth="'/curriculum:内容设置:更换文件'">更换文件</el-button>
</template> </template>
<template v-else> <template v-else>
<i class="el-icon-top sort-icon" :class="{ disabled: scope.$index == 0 }" style="margin-right: 5px" <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>
@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>
<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>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<el-dialog :title="chapterId ? '编辑章节' : '新增章节'" :visible.sync="chapterVisible" width="540px" <el-dialog :title="chapterId ? '编辑章节' : '新增章节'" :visible.sync="chapterVisible" width="540px" :close-on-click-modal="false">
:close-on-click-modal="false">
<el-form> <el-form>
<el-form-item> <el-form-item>
<el-input placeholder="请输入章节名称,便于对小节归类" v-model="chapterName" maxlength="50"></el-input> <el-input placeholder="请输入章节名称,便于对小节归类" v-model="chapterName" maxlength="50"></el-input>
@ -96,20 +84,29 @@
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="添加小节" :visible.sync="sectionVisible" width="540px" @close="closeSection" <el-dialog title="添加小节" :visible.sync="sectionVisible" width="540px" @close="closeSection" :close-on-click-modal="false">
:close-on-click-modal="false"> <el-form label-width="80px">
<el-form ref="form" :model="sectionForm" label-width="80px" @submit.native.prevent>
<el-form-item label="资源添加"> <el-form-item label="资源添加">
<Upload :max-size="100000" :file-list="uploadList" :on-remove="handleRemove" <el-upload
@beforeUpload="beforeUpload" @onSuccess="uploadSuccess"> :before-upload="beforeUpload"
<template slot="tip"> :on-remove="handleRemove"
<p>视频请上传MP4格式大小不超过150Moffice文件大小不要超过10M</p> :on-error="uploadError"
</template> :before-remove="beforeRemove"
</Upload> :limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:file-list="uploadList"
:headers="headers"
:http-request="handleRequest"
name="file"
>
<el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button>
<div slot="tip" class="el-upload__tip">视频请上传MP4格式大小不超过30Moffice文件大小不要超过10M</div>
</el-upload>
<el-progress v-if="showProgress" :stroke-width="3" :percentage="progressPercent"></el-progress>
</el-form-item> </el-form-item>
<el-form-item label="小节名称"> <el-form-item label="小节名称">
<el-input placeholder="请输入小节名称" v-model.trim="sectionForm.sectionName" maxlength="50" <el-input placeholder="请输入小节名称" v-model="sectionName" maxlength="50"></el-input>
@keyup.enter.native="sectionSubmit()"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -118,13 +115,24 @@
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="更换文件" :visible.sync="switchVisible" width="540px" :close-on-click-modal="false" <el-dialog title="更换文件" :visible.sync="switchVisible" width="540px" :close-on-click-modal="false" @close="closeSwitch">
@close="closeSwitch">
<div style="text-align: center"> <div style="text-align: center">
<Upload :max-size="100000" :file-list="uploadList" :on-remove="handleRemove" @beforeUpload="beforeUpload" <el-upload
@onSuccess="uploadSuccess"> :before-upload="beforeUpload"
<div slot="tip"></div> :on-remove="handleRemove"
</Upload> :on-error="uploadError"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:file-list="uploadList"
:headers="headers"
:http-request="handleRequest"
name="file"
>
<el-button size="small"><img src="@/assets/img/upload.png" alt=""> 上传资源</el-button>
</el-upload>
<el-progress v-if="showProgress" :stroke-width="3" :percentage="progressPercent"></el-progress>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="switchVisible = false">取消</el-button> <el-button @click="switchVisible = false">取消</el-button>
@ -133,10 +141,9 @@
</el-dialog> </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>
<el-form-item> <el-form-item>
<el-input placeholder="请输入小节名称" v-model="sectionForm.sectionName" maxlength="50" <el-input placeholder="请输入小节名称" v-model="sectionName" maxlength="50"></el-input>
@keyup.enter.native="sectionNameSubmit()"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -145,28 +152,18 @@
</span> </span>
</el-dialog> </el-dialog>
<div v-show="previewImg" class="el-image-viewer__wrapper" :class="{ active: previewImg }" <div v-show="previewImg" class="el-image-viewer__wrapper" :class="{active: previewImg}" style="z-index: 2000">
style="z-index: 2000">
<div class="el-image-viewer__mask"></div> <div class="el-image-viewer__mask"></div>
<span class="el-image-viewer__btn el-image-viewer__close" @click="previewImg = ''"><i <span class="el-image-viewer__btn el-image-viewer__close" @click="previewImg = ''"><i class="el-icon-circle-close" style="color: #fff"></i></span>
class="el-icon-circle-close" style="color: #fff"></i></span>
<div class="el-image-viewer__canvas"> <div class="el-image-viewer__canvas">
<img :src="previewImg" class="el-image-viewer__img" <img :src="previewImg" class="el-image-viewer__img" style="transform: scale(1) rotate(0deg);margin-top: -1px; max-height: 100%; max-width: 100%;">
style="transform: scale(1) rotate(0deg);margin-top: -1px; max-height: 100%; max-width: 100%;">
</div> </div>
</div> </div>
<div v-show="iframeSrc || videoSrc" class="el-image-viewer__wrapper" :class="{ active: iframeSrc }" <div v-show="iframeSrc" class="el-image-viewer__wrapper" :class="{active: iframeSrc}" style="z-index: 2000">
style="z-index: 2000">
<div class="el-image-viewer__mask"></div> <div class="el-image-viewer__mask"></div>
<span class="el-image-viewer__btn el-image-viewer__close" :class="{ 'doc-close': isWord }" <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>
:style="{ top: isWord ? '50px' : '5px' }" @click="closeIframe"><i class="el-icon-circle-close"
style="color: #fff"></i></span>
<div class="el-image-viewer__canvas"> <div class="el-image-viewer__canvas">
<iframe v-if="iframeSrc" class="fileIframe" id="fileIframe" :src="iframeSrc" frameborder="0"></iframe> <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"> <template v-if="showMask">
<div class="mask" style="width: 200px;height: 30px;top: 53px;right: 320px"></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> <div class="mask" style="width: 175px;height: 30px;top: 53px;right: 5px"></div>
@ -183,12 +180,11 @@
</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> <div class="el-image-viewer__mask"></div>
<span class="el-image-viewer__btn el-image-viewer__close" @click="closePlayer"><i <span class="el-image-viewer__btn el-image-viewer__close" @click="closePlayer"><i class="el-icon-circle-close" style="color: #fff"></i></span>
class="el-icon-circle-close" style="color: #fff"></i></span>
<div class="player" id="player"></div> <div class="player" id="player"></div>
</div> </div>
<Pdf :visible.sync="pdfVisible" :src.sync="pdfSrc" /> <pdf :visible.sync="pdfVisible" :src.sync="pdfSrc"></pdf>
</div> </div>
</div> </div>
</el-card> </el-card>
@ -217,11 +213,8 @@
<script> <script>
import { Loading } from "element-ui"; import { Loading } from "element-ui";
import Pdf from "@/components/pdf"; import pdf from "@/components/pdf";
import Upload from '@/components/upload'; import axios from 'axios'
import Oss from '@/components/upload/upload.js'
import Util from '@/libs/util'
export default { export default {
name: "contentSettings", name: "contentSettings",
data() { data() {
@ -245,21 +238,11 @@ export default {
sectionId: "", sectionId: "",
switchVisible: false, switchVisible: false,
sectionNameVisible: false, sectionNameVisible: false,
rules: {
sectionName: [
{ required: true, message: "请输入小节名称", trigger: "blur" }
],
},
sectionForm: {
sectionName: ''
},
fileId: "", fileId: "",
fileName: "", fileName: "",
fileUrl: "", fileUrl: "",
originalFileName: "", originalFileName: "",
fileType: "", fileType: "",
videoSrc: '',
playAuth: "", playAuth: "",
player: null, player: null,
previewImg: "", previewImg: "",
@ -297,18 +280,18 @@ export default {
moved: false // moved: false //
}; };
}, },
components: { Pdf, Upload }, components: { pdf },
mounted() { mounted() {
this.insertScript(); this.insertScript();
this.id && this.getData(); this.id && this.getData();
// //
if (window.history && window.history.pushState) { if (window.history && window.history.pushState) {
history.pushState(null, null, document.URL); history.pushState(null, null, document.URL);
window.addEventListener("popstate", this.back, false); window.addEventListener("popstate", this.goBack, false);
} }
}, },
destroyed() { destroyed() {
window.removeEventListener("popstate", this.back, false); window.removeEventListener("popstate", this.goBack, false);
}, },
methods: { methods: {
getData() { getData() {
@ -324,7 +307,7 @@ export default {
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val this.multipleSelection = val
}, },
back () { goBack() {
// //
if (this.previewing) { if (this.previewing) {
this.closeIframe(); this.closeIframe();
@ -334,8 +317,7 @@ export default {
// //
if (this.moved) { if (this.moved) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning', type: 'warning'
closeOnClickModal: false
}).then(() => { }).then(() => {
this.saveSort() this.saveSort()
this.moved = false this.moved = false
@ -347,7 +329,7 @@ export default {
this.sorting = false this.sorting = false
} }
} else { } else {
this.$router.push(this.$store.state.referrer || '/curriculum') this.$router.back()
} }
} }
}, },
@ -384,10 +366,19 @@ export default {
}, },
// //
beforeUpload(file) { beforeUpload(file) {
let type = this.transferType(file.name.substring(file.name.lastIndexOf(".") + 1));
// if (type != "" && type != "" && type != "pdf" && (file.size / 1024 / 1024) > 10) {
// this.$message.error("10M");
// return false;
// }
// if (type == "" && (file.size / 1024 / 1024) > 30) {
// this.$message.warning('30M')
// return false;
// }
this.uploading = true; this.uploading = true;
this.originalFileName = file.name; this.originalFileName = file.name;
if (this.isAddSection) this.sectionForm.sectionName = file.name.substring(0, file.name.lastIndexOf(".")); if (this.isAddSection) this.sectionName = file.name.substring(0, file.name.lastIndexOf("."));
this.fileType = Util.getFileExt(file.name) this.fileType = file.name.substring(file.name.lastIndexOf(".") + 1);
this.showProgress = true this.showProgress = true
}, },
handleExceed(files, fileList) { handleExceed(files, fileList) {
@ -395,12 +386,33 @@ export default {
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
); );
}, },
uploadSuccess (file) { //
handleRequest(data) {
const param = new FormData()
param.append('file', data.file)
const config = {
timeout: 10000000000,
headers: {
'Accept': '*/*',
'Content-Type': 'multipart/form-data'
},
//
onUploadProgress: progressEvent => {
const per = Number((progressEvent.loaded / progressEvent.total * 100).toFixed(2))
console.log("🚀 ~ file: contentSettings.vue ~ line 329 ~ handleRequest ~ per", per, this.progressPercent)
if (this.progressPercent <= 80) this.progressPercent = (per > 80) ? (Math.random() * 10 + 80).toFixed(2) : per
}
}
axios.post(this.api.fileupload, param, config).then(res => {
this.progressPercent = 100
this.showProgress = false
const { fileId, fileType, fileUrl, ossFileName } = res.data.data.filesResult
this.uploading = false this.uploading = false
this.fileId = '' this.fileId = fileId
this.fileType = file.format this.fileType = fileType
this.fileUrl = file.url this.fileUrl = fileUrl
this.fileName = file.name this.fileName = ossFileName
})
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.$message({ this.$message({
@ -414,9 +426,8 @@ export default {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
} }
}, },
handleRemove () { handleRemove(file, fileList) {
Oss.del(this.fileUrl) this.uploadList = fileList;
this.fileUrl = ''
}, },
uploadSure() { uploadSure() {
this.importVisible = false; this.importVisible = false;
@ -548,8 +559,11 @@ export default {
this.$del(`${this.api.deleteChapter}/${id}`).then(res => { this.$del(`${this.api.deleteChapter}/${id}`).then(res => {
this.$message.success("删除成功"); this.$message.success("删除成功");
this.getData(); this.getData();
}).catch(res => { }); }).catch(res => {
}).catch(() => { }); });
})
.catch(() => {
});
}, },
closeSection() { closeSection() {
this.isAddSection = false; this.isAddSection = false;
@ -557,7 +571,7 @@ export default {
}, },
addSection(id) { addSection(id) {
this.chapterId = id; this.chapterId = id;
this.sectionForm.sectionName = ""; this.sectionName = "";
this.fileUrl = ""; this.fileUrl = "";
this.uploadList = []; this.uploadList = [];
this.sectionId = ""; this.sectionId = "";
@ -589,15 +603,15 @@ export default {
}); });
} }
}, },
sectionSubmit (e) { sectionSubmit() {
if (!this.sectionForm.sectionName) return this.$message.warning("请填写小节名称"); if (!this.sectionName) return this.$message.warning("请填写小节名称");
if (this.uploading) return this.$message.warning("资源正在上传中,请稍候"); if (this.uploading) return this.$message.warning("资源正在上传中,请稍候");
if (!this.fileUrl && !this.fileId) return this.$message.warning("请上传资源"); if (!this.fileUrl && !this.fileId) return this.$message.warning("请上传资源");
let data = { let data = {
id: this.sectionId, id: this.sectionId,
cid: this.id, cid: this.id,
chapterId: this.chapterId, chapterId: this.chapterId,
name: this.sectionForm.sectionName, name: this.sectionName,
fileId: this.fileId, fileId: this.fileId,
fileUrl: this.fileUrl, fileUrl: this.fileUrl,
fileName: this.fileName, fileName: this.fileName,
@ -610,7 +624,7 @@ export default {
this.getData(); this.getData();
}) })
.catch(err => { .catch(err => {
}) });
}, },
closeSwitch() { closeSwitch() {
this.fileId = ""; this.fileId = "";
@ -622,19 +636,19 @@ export default {
}, },
// //
download(row) { download(row) {
const { fileType, fileId } = row const { fileType } = row
// ppt // ppt
if (fileType === 'pptx') { if (fileType === 'pptx') {
this.downloadFile(row.originalFileName || row.name, row.fileUrl) this.downloadFile(row.name, row.fileUrl)
} else if (fileId) { } else if (fileType === 'mp4') {
// //
this.$get(`${this.api.getPlayAuth}/${fileId}`).then(res => { this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => {
new Aliplayer({ const player = new Aliplayer({
id: "playerDownload", id: "playerDownload",
width: "100%", width: "100%",
autoplay: false, autoplay: false,
vid: fileId, vid: row.fileId,
playauth: res.playAuth, playauth: res.data.playAuth,
encryptType: 1 // encryptType: 1 //
}, player => { }, player => {
this.downloadFile(row.name, player._urls[0].Url) this.downloadFile(row.name, player._urls[0].Url)
@ -646,10 +660,8 @@ export default {
}, },
preview(row) { preview(row) {
if (this.transferType(row.fileType) == "视频") { if (this.transferType(row.fileType) == "视频") {
//
if (row.fileId) {
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => { this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => {
this.playAuth = res.playAuth; this.playAuth = res.data.playAuth;
if (this.player) { if (this.player) {
this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth); this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth);
} else { } else {
@ -662,10 +674,8 @@ export default {
encryptType: 1 // encryptType: 1 //
}); });
} }
}).catch(res => { }); }).catch(res => {
} else { });
this.videoSrc = row.fileUrl
}
} else if (this.transferType(row.fileType) == "图片") { } else if (this.transferType(row.fileType) == "图片") {
this.previewImg = row.fileUrl; this.previewImg = row.fileUrl;
} else if (row.fileType == "pdf") { } else if (row.fileType == "pdf") {
@ -705,7 +715,7 @@ export default {
editSectionName(row, chapterId) { editSectionName(row, chapterId) {
this.chapterId = chapterId; this.chapterId = chapterId;
this.sectionId = row.id; this.sectionId = row.id;
this.sectionForm.sectionName = row.name; this.sectionName = row.name;
this.sectionNameVisible = true; this.sectionNameVisible = true;
}, },
switchFile(row, chapterId, sectionId) { switchFile(row, chapterId, sectionId) {
@ -718,7 +728,7 @@ export default {
}; };
this.chapterId = chapterId; this.chapterId = chapterId;
this.sectionId = row.id; this.sectionId = row.id;
this.sectionForm.sectionName = row.sectionName; this.sectionName = row.sectionName;
this.switchVisible = true; this.switchVisible = true;
}, },
@ -727,7 +737,7 @@ export default {
id: this.sectionId, id: this.sectionId,
cid: this.id, cid: this.id,
chapterId: this.chapterId, chapterId: this.chapterId,
name: this.sectionForm.sectionName, name: this.sectionName,
fileId: this.fileId, fileId: this.fileId,
fileName: this.fileName, fileName: this.fileName,
fileType: this.fileType, fileType: this.fileType,
@ -745,7 +755,20 @@ export default {
switchSubmit() { switchSubmit() {
if (this.uploading) return this.$message.warning("资源正在上传中,请稍候"); if (this.uploading) return this.$message.warning("资源正在上传中,请稍候");
if (!this.fileUrl && !this.fileId) return this.$message.warning("请上传资源"); if (!this.fileUrl && !this.fileId) return this.$message.warning("请上传资源");
if (this.transferType(this.curFile.fileType) == "视频") {
let data = {
videoIdList: [this.sectionId]
};
this.$del(`${this.api.removeVideo}/${this.curFile.fileId}`).then(res => {
this.switchSubmitFile(); this.switchSubmitFile();
}).catch(res => {
});
} else {
this.$del(`${this.api.fileDeletion}?keys=${this.curFile.fileName}`).then(res => {
this.switchSubmitFile();
}).catch(res => {
});
}
}, },
delSection(row) { delSection(row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
@ -753,7 +776,6 @@ export default {
}) })
.then(() => { .then(() => {
this.$del(`${this.api.deleteSubsection}/${row.id}`).then(res => { this.$del(`${this.api.deleteSubsection}/${row.id}`).then(res => {
row.fileUrl && Oss.del(row.fileUrl)
this.$message.success("删除成功"); this.$message.success("删除成功");
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
@ -788,12 +810,12 @@ export default {
} }
}, },
sectionNameSubmit() { sectionNameSubmit() {
if (!this.sectionForm.sectionName) return this.$message.warning("请填写小节名称"); if (!this.sectionName) return this.$message.warning("请填写小节名称");
let data = { let data = {
id: this.sectionId, id: this.sectionId,
cid: this.id, cid: this.id,
chapterId: this.chapterId, chapterId: this.chapterId,
name: this.sectionForm.sectionName name: this.sectionName
}; };
this.$put(this.api.editSubsection, data).then(res => { this.$put(this.api.editSubsection, data).then(res => {
this.$message.success("修改成功"); this.$message.success("修改成功");
@ -809,7 +831,6 @@ export default {
}, },
closeIframe() { closeIframe() {
this.iframeSrc = ""; this.iframeSrc = "";
this.videoSrc = ''
this.showMask = false; this.showMask = false;
this.showMask1 = false; this.showMask1 = false;
this.showMask2 = false; this.showMask2 = false;
@ -824,11 +845,10 @@ export default {
max-height: calc(100vh - 420px); max-height: calc(100vh - 420px);
overflow: auto; overflow: auto;
} }
.action-btn{ .action-btn{
color: #9076ff; color: #9076FF;
font-size: 14px; font-size: 14px;
border: #9076ff 1px solid; border: #9076FF 1px solid;
background-color: #fff; background-color: #fff;
border-radius: 4px; border-radius: 4px;
} }
@ -849,15 +869,13 @@ export default {
&.disabled { &.disabled {
color: #ccc; color: #ccc;
cursor: not-allowed; cursor: not-allowed
} }
} }
/deep/.el-progress-bar { /deep/.el-progress-bar {
padding-right: 70px; padding-right: 70px;
margin-right: -70px; margin-right: -70px;
} }
.el-upload__tip { .el-upload__tip {
position: absolute; position: absolute;
top: -4px; top: -4px;
@ -865,13 +883,12 @@ export default {
width: 300px; width: 300px;
line-height: 1.4; line-height: 1.4;
} }
.el-image-viewer__wrapper { .el-image-viewer__wrapper {
transform: translateY(-10px); transform: translateY(-10px);
transition: transform 0.5s; transition: transform .5s;
&.active { &.active {
transform: translateY(0); transform: translateY(0)
} }
} }
@ -895,7 +912,6 @@ export default {
width: 1200px !important; width: 1200px !important;
height: 600px !important; height: 600px !important;
} }
.player-download { .player-download {
position: absolute; position: absolute;
top: -9999px; top: -9999px;
@ -975,7 +991,7 @@ export default {
margin-right: 6px; margin-right: 6px;
font-size: 14px; font-size: 14px;
line-height: 14px; line-height: 14px;
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, .65);
white-space: nowrap; white-space: nowrap;
} }
} }

File diff suppressed because it is too large Load Diff

@ -1,11 +1,8 @@
<template> <template>
<div> <div>
<el-card shadow="hover" <el-card shadow="hover" class="mgb20">
class="mgb20">
<div class="flex-between"> <div class="flex-between">
<div class="per_title" <div class="per_title" v-preventReClick @click="back">
v-preventReClick
@click="back">
<i class="el-icon-arrow-left"></i> <i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span> <span class="per_back">返回</span>
<span class="per_school">{{ $route.query.userName }}的订单</span> <span class="per_school">{{ $route.query.userName }}的订单</span>
@ -13,80 +10,45 @@
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" <el-card shadow="hover" class="card">
class="card">
<div class="flex-between mgb20"> <div class="flex-between mgb20">
<div class="flex-center"> <div class="flex-center">
<p class="hr_tag"></p> <p class="hr_tag"></p>
<span>订单列表</span> <span>订单列表</span>
</div> </div>
<el-input style="width: 300px" <el-input style="width: 300px" placeholder="请输入订单编号/产品名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
placeholder="请输入订单编号/产品名称"
prefix-icon="el-icon-search"
v-model="keyword"
clearable></el-input>
</div> </div>
<el-table :data="orderData" <el-table :data="orderData" class="table" ref="table" stripe header-align="center"
class="table" @selection-change="handleSelectionChange" :row-key="getRowKeys">
ref="table" <el-table-column type="index" width="100" label="序号" align="center">
stripe
header-align="center"
@selection-change="handleSelectionChange"
:row-key="getRowKeys">
<el-table-column type="index"
width="100"
label="序号"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="orderNumber" <el-table-column prop="orderNumber" label="订单编号" align="center">
label="订单编号"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="customerName" <el-table-column prop="customerName" label="客户名称" align="center">
label="客户名称"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ customerName }} {{ customerName }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="productName" <el-table-column prop="productName" label="产品内容" align="center" show-overflow-tooltip></el-table-column>
label="产品内容" <el-table-column prop="orderAmount" label="订单金额(元)" align="center">
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="orderAmount"
label="订单金额(元)"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="createTime" <el-table-column prop="createTime" label="订单日期" align="center">
label="订单日期"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="orderType" <el-table-column prop="orderType" label="订单类型" align="center">
label="订单类型"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="orderStatus" <el-table-column prop="orderStatus" label="订单状态" align="center">
label="订单状态"
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="orderNature" <el-table-column prop="orderNature" label="订单性质" align="center">
label="订单性质"
align="center">
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作" align="center">
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" <el-button type="text" @click="toDetail(scope.row)">查看</el-button>
@click="toDetail(scope.row)">查看</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background <el-pagination background layout="total, prev, pager, next"
layout="total, prev, pager, next" @current-change="handleCurrentChange" :current-page="page" :total="totals">
@current-change="handleCurrentChange"
:current-page="page"
:total="totals">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
@ -118,13 +80,6 @@ export default {
} }
}, },
created() { created() {
const { orderParam } = this.$store.state
if (orderParam) {
this.keyword = orderParam.keyword
this.page = orderParam.page
this.$store.commit('setOrderParam', null)
}
this.getData(); this.getData();
}, },
methods: { methods: {
@ -152,21 +107,13 @@ export default {
this.page = 1 this.page = 1
this.getData() this.getData()
}, },
handleCurrentChange (val) {
this.page = val
this.getData()
},
toDetail(row) { toDetail(row) {
this.$store.commit('setOrderParam', {
keyword: this.keyword,
page: this.page,
})
this.$router.push({ this.$router.push({
path:'/AddOrder', path:'/AddOrder',
query:{ query:{
val: 'watch', val: 'watch',
orderId: row.orderId, orderId: row.orderId,
orderStatus: row.orderStatus === '已完成' ? 1 : 0, orderStatus: row.orderStatus === '已完成' ? 1 : 0
} }
}) })
}, },
@ -196,8 +143,7 @@ export default {
} }
.tags{ .tags{
border: none; border: none;
background: none; background: none;color: #000;
color: #000;
white-space:pre-wrap; white-space:pre-wrap;
width: 140px; width: 140px;
overflow: hidden; overflow: hidden;

@ -1,5 +1,5 @@
<template> <template>
<div v-loading="loading"> <div>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="mgb20">
<div> <div>
<div class="flex-center mgb20"> <div class="flex-center mgb20">
@ -9,35 +9,29 @@
<div> <div>
<el-form label-width="80px"> <el-form label-width="80px">
<el-col :span="4"> <el-col :span="4">
<el-form-item label="省份"> <el-form-item label="国家">
<el-select v-model="form.provinces" clearable placeholder="请选择省份" @change="getCity" <el-select v-model="form.countries" placeholder="请选择国家">
@clear="clearprovince"> <el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.name"></el-option>
<el-option v-for="(item, index) in provinceList" :key="index" :label="item.provinceName"
:value="item.provinceId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="城市"> <el-form-item label="省份">
<el-select v-model="form.city" clearable placeholder="请选择城市" :disabled="form.provinces ? false : true" <el-select v-model="form.provinces" clearable placeholder="请选择省份" @change="getCity" @clear="clearprovince">
@change="initData"> <el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
<el-option v-for="(item, index) in cityList" :key="index" :label="item.cityName"
:value="item.cityId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="客户类型"> <el-form-item label="城市">
<el-select v-model="form.customerType" placeholder="请选择客户类型" @change="initData"> <el-select v-model="form.city" clearable placeholder="请选择城市" :disabled="form.provinces ? false : true" @change="initData">
<el-option v-for="(item, index) in customerTypeList" :key="index" :label="item.name" <el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
:value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item>
<el-input placeholder="支持客户,联系人,账号搜索" prefix-icon="el-icon-search" v-model="form.keyword" <el-input placeholder="支持客户,联系人,账号搜索" prefix-icon="el-icon-search" v-model="form.keyword" clearable></el-input>
clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
@ -52,13 +46,11 @@
<span>客户列表</span> <span>客户列表</span>
</div> </div>
<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 class="mag" @click="addcustomer" v-auth>新增</el-button>
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button> <el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
</div> </div>
</div> </div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" <el-table v-loading="loading" :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="customerId">
@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="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -72,11 +64,7 @@
<span class="ellipsis">{{scope.row.industryName}}</span> <span class="ellipsis">{{scope.row.industryName}}</span>
</template> </template>
</el-table-column> </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>
</template>
</el-table-column> </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>
@ -92,14 +80,13 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="resetPassword(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="show(scope.row)" v-auth>查看</el-button>
<el-button type="text" @click="edit(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="handleDelete(scope.row)" v-auth>删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" <el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
:current-page="page">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
@ -108,9 +95,6 @@
<script> <script>
import Setting from '@/setting' import Setting from '@/setting'
import axios from 'axios';
import util from "@/libs/util";
import qs from 'qs'
export default { export default {
name: 'customer', name: 'customer',
data() { data() {
@ -120,29 +104,12 @@ export default {
countryList: [{ countryList: [{
name:'中国' name:'中国'
}], }],
customerTypeList: [
{
value: '',
name: '不限'
},
{
name: '正式',
value: 1
},
{
name: '试用',
value: 2
},
{
name: '到期',
value: 3
}],
listData: [], listData: [],
form: { form: {
customerType: +this.$route.query.customerType || '', countries:'中国',
provinces: +this.$route.query.provinces || '', provinces: '',
city: +this.$route.query.city || '', city: '',
keyword: this.$route.query.keyword || '' keyword: ''
}, },
multipleSelection: [], multipleSelection: [],
provinceList: [], provinceList: [],
@ -162,11 +129,6 @@ export default {
}, },
}, },
mounted() { mounted() {
const { query } = this.$route
if (query.page) {
this.$router.push('/customer').catch(() => { })
}
this.getData() this.getData()
this.getProvince() this.getProvince()
}, },
@ -175,9 +137,9 @@ export default {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '客户管理') const sid = this.$store.state.dataPer.find(e => e.permissionName === '客户管理')
this.loading = true this.loading = true
this.$post(this.api.queryCustomer,{ this.$post(this.api.queryCustomer,{
countries: this.form.countries,
provinceId: this.form.provinces, provinceId: this.form.provinces,
cityId: this.form.city, cityId: this.form.city,
customerType: this.form.customerType,
searchContent: this.form.keyword, searchContent: this.form.keyword,
page: this.page, page: this.page,
size: this.pageSize, size: this.pageSize,
@ -198,7 +160,6 @@ export default {
this.$get(this.api.queryProvince).then(res => { this.$get(this.api.queryProvince).then(res => {
this.provinceList = res.list this.provinceList = res.list
this.$store.commit("provinceData", { provinceList : this.provinceList}) this.$store.commit("provinceData", { provinceList : this.provinceList})
this.form.city && this.getCityData()
}).catch(res => {}) }).catch(res => {})
}, },
clearprovince(){ clearprovince(){
@ -221,47 +182,13 @@ export default {
permission(row){ permission(row){
this.$router.push(`/permission?name=${row.customerName}`) this.$router.push(`/permission?name=${row.customerName}`)
}, },
//
async exportData () {
let sid = this.$store.state.dataPer.find(e => e.permissionName === '客户管理')
sid = (sid && !sid.all) ? sid.supplierId : ''
let list = this.multipleSelection
//
if (!list.length) {
const res = await this.$post(this.api.queryCustomer, {
page: 1,
size: 1000,
supplierId: sid
})
list = res.message.list
}
const ids = list.map(e => e.customerId)
axios.post(this.api.exportClient, {
exportCustomerIds: ids,
supplierId: sid
}, {
headers: {
token: this.token
},
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`客户列表.xlsx`, new Blob([res.data]))
}).catch(res => { })
},
// url
setReferrer () {
this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`)
},
addcustomer(){ addcustomer(){
this.setReferrer()
this.$router.push('addcustomer') this.$router.push('addcustomer')
}, },
edit(row){ edit(row){
this.setReferrer()
this.$router.push(`addcustomer?id=${row.customerId}`) this.$router.push(`addcustomer?id=${row.customerId}`)
}, },
show(row){ show(row){
this.setReferrer()
this.$router.push(`addcustomer?id=${row.customerId}&show=true`) this.$router.push(`addcustomer?id=${row.customerId}&show=true`)
}, },
handleDelete(row) { handleDelete(row) {
@ -311,6 +238,7 @@ export default {
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val this.page = val
this.$store.commit('SET_C_PAGE', val)
this.$router.push(`customer?page=${val}`) this.$router.push(`customer?page=${val}`)
this.getData() this.getData()
}, },
@ -338,3 +266,4 @@ export default {
min-height: calc(100vh - 300px); min-height: calc(100vh - 300px);
} }
</style> </style>

@ -1,63 +1,38 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<div class="side"> <div class="side">
<el-tree ref="type" <el-tree ref="type" :data="typeList" node-key="id" accordion :default-expanded-keys="defaultActive" :current-node-key="categoryId" :props="defaultProps" :highlight-current="true" @current-change="typeClick"></el-tree>
:data="typeList"
node-key="id"
accordion
:default-expanded-keys="defaultActive"
:current-node-key="categoryId"
:props="defaultProps"
:highlight-current="true"
@current-change="typeClick"></el-tree>
</div> </div>
<div class="right"> <div class="right">
<div class="flex-between" <div class="flex-between" style="margin-bottom: 10px;">
style="margin-bottom: 10px;">
<p>数据简介</p> <p>数据简介</p>
<el-button v-if="introduceText && !editing" <el-button v-if="introduceText && !editing" type="primary" @click="editing = !editing" v-auth="'/data:数据简介:编辑'">编辑</el-button>
type="primary"
@click="editing = !editing"
v-auth="'/data:数据简介:编辑'">编辑</el-button>
</div> </div>
<div class="intro" <div class="intro" v-if="!introduceText && !editing">
v-if="!introduceText && !editing">
<p class="text">请添加简介</p> <p class="text">请添加简介</p>
<div class="btn"> <div class="btn">
<el-button type="primary" <el-button type="primary" @click="edit">添加</el-button>
@click="edit">添加</el-button>
</div> </div>
</div> </div>
<template v-if="introduceText || editing"> <template v-if="introduceText || editing">
<el-input placeholder="请输入简介" <el-input placeholder="请输入简介" v-model="introduce" type="textarea" rows="5" :disabled="!editing"></el-input>
v-model="introduce"
type="textarea"
rows="5"
:disabled="!editing"></el-input>
<div class="field"> <div class="field">
<p class="label">数据源</p> <p class="label">数据源</p>
<el-input style="width: 250px" <el-input style="width: 250px" placeholder="请输入数据源" v-model="dataSource" type="text" :disabled="!editing"></el-input>
placeholder="请输入数据源"
v-model="dataSource"
type="text"
:disabled="!editing"></el-input>
</div> </div>
</template> </template>
<div class="field"> <div class="field">
<p class="label">关键字</p> <p class="label">关键字</p>
<div class="tag-add" <div class="tag-add" v-if="editing">
v-if="editing"> <el-input placeholder="请输入关键字" size="small" v-model="newKeyword"></el-input>
<el-input placeholder="请输入关键字"
size="small"
v-model="newKeyword"></el-input>
<span v-if="editing"> <span v-if="editing">
<el-button @click="save" <el-button @click="save" style="color: #9076FF;border: 1px solid #9076FF;border-radius:5px;height: 25px;line-height: 0px"> </el-button>
style="color: #9076FF;border: 1px solid #9076FF;border-radius:5px;height: 25px;line-height: 0px"> </el-button>
</span> </span>
</div> </div>
<div class="tag-wrap"> <div class="tag-wrap">
<el-tag :key="tag.id" <el-tag
:key="tag.id"
:type="editing ? '' : 'info'" :type="editing ? '' : 'info'"
v-for="tag in keywordList" v-for="tag in keywordList"
:closable="editing" :closable="editing"
@ -67,11 +42,9 @@
</el-tag> </el-tag>
</div> </div>
</div> </div>
<div class="btns" <div class="btns" v-if="editing">
v-if="editing">
<el-button @click="editing = false"> </el-button> <el-button @click="editing = false"> </el-button>
<el-button type="primary" <el-button type="primary" @click="confirmData"> </el-button>
@click="confirmData"> </el-button>
</div> </div>
</div> </div>
</div> </div>
@ -80,7 +53,6 @@
export default { export default {
data() { data() {
return { return {
id: this.$route.query.id || '',
typeList: [], typeList: [],
defaultProps: { defaultProps: {
children: 'children', children: 'children',
@ -123,10 +95,11 @@ export default {
}) })
} }
handleId(res) handleId(res)
console.log(res)
this.typeList = res this.typeList = res
if (!this.edited) {
// id // id
if (!this.edited) {
if(res[0].children.length){ if(res[0].children.length){
let item = res[0].children[0] let item = res[0].children[0]
this.categoryId = item.id this.categoryId = item.id
@ -146,18 +119,13 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.type.setCurrentKey(this.categoryId) this.$refs.type.setCurrentKey(this.categoryId)
}) })
} else if (this.id) {
this.$nextTick(() => {
this.defaultActive = [+this.id]
this.$refs.type.setCurrentKey(+this.id)
})
} }
this.getKeyword() this.getKeyword()
}).catch(res => {}) }).catch(res => {})
}, },
// //
typeClick(data,node){ typeClick(data,node){
this.$router.push(`/data?tab=third&id=${data.id}`).catch(e => { }) console.log(data)
this.editing = false this.editing = false
this.categoryId = data.id this.categoryId = data.id
this.defaultActive = [data.id] this.defaultActive = [data.id]
@ -181,6 +149,7 @@ export default {
}, },
// //
saveType(){ saveType(){
const id = this.categoryId // id const id = this.categoryId // id
this.$post(this.api.updateCategory,{ this.$post(this.api.updateCategory,{
id, id,
@ -191,7 +160,7 @@ export default {
this.introduceText = this.introduce this.introduceText = this.introduce
this.editing = false this.editing = false
this.edited = true this.edited = true
this.getData() // this.getData()
}).catch(res => {}) }).catch(res => {})
}, },
// //

@ -6,19 +6,26 @@
<h1>欢迎使用开发者平台</h1> <h1>欢迎使用开发者平台</h1>
<div class="form"> <div class="form">
<ul class="tab"> <ul class="tab">
<li v-for="(item, i) in tabList" :key="i" :class="{ active: activeIndex == item.id }" <li v-for="(item, i) in tabList" :key="i" :class="{active: activeIndex == item.id}" @click="handleSelect(item.id)">{{item.label}}</li>
@click="handleSelect(item.id)">{{ item.label }}</li>
</ul> </ul>
<el-form v-show="activeIndex==='1'" :model="param" :rules="rules" ref="login" label-width="0px"> <el-form v-show="activeIndex==='1'" :model="param" :rules="rules" ref="login" label-width="0px">
<el-form-item prop="account"> <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>
<el-form-item prop="password"> <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-input>
</el-form-item> </el-form-item>
<el-form-item prop="code" v-if="showVerify"> <el-form-item prop="code" v-if="showVerify">
<el-input placeholder="请输入验证码" v-model="param.code" @keyup.enter.native="submitForm()"> <el-input
placeholder="请输入验证码"
v-model="param.code"
@keyup.enter.native="submitForm()"
>
</el-input> </el-input>
<img @click="blur" :src="verificationIMG" class="verification" alt=""> <img @click="blur" :src="verificationIMG" class="verification" alt="">
</el-form-item> </el-form-item>
@ -27,17 +34,24 @@
</div> </div>
</el-form> </el-form>
<el-form v-show="activeIndex === '2'" :model="phoneOrEmail" :rules="phoneOrEmailrules" ref="phoneOrEmail" <el-form v-show="activeIndex==='2'" :model="phoneOrEmail" :rules="phoneOrEmailrules" ref="phoneOrEmail" label-width="0px">
label-width="0px">
<el-form-item prop="account"> <el-form-item prop="account">
<el-input @blur="phoneBlur" v-model="phoneOrEmail.account" placeholder="请输入电话/邮箱"></el-input> <el-input @blur="phoneBlur" v-model="phoneOrEmail.account" placeholder="请输入电话/邮箱"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <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-input>
</el-form-item> </el-form-item>
<el-form-item prop="code" v-if="showPhoneVerify"> <el-form-item prop="code" v-if="showPhoneVerify">
<el-input placeholder="请输入验证码" v-model="phoneOrEmail.code" @keyup.enter.native="submitForm('phone')"> <el-input
placeholder="请输入验证码"
v-model="phoneOrEmail.code"
@keyup.enter.native="submitForm('phone')"
>
</el-input> </el-input>
<img @click="phoneBlur" :src="PhoneVerificationIMG" class="verification" alt=""> <img @click="phoneBlur" :src="PhoneVerificationIMG" class="verification" alt="">
</el-form-item> </el-form-item>
@ -57,8 +71,7 @@
<el-form-item label="验证码"> <el-form-item label="验证码">
<div style="display:flex;"> <div style="display:flex;">
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input> <el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input>
<el-button style="margin-left:10px" @click="sendPhoneCode" :disabled="phoneDisabled">{{ phoneBtnText <el-button style="margin-left:10px" @click="sendPhoneCode" :disabled="phoneDisabled">{{phoneBtnText}}</el-button>
}}</el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -67,20 +80,6 @@
<el-button type="primary" @click="phoneSubmit"> </el-button> <el-button type="primary" @click="phoneSubmit"> </el-button>
</span> </span>
</el-dialog> </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> <v-footer class="footer" ref="footer"></v-footer>
</div> </div>
</template> </template>
@ -88,9 +87,6 @@
<script> <script>
import vFooter from '../components/Footer' import vFooter from '../components/Footer'
import Setting from '@/setting' import Setting from '@/setting'
import addRoutes from '@/libs/route/addRoutes'
import CryptoJS from 'crypto-js'
import JSEncrypt from 'jsencrypt'
export default { export default {
data: function() { data: function() {
var regPhoneOrEmail = (rule, value, callback) => {// var regPhoneOrEmail = (rule, value, callback) => {//
@ -159,10 +155,8 @@ export default {
phoneDisabled:false, phoneDisabled:false,
phoneBtnText: '发送验证码', phoneBtnText: '发送验证码',
phoneTimer:'', phoneTimer:'',
phoneOpener: '', phoneOpener:''
userVisible: false,
users: [],
}; };
}, },
components: { components: {
@ -196,29 +190,26 @@ export default {
let param = val==='phone'?this.phoneOrEmail:this.param let param = val==='phone'?this.phoneOrEmail:this.param
this.$refs[ref].validate(valid => { this.$refs[ref].validate(valid => {
if (valid) { if (valid) {
this.$post(this.api.logins, param).then(({ status, data, message }) => { this.$post(this.api.logins,param).then(res => {
localStorage.removeItem('examPath') const { message } = res
localStorage.removeItem('reviewPath') sessionStorage.setItem('token',res.data.token)
this.getOss() this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`).then(res => {
if (status == 200) { const list = res.permissionMenu
const accounts = data.userAccounts this.$store.commit('setDataPer', res.dataPermissionList)
// this.$message.success(message);
if (accounts instanceof Array) { this.$router.push({
this.users = accounts path: list[0].children[0].path
this.userVisible = true });
} else { localStorage.setItem('ms_username', this.param.username);
sessionStorage.setItem('token', data.token) }).catch(err => {
this.setLogin() if (err.status === 500) {
} sessionStorage.clear()
} else {
param.code = ''
this.$message.error(message)
} }
})
}).catch(err => { }).catch(err => {
if(err.status===30001){ if(err.status===30001){
this.phoneVisible = true this.phoneVisible = true
} else if (err.status == 10004 || err.status == 10005) { }else if(err.status == 10004){
param.code = ''
this.blur() this.blur()
} }
}); });
@ -227,54 +218,7 @@ export default {
return false; 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(){ blur(){
this.param.random = Math.floor(Math.random()*999999999) this.param.random = Math.floor(Math.random()*999999999)
@ -361,28 +305,24 @@ export default {
.wrap { .wrap {
min-height: 100%; min-height: 100%;
} }
.logo { .logo {
z-index: 2; z-index: 2;
position: absolute; position: absolute;
top: 50px; top: 50px;
left: 50px; left: 50px;
} }
.login { .login {
position: relative; position: relative;
height: 100%; height: 100%;
background-image: url(../assets/img/devLogin.jpg); background-image: url(../assets/img/devLogin.jpg);
background-size: 100%; background-size: 100%;
} }
.box { .box {
width: 448px; width: 448px;
position: absolute; position: absolute;
right: 20%; right: 20%;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
h1 { h1 {
margin-bottom: 20px; margin-bottom: 20px;
font-size: 34px; font-size: 34px;
@ -390,25 +330,21 @@ export default {
text-align: center; text-align: center;
} }
} }
/deep/ .form { /deep/ .form {
padding: 20px 60px 0; padding: 20px 60px 0;
background-color: rgba(255, 255, 255, .3); background-color: rgba(255, 255, 255, .3);
border-radius: 4px; border-radius: 4px;
box-sizing: border-box; box-sizing: border-box;
border: 4px solid rgba(255, 255, 255, .2); border: 4px solid rgba(255, 255, 255, .2);
.el-input__inner { .el-input__inner {
height: 50px; height: 50px;
line-height: 50px; line-height: 50px;
border: 1px solid rgba(220, 220, 220, 1); border: 1px solid rgba(220, 220, 220, 1);
border-radius: 2px; border-radius: 2px;
} }
.el-form-item { .el-form-item {
margin-bottom: 25px; margin-bottom: 25px;
} }
.verification{ .verification{
position: absolute; position: absolute;
top: 1px; top: 1px;
@ -418,13 +354,11 @@ export default {
cursor: pointer; cursor: pointer;
} }
} }
.tab{ .tab{
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
margin-bottom: 24px; margin-bottom: 24px;
li{ li{
padding: 18px 5px; padding: 18px 5px;
margin: 0 20px; margin: 0 20px;
@ -433,28 +367,23 @@ export default {
color: #fff; color: #fff;
cursor: pointer; cursor: pointer;
border-bottom: 2px solid transparent; border-bottom: 2px solid transparent;
&:last-child{ &:last-child{
margin-right: 0; margin-right: 0;
} }
&.active{ &.active{
color: #fff; color: #fff;
border-bottom-color: #ccc; border-bottom-color: #ccc;
} }
} }
} }
.title{ .title{
font-size: 16px; font-size: 16px;
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
} }
.login-btn { .login-btn {
text-align: center; text-align: center;
} }
.login-btn button { .login-btn button {
width: 100%; width: 100%;
height: 48px; height: 48px;
@ -464,55 +393,13 @@ export default {
border-radius: 4px; border-radius: 4px;
border: 0; border: 0;
} }
.forget{ .forget{
margin-bottom: 28px; margin-bottom: 28px;
text-align: right; text-align: right;
color: #999; color: #999;
font-weight:bold; font-weight:bold;
&:hover{ &:hover{
color: #0092FF; 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> </style>

@ -1,74 +1,51 @@
<template> <template>
<div> <div>
<el-card shadow="hover" <el-card shadow="hover" class="m-b-20">
class="m-b-20">
<div class="flex-between"> <div class="flex-between">
<el-page-header @back="goBack" <el-page-header @back="goBack" :content="'新增文章'"></el-page-header>
:content="'新增文章'"></el-page-header>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" <el-card shadow="hover" class="m-b-20">
class="m-b-20"> <el-form :model="form" :rules="rules" ref="form" label-width="90px" label-suffix=":" size="small">
<el-form :model="form" <el-form-item prop="coverUrl" label="封面图">
:rules="rules" <el-upload
ref="form" class="avatar-uploader"
label-width="90px"
label-suffix=":"
size="small">
<el-form-item prop="coverUrl"
label="封面图">
<el-upload class="avatar-uploader"
accept=".jpg,.png,.jpeg" accept=".jpg,.png,.jpeg"
:on-remove="handleRemove" :on-remove="handleRemove"
:on-error="uploadError" :on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove" :before-remove="beforeRemove"
:limit="1" :limit="1"
:on-exceed="handleExceed" :on-exceed="handleExceed"
action="" :action="this.api.fileupload"
:http-request="handleRequest"> :headers="headers"
<img v-if="form.coverUrl" name="file"
:src="form.coverUrl" >
class="avatar"> <img v-if="form.coverUrl" :src="form.coverUrl" class="avatar">
<div class="uploader-default" <div class="uploader-default" v-else>
v-else>
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
<p>上传封面</p> <p>上传封面</p>
</div> </div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item prop="author" <el-form-item prop="author" label="作者">
label="作者">
<div class="d-inline-block"> <div class="d-inline-block">
<el-input placeholder="请输入作者" <el-input placeholder="请输入作者" v-model="form.author" clearable></el-input>
v-model="form.author"
clearable></el-input>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item prop="date" <el-form-item prop="date" label="日期">
label="日期">
<div class="d-inline-block"> <div class="d-inline-block">
<el-date-picker v-model="form.date" <el-date-picker v-model="form.date" type="date" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期"></el-date-picker>
type="date"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期"></el-date-picker>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item prop="title" <el-form-item prop="title" label="文章标题">
label="文章标题"> <el-input placeholder="请输入文章标题" v-model="form.title" clearable></el-input>
<el-input placeholder="请输入文章标题"
v-model="form.title"
clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="content" <el-form-item prop="content" label="文章内容">
label="文章内容"> <quill :border="true" v-model="form.content" :uploading.sync="uploading" :height="400" />
<quill :border="true"
v-model="form.content"
:uploading.sync="uploading"
:height="400" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" <el-button type="primary" @click="saveData">确定</el-button>
@click="saveData">确定</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
@ -76,7 +53,6 @@
</template> </template>
<script> <script>
import Oss from '@/components/upload/upload.js'
import quill from "@/components/quill"; import quill from "@/components/quill";
import util from "@/libs/util"; import util from "@/libs/util";
export default { export default {
@ -172,12 +148,14 @@ export default {
handleExceed(files, fileList) { handleExceed(files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
}, },
// uploadSuccess(res, file, fileList) {
async handleRequest ({ file }) { if (this.form.coverUrl) {
this.form.coverUrl && Oss.del(this.form.coverUrl) let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
Oss.upload(file).then(res => { this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.form.coverUrl = res.url }).catch(res => {
}) });
}
this.form.coverUrl = res.data.filesResult.fileUrl;
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.$message({ this.$message({
@ -190,8 +168,11 @@ export default {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
Oss.del(this.form.coverUrl) let fileName = this.form.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.form.coverUrl = '' this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.form.coverUrl = "";
}).catch(res => {
});
}, },
uploadSure() { uploadSure() {
this.BatchUpload = false; this.BatchUpload = false;
@ -204,8 +185,7 @@ export default {
}, },
goback() { goback() {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", { this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: "warning", type: "warning"
closeOnClickModal: false
}) })
.then(() => { .then(() => {
this.back(); this.back();
@ -241,7 +221,7 @@ $avatar-width: 104px;
overflow: hidden; overflow: hidden;
&:hover { &:hover {
border-color: #409eff; border-color: #409EFF;
} }
.uploader-default { .uploader-default {
@ -292,8 +272,7 @@ $avatar-width: 104px;
/deep/ .d-inline-block { /deep/ .d-inline-block {
width: 216px; width: 216px;
.el-select, .el-select, .el-input {
.el-input {
width: 100%; width: 100%;
} }
} }

@ -3,65 +3,35 @@
<div class="page"> <div class="page">
<div class="btn-wrap"> <div class="btn-wrap">
<template v-if="sorting"> <template v-if="sorting">
<el-button class="action-btn" <el-button class="action-btn" type="primary" round @click="cancelSort">取消</el-button>
type="primary" <el-button class="action-btn" type="primary" round @click="sortSubmit">保存</el-button>
round
@click="cancelSort">取消</el-button>
<el-button class="action-btn"
type="primary"
round
@click="sortSubmit">保存</el-button>
</template> </template>
<template v-if="!sorting"> <template v-if="!sorting">
<el-button v-auth="'栏目管理:更改排序'" <el-button v-auth="'栏目管理:更改排序'" class="action-btn" type="primary" round @click="openSort">更改排序
class="action-btn"
type="primary"
round
@click="openSort">更改排序
</el-button> </el-button>
<el-button v-auth="'栏目管理:添加栏目'" <el-button v-auth="'栏目管理:添加栏目'" class="action-btn" type="primary" round @click="handleColumn(false, 0, 0)">添加栏目
class="action-btn"
type="primary"
round
@click="handleColumn(false, 0, 0)">添加栏目
</el-button> </el-button>
</template> </template>
</div> </div>
<div class="page-content" <div class="page-content" style="padding-top: 24px; margin-top: 24px">
style="padding-top: 24px; margin-top: 24px">
<div class="el-table"> <div class="el-table">
<div class="list"> <div class="list">
<div class="thead"> <div class="thead">
<span>栏目名称</span> <span>栏目名称</span>
<span><em :class="{hide: sorting}" <span><em :class="{hide: sorting}" style="font-style: normal">操作</em></span>
style="font-style: normal">操作</em></span>
</div> </div>
</div> </div>
<el-tree :data="list" <el-tree :data="list" node-key="id" default-expand-all :draggable="sorting" :allow-drop="allowDrop">
node-key="id" <span class="custom-tree-node" slot-scope="{ node, data }">
default-expand-all
:draggable="sorting"
:allow-drop="allowDrop">
<span class="custom-tree-node"
slot-scope="{ node, data }">
<span class="name">{{ data.name }}</span> <span class="name">{{ data.name }}</span>
<span class="action" <span class="action" v-show="!sorting">
v-show="!sorting"> <el-button v-auth="'栏目管理:编辑'" type="text" @click.stop="handleColumn(data)">编辑</el-button>
<el-button v-auth="'栏目管理:编辑'" <el-divider v-auth="'栏目管理:编辑'" direction="vertical"></el-divider>
type="text"
@click.stop="handleColumn(data)">编辑</el-button>
<el-divider v-auth="'栏目管理:编辑'"
direction="vertical"></el-divider>
<template v-if="node.level < 4"> <template v-if="node.level < 4">
<el-button v-auth="'栏目管理:新增'" <el-button v-auth="'栏目管理:新增'" type="text" @click.stop="handleColumn(data, data.id, data.level + 1)">新增</el-button>
type="text" <el-divider v-auth="'栏目管理:新增'" direction="vertical"></el-divider>
@click.stop="handleColumn(data, data.id, data.level + 1)">新增</el-button>
<el-divider v-auth="'栏目管理:新增'"
direction="vertical"></el-divider>
</template> </template>
<el-button v-auth="'栏目管理:删除'" <el-button v-auth="'栏目管理:删除'" type="text" @click.stop="delData(data)">删除</el-button>
type="text"
@click.stop="delData(data)">删除</el-button>
</span> </span>
</span> </span>
</el-tree> </el-tree>
@ -69,22 +39,16 @@
</div> </div>
</div> </div>
<el-dialog :title="!curRow.id ? '添加栏目' : '编辑栏目'" <el-dialog :title="!curRow.id ? '添加栏目' : '编辑栏目'" :visible.sync="columnVisible" width="400px"
:visible.sync="columnVisible" :close-on-click-modal="false" @close="closeColumn">
width="400px"
:close-on-click-modal="false"
@close="closeColumn">
<el-form> <el-form>
<el-form-item> <el-form-item>
<el-input placeholder="栏目名称" <el-input placeholder="栏目名称" v-model="curRow.name"></el-input>
v-model="curRow.name"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer">
<el-button @click="columnVisible = false"> </el-button> <el-button @click="columnVisible = false"> </el-button>
<el-button type="primary" <el-button type="primary" @click="columnSubmit"> </el-button>
@click="columnSubmit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -126,8 +90,7 @@ export default {
beforeRouteLeave(to, from, next) { beforeRouteLeave(to, from, next) {
if (JSON.stringify(this.originList) !== JSON.stringify(this.list)) { if (JSON.stringify(this.originList) !== JSON.stringify(this.list)) {
this.$confirm("确定返回?排序尚未保存。", "提示", { this.$confirm("确定返回?排序尚未保存。", "提示", {
type: "warning", type: "warning"
closeOnClickModal: false
}) })
.then(() => { .then(() => {
next(); next();
@ -301,7 +264,7 @@ export default {
.el-tree-node__content { .el-tree-node__content {
padding: 5px; padding: 5px;
border-bottom: 0.0625rem solid #ebeef5; border-bottom: 0.0625rem solid #EBEEF5;
} }
} }

@ -4,108 +4,59 @@
<!-- <a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == activeName}" @click="tabChange(index)">{{item}}</a>--> <!-- <a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == activeName}" @click="tabChange(index)">{{item}}</a>-->
<!-- </div>--> <!-- </div>-->
<div class="btn-wrap"> <div class="btn-wrap">
<el-button v-auth="'内容管理:保存排序'" <el-button v-auth="'内容管理:保存排序'" class="action-btn" type="primary" @click="sortSubmit">保存排序</el-button>
class="action-btn" <el-button v-auth="'内容管理:批量删除'" class="action-btn" type="primary" @click="delAllData">批量删除</el-button>
type="primary" <el-button v-auth="'内容管理:新增文章'" class="action-btn" type="primary" @click="addArticle">新增文章</el-button>
@click="sortSubmit">保存排序</el-button>
<el-button v-auth="'内容管理:批量删除'"
class="action-btn"
type="primary"
@click="delAllData">批量删除</el-button>
<el-button v-auth="'内容管理:新增文章'"
class="action-btn"
type="primary"
@click="addArticle">新增文章</el-button>
</div> </div>
<div class="page-content" <div class="page-content" style="padding-top: 24px">
style="padding-top: 24px"> <el-table ref="table" :data="list" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table ref="table" <el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column>
:data="list" <el-table-column type="index" width="60" label="序号" align="center">
class="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="60"
label="序号"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + (pageNo - 1) * pageSize + 1 }} {{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="title" <el-table-column prop="title" label="标题" show-overflow-tooltip align="center">
label="标题"
show-overflow-tooltip
align="center">
</el-table-column> </el-table-column>
<el-table-column prop="title" <el-table-column prop="title" label="栏目" show-overflow-tooltip align="center">
label="栏目"
show-overflow-tooltip
align="center">
{{ columnName }} {{ columnName }}
</el-table-column> </el-table-column>
<el-table-column prop="name" <el-table-column prop="name" label="排序值" width="80" align="center">
label="排序值"
width="80"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input class="sort-input" <el-input class="sort-input" width="120" min="1" v-model.number="scope.row.sort" type="number"></el-input>
width="120"
min="1"
v-model.number="scope.row.sort"
type="number"></el-input>
<span>{{ scope.row.sort }}</span> <span>{{ scope.row.sort }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="date" <el-table-column prop="date" label="添加日期" align="center">
label="添加日期"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ transferDate(scope.row.date) }} {{ transferDate(scope.row.date) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作" align="center" width="170">
align="center"
width="170">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-auth="'内容管理:编辑'" <el-button v-auth="'内容管理:编辑'" type="text" @click="editArticle(scope)">编辑</el-button>
type="text" <el-divider v-auth="'内容管理:编辑'" direction="vertical"></el-divider>
@click="editArticle(scope)">编辑</el-button> <el-button v-auth="'内容管理:删除'" type="text" @click="delData(scope.row)">删除</el-button>
<el-divider v-auth="'内容管理:编辑'"
direction="vertical"></el-divider>
<el-button v-auth="'内容管理:删除'"
type="text"
@click="delData(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" <el-table-column prop="name" label="文章发布状态" width="120" align="center">
label="文章发布状态"
width="120"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch v-auth="'内容管理:禁用'" <el-switch
v-auth="'内容管理:禁用'"
class="off" class="off"
v-model="scope.row.status" v-model="scope.row.status"
:active-value="0" :active-value="0"
:inactive-value="1" :inactive-value="1"
style="margin: 0 5px" style="margin: 0 5px"
:active-text="scope.row.status ? '关' : '开'" :active-text="scope.row.status ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)"></el-switch> @change="switchOff($event,scope.row,scope.$index)"
></el-switch>
<span>{{ scope.row.status ? "禁用" : "启用" }}</span> <span>{{ scope.row.status ? "禁用" : "启用" }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background <el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo">
layout="total, prev, pager, next"
:total="totals"
@current-change="handleCurrentChange"
:current-page="pageNo">
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
@ -166,7 +117,7 @@ export default {
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNo = val; this.pageNo = val;
this.$router.push(`/information?page=${val}`) this.$router.push(`list?page=${val}`)
this.getData(); this.getData();
}, },
// //

@ -2,19 +2,10 @@
<!-- 内容管理 --> <!-- 内容管理 -->
<div class="flex"> <div class="flex">
<div class="menu-con"> <div class="menu-con">
<el-tree ref="column" <el-tree ref="column" :data="menuList" :props="{ label: 'name' }" highlight-current :expand-on-click-node="false" default-expand-all node-key="id" @node-click="handleSelect"></el-tree>
:data="menuList"
:props="{ label: 'name' }"
highlight-current
:expand-on-click-node="false"
default-expand-all
node-key="id"
@node-click="handleSelect"></el-tree>
</div> </div>
<div class="right"> <div class="right">
<ContentList ref="content" <ContentList ref="content" v-show="menuList.length" :columnId="columnId" />
v-show="menuList.length"
:columnId="columnId" />
</div> </div>
</div> </div>
</template> </template>
@ -80,8 +71,7 @@ export default {
// //
if (JSON.stringify(list) !== JSON.stringify(originList)) { if (JSON.stringify(list) !== JSON.stringify(originList)) {
this.$confirm(`您已更改了文章排序,是否保存更改?`, '提示', { this.$confirm(`您已更改了文章排序,是否保存更改?`, '提示', {
type: 'warning', type: 'warning'
closeOnClickModal: false
}).then(() => { }).then(() => {
content.sortSubmit() content.sortSubmit()
this.setColumnId(key.id) this.setColumnId(key.id)
@ -101,7 +91,7 @@ export default {
width: 210px; width: 210px;
height: calc(100vh - 250px); height: calc(100vh - 250px);
border-right: solid 1px #e6e6e6; border-right: solid 1px #e6e6e6;
background-color: #f2f6fc; background-color: #F2F6FC;
/deep/.el-tree-node__content { /deep/.el-tree-node__content {
height: 50px; height: 50px;
} }

@ -2,17 +2,11 @@
<!-- 资讯管理 --> <!-- 资讯管理 -->
<div class="page"> <div class="page">
<ul class="column-tab"> <ul class="column-tab">
<li :class="{active: tabsName == 1}" <li :class="{active: tabsName == 1}" @click="handleClick(1)"><i class="el-icon-collection-tag"></i> 栏目管理</li>
@click="handleClick(1)"><i class="el-icon-collection-tag"></i> 栏目管理</li> <li :class="{active: tabsName == 2}" @click="handleClick(2)"><i class="el-icon-document"></i> 内容管理</li>
<li :class="{active: tabsName == 2}"
@click="handleClick(2)"><i class="el-icon-document"></i> 内容管理</li>
</ul> </ul>
<columnManage class="flex-1" <columnManage class="flex-1" ref="content1" v-if="tabsName == 1" />
ref="content1" <ContentManage class="flex-1" ref="content2" v-if="tabsName == 2" />
v-if="tabsName == 1" />
<ContentManage class="flex-1"
ref="content2"
v-if="tabsName == 2" />
</div> </div>
</template> </template>
@ -48,8 +42,7 @@ export default {
// //
if (JSON.stringify(list) !== JSON.stringify(originList)) { if (JSON.stringify(list) !== JSON.stringify(originList)) {
this.$confirm(`您已更改了${tab == 1 ? '栏目' : '文章'}排序,是否保存更改?`, '提示', { this.$confirm(`您已更改了${tab == 1 ? '栏目' : '文章'}排序,是否保存更改?`, '提示', {
type: 'warning', type: 'warning'
closeOnClickModal: false
}).then(() => { }).then(() => {
content.sortSubmit() content.sortSubmit()
fn(param) fn(param)
@ -89,9 +82,8 @@ export default {
i { i {
margin-right: 5px; margin-right: 5px;
} }
&:hover, &:hover, &.active {
&.active { color: #9278FF;
color: #9278ff;
} }
} }
} }

@ -1,33 +1,51 @@
<template> <template>
<div> <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"> <div class="flex-between">
<el-page-header @back="back" :content="'创建赛事'"></el-page-header> <el-page-header @back="back"
:content="'创建赛事'"></el-page-header>
</div> </div>
</el-card> </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> <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-form-item label="请选择类型">
<el-radio v-for="(item, i) in releaseTypes" :key="i" v-model="releaseType" :label="item.id">{{ item.name <el-radio v-model="releaseType"
}}</el-radio> :label="0">仅发布信息</el-radio>
<el-radio v-model="releaseType"
:label="1">设置完整比赛</el-radio>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-button v-if="!editing && id" class="edit" type="primary" @click="editing = 1" <el-button v-if="!editing && id"
class="edit"
type="primary"
@click="editing = 1"
v-auth="'/match:管理:大赛详情:编辑'">编辑</el-button> v-auth="'/match:管理:大赛详情:编辑'">编辑</el-button>
</div> </div>
<el-card v-if="step !== 4" shadow="hover" class="m-b-20" style="position: relative;margin-top: 20px"> <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}]"> <ul :class="['steps', {pointer: !editing && id && publishStatus}]">
<li :class="{ active: step === 1, done: step > 1 }" @click="toStep(1)"> <li :class="{active: step === 1,done: step > 1}"
@click="toStep(1)">
<span class="circle">1</span> <span class="circle">1</span>
<p class="text">大赛信息填写</p> <p class="text">大赛信息填写</p>
</li> </li>
<template v-if="releaseType"> <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> <span class="circle circle2">2</span>
<p class="text">赛程与规则设置</p> <p class="text">赛程与规则设置</p>
</li> </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> <span class="circle circle3">3</span>
<p class="text">比赛内容设置</p> <p class="text">比赛内容设置</p>
</li> </li>
@ -40,21 +58,43 @@
</el-card> </el-card>
<div class="page"> <div class="page">
<div class="page-content"> <div class="page-content">
<step1 v-show="step === 1" ref="step1" :editing.sync="editing" @next="next" /> <step1 v-show="step === 1"
<step2 v-if="step === 2" ref="step2" :editing.sync="editing" :setupId.sync="setupId" @next="next" /> ref="step1"
<step3 v-if="step === 3" ref="step3" :editing.sync="editing" :setupId.sync="setupId" :editing.sync="editing"
:competitionId.sync="competitionId" @next="next" /> @next="next" />
<step4 v-if="step === 4" ref="step4" /> <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"> <template v-if="editing || !id">
<el-button v-if="!publishStatus" @click="save(0)">保存{{ releaseType ? '草稿' : '' }}</el-button> <el-button v-if="!publishStatus"
<el-button v-if="step === 2 || step === 3" type="primary" @click="prev">上一步</el-button> @click="save(0)">保存{{ releaseType ? '草稿' : '' }}</el-button>
<el-button v-if="!releaseType || (releaseType && step === 3)" type="primary" @click="save(1)">发布</el-button> <el-button v-if="step === 2 || step === 3"
<el-button v-else type="primary" @click="save(0, 2)">保存并下一步</el-button> 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(id ? 1 : 0, 2)">保存并下一步</el-button>
</template> </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> <el-button @click="cancel">{{ editing ? '取消' : '返回' }}</el-button>
</div> </div>
</div> </div>
@ -83,20 +123,6 @@ export default {
updateTime: 0, updateTime: 0,
setupId: '', setupId: '',
releaseType: 0, releaseType: 0,
releaseTypes: [
{
id: 0,
name: '仅发布信息'
},
{
id: 1,
name: '设置完整比赛'
},
// {
// id: 2,
// name: ''
// },
],
editing: this.$route.query.id ? 0 : 1, editing: this.$route.query.id ? 0 : 1,
showBtns: true, showBtns: true,
loadIns: null loadIns: null
@ -139,8 +165,7 @@ export default {
const { updateTime } = this.$refs['step' + this.step] const { updateTime } = this.$refs['step' + this.step]
if (updateTime) { if (updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning', type: 'warning'
closeOnClickModal: false
}).then(() => { }).then(() => {
this.save(0, 1) this.save(0, 1)
}).catch(() => { }).catch(() => {
@ -153,15 +178,7 @@ export default {
// //
next (next, setupId, competitionId) { next (next, setupId, competitionId) {
if (!next) { if (!next) {
if (this.step === 3 && this.$refs['step' + this.step].form[0].contentId) { this.$router.push(`/match?page=${this.$store.state.matchPage}`)
// &&
this.editing = 0
this.step = 1
this.$parent.initTabs && this.$parent.initTabs()
} else {
//
this.$router.push(`/match`)
}
} else if (next === 2) { } else if (next === 2) {
if (setupId) this.setupId = setupId if (setupId) this.setupId = setupId
if (competitionId) { if (competitionId) {
@ -172,12 +189,6 @@ export default {
this.step++ this.step++
} else if (next === 1) { } else if (next === 1) {
this.step-- this.step--
} else {
if (typeof setupId === 'function') {
setupId()
} else if (typeof type === 'function') {
type()
}
} }
}, },
// //
@ -197,8 +208,7 @@ export default {
const { updateTime } = this.$refs['step' + this.step] const { updateTime } = this.$refs['step' + this.step]
if (this.step < 4 && updateTime) { if (this.step < 4 && updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning', type: 'warning'
closeOnClickModal: false
}).then(() => { }).then(() => {
this.save(0, 3) this.save(0, 3)
}).catch(() => { }).catch(() => {
@ -208,7 +218,7 @@ export default {
this.editing = false this.editing = false
} }
} else { } else {
this.backPage() this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`)
} }
}, },
back () { back () {
@ -216,8 +226,7 @@ export default {
const { updateTime } = this.$refs['step' + this.step] const { updateTime } = this.$refs['step' + this.step]
if (this.step < 4 && updateTime) { if (this.step < 4 && updateTime) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning', type: 'warning'
closeOnClickModal: false
}).then(() => { }).then(() => {
this.save(0) this.save(0)
}).catch(() => { }).catch(() => {
@ -228,7 +237,7 @@ export default {
} }
}, },
backPage () { backPage () {
this.$router.push(this.$store.state.referrer || '/match') this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`)
} }
} }
}; };
@ -237,41 +246,33 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.type-wrap { .type-wrap {
position: relative; position: relative;
padding: 10px;
margin-top: 20px; margin-top: 20px;
background: #fff; background: #fff;
&.pd { &.pd {
padding: 15px; padding: 15px;
} }
} }
.edit { .edit {
position: absolute; position: absolute;
top: 30px; top: 30px;
right: 30px; right: 30px;
} }
.el-steps { .el-steps {
justify-content: center; justify-content: center;
} }
.steps { .steps {
display: flex; display: flex;
justify-content: center; justify-content: center;
&.pointer { &.pointer {
li { li {
cursor: pointer; cursor: pointer;
} }
} }
li { li {
position: relative; position: relative;
margin-right: 100px; margin-right: 100px;
text-align: center; text-align: center;
} }
.circle { .circle {
display: inline-flex; display: inline-flex;
justify-content: center; justify-content: center;
@ -284,7 +285,6 @@ export default {
background: #f9f9f9; background: #f9f9f9;
border: 5px solid #e1e1e1; border: 5px solid #e1e1e1;
border-radius: 50%; border-radius: 50%;
&:after { &:after {
content: ''; content: '';
position: absolute; position: absolute;
@ -294,45 +294,37 @@ export default {
background: #e1e1e1; background: #e1e1e1;
} }
} }
.active { .active {
.circle { .circle {
color: #fff; color: #fff;
border-color: #459ffb; border-color: #459ffb;
background: #007eff; background: #007eff;
} }
.text { .text {
color: #007eff; color: #007eff;
} }
} }
.done { .done {
.circle { .circle {
color: #fff; color: #fff;
background: #9c86ff; background: #9c86ff;
border-color: #bbacff; border-color: #bbacff;
&:after { &:after {
background: #bbacff; background: #bbacff;
} }
} }
.text { .text {
color: #9178ff; color: #9178ff;
} }
} }
.circle2:after { .circle2:after {
left: 71px; left: 71px;
width: 147px; width: 147px;
} }
.circle4:after { .circle4:after {
display: none; display: none;
} }
} }
.btns { .btns {
text-align: center; text-align: center;
} }

@ -12,97 +12,42 @@
<div class="date-inputs"> <div class="date-inputs">
起止时间 起止时间
<div style="display: inline-flex;align-items: center;"> <div style="display: inline-flex;align-items: center;">
<el-date-picker v-model="form.time" type="datetimerange" range-separator="~" start-placeholder="开始日期" <el-date-picker
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" 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"> @change="timeChange">
</el-date-picker> </el-date-picker>
<el-alert style="width: auto;padding: 4px 16px;margin-left: 10px;" <el-alert
:title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'" type="error" :closable="false" style="width: auto;padding: 4px 16px;margin-left: 10px;"
:title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'"
type="error"
:closable="false"
effect="dark"> effect="dark">
</el-alert> </el-alert>
</div> </div>
</div> </div>
</div> </div>
</el-card> </el-card>
<!-- 理论系统 -->
<template v-if="isTheory">
<!-- 理论系统选择试卷库非理论则选择系统 -->
<el-card shadow="hover" class="mgr20 m-b-20"> <el-card shadow="hover" class="mgr20 m-b-20">
<div> <div>
<p class="m-b-20">试卷库</p> <p class="m-b-20">课程</p>
<div class="inline-input"> <div class="inline-input">
<el-select v-model="libraryId" placeholder="请选择试卷库" @change="getProject"> <el-select v-model="form.cid" @change="courseChange">
<el-option v-for="(item, i) in paperLibraries" :key="i" :label="item.libraryName" :value="item.libraryId"> <el-option
v-for="item in curriculumList"
:key="item.cid"
:label="item.curriculumName"
:value="item.cid">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
</el-card> </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>
</div>
<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"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between m-b-20"> <div class="flex-between m-b-20">
<span>实训项目</span> <span>实训项目</span>
@ -139,11 +84,15 @@
</el-table-column> --> </el-table-column> -->
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background :page-size="pageSize" @current-change="handleCurrentChange" <el-pagination
layout="total,prev, pager, next" :total="total"></el-pagination> background
:page-size="pageSize"
@current-change="handleCurrentChange"
layout="total,prev, pager, next"
:total="total"
></el-pagination>
</div> </div>
</el-card> </el-card>
</template>
<div style="text-align: center"> <div style="text-align: center">
<el-button @click="back">返回</el-button> <el-button @click="back">返回</el-button>
@ -153,40 +102,24 @@
</template> </template>
<script> <script>
import Setting from '@/setting'
import util from "@/libs/util"; import util from "@/libs/util";
import { Loading } from 'element-ui' import { Loading } from 'element-ui'
import TestPaperConst from '@/const/testPaper'
export default { export default {
props: ['form', 'step1'], props: ['form', 'step1'],
data() { data() {
return { return {
difficults: TestPaperConst.difficults,
paperTypes: TestPaperConst.paperTypes,
loadIns: null, loadIns: null,
mallIds: [], curriculumList: [],
curs: [],
paperLibraries: [],
testPapers: [],
keyword: '', keyword: '',
projects: [], projects: [],
page: 1, page: 1,
pageSize: 5, pageSize: 5,
total: 0, total: 0,
libraryId: '',
sysId: '', sysId: '',
paperId: '',
paperName: '',
permissionsKeys: ['练习', '考核', '竞赛'], permissionsKeys: ['练习', '考核', '竞赛'],
timeInvalid: false, timeInvalid: false
}; };
}, },
computed: {
//
isTheory () {
return this.form.method === 1
},
},
watch: { watch: {
// , // ,
form: { form: {
@ -203,124 +136,58 @@ export default {
} }
}, },
mounted() { mounted() {
this.isTheory ? this.getLibrary() : this.getCourse() this.getCourse()
}, },
methods: { methods: {
// //
async getCourse () { getCourse() {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '服务配置') this.loadIns = Loading.service()
const { serviceList } = await this.$post(this.api.queryServiceConfig, { const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
pageNum: 1, this.$post(this.api.curriculumList, {
pageSize: 1000, isShelves: 1,
supplierId: sid ? sid.supplierId : ''
})
const { page } = await this.$post(this.api.listOfGoods, {
pageNum: 1, pageNum: 1,
pageSize: 10000, pageSize: 10000,
hotTag: 1, supplierId: sid ? sid.supplierId : ''
sort: 0, }).then(({ page }) => {
isAssociatedProduct: 1, const list = page.records
isShelves: 0, this.curriculumList = page.records
}) if (!this.form.cid && list.length) this.form.cid = list[0].cid
const { records } = page this.courseChange()
const { mallId, cid, systemId } = this.form }).catch(err => {
if (records.length) { this.loadIns.close()
serviceList.records.map(e => { });
e.id = +e.systemId
e.label = e.systemName
})
records.map(e => {
e.id = +e.mallId
e.label = e.productName
e.children = serviceList.records.filter(n => e.systemId && e.systemId.split(',').includes(n.systemId)) //
})
this.curs = records
//
const first = records[0]
this.mallIds = [mallId || first.mallId, systemId || first.children[0].id]
this.form.mallId = mallId || first.mallId
this.form.cid = cid || +first.associatedProduct
this.form.systemId = systemId || first.systemId
this.sysId = systemId || first.systemId
this.loadIns = Loading.service()
this.getProject()
}
}, },
// //
curChange (val) { courseChange(val) {
const id = val[0] const { systemId } = this.curriculumList.find(e => e.cid == this.form.cid)
const item = this.curs.find(e => e.id == id) this.sysId = systemId
if (val.length === 1) { if (val) this.loadIns = Loading.service()
//
this.mallIds = [id, item.children[0].id]
}
this.form.mallId = id
this.form.cid = +item.associatedProduct
this.form.systemId = this.mallIds[1]
this.sysId = this.mallIds[1]
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() this.getProject()
}
} finally { }
}, },
//
// / getProject() {
async getProject () { this.$post(this.api.getProjectAssessmentByCompetition, {
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, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
cid: this.form.cid, cid: this.form.cid,
projectName: this.keyword, projectName: this.keyword,
systemId: this.sysId, systemId: this.sysId,
permissions: 2, permissions: 2
}) }).then(({ data }) => {
this.projects = data.records this.projects = data.records
this.total = data.total this.total = data.total
}
} finally {
this.loadIns.close() this.loadIns.close()
} }).catch(err => {
this.loadIns.close()
});
}, },
initData() { initData() {
this.page = 1 this.page = 1;
this.getProject() this.getProject();
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val this.page = val;
this.getProject() this.getProject();
}, },
// //
toProject() { toProject() {
@ -330,7 +197,10 @@ export default {
form, form,
curStep curStep
}) })
this.$router.push(`/projectList?systemId=${this.mallIds[1]}&show=1&name=${this.$refs.cur.getCheckedNodes()[0].label}`) const item = this.curriculumList.find(e => e.cid == this.form.cid) || {} // id
let systemId = item.sysId || '1'
systemId = systemId.split(',')[0] // id
this.$router.push(`/projectList?systemId=${systemId}&show=1&name=${item.sysName.split(',')[0]}`)
}, },
// //
timeChange(val) { timeChange(val) {
@ -357,65 +227,30 @@ 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() { save() {
const { form } = this const { form } = this
if (!form.time.length) return util.warningMsg('请选择比赛时间') if (!form.time.length) return util.warningMsg('请选择比赛时间')
const { playStartTime, playEndTime } = this.step1 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 (new Date(form.time[0]) < new Date(playStartTime) || new Date(form.time[1]) > new Date(playEndTime)) return util.warningMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
//
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.cid) return util.warningMsg('请选择课程')
if (!form.projectId) return util.warningMsg('请选择项目') if (!form.projectId) return util.warningMsg('请选择项目')
const { systemId, systemName, projectName } = this.projects.find(e => e.projectId == form.projectId) const { systemId, systemName, projectName } = this.projects.find(e => e.projectId == form.projectId)
if (systemId) form.systemId = systemId if (systemId) form.systemId = systemId
if (projectName) form.projectName = projectName if (projectName) form.projectName = projectName
if (systemName) form.systemName = systemName if (systemName) form.systemName = systemName
}
form.startTime = form.time[0] form.startTime = form.time[0]
form.endTime = form.time[1] form.endTime = form.time[1]
this.handlePaper()
this.$emit('hideSet', this.form) 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() { back() {
this.$emit('update:form', this.$parent.curOriginForm)
this.$emit('hideSet') this.$emit('hideSet')
} }
} }
}; };
</script> </script>
<style scoped lang="scss"></style> <style scoped lang="scss">
</style>

@ -5,9 +5,19 @@
<div class="p-title">大赛信息</div> <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-form-item label="竞赛封面(选填)">
<el-upload class="avatar-uploader" accept=".jpg,.png,.jpeg,.gif" :on-remove="handleRemove" <el-upload
:on-error="uploadError" :before-remove="beforeRemove" :limit="1" :on-exceed="handleExceed" action="" class="avatar-uploader"
:http-request="handleRequest"> accept=".jpg,.png,.jpeg,.gif"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:headers="headers"
name="file"
>
<img v-if="form.coverUrl" :src="form.coverUrl" class="avatar"> <img v-if="form.coverUrl" :src="form.coverUrl" class="avatar">
<div class="uploader-default" v-else> <div class="uploader-default" v-else>
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
@ -19,9 +29,18 @@
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="竞赛封面长图(选填)"> <el-form-item label="竞赛封面长图(选填)">
<el-upload class="avatar-uploader avatar-uploader-lg" accept=".jpg,.png,.jpeg,.gif" <el-upload
:on-remove="handleLgRemove" :on-error="uploadError" :before-remove="beforeRemove" :limit="1" class="avatar-uploader avatar-uploader-lg"
:on-exceed="handleExceed" action="" :http-request="handleRequestLg"> accept=".jpg,.png,.jpeg,.gif"
:on-remove="handleLgRemove"
:on-error="uploadError"
:on-success="uploadLgSuccess"
:before-remove="beforeRemove"
:limit="1" :on-exceed="handleExceed"
:action="this.api.fileupload"
:headers="headers"
name="file"
>
<img v-if="form.carouselUrl" :src="form.carouselUrl" class="avatar-lg"> <img v-if="form.carouselUrl" :src="form.carouselUrl" class="avatar-lg">
<div class="uploader-default" v-else> <div class="uploader-default" v-else>
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
@ -37,15 +56,12 @@
<el-input placeholder="请输入竞赛名称" v-model="form.name" clearable></el-input> <el-input placeholder="请输入竞赛名称" v-model="form.name" clearable></el-input>
</div> </div>
</el-form-item> </el-form-item>
<template v-if="!isPractice">
<el-form-item class="req" label="主办方"> <el-form-item class="req" label="主办方">
<div class="inline-input"> <div class="inline-input">
<div class="input-wrap" v-for="(item,index) in sponsorList" :key="index"> <div class="input-wrap" v-for="(item,index) in sponsorList" :key="index">
<el-input placeholder="主办方名称" v-model="sponsorList[index]"></el-input> <el-input placeholder="主办方名称" v-model="sponsorList[index]"></el-input>
<i v-if="sponsorList.length > 1" class="remove" @click="delSponsor(index)"></i> <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 !== ''" <button v-if="index == 0" class="add-btn" type="button" :disabled="!editing && form.id !== ''" @click="addSponsor">
@click="addSponsor">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
<span>添加</span> <span>添加</span>
</button> </button>
@ -57,8 +73,7 @@
<div class="input-wrap" v-for="(item,index) in undertakerList" :key="index"> <div class="input-wrap" v-for="(item,index) in undertakerList" :key="index">
<el-input placeholder="承办方名称" v-model="undertakerList[index]"></el-input> <el-input placeholder="承办方名称" v-model="undertakerList[index]"></el-input>
<i v-if="undertakerList.length > 1" class="remove" @click="delOrganizer(index)"></i> <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 !== ''" <button v-if="index == 0" class="add-btn" type="button" :disabled="!editing && form.id !== ''" @click="addOrganizer">
@click="addOrganizer">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
<span>添加</span> <span>添加</span>
</button> </button>
@ -74,7 +89,6 @@
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:picker-options="pickerOptions"></el-date-picker> :picker-options="pickerOptions"></el-date-picker>
</el-form-item> </el-form-item>
</template>
<el-form-item class="req" label="竞赛时间"> <el-form-item class="req" label="竞赛时间">
<el-date-picker v-model="playTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" <el-date-picker v-model="playTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
@ -89,36 +103,29 @@
</div> </div>
<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 v-if="form.competitionScope === 2" 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> <span style="margin-left: 20px">{{ rangeName }}</span>
</template>
</div> </div>
</el-form-item> </el-form-item>
<template v-if="!isPractice">
<el-form-item class="req" label="竞赛类型"> <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="0">个人赛</el-radio>
<el-radio v-model="form.completeCompetitionSetup.competitionType" :label="1">团队赛</el-radio> <el-radio v-model="form.completeCompetitionSetup.competitionType" :label="1">团队赛</el-radio>
</el-form-item> </el-form-item>
<el-form-item class="req" v-if="!form.completeCompetitionSetup.competitionType" label="报名人数上限"> <el-form-item class="req" v-if="!form.completeCompetitionSetup.competitionType" label="报名人数上限">
<div class="input-center"> <div class="input-center">
<el-input placeholder="请输入人数" v-model.number="form.completeCompetitionSetup.quantityLimit" <el-input placeholder="请输入人数" v-model.number="form.completeCompetitionSetup.quantityLimit" type="number"></el-input>
type="number"></el-input>
</div> </div>
</el-form-item> </el-form-item>
<template v-if="form.completeCompetitionSetup.competitionType"> <template v-if="form.completeCompetitionSetup.competitionType">
<el-form-item class="req" label="报名团队数上限"> <el-form-item class="req" label="报名团队数上限">
<div class="input-center"> <div class="input-center">
<el-input placeholder="请输入团队数" v-model.number="form.completeCompetitionSetup.quantityLimit" <el-input placeholder="请输入团队数" v-model.number="form.completeCompetitionSetup.quantityLimit" type="number"></el-input>
type="number"></el-input>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item class="req" label="团队人数"> <el-form-item class="req" label="团队人数">
<div class="input-center" style="width: 250px;"> <div class="input-center" style="width: 250px;">
<el-input v-model.number="form.completeCompetitionSetup.minTeamSize" type="number"></el-input> <el-input v-model.number="form.completeCompetitionSetup.minTeamSize" type="number"></el-input>
<el-input style="margin-left: 5px;" v-model.number="form.completeCompetitionSetup.maxTeamSize" <el-input style="margin-left: 5px;" v-model.number="form.completeCompetitionSetup.maxTeamSize" type="number"></el-input> /
type="number"></el-input> /
</div> </div>
</el-form-item> </el-form-item>
</template> </template>
@ -126,83 +133,59 @@
<div class="input-center" style="width: 550px;"> <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="0">不需要</el-radio>
<el-radio v-model="form.completeCompetitionSetup.isNeedCode" :label="1">需要</el-radio> <el-radio v-model="form.completeCompetitionSetup.isNeedCode" :label="1">需要</el-radio>
<el-input style="width: 250px" placeholder="请输入4位邀请码或点击随机生成" <el-input style="width: 250px" placeholder="请输入4位邀请码或点击随机生成" v-model="form.completeCompetitionSetup.invitationCode" :disabled="form.completeCompetitionSetup.isNeedCode === 0"></el-input>
v-model="form.completeCompetitionSetup.invitationCode"
:disabled="form.completeCompetitionSetup.isNeedCode === 0"></el-input>
<el-button v-if="form.completeCompetitionSetup.isNeedCode === 1" @click="randomInv">随机</el-button> <el-button v-if="form.completeCompetitionSetup.isNeedCode === 1" @click="randomInv">随机</el-button>
</div> </div>
</el-form-item> </el-form-item>
</template>
<el-form-item class="req" label="竞赛详情"> <el-form-item class="req" label="竞赛详情">
<quill v-if="quillShow" :border="true" v-model="form.description" :height="400" <quill v-if="quillShow" :border="true" v-model="form.description" :height="400" :readonly="!editing && form.id !== ''" />
:readonly="!editing && form.id !== ''" />
</el-form-item> </el-form-item>
<el-form-item label="附件"> <el-form-item label="附件">
<Upload :limit="5" :file-list.sync="fileList" :on-remove="handleAnnexRemove" <el-upload
@onSuccess="uploadAnnexSuccess" /> :on-remove="handleAnnexRemove"
</el-form-item> :on-error="uploadError"
:before-upload="beforeUpload"
<template v-if="isPractice"> :on-success="uploadAnnexSuccess"
<el-form-item label="比赛方式"> :limit="5"
<el-radio-group v-model="form.type"> :on-exceed="handleExceedAnnex"
<el-radio :label="0">实训</el-radio> :action="this.api.fileupload"
<el-radio :label="1">理论</el-radio> :headers="headers"
</el-radio-group> :file-list="fileList"
</el-form-item> name="file"
<el-form-item label="比赛内容"> >
<el-button style="margin-bottom: 10px;" size="small" type="primary">选择理论试卷</el-button> <el-button size="small" type="primary">点击上传</el-button>
<el-table :data="list" class="table" ref="table" stripe header-align="center" row-key="id"> <div slot="tip" class="el-upload__tip">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <p>支持扩展名.rar .zip .doc .docx .pdf .jpg...</p>
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> </div>
<el-table-column prop="name" label="试卷名称" align="center" min-width="100"></el-table-column> </el-upload>
<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> </el-form-item>
</template>
</el-form> </el-form>
</div> </div>
</div> </div>
<el-dialog title="请勾选院校" :visible.sync="rangeVisible" width="580px" custom-class="range-dia" <el-dialog title="请勾选院校" :visible.sync="rangeVisible" width="580px" custom-class="range-dia" :close-on-click-modal="false">
:close-on-click-modal="false">
<div class="range-wrap"> <div class="range-wrap">
<el-cascader ref="range" class="range-cas" key="range" v-model="range" :props="props" :show-all-levels="false" <el-cascader
clearable filterable :before-filter="beforeFilter" :options="rangeList" @change="rangeChange" ref="range"
@visible-change="rangeViChange" @input.native="rangeSearch"></el-cascader> class="range-cas"
<el-tag v-for="(tag, i) in rangeChecked" :key="tag.value" class="range-check" closable key="range"
:disable-transitions="false" @close="val => closeRange(i)"> 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}} {{tag.label}}
</el-tag> </el-tag>
</div> </div>
@ -216,15 +199,17 @@
</template> </template>
<script> <script>
import Util from "@/libs/util"; import util from "@/libs/util";
import quill from "@/components/quill"; import quill from "@/components/quill";
import Upload from '@/components/upload'; import { Loading } from 'element-ui'
import Oss from '@/components/upload/upload.js'
export default { export default {
props: ['editing'], props: ['editing'],
data() { data() {
const that = this const that = this
return { return {
headers: {
token: sessionStorage.getItem('token')
},
form: { form: {
id: this.$route.query.id || '', id: this.$route.query.id || '',
platformSource: 0, // (0:1) platformSource: 0, // (0:1)
@ -340,18 +325,11 @@ export default {
}, },
submiting: false, submiting: false,
updateTime: 0, updateTime: 0,
quillShow: true, quillShow: true
originSignUpEndTime: '',
}; };
}, },
components: { components: {
quill, quill
Upload
},
computed: {
isPractice () {
return this.$parent.releaseType === 2
},
}, },
watch: { watch: {
editing: function(val) { editing: function(val) {
@ -394,7 +372,7 @@ export default {
}, },
methods: { methods: {
getData() { getData() {
const { id } = this.$route.query const { id } = this.form
id && this.$post(`${this.api.getCompetition}?competitionId=${id}`).then(({ competition }) => { id && this.$post(`${this.api.getCompetition}?competitionId=${id}`).then(({ competition }) => {
this.$parent.publishStatus = competition.publishStatus this.$parent.publishStatus = competition.publishStatus
this.$parent.releaseType = competition.releaseType this.$parent.releaseType = competition.releaseType
@ -409,7 +387,6 @@ export default {
const files = [] const files = []
fileList.map(e => { fileList.map(e => {
files.push({ files.push({
id: e.id,
name: e.fileName, name: e.fileName,
url: e.filePath url: e.filePath
}) })
@ -442,7 +419,6 @@ export default {
}) })
this.rangeName = range.join(',') this.rangeName = range.join(',')
} }
this.originSignUpEndTime = competition.signUpEndTime
this.form = competition this.form = competition
this.$parent.resumeData() this.$parent.resumeData()
this.$nextTick(() => { this.$nextTick(() => {
@ -520,7 +496,7 @@ export default {
provinceId: e.provinceId || '', provinceId: e.provinceId || '',
cityId: e.cityId || '', cityId: e.cityId || '',
schoolId: e.schoolId || '', schoolId: e.schoolId || '',
type: e.schoolId ? 0 : (e.cityId ? 1 : 2) type: e.schoolId ? 0 : 1
}) })
}) })
this.form.competitionRangeList = data this.form.competitionRangeList = data
@ -535,32 +511,45 @@ export default {
this.rangeVisible = false this.rangeVisible = false
}, },
handleExceed(files, fileList) { handleExceed(files, fileList) {
Util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
}, },
// handleExceedAnnex(files, fileList) {
async handleRequest ({ file }) { util.warningMsg(`当前限制选择 5 个文件,如需更换,请删除一个文件再重新选择!`);
Oss.upload(file).then(res => {
this.form.coverUrl = res.url
})
}, },
// uploadSuccess(res) {
async handleRequestLg ({ file }) { const { coverUrl } = this.form
Oss.upload(file).then(res => { coverUrl && this.$del(`${this.api.fileDeletion}?keys=${coverUrl}`).then(res => {}).catch(res => {})
this.form.carouselUrl = res.url this.form.coverUrl = res.data.filesResult.fileUrl
}) },
uploadLgSuccess(res) {
const { carouselUrl } = this.form
carouselUrl && this.$del(`${this.api.fileDeletion}?keys=${carouselUrl}`).then(res => {}).catch(res => {})
this.form.carouselUrl = res.data.filesResult.fileUrl
}, },
// //
uploadAnnexSuccess (file) { uploadAnnexSuccess(res) {
const file = res.data.filesResult
const { id } = this.form const { id } = this.form
const data = { const data = {
competitionId: id || '', competitionId: id || '',
fileName: file.name, fileName: this.fileName,
filePath: file.url filePath: file.fileUrl || file.fileId
} }
this.form.competitionAnnexList.push(data) this.form.competitionAnnexList.push(data)
// //
id && this.$post(this.api.saveComAnnex, data).then(res => {}).catch(res => {}) id && this.$post(this.api.saveComAnnex, data).then(res => {}).catch(res => {})
}, },
//
beforeUpload(file) {
const isLt2M = file.size / 1024 / 1024 < 10
if (!isLt2M) util.warningMsg('请上传小于10MB的附件!')
if (isLt2M) {
this.fileName = file.name
return true
} else {
return false
}
},
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.$message({ this.$message({
message: "上传出错,请重试!", message: "上传出错,请重试!",
@ -571,17 +560,20 @@ export default {
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove () { handleRemove(file, fileList) {
Oss.del(this.form.coverUrl) this.$del(`${this.api.fileDeletion}?keys=${this.form.coverUrl}`).then(res => {
this.form.coverUrl = '' this.form.coverUrl = ''
}).catch(res => {})
}, },
handleLgRemove () { handleLgRemove(file, fileList) {
Oss.del(this.form.carouselUrl) this.$del(`${this.api.fileDeletion}?keys=${this.form.carouselUrl}`).then(res => {
this.form.carouselUrl = '' this.form.carouselUrl = ''
}).catch(res => {})
}, },
handleAnnexRemove(file, fileList) { handleAnnexRemove(file, fileList) {
Oss.del(file.url) const { url, name } = file
const { id } = file url && this.$del(`${this.api.fileDeletion}?keys=${url}`).then(res => {}).catch(res => {})
const id = this.form.competitionAnnexList.find(e => e.fileName === name).id
id && this.$post(`${this.api.delComAnnex}?id=${id}`).then(res => {}).catch(res => {}) id && this.$post(`${this.api.delComAnnex}?id=${id}`).then(res => {}).catch(res => {})
}, },
// //
@ -599,52 +591,47 @@ export default {
* releaseType 发布类型0发布信息1完整比赛 * releaseType 发布类型0发布信息1完整比赛
* */ * */
save(status, next = 0, releaseType = 0) { save(status, next = 0, releaseType = 0) {
const form = JSON.parse(JSON.stringify(this.form)) const { form } = this
form.sponsor = this.sponsorList.filter(d => d).join(); form.sponsor = this.sponsorList.filter(d => d).join();
form.undertaker = this.undertakerList.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 (next === 2) {
if (form.competitionScope == 2 && (!form.competitionRangeList || !form.competitionRangeList.length)) return Util.warningMsg('请选择区域、院校') if (form.competitionScope == 2 && !form.competitionRangeList.length) return util.warningMsg('请选择区域、院校')
if (!form.sponsor) return Util.warningMsg("请填写主办方"); if (!form.sponsor) return util.warningMsg("请填写主办方");
if (!form.signUpStartTime) return Util.warningMsg("请选择报名时间"); if (!form.signUpStartTime) return util.warningMsg("请选择报名时间");
let now = new Date().getTime(); let now = new Date().getTime();
let signUpStartTime = new Date(form.signUpStartTime).getTime(); let signUpStartTime = new Date(form.signUpStartTime).getTime();
let signUpEndTime = new Date(form.signUpEndTime).getTime(); let signUpEndTime = new Date(form.signUpEndTime).getTime();
let playStartTime = new Date(form.playStartTime).getTime(); let playStartTime = new Date(form.playStartTime).getTime();
if (!form.playStartTime) return Util.warningMsg("请选择竞赛时间"); if (!form.playStartTime) return util.warningMsg("请选择竞赛时间");
if (playStartTime && signUpEndTime && playStartTime < signUpEndTime) return Util.warningMsg("竞赛时间不能早于报名结束时间"); if (playStartTime && signUpEndTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间");
const { competitionType, quantityLimit, minTeamSize, maxTeamSize, isNeedCode, invitationCode } = form.completeCompetitionSetup const { competitionType, quantityLimit, minTeamSize, maxTeamSize, isNeedCode, invitationCode } = form.completeCompetitionSetup
// //
if (competitionType) { if (competitionType) {
if (quantityLimit === '') return Util.warningMsg('请填写报名团队数上限') if (quantityLimit === '') return util.warningMsg('请填写报名团队数上限')
if (quantityLimit < 0) return Util.warningMsg('报名团队数上限不得小于0') if (quantityLimit < 0) return util.warningMsg('报名团队数上限不得小于0')
if (minTeamSize === '') return Util.warningMsg('请填写团队人数下限') if (minTeamSize === '') return util.warningMsg('请填写团队人数下限')
if (minTeamSize < 2) return Util.warningMsg('团队人数下限不得小于2') if (minTeamSize < 2) return util.warningMsg('团队人数下限不得小于2')
if (maxTeamSize === '') return Util.warningMsg('请填写团队人数上限') if (maxTeamSize === '') return util.warningMsg('请填写团队人数上限')
if (minTeamSize > maxTeamSize) return Util.warningMsg('团队人数上限不得小于下限') if (minTeamSize > maxTeamSize) return util.warningMsg('团队人数上限不得小于下限')
} else { // } else { //
if (quantityLimit === '') return Util.warningMsg('请填写报名人数上限') if (quantityLimit === '') return util.warningMsg('请填写报名人数上限')
if (quantityLimit < 0) return Util.warningMsg('报名人数上限不得小于0') if (quantityLimit < 0) return util.warningMsg('报名人数上限不得小于0')
} }
if (isNeedCode && (!invitationCode || invitationCode.length !== 4)) return Util.warningMsg('请填写四位数邀请码') if (isNeedCode && (!invitationCode || invitationCode.length !== 4)) return util.warningMsg('请填写四位数邀请码')
if (!form.description) return Util.warningMsg("请填写竞赛详情"); if (!form.description) return util.warningMsg("请填写竞赛详情");
} else {
if (form.competitionScope == 2 && (!form.competitionRangeList || !form.competitionRangeList.length)) form.competitionScope = 1
} }
this.$parent.showLoad() this.$parent.showLoad()
// delete form.publishStatus
// if (status === 1) form.publishStatus = 1
form.publishStatus = status form.publishStatus = status
form.id = this.$route.query.id form.ztOpen = status ? 0 : 1 //
form.ztOpen = form.id ? form.ztOpen : (status ? 0 : 1) //
form.releaseType = releaseType form.releaseType = releaseType
form.id = this.$route.query.id
if (form.id) { if (form.id) {
this.$post(this.api.editCompetition, form).then(async () => { this.$post(this.api.editCompetition, form).then(res => {
this.$parent.hideLoad()
this.updateTime && Util.successMsg("修改成功")
this.updateTime = 0 this.updateTime = 0
await this.automaticAllocation(status) this.$parent.hideLoad()
util.successMsg("修改成功");
this.$emit('next', next) this.$emit('next', next)
}).catch(err => { }).catch(err => {
this.$parent.hideLoad() this.$parent.hideLoad()
@ -653,47 +640,29 @@ export default {
this.$post(this.api.addCompetition, form).then(({ competitionId, setupId }) => { this.$post(this.api.addCompetition, form).then(({ competitionId, setupId }) => {
this.updateTime = 0 this.updateTime = 0
this.$parent.hideLoad() this.$parent.hideLoad()
Util.successMsg("创建成功") util.successMsg("创建成功");
this.$emit('next', next, setupId, competitionId) this.$emit('next', next, setupId, competitionId)
}).catch(err => { }).catch(err => {
this.$parent.hideLoad() 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() { preview() {
Util.local.set('match', this.form) util.local.set('match', this.form)
window.open(this.$router.resolve('/matchPreview').href) window.open(this.$router.resolve('/matchPreview').href)
}, },
addSponsor() { addSponsor() {
this.sponsorList.push('') this.sponsorList.push("");
}, },
delSponsor(index) { delSponsor(index) {
this.sponsorList.splice(index, 1) this.sponsorList.splice(index, 1);
}, },
addOrganizer() { addOrganizer() {
this.undertakerList.push('') this.undertakerList.push("");
}, },
delOrganizer(index) { delOrganizer(index) {
this.undertakerList.splice(index, 1) this.undertakerList.splice(index, 1);
} }
} }
}; };
@ -703,7 +672,6 @@ export default {
$upload-width: 220px; $upload-width: 220px;
$upload-height: 140px; $upload-height: 140px;
$upload-lg-height: 150px; $upload-lg-height: 150px;
/deep/ .avatar-uploader { /deep/ .avatar-uploader {
.el-upload { .el-upload {
position: relative; position: relative;
@ -783,12 +751,10 @@ $upload-lg-height: 150px;
/deep/ .d-inline-block { /deep/ .d-inline-block {
width: 216px; width: 216px;
.el-select, .el-select, .el-input {
.el-input {
width: 100%; width: 100%;
} }
} }
.inline-input { .inline-input {
.input-wrap { .input-wrap {
display: flex; display: flex;
@ -804,7 +770,7 @@ $upload-lg-height: 150px;
.remove { .remove {
width: 16px; width: 16px;
height: 16px; height: 16px;
background: url('../../../assets/img/close.png') 0 0 / cover no-repeat; background: url("../../../assets/img/close.png") 0 0/cover no-repeat;
cursor: pointer; cursor: pointer;
} }
} }
@ -833,33 +799,27 @@ $upload-lg-height: 150px;
font-weight: bold; font-weight: bold;
} }
} }
.range-check { .range-check {
display: inline-block; display: inline-block;
margin: 0 0 10px 10px; margin: 0 0 10px 10px;
} }
/deep/.range-cas { /deep/.range-cas {
.el-tag { .el-tag {
display: none; display: none;
} }
} }
.input-center { .input-center {
display: flex; display: flex;
align-items: center; align-items: center;
width: 216px; width: 216px;
white-space: nowrap; white-space: nowrap;
.el-input { .el-input {
margin-right: 5px; margin-right: 5px;
} }
} }
.el-steps { .el-steps {
justify-content: center; justify-content: center;
} }
/deep/.req { /deep/.req {
.el-form-item__label { .el-form-item__label {
&:before { &:before {

@ -3,16 +3,12 @@
<div class="page"> <div class="page">
<div class="page-content"> <div class="page-content">
<div class="p-title">赛程与规则设置</div> <div class="p-title">赛程与规则设置</div>
<el-form :model="form" :rules="validRules" label-width="170px" label-suffix=":" size="small" <el-form :model="form" :rules="validRules" label-width="170px" label-suffix=":" size="small" :disabled="!editing && id">
:disabled="!!(!editing && id)">
<el-form-item label="竞赛类型"> <el-form-item label="竞赛类型">
{{ step1.completeCompetitionSetup.competitionType ? '团队赛(' + step1.completeCompetitionSetup.minTeamSize + {{ step1.completeCompetitionSetup.competitionType ? '团队赛(' + step1.completeCompetitionSetup.minTeamSize + '-' + step1.completeCompetitionSetup.maxTeamSize + '人/队)' : '个人赛' }} <span class="tips">如需修改请返回上一步</span>
'-' + step1.completeCompetitionSetup.maxTeamSize + '人/队)' : '个人赛' }} <span
class="tips">如需修改请返回上一步</span>
</el-form-item> </el-form-item>
<el-form-item prop="rule" label="赛制"> <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 v-for="(rule, i) in rules" :key="i" v-model="form.rule" :label="rule.id">{{ rule.name }}</el-radio>
}}</el-radio>
<p class="tips">积分赛包含多个竞赛阶段每个阶段的成绩都包含在最终总成绩里最后一轮结束后总成绩排名靠前的参赛者得到获奖资格</p> <p class="tips">积分赛包含多个竞赛阶段每个阶段的成绩都包含在最终总成绩里最后一轮结束后总成绩排名靠前的参赛者得到获奖资格</p>
<p class="tips">淘汰赛包含多个竞赛阶段每个阶段结束后之后只有部分参赛者能晋级下一阶段晋级最后一轮且在最后一轮排名靠前的参赛者得到获奖资格</p> <p class="tips">淘汰赛包含多个竞赛阶段每个阶段结束后之后只有部分参赛者能晋级下一阶段晋级最后一轮且在最后一轮排名靠前的参赛者得到获奖资格</p>
<p class="tips">单项赛仅包含一个竞赛阶段单项的成绩排名即为最终排名排名靠前的参赛者得到获奖资格</p> <p class="tips">单项赛仅包含一个竞赛阶段单项的成绩排名即为最终排名排名靠前的参赛者得到获奖资格</p>
@ -41,46 +37,40 @@
<el-form-item prop="stageNum" label="阶段设置"> <el-form-item prop="stageNum" label="阶段设置">
<div v-for="(item, i) in form.competitionStageList" :key="i" class="step-set"> <div v-for="(item, i) in form.competitionStageList" :key="i" class="step-set">
<div class="line"> <div class="line">
{{ serials[i] }}阶段 <el-input v-model="item.stageName" clearable placeholder="请输入阶段名称,如“初赛”" {{ serials[i] }}阶段 <el-input v-model="item.stageName" clearable placeholder="请输入阶段名称,如“初赛”" style="width: 200px"></el-input>
style="width: 200px"></el-input>
</div> </div>
<div class="line"> <div class="line">
<span class="req">*</span> <span class="req">*</span>
比赛方式 比赛方式
<el-radio v-for="(method, i) in methods" :key="i" v-model="item.method" :label="method.id">{{ <el-radio v-for="(method, i) in methods" :key="i" v-model="item.method" :label="method.id">{{ method.name }}</el-radio>
method.name }}</el-radio>
</div> </div>
<div v-if="step1.completeCompetitionSetup.competitionType" class="line"> <div v-if="step1.completeCompetitionSetup.competitionType" class="line">
<span class="req">*</span> <span class="req">*</span>
团队参赛人数限制 团队参赛人数限制
<el-radio v-model="item.teamNumLimit" :label="0">不限制</el-radio> <el-radio v-model="item.teamNumLimitOpt" :label="0">不限制</el-radio>
<el-radio v-model="item.teamNumLimit" :label="1">自定义</el-radio> <el-radio v-model="item.teamNumLimitOpt" :label="1">自定义</el-radio>
<el-input v-model.number="item.customNumber" type="number" min="0" style="width: 150px;" <el-input v-model.number="item.teamNumLimit" type="number" style="width: 150px;" :disabled="item.teamNumLimitOpt === 0"></el-input>
:disabled="item.teamNumLimit === 0"></el-input>
<span class="tips">可限制本阶段单个团队的出战人数</span> <span class="tips">可限制本阶段单个团队的出战人数</span>
</div> </div>
<div v-if="step1.completeCompetitionSetup.competitionType" class="line"> <div v-if="step1.completeCompetitionSetup.competitionType" class="line">
<span class="req">*</span> <span class="req">*</span>
团队成绩计算方式 团队成绩计算方式
<el-radio v-for="(j, i) in teamCalculationMethods" :key="i" v-model="item.teamCalculationMethod" <el-radio v-for="(j, i) in teamCalculationMethods" :key="i" v-model="item.teamCalculationMethod" :label="j.id">{{ j.name }}</el-radio>
:label="j.id">{{ j.name }}</el-radio>
<span class="tips">可设置本阶段的团队取分规则</span> <span class="tips">可设置本阶段的团队取分规则</span>
</div> </div>
<div v-if="form.rule === 1 && i !== form.competitionStageList.length - 1" class="line" <div v-if="form.rule === 1 && i !== form.competitionStageList.length - 1" class="line" style="display: flex;">
style="display: flex;">
<p> <p>
<span class="req">*</span>晋级规则 <span class="req">*</span>晋级规则
</p> </p>
<div> <div>
<div class="line"> <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" style="width: 100px"></el-input>
可晋级下一阶段比赛 可晋级下一阶段比赛
</div> </div>
<div class="line"> <div class="line">
本阶段成绩排名前 本阶段成绩排名前
<el-input v-model.number="item.percentageLimit" type="number" min="0" <el-input v-model.number="item.percentageLimit" type="number" style="width: 100px"></el-input>
style="width: 100px"></el-input>
%可晋级下一阶段比赛 %可晋级下一阶段比赛
</div> </div>
<div> <div>
@ -88,7 +78,7 @@
<el-select v-model="item.operator" style="width: 80px;margin-right: 10px"> <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-option v-for="i in operators" :key="i" :label="i" :value="i"></el-option>
</el-select> </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" style="width: 100px"></el-input>
可晋级下一阶段比赛 可晋级下一阶段比赛
</div> </div>
</div> </div>
@ -96,19 +86,17 @@
<div v-if="!form.rule" class="line"> <div v-if="!form.rule" class="line">
<span class="req">*</span> <span class="req">*</span>
占总成绩权重 占总成绩权重
<el-input v-model.number="item.pointWeight" type="number" min="0" <el-input v-model.number="item.pointWeight" type="number" :disabled="form.resultCalculationMethod != 0" style="width: 150px;"></el-input> %
:disabled="form.resultCalculationMethod != 0" style="width: 150px;"></el-input> %
</div> </div>
<div class="line"> <div class="line">
<span class="req">*</span>
成绩公布时间 成绩公布时间
阶段比赛结束后 阶段比赛结束后
<el-input v-model.number="item.resultAnnouncementTime" type="number" min="0" <el-input v-model.number="item.resultAnnouncementTime" type="number" style="width: 120px"></el-input>
style="width: 120px"></el-input> 小时公布阶段比赛成绩
小时公布阶段比赛成绩为空则不公布成绩为0则阶段比赛结束后立马公布成绩
</div> </div>
<div <div class="line">
v-if="item.resultAnnouncementTime !== '' && item.resultAnnouncementTime !== null && item.resultAnnouncementTime !== undefined" <span class="req">*</span>
class="line">
是否公布成绩详情 是否公布成绩详情
<el-radio v-model="item.resultsDetails" :label="0"></el-radio> <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="1"></el-radio>
@ -124,27 +112,22 @@
<div class="line"> <div class="line">
<span class="req">*</span> <span class="req">*</span>
比赛方式 比赛方式
<el-radio v-for="(method, i) in methods" :key="i" v-model="form.competitionStageList[0].method" <el-radio v-for="(method, i) in methods" :key="i" v-model="form.competitionStageList[0].method" :label="method.id">{{ method.name }}</el-radio>
:label="method.id">{{ method.name }}</el-radio>
</div> </div>
<div v-if="step1.completeCompetitionSetup.competitionType" class="line"> <div v-if="step1.completeCompetitionSetup.competitionType" class="line">
<span class="req">*</span> <span class="req">*</span>
团队成绩计算方式 团队成绩计算方式
<el-radio v-for="(j, i) in teamCalculationMethods" :key="i" <el-radio v-for="(j, i) in teamCalculationMethods" :key="i" v-model="form.competitionStageList[0].teamCalculationMethod" :label="j.id">{{ j.name }}</el-radio>
v-model="form.competitionStageList[0].teamCalculationMethod" :label="j.id">{{ j.name }}</el-radio>
<span class="tips">可设置本阶段的团队取分规则</span> <span class="tips">可设置本阶段的团队取分规则</span>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="成绩公布时间"> <el-form-item prop="rule" label="成绩公布时间">
阶段比赛结束后 阶段比赛结束后
<el-input v-model.number="form.competitionStageList[0].resultAnnouncementTime" type="number" min="0" <el-input v-model.number="form.competitionStageList[0].resultAnnouncementTime" type="number" style="width: 120px"></el-input>
style="width: 120px"></el-input> 小时公布阶段比赛成绩
小时公布阶段比赛成绩为空则不公布成绩为0则阶段比赛结束后立马公布成绩
</el-form-item> </el-form-item>
<el-form-item <el-form-item prop="resultsDetails" label="是否公布成绩详情">
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="0"></el-radio>
<el-radio v-model="form.competitionStageList[0].resultsDetails" :label="1"></el-radio> <el-radio v-model="form.competitionStageList[0].resultsDetails" :label="1"></el-radio>
<p class="tips">若选择则公布成绩详情竞赛结束后参赛者可查看自己的比赛成绩得分详情</p> <p class="tips">若选择则公布成绩详情竞赛结束后参赛者可查看自己的比赛成绩得分详情</p>
@ -159,8 +142,8 @@
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import quill from "@/components/quill";
import Const from '@/const/match' import Const from '@/const/match'
import _ from 'lodash'
export default { export default {
props: ['setupId', 'editing'], props: ['setupId', 'editing'],
data() { data() {
@ -186,10 +169,10 @@ export default {
scoreLimit: '', scoreLimit: '',
operator: '>', operator: '>',
score: '', score: '',
customNumber: '', teamNumLimit: '',
teamNumLimit: 0, teamNumLimitOpt: 0,
resultAnnouncementTime: '', resultAnnouncementTime: '',
resultsDetails: '', resultsDetails: 0,
}, },
{ {
method: 0, method: 0,
@ -202,10 +185,10 @@ export default {
scoreLimit: '', scoreLimit: '',
operator: '>', operator: '>',
score: '', score: '',
customNumber: '', teamNumLimit: '',
teamNumLimit: 0, teamNumLimitOpt: 0,
resultAnnouncementTime: '', resultAnnouncementTime: '',
resultsDetails: '', resultsDetails: 0,
}, },
{ {
method: 0, method: 0,
@ -218,10 +201,10 @@ export default {
scoreLimit: '', scoreLimit: '',
operator: '>', operator: '>',
score: '', score: '',
customNumber: '', teamNumLimit: '',
teamNumLimit: 0, teamNumLimitOpt: 0,
resultAnnouncementTime: '', resultAnnouncementTime: '',
resultsDetails: '', resultsDetails: 0,
} }
] ]
}, },
@ -242,7 +225,6 @@ export default {
{ required: true, trigger: 'change' } { required: true, trigger: 'change' }
], ],
}, },
originForm: null,
ruleForm: {}, ruleForm: {},
rules: Const.rules, rules: Const.rules,
methods: Const.methods, methods: Const.methods,
@ -283,9 +265,9 @@ export default {
} }
if (!e.peopleLimit) e.peopleLimit = '' if (!e.peopleLimit) e.peopleLimit = ''
if (!e.percentageLimit) e.percentageLimit = '' if (!e.percentageLimit) e.percentageLimit = ''
e.teamNumLimitOpt = e.teamNumLimit ? 1 : 0
e.teamCalculationMethod = +e.teamCalculationMethod e.teamCalculationMethod = +e.teamCalculationMethod
}) })
this.originForm = _.cloneDeep(rule)
this.form = rule this.form = rule
} }
this.$nextTick(() => { this.$nextTick(() => {
@ -306,10 +288,10 @@ export default {
const stages = this.form.competitionStageList const stages = this.form.competitionStageList
const { ruleId } = this.form const { ruleId } = this.form
if (stages.length < val) { if (stages.length < val) {
const len = stages.length const list = []
for (let i = 1; i <= val - len; i++) { for (let i = 1; i <= val - stages.length; i++) {
const form = JSON.parse(JSON.stringify(this.ruleForm)) const form = JSON.parse(JSON.stringify(this.ruleForm))
form.number = len + i form.number = stages.length + i
if (ruleId) form.ruleId = ruleId if (ruleId) form.ruleId = ruleId
this.form.competitionStageList.push(form) this.form.competitionStageList.push(form)
} }
@ -317,38 +299,9 @@ export default {
this.form.competitionStageList = stages.slice(0, val) 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) { save(status, next = 0) {
const form = _.cloneDeep(this.form) let { form } = this
const { rule } = form const { rule } = form
let invalid = 0 let invalid = 0
let pointWeight = 0 let pointWeight = 0
@ -359,7 +312,10 @@ export default {
if (form.rule === 2) { // if (form.rule === 2) { //
const e = stages[0] const e = stages[0]
e.stageName = step1.name e.stageName = step1.name
if (e.resultsDetails === 0 && e.resultAnnouncementTime !== '') { if (!e.resultsDetails) {
if (e.resultAnnouncementTime === '') {
return util.errorMsg('请填写成绩公布时间')
}
if (e.resultAnnouncementTime < 0) { if (e.resultAnnouncementTime < 0) {
return util.errorMsg('成绩公布时间不得小于0') return util.errorMsg('成绩公布时间不得小于0')
} }
@ -370,8 +326,6 @@ export default {
} }
form.competitionStageList = stages.slice(0, 1) // form.competitionStageList = stages.slice(0, 1) //
} else { // } else { //
let customNumber = 0
const { competitionType, minTeamSize, maxTeamSize } = step1.completeCompetitionSetup // 01
for (const i in stages) { for (const i in stages) {
const e = stages[i] const e = stages[i]
if (rule !== 2 && !e.stageName) { if (rule !== 2 && !e.stageName) {
@ -379,11 +333,12 @@ export default {
util.errorMsg('请输入阶段名称') util.errorMsg('请输入阶段名称')
break break
} }
const { competitionType, maxTeamSize } = step1.completeCompetitionSetup // 01
// rule: 012 // rule: 012
// //
if (!rule) { if (!rule) {
// //
if (form.resultCalculationMethod == 0 && (e.pointWeight === '' || e.pointWeight === undefined)) { if (form.resultCalculationMethod == 0 && e.pointWeight === '') {
invalid = 1 invalid = 1
util.errorMsg('请输入权重') util.errorMsg('请输入权重')
break break
@ -398,22 +353,27 @@ export default {
} }
if (e.score !== '') e.scoreLimit = e.operator + e.score if (e.score !== '') e.scoreLimit = e.operator + e.score
} }
if (rule !== 2 && competitionType && e.teamNumLimit) { if (rule !== 2 && competitionType && e.teamNumLimitOpt) {
if (e.customNumber === '' || e.customNumber === undefined) { if (e.teamNumLimit === '') {
invalid = 1 invalid = 1
util.errorMsg('请输入团队参数人数限制') util.errorMsg('请输入团队参数人数限制')
break break
} else if (e.customNumber < 0) { } else if (e.teamNumLimit < 0) {
invalid = 1 invalid = 1
util.errorMsg('团队参数人数不得小于0') util.errorMsg('团队参数人数不得小于0')
break break
} else if (maxTeamSize !== '' && e.customNumber > maxTeamSize) { } else if (maxTeamSize !== '' && e.teamNumLimit > maxTeamSize) {
invalid = 1 invalid = 1
util.errorMsg('团队参数人数不得大于团队人数上限') util.errorMsg('团队参数人数不得大于团队人数上限')
break break
} }
} }
if (e.resultsDetails === 0 && (e.resultAnnouncementTime !== '' && e.resultAnnouncementTime !== undefined)) { if (!e.resultsDetails) {
if (e.resultAnnouncementTime === '') {
invalid = 1
util.errorMsg('请填写成绩公布时间')
break
}
if (e.resultAnnouncementTime < 0) { if (e.resultAnnouncementTime < 0) {
invalid = 1 invalid = 1
util.errorMsg('成绩公布时间不得小于0') util.errorMsg('成绩公布时间不得小于0')
@ -426,25 +386,22 @@ export default {
} }
e.resultAnnouncementTime = +e.resultAnnouncementTime e.resultAnnouncementTime = +e.resultAnnouncementTime
} }
if (e.teamNumLimit && e.customNumber) customNumber += e.customNumber //
if (!e.teamNumLimit) e.customNumber = ''
} }
if (invalid) return if (invalid) return
if (form.teamLimit && competitionType) {
if (stages.length > minTeamSize) return util.errorMsg('阶段数不得大于团队人数下限')
if (customNumber > minTeamSize) return util.errorMsg('各阶段自定义的参赛人数之和不得大于团队人数下限')
}
if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入') if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入')
} }
} else { // 稿 } else { // 稿
form.competitionStageList = form.competitionStageList.filter(e => e.stageName) form.competitionStageList = form.competitionStageList.filter(e => e.stageName)
} }
for (const e of form.competitionStageList) {
if (!e.teamNumLimitOpt) e.teamNumLimit = 0
}
this.$parent.showLoad() this.$parent.showLoad()
if (form.ruleId) { if (form.ruleId) {
this.$post(this.api.editCompetitionRule, form).then(res => { this.$post(this.api.editCompetitionRule, form).then(res => {
this.$parent.hideLoad() this.$parent.hideLoad()
this.updateTime && util.successMsg("修改成功"); util.successMsg("修改成功");
this.automaticAllocation(next) this.$emit('next', next)
}).catch(err => { }).catch(err => {
this.$parent.hideLoad() this.$parent.hideLoad()
}) })
@ -466,13 +423,10 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
/deep/ .d-inline-block { /deep/ .d-inline-block {
width: 216px; width: 216px;
.el-select, .el-input {
.el-select,
.el-input {
width: 100%; width: 100%;
} }
} }
.inline-input { .inline-input {
.input-wrap { .input-wrap {
display: flex; display: flex;
@ -488,7 +442,7 @@ export default {
.remove { .remove {
width: 16px; width: 16px;
height: 16px; height: 16px;
background: url('../../../assets/img/close.png') 0 0 / cover no-repeat; background: url("../../../assets/img/close.png") 0 0/cover no-repeat;
cursor: pointer; cursor: pointer;
} }
} }
@ -497,32 +451,26 @@ export default {
margin-left: 32px; margin-left: 32px;
} }
} }
.input-center { .input-center {
display: flex; display: flex;
align-items: center; align-items: center;
width: 216px; width: 216px;
white-space: nowrap; white-space: nowrap;
.el-input { .el-input {
margin-right: 5px; margin-right: 5px;
} }
} }
.step-set { .step-set {
padding: 15px; padding: 15px;
background-color: #fbfbfb; background-color: #fbfbfb;
} }
.tips { .tips {
font-size: 13px; font-size: 13px;
color: #959595; color: #959595;
} }
.req { .req {
color: #f00; color: #f00;
} }
.line { .line {
margin-bottom: 10px; margin-bottom: 10px;
} }

@ -3,7 +3,7 @@
<div v-show="!setVisible" class="page"> <div v-show="!setVisible" class="page">
<div class="page-content"> <div class="page-content">
<div class="p-title">比赛内容设置</div> <div class="p-title">比赛内容设置</div>
<el-form label-width="170px" label-suffix=":" size="small" :disabled="!!(!editing && id)"> <el-form label-width="170px" label-suffix=":" size="small" :disabled="!editing && id">
<div v-for="(item, i) in form" :key="i" class="step"> <div v-for="(item, i) in form" :key="i" class="step">
<div class="title"> <div class="title">
<span>{{ item.stageName }}{{ nums[i] }}阶段 | {{ methods.find(e => e.id === item.method).name }} </span> <span>{{ item.stageName }}{{ nums[i] }}阶段 | {{ methods.find(e => e.id === item.method).name }} </span>
@ -12,57 +12,29 @@
<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> <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"> <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="开始日期" <el-date-picker
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" 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"> @change="timeChange">
</el-date-picker> </el-date-picker>
<el-alert style="width: auto;padding: 0px 16px;margin-left: 10px;" <el-alert
:title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'" type="error" style="width: auto;padding: 0px 16px;margin-left: 10px;"
:closable="false" effect="dark"> :title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'"
type="error"
:closable="false"
effect="dark">
</el-alert> </el-alert>
</div> </div>
</el-form-item> </el-form-item>
<!-- 其他赛事 -->
<template v-if="item.method === 2"> <template v-if="item.method === 2">
<el-form-item class="req" label="比赛地点"> <el-form-item class="req" label="比赛地点">
<el-input v-model="item.offlineAddress" style="width: 80%"></el-input> <el-input v-model="item.offlineAddress" style="width: 80%"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="系统链接">
<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>
</div>
<div class="flex a-center">
<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>
<!-- <div slot="tip"
class="el-upload__tip"
style="position: relative">
<div v-if="item.competitionStageContentSetting.fileList.length"
class="download"
@click="downloadFile(item.competitionStageContentSetting.fileList)">
<p v-for="(file, i) in item.competitionStageContentSetting.fileList"
:key="i">下载</p>
</div>
</div> -->
</el-upload>
</template>
</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>
</div>
</el-form-item>
<el-form-item class="req" label="比赛内容"> <el-form-item class="req" label="比赛内容">
<el-input v-model="item.contentDescription" type="textarea" style="width: 80%"></el-input> <el-input v-model="item.contentDescription" type="textarea" style="width: 80%"></el-input>
</el-form-item> </el-form-item>
@ -71,35 +43,20 @@
</el-form-item> </el-form-item>
</template> </template>
<template v-else> <template v-else>
<template v-if="item.method === 0">
<el-form-item class="req" prop="cid" label="课程系统"> <el-form-item class="req" prop="cid" label="课程系统">
{{ item.systemName }} {{ item.systemName }}
</el-form-item> </el-form-item>
<el-form-item class="req" prop="assessmentId" label="已选择考核"> <el-form-item class="req" prop="assessmentId" label="已选择考核">
{{ item.projectName }} {{ item.projectName }}
</el-form-item> </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="比赛地点"> <el-form-item class="req" prop="resultAnnouncementTime" label="比赛地点">
<div class="line"> <div class="line">
<el-checkbox v-model="item.onlineButton">线上</el-checkbox> <el-checkbox v-model="item.onlineButton">线上</el-checkbox>
<el-input v-model="item.onlineAddress" clearable placeholder="请输入比赛网址" :disabled="!item.onlineButton" <el-input v-model="item.onlineAddress" clearable placeholder="请输入比赛网址" :disabled="!item.onlineButton" style="width: 400px;margin-left: 10px"></el-input>
style="width: 400px;margin-left: 10px"></el-input>
</div> </div>
<div class="line"> <div class="line">
<el-checkbox v-model="item.offlineButton">线下</el-checkbox> <el-checkbox v-model="item.offlineButton">线下</el-checkbox>
<el-input v-model="item.offlineAddress" clearable placeholder="请输入地址" :disabled="!item.offlineButton" <el-input v-model="item.offlineAddress" clearable placeholder="请输入地址" :disabled="!item.offlineButton" style="width: 400px;margin-left: 10px"></el-input>
style="width: 400px;margin-left: 10px"></el-input>
</div> </div>
</el-form-item> </el-form-item>
</template> </template>
@ -108,41 +65,22 @@
</div> </div>
</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> </div>
</template> </template>
<script> <script>
import Set from './set' import util from "@/libs/util";
import Oss from '@/components/upload/upload.js' import set from './set'
import Setting from '@/setting'
import Util from '@/libs/util'
export default { export default {
props: ['setupId', 'competitionId', 'editing'], props: ['setupId', 'competitionId', 'editing'],
components: { Set },
data() { data() {
return { return {
headers: {
token: sessionStorage.getItem('token')
},
id: this.$route.query.id, id: this.$route.query.id,
updateTime: 0, updateTime: 0,
step1: this.$parent.$refs.step1.form, step1: this.$parent.$refs.step1.form,
cache: this.$store.state.competitionCache, cache: this.$store.state.competitionCache,
nums: ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十'], nums: ['一', '二', '三'],
methods: [ methods: [
{ {
id: 0, id: 0,
@ -159,30 +97,26 @@ export default {
], ],
originForm: { originForm: {
cid: '', cid: '',
mallId: '',
contentDescription: '', contentDescription: '',
endTime: '', endTime: '',
scoreRule: '', scoreRule: '',
stageId: '', stageId: '',
startTime: '', startTime: '',
systemId: '', systemId: '',
paperId: '',
paperName: '',
offlineAddress: '', offlineAddress: '',
offlineButton: 0, offlineButton: 0,
onlineAddress: '', onlineAddress: '',
onlineButton: 0, onlineButton: 0,
time: [], time: []
}, },
form: [], form: [],
setVisible: false, setVisible: false,
curStep: 0, curStep: 0,
curOriginForm: {},
closeStatus: false,
tipsVisible: false,
}; };
}, },
components: {
set
},
watch: { watch: {
// , // ,
form: { form: {
@ -216,45 +150,13 @@ export default {
} else { } else {
form.time = [] form.time = []
} }
// 线
if (e.method === 2) {
if (!form.competitionStageContentSetting) {
form.competitionStageContentSetting = {
whetherToUploadFiles: 0,
stageExplain: '',
fileUrl: '',
systemLink: '',
fileList: []
}
}
form.competitionStageContentSetting.fileList = []
//
if (form.competitionStageContentSetting.fileUrl) {
const urls = form.competitionStageContentSetting.fileUrl.split('|')
const names = form.competitionStageContentSetting.fileName.split('|')
urls.map((n, i) => {
form.competitionStageContentSetting.fileList.push({
name: names[i],
url: n
})
})
} else {
form.competitionStageContentSetting.fileList = []
}
form.competitionStageContentSetting.competitionId = this.id
form.competitionStageContentSetting.stageId = e.stageId
}
if (!form.mallId) form.mallId = ''
form.offlineButton = !!form.offlineButton form.offlineButton = !!form.offlineButton
form.onlineButton = !!form.onlineButton form.onlineButton = !!form.onlineButton
form.method = e.method form.method = e.method
form.stageId = e.stageId form.stageId = e.stageId
form.stageName = e.stageName form.stageName = e.stageName
if (form.paperName) form.originPaperName = form.paperName //
this.form.push(form) this.form.push(form)
}) })
this.resumeData() this.resumeData()
this.$nextTick(() => { this.$nextTick(() => {
this.updateTime = 0 this.updateTime = 0
@ -263,7 +165,6 @@ export default {
}, },
// //
toSet(i) { toSet(i) {
this.curOriginForm = JSON.parse(JSON.stringify(this.form[i]))
this.curStep = i this.curStep = i
this.$parent.showBtns = false this.$parent.showBtns = false
this.setVisible = true this.setVisible = true
@ -274,26 +175,13 @@ export default {
this.setVisible = false this.setVisible = false
this.$parent.showBtns = true 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) { timeChange(val) {
if (val.length) { if (val.length) {
const startTime = new Date(val[0]) const startTime = new Date(val[0])
const endTime = new Date(val[1]) const endTime = new Date(val[1])
const { playStartTime, playEndTime } = this.step1 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 const { form, curStep } = this
for (const i in form) { for (const i in form) {
// //
@ -301,207 +189,88 @@ export default {
const time1 = new Date(form[i].startTime) const time1 = new Date(form[i].startTime)
const time2 = new Date(form[i].endTime) const time2 = new Date(form[i].endTime)
if ((startTime >= time1 && startTime <= time2) || (endTime >= time1 && endTime <= time2)) { if ((startTime >= time1 && startTime <= time2) || (endTime >= time1 && endTime <= time2)) {
Util.warningMsg('请注意,所设置的时间与已设置的阶段时间重合。') util.warningMsg('请注意,所设置的时间与已设置的阶段时间重合。')
break break
} }
} }
} }
} }
}, },
//
beforeUpload (file) {
const isLt2M = file.size / 1024 / 1024 < 10
if (!isLt2M) Util.warningMsg('请上传小于10MB的附件!')
if (isLt2M) {
this.fileName = file.name
return true
} else {
return false
}
},
uploadError (err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
})
},
downloadFile () {
// const { name, url } = this.fileList[0]
// 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)
},
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove (file, fileList, item) {
Oss.del(file.url)
item.competitionStageContentSetting.fileList = fileList
},
//
async handleRequest ({ file }, item) {
Oss.upload(file).then(res => {
item.competitionStageContentSetting.fileList.push({
name: res.name,
url: res.url
})
})
},
// //
publish() { publish() {
this.competitionId && this.$post(`${this.api.publishCompetition}?competitionId=${this.competitionId}&publishStatus=1`).then(res => {}).catch(err => {}) this.competitionId && this.$post(`${this.api.publishCompetition}?competitionId=${this.competitionId}&publishStatus=1`).then(res => {}).catch(err => {})
}, },
//
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) { save(status, next = 0) {
const { form } = this const { form } = this
if (!form.length) { if (!form.length) {
this.$parent.hideLoad() this.$parent.hideLoad()
Util.successMsg('保存成功') util.successMsg('保存成功')
this.$emit('next', next) this.$emit('next', next)
return return
} }
//
if (status) {
let invalid = 0 let invalid = 0
const { playStartTime, playEndTime } = this.step1 const { playStartTime, playEndTime } = this.step1
for (const e of form) { for (const e of form) {
//
if (status) {
if (!e.time.length) { if (!e.time.length) {
invalid = 1 invalid = 1
Util.errorMsg('请选择比赛时间') util.errorMsg('请选择比赛时间')
break break
} }
if (new Date(e.time[0]) < new Date(playStartTime) || new Date(e.time[1]) > new Date(playEndTime)) { if (new Date(e.time[0]) < new Date(playStartTime) || new Date(e.time[1]) > new Date(playEndTime)) {
invalid = 1 invalid = 1
Util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。') util.errorMsg('设置的阶段比赛时间必须要在第一步设置的竞赛时间范围内,请重新设置。')
break break
} }
if (e.method === 0 && !e.cid) { e.startTime = e.time[0]
invalid = 1 e.endTime = e.time[1]
Util.errorMsg('请选择课程') if (e.method !== 2 && !e.cid) {
break
}
if (e.method === 1 && !e.paperId) {
invalid = 1 invalid = 1
Util.errorMsg('请选择试卷') util.errorMsg('请选择课程')
break break
} }
if (e.method === 2) { // 线 if (e.method === 2) { // 线
if (!e.offlineAddress) { if (!e.offlineAddress) {
invalid = 1 invalid = 1
Util.errorMsg('请输入比赛地点') util.errorMsg('请输入比赛地点')
break break
} }
if (!e.contentDescription) { if (!e.contentDescription) {
invalid = 1 invalid = 1
Util.errorMsg('请输入比赛内容') util.errorMsg('请输入比赛内容')
break break
} }
if (!e.scoreRule) { if (!e.scoreRule) {
invalid = 1 invalid = 1
Util.errorMsg('请输入评分规则') util.errorMsg('请输入评分规则')
break break
} }
// if (e.competitionStageContentSetting.whetherToUploadFiles && !e.competitionStageContentSetting.stageExplain) {
// invalid = 1
// Util.errorMsg('')
// break
// }
} else { } else {
if (e.onlineButton && !e.onlineAddress) { if (e.onlineButton && !e.onlineAddress) {
invalid = 1 invalid = 1
Util.errorMsg('请输入线上地点') util.errorMsg('请输入线上地点')
break break
} }
if (e.offlineButton && !e.offlineAddress) { if (e.offlineButton && !e.offlineAddress) {
invalid = 1 invalid = 1
Util.errorMsg('请输入线下地点') util.errorMsg('请输入线下地点')
break break
} }
if (!e.onlineAddress && !e.offlineAddress) { if (!e.onlineAddress && !e.offlineAddress) {
invalid = 1 invalid = 1
Util.errorMsg('请输入比赛地点') util.errorMsg('请输入比赛地点')
break break
} }
} }
} }
e.startTime = e.time[0]
e.endTime = e.time[1]
}
if (invalid) return if (invalid) return
}
// //
for (const e of form) { for (const e of form) {
e.offlineButton = e.offlineButton ? 1 : 0 e.offlineButton = e.offlineButton ? 1 : 0
e.onlineButton = e.onlineButton ? 1 : 0 e.onlineButton = e.onlineButton ? 1 : 0
if (e.competitionStageContentSetting) {
if (e.competitionStageContentSetting.fileList && e.competitionStageContentSetting.fileList.length) {
e.competitionStageContentSetting.fileName = e.competitionStageContentSetting.fileList.map(n => n.name).join('|')
e.competitionStageContentSetting.fileUrl = e.competitionStageContentSetting.fileList.map(n => n.url).join('|')
} else {
e.competitionStageContentSetting.fileName = ''
e.competitionStageContentSetting.fileUrl = ''
}
}
} }
this.$parent.showLoad() this.$parent.showLoad()
this.$post(this.api[form[0].contentId ? 'editCompetitionContent' : 'addCompetitionContent'], { this.$post(this.api[form[0].contentId ? 'editCompetitionContent' : 'addCompetitionContent'], {
@ -509,17 +278,9 @@ export default {
}).then(res => { }).then(res => {
this.$parent.hideLoad() this.$parent.hideLoad()
// //
if (status) { status && this.publish(status)
this.publish(status) util.successMsg((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) this.$emit('next', next)
}
}).catch(err => { }).catch(err => {
this.$parent.hideLoad() this.$parent.hideLoad()
}) })
@ -532,7 +293,6 @@ export default {
.step { .step {
padding-bottom: 10px; padding-bottom: 10px;
background-color: #f9f9f9; background-color: #f9f9f9;
.title { .title {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -542,11 +302,9 @@ export default {
background-color: #ededed; background-color: #ededed;
} }
} }
.line { .line {
margin-bottom: 10px; margin-bottom: 10px;
} }
/deep/.req { /deep/.req {
.el-form-item__label { .el-form-item__label {
&:before { &:before {
@ -558,23 +316,4 @@ export default {
} }
} }
} }
/deep/.file-upload {
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> </style>

@ -1,9 +1,7 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<div class="modal"> <div class="modal">
<el-steps :space="200" <el-steps :space="200" :active="4" finish-status="success">
:active="4"
finish-status="success">
<el-step title="大赛信息填写"></el-step> <el-step title="大赛信息填写"></el-step>
<el-step title="赛程与规则设置"></el-step> <el-step title="赛程与规则设置"></el-step>
<el-step title="比赛内容设置"></el-step> <el-step title="比赛内容设置"></el-step>
@ -11,8 +9,7 @@
</el-steps> </el-steps>
<h1>大赛已发布</h1> <h1>大赛已发布</h1>
<div class="btns"> <div class="btns">
<el-button type="primary" <el-button type="primary" @click="back">确定</el-button>
@click="back">确定</el-button>
</div> </div>
</div> </div>
</div> </div>
@ -30,7 +27,7 @@ export default {
}, },
methods: { methods: {
back() { back() {
this.$router.push(this.$store.state.referrer || '/match') this.$router.push(`/match?page=${this.$store.state.matchPage}`)
} }
} }
}; };

@ -1,211 +0,0 @@
<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,5 +1,5 @@
<template> <template>
<div class="page" v-loading="loading"> <div class="page">
<h6 class="p-title">筛选</h6> <h6 class="p-title">筛选</h6>
<div class="tool mul"> <div class="tool mul">
<ul class="filter"> <ul class="filter">
@ -8,9 +8,12 @@
<div class="single-choice"> <div class="single-choice">
<dl> <dl>
<dd> <dd>
<el-radio-group v-model="form.month" @change="changeType"> <el-radio-group v-model="form.month"
<el-radio v-for="(item, index) in dateList" :key="index" :label="item.id" border>{{ item.name @change="changeType">
}}</el-radio> <el-radio v-for="(item,index) in dateList"
:key="index"
:label="item.id"
border>{{ item.name }}</el-radio>
</el-radio-group> </el-radio-group>
</dd> </dd>
</dl> </dl>
@ -18,150 +21,218 @@
</li> </li>
<li> <li>
<label>创建区间</label> <label>创建区间</label>
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" <el-date-picker v-model="date"
end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker> 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>
<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="keyword"
clearable></el-input>
</li> </li>
</ul> </ul>
</div> </div>
<div class="tool mul"> <div class="tool mul">
<ul class="filter"> <ul class="filter">
<li> <li>
<label>竞赛来源</label> <label>大赛来源</label>
<el-select v-model="form.platformSource" clearable @change="initData"> <el-select v-model="form.platformSource"
<el-option v-for="(item, i) in sourceList" :key="i" :label="item.name" :value="item.id"></el-option> clearable
@change="sourceChange">
<el-option v-for="(item, i) in sourceList"
:key="i"
:label="item.name"
:value="item.id"></el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
<label>发布类型</label> <label>大赛范围</label>
<el-select v-model="form.releaseType" clearable @change="initData"> <el-select v-model="form.competitionScope"
<el-option v-for="(item, i) in releaseTypes" :key="i" :label="item.name" :value="item.id"></el-option> clearable
</el-select> @change="initData">
</li> <el-option v-for="(item, i) in rangeList"
<li> :key="i"
<label>竞赛范围</label> :label="item.name"
<el-select v-model="form.competitionScope" @change="initData"> :value="item.id"></el-option>
<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> </el-select>
</li> </li>
</ul> </ul>
<div> <div>
<el-button type="primary" round @click="add" v-auth>创建竞赛</el-button> <el-button type="primary"
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button> round
@click="add"
v-auth>创建竞赛</el-button>
<el-button type="primary"
round
@click="delAllSelection"
v-auth>批量删除</el-button>
</div> </div>
</div> </div>
<el-table ref="table" :data="matchData" class="table" stripe header-align="center" <el-table ref="table"
@selection-change="handleSelectionChange" row-key="id"> :data="matchData"
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> class="table"
<el-table-column type="index" width="60" label="序号" align="center"> 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"> <template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="competitionName" label="竞赛名称" align="center"></el-table-column> <el-table-column prop="competitionName"
<el-table-column prop="name" label="竞赛来源" width="90" align="center"> label="竞赛名称"
align="center"></el-table-column>
<el-table-column prop="founderName"
label="创建人"
align="center"></el-table-column>
<el-table-column prop="name"
label="大赛来源"
width="120"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ sourceList.find(e => e.id === scope.row.platformSource).name }} {{ sourceList.find(e => e.id === scope.row.platformSource).name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="发布类型" width="110" align="center"> <el-table-column prop="name"
<template slot-scope="scope"> label="大赛范围"
{{ scope.row.releaseType ? '设置完整比赛' : '练习赛' }} align="center">
</template>
</el-table-column>
<el-table-column prop="name" label="竞赛范围" width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ rangeList.find(e => e.id === scope.row.competitionScope).name }} {{ rangeList.find(e => e.id === scope.row.competitionScope).name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="竞赛类型" width="90" align="center"> <el-table-column prop="applicantNum"
<template slot-scope="scope"> label="报名人数"
{{ scope.row.competitionType ? '团队赛' : '个人赛' }} align="center"
</template> width="100"></el-table-column>
</el-table-column> <el-table-column prop="status"
<el-table-column prop="applicantNum" label="报名人数" align="center" width="100"></el-table-column> label="状态"
<el-table-column prop="status" label="状态" align="center" width="80"> align="center"
width="80">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.publishStatus ? '已发布' : '未发布' }} {{ scope.row.publishStatus ? '已发布' : '未发布' }}
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
{{ scope.row.playStartTime }} ~ {{ scope.row.playEndTime }} {{ scope.row.playStartTime }} ~ {{ scope.row.playEndTime }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center" width="160"></el-table-column> <el-table-column prop="createTime"
<el-table-column prop="founderName" label="创建人" width="130" align="center"></el-table-column> label="创建时间"
<el-table-column label="操作" align="center" width="280"> align="center"
width="160"></el-table-column>
<el-table-column label="操作"
align="center"
width="260">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="copy(scope.row)">复制</el-button> <el-button v-if="scope.row.playingStages && scope.row.playingStages.length"
<el-button v-if="scope.row.publishStatus && scope.row.playingStages && scope.row.playingStages.length" type="text"
type="text" @click="editEndTime(scope.row)" v-auth>修改结束时间</el-button> @click="editEndTime(scope.row)"
<el-button type="text" @click="manage(scope.row)" v-auth>管理</el-button> v-auth>修改结束时间</el-button>
<el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button> <el-button type="text"
<el-switch v-if="scope.row.publishStatus" v-auth="'/match:启用'" v-model="scope.row.ztOpen" :active-value="0" @click="manage(scope.row)"
:inactive-value="1" style="margin: 0 10px 0 5px" :active-text="scope.row.ztOpen ? '关' : '开'" 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> @change="switchOff($event,scope.row,scope.$index)"></el-switch>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" <el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page"> :current-page="page">
</el-pagination> </el-pagination>
</div> </div>
<el-dialog title="修改当前阶段结束时间" :visible.sync="modifyVisible" width="900px" :close-on-click-modal="false"> <el-dialog title="修改当前阶段结束时间"
<el-table :data="curRow.playingStages" class="table" ref="table" stripe header-align="center"> :visible.sync="modifyVisible"
<el-table-column prop="stageName" label="阶段名称" min-width="100" align="center"></el-table-column> width="900px"
<el-table-column label="竞赛起止时间" width="300" align="center"> :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"> <template slot-scope="scope">
{{ scope.row.startTime + ' ~ ' + scope.row.endTime }} {{ scope.row.startTime + ' ~ ' + scope.row.endTime }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="结束时间调整为" align="center" width="280"> <el-table-column label="结束时间调整为"
align="center"
width="280">
<template slot-scope="scope"> <template slot-scope="scope">
<el-date-picker popper-class="no-atTheMoment" v-model="scope.row.newEndTime" placeholder="请选择结束时间" <el-date-picker popper-class="no-atTheMoment"
type="datetime" :picker-options="pickerOptions"> v-model="scope.row.newEndTime"
placeholder="请选择结束时间"
type="datetime"
:picker-options="pickerOptions">
</el-date-picker> </el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<span slot="footer" class="dialog-footer"> <span slot="footer"
<el-button size="small" @click="modifyVisible = false"> </el-button> class="dialog-footer">
<el-button size="small" type="primary" @click="modifySubmit"> </el-button> <el-button size="small"
@click="modifyVisible = false"> </el-button>
<el-button size="small"
type="primary"
@click="modifySubmit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import Util from '@/libs/util' import util from "@/libs/util";
import Setting from "@/setting";
import { Loading } from 'element-ui'
import Bus from '@/libs/bus' import Bus from '@/libs/bus'
import qs from 'qs'
export default { export default {
name: "match", name: "match",
data () { data () {
return { return {
timer: null, timer: null,
keyword: "",
sourceList: [ sourceList: [
{ {
id: null, id: "",
name: "不限" name: "不限"
}, },
{ {
@ -173,23 +244,9 @@ export default {
name: "院校创建" name: "院校创建"
} }
], ],
releaseTypes: [
{
id: '',
name: "不限"
},
{
id: 0,
name: '发布信息'
},
{
id: 1,
name: '完整比赛'
}
],
rangeList: [ rangeList: [
{ {
id: null, id: "",
name: "不限" name: "不限"
}, },
{ {
@ -205,45 +262,14 @@ export default {
name: "校内" name: "校内"
} }
], ],
competitionTypes: [
{
id: '',
name: '不限'
},
{
id: 0,
name: '个人赛'
},
{
id: 1,
name: '团队赛'
}
],
publishStatus: [
{
id: '',
name: '不限'
},
{
id: 0,
name: '未发布'
},
{
id: 1,
name: '已发布'
}
],
matchData: [], matchData: [],
form: { form: {
keyWord: null, month: "",
month: '', publishStatus: "",
startTime: null, startTime: "",
endTime: null, endTime: "",
releaseType: '', platformSource: +this.$route.query.platformSource || 0, // (01)
publishStatus: '', competitionScope: '', // (0: 1: 2.)
competitionType: '',
platformSource: 0, // (01)
competitionScope: null, // (0: 1: 2.)
}, },
multipleSelection: [], multipleSelection: [],
dateList: [ dateList: [
@ -281,16 +307,14 @@ export default {
picker.$emit('pick', new Date(Date.now() + 5000)) picker.$emit('pick', new Date(Date.now() + 5000))
} }
}] }]
}, }
loading: false,
now: '',
}; };
}, },
watch: { watch: {
"form.month": function (val) { "form.month": function (val) {
if (val) { if (val) {
let unit = 24 * 60 * 60 * 1000; 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 { } else {
this.date = []; this.date = [];
} }
@ -300,12 +324,12 @@ export default {
this.form.startTime = val[0]; this.form.startTime = val[0];
this.form.endTime = val[1]; this.form.endTime = val[1];
} else { } else {
this.form.startTime = '' this.form.startTime = "";
this.form.endTime = '' this.form.endTime = "";
} }
this.initData(); this.initData();
}, },
'form.keyWord': function (val) { keyword: function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData(); this.initData();
@ -313,23 +337,6 @@ export default {
} }
}, },
mounted () { 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(() => { })
}
// websocket // websocket
Bus.$on('matchSocket', () => { Bus.$on('matchSocket', () => {
this.getData() this.getData()
@ -341,80 +348,64 @@ export default {
}) })
}, },
methods: { methods: {
async getData () { getData () {
this.loading = true
try {
const { form } = this const { form } = this
const { data } = await this.$post(this.api.CompetitionPageConditionQueryByNakadai, { this.$post(this.api.CompetitionPageConditionQueryByNakadai, {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
...form competitionScope: form.competitionScope === '' ? null : form.competitionScope,
}) endTime: form.endTime || null,
this.matchData = data.records keyWord: this.keyword || null,
platformSource: form.platformSource === '' ? null : form.platformSource,
this.now = await Util.getNow() startTime: form.startTime || null,
clearInterval(this.timer) }).then(({ data }) => {
this.handleBeganStage() // load.close()
this.timer = setInterval(() => { const list = data.records
this.now = new Date(this.now.setSeconds(this.now.getSeconds() + 1))
this.handleBeganStage()
}, 1000)
this.total = data.total
this.$refs.table.clearSelection()
this.loading = false
if (!this.matchData.length && this.total) {
this.page--
this.getData()
}
} catch (e) {
this.loading = false
}
},
// //
async handleBeganStage () { this.timer = setInterval(() => {
this.matchData.map(e => { const now = new Date()
list.map(e => {
if (!e.playingStages) { if (!e.playingStages) {
this.$set(e, 'playingStages', []) this.$set(e, 'playingStages', [])
} else { } else {
e.playingStages = [] e.playingStages = []
} }
// //
if (this.now >= new Date(e.playStartTime) && this.now <= new Date(e.playEndTime)) { if (now >= new Date(e.playStartTime) && now <= new Date(e.playEndTime)) {
// //
if (e.competitionStageList) { if (e.competitionStageList) {
for (const n of e.competitionStageList) { for (const n of e.competitionStageList) {
// //
if (this.now >= new Date(n.startTime) && this.now <= new Date(n.endTime)) { if (now >= new Date(n.startTime) && now <= new Date(n.endTime)) {
e.playingStages.push(n) e.playingStages.push(n)
} }
} }
} }
} }
}) })
}, 1000)
this.matchData = list
this.total = data.total
this.$refs.table.clearSelection()
if (!this.matchData.length && this.total) {
this.page--
this.getData()
}
}).catch(res => { })
}, },
initData () { initData () {
this.page = 1; this.page = 1;
this.getData(); this.getData();
}, },
// url // redis
setReferrer () { getRedis () {
this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`) this.$post(this.api.getRedisCacheCompetition).then(({ data }) => {
data && this.getList()
}).catch(res => { })
}, },
add () { add () {
this.setReferrer()
this.$router.push("/addMatch"); this.$router.push("/addMatch");
}, },
//
copy (row) {
this.$confirm('确定要复制吗', "提示", {
type: "warning"
}).then(async () => {
await this.$post(`${this.api.copyCompetition}?competitionId=${row.id}`)
Util.successMsg('复制成功')
this.initData()
}).catch(() => { })
},
// //
editEndTime (row) { editEndTime (row) {
this.modifyVisible = true this.modifyVisible = true
@ -432,16 +423,14 @@ export default {
}) })
this.$post(this.api.editCompetitionContent, { this.$post(this.api.editCompetitionContent, {
competitionContents: data competitionContents: data
}).then(async res => { }).then(res => {
await this.$post(`${this.api.refreshPageNotification}?content=1`) util.successMsg('修改成功')
Util.successMsg('修改成功')
this.modifyVisible = false this.modifyVisible = false
this.getData() this.getData()
}).catch(err => { }) }).catch(err => { })
}, },
// //
manage (row) { manage (row) {
this.setReferrer()
this.$router.push(`/matchManage?id=${row.id}&name=${row.competitionName}`) this.$router.push(`/matchManage?id=${row.id}&name=${row.competitionName}`)
}, },
@ -451,6 +440,14 @@ export default {
}, },
// //
sourceChange (val) { sourceChange (val) {
this.$router.push({
path: '/match',
query: {
...this.$route.query,
platformSource: val
}
})
this.$store.commit('SET_M_SOURCE', val)
this.initData() this.initData()
}, },
delData (row) { delData (row) {
@ -459,7 +456,7 @@ export default {
}) })
.then(() => { .then(() => {
this.$post(`${this.api.batchDeleteCompetition}?competitionIds=${row.id}`).then(res => { this.$post(`${this.api.batchDeleteCompetition}?competitionIds=${row.id}`).then(res => {
Util.successMsg("删除成功"); util.successMsg("删除成功");
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
}); });
@ -493,6 +490,7 @@ export default {
this.page = val; this.page = val;
this.$router.push(`match?page=${val}`) this.$router.push(`match?page=${val}`)
this.getData(); this.getData();
this.$store.commit('SET_M_PAGE', val)
}, },
transferTime (date, type) { transferTime (date, type) {
if (date == "0000-00-00 00:00:00") return "---"; if (date == "0000-00-00 00:00:00") return "---";
@ -504,7 +502,7 @@ export default {
isOpen: val, isOpen: val,
type: 0 // (01) type: 0 // (01)
}).then(res => { }).then(res => {
Util.successMsg(val == 1 ? '禁用成功' : '启用成功') util.successMsg(val == 1 ? '禁用成功' : '启用成功')
}).catch(err => { }) }).catch(err => { })
await this.$post(`${this.api.refreshPageNotification}?content=1`) await this.$post(`${this.api.refreshPageNotification}?content=1`)

@ -1,630 +0,0 @@
<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>

@ -8,15 +8,13 @@
</el-card> </el-card>
<div class="page" style="margin-bottom: 24px"> <div class="page" style="margin-bottom: 24px">
<div class="tabs"> <div class="tabs">
<a class="item" v-for="(item, index) in tabs" :key="index" :class="{ active: index == active }" <a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a>
@click="tabChange(index)">{{ item }}</a>
</div> </div>
<MatchDetail v-if="active == 'tab1'" ref="detail" /> <MatchDetail v-if="active == 'tab1'" ref="detail" />
<MatchArch v-if="active == 'tab2'" /> <MatchArch v-if="active == 'tab2'" />
<MatchProgress v-else-if="active == 'tab3'" /> <MatchProgress v-else-if="active == 'tab3'" />
<Notice v-else-if="active == 'tab4'" /> <notice v-else-if="active == 'tab4'" />
<MatchSignup v-else-if="active == 'tab5'" /> <MatchSignup v-else-if="active == 'tab5'" />
<AbnormalTeam v-else-if="active == 'tab6'" />
</div> </div>
</div> </div>
@ -27,21 +25,20 @@ import Setting from "@/setting";
import MatchDetail from "../add"; import MatchDetail from "../add";
import MatchArch from "./matchArch"; import MatchArch from "./matchArch";
import MatchProgress from "./matchProgress"; import MatchProgress from "./matchProgress";
import Notice from "./notice"; import notice from "./notice";
import MatchSignup from './matchSignup' import MatchSignup from "./matchSignup";
import AbnormalTeam from './abnormalTeam'
export default { export default {
name: "matchManage", name: "matchManage",
data() { data() {
return { return {
name: this.$route.query.name, name: this.$route.query.name,
active: this.$route.query.tab || '', active: this.$route.query.tab || "tab1",
tabs: { tabs: {
tab1: "大赛详情", tab1: "大赛详情",
tab2: "大赛成绩管理", tab2: "大赛成绩管理",
tab3: "竞赛进展", tab3: "竞赛进展",
tab4: "公告通知", tab4: "公告通知",
tab5: "报名人员", tab5: "报名人员"
} }
}; };
}, },
@ -49,19 +46,14 @@ export default {
MatchDetail, MatchDetail,
MatchArch, MatchArch,
MatchProgress, MatchProgress,
Notice, notice,
MatchSignup, MatchSignup
AbnormalTeam
}, },
mounted() { mounted() {
// if (Setting.dynamicRoute) { Setting.dynamicRoute && this.initTabs()
this.initTabs()
// } else {
// this.active = this.$route.query.tab || 'tab1'
// }
}, },
methods: { methods: {
async initTabs () { initTabs() {
const btns = this.$store.state.btns const btns = this.$store.state.btns
const tab1 = btns.includes('/match:管理:大赛详情') const tab1 = btns.includes('/match:管理:大赛详情')
const tab2 = btns.includes('/match:管理:大赛成绩管理') const tab2 = btns.includes('/match:管理:大赛成绩管理')
@ -69,23 +61,15 @@ export default {
const tab4 = btns.includes('/match:管理:公告通知') const tab4 = btns.includes('/match:管理:公告通知')
const tab5 = btns.includes('/match:管理:报名人员') const tab5 = btns.includes('/match:管理:报名人员')
const res = await this.$post(`${this.api.getCompetition}?competitionId=${this.$route.query.id}`)
tab1 || this.$delete(this.tabs, 'tab1') tab1 || this.$delete(this.tabs, 'tab1')
if (!tab2 || !res.competition.releaseType) this.$delete(this.tabs, 'tab2') tab2 || this.$delete(this.tabs, 'tab2')
tab3 || this.$delete(this.tabs, 'tab3') tab3 || this.$delete(this.tabs, 'tab3')
tab4 || this.$delete(this.tabs, 'tab4') tab4 || this.$delete(this.tabs, 'tab4')
tab5 || this.$delete(this.tabs, 'tab5') 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 type = this.$route.query.tab
const keys = Object.keys(this.tabs) const keys = Object.keys(this.tabs)
if (keys.length) this.active = keys.includes(type) ? type : keys[0] this.active = keys.includes(type) ? type : keys[0]
}, },
back() { back() {
this.handleSave(0) && this.backPage() this.handleSave(0) && this.backPage()
@ -99,8 +83,7 @@ export default {
const step = detail.$refs['step' + detail.step] const step = detail.$refs['step' + detail.step]
if (detail.step < 4 && step && step.updateTime) { if (detail.step < 4 && step && step.updateTime) {
this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示', { this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示', {
type: 'warning', type: 'warning'
closeOnClickModal: false
}).then(() => { }).then(() => {
detail.save(1, 1) detail.save(1, 1)
this.backOrTab(i) this.backOrTab(i)
@ -120,12 +103,12 @@ export default {
}, },
// //
backPage(){ backPage(){
this.$router.push(this.$store.state.referrer || '/match') this.$router.push(`/match?page=${this.$store.state.matchPage}&platformSource=${this.$store.state.platformSource}`)
}, },
// tab // tab
tabSwitch(i) { tabSwitch(i) {
this.active = i this.active = i
this.$router.push(`/matchManage?id=${this.$route.query.id}&tab=${i}&name=${this.name}`).catch(e => { }) this.$router.push(`/matchManage?id=${this.$route.query.id}&tab=${i}&name=${this.name}`)
}, },
// tab // tab
backOrTab(i) { backOrTab(i) {
@ -139,4 +122,6 @@ export default {
}; };
</script> </script>
<style scoped></style> <style scoped>
</style>

@ -1,57 +1,26 @@
<template> <template>
<!-- 报名人员 --> <!-- 报名人员 -->
<div class="page-content" style="padding: 24px"> <div class="page-content" style="padding: 24px">
<el-table ref="table" :data="list" class="table" stripe header-align="center" row-key="stageId"> <el-collapse v-model="curStep">
<el-table-column type="index" width="60" label="序号" align="center"> <el-collapse-item v-for="(item, i) in list" :key="i" :title="item.stageName" :name="item.stageId">
<template slot-scope="scope"> <div class="line">
{{ scope.$index + 1 }} <span>比赛方式{{ item.methodName }}</span>
</template> <span>比赛形式{{ item.competitionType ? '团队赛' : '个人赛' }}</span>
</el-table-column> <span>赛制{{ item.ruleName }}</span>
<el-table-column prop="stageName" label="阶段名称" align="center"></el-table-column> <span>状态{{ item.status }}</span>
<el-table-column prop="competitionContent" label="比赛内容" align="center"></el-table-column> <span>竞赛起止时间{{ item.startTime + ' ~ ' + item.endTime }}</span>
<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 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="280">
<template slot-scope="scope">
<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> <div>
<button type="button" class="el-drawer__close-btn" @click="reviewVisible = false"> <el-button type="primary" @click="toRank(item, i)">排名</el-button>
<i class="el-dialog__close el-icon el-icon-close"></i> <el-button @click="toArch(item)">成绩管理</el-button>
</button>
</div> </div>
<iframe :src="reviewUrl" frameborder="0" width="100%"></iframe> </div>
</el-drawer> </el-collapse-item>
</el-collapse>
</div> </div>
</template> </template>
<script> <script>
import Setting from '@/setting' import util from "@/libs/util";
import Const from '@/const/match' import Const from '@/const/match'
export default { export default {
name: "matchArch", name: "matchArch",
@ -62,8 +31,6 @@ export default {
form: {}, form: {},
timer: null, timer: null,
curStep: [], curStep: [],
reviewVisible: false,
reviewUrl: '',
}; };
}, },
mounted() { mounted() {
@ -112,27 +79,15 @@ export default {
} }
} }
}) })
console.log("🚀 ~ file: matchArch.vue:87 ~ handleStatus ~ this.status", this.list)
}, },
// //
toRank(row, i) { toRank(row, i) {
this.$store.commit('setInnerReferrer', this.$route.fullPath)
this.$router.push(`/matchRank?id=${this.id}&stageId=${row.stageId}&index=${i}&method=${row.method}&competitionType=${row.competitionType}&rule=${row.rule}`) this.$router.push(`/matchRank?id=${this.id}&stageId=${row.stageId}&index=${i}&method=${row.method}&competitionType=${row.competitionType}&rule=${row.rule}`)
}, },
// //
toArch (row, i) { toArch(row) {
this.$store.commit('setInnerReferrer', this.$route.fullPath) this.$router.push(`/matchArchList?id=${this.id}&stageId=${row.stageId}&method=${row.method}&competitionType=${row.competitionType}`)
const cur = this.form.competitionStage[i]
const showFile = !!(cur.method === 2 && cur.competitionStageContentSetting && cur.competitionStageContentSetting.whetherToUploadFiles)
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
} }
} }
}; };
@ -143,26 +98,12 @@ export default {
font-size: 16px; font-size: 16px;
color: #333; color: #333;
} }
.line { .line {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
span { span {
margin-right: 30px; margin-right: 30px;
} }
} }
/deep/.review-dia {
.el-drawer__close-btn {
position: absolute;
top: 20px;
right: 20px;
}
iframe {
height: 100%;
}
}
</style> </style>

@ -2,32 +2,21 @@
<div> <div>
<el-card shadow="hover" class="m-b-20 head-card"> <el-card shadow="hover" class="m-b-20 head-card">
<div class="flex-between m-b-20"> <div class="flex-between m-b-20">
<el-page-header @back="back" content="成绩管理"></el-page-header> <el-page-header @back="$router.back()" content="成绩管理"></el-page-header>
</div> </div>
</el-card> </el-card>
<div v-loading="loading">
<el-card v-if="method != 2" shadow="hover" class="m-b-20"> <el-card v-if="method != 2" shadow="hover" class="m-b-20">
<div class="stat"> <div class="stat">
<div class="nums"> <div class="nums">
<div class="item"> <div class="item">
<p class="name">已参加/应参加人数</p> <p class="name">实验总人数</p>
<p class="val">{{ isNaN(statData.totalNumber) ? '' : statData.attendance + '/' + statData.totalNumber }} <p class="val">{{ totalNumber }}</p>
</p>
</div> </div>
<div class="item"> <div class="item">
<p class="name">平均分</p> <p class="name">实验平均分</p>
<p class="val">{{ (+statData.avgScore).toFixed(2) }}</p> <p class="val">{{ avgScore }}</p>
</div>
<div class="item">
<p class="name">最高分</p>
<p class="val">{{ statData.maxScore }}
</p>
</div>
<div class="item">
<p class="name">最低分</p>
<p class="val">{{ statData.minScore }}</p>
</div> </div>
</div> </div>
<div class="chart" id="chart"></div> <div class="chart" id="chart"></div>
@ -35,538 +24,226 @@
</el-card> </el-card>
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<div class="tabs m-b-20"> <div class="flex-between m-b-20">
<a class="item" v-for="(item, i) in tabs" :key="i" :class="{ active: item.id === active }" <div>
@click="tabChange(item.id)">{{ item.name }}</a> <el-input
size="small"
placeholder="请输入学校/学生姓名"
prefix-icon="el-icon-search"
v-model="keyword" clearable
style="width: 300px"
></el-input>
</div> </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 v-if="active">
<label>评阅状态</label>
<el-select v-model="filter.reviewStatus" clearable placeholder="请选择评阅状态" @change="initData">
<el-option value="待评阅"></el-option>
<el-option value="已评阅"></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> <div>
<template v-if="active && method === 1"> <el-button v-if="method == 2" type="primary" @click="batchImport">上传成绩</el-button>
<el-button v-auth="'/review:分配评阅任务'" type="primary" size="mini" <el-button type="primary" @click="delAllData">批量删除</el-button>
@click="showReview('/allocationReview')">分配评阅任务</el-button> <el-button type="primary" @click="exportData">导出</el-button>
<el-button v-if="showMyReviewTask" type="primary" size="mini"
@click="showReview('/myReview/records')">我的评阅任务</el-button>
<el-button type="primary" size="mini" @click="exportFiles">导出答题文件</el-button>
</template>
<el-button type="primary" size="mini" :loading="exportingList" @click="exportList">{{ exportingList ? '正在导出'
:
'导出成绩列表'
}}</el-button>
<template v-if="active">
<el-button type="primary" size="mini" :loading="exportingReport" @click="exporReport">{{ exportingReport ?
'正在导出' :
'导出成绩报告'
}}</el-button>
<el-button type="primary" size="mini" @click="delAllData">批量删除</el-button>
</template>
</div> </div>
</div> </div>
<el-table :data="list" class="table" :key="1" ref="table" stripe header-align="center" <el-table :data="list" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="reportId">
@selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <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 type="index" width="60" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="provinceName" label="省份" min-width="100" align="center"></el-table-column> <el-table-column prop="schoolName" label="学校" min-width="150" align="center"></el-table-column>
<el-table-column prop="cityName" 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="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="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="workNumber" label="学号" min-width="100" align="center"></el-table-column>
<el-table-column prop="score" label="成绩" width="90" align="center" sortable="custom"> <el-table-column prop="score" label="分数" width="90" align="center"></el-table-column>
<el-table-column prop="timeSum" label="耗时" width="90" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.submitTime ? scope.row.score : '--' }} {{ scope.row.timeSum }}min
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="timeSum" label="用时" width="90" align="center"> <el-table-column prop="submitTime" label="提交时间" min-width="150" align="center">
<template slot-scope="scope">
{{ scope.row.timeSum ? scope.row.timeSum + 'min' : '--' }}
</template>
</el-table-column> </el-table-column>
<el-table-column prop="submitTime" label="提交时间" min-width="150" align="center" sortable="custom"> <el-table-column label="操作" align="center" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.submitTime || '--' }} <el-button v-if="scope.row.reportId" type="text" @click="show(scope.row)">查看成绩报告</el-button>
</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 prop="evaluationStatus" label="评阅状态" align="center" width="90">
<template slot-scope="scope">
<span v-if="scope.row.reviewStatus === '-'">-</span>
<el-tag v-else :type="scope.row.reviewStatus === '待评阅' ? 'danger' : 'success'">{{ scope.row.reviewStatus
}}</el-tag>
</template>
</el-table-column>
<el-table-column v-if="active" label="操作" align="center" width="300">
<template v-if="scope.row.reportId" slot-scope="scope">
<template v-if="method === 1">
<el-popover placement="top" trigger="click" popper-class="files-tip">
<div>
<ul class="match-files">
<li v-for="(file, i) in scope.row.files" :key="i" @click="preview(file.attachmentUrl)">{{
file.attachmentName }}</li>
</ul>
</div>
<el-button slot="reference" :disabled="!scope.row.hasFile" type="text"
@click="showFiles(scope.row)">查看答题文件</el-button>
</el-popover>
<el-button style="margin-left: 10px;" :disabled="!scope.row.hasFile" type="text"
@click="downloadFile(scope.row)">下载答题文件</el-button>
</template>
<el-button v-if="method != 2" type="text" @click="toReport(scope.row)">查看成绩报告</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" <el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
@current-change="handleCurrentChange" :current-page="page">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
</div>
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false" <el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false">
@close="cancelUpload">
<div style="text-align: center"> <div style="text-align: center">
<template v-if="!uploadFaild">
<div style="margin-bottom: 10px;"> <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> </div>
<el-upload ref="upload" name="file" accept=".xls,.xlsx" class="import-file" :before-upload="beforeUpload" <el-upload
:on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" ref="importStaff"
:limit="1" :on-exceed="handleExceed" :action="this.api.batchImportGrades" :file-list="uploadList" name="file"
:headers="headers" :disabled="uploading" :data="{ accept=".xls,.xlsx"
: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"
:data="{
competitionId: this.id, competitionId: this.id,
stageId: this.stageId, stageId: this.stageId,
systemId: 0 systemId: 0
}"> }"
<el-button type="primary" :loading="uploading" class="ml20">上传文件<i >
class="el-icon-upload2 el-icon--right"></i></el-button> <el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload> </el-upload>
</template> <el-link v-if="uploadFaild" type="primary" @click="showFaild">部分数据导入失败查看失败原因</el-link>
<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> </div>
<span v-if="uploading" slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="cancelUpload">停止导入</el-button> <el-button size="small" @click="importVisible = false"> </el-button>
<el-button size="small" type="primary" @click="uploadSure"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<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>
<el-dialog title="图片预览" :visible.sync="previewImgVisible" width="800px" :close-on-click-modal="false">
<el-image style="max-width: 100px; max-height: 100px" :src="previewImg" :preview-src-list="[previewImg]">
</el-image>
</el-dialog>
<PdfDia :key="pdfVisible" :visible.sync="pdfVisible" :src.sync="pdfSrc" />
</div> </div>
</template> </template>
<script> <script>
import Setting from '@/setting' import Setting from "@/setting";
import PdfDia from '@/components/pdf' import util from "@/libs/util";
import Util from '@/libs/util'
import * as echarts from "echarts"; import * as echarts from "echarts";
import axios from 'axios'; import axios from 'axios';
export default { export default {
components: {
PdfDia
},
data() { data() {
return { return {
id: +this.$route.query.id, id: +this.$route.query.id,
stageId: +this.$route.query.stageId, stageId: +this.$route.query.stageId,
method: +this.$route.query.method, method: +this.$route.query.method,
competitionType: +this.$route.query.competitionType, competitionType: +this.$route.query.competitionType,
showMyReviewTask: +this.$route.query.showMyReviewTask, keyword: "",
isCompress: Util.isCompress,
filter: {
provinceId: '',
cityId: '',
realSchoolId: '',
reviewStatus: '',
scoreSortOrder: '',
submitTimeSortOrder: '',
},
provinces: [],
cities: [],
schools: [],
keyword: this.$route.query.keyword || '',
searchTimer: null, searchTimer: null,
list: [], list: [],
multipleSelection: [], multipleSelection: [],
page: +this.$route.query.page || 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
totalNumber: 0, //
list1: [],
multipleSelection1: [],
page1: 1,
total1: 0,
avgScore: 0, // avgScore: 0, //
importVisible: false, importVisible: false,
uploadList: [], uploadList: [],
uploadFaild: false, uploadFaild: false,
uploading: false, exportCode: '',
faildData: null,
headers: { headers: {
token: sessionStorage.getItem("token") token: sessionStorage.getItem("token")
}, },
statData: { statData: {}
avgScore: 0,
maxScore: 0,
minScore: 0,
},
tabs: [
{
id: 1,
name: '已提交'
},
{
id: 0,
name: '未提交'
}
],
active: 1,
loading: false,
exportingFiles: false,
exportingList: false,
exportingReport: false,
previewImgVisible: false,
previewImg: '',
pdfVisible: false,
pdfSrc: '',
reviewVisible: false,
reviewUrl: '',
}; };
}, },
watch: { watch: {
keyword: function(val) { keyword: function(val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.$router.push({
path: '/matchArchList',
query: {
...this.$route.query,
keyword: val
}
})
this.initData(); this.initData();
}, 500); }, 500);
} }
}, },
mounted() { mounted() {
this.getData() this.getData()
this.getProvince()
this.getSchool()
}, },
methods: { methods: {
async getData () { getData() {
this.loading = true this.$post(this.api.stageGradeManagementList, {
const { data, page } = await this.$post(this.api.stageGradeManagementList, {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
competitionId: this.id, competitionId: this.id,
keyWord: this.keyword, keyWord: this.keyword,
stageId: this.stageId, stageId: this.stageId,
isNakadai: 1, isNakadai: 1
participatingState: this.active, }).then(({ data, page }) => {
...this.filter
})
this.loading = false
this.total = page.total this.total = page.total
this.list = page.records this.list = page.records
this.statData = data this.statData = data
this.avgScore = (+data.avgScore).toFixed(2)
this.totalNumber = data.totalNumber
this.getChart() this.getChart()
}).catch(res => {})
}, },
initData() { initData() {
this.page = 1 this.page = 1
this.getData() 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
},
//
sortChange (column) {
if (column.prop === 'score') this.filter.scoreSortOrder = column.order ? column.order === 'ascending' ? 'ASC' : 'DESC' : ''
if (column.prop === 'submitTime') this.filter.scoreSortOrder = column.order ? column.order === 'ascending' ? 'ASC' : 'DESC' : ''
this.getData()
},
//
async showFiles (row) {
const { data } = await this.$get(this.api.getPaperUploadFile, {
reportId: row.reportId
})
this.$set(row, 'files', data)
},
//
async downloadFile (row) {
const res = await axios.post(this.api.getPaperUploadFileZip, {
reportIds: [row.reportId],
// reportIds: [3785],
stageId: this.stageId
}, {
headers: this.headers,
responseType: 'blob'
})
const name = res.headers['content-disposition']
Util.downloadFileDirect(name ? decodeURI(name) : '答题文件.zip', new Blob([res.data]))
},
// //
toReport (row) { show(row) {
this.$router.push(`/${this.method === 1 ? 'theoryReport' : 'trialReport'}?reportId=${row.reportId}`) this.$router.push(`/matchReport?reportId=${row.reportId}`)
},
//
showReview (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=${this.stageId}`
localStorage.setItem('review_token', sessionStorage.getItem('token'))
this.reviewUrl = url
this.reviewVisible = true
}, },
// // ()
async exportFiles () { exportData() {
if (this.list.length) { // id
this.exportingFiles = true
const list = this.multipleSelection
const ids = []
if (list.length) {
list.forEach(e => {
e.reportId && ids.push(e.reportId)
})
}
const res = await axios.post(this.api.getPaperUploadFileZip, {
reportIds: ids,
// reportIds: [3785],
stageId: this.stageId
}, {
headers: this.headers,
responseType: 'blob'
})
const name = res.headers['content-disposition']
Util.downloadFileDirect(name ? decodeURI(name) : '答题文件.zip', new Blob([res.data]))
this.exportingFiles = false
}
},
// ()
async exportList () {
if (this.list.length) {
this.exportingList = true
//
if (this.multipleSelection.length) { if (this.multipleSelection.length) {
const res = await axios.post(this.api.exportExperimentalResultsInBatch, this.multipleSelection, { const ids = this.multipleSelection.map(e => e.reportId)
headers: this.headers, url += `&ids=${ids.toString()}`
responseType: 'blob'
})
Util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data]))
this.exportingList = 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,
participatingState: this.active,
}, {
headers: this.headers,
responseType: 'blob'
})
Util.downloadFileDirect(`赛事成绩.xls`, new Blob([res.data]))
this.exportingList = false
}
} }
}, axios.post(this.api.exportExperimentalResultsInBatch, this.list, {
// ()
async exporReport () {
if (this.list.length) {
this.exportingReport = true
const list = this.multipleSelection
const ids = []
if (list.length) {
list.forEach(e => {
e.reportId && ids.push(e.reportId)
})
}
let res
//
if (this.method) {
res = await axios.post(this.api.exportExamPaperReports, {
ids,
stageId: list.length ? '' : this.stageId
}, {
headers: this.headers, headers: this.headers,
responseType: 'blob' responseType: 'blob'
}) }).then((res) => {
Util.downloadFileDirect('成绩报告.zip', new Blob([res.data])) util.downloadFileDirect(`赛事成绩.xls`,new Blob([res.data]))
this.exportingReport = false }).catch(res => {})
} else {
//
res = await axios.post(this.api.batchExportReportsAsZip, {
reportIds: ids,
stageId: this.stageId,
competitionId: this.id,
}, {
headers: this.headers,
responseType: 'blob'
})
Util.downloadFileDirect('成绩报告.zip', new Blob([res.data]))
this.exportingReport = false
}
}
}, },
async handleDelete (row) { // handleDelete(row) { //
await this.$confirm(`<p>确认要删除【${row.userName}】的成绩记录吗?</p><p style="color: #f56c6c;">删除后成绩数据不可恢复,自动变为未提交</p>`, '提示', { this.$confirm("确定要删除吗?", "提示", {
confirmButtonText: '确定', type: "warning"
cancelButtonText: '取消', }).then(() => {
type: 'warning', this.$post(this.api.batchDeleteContestGrade, {
closeOnClickModal: false,
dangerouslyUseHTMLString: true,
})
await this.$post(this.api.batchDeleteContestGrade, {
ids: [this.method == 2 ? row.scoreId : row.reportId], ids: [this.method == 2 ? row.scoreId : row.reportId],
competitionId: this.id, competitionId: this.id,
stageId: this.stageId stageId: row.stageId
}) }).then(res => {
Util.successMsg("删除成功") util.successMsg("删除成功");
this.getData() this.getData();
}).catch(res => {
});
}).catch(() => {
});
}, },
delAllData() { // delAllData() { //
const list = this.multipleSelection if (this.multipleSelection.length) {
this.$confirm(list.length ? '该项目下的所有成绩报告将会删除,是否继续?' : '是否确定删除列表所有成绩数据?', "提示", { this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", {
type: "warning" type: "warning"
}).then(async () => { }).then(() => {
let ids = [] let ids = this.multipleSelection.map(item => {
if (list.length) {
ids = list.map(item => {
return this.method == 2 ? item.scoreId : item.reportId return this.method == 2 ? item.scoreId : item.reportId
}); });
ids = ids.filter(e => e) this.$post(this.api.batchDeleteContestGrade, {
} ids,
const data = {
competitionId: this.id, competitionId: this.id,
stageId: this.stageId stageId: this.stageId
} }).then(res => {
if (list.length) data.ids = ids
await this.$post(this.api.batchDeleteContestGrade, data)
this.multipleSelection = []; this.multipleSelection = [];
this.$refs.table.clearSelection(); this.$refs.table.clearSelection();
Util.successMsg("删除成功"); util.successMsg("删除成功");
this.getData(); this.getData();
}).catch(() => { }); }).catch(res => {
});
}).catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
}, },
handleSelectionChange(val) { // handleSelectionChange(val) { //
this.multipleSelection = val; this.multipleSelection = val;
}, },
handleCurrentChange(val) { // handleCurrentChange(val) { //
this.$router.push({
path: '/matchArchList',
query: {
...this.$route.query,
page: val
}
})
this.page = val; this.page = val;
this.getData(); this.getData();
}, },
handleSelectionChange1 (val) { //
this.multipleSelection1 = val;
},
getChart() { // 线 getChart() { // 线
const { fractionalSegmentCounts: data } = this.statData const data = []
const { statData } = this
for (let i = 1; i <= 10; i++) {
data.push(statData['num' + i])
}
let myChart = echarts.init(document.getElementById("chart")); let myChart = echarts.init(document.getElementById("chart"));
myChart.setOption({ myChart.setOption({
title: { text: "实验分数分布图" }, title: { text: "实验分数分布图" },
@ -576,21 +253,17 @@ export default {
type: "category", type: "category",
boundaryGap: false, boundaryGap: false,
interval: 10, interval: 10,
data: data.map(e => e.range) data: ["0-10", "11-20", "21-30", "31-40", "41-50", "51-60", "61-70", "71-80", "81-90", "91-100"]
}, },
yAxis: { yAxis: {
name: "人数", name: "人数",
type: "value", type: "value",
minInterval: 10 interval: 1
}, },
series: [{ series: [{
data: data.map(e => e.count), data,
type: "line", type: "line",
areaStyle: {}, areaStyle: {},
label: {
show: true,
position: 'top'
},
color: ["#8191fd"] color: ["#8191fd"]
}] }]
}); });
@ -603,56 +276,42 @@ export default {
}, },
// //
download() { download() {
axios.get(`${this.api.gradeDownloadExcel}?competitionId=${this.id}&stageId=${this.stageId}`, { location.href = this.api.gradeImport
headers: this.headers,
responseType: 'blob'
}).then((res) => {
Util.downloadFileDirect('赛事成绩导入模板.xlsx', new Blob([res.data]))
}).catch(res => { })
}, },
// //
handleExceed(files, fileList) { handleExceed(files, fileList) {
Util.warningMsg( util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
) )
}, },
// //
showFaild() { showFaild() {
axios.get(`${this.api.performanceExportFailure}?exportCode=${this.faildData.exportCode}&competitionType=${this.faildData.competitionType}`, { axios.get(`${this.api.performanceExportFailure}?exportCode=${this.exportCode}`, {
headers: this.headers, headers: this.headers,
responseType: 'blob' responseType: 'blob'
}).then((res) => { }).then((res) => {
Util.downloadFileDirect(`批量导入成绩管理失败数据导出.xls`, new Blob([res.data])) util.downloadFileDirect(`批量导入成绩管理失败数据导出.xls`, new Blob([res.data]))
}).catch(res => {}) }).catch(res => {})
}, },
uploadSuccess (res) { uploadSuccess(res, file, fileList) {
this.uploading = false
this.uploadFaild = false this.uploadFaild = false
if (res.status === 200) { if (res.status === 200) {
this.initData() if (res.data.exportCode) {
const { data } = res this.exportCode = res.data.exportCode
if (data.exportCode) {
this.faildData = data
this.uploadFaild = true this.uploadFaild = true
} else { util.errorMsg(`本次上传有${res.data.failureNum}个错误信息录入`)
Util.successMsg(data.tip, 3000)
this.importVisible = false
} }
} else { } else {
Util.errorMsg(res.message || '上传失败,请检查数据') res.message ? util.errorMsg(res.message) : util.errorMsg("上传失败,请检查数据")
} }
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.uploading = false
this.$message({ this.$message({
message: "上传出错,请重试!", message: "上传出错,请重试!",
type: "error", type: "error",
center: true center: true
}) })
}, },
beforeUpload (file) {
this.uploading = true
},
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`) return this.$confirm(`确定移除 ${file.name}`)
}, },
@ -660,41 +319,16 @@ export default {
this.uploadList = fileList this.uploadList = fileList
this.uploadFaild = false this.uploadFaild = false
}, },
cancelUpload () { uploadSure() {
this.uploading = false
if (this.$refs.upload) this.$refs.upload.abort()
this.keyword = ''
this.initData()
this.importVisible = false this.importVisible = false
}, this.getData()
// tab
tabChange (i) {
this.multipleSelection = []
this.$refs.table.clearSelection()
this.active = i
this.initData()
},
//
preview (url) {
const ext = url.split('.').pop()
if (Util.isDoc(ext)) {
window.open('https://view.officeapps.live.com/op/view.aspx?src=' + url)
} else if (Util.isImg(ext)) {
this.previewImgVisible = true
this.previewImg = url
} else if (ext === 'pdf') {
this.pdfVisible = true
this.pdfSrc = url
}
},
back () {
this.$router.push(this.$store.state.innerReferrer)
} }
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/ .head-card { /deep/ .head-card {
.el-card__body { .el-card__body {
padding-bottom: 0px; padding-bottom: 0px;
@ -713,31 +347,12 @@ export default {
} }
} }
.tool {
align-items: flex-start;
margin-bottom: 10px;
.filter {
flex-wrap: wrap;
}
li {
margin-bottom: 10px;
}
/deep/.el-select {
width: 140px;
}
}
.stat { .stat {
display: flex; display: flex;
.nums { .nums {
display: flex; display: flex;
flex-wrap: wrap;
align-items: center; align-items: center;
width: 640px;
margin-right: 20px; margin-right: 20px;
.item:nth-child(1) { .item:nth-child(1) {
@ -748,17 +363,8 @@ export default {
background-image: url('../../../assets/img/avg.png'); background-image: url('../../../assets/img/avg.png');
} }
.item:nth-child(3) {
background-image: url('../../../assets/img/ach1.png');
}
.item:nth-child(4) {
background-image: url('../../../assets/img/ach2.png');
}
.item { .item {
width: 300px; width: 300px;
min-height: 145px;
padding: 30px 30px; padding: 30px 30px;
margin: 0 10px; margin: 0 10px;
box-sizing: border-box; box-sizing: border-box;
@ -780,28 +386,8 @@ export default {
} }
.chart { .chart {
width: calc(100% - 660px); flex: 1;
height: 300px; height: 300px;
} }
} }
/deep/.import-file {
.el-progress__text,
.el-progress,
.el-upload-list__item-status-label {
display: none !important;
}
}
/deep/.review-dia {
.el-drawer__close-btn {
position: absolute;
top: 20px;
right: 20px;
}
iframe {
height: 100%;
}
}
</style> </style>

@ -2,11 +2,11 @@
<div style="padding: 0 100px;"> <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"> <div class="flex-between">
<el-page-header @back="back" content="参赛信息与成绩"></el-page-header> <el-page-header @back="$router.back()" content="参赛信息与成绩"></el-page-header>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="m-b-20" v-loading="loading"> <el-card shadow="hover" class="m-b-20">
<div style="display: flex;align-items: center"> <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> <tr>
@ -16,7 +16,7 @@
</td> </td>
<th width="150">团队邀请码</th> <th width="150">团队邀请码</th>
<td> <td>
<el-input :disabled="!editing" maxlength="6" v-model="info.team.invitationCode"></el-input> <el-input :disabled="!editing" v-model="info.team.invitationCode"></el-input>
</td> </td>
</tr> </tr>
</table> </table>
@ -36,21 +36,19 @@
</tr> </tr>
<tr> <tr>
<th>学校</th> <th>学校</th>
<td>{{ info.person.realSchool }}</td> <td>{{ info.person.schoolName }}</td>
</tr> </tr>
</template> </template>
<template v-if="form.completeCompetitionSetup.competitionType"> <template v-if="form.completeCompetitionSetup.competitionType">
<template> <template>
<tr> <tr>
<th>队长</th> <th>队长</th>
<td>{{ info.captain.userName }}{{ info.captain.realSchool && ',' + info.captain.realSchool }}{{ <td>{{ info.caption.userName }}{{ info.caption.schoolName && ',' + info.caption.schoolName }}{{ info.caption.workNumber && ',' + info.caption.workNumber }}</td>
info.captain.workNumber && ',' + info.captain.workNumber }}</td>
</tr> </tr>
<tr> <tr>
<th>团队成员</th> <th>团队成员</th>
<td> <td>
<el-tag v-for="(item, i) in info.teamDetail" :key="i" style="margin-right: 5px">{{ item.userName <el-tag v-for="(item, i) in info.teamDetail" :key="i" style="margin-right: 5px">{{ item.userName }}</el-tag>
}}</el-tag>
</td> </td>
</tr> </tr>
</template> </template>
@ -58,17 +56,15 @@
<tr> <tr>
<th width="130">指导老师</th> <th width="130">指导老师</th>
<td> <td>
<div class="plus"> <div v-if="status < 5" 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>
<div v-for="(item, i) in info.teamInstructors" :key="i" class="line"> <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="请输入姓名" v-model="item.name" clearable size="mini" :disabled="!item.edit"></el-input>
<el-input placeholder="请输入职务" maxlength="10" v-model="item.position" clearable size="mini" <el-input placeholder="请输入职务" maxlength="10" v-model="item.position" clearable size="mini" :disabled="!item.edit"></el-input>
:disabled="!item.edit"></el-input> <el-input placeholder="请输入手机号" maxlength="11" v-model="item.phone" clearable size="mini" :disabled="!item.edit"></el-input>
<el-input placeholder="请输入手机号" maxlength="11" v-model="item.phone" clearable size="mini" <template v-if="status < 5">
:disabled="!item.edit"></el-input> <i v-if="item.edit" class="el-icon-check icon" @click="submitAdvisor(item)"></i>
<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 v-else class="el-icon-edit icon" @click="editAdvisor(item)"></i>
<i class="el-icon-delete icon" @click="delAdvisor(item, i)"></i> <i class="el-icon-delete icon" @click="delAdvisor(item, i)"></i>
</template> </template>
@ -84,13 +80,7 @@
<th>赛项阶段名称</th> <th>赛项阶段名称</th>
<template v-if="form.completeCompetitionSetup.competitionType"> <template v-if="form.completeCompetitionSetup.competitionType">
<th width="110">参赛人数限制</th> <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> </template>
<th v-if="form.rule === 0">总分</th> <th v-if="form.rule === 0">总分</th>
<th>竞赛成绩</th> <th>竞赛成绩</th>
@ -100,28 +90,26 @@
<td>{{ i + 1 }}</td> <td>{{ i + 1 }}</td>
<td>{{ item.stageName }}</td> <td>{{ item.stageName }}</td>
<template v-if="form.completeCompetitionSetup.competitionType"> <template v-if="form.completeCompetitionSetup.competitionType">
<td>{{ item.customNumber || '不限制' }}</td> <td>{{ item.teamNumLimit || '不限制' }}</td>
<td> <td>
<template v-if="item.participants"> <template v-if="item.participants">
<el-tag v-for="tag in item.participants" :key="tag.name" class="m-r-5" closable <el-tag
v-for="tag in item.participants"
:key="tag.name"
class="m-r-5"
closable
@close="removePar(tag, item)"> @close="removePar(tag, item)">
{{tag.name}} {{tag.name}}
</el-tag> </el-tag>
</template> </template>
<span v-else class="m-r-5"></span> <span v-else class="m-r-5"></span>
<i class="el-icon-edit icon" @click="selectPar(item)"></i> <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> </td>
</template> </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> <td>
<span v-if="item.score >= 0" class="m-r-10">分数{{item.score}}</span> <span v-if="item.score >= 0" class="m-r-10">分数{{item.score}}</span>
<el-button <el-button type="text" :disabled="item.resultsDetails === 1 || (form.completeCompetitionSetup.competitionType && !item.reportId) || (form.completeCompetitionSetup.competitionType === 0 && !item.reportId)" @click="show(item)">查看成绩详情</el-button>
v-if="form.completeCompetitionSetup.competitionType || (!form.completeCompetitionSetup.competitionType && item.reportId)"
type="text" @click="show(item)">查看成绩详情</el-button>
</td> </td>
</tr> </tr>
</template> </template>
@ -129,28 +117,26 @@
<td colspan="6">暂无数据</td> <td colspan="6">暂无数据</td>
</tr> </tr>
</table> </table>
<el-alert v-if="form.completeCompetitionSetup.competitionType && form.rule !== 2" style="margin-top: 10px;" <el-alert
v-if="form.completeCompetitionSetup.competitionType"
style="margin-top: 10px;"
:title="'注:请团长(团队创建人)设置各阶段参赛成员,只有被选择的允许参赛成员可进入对应阶段比赛' + (info.teamLimit ? ',每个团队成员只能参加一个赛项阶段' : '') + '!'" :title="'注:请团长(团队创建人)设置各阶段参赛成员,只有被选择的允许参赛成员可进入对应阶段比赛' + (info.teamLimit ? ',每个团队成员只能参加一个赛项阶段' : '') + '!'"
type="warning" show-icon> type="warning"
show-icon>
</el-alert> </el-alert>
</td> </td>
</tr> </tr>
</table> </table>
<template v-if="form.completeCompetitionSetup.competitionType"> <template v-if="form.completeCompetitionSetup.competitionType">
<div class="flex a-center" style="margin: 20px 0"> <div class="l-title m-t-20">团队成员</div>
<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"> <div class="flex-center">
<p>队长{{ info.captain.userName }}</p> <p>队长{{ info.caption.userName }}</p>
<el-button type="primary" @click="transfer">转让队长</el-button> <el-button type="primary" @click="transfer">转让队长</el-button>
</div> </div>
<el-table :data="info.teamDetail" stripe header-align="center"> <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="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="schoolName" 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="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 prop="createTime" label="加入时间" width="180" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="160"> <el-table-column label="操作" align="center" width="160">
@ -164,8 +150,7 @@
<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"> <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 v-if="item.captain" :key="i" v-model="checkedPlayer" :label="item.teamId">{{ item.userName }}</el-radio>
}}</el-radio>
</template> </template>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="transferSubmit">确定</el-button> <el-button size="small" type="primary" @click="transferSubmit">确定</el-button>
@ -176,16 +161,14 @@
<el-checkbox-group v-model="checkedMembers"> <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> </el-checkbox-group>
<p v-if="info.teamLimit && curRow.customNumber" style="margin-top: 15px;font-size: 12px;">当前阶段限制{{ <p v-if="info.teamLimit && curRow.teamNumLimit" style="margin-top: 15px;font-size: 12px;">当前阶段限制{{ curRow.teamNumLimit }}人参赛且此竞赛每个成员只能参加一个阶段赛项</p>
curRow.customNumber }}人参赛且此竞赛每个成员只能参加一个阶段赛项</p>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="chooseSubmit">确定</el-button> <el-button size="small" type="primary" @click="chooseSubmit">确定</el-button>
<el-button size="small" @click="chooseVisible = false">取消</el-button> <el-button size="small" @click="chooseVisible = false">取消</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="团队得分详情" :visible.sync="memberVisible" width="900px" :close-on-click-modal="false"> <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 }} 阶段名称{{ <h6 v-if="members.length" style="margin-bottom: 10px;font-size: 16px;">团队名称{{ members[0].teamName }} 阶段名称{{ curRow.stageName }}</h6>
curRow.stageName }}</h6>
<table class="table tc"> <table class="table tc">
<tr> <tr>
<th width="60">序号</th> <th width="60">序号</th>
@ -199,11 +182,11 @@
<tr v-for="(item, i) in members" :key="i"> <tr v-for="(item, i) in members" :key="i">
<td>{{ i + 1 }}</td> <td>{{ i + 1 }}</td>
<td>{{ item.userName }}</td> <td>{{ item.userName }}</td>
<td>{{ item.realSchool }}</td> <td>{{ item.schoolName }}</td>
<td>{{ item.timeSum }}min</td> <td>{{ item.timeSum }}min</td>
<td>{{ item.score }}</td> <td>{{ item.score }}</td>
<td> <td>
<el-button :disabled="!item.reportId" type="text" @click="toReport(item)">查看</el-button> <el-button type="text" @click="toReport(item)">查看</el-button>
</td> </td>
</tr> </tr>
</template> </template>
@ -211,11 +194,6 @@
<td colspan="6">暂无数据</td> <td colspan="6">暂无数据</td>
</tr> </tr>
</table> </table>
<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"> <span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="memberVisible = false">确定</el-button> <el-button size="small" type="primary" @click="memberVisible = false">确定</el-button>
</span> </span>
@ -224,13 +202,13 @@
</template> </template>
<script> <script>
import Util from "@/libs/util"; import Setting from "@/setting";
import util from "@/libs/util";
export default { export default {
data() { data() {
return { return {
id: +this.$route.query.id, id: +this.$route.query.id,
accountId: +this.$route.query.accountId, accountId: +this.$route.query.accountId,
loading: false,
status: 5, status: 5,
form: { form: {
competitionStage: [], competitionStage: [],
@ -240,7 +218,7 @@ export default {
info: { info: {
isCaption: 0, isCaption: 0,
person: {}, person: {},
captain: {}, caption: {},
team: { team: {
captain: 1, captain: 1,
invitationCode: '' invitationCode: ''
@ -251,9 +229,6 @@ export default {
}, },
memberVisible: false, memberVisible: false,
members: [], members: [],
page: 1,
pageSize: 10,
total: 0,
curRow: {}, curRow: {},
teamVisible: false, teamVisible: false,
teams: [], teams: [],
@ -270,7 +245,6 @@ export default {
curStage: null, curStage: null,
originInfo: {}, originInfo: {},
originIns: { originIns: {
id: '',
position: '', position: '',
name: '', name: '',
phone: '', phone: '',
@ -285,20 +259,22 @@ export default {
checkedMember: '', checkedMember: '',
checkedMembers: [], checkedMembers: [],
chooses: [], chooses: [],
timer: null, timerList: [],
teamErrors: [], timer: null
stageTip: null,
}; };
}, },
mounted() { mounted() {
this.$once('hook:beforeDestroy', function() { this.$once('hook:beforeDestroy', function() {
clearInterval(this.timer) clearInterval(this.timer)
this.timerList.forEach(n => {
clearTimeout(n)
})
this.timerList = []
}) })
this.getData() this.getData()
}, },
methods: { methods: {
getData() { getData() {
this.loading = true
this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => { this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => {
this.form = competition this.form = competition
this.timer = setInterval(this.handleStatus, 1000) this.timer = setInterval(this.handleStatus, 1000)
@ -315,10 +291,10 @@ export default {
info.team = {} info.team = {}
info.teamDetail = [] info.teamDetail = []
} else { } else {
info.isCaption = info.team.captain info.isCaption = info.team.caption
} }
const captain = info.teamDetail.find(e => !e.captain) const caption = info.teamDetail.find(e => !e.caption)
info.captain = captain ? captain : {} info.caption = caption ? caption : {}
info.person = info.personalDetail || info.teamDetail.find(e => e.accountId == info.team.accountId) info.person = info.personalDetail || info.teamDetail.find(e => e.accountId == info.team.accountId)
this.originInfo = JSON.parse(JSON.stringify(info)) this.originInfo = JSON.parse(JSON.stringify(info))
// accountId // accountId
@ -336,24 +312,22 @@ export default {
e.participants = participants 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.info = info
this.form.completeCompetitionSetup.competitionType && this.getErrorInfo()
this.loading = false
}).catch(err => {}); }).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() { handleStatus() {
let status let status
@ -380,7 +354,6 @@ export default {
edit(showMsg) { edit(showMsg) {
if (this.editing || !showMsg) { if (this.editing || !showMsg) {
const { teamId, teamName, invitationCode } = this.info.team const { teamId, teamName, invitationCode } = this.info.team
if (invitationCode.length !== 6) return Util.errorMsg('请输入6位数团队邀请码')
this.$post(this.api.editCompetitionTeam, { this.$post(this.api.editCompetitionTeam, {
accountId: this.accountId, accountId: this.accountId,
identification: 1, identification: 1,
@ -392,7 +365,7 @@ export default {
}).then(res => { }).then(res => {
this.editing = false this.editing = false
this.getInfo() this.getInfo()
showMsg && Util.successMsg('保存成功') showMsg && util.successMsg('保存成功')
}).catch(res => {}) }).catch(res => {})
} else { } else {
this.editing = !this.editing this.editing = !this.editing
@ -405,8 +378,8 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$post(`${this.api.deleteAnAdvisor}?id=${row.id}`).then(res => { this.$post(`${this.api.deleteAnAdvisor}?id=${row.id}`).then(res => {
Util.successMsg('删除成功') util.successMsg('删除成功')
this.info.teamInstructors.splice(i, 1) this.getInfo()
}).catch(res => {}) }).catch(res => {})
}).catch(() => {}) }).catch(() => {})
} else { } else {
@ -415,20 +388,18 @@ export default {
}, },
// //
addAdvisor() { addAdvisor() {
if (this.info.teamInstructors.length > 4) return Util.errorMsg('指导老师仅限添加5个!') if (this.info.teamInstructors.length > 4) return util.errorMsg('指导老师仅限添加5个!')
const line = JSON.parse(JSON.stringify(this.originIns)) this.info.teamInstructors.push(JSON.parse(JSON.stringify(this.originIns)))
line.edit = 1
this.info.teamInstructors.push(line)
}, },
// //
editAdvisor(row) { editAdvisor(row) {
this.$set(row, 'edit', 1) this.$set(row, 'edit', 1)
}, },
// //
submitAdvisor (row, i) { submitAdvisor(row) {
if (!row.name) return Util.errorMsg('请输入姓名') if (!row.name) return util.errorMsg('请输入姓名')
const { phone } = row const { phone } = row
if (phone && !/^1[3456789]\d{9}$/.test(phone)) return Util.errorMsg('请输入正确手机号格式') if (phone && !/^1[3456789]\d{9}$/.test(phone)) return util.errorMsg('请输入正确手机号格式')
this.$post(this.api.addAnAdvisor, { this.$post(this.api.addAnAdvisor, {
name: row.name, name: row.name,
competitionId: this.id, competitionId: this.id,
@ -436,28 +407,34 @@ export default {
teamId: this.info.teamId, teamId: this.info.teamId,
phone: row.phone, phone: row.phone,
position: row.position, position: row.position,
accountId: this.accountId }).then(res => {
}).then(({ id }) => { util.successMsg((row.id ? '修改' : '新增') + '成功')
Util.successMsg((row.id ? '修改' : '新增') + '成功') this.getInfo()
if (!row.id) {
this.info.teamInstructors[i].id = id
}
this.info.teamInstructors[i].edit = 0
}).catch(res => {}) }).catch(res => {})
}, },
// //
transfer() { transfer() {
this.transferVisible = true //
const now = new Date()
let start = 0
for (const e of this.form.competitionStage) {
if (now >= new Date(e.startTime) && now <= new Date(e.endTime)) {
util.errorMsg('比赛已经开始,无法转让队长!')
start = 1
break
}
}
if (!start) this.transferVisible = true
}, },
// //
transferSubmit() { transferSubmit() {
if (!this.checkedPlayer) return Util.errorMsg('请选择成员') if (!this.checkedPlayer) return util.errorMsg('请选择成员')
this.$post(this.api.captainOfTransfer, { this.$post(this.api.captainOfTransfer, {
captainId: this.info.captain.teamId, captainId: this.info.caption.teamId,
playerId: this.checkedPlayer playerId: this.checkedPlayer
}).then(res => { }).then(res => {
this.checkedPlayer = '' this.checkedPlayer = ''
Util.successMsg('转让成功') util.successMsg('转让成功')
this.transferVisible = false this.transferVisible = false
this.getInfo() this.getInfo()
}).catch(res => {}) }).catch(res => {})
@ -467,13 +444,13 @@ export default {
// //
const now = new Date() const now = new Date()
let start = 0 let start = 0
// for (const e of this.form.competitionStage) { for (const e of this.form.competitionStage) {
// if (now >= new Date(e.startTime) && now <= new Date(e.endTime)) { if (now >= new Date(e.startTime) && now <= new Date(e.endTime)) {
// Util.errorMsg('') util.errorMsg('比赛已经开始,无法踢出成员!')
// start = 1 start = 1
// break break
// } }
// } }
if (!start) { if (!start) {
let include let include
for (const e of this.info.stages) { for (const e of this.info.stages) {
@ -489,7 +466,7 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$post(`${this.api.removeTheLine}?teamId=${this.info.teamId}&competitionId=${this.id}&accountId=${row.accountId}`).then(res => { this.$post(`${this.api.removeTheLine}?teamId=${this.info.teamId}&competitionId=${this.id}&accountId=${row.accountId}`).then(res => {
Util.successMsg('移除成功') util.successMsg('移除成功')
this.getInfo() this.getInfo()
}).catch(res => {}) }).catch(res => {})
}).catch(() => {}) }).catch(() => {})
@ -506,16 +483,20 @@ export default {
stageId: stage.stageId, stageId: stage.stageId,
teamId: this.info.teamId teamId: this.info.teamId
}).then(res => { }).then(res => {
Util.successMsg('移除成功') util.successMsg('移除成功')
this.getInfo() this.getInfo()
}).catch(res => {}) }).catch(res => {})
}).catch(() => {}) }).catch(() => {})
}, },
// //
selectPar(row) { selectPar(row) {
// debugger
const item = this.form.competitionStage.find(e => e.stageId == row.stageId) const item = this.form.competitionStage.find(e => e.stageId == row.stageId)
if (item) { if (item) {
//
const now = new Date()
if (now >= new Date(item.startTime) && now <= new Date(item.endTime)) {
return util.errorMsg('该阶段比赛已经开始,无法修改允许参赛人员!')
} else {
const { teamLimit, stages, teamDetail } = this.info const { teamLimit, stages, teamDetail } = this.info
// teamLimit=truestagesparticipantAccountIdsaccountId // teamLimit=truestagesparticipantAccountIdsaccountId
if (teamLimit) { if (teamLimit) {
@ -535,16 +516,17 @@ export default {
this.chooses = this.info.teamDetail this.chooses = this.info.teamDetail
} }
this.curRow = row this.curRow = row
this.checkedMembers = row.participants ? row.participants.map(e => e.id) : [] this.checkedMembers = []
this.chooseVisible = true this.chooseVisible = true
} }
}
}, },
// //
chooseSubmit() { chooseSubmit() {
const accountIds = this.checkedMembers const accountIds = this.checkedMembers
if (!accountIds.length) return Util.errorMsg('请选择参赛成员!') if (!accountIds.length) return util.errorMsg('请选择参赛成员!')
const { customNumber, teamNumLimit } = this.curRow // const limit = this.curRow.teamNumLimit //
if (teamNumLimit && accountIds.length > customNumber) return Util.errorMsg(`请选择${this.curRow.customNumber}个以下参赛成员!`) // if (limit && accountIds.length > limit) return util.errorMsg(`请选择${limit}个以下参赛成员!`) //
this.$post(this.api.stageSelectParticipants, { this.$post(this.api.stageSelectParticipants, {
accountIds, accountIds,
competitionId: this.id, competitionId: this.id,
@ -552,32 +534,28 @@ export default {
teamId: this.info.teamId teamId: this.info.teamId
}).then(res => { }).then(res => {
this.checkedMembers = [] this.checkedMembers = []
Util.successMsg('修改成功') util.successMsg('修改成功')
this.getInfo() this.getInfo()
this.chooseVisible = false this.chooseVisible = false
}).catch(res => {}) }).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) { show(row) {
this.curRow = row
// //
if (this.form.completeCompetitionSetup.competitionType) { // if (this.form.completeCompetitionSetup.competitionType) { //
this.curRow = row
this.memberVisible = true this.memberVisible = true
if (this.info.teamId) { const teamId = this.info.teamId
this.getMembers() if (teamId) {
this.$post(this.api.frontOfficeCompetitionRanking, {
pageNum: 1,
pageSize: 1000,
competitionId: this.id,
isOverallRanking: 0,
teamId
}).then(({ list }) => {
this.members = list
}).catch(res => {})
} else { } else {
this.members = [] this.members = []
} }
@ -585,17 +563,10 @@ export default {
this.toReport(row) this.toReport(row)
} }
}, },
handleCurrentChange (val) {
this.page = val;
this.getMembers()
},
// //
toReport(row) { toReport(row) {
this.$router.push(`/${this.curRow.method === 1 ? 'theoryReport' : 'trialReport'}?reportId=${row.reportId}`) this.$router.push(`/matchReport?reportId=${row.reportId}`)
}, },
back () {
this.$router.push(this.$store.state.innerReferrer)
}
} }
}; };
</script> </script>
@ -604,65 +575,52 @@ export default {
.m-r-5 { .m-r-5 {
margin-right: 5px; margin-right: 5px;
} }
.l-title { .l-title {
margin-top: 20px; margin-top: 20px;
font-size: 18px; font-size: 18px;
} }
.table { .table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
th, td {
th,
td {
padding: 12px; padding: 12px;
border: 1px solid #ebeef5; border: 1px solid #ebeef5;
} }
&.tc { &.tc {
text-align: center; text-align: center;
} }
th { th {
text-align: center; text-align: center;
background-color: #f8faff; background-color: #f8faff;
} }
.icon { .icon {
margin-right: 10px; margin-right: 10px;
font-size: 16px; font-size: 16px;
color: #7a7a7a; color: #7a7a7a;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
color: #007eff; color: #007EFF;
} }
} }
.plus { .plus {
margin-bottom: 10px; margin-bottom: 10px;
text-align: right; text-align: right;
} }
.line { .line {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 10px; margin-bottom: 10px;
.el-input { .el-input {
margin-right: 15px; margin-right: 15px;
} }
} }
} }
.flex-center { .flex-center {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 15px; margin-bottom: 15px;
} }
.text-center { .text-center {
text-align: center; text-align: center;
} }

@ -1,74 +1,38 @@
<template> <template>
<!-- 竞赛进展 --> <!-- 竞赛进展 -->
<div class="page-content" <div class="page-content" style="padding: 24px">
style="padding: 24px"> <el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table ref="table" <el-table-column type="index" width="60" label="序号" align="center">
:data="listData"
class="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="index"
width="60"
label="序号"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + (pageNo - 1) * pageSize + 1 }} {{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" <el-table-column prop="name" label="标题">
label="标题">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input placeholder="请输入标题" <el-input placeholder="请输入标题" :disabled="!scope.row.operate" v-model="scope.row.title"></el-input>
:disabled="!scope.row.operate"
v-model="scope.row.title"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" <el-table-column prop="name" label="详情描述">
label="详情描述">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input placeholder="请输入详情描述" <el-input placeholder="请输入详情描述" :disabled="!scope.row.operate" type="textarea" v-model="scope.row.description"></el-input>
:disabled="!scope.row.operate"
type="textarea"
v-model="scope.row.description"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" <el-table-column prop="name" label="状态" width="150">
label="状态"
width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.status" <el-select v-model="scope.row.status" :disabled="!scope.row.operate" clearable placeholder="请选择状态">
:disabled="!scope.row.operate" <el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option>
clearable
placeholder="请选择状态">
<el-option v-for="(item,index) in statusList"
:key="index"
:label="item.name"
:value="item.value"></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作" align="center" width="170">
align="center"
width="170">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="!scope.row.operate" <el-button v-if="!scope.row.operate" type="text" @click="operateIt(scope.row)" v-auth="'/match:管理:竞赛进展:编辑'">编辑</el-button>
type="text" <el-button v-else type="text" @click="saveData(scope.row)">保存</el-button>
@click="operateIt(scope.row)" <el-button type="text" @click="handleDelete(scope.row, scope.$index)" v-auth="'/match:管理:竞赛进展:删除'">删除</el-button>
v-auth="'/match:管理:竞赛进展:编辑'">编辑</el-button>
<el-button v-else
type="text"
@click="saveData(scope.row)">保存</el-button>
<el-button type="text"
@click="handleDelete(scope.row, scope.$index)"
v-auth="'/match:管理:竞赛进展:删除'">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="plus" <div class="plus" @click="addData" v-auth="'/match:管理:竞赛进展:新增'">
@click="addData"
v-auth="'/match:管理:竞赛进展:新增'">
<i class="el-icon-circle-plus-outline"></i> <i class="el-icon-circle-plus-outline"></i>
</div> </div>
</div> </div>
@ -210,8 +174,7 @@ export default {
this.$confirm('暂未保存,是否保存本次编辑?', '提示', { this.$confirm('暂未保存,是否保存本次编辑?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning'
closeOnClickModal: false
}).then(() => { }).then(() => {
let num = 0; let num = 0;
for(var i=0;i<this.listData.length;i++){ for(var i=0;i<this.listData.length;i++){

@ -1,105 +1,121 @@
<template> <template>
<div> <div>
<el-card shadow="hover" class="m-b-20 head-card"> <el-card shadow="hover"
<div class="flex-between"> class="m-b-20 head-card">
<el-page-header v-if="grades.length" @back="back" :content="grades[index].stageName + '/排名'"></el-page-header> <div class="flex-between m-b-20">
<el-page-header v-if="grades.length"
@back="$router.back()"
:content="grades[index].stageName + '/排名'"></el-page-header>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" v-loading="loading" class="m-b-20"> <el-card shadow="hover"
class="m-b-20">
<div class="tabs"> <div class="tabs">
<template v-for="(item, i) in grades"> <template v-for="(item, i) in grades">
<a v-if="i === index || !item.stageId" :key="i" class="item" :class="{ active: item.stageId == active }" <a v-if="i === index || !item.stageId"
:key="i"
class="item"
:class="{active: item.stageId == active}"
@click="tabChange(item.stageId)">{{ item.stageName }}排名</a> @click="tabChange(item.stageId)">{{ item.stageName }}排名</a>
</template> </template>
</div> </div>
<div class="flex-between"
<div class="tool flex-between" style="margin-top: 20px"> style="margin: 20px 0">
<div style="display: inline-flex;align-items: center"> <div style="display: inline-flex;align-items: center">
<el-radio v-model="type" :label="0" @change="typeChange">默认系统排序</el-radio> <el-radio v-model="type"
<el-radio v-model="type" :label="1" @change="typeChange">手动上传</el-radio> :label="0"
<el-button type="primary" :disabled="type === 0" class="ml20" @click="batchImport">上传文件</el-button> @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>
<ul class="filter" style="flex: none;"> <div>
<li> <el-button v-if="!published"
<label>省份</label> type="primary"
<el-select v-model="filter.provinceId" clearable filterable placeholder="请选择省份" @change="provinceChange" @click="cancelPublish(1)">发布排名</el-button>
@clear="clearProvince"> <div v-else>
<el-option v-for="(item, i) in provinces" :key="i" :label="item.provinceName" <span style="margin-right: 10px">{{ publishTime }}发布排名</span>
:value="item.provinceId"></el-option> <el-button type="primary"
</el-select> @click="cancelPublish(0)">取消发布</el-button>
</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>
</template>
<el-button v-if="list.length" type="primary" :loading="exporting" @click="exportData">{{ exporting ? '正在导出' :
'批量导出'
}}</el-button>
</ul>
</div> </div>
</div>
<el-table :data="list" class="table" ref="table" stripe row-key="scoreId" </div>
@selection-change="handleSelectionChange" header-align="center"> <el-table :data="list"
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> class="table"
<el-table-column type="index" width="60" label="排名" align="center"> ref="table"
stripe
header-align="center">
<el-table-column type="index"
width="60"
label="排名"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<template v-if="competitionType == 1"> <template v-if="competitionType == 1">
<el-table-column prop="teamName" label="团队名称" min-width="150" align="center"></el-table-column> <el-table-column prop="teamName"
<el-table-column prop="leaderName" label="队长" min-width="150" align="center"></el-table-column> label="团队名称"
min-width="150"
align="center"></el-table-column>
<el-table-column prop="leaderName"
label="队长"
min-width="150"
align="center"></el-table-column>
</template> </template>
<el-table-column v-else prop="userName" label="学生姓名" min-width="100" align="center"></el-table-column> <el-table-column v-else
<el-table-column prop="provinceName" label="省份" min-width="100" align="center"></el-table-column> prop="userName"
<el-table-column prop="cityName" label="城市" min-width="100" align="center"></el-table-column> label="学生姓名"
<el-table-column prop="schoolName" label="学生账号归属" min-width="100" align="center"></el-table-column> min-width="100"
<el-table-column prop="realSchool" label="学生所在院校" min-width="100" align="center"></el-table-column> align="center"></el-table-column>
<el-table-column prop="timeSum" label="用时" width="90" align="center"> <el-table-column prop="schoolName"
label="学校"
min-width="100"
align="center"></el-table-column>
<el-table-column prop="timeSum"
label="用时"
width="90"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.timeSum + (scope.row.timeSum === '—' ? '' : 'min') }} {{ scope.row.timeSum + (scope.row.timeSum === '—' ? '' : 'min') }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="score" label="分数" width="90" align="center"></el-table-column> <el-table-column prop="score"
<el-table-column label="得分详情" align="center" width="160"> label="分数"
width="90"
align="center"></el-table-column>
<el-table-column label="得分详情"
align="center"
width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="(!competitionType && scope.row.reportId) || competitionType" type="text" <el-button v-if="(!competitionType && scope.row.reportId) || competitionType"
type="text"
@click="show(scope.row, scope.$index)">查看</el-button> @click="show(scope.row, scope.$index)">查看</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" <el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page"> :current-page="page">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
<el-dialog title="团队得分详情" :visible.sync="teamVisible" width="900px" :close-on-click-modal="false"> <el-dialog title="团队得分详情"
<h6 v-if="active" style="margin-bottom: 10px;font-size: 16px;">团队名称{{ curRow.teamName }} 阶段名称{{ stageName }} :visible.sync="teamVisible"
</h6> 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"> <table class="table tc">
<tr> <tr>
<template v-if="!active"> <template v-if="!active">
@ -114,29 +130,32 @@
<th width="100">得分详情</th> <th width="100">得分详情</th>
</tr> </tr>
<template v-if="teams.length"> <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"> <template v-if="!active && item.rowspan">
<td :rowspan="item.rowspan">{{ item.stageName }}</td> <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 class="score">{{ item.teamScore }}</p>
<p>{{ item.teamCalculationMethodName }}</p> <p>{{ item.teamCalculationMethodName }}</p>
<template v-if="isPointWeight">
<p>权重</p> <p>权重</p>
<p>{{ item.pointWeight }}%</p> <p>{{ item.pointWeight }}%</p>
</template>
</td> </td>
</template> </template>
<template v-if="item.accountId"> <template v-if="item.accountId">
<td>{{ i + 1 }}</td> <td>{{ i + 1 }}</td>
<td>{{ item.userName }}</td> <td>{{ item.userName }}</td>
<td>{{ item.realSchool }}</td> <td>{{ item.schoolName }}</td>
<td>{{ item.timeSum }}min</td> <td>{{ item.timeSum }}min</td>
<td>{{ item.score }}</td> <td>{{ item.score }}</td>
<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> </td>
</template> </template>
<td v-else colspan="6"></td> <td v-else
colspan="6"></td>
</tr> </tr>
</template> </template>
<tr v-else> <tr v-else>
@ -148,78 +167,96 @@
<td colspan="6">总排名{{ curRow.index }}</td> <td colspan="6">总排名{{ curRow.index }}</td>
</tr> </tr>
</table> </table>
<span slot="footer" class="dialog-footer"> <span slot="footer"
<el-button size="small" type="primary" @click="teamVisible = false">确定</el-button> class="dialog-footer">
<el-button size="small"
type="primary"
@click="teamVisible = false">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false" <el-dialog title="批量导入"
@close="cancelUpload"> :visible.sync="importVisible"
width="24%"
:close-on-click-modal="false">
<div style="text-align: center"> <div style="text-align: center">
<template v-if="!uploadFaild">
<div style="margin-bottom: 10px;"> <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> </div>
<el-upload ref="upload" name="file" accept=".xls,.xlsx" class="import-file" :before-upload="beforeUpload" <el-upload ref="upload"
:on-remove="handleRemove" :on-error="uploadError" :on-success="uploadSuccess" :before-remove="beforeRemove" name="file"
:limit="1" :on-exceed="handleExceed" :action="this.api.batchImportRanking" :file-list="uploadList" accept=".xls,.xlsx"
:headers="headers" :disabled="uploading" :data="{ :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"
:data="{
competitionId: this.id, competitionId: this.id,
stageId: this.stageId, stageId: this.stageId,
isOverallRanking: active ? 0 : 1, isOverallRanking: active ? 0 : 1,
schoolId: '' schoolId: ''
}"> }"
<el-button type="primary" :loading="uploading" class="ml20">上传文件<i :auto-upload="false">
class="el-icon-upload2 el-icon--right"></i></el-button> <el-button type="primary"
class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload> </el-upload>
</template> <el-link v-if="uploadFaild"
<template v-else> type="primary"
<p style="margin: -10px 0 13px;font-size: 14px;color: #e90000;">{{ faildData.tip }}</p> @click="showFaild">部分数据导入失败查看失败原因</el-link>
<p type="primary"
style="margin-bottom: 10px;font-size: 14px;color: #9076FF;text-decoration: underline;cursor: pointer;"
@click="showFaild">部分数据导入失败查看失败原因</p>
</template>
</div> </div>
<span v-if="uploading" slot="footer" class="dialog-footer"> <span slot="footer"
<el-button @click="cancelUpload">停止导入</el-button> class="dialog-footer">
<el-button size="small"
@click="importVisible = false"> </el-button>
<el-button size="small"
type="primary"
@click="uploadSure"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="请选择发布排名时间" :visible.sync="publishVisible" width="260px" :close-on-click-modal="false" <el-dialog title="请选择发布排名时间"
:visible.sync="publishVisible"
width="260px"
:close-on-click-modal="false"
custom-class="publish-dia"> custom-class="publish-dia">
<el-date-picker popper-class="no-atTheMoment" v-model="publishTime" placeholder="请选择结束时间" type="datetime" <el-date-picker popper-class="no-atTheMoment"
v-model="publishTime"
placeholder="请选择结束时间"
type="datetime"
:picker-options="pickerOptions"> :picker-options="pickerOptions">
</el-date-picker> </el-date-picker>
<span slot="footer" class="dialog-footer"> <span slot="footer"
<el-button size="small" @click="publishVisible = false"> </el-button> class="dialog-footer">
<el-button size="small" type="primary" @click="publishTimeSubmit"> </el-button> <el-button size="small"
@click="publishVisible = false"> </el-button>
<el-button size="small"
type="primary"
@click="publishTimeSubmit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import Util from '@/libs/util' import Setting from '@/setting'
import axios from 'axios' import util from "@/libs/util";
import echarts from "echarts";
import axios from 'axios';
export default { export default {
data () { data () {
return { return {
id: +this.$route.query.id, id: +this.$route.query.id,
stageId: +this.$route.query.stageId, stageId: +this.$route.query.stageId,
index: +this.$route.query.index, index: +this.$route.query.index,
method: +this.$route.query.method, method: this.$route.query.method,
competitionType: +this.$route.query.competitionType, competitionType: +this.$route.query.competitionType,
rule: +this.$route.query.rule, rule: +this.$route.query.rule,
searchTimer: null,
filter: {
provinceId: '',
cityId: '',
realSchoolId: '',
},
provinces: [],
cities: [],
schools: [],
keyword: this.$route.query.keyword || '',
teamCalculationMethods: [ teamCalculationMethods: [
{ {
id: 0, id: 0,
@ -240,7 +277,7 @@ export default {
active: '', active: '',
grades: [], grades: [],
list: [], list: [],
page: +this.$route.query.page || 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
type: 0, type: 0,
@ -251,8 +288,7 @@ export default {
importVisible: false, importVisible: false,
uploadList: [], uploadList: [],
uploadFaild: false, uploadFaild: false,
uploading: false, exportCode: '',
faildData: null,
curRow: {}, curRow: {},
stageName: '', stageName: '',
totalScore: 0, totalScore: 0,
@ -276,31 +312,10 @@ export default {
return [`${hour}:${minute}:${second} - 23:59:59`] return [`${hour}:${minute}:${second} - 23:59:59`]
})(), })(),
}, },
uploaded: 0, uploaded: 0
multipleSelection: [],
loading: false,
exporting: false,
isPointWeight: false
}; };
}, },
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.$router.push({
path: '/matchRank',
query: {
...this.$route.query,
keyword: val
}
})
this.getRank();
}, 500);
}
},
mounted () { mounted () {
this.getProvince()
this.getSchool()
this.getStage() this.getStage()
}, },
methods: { methods: {
@ -314,8 +329,6 @@ export default {
}, },
// //
getRank () { getRank () {
const { filter } = this
this.loading = true
// //
if (this.type) { if (this.type) {
this.$post(this.api.manuallyUploadedRankings, { this.$post(this.api.manuallyUploadedRankings, {
@ -323,9 +336,7 @@ export default {
pageSize: this.pageSize, pageSize: this.pageSize,
competitionId: this.id, competitionId: this.id,
isOverallRanking: this.active ? 0 : 1, isOverallRanking: this.active ? 0 : 1,
stageId: this.active || this.stageId, stageId: this.active || this.stageId
keyword: this.keyword,
...filter
}).then(({ message, publishStatus }) => { }).then(({ message, publishStatus }) => {
// isRelease 01 // isRelease 01
this.published = publishStatus this.published = publishStatus
@ -333,10 +344,7 @@ export default {
this.list = message.records this.list = message.records
this.total = message.total this.total = message.total
this.getPublishTime() this.getPublishTime()
this.loading = false }).catch(res => { })
}).catch(res => {
this.loading = false
})
} else { // } else { //
if (!this.active) { if (!this.active) {
// //
@ -347,41 +355,30 @@ export default {
competitionId: this.id, competitionId: this.id,
publicationType: this.type, publicationType: this.type,
locationStageId: this.stageId, locationStageId: this.stageId,
stageIds: ids.splice(0, ids.length - 1), stageIds: ids.splice(0, ids.length - 1)
keyword: this.keyword,
...filter
}).then(({ page, publishStatus, total }) => { }).then(({ page, publishStatus, total }) => {
this.published = publishStatus this.published = publishStatus
this.list = page || [] this.list = page
this.total = total this.total = total
this.getPublishTime() this.getPublishTime()
this.loading = false }).catch(res => { })
}).catch(res => { } else { //
this.loading = false this.$post(`${this.api.stageRaceRanking}?competitionId=${this.id}&stageId=${this.active}&pageNum=${this.page}&pageSize=${this.pageSize}&publicationType=${this.type}`).then(({ page, total, publishStatus }) => {
})
} else {
//
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.published = publishStatus
this.list = page this.list = page
this.total = total this.total = total
this.getPublishTime() this.getPublishTime()
this.loading = false }).catch(res => { })
}).catch(res => {
this.loading = false
})
} }
} }
}, },
// //
async getStage () { getStage () {
this.loading = true this.$post(this.api.detailsOfCompetitionStage, {
try {
const { page } = await this.$post(this.api.detailsOfCompetitionStage, {
pageNum: 1, pageNum: 1,
pageSize: 100, pageSize: 100,
contestId: this.id, contestId: this.id,
}) }).then(({ page }) => {
this.grades = page.records.slice(0, this.index + 1) this.grades = page.records.slice(0, this.index + 1)
this.active = this.grades[this.index].stageId this.active = this.grades[this.index].stageId
// //
@ -390,13 +387,11 @@ export default {
stageName: '总分' stageName: '总分'
}) })
this.getData() this.getData()
} catch (e) { }).catch(res => { });
this.loading = false
}
}, },
// //
async typeChange (val) { typeChange (val) {
await this.$post(`${this.api.toggleTheSortingMode}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`) this.$post(`${this.api.toggleTheSortingMode}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => { }).catch(res => { })
this.getRank() this.getRank()
}, },
initData () { initData () {
@ -409,39 +404,6 @@ export default {
this.active = i this.active = i
this.initData() 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) { show (row, i) {
this.teams = [] this.teams = []
@ -469,12 +431,11 @@ export default {
data.stageIds = ids.splice(0, this.index + 1) data.stageIds = ids.splice(0, this.index + 1)
// //
// if (this.published) { // if (this.published) {
this.$post(this.api.totalRankingScoreDetails, data).then(res => { this.$post(this.api.totalRankingScoreDetails, data).then(({ data }) => {
this.isPointWeight = res.isPointWeight if (data.length) {
if (res.data.length) {
const result = [] const result = []
// //
res.data.map(e => { data.map(e => {
const team = e.stageTeamInformation const team = e.stageTeamInformation
if (team.length) { if (team.length) {
const teamCItem = this.teamCalculationMethods.find(n => n.id == e.teamCalculationMethod) const teamCItem = this.teamCalculationMethods.find(n => n.id == e.teamCalculationMethod)
@ -524,90 +485,58 @@ export default {
}, },
// //
toReport (row) { toReport (row) {
this.$router.push(`/${this.method !== 1 ? 'trialReport' : 'theoryReport'}?reportId=${row.reportId}`) this.$router.push(`/matchReport?reportId=${row.reportId}`)
},
handleSelectionChange (val) { //
this.multipleSelection = val;
}, },
handleCurrentChange (val) { // handleCurrentChange (val) { //
this.$router.push({
path: '/matchRank',
query: {
...this.$route.query,
page: val
}
})
this.page = val; this.page = val;
this.getData(); this.getData();
}, },
// () //
async exportData () { publishSubmit () {
this.exporting = true if (this.type) { //
let { list } = this this.$post(this.api.batchRelease, this.list.map(e => e.id)).then(res => {
if (this.multipleSelection.length) { // this.getData()
list = this.multipleSelection // util.successMsg('')
}).catch(res => { })
} else { } else {
// pageSize10000 let data = [] // data
if (!this.type) { //
// //
if (this.type) { const { list, id } = this
const res = await this.$post(this.api.manuallyUploadedRankings, { const isOverall = this.active ? 0 : 1
pageNum: 1, if (list.length) {
pageSize: 10000, const isPerson = this.competitionType == 0
competitionId: this.id, list.map(e => {
isOverallRanking: this.active ? 0 : 1, e.competitionId = id
stageId: this.active || this.stageId e.isOverallRanking = isOverall
e.stageId = this.stageId
// if (isOverall) delete e.stageId
if (isPerson) e.teamId = null // teamIdnull
}) })
list = res.message.records data = list
} else { //
if (!this.active) {
//
const ids = this.grades.map(e => e.stageId)
const res = await this.$post(this.api.overallStandingsInThePointsRace, {
pageNum: 1,
pageSize: 10000,
competitionId: this.id,
publicationType: this.type,
locationStageId: this.stageId,
stageIds: ids.splice(0, ids.length - 1)
})
list = res.page
} else { //
const res = await this.$post(`${this.api.stageRaceRanking}?competitionId=${this.id}&stageId=${this.active}&pageNum=1&pageSize=10000&publicationType=${this.type}`)
list = res.page
}
} }
} }
list.forEach((e, i) => { data.forEach(e => {
e.serialNumber = i + 1 e.publicationType = this.type
if (e.leaderName) e.userName = e.leaderName
})
axios.post(this.api[this.competitionType ? 'derivedRanking' : 'individualDerivedRanking'], list, {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
Util.downloadFileDirect(`${this.grades.find(e => e.stageId == this.active).stageName}排名.xls`, new Blob([res.data]))
this.exporting = false
}).catch(res => { })
},
//
async publishSubmit () {
await this.$post(this.api.publishRanking, {
competitionId: this.id,
isOverallRanking: this.active ? 0 : 1,
publicationType: this.type,
releaseTime: Util.formatDate("yyyy-MM-dd hh:mm:ss", this.publishTime),
stageId: this.active || this.stageId,
}) })
const ids = this.grades.map(e => e.stageId)
ids.pop()
//
// this.$post(`${this.api.releaseVerification}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&whetherToManuallyPublish=${this.type}`).then(res => {
this.$post(this.api.publishRanking, data).then(res => {
this.uploadData = [] this.uploadData = []
// this.getData()
// util.successMsg('')
}).catch(res => { })
// }).catch(res => {})
}
}, },
// //
publish () { publish () {
this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&publicationType=${this.type}`).then(({ whetherToPublish }) => { this.$post(`${this.api.whetherToPublish}?competitionId=${this.id}&stageId=${this.active || this.stageId}&isOverallRanking=${this.active ? 0 : 1}&publicationType=${this.type}`).then(({ whetherToPublish }) => {
whetherToPublish ? whetherToPublish ?
this.$confirm('排名已经发布,是否直接覆盖?', '提示', { this.$confirm('排名已经发布,是否直接覆盖?', '提示', {
type: 'success', type: 'success'
closeOnClickModal: false
}).then(() => { }).then(() => {
this.publishSubmit() this.publishSubmit()
}).catch(() => { }) : }).catch(() => { }) :
@ -635,19 +564,18 @@ export default {
// //
async publishTimeSubmit () { async publishTimeSubmit () {
const { startTime, endTime } = this.grades[this.index] const { startTime, endTime } = this.grades[this.index]
const now = await Util.getNow() if (Date.now() <= new Date(endTime)) return util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!')
if (now <= new Date(endTime)) return Util.errorMsg('当前阶段还在进行中,请在本阶段结束后再发布!')
this.publishSubmit() this.publishSubmit()
// await this.$post(this.api.addCompetitionStageRankingTime, { await this.$post(this.api.addCompetitionStageRankingTime, {
// competitionId: this.id, competitionId: this.id,
// isOverallRanking: this.active ? 0 : 1, isOverallRanking: this.active ? 0 : 1,
// publicationType: this.type, publicationType: this.type,
// stageId: this.active || this.stageId, 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.getData()
this.uploaded = 0 this.uploaded = 0
this.publishVisible = false this.publishVisible = false
@ -665,7 +593,7 @@ export default {
if (publish) { if (publish) {
// //
if (this.type && !this.uploaded && !this.list.length) { if (this.type && !this.uploaded && !this.list.length) {
return Util.errorMsg('请先上传数据!') return util.errorMsg('请先上传数据!')
} else { } else {
this.publishTime = new Date() this.publishTime = new Date()
this.publishVisible = true this.publishVisible = true
@ -676,12 +604,12 @@ export default {
// if (this.timeId) { // if (this.timeId) {
// await this.$post(`${this.api.cancelCompetitionStageRankingTime}?competitionId=${this.id}&releaseId=${this.timeId}&isOverallRanking=${this.active ? 0 : 1}&stageId=${this.active || this.stageId}`) // await this.$post(`${this.api.cancelCompetitionStageRankingTime}?competitionId=${this.id}&releaseId=${this.timeId}&isOverallRanking=${this.active ? 0 : 1}&stageId=${this.active || this.stageId}`)
// } else { // } else {
await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}&releaseId=${this.timeId}&publicationType=${this.type}`) await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}&releaseId=${this.timeId}`)
// } // }
this.sourceType = '' this.sourceType = ''
this.type = 0 this.type = 0
this.getData() this.getData()
Util.successMsg('取消发布成功!') util.successMsg('取消发布成功!')
} catch (error) { } } catch (error) { }
} }
}, },
@ -697,53 +625,45 @@ export default {
}, },
// //
handleExceed (files, fileList) { handleExceed (files, fileList) {
Util.warningMsg( util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
) )
}, },
// //
showFaild () { showFaild () {
axios.get(`${this.api.rankExportFailure}?exportCode=${this.faildData.exportCode}&competitionId=${this.id}`, { axios.get(`${this.api.rankExportFailure}?exportCode=${this.exportCode}&competitionId=${this.id}`, {
headers: this.headers, headers: this.headers,
responseType: 'blob' responseType: 'blob'
}).then((res) => { }).then((res) => {
Util.downloadFileDirect(`批量导入排名管理失败数据导出.xls`, new Blob([res.data])) util.downloadFileDirect(`批量导入排名管理失败数据导出.xls`, new Blob([res.data]))
}).catch(res => { }) }).catch(res => { })
}, },
uploadSuccess (res) { uploadSuccess (res, file, fileList) {
this.uploading = false
this.uploadFaild = false this.uploadFaild = false
this.uploaded = 0 this.uploaded = 0
if (res.status === 200) { if (res.status === 200) {
this.getRank() const { exportCode } = res.data
const { data } = res if (exportCode) {
if (data.exportCode) { this.exportCode = exportCode
this.faildData = data
this.uploadFaild = true this.uploadFaild = true
util.errorMsg(`本次上传有${res.data.failureNum}个错误信息录入`)
} else { } else {
this.uploaded = 1 this.uploaded = 1
this.importVisible = false this.importVisible = false
Util.successMsg(data.tip, 3000) this.getRank()
// Util.successMsg('') util.successMsg('请检查数据后,点击发布排名以发布数据!')
} }
} else { } else {
Util.errorMsg(res.message || "上传失败,请检查数据") util.errorMsg(res.message || "上传失败,请检查数据")
} }
}, },
uploadError (err, file, fileList) { uploadError (err, file, fileList) {
this.uploading = false
this.$message({ this.$message({
message: "上传出错,请重试!", message: "上传出错,请重试!",
type: "error", type: "error",
center: true center: true
}) })
}, },
async beforeUpload (file) {
this.uploading = true
if (this.list.length) {
await this.$post(`${this.api.cancelRanking}?competitionId=${this.id}&isOverallRanking=${this.active ? 0 : 1}&${this.active ? 'stageIds=' + this.active : query.join('&')}&releaseId=${this.timeId}&publicationType=${this.type}`)
}
},
beforeRemove (file, fileList) { beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`) return this.$confirm(`确定移除 ${file.name}`)
}, },
@ -751,15 +671,12 @@ export default {
this.uploadList = fileList this.uploadList = fileList
this.uploadFaild = false this.uploadFaild = false
}, },
cancelUpload () { uploadSure () {
this.uploading = false this.list.length ?
if (this.$refs.upload) this.$refs.upload.abort() this.$post(this.api.cancelImport, this.list.map(e => e.id)).then(res => {
this.keyword = '' this.$refs.upload.submit()
this.getRank() }).catch(res => { }) :
this.importVisible = false this.$refs.upload.submit()
},
back () {
this.$router.push(this.$store.state.innerReferrer)
} }
} }
}; };
@ -769,38 +686,25 @@ export default {
.table { .table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
th, th,
td { td {
padding: 12px; padding: 12px;
border: 1px solid #ebeef5; border: 1px solid #ebeef5;
} }
&.tc { &.tc {
text-align: center; text-align: center;
} }
th { th {
text-align: center; text-align: center;
background-color: #f8faff; background-color: #f8faff;
} }
.scores { .scores {
line-height: 1.6; line-height: 1.6;
} }
.score { .score {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
color: #9076ff; color: #9076ff;
} }
} }
/deep/.import-file {
.el-progress__text,
.el-progress,
.el-upload-list__item-status-label {
display: none !important;
}
}
</style> </style>

@ -0,0 +1,375 @@
<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="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,
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>

@ -5,9 +5,7 @@
<ul class="filter"> <ul class="filter">
<li> <li>
<label>搜索</label> <label>搜索</label>
<el-input <el-input placeholder="请输入姓名/手机号/学号" prefix-icon="el-icon-search" v-model="keyword" clearable size="mini" style="width: 250px"></el-input>
:placeholder="'请输入姓名、手机号、' + (info.completeCompetitionSetup.competitionType ? '团队名称、' : '') + '学号、学校'"
prefix-icon="el-icon-search" v-model="keyword" clearable size="mini" style="width: 350px"></el-input>
</li> </li>
<li v-if="info.releaseType"> <li v-if="info.releaseType">
<label>参赛人员状态</label> <label>参赛人员状态</label>
@ -17,105 +15,58 @@
</li> </li>
</ul> </ul>
<div> <div>
<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 @click="add" v-auth="'/match:管理:报名人员:新增'">新增</el-button>
<el-button type="primary" round :loading="exporting" @click="exportAll" <el-button type="primary" round @click="exportAll" v-auth="'/match:管理:报名人员:导出'">批量导出</el-button>
v-auth="'/match:管理:报名人员:导出'">批量导出</el-button>
<el-button type="primary" @click="batchDel" round v-auth="'/match:管理:报名人员:导出'">批量删除</el-button>
</div> </div>
</div> </div>
<el-table ref="table" :data="listData" class="table" stripe header-align="center" <el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange">
@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="selection" width="80" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="school" label="学生账号归属" sortable="custom" min-width="180" align="center"></el-table-column> <el-table-column prop="school" label="学校" sortable="custom">
<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>
<el-table-column prop="username" :label="info.completeCompetitionSetup.competitionType ? '队长/成员' : '学生姓名'" <el-table-column v-if="info.completeCompetitionSetup.competitionType" prop="teamName" label="团队名称" sortable="custom">
min-width="140" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="workNumber" :label="info.completeCompetitionSetup.competitionType ? '队长/成员学号' : '学号'" <el-table-column prop="username" label="学生姓名">
min-width="140" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="phone" :label="info.completeCompetitionSetup.competitionType ? '队长/成员手机号' : '手机号'" <el-table-column prop="workNumber" label="学号">
min-width="140" align="center">
</el-table-column> </el-table-column>
<el-table-column v-if="info.completeCompetitionSetup.competitionType" prop="captain" label="是否为队长" min-width="80" <el-table-column prop="phone" label="手机号">
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>
<el-table-column label="操作" align="center" width="270"> <el-table-column label="操作" align="center" width="320">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="!scope.row.isDel">
<el-button v-auth="'/match:管理:报名人员:编辑'" type="text" @click="edit(scope.row)">编辑</el-button> <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"> <template v-if="info.releaseType">
<el-button v-auth="'/match:管理:报名人员:参赛信息与成绩'" type="text" @click="toInfo(scope.row)">参赛信息与成绩</el-button> <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" <el-switch
:active-text="scope.row.isDisable ? '禁用' : '启用'" :active-value="0" :inactive-value="1" v-auth="'/match:管理:报名人员:禁用'"
style="margin: 0 10px 0 5px" @change="switchOff($event, scope.row, scope.$index)"></el-switch> 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>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" <el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
:current-page="page">
</el-pagination> </el-pagination>
</div> </div>
<el-dialog :title="(!isAdd ? '编辑' : '新增') + '参赛人员'" :visible.sync="addVisible" width="440px" class="dialog"
:close-on-click-modal="false" @close="closeAdd"> <el-dialog :title="(!isAdd ? '编辑' : '新增') + '参赛人员'" :visible.sync="addVisible" width="400px" 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 ref="form" :model="form" :rules="rules" label-width="80px" style='margin-right: 10px;'>
<el-form-item v-if="!schoolDisable" prop="schoolId" label="学生账号归属"> <el-form-item v-if="!schoolDisable" prop="schoolId" label="院校">
<el-select v-model="form.schoolId" filterable :disabled="!isAdd" @change="schoolChange" style="width: 100%"> <el-select v-model="form.schoolId" filterable style="width: 100%">
<el-option v-for="(item, i) in clients" :key="i" :label="item.schoolName" <el-option v-for="(item, i) in clients" :key="i" :label="item.schoolName" :value="item.schoolId"></el-option>
: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> </el-select>
<p style="margin-top: 10px;line-height: 1.4;font-size: 12px;">学生所在院校为学生实际院校</p>
</el-form-item> </el-form-item>
<el-form-item prop="workNumber" label="学生学号"> <el-form-item prop="workNumber" label="学生学号">
<el-input v-model="form.workNumber" placeholder="请输入学生学号" @change="workNumberChange"></el-input> <el-input v-model="form.workNumber" placeholder="请输入学生学号" @change="workNumberChange"></el-input>
@ -128,8 +79,7 @@
</el-form-item> </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"> <div style="display: flex;align-items: center">
<el-select v-model="form.teamId" :disabled="formEnable && isAdd" filterable <el-select v-model="form.teamId" :disabled="formEnable && isAdd" filterable style="width: 240px;margin-right: 10px">
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-option v-for="(item, i) in teams" :key="i" :label="item.teamName" :value="item.teamId"></el-option>
</el-select> </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>
@ -142,7 +92,6 @@
<el-input v-model="form.email" placeholder="请输入邮箱" :disabled="isAdd"></el-input> <el-input v-model="form.email" placeholder="请输入邮箱" :disabled="isAdd"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<p v-if="!isAdd" class="tips" style="margin-left: 13px">当前页面信息修改会同步修改掉学生账号信息</p>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="addVisible = false">取消</el-button> <el-button @click="addVisible = false">取消</el-button>
<el-button type="primary" @click="submit">确定</el-button> <el-button type="primary" @click="submit">确定</el-button>
@ -163,43 +112,11 @@
<el-button size="small" @click="teamVisible = false">取消</el-button> <el-button size="small" @click="teamVisible = false">取消</el-button>
</span> </span>
</el-dialog> </el-dialog>
<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>
</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>
</template>
</div>
<span v-if="uploading" slot="footer" class="dialog-footer">
<el-button @click="cancelUpload">停止导入</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import Util from "@/libs/util"; import util from "@/libs/util";
import axios from 'axios' import axios from 'axios'
import Setting from "@/setting"; import Setting from "@/setting";
export default { export default {
@ -209,11 +126,9 @@ export default {
token: sessionStorage.getItem('token'), token: sessionStorage.getItem('token'),
id: +this.$route.query.id, id: +this.$route.query.id,
info: { info: {
completeCompetitionSetup: { completeCompetitionSetup: {}
competitionType: 1,
}
}, },
isDisable: this.$route.query.isDisable ? +this.$route.query.isDisable : '', isDisable: '',
statusList: [ statusList: [
{ {
id: '', id: '',
@ -228,16 +143,15 @@ export default {
name: '未禁用' name: '未禁用'
} }
], ],
keyword: this.$route.query.keyword || '', keyword: "",
listData: [], listData: [],
multipleSelection: [], multipleSelection: [],
page: +this.$route.query.page || 1, page: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
schoolOrder: '', schoolOrder: '',
teamOrder: '', teamOrder: '',
clients: [], clients: [],
schools: [],
addVisible: false, addVisible: false,
formEnable: true, formEnable: true,
isAdd: false, isAdd: false,
@ -247,7 +161,6 @@ export default {
userName: '', userName: '',
workNumber: '', workNumber: '',
schoolId: '', schoolId: '',
studentAffiliatedInstitutionId: '',
teamId: '', teamId: '',
whetherSignUp: 0, whetherSignUp: 0,
phone: '', phone: '',
@ -283,27 +196,7 @@ export default {
originForm: {}, originForm: {},
exitMember: 0, exitMember: 0,
notExit: 0, notExit: 0,
schoolDisable: false, schoolDisable: false
importVisible: false,
uploadList: [],
uploadFaild: false,
uploadTips: '',
exportCode: '',
headers: {
token: sessionStorage.getItem("token")
},
uploading: false,
isBackstage: 0,
exporting: false,
loading: false,
timer: null,
now: '',
notBeginSign: true,
allocated: true,
hasReport: false,
allocating: false,
loaded: 0,
}; };
}, },
watch: { watch: {
@ -315,23 +208,13 @@ export default {
} }
}, },
mounted() { mounted() {
this.$once('hook:beforeDestroy', function () { this.initData()
clearInterval(this.timer)
})
this.getData()
this.getInfo() this.getInfo()
this.getTeam() this.getTeam()
}, },
methods: { methods: {
init () { getData() {
this.initData() this.$post(this.api.queryRegistrationByCondition, {
this.getTeam()
this.getClient()
},
async getData () {
this.loading = true
const { data } = await this.$post(this.api.queryRegistrationByCondition, {
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
competitionId: this.id, competitionId: this.id,
@ -339,23 +222,17 @@ export default {
isDisable: this.isDisable, isDisable: this.isDisable,
schoolOrder: this.schoolOrder, schoolOrder: this.schoolOrder,
teamOrder: this.teamOrder, teamOrder: this.teamOrder,
}) }).then(({ data }) => {
const list = data.records; this.listData = data.records;
list.map(e => {
if (e.teacherDetails) {
e.teachers = JSON.parse(e.teacherDetails)
}
})
this.listData = list
this.total = data.total; this.total = data.total;
this.$refs.table.clearSelection(); this.$refs.table.clearSelection();
this.loading = false }).catch(res => {
});
}, },
// //
async getInfo () { getInfo() {
const { competition } = await this.$post(`${this.api.getCompetition}?competitionId=${this.id}`) this.$post(`${this.api.getCompetition}?competitionId=${this.id}`).then(({ competition }) => {
this.info = competition this.info = competition
this.getSchool()
// //
if (competition.competitionScope) { if (competition.competitionScope) {
this.getClient() this.getClient()
@ -363,61 +240,7 @@ export default {
this.schoolDisable = true this.schoolDisable = true
this.form.schoolId = competition.schoolId this.form.schoolId = competition.schoolId
} }
}).catch(err => {})
//
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() { initData() {
this.page = 1 this.page = 1
@ -440,82 +263,6 @@ export default {
if (column.prop === 'teamName') this.teamOrder = column.order ? column.order === 'ascending' ? 2 : 1 : '' if (column.prop === 'teamName') this.teamOrder = column.order ? column.order === 'ascending' ? 2 : 1 : ''
this.getData() this.getData()
}, },
//
batchImport () {
this.importVisible = true
this.uploadList = []
this.uploadFaild = false
},
//
download () {
location.href = this.api[this.info.completeCompetitionSetup.competitionType ? 'competionTeamTemplate' : 'competionPersonTemplate']
},
//
handleExceed (files, fileList) {
Util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
)
},
//
showFaild () {
axios.get(`${this.api.TeamDataExportFailure}?exportCode=${this.exportCode}&platformId=2&type=${this.info.completeCompetitionSetup.competitionType ? 1 : 2}`, {
headers: this.headers,
responseType: 'blob'
}).then((res) => {
const name = res.headers['content-disposition']
Util.downloadFileDirect(name ? decodeURI(name) : '批量导入报名人员失败数据导出.xlsx', new Blob([res.data]))
}).catch(res => { })
},
uploadSuccess ({ data, status }) {
this.uploading = false
this.uploadFaild = false
this.uploadTips = ''
if (status === 200) {
this.init()
const { tip } = data
if (data.exportCode) {
this.exportCode = data.exportCode
this.uploadFaild = true
this.uploadTips = tip
} else {
Util[tip.includes('5000') ? 'errorMsg' : 'successMsg'](tip, 3000)
this.importVisible = false
}
} else {
Util.errorMsg(res.message || '上传失败,请检查数据', 3000)
}
},
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
this.$refs.upload.abort()
this.keyword = ''
this.init()
this.importVisible = false
},
//
backstageUpload () {
this.isBackstage = 1
this.importVisible = false
},
// //
add() { add() {
this.notExit = 0 this.notExit = 0
@ -533,30 +280,13 @@ export default {
this.originForm = JSON.parse(JSON.stringify(row)) this.originForm = JSON.parse(JSON.stringify(row))
this.form = 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() { workNumberChange() {
const { form } = this const { form } = this
if (this.originForm.workNumber !== form.workNumber) { 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 }) => { 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 this.exitMember = 0
if (account) { if (account) {
const { studentAffiliatedInstitutionId } = form
account.studentAffiliatedInstitutionId = studentAffiliatedInstitutionId
this.form = account this.form = account
} }
this.formEnable = !account this.formEnable = !account
@ -570,26 +300,30 @@ export default {
}, },
// //
submitForm() { submitForm() {
if (this.notExit) {
this.submiting = false
return util.errorMsg('学生不存在,无法添加!')
}
if (this.exitMember) {
this.submiting = false
return util.errorMsg('学生已存在')
}
const { form } = this const { form } = this
if (!this.isAdd) { // if (!this.isAdd) { //
this.$post(this.api.updateUser, { this.$post(this.api.updateUser, {
hrUserAccount: { hrUserAccount: {
...form, ...form,
id: form.id, id: form.id,
lastTimeInstitutionId: this.originForm.studentAffiliatedInstitutionId
}, },
hrUserInfo: { hrUserInfo: {
userId: form.userId, userId: form.userId,
schoolId: form.schoolId, schoolId: form.schoolId,
email: form.email, email: form.email
userName: form.userName
} }
}).then(res => { }).then(res => {
// //
if (this.originForm.teamId !== form.teamId) { if (this.originForm.teamId !== form.teamId) {
this.$post(this.api.joinCompetitionTeam, { this.$post(this.api.joinCompetitionTeam, {
schoolId: form.schoolId,
studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId,
accountId: form.id, accountId: form.id,
competitionId: this.id, competitionId: this.id,
teamId: form.teamId, teamId: form.teamId,
@ -597,17 +331,17 @@ export default {
whetherSignUp: 1 whetherSignUp: 1
}).then(res => { }).then(res => {
this.addVisible = false this.addVisible = false
this.init() this.getData()
this.submiting = false this.submiting = false
Util.successMsg('编辑成功!') util.successMsg('编辑成功!')
}).catch(res => { }).catch(res => {
this.submiting = false this.submiting = false
}) })
} else { } else {
this.addVisible = false this.addVisible = false
this.init() this.getData()
this.submiting = false this.submiting = false
Util.successMsg('编辑成功!') util.successMsg('编辑成功!')
} }
}).catch(res => { }).catch(res => {
this.submiting = false this.submiting = false
@ -615,8 +349,6 @@ export default {
} else { } else {
// //
this.$post(this.api[this.info.completeCompetitionSetup.competitionType ? 'joinCompetitionTeam' : 'addCompetitionRegistration'], { this.$post(this.api[this.info.completeCompetitionSetup.competitionType ? 'joinCompetitionTeam' : 'addCompetitionRegistration'], {
schoolId: form.schoolId,
studentAffiliatedInstitutionId: form.studentAffiliatedInstitutionId,
accountId: form.id, accountId: form.id,
competitionId: this.id, competitionId: this.id,
teamId: this.form.teamId, teamId: this.form.teamId,
@ -624,9 +356,9 @@ export default {
whetherSignUp: 1 whetherSignUp: 1
}).then(res => { }).then(res => {
this.addVisible = false this.addVisible = false
this.init() this.getData()
this.submiting = false this.submiting = false
Util.successMsg('报名成功!') util.successMsg('报名成功!')
}).catch(res => { }).catch(res => {
this.submiting = false this.submiting = false
}) })
@ -637,22 +369,16 @@ export default {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
if (this.submiting) return false if (this.submiting) return false
this.submiting = true
const { form } = this const { form } = this
const team = this.teams.find(e => e.teamId == form.teamId) const team = this.teams.find(e => e.teamId == form.teamId)
if (team && team.invitationCode) form.invitationCode = team.invitationCode if (team && team.invitationCode) form.invitationCode = team.invitationCode
// id-id-schoolId-workNumber // id-id-schoolId-workNumber
form.account = `${Setting.platformId}-3-${form.schoolId}-${form.workNumber}` form.account = `${Setting.platformId}-3-${form.schoolId}-${form.workNumber}`
const { phone, email } = form const { phone } = form
if (phone && !/^1[3456789]\d{9}$/.test(phone)) { 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("请输入正确的邮箱")
} else if (this.notExit) {
return Util.errorMsg('学生不存在,无法添加!')
} else if (this.exitMember) {
return Util.errorMsg('学生已存在')
} else { } else {
this.submiting = true
this.submitForm() this.submitForm()
} }
} }
@ -687,31 +413,14 @@ export default {
} }
this.teamVisible = true this.teamVisible = true
}, },
//
async getSchool () {
const { list } = await this.$get(this.api.querySchoolData)
this.schools = list
},
// //
async getClient () { getClient() {
if (this.info.competitionScope === 2) { if (this.info.competitionScope === 2) { //
//
this.$get(`${this.api.schoolsInCompetitionArea}?competitionId=${this.id}`).then(({ schools }) => { this.$get(`${this.api.schoolsInCompetitionArea}?competitionId=${this.id}`).then(({ schools }) => {
this.clients = schools this.clients = schools
}).catch(res => {}) }).catch(res => {})
} else { } else { //
// this.$get(this.api.querySchoolData).then(({ list }) => {
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 this.clients = list
}).catch(res => {}) }).catch(res => {})
} }
@ -728,26 +437,21 @@ export default {
// //
teamSubmit() { teamSubmit() {
const form = this.teamForm const form = this.teamForm
if (!form.teamName) return Util.errorMsg('请输入团队名称') if (!form.teamName) return util.errorMsg('请输入团队名称')
if (form.invitationCode.length !== 6) return Util.errorMsg('请输入6位数团队邀请码') if (form.invitationCode.length !== 6) return util.errorMsg('请输入6位数团队邀请码')
form.accountId = this.form.id form.accountId = this.form.id
form.schoolId = this.form.schoolId
form.studentAffiliatedInstitutionId = this.form.studentAffiliatedInstitutionId
this.$post(this.api.addCompetitionTeam, form).then(res => { this.$post(this.api.addCompetitionTeam, form).then(res => {
this.teamVisible = false this.teamVisible = false
this.addVisible = false this.addVisible = false
this.init() this.getData()
Util.successMsg('报名成功!') util.successMsg('报名成功!')
}).catch(res => {}) }).catch(res => {})
}, },
// //
toInfo(row) { toInfo(row) {
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}`) this.$router.push(`/matchInfo?id=${this.id}&accountId=${row.accountId}`)
}, },
exportAll() { exportAll() {
if (this.listData.length) {
this.exporting = true
const data = this.multipleSelection const data = this.multipleSelection
if (data.length) { if (data.length) {
data.map((e, i) => e.id = i + 1) data.map((e, i) => e.id = i + 1)
@ -757,12 +461,8 @@ export default {
}, },
responseType: 'blob' responseType: 'blob'
}).then((res) => { }).then((res) => {
const name = res.headers['content-disposition'] util.downloadFileDirect(`报名人员.xls`, new Blob([res.data]))
Util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data])) }).catch(res => {})
this.exporting = false
}).catch(res => {
this.exporting = false
})
} else { } else {
axios.get(`${this.api.excelExport}?competitionId=${this.id}`, { axios.get(`${this.api.excelExport}?competitionId=${this.id}`, {
headers: { headers: {
@ -770,33 +470,10 @@ export default {
}, },
responseType: 'blob' responseType: 'blob'
}).then((res) => { }).then((res) => {
const name = res.headers['content-disposition'] util.downloadFileDirect(`报名人员.xls`, new Blob([res.data]))
Util.downloadFileDirect(name ? decodeURI(name) : '报名人员.xlsx', new Blob([res.data])) }).catch(res => {})
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> </script>
@ -806,24 +483,10 @@ export default {
.w-100 { .w-100 {
width: 100%; width: 100%;
} }
.tips { .tips {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: 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> </style>

@ -1,71 +1,45 @@
<template> <template>
<!-- 报名人员 --> <!-- 报名人员 -->
<div class="page-content" <div class="page-content" style="padding: 24px">
style="padding: 24px"> <div class="tool" style="justify-content: flex-end">
<div class="tool" <el-button type="primary" round @click="add" v-auth="'/match:管理:公告通知:新增'">新增</el-button>
style="justify-content: flex-end">
<el-button type="primary"
round
@click="add"
v-auth="'/match:管理:公告通知:新增'">新增</el-button>
</div> </div>
<el-table ref="table" <el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
:data="listData" <el-table-column type="index" width="60" label="序号" align="center">
class="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="index"
width="60"
label="序号"
align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + (pageNo - 1) * pageSize + 1 }} {{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="announcementTitle" <el-table-column prop="announcementTitle" label="标题名称">
label="标题名称">
</el-table-column> </el-table-column>
<el-table-column prop="createTime" <el-table-column prop="createTime" label="创建时间">
label="创建时间">
</el-table-column> </el-table-column>
<el-table-column prop="updateTime" <el-table-column prop="updateTime" label="发布时间">
label="发布时间">
</el-table-column> </el-table-column>
<el-table-column prop="phone" <el-table-column prop="phone" label="状态">
label="状态">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.status ? '已发布' : '草稿' }} {{ scope.row.status ? '已发布' : '草稿' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" <el-table-column label="操作" align="center" width="250">
align="center"
width="250">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" <el-button type="text" @click="edit(scope.row)" v-auth="'/match:管理:公告通知:编辑'">编辑</el-button>
@click="edit(scope.row)" <el-button type="text" @click="del(scope.row)" v-auth="'/match:管理:公告通知:删除'">删除</el-button>
v-auth="'/match:管理:公告通知:编辑'">编辑</el-button> <el-switch
<el-button type="text" v-auth="'/match:管理:公告通知:启用'"
@click="del(scope.row)"
v-auth="'/match:管理:公告通知:删除'">删除</el-button>
<el-switch v-auth="'/match:管理:公告通知:启用'"
v-model="scope.row.isOpen" v-model="scope.row.isOpen"
:active-text="scope.row.isOpen ? '关' : '开'" :active-text="scope.row.isOpen ? '关' : '开'"
:active-value="0" :active-value="0"
:inactive-value="1" :inactive-value="1"
style="margin: 0 10px 0 5px" style="margin: 0 10px 0 5px"
@change="switchOff($event,scope.row,scope.$index)"></el-switch> @change="switchOff($event,scope.row,scope.$index)"
></el-switch>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background <el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo">
layout="total, prev, pager, next"
:total="totals"
@current-change="handleCurrentChange"
:current-page="pageNo">
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
@ -134,8 +108,7 @@ export default {
this.$put(`${this.api.disableAnnouncement}?id=${row.id}&isDisable=${val}`).then(res => {}).catch(err => {}) this.$put(`${this.api.disableAnnouncement}?id=${row.id}&isDisable=${val}`).then(res => {}).catch(err => {})
} else if (!row.status) { } else if (!row.status) {
this.$confirm('是否发布该公告?', '提示', { this.$confirm('是否发布该公告?', '提示', {
type: 'success', type: 'success'
closeOnClickModal: false
}).then(() => { }).then(() => {
this.$put(`${this.api.disableAnnouncement}?id=${row.id}&isDisable=${val}`).then(res => { this.$put(`${this.api.disableAnnouncement}?id=${row.id}&isDisable=${val}`).then(res => {
this.$post(this.api.amendmentAnnouncement, { this.$post(this.api.amendmentAnnouncement, {
@ -163,4 +136,5 @@ export default {
</script> </script>
<style scoped> <style scoped>
</style> </style>

@ -1,43 +1,45 @@
<template> <template>
<!-- 大赛详情 --> <!-- 大赛详情 -->
<div> <div>
<el-card shadow="hover" <el-card shadow="hover" style="margin-bottom: 20px">
style="margin-bottom: 20px">
<div class="flex-between"> <div class="flex-between">
<el-page-header @back="back" <el-page-header @back="back" :content="(form.id ? '编辑' : '创建') + '公告'"></el-page-header>
:content="(form.id ? '编辑' : '创建') + '公告'"></el-page-header>
</div> </div>
</el-card> </el-card>
<div class="page"> <div class="page">
<div class="page-content"> <div class="page-content">
<el-form label-width="170px" <el-form label-width="170px" label-suffix=":" size="small">
label-suffix=":"
size="small">
<el-form-item label="公告标题"> <el-form-item label="公告标题">
<div class="d-inline-block"> <div class="d-inline-block">
<el-input placeholder="请输入公告名称" <el-input placeholder="请输入公告名称" v-model="form.announcementTitle" clearable></el-input>
v-model="form.announcementTitle"
clearable></el-input>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="正文"> <el-form-item label="正文">
<quill :border="true" <quill :border="true" v-model="form.announcementText" :height="400" />
v-model="form.announcementText"
:height="400" />
</el-form-item> </el-form-item>
<el-form-item label="附件"> <el-form-item label="附件">
<Upload :limit="5" <el-upload
:file-list="fileList"
:on-remove="handleRemove" :on-remove="handleRemove"
@onSuccess="uploadSuccess" /> :on-error="uploadError"
:on-success="uploadSuccess"
:before-upload="beforeUpload"
:before-remove="beforeRemove"
:limit="5"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:headers="headers"
:file-list="fileList"
name="file"
>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">
<p>支持扩展名.rar .zip .doc .docx .pdf .jpg...</p>
</div>
</el-upload>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button v-if="!form.id" <el-button v-if="!form.id" @click="save(0)" v-auth="'/match:管理:公告通知:草稿'">草稿</el-button>
@click="save(0)" <el-button type="primary" @click="save(1)" v-auth="'/match:管理:公告通知:发布'">发布</el-button>
v-auth="'/match:管理:公告通知:草稿'">草稿</el-button>
<el-button type="primary"
@click="save(1)"
v-auth="'/match:管理:公告通知:发布'">发布</el-button>
<el-button @click="back">取消</el-button> <el-button @click="back">取消</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -49,8 +51,6 @@
<script> <script>
import quill from "@/components/quill"; import quill from "@/components/quill";
import util from "@/libs/util"; import util from "@/libs/util";
import Upload from '@/components/upload';
import Oss from '@/components/upload/upload.js'
export default { export default {
name: "matchDetail", name: "matchDetail",
data() { data() {
@ -72,8 +72,7 @@ export default {
}; };
}, },
components: { components: {
quill, quill
Upload
}, },
watch: { watch: {
// , // ,
@ -133,17 +132,22 @@ export default {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
}, },
// //
uploadSuccess (file) { uploadSuccess(res) {
const file = res.data.filesResult
const { id } = this.form const { id } = this.form
const data = { const data = {
announcementId: id || '', announcementId: id || '',
fileName: file.name, fileName: this.fileName,
filePath: file.url filePath: file.fileUrl || file.fileId
} }
this.form.announcementAnnexList.push(data) this.form.announcementAnnexList.push(data)
// //
id && this.$post(this.api.saveAnnouncementAnnex, data).then(res => {}).catch(res => {}) id && this.$post(this.api.saveAnnouncementAnnex, data).then(res => {}).catch(res => {})
}, },
//
beforeUpload(file) {
this.fileName = file.name
},
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.$message({ this.$message({
message: "上传出错,请重试!", message: "上传出错,请重试!",
@ -156,7 +160,7 @@ export default {
}, },
handleRemove(file, fileList) { handleRemove(file, fileList) {
if (file.url) { if (file.url) {
Oss.del(file.url) this.$del(`${this.api.fileDeletion}?keys=${file.url}`).then(res => {}).catch(res => {})
const id = this.form.announcementAnnexList.find(e => e.fileName === file.name).id const id = this.form.announcementAnnexList.find(e => e.fileName === file.name).id
this.$post(`${this.api.delAnnex}?id=${id}`).then(res => {}).catch(res => {}) this.$post(`${this.api.delAnnex}?id=${id}`).then(res => {}).catch(res => {})
} }
@ -251,8 +255,7 @@ $upload-lg-height: 150px;
/deep/ .d-inline-block { /deep/ .d-inline-block {
width: 216px; width: 216px;
.el-select, .el-select, .el-input {
.el-input {
width: 100%; width: 100%;
} }
} }
@ -272,7 +275,7 @@ $upload-lg-height: 150px;
.remove { .remove {
width: 16px; width: 16px;
height: 16px; height: 16px;
background: url('../../../assets/img/close.png') 0 0 / cover no-repeat; background: url("../../../assets/img/close.png") 0 0/cover no-repeat;
cursor: pointer; cursor: pointer;
} }
} }

@ -1,675 +0,0 @@
<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

@ -1,413 +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" 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>

@ -69,16 +69,16 @@
<p v-if="rule.onlineButton">线上地点{{ rule.onlineAddress }}</p> <p v-if="rule.onlineButton">线上地点{{ rule.onlineAddress }}</p>
<p v-if="rule.offlineButton">线下地点{{ rule.offlineAddress }}</p> <p v-if="rule.offlineButton">线下地点{{ rule.offlineAddress }}</p>
<template v-if="rule.method === 2"> <template v-if="rule.method === 2">
<p>比赛地点{{ rule.offlineAddress }}</p> <p>线下地点{{ rule.offlineAddress }}</p>
<p>比赛内容{{ rule.contentDescription }}</p> <p>比赛内容{{ rule.contentDescription }}</p>
<p>评分规则{{ rule.scoreRule }}</p> <p>评分规则{{ rule.scoreRule }}</p>
</template> </template>
<template v-if="form.completeCompetitionSetup.competitionType"> <template v-if="form.completeCompetitionSetup.competitionType">
<p>每个团队参赛人数限制{{ rule.teamNumLimit || '不限制' }}</p> <p>团队参赛人数限制{{ rule.teamNumLimit || '不限制' }}</p>
<p>团队成绩计算方式{{ teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod) && teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod).name }}</p> <p>团队成绩计算方式{{ teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod) && teamCalculationMethods.find(e => e.id == rule.teamCalculationMethod).name }}</p>
</template> </template>
<!-- <p v-if="rule.resultAnnouncementTime != 0">阶段比赛结束后{{ rule.resultAnnouncementTime }}小时公布阶段比赛成绩</p> --> <p>阶段比赛结束后{{ rule.resultAnnouncementTime }}小时公布阶段比赛成绩</p>
<div v-if="form.rule === 1" <div v-if="form.rule === 1"
class="flex"> class="flex">
<p>晋级规则</p> <p>晋级规则</p>
@ -183,7 +183,6 @@ export default {
}, },
mounted () { mounted () {
this.handleAnnex() this.handleAnnex()
console.log("🚀 ~ file: index.vue:187 ~ mounted ~ this.form:", this.form)
if (this.form.id) { if (this.form.id) {
this.getProgress() this.getProgress()
this.getNotice() this.getNotice()

File diff suppressed because it is too large Load Diff

@ -10,42 +10,43 @@
<el-form label-width="80px"> <el-form label-width="80px">
<el-col :span="4"> <el-col :span="4">
<el-form-item label="省份"> <el-form-item label="省份">
<el-select v-model="form.provinceId" clearable placeholder="请选择省份" @change="getCity()" <el-select v-model="form.provinces" clearable placeholder="请选择省份"
@clear="clearprovince()"> @change="getCity()" @clear="clearprovince()">
<el-option v-for="(item, index) in provinceList" :key="index" :label="item.provinceName" <el-option v-for="(item,index) in provinceList" :key="index"
:value="item.provinceId"></el-option> :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="城市"> <el-form-item label="城市">
<el-select v-model="form.cityId" clearable placeholder="请选择城市" <el-select v-model="form.city" clearable placeholder="请选择城市"
:disabled="form.provinceId ? false : true" @change="getData()"> :disabled="form.provinces ? false : true" @change="getData()">
<el-option v-for="(item, index) in cityList" :key="index" :label="item.cityName" <el-option v-for="(item,index) in cityList" :key="index"
:value="item.cityId"></el-option> :label="item.cityName" :value="item.cityId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="订单类型"> <el-form-item label="订单类型">
<el-select v-model="form.orderType" clearable placeholder="请选择订单类型" @change="getData()"> <el-select v-model="form.orderType" clearable placeholder="请选择订单类型"
<el-option v-for="(item, index) in orderTypeList" :key="index" :label="item.name" @change="getData()">
:value="item.value"></el-option> <el-option v-for="(item,index) in orderTypeList" :key="index"
:label="item.name" :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="订单状态"> <el-form-item label="订单状态">
<el-select v-model="form.orderStatus" clearable placeholder="请选择订单状态" @change="getData()"> <el-select v-model="form.orderStatus" clearable placeholder="请选择订单状态"
<el-option v-for="(item, index) in orderStatusList" :key="index" :label="item.name" @change="getData()">
:value="item.value"></el-option> <el-option v-for="(item,index) in orderStatusList" :key="index"
:label="item.name" :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item>
<el-input placeholder="请输入订单号/客户名称/订单名称" prefix-icon="el-icon-search" v-model="form.customerName" <el-input placeholder="请输入订单号/客户名称/订单名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
@ -60,13 +61,14 @@
<span>订单列表</span> <span>订单列表</span>
</div> </div>
<div> <div>
<el-button type="primary" round @click="addOrder" 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> <el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
</div> </div>
</div> </div>
<el-table :data="orderData" class="table" ref="table" stripe header-align="center" <el-table :data="orderData" class="table" ref="table" stripe header-align="center"
@selection-change="handleSelectionChange" row-key="orderId"> @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="selection" width="55" align="center"
:reserve-selection="true"></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>
<el-table-column prop="orderNumber" label="订单编号" align="center"> <el-table-column prop="orderNumber" label="订单编号" align="center">
@ -101,8 +103,8 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background layout="total, prev, pager, next" @current-change="handleCurrentChange" <el-pagination background layout="total, prev, pager, next"
:current-page="page" :total="totals"> @current-change="handleCurrentChange" :current-page="pageNo" :total="totals">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
@ -110,17 +112,17 @@
</template> </template>
<script> <script>
import qs from 'qs'
export default { export default {
data() { data() {
return { return {
orderParam: this.$store.state.orderParam,
form: { form: {
provinceId: +this.$route.query.provinceId || '', provinces: "",
cityId: +this.$route.query.cityId || '', city: "",
orderType: +this.$route.query.orderType || '', orderType: "",
orderStatus: this.$route.query.orderStatus ? +this.$route.query.orderStatus : '', orderStatus: ""
customerName: this.$route.query.customerName || ''
}, },
keyword: "",
orderData: [], orderData: [],
multipleSelection: [], multipleSelection: [],
provinceList: this.$store.state.provinceList, provinceList: this.$store.state.provinceList,
@ -145,7 +147,7 @@ export default {
name: "已取消", name: "已取消",
value: 2 value: 2
}], }],
page: +this.$route.query.page || 1, pageNo: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
totals: 0, totals: 0,
searchTimer: null, searchTimer: null,
@ -153,20 +155,15 @@ export default {
}; };
}, },
watch: { watch: {
'form.customerName': function (val) { keyword: function(val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData(); this.initData();
}, 500); }, 500);
} }
}, },
mounted () { created() {
const { query } = this.$route if (this.orderParam) this.form = this.orderParam
if (query.page) {
this.$router.push('/order').catch(() => { })
}
this.form.provinceId && this.getCityData()
this.getData() this.getData()
this.getSchool() this.getSchool()
}, },
@ -179,9 +176,13 @@ export default {
getData() { getData() {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '订单管理') const sid = this.$store.state.dataPer.find(e => e.permissionName === '订单管理')
let data = { let data = {
...this.form, cityId: this.form.city,
pageNo: this.page, customerName: this.keyword,
orderStatus: this.form.orderStatus,
orderType: this.form.orderType,
pageNo: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
provinceId: this.form.provinces,
supplierId: sid ? sid.supplierId : '' supplierId: sid ? sid.supplierId : ''
}; };
this.$post(this.api.orderList, data).then(res => { this.$post(this.api.orderList, data).then(res => {
@ -192,32 +193,31 @@ export default {
}); });
this.orderData = res.orderPage.orders; this.orderData = res.orderPage.orders;
this.totals = res.orderPage.total; this.totals = res.orderPage.total;
}).catch(res => { }); }).catch(res => {
});
}, },
// //
clearprovince() { clearprovince() {
this.form.cityId = '' this.form.city = "";
}, },
// //
getCity() { getCity() {
this.clearprovince(); this.clearprovince();
this.getCityData(); this.getCityData();
this.page = 1; this.pageNo = 1;
this.getData(); this.getData();
}, },
async getCityData () { getCityData() {
const { list } = await this.$get(this.api.queryCity, { let data = {
provinceId: this.form.provinceId provinceId: this.form.provinces
}) };
this.cityList = list this.$get(this.api.queryCity, data).then(res => {
}, this.cityList = res.list;
// url }).catch(res => {
setReferrer () { });
this.$router.push(`${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`)
// this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`)
}, },
addOrder() { addOrder() {
this.setReferrer() this.$store.commit("systemData", { order_id: "" });
this.$router.push({ this.$router.push({
path:'/AddOrder', path:'/AddOrder',
query:{ query:{
@ -226,13 +226,13 @@ export default {
}) })
}, },
handle(val, row) { handle(val, row) {
this.setReferrer()
let orderStatus let orderStatus
if(row.orderStatus == '已完成'){ if(row.orderStatus == '已完成'){
orderStatus = 1 orderStatus = 1
}else{ }else{
orderStatus = 0 orderStatus = 0
} }
this.$store.commit('setOrderParam', this.form)
this.$router.push({ this.$router.push({
path:'/AddOrder', path:'/AddOrder',
query:{ query:{
@ -241,6 +241,7 @@ export default {
orderStatus orderStatus
} }
}) })
// this.$router.push("/addorder?" + val + "=" + row.orderId+"&orderStatus="+orderStatus);
}, },
// //
getSchool() { getSchool() {
@ -313,11 +314,11 @@ export default {
} }
}, },
initData() { initData() {
this.page = 1; this.pageNo = 1;
this.getData(); this.getData();
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val; this.pageNo = val;
this.$router.push(`order?page=${val}`) this.$router.push(`order?page=${val}`)
this.getData(); this.getData();
}, },
@ -333,11 +334,9 @@ export default {
.card { .card {
min-height: calc(100vh - 300px); min-height: calc(100vh - 300px);
} }
.mag { .mag {
margin-right: 20px; margin-right: 20px;
} }
.cell{ .cell{
white-space:pre-wrap; white-space:pre-wrap;
width: 140px; width: 140px;
@ -348,11 +347,9 @@ export default {
line-clamp: 2; line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.tags{ .tags{
border: none; border: none;
background: none; background: none;color: #000;
color: #000;
white-space:pre-wrap; white-space:pre-wrap;
width: 140px; width: 140px;
overflow: hidden; overflow: hidden;
@ -363,3 +360,4 @@ export default {
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
</style> </style>

@ -4,58 +4,54 @@
<div class="side"> <div class="side">
<div> <div>
<div class="flex-between"> <div class="flex-between">
<h6 class="p-title" <h6 class="p-title" style="margin-bottom: 0">城市合伙人区域管理</h6>
style="margin-bottom: 0">城市合伙人区域管理</h6>
</div> </div>
<div style="height: 504px; max-height: 504px; overflow: auto"> <div style="height: 504px; max-height: 504px; overflow: auto">
<el-tree :data="orgList" <el-tree
:data="orgList"
default-expand-all default-expand-all
ref="orgTree" ref="orgTree"
node-key="id" node-key="id"
highlight-current highlight-current
:expand-on-click-node="false" :expand-on-click-node="false"
@node-click="handleNodeClick" @node-click="handleNodeClick"
:props="{children: 'children', label: 'partnerClassificationName', isLeaf: 'leaf'}"> :props="{children: 'children', label: 'partnerClassificationName', isLeaf: 'leaf'}"
<span class="custom-tree-node" >
slot-scope="{ node, data }"> <span class="custom-tree-node" slot-scope="{ node, data }">
<span class="org-name">{{ node.label }}</span> <span class="org-name">{{ node.label }}</span>
</span> </span>
</el-tree> </el-tree>
</div> </div>
</div> </div>
<el-dialog :title="typeForm.id ? '编辑' : '新增' + '分类'" <el-dialog
:title="typeForm.id ? '编辑' : '新增' + '分类'"
:visible.sync="orgVisible" :visible.sync="orgVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
width="50%" width="50%"
@close="closeType"> @close="closeType"
<el-form v-if="orgVisible" >
ref="typeForm" <el-form v-if="orgVisible" ref="typeForm" :model="typeForm" :rules="orgRules" label-width="100px">
:model="typeForm" <el-form-item label="分类名称" prop="partnerClassificationName">
:rules="orgRules" <el-input v-model.trim="typeForm.partnerClassificationName" placeholder="请输入"></el-input>
label-width="100px">
<el-form-item label="分类名称"
prop="partnerClassificationName">
<el-input v-model.trim="typeForm.partnerClassificationName"
placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="上级部门"> <el-form-item label="上级部门">
<span v-if="typeForm.parentName">{{ typeForm.parentName }}</span> <span v-if="typeForm.parentName">{{ typeForm.parentName }}</span>
<el-cascader v-else <el-cascader
v-else
:options="orgListDia" :options="orgListDia"
v-model="cascaderValue" v-model="cascaderValue"
:props="cascaderProps" :props="cascaderProps"
clearable clearable
style="width: 100%"> style="width: 100%"
>
</el-cascader> </el-cascader>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer">
<el-button @click="closeOrg"> </el-button> <el-button @click="closeOrg"> </el-button>
<el-button type="primary" <el-button type="primary" @click="orgSubmit"> </el-button>
@click="orgSubmit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -70,117 +66,51 @@
</ul> </ul>
</div> --> </div> -->
<el-table :data="listData" <el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
class="table" <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
ref="table" <el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
stripe <el-table-column prop="teamName" label="团队名称" align="center" min-width="120" show-overflow-tooltip></el-table-column>
header-align="center" <el-table-column prop="userName" label="团队负责人" align="center" min-width="100"></el-table-column>
@selection-change="handleSelectionChange" <el-table-column prop="phone" label="手机号" align="center" min-width="120"></el-table-column>
row-key="id"> <el-table-column prop="account" label="账号" align="center" min-width="100"></el-table-column>
<el-table-column type="selection" <el-table-column prop="invitationAccount" label="邀请人" align="center" min-width="120"></el-table-column>
width="55" <el-table-column prop="phone" label="团队年费" align="center" min-width="120">
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="teamName"
label="团队名称"
align="center"
min-width="120"
show-overflow-tooltip></el-table-column>
<el-table-column prop="userName"
label="团队负责人"
align="center"
min-width="100"></el-table-column>
<el-table-column prop="phone"
label="手机号"
align="center"
min-width="120"></el-table-column>
<el-table-column prop="account"
label="账号"
align="center"
min-width="100"></el-table-column>
<el-table-column prop="invitationAccount"
label="邀请人"
align="center"
min-width="120"></el-table-column>
<el-table-column prop="phone"
label="团队年费"
align="center"
min-width="120">
<template slot-scope="scope"> <template slot-scope="scope">
固定年费{{ scope.row.annualTeamFee !== underfined ? scope.row.annualTeamFee + '元' : '' }} 固定年费{{ scope.row.annualTeamFee !== underfined ? scope.row.annualTeamFee + 'w' : '' }}
<el-button v-auth="'/parner:费率管理:修改固定年费'" <el-button v-auth="'/parner:费率管理:修改固定年费'" type="primary" size="mini" @click="editAnnualTeamFee(scope.row)">修改</el-button>
type="primary"
size="mini"
@click="editAnnualTeamFee(scope.row)">修改</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="phone" <el-table-column prop="phone" label="市场服务年费" align="center" min-width="120">
label="市场服务年费"
align="center"
min-width="120">
<template slot-scope="scope"> <template slot-scope="scope">
项目抽成{{ scope.row.annualMarketingFee !== underfined ? scope.row.annualMarketingFee + '%' : '' }} 项目抽成{{ scope.row.annualMarketingFee !== underfined ? scope.row.annualMarketingFee + '%' : '' }}
<el-button v-auth="'/parner:费率管理:修改项目抽成'" <el-button v-auth="'/parner:费率管理:修改项目抽成'" type="primary" size="mini" @click="editAnnualMarketingFee(scope.row)">修改</el-button>
type="primary"
size="mini"
@click="editAnnualMarketingFee(scope.row)">修改</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background <el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
@current-change="currentChange"
:current-page="page"
layout="total, prev, pager, next"
:total="total"></el-pagination>
</div> </div>
<el-dialog title="请设置团队年费" <el-dialog title="请设置团队年费" :visible.sync="annualTeamFeeVisible" width="300px" class="dialog" :close-on-click-modal="false">
:visible.sync="annualTeamFeeVisible" <el-form ref="form" label-width="75px" style='margin-right: 0;'>
width="300px"
class="dialog"
:close-on-click-modal="false">
<el-form ref="form"
label-width="75px"
style='margin-right: 0;'>
<el-form-item label="固定年费"> <el-form-item label="固定年费">
<el-input style="width: 150px;" <el-input style="width: 150px;" type="number" v-model.number="annualTeamFee" placeholder="请输入数字"></el-input>
type="number"
v-model.number="annualTeamFee"
placeholder="请输入数字"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer">
<el-button @click="annualTeamFeeVisible = false">取消</el-button> <el-button @click="annualTeamFeeVisible = false">取消</el-button>
<el-button type="primary" <el-button type="primary" @click="submitAnnualTeamFee">确定</el-button>
@click="submitAnnualTeamFee">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="请设置市场服务年费" <el-dialog title="请设置市场服务年费" :visible.sync="annualMarketingFeeVisible" width="300px" class="dialog" :close-on-click-modal="false">
:visible.sync="annualMarketingFeeVisible" <el-form ref="form" label-width="75px" style='margin-right: 0;'>
width="300px"
class="dialog"
:close-on-click-modal="false">
<el-form ref="form"
label-width="75px"
style='margin-right: 0;'>
<el-form-item label="项目抽成"> <el-form-item label="项目抽成">
<el-input style="width: 150px;" <el-input style="width: 150px;" type="number" v-model.number="annualMarketingFee" placeholder="请输入数字"></el-input> %
type="number"
v-model.number="annualMarketingFee"
placeholder="请输入数字"></el-input> %
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" <span slot="footer" class="dialog-footer">
class="dialog-footer">
<el-button @click="annualMarketingFeeVisible = false">取消</el-button> <el-button @click="annualMarketingFeeVisible = false">取消</el-button>
<el-button type="primary" <el-button type="primary" @click="submitAnnualMarketingFee">确定</el-button>
@click="submitAnnualMarketingFee">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>

@ -21,20 +21,37 @@
</div> </div>
<div style="height: 504px; max-height: 504px; overflow: auto"> <div style="height: 504px; max-height: 504px; overflow: auto">
<el-tree :data="orgList" default-expand-all ref="orgTree" node-key="id" highlight-current <el-tree
:expand-on-click-node="false" @node-click="handleNodeClick" :data="orgList"
:props="{ children: 'children', label: 'partnerClassificationName', isLeaf: 'leaf' }"> default-expand-all
ref="orgTree"
node-key="id"
highlight-current
:expand-on-click-node="false"
@node-click="handleNodeClick"
:props="{children: 'children', label: 'partnerClassificationName', isLeaf: 'leaf'}"
>
<span class="custom-tree-node" slot-scope="{ node, data }"> <span class="custom-tree-node" slot-scope="{ node, data }">
<span class="org-name">{{ node.label }}</span> <span class="org-name">{{ node.label }}</span>
<span> <span>
<!-- isTeam 0: 分类1: 团队 --> <!-- isTeam 0: 分类1: 团队 -->
<el-button v-auth="'/parner:账号管理:添加分类'" v-if="!data.isTeam" type="text" <el-button
icon="el-icon-circle-plus-outline" @click="() => addOrg(node, data)"> v-auth="'/parner:账号管理:添加分类'"
v-if="!data.isTeam"
type="text"
icon="el-icon-circle-plus-outline"
@click="() => addOrg(node, data)">
</el-button> </el-button>
<el-button v-auth="'/parner:账号管理:编辑分类'" type="text" icon="el-icon-edit-outline" <el-button
v-auth="'/parner:账号管理:编辑分类'"
type="text"
icon="el-icon-edit-outline"
@click="() => editOrg(node, data)"> @click="() => editOrg(node, data)">
</el-button> </el-button>
<el-button v-auth="'/parner:账号管理:删除分类'" type="text" icon="el-icon-delete" <el-button
v-auth="'/parner:账号管理:删除分类'"
type="text"
icon="el-icon-delete"
@click="() => delOrg(node, data)"> @click="() => delOrg(node, data)">
</el-button> </el-button>
</span> </span>
@ -43,16 +60,27 @@
</div> </div>
</div> </div>
<el-dialog :title="typeForm.id ? '编辑' : '新增' + '分类'" :visible.sync="orgVisible" :close-on-click-modal="false" <el-dialog
width="50%" @close="closeType"> :title="typeForm.id ? '编辑' : '新增' + '分类'"
:visible.sync="orgVisible"
:close-on-click-modal="false"
width="50%"
@close="closeType"
>
<el-form v-if="orgVisible" ref="typeForm" :model="typeForm" :rules="orgRules" label-width="100px"> <el-form v-if="orgVisible" ref="typeForm" :model="typeForm" :rules="orgRules" label-width="100px">
<el-form-item label="分类名称" prop="partnerClassificationName"> <el-form-item label="分类名称" prop="partnerClassificationName">
<el-input v-model.trim="typeForm.partnerClassificationName" placeholder="请输入"></el-input> <el-input v-model.trim="typeForm.partnerClassificationName" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="上级部门"> <el-form-item label="上级部门">
<span v-if="typeForm.parentName">{{ typeForm.parentName }}</span> <span v-if="typeForm.parentName">{{ typeForm.parentName }}</span>
<el-cascader v-else :options="orgListDia" v-model="cascaderValue" :props="cascaderProps" clearable <el-cascader
style="width: 100%"> v-else
:options="orgListDia"
v-model="cascaderValue"
:props="cascaderProps"
clearable
style="width: 100%"
>
</el-cascader> </el-cascader>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -68,8 +96,7 @@
<div class="tool"> <div class="tool">
<ul class="filter"> <ul class="filter">
<li> <li>
<el-input style="width: 250px;" placeholder="请输入员工姓名/手机号" prefix-icon="el-icon-search" v-model="keyWord" <el-input style="width: 250px;" placeholder="请输入员工姓名/手机号" prefix-icon="el-icon-search" v-model="keyWord" clearable></el-input>
clearable></el-input>
</li> </li>
</ul> </ul>
<div> <div>
@ -77,21 +104,18 @@
</div> </div>
</div> </div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" <el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
@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="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 type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="userName" label="姓名" align="center" min-width="100"></el-table-column> <el-table-column prop="userName" label="姓名" align="center" min-width="100"></el-table-column>
<el-table-column prop="account" label="账号" align="center" min-width="100"></el-table-column> <el-table-column prop="account" label="账号" align="center" min-width="100"></el-table-column>
<el-table-column prop="phone" label="手机号" align="center" min-width="120"></el-table-column> <el-table-column prop="phone" label="手机号" align="center" min-width="120"></el-table-column>
<el-table-column prop="invitationAccount" label="邀请人" align="center" min-width="120"></el-table-column> <el-table-column prop="invitationAccount" label="邀请人" align="center" min-width="120"></el-table-column>
<el-table-column prop="partnerClassificationName" label="团队名称" align="center" min-width="120" <el-table-column prop="partnerClassificationName" label="团队名称" align="center" min-width="120" show-overflow-tooltip></el-table-column>
show-overflow-tooltip></el-table-column>
<template v-if="!type"> <template v-if="!type">
<el-table-column prop="provinceName" label="省份" align="center" min-width="80"></el-table-column> <el-table-column prop="provinceName" label="省份" align="center" min-width="80"></el-table-column>
<el-table-column prop="cityName" label="城市" align="center" min-width="80"></el-table-column> <el-table-column prop="cityName" label="城市" align="center" min-width="80"></el-table-column>
<el-table-column prop="roleName" label="授权角色" align="center" min-width="120" <el-table-column prop="roleName" label="授权角色" align="center" min-width="120" show-overflow-tooltip></el-table-column>
show-overflow-tooltip></el-table-column>
<el-table-column prop="phone" label="费率" align="center" min-width="120"> <el-table-column prop="phone" label="费率" align="center" min-width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<p v-if="scope.row.annualTeamFee">团队年费{{ scope.row.annualTeamFee}}w</p> <p v-if="scope.row.annualTeamFee">团队年费{{ scope.row.annualTeamFee}}w</p>
@ -106,20 +130,16 @@
<el-button v-if="!type" type="text" v-auth="'/parner:账号管理:重置密码'" @click="edit(scope.row)">编辑</el-button> <el-button v-if="!type" type="text" v-auth="'/parner:账号管理:重置密码'" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" v-auth="'/parner:账号管理:重置密码'" @click="resetPassword(scope.row)">重置密码</el-button> <el-button type="text" v-auth="'/parner:账号管理:重置密码'" @click="resetPassword(scope.row)">重置密码</el-button>
<el-button v-if="type" type="text" v-auth="'/parner:账号管理:删除合伙人'" @click="del(scope.row)">删除</el-button> <el-button v-if="type" type="text" v-auth="'/parner:账号管理:删除合伙人'" @click="del(scope.row)">删除</el-button>
<el-button v-else-if="scope.row.isTeam == 1" type="text" v-auth="'/parner:账号管理:转让超管'" <el-button v-else-if="scope.row.isTeam == 1" type="text" v-auth="'/parner:账号管理:转让超管'" @click="transfer(scope.row)">转让超管</el-button>
@click="transfer(scope.row)">转让超管</el-button> <el-button v-if="scope.row.isTeam == 0" type="text" v-auth="'/parner:账号管理:移除'" @click="remove(scope.row)">移除</el-button>
<el-button v-if="scope.row.isTeam == 0" type="text" v-auth="'/parner:账号管理:移除'"
@click="remove(scope.row)">移除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" <el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
:total="total"></el-pagination>
</div> </div>
<el-dialog title="添加城市合伙人" :visible.sync="parnerVisible" width="580px" custom-class="add-dia" <el-dialog title="添加城市合伙人" :visible.sync="parnerVisible" width="580px" custom-class="add-dia" :close-on-click-modal="false" @close="closeAdd">
:close-on-click-modal="false" @close="closeAdd">
<p class="tips">链接/二维码失效时间{{ expireTime }}</p> <p class="tips">链接/二维码失效时间{{ expireTime }}</p>
<p class="title">城市合伙人 <em>邀请链接</em></p> <p class="title">城市合伙人 <em>邀请链接</em></p>
<p class="des">加盟商合作伙伴可以通过这个链接加入 <em>城市合伙人计划</em></p> <p class="des">加盟商合作伙伴可以通过这个链接加入 <em>城市合伙人计划</em></p>
@ -132,24 +152,21 @@
<img width="250" :src="qrcode" alt=""> <img width="250" :src="qrcode" alt="">
</el-dialog> </el-dialog>
<el-dialog title="转让管理员" :visible.sync="transferVisible" width="350px" custom-class="transfer-dia" <el-dialog title="转让管理员" :visible.sync="transferVisible" width="350px" custom-class="transfer-dia" :close-on-click-modal="false">
:close-on-click-modal="false">
<div style="text-align: center"> <div style="text-align: center">
<el-button type="primary" @click="showChoose">转给团队成员</el-button> <el-button type="primary" @click="showChoose">转给团队成员</el-button>
<el-button @click="add(1)">邀请外部人员</el-button> <el-button @click="add(1)">邀请外部人员</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="请选择要转让的团队成员" :visible.sync="chooseVisible" width="300px" custom-class="choose-dia" <el-dialog title="请选择要转让的团队成员" :visible.sync="chooseVisible" width="300px" custom-class="choose-dia" :close-on-click-modal="false">
:close-on-click-modal="false">
<ul class="member-list"> <ul class="member-list">
<li v-for="(item, i) in members" :key="i"> <li v-for="(item, i) in members" :key="i">
<div class="info"> <div class="info">
<img src="@/assets/img/avatar.png" alt=""> <img src="@/assets/img/avatar.png" alt="">
<span class="name">{{ item.userName }}</span> <span class="name">{{ item.userName }}</span>
</div> </div>
<el-radio v-model="choosePartnerId" :label="item.partnerId" <el-radio v-model="choosePartnerId" :label="item.partnerId" :disabled="curRow.accountId === item.accountId"></el-radio>
:disabled="curRow.accountId === item.accountId"></el-radio>
</li> </li>
</ul> </ul>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -167,22 +184,22 @@
<el-select class="w-100" v-model="form.roleList" multiple> <el-select class="w-100" v-model="form.roleList" multiple>
<template v-for="item in roleList"> <template v-for="item in roleList">
<!-- 不显示超管 --> <!-- 不显示超管 -->
<el-option :key="item.id" :label="item.roleName" :value="item.id"> <el-option
:key="item.id"
:label="item.roleName"
:value="item.id">
</el-option> </el-option>
</template> </template>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="provinceId" label="省份"> <el-form-item prop="provinceId" label="省份">
<el-select style="width: 100%" v-model="form.provinceId" placeholder="请选择省份" @change="getCity"> <el-select style="width: 100%" v-model="form.provinceId" placeholder="请选择省份" @change="getCity">
<el-option v-for="(item, index) in provinces" :key="index" :label="item.provinceName" <el-option v-for="(item,index) in provinces" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
:value="item.provinceId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="cityId" label="城市"> <el-form-item prop="cityId" label="城市">
<el-select style="width: 100%" v-model="form.cityId" placeholder="请选择城市" <el-select style="width: 100%" v-model="form.cityId" placeholder="请选择城市" :disabled="form.provinceId ? false : true">
:disabled="form.provinceId ? false : true"> <el-option v-for="(item,index) in cities" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
<el-option v-for="(item, index) in cities" :key="index" :label="item.cityName"
:value="item.cityId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -648,58 +665,47 @@ export default {
.m-b-20 { .m-b-20 {
margin-bottom: 20px; margin-bottom: 20px;
} }
.org-name { .org-name {
margin-right: 20px; margin-right: 20px;
} }
.w-100 { .w-100 {
width: 100%; width: 100%;
} }
.wrap { .wrap {
display: flex; display: flex;
padding: 0 24px; padding: 0 24px;
.side { .side {
width: 300px; width: 300px;
padding: 24px 10px 24px 0; padding: 24px 10px 24px 0;
margin-right: 24px; margin-right: 24px;
border-right: 1px solid rgba(0, 0, 0, 0.06); border-right: 1px solid rgba(0, 0, 0, 0.06);
} }
.right { .right {
width: calc(100% - 324px); width: calc(100% - 324px);
padding: 24px 0; padding: 24px 0;
} }
} }
.add-dia { .add-dia {
.tips { .tips {
font-size: 12px; font-size: 12px;
color: #f00; color: #f00;
} }
.title { .title {
margin: 10px 0; margin: 10px 0;
font-size: 14px; font-size: 14px;
em { em {
font-style: normal; font-style: normal;
} }
} }
.des { .des {
font-size: 13px; font-size: 13px;
color: #7a7a7a; color: #7a7a7a;
} }
.link-wrap { .link-wrap {
display: flex; display: flex;
align-items: center; align-items: center;
margin: 10px 0 20px; margin: 10px 0 20px;
} }
.link { .link {
padding: 10px; padding: 10px;
margin-right: 15px; margin-right: 15px;
@ -707,7 +713,6 @@ export default {
border-radius: 4px; border-radius: 4px;
} }
} }
/deep/.choose-dia { /deep/.choose-dia {
.member-list { .member-list {
li { li {
@ -716,21 +721,17 @@ export default {
align-items: center; align-items: center;
margin-bottom: 10px; margin-bottom: 10px;
} }
.info { .info {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
} }
img { img {
width: 40px; width: 40px;
height: 40px; height: 40px;
} }
.name { .name {
margin-left: 10px; margin-left: 10px;
} }
.el-radio__label { .el-radio__label {
display: none; display: none;
} }

@ -1,40 +1,35 @@
<template> <template>
<div class="page system" <div class="page system" style="padding: 0">
style="padding: 0">
<div class="tabs"> <div class="tabs">
<a class="item" <a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a>
v-for="(item,index) in tabs"
:key="index"
:class="{active: index == active}"
@click="tabChange(index)">{{ item }}</a>
</div> </div>
<learn v-if="active == 'learn'" /> <staff v-if="active == 'staff'"></staff>
<info v-if="active == 'info'" /> <pc-role v-if="active == 'pcRole'"></pc-role>
<plan v-if="active == 'plan'" /> <mobile-role v-if="active == 'mobileRole'"></mobile-role>
</div> </div>
</template> </template>
<script> <script>
import Setting from "@/setting"; import Setting from "@/setting";
import learn from "./learn"; import staff from "./staff";
import info from "./info"; import pcRole from "./pcRole";
import plan from "./plan"; import mobileRole from "./mobileRole";
export default { export default {
data() { data() {
return { return {
active: this.$route.query.type || 'learn', active: this.$route.query.type || 'staff',
tabs: { tabs: {
learn: "合伙人学习管理", staff: "合伙人学习管理",
info: "合伙人资讯管理", pcRole: "合伙人资讯管理",
plan: "方案管理" mobileRole: "方案管理"
} }
}; };
}, },
components: { components: {
learn, staff,
info, pcRole,
plan mobileRole
}, },
created() { created() {
Setting.dynamicRoute && this.initTabs(); Setting.dynamicRoute && this.initTabs();
@ -42,7 +37,13 @@ export default {
methods: { methods: {
tabChange(index) { tabChange(index) {
this.active = index this.active = index
this.$router.push(`/parnerOperation?type=${index}`) this.$router.push({
path: 'parnerOperation',
query: {
...this.$route.query,
type: index
}
})
}, },
initTabs() { initTabs() {
const btns = this.$store.state.btns const btns = this.$store.state.btns
@ -50,9 +51,9 @@ export default {
const tab2 = btns.includes('/parnerOperation:合伙人资讯管理') const tab2 = btns.includes('/parnerOperation:合伙人资讯管理')
const tab3 = btns.includes('/parnerOperation:方案管理') const tab3 = btns.includes('/parnerOperation:方案管理')
tab1 || delete this.tabs.learn tab1 || delete this.tabs.staff
tab2 || delete this.tabs.info tab2 || delete this.tabs.pcRole
tab3 || delete this.tabs.plan tab3 || delete this.tabs.mobileRole
const type = this.$route.query.type const type = this.$route.query.type
const keys = Object.keys(this.tabs) const keys = Object.keys(this.tabs)
this.active = keys.includes(type) ? type : keys[0] this.active = keys.includes(type) ? type : keys[0]

@ -1,339 +0,0 @@
<template>
<div class="page">
<div class="tool">
<div class="search-wrap">
<el-select v-model="field"
@change="initData">
<el-option v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input class="keyword"
:placeholder="'请输入' + keywords.find(e => e.id === field).name"
v-model.trim="keyword"
clearable></el-input>
</div>
<div class="actions">
<el-button v-auth="'/parnerOperation:合伙人资讯管理:批量删除'"
@click="batchDel">批量删除</el-button>
<el-button v-auth="'/parnerOperation:合伙人资讯管理:新增文章'"
type="primary"
@click="add">新增文章</el-button>
</div>
</div>
<el-table :data="list"
class="table"
ref="table"
header-align="center"
@selection-change="handleSelectionChange"
row-key="id"
@sort-change="sortChange">
<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 show-overflow-tooltip
prop="title"
label="标题"
align="center"
min-width="150"></el-table-column>
<el-table-column prop="classificationName"
label="所属分类"
align="center"
min-width="120"
sortable="custom"></el-table-column>
<el-table-column prop="founderName"
label="录入人"
align="center"
min-width="80"></el-table-column>
<el-table-column prop="editorName"
label="修改人"
align="center"
min-width="80"></el-table-column>
<el-table-column prop="updateTime"
label="修改日期"
align="center"
min-width="150"
sortable="custom"></el-table-column>
<el-table-column prop="releaseTime"
label="发布日期"
align="center"
min-width="100"
sortable="custom"></el-table-column>
<el-table-column prop="learnerNumber"
label="总浏览"
align="center"
min-width="70"></el-table-column>
<el-table-column prop="workNumber"
label="状态"
align="center"
min-width="80">
<template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column prop="sequence"
label="置顶"
align="center"
min-width="80"
sortable="custom">
<template slot-scope="scope">
<i v-if="scope.row.isRelease"
:class="['squ-icon', scope.row.isTop ? 'el-icon-check' : 'el-icon-close']"
@click="sticky(scope.row)"></i>
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="210">
<template slot-scope="scope">
<el-button v-auth="'/parnerOperation:合伙人资讯管理:编辑'"
type="text"
@click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/parnerOperation:合伙人资讯管理:删除'"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
<el-switch v-auth="'/parnerOperation:合伙人资讯管理:禁用'"
v-if="scope.row.isRelease"
class="m-l-10"
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row, scope.$index)">
</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="total"></el-pagination>
</div>
</div>
</template>
<script>
import util from '@/libs/util'
export default {
data () {
return {
field: this.$route.query.field || 'title',
keywords: [
{
id: 'title',
name: '标题'
},
{
id: 'founder',
name: '录入人'
},
{
id: 'editor',
name: '修改人'
}
],
keyword: this.$route.query.keyword || '',
list: [],
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
topSort: '',
classificationNameSort: '',
releaseDateSort: '',
editTimeSort: '',
multipleSelection: [],
};
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted () {
const { query } = this.$route
if (query.page) {
this.$router.push('/parnerOperation?type=info').catch(() => { })
}
this.getData()
},
methods: {
//
getData () {
const { keyword } = this
this.$post(this.api.partnerOperatingList, {
pageNum: this.page,
pageSize: this.pageSize,
querySource: 3, //(3. 4.)
topSort: this.topSort,
classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort,
releaseDateSort: this.releaseDateSort,
typeId: 2, // (1.2.)
title: this.field === 'title' ? keyword : '',
founderName: this.field === 'founder' ? keyword : '',
editorName: this.field === 'editor' ? keyword : ''
}).then(({ page, total }) => {
page.forEach(e => {
e.editing = false
})
this.list = page
this.total = total
}).catch(err => { })
},
currentChange (val) {
this.page = val
this.getData()
},
handleSelectionChange (val) {
this.multipleSelection = val
},
initData () {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
//
batchDel () {
const list = this.multipleSelection
if (list.length) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
const data = []
list.map(e => {
data.push('ids=' + e.id)
})
this.$post(`${this.api.batchDeletionParnerArticle}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection()
util.successMsg("删除成功")
this.getData()
}).catch(res => { })
}).catch(() => { })
} else {
util.errorMsg('请先选择数据 !')
}
},
//
handleDelete (row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.batchDeletionParnerArticle}?ids=${row.id}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => { })
}).catch(() => { })
},
//
switchOff (val, row) {
this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => { }).catch((res) => { })
},
//
sortChange (column) {
const { order } = column
// 1
if (column.prop === 'classificationName') {
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.topSort = ''
}
}
if (column.prop === 'updateTime') {
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.classificationNameSort = ''
this.releaseDateSort = ''
this.topSort = ''
}
}
if (column.prop === 'releaseTime') {
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.classificationNameSort = ''
this.topSort = ''
}
}
if (column.prop === 'sequence') {
this.topSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.classificationNameSort = ''
}
}
this.getData()
},
//
submitSequence (row) {
if (!row.sequence) return Util.errorMsg('请输入排序')
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=${row.sequence}`).then(res => {
this.initData()
}).catch(res => { })
},
//
editSequence (row) {
this.list.forEach(e => {
e.editing = false
})
row.editing = true
},
//
sticky (row) {
this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => {
this.initData()
}).catch(res => { })
},
// url
setReferrer () {
this.$store.commit('setReferrer', `${this.$route.fullPath}&keyword=${this.keyword}&field=${this.field}&page=${this.page}`)
},
//
add () {
this.setReferrer()
this.$router.push(`/learnMg?type=2`)
},
//
edit (row) {
this.setReferrer()
this.$router.push(`/learnMg?id=${row.id}&type=2`)
},
}
};
</script>
<style lang="scss" scoped>
.m-l-10 {
margin-left: 10px;
}
.squ-icon {
font-size: 16px;
font-weight: 600;
cursor: pointer;
color: #f70000;
&.el-icon-check {
color: #05991e;
}
}
/deep/.squ-input {
width: auto;
.el-input__inner {
width: 60px;
padding: 0 10px;
}
}
</style>

@ -1,339 +0,0 @@
<template>
<div class="page">
<div class="tool">
<div class="search-wrap">
<el-select v-model="field"
@change="initData">
<el-option v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input class="keyword"
:placeholder="'请输入' + keywords.find(e => e.id === field).name"
v-model.trim="keyword"
clearable></el-input>
</div>
<div class="actions">
<el-button v-auth="'/parnerOperation:合伙人学习管理:批量删除'"
@click="batchDel">批量删除</el-button>
<el-button v-auth="'/parnerOperation:合伙人学习管理:新增文章'"
type="primary"
@click="add">新增文章</el-button>
</div>
</div>
<el-table :data="list"
class="table"
ref="table"
header-align="center"
@selection-change="handleSelectionChange"
row-key="id"
@sort-change="sortChange">
<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 show-overflow-tooltip
prop="title"
label="标题"
align="center"
min-width="150"></el-table-column>
<el-table-column prop="classificationName"
label="所属分类"
align="center"
min-width="120"
sortable="custom"></el-table-column>
<el-table-column prop="founderName"
label="录入人"
align="center"
min-width="80"></el-table-column>
<el-table-column prop="editorName"
label="修改人"
align="center"
min-width="80"></el-table-column>
<el-table-column prop="updateTime"
label="修改日期"
align="center"
min-width="150"
sortable="custom"></el-table-column>
<el-table-column prop="releaseTime"
label="发布日期"
align="center"
min-width="100"
sortable="custom"></el-table-column>
<el-table-column prop="learnerNumber"
label="已学习人数"
align="center"
min-width="70"></el-table-column>
<el-table-column prop="workNumber"
label="状态"
align="center"
min-width="80">
<template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column prop="sequence"
label="置顶"
align="center"
min-width="80"
sortable="custom">
<template slot-scope="scope">
<i v-if="scope.row.isRelease"
:class="['squ-icon', scope.row.isTop ? 'el-icon-check' : 'el-icon-close']"
@click="sticky(scope.row)"></i>
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="210">
<template slot-scope="scope">
<el-button v-auth="'/parnerOperation:合伙人学习管理:编辑'"
type="text"
@click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/parnerOperation:合伙人学习管理:删除'"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
<el-switch v-auth="'/parnerOperation:合伙人学习管理:禁用'"
v-if="scope.row.isRelease"
class="m-l-10"
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row, scope.$index)">
</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="total"></el-pagination>
</div>
</div>
</template>
<script>
import util from '@/libs/util'
export default {
data () {
return {
field: this.$route.query.field || 'title',
keywords: [
{
id: 'title',
name: '标题'
},
{
id: 'founder',
name: '录入人'
},
{
id: 'editor',
name: '修改人'
}
],
keyword: this.$route.query.keyword || '',
list: [],
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
topSort: '',
classificationNameSort: '',
releaseDateSort: '',
editTimeSort: '',
multipleSelection: [],
};
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted () {
const { query } = this.$route
if (query.page) {
this.$router.push('/parnerOperation?type=learn').catch(() => { })
}
this.getData()
},
methods: {
//
getData () {
const { keyword } = this
this.$post(this.api.partnerOperatingList, {
pageNum: this.page,
pageSize: this.pageSize,
querySource: 3, //(3. 4.)
topSort: this.topSort,
classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort,
releaseDateSort: this.releaseDateSort,
typeId: 1, // (1.2.)
title: this.field === 'title' ? keyword : '',
founderName: this.field === 'founder' ? keyword : '',
editorName: this.field === 'editor' ? keyword : ''
}).then(({ page, total }) => {
page.forEach(e => {
e.editing = false
})
this.list = page
this.total = total
}).catch(err => { })
},
currentChange (val) {
this.page = val
this.getData()
},
handleSelectionChange (val) {
this.multipleSelection = val
},
initData () {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
//
batchDel () {
const list = this.multipleSelection
if (list.length) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
const data = []
list.map(e => {
data.push('ids=' + e.id)
})
this.$post(`${this.api.batchDeletionParnerArticle}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection()
util.successMsg("删除成功")
this.getData()
}).catch(res => { })
}).catch(() => { })
} else {
util.errorMsg('请先选择数据 !')
}
},
//
handleDelete (row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.batchDeletionParnerArticle}?ids=${row.id}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => { })
}).catch(() => { })
},
//
switchOff (val, row) {
this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => { }).catch((res) => { })
},
//
sortChange (column) {
const { order } = column
// 1
if (column.prop === 'classificationName') {
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.topSort = ''
}
}
if (column.prop === 'updateTime') {
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.classificationNameSort = ''
this.releaseDateSort = ''
this.topSort = ''
}
}
if (column.prop === 'releaseTime') {
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.classificationNameSort = ''
this.topSort = ''
}
}
if (column.prop === 'sequence') {
this.topSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.classificationNameSort = ''
}
}
this.getData()
},
//
submitSequence (row) {
if (!row.sequence) return Util.errorMsg('请输入排序')
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=${row.sequence}`).then(res => {
this.initData()
}).catch(res => { })
},
//
editSequence (row) {
this.list.forEach(e => {
e.editing = false
})
row.editing = true
},
//
sticky (row) {
this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => {
this.initData()
}).catch(res => { })
},
// url
setReferrer () {
this.$store.commit('setReferrer', `${this.$route.fullPath}&keyword=${this.keyword}&field=${this.field}&page=${this.page}`)
},
//
add () {
this.setReferrer()
this.$router.push(`/learnMg?type=1`)
},
//
edit (row) {
this.setReferrer()
this.$router.push(`/learnMg?id=${row.id}&type=1`)
},
}
};
</script>
<style lang="scss" scoped>
.m-l-10 {
margin-left: 10px;
}
.squ-icon {
font-size: 16px;
font-weight: 600;
cursor: pointer;
color: #f70000;
&.el-icon-check {
color: #05991e;
}
}
/deep/.squ-input {
width: auto;
.el-input__inner {
width: 60px;
padding: 0 10px;
}
}
</style>

@ -125,7 +125,7 @@
accept=".jpg,.png,.jpeg,.gif" accept=".jpg,.png,.jpeg,.gif"
:on-change="changeFile" :on-change="changeFile"
:show-file-list="false" :show-file-list="false"
action="" :action="this.api.fileupload"
:auto-upload="false"> :auto-upload="false">
<img v-if="form.bannerImg" <img v-if="form.bannerImg"
:src="form.bannerImg" :src="form.bannerImg"
@ -147,11 +147,14 @@
</el-form-item> </el-form-item>
<el-form-item prop="file" <el-form-item prop="file"
label="文件上传"> label="文件上传">
<Upload :limit="20" <el-upload :before-upload="fileBeforeUpload"
:changeFileList="false"
:file-list.sync="form.fileList"
:on-remove="handleRemove" :on-remove="handleRemove"
@onSuccess="uploadSuccessFile" /> :on-success="uploadSuccessFile"
:action="this.api.fileUploadNakadai"
:file-list="form.fileList"
:headers="headers">
<el-button>上传</el-button>
</el-upload>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="btns"> <div class="btns">
@ -294,9 +297,6 @@ import Editor from '@tinymce/tinymce-vue'
import editorConfig from '@/utils/editor' import editorConfig from '@/utils/editor'
import Cropper from '@/components/img-upload/Cropper' import Cropper from '@/components/img-upload/Cropper'
import Axios from 'axios' import Axios from 'axios'
import Upload from '@/components/upload';
import Oss from '@/components/upload/upload.js'
export default { export default {
data () { data () {
return { return {
@ -356,8 +356,7 @@ export default {
}, },
components: { components: {
Editor, Editor,
Cropper, Cropper
Upload
}, },
watch: { watch: {
// , // ,
@ -376,11 +375,11 @@ export default {
// //
if (this.updateTime) { if (this.updateTime) {
this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', { this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', {
type: 'warning', type: 'warning'
closeOnClickModal: false
}).then(() => { }).then(() => {
this.submit(this.form.isRelease, next) this.submit(this.form.isRelease, next)
}).catch(() => { }).catch(() => {
console.log(55)
next() next()
}) })
} else { } else {
@ -425,8 +424,6 @@ export default {
}, },
// //
addClass () { addClass () {
this.classifications.find(e => e.edit) ?
Util.errorMsg('请先保存分类!') :
this.classifications.push({ this.classifications.push({
edit: true, edit: true,
id: '', id: '',
@ -435,8 +432,6 @@ export default {
}, },
// //
editClass (row) { editClass (row) {
this.classifications.find(e => e.edit) ?
Util.errorMsg('请先保存分类!') :
this.$set(row, 'edit', 1) this.$set(row, 'edit', 1)
}, },
// //
@ -473,8 +468,7 @@ export default {
const list = this.classifications const list = this.classifications
if (list.find(e => e.edit && e.classificationName)) { if (list.find(e => e.edit && e.classificationName)) {
this.$confirm('所填写内容暂未保存,是否保存?', '提示', { this.$confirm('所填写内容暂未保存,是否保存?', '提示', {
type: 'warning', type: 'warning'
closeOnClickModal: false
}).then(() => { }).then(() => {
list.map(e => { list.map(e => {
e.edit && e.classificationName && this.submitClass(e, 0) e.edit && e.classificationName && this.submitClass(e, 0)
@ -502,8 +496,6 @@ export default {
}, },
// //
addLabel () { addLabel () {
this.labels.find(e => e.edit) ?
Util.errorMsg('请先保存主题!') :
this.labels.push({ this.labels.push({
edit: true, edit: true,
id: '', id: '',
@ -512,8 +504,6 @@ export default {
}, },
// //
editLabel (row) { editLabel (row) {
this.labels.find(e => e.edit) ?
Util.errorMsg('请先保存主题!') :
this.$set(row, 'edit', 1) this.$set(row, 'edit', 1)
}, },
// //
@ -549,8 +539,7 @@ export default {
const list = this.labels const list = this.labels
if (list.find(e => e.edit && e.labelName)) { if (list.find(e => e.edit && e.labelName)) {
this.$confirm('所填写内容暂未保存,是否保存?', '提示', { this.$confirm('所填写内容暂未保存,是否保存?', '提示', {
type: 'warning', type: 'warning'
closeOnClickModal: false
}).then(() => { }).then(() => {
list.map(e => { list.map(e => {
e.edit && e.labelName && this.submitLabel(e, 0) e.edit && e.labelName && this.submitLabel(e, 0)
@ -583,17 +572,61 @@ export default {
}, },
// //
customUpload (data) { customUpload (data) {
data.name = this.file.name const formData = new FormData()
this.imgUpload(data) formData.append('file', data, this.file.name)
this.imgUpload(formData)
},
//
compress (img) {
const canvas = document.createElement('canvas')
const ctx = canvas.getContext('2d')
// let initSize = img.src.length;
const width = img.width
const height = img.height
canvas.width = width
canvas.height = height
//
ctx.fillStyle = '#fff'
ctx.fillRect(0, 0, canvas.width, canvas.height)
ctx.drawImage(img, 0, 0, width, height)
//
const ndata = canvas.toDataURL('image/jpeg', 0.8)
return ndata
},
// base64bolb
dataURItoBlob (base64Data) {
let byteString
if (base64Data.split(',')[0].indexOf('base64') >= 0) {
byteString = atob(base64Data.split(',')[1])
} else {
byteString = unescape(base64Data.split(',')[1])
}
const mimeString = base64Data
.split(',')[0]
.split(':')[1]
.split(';')[0]
const ia = new Uint8Array(byteString.length)
for (let i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i)
}
return new Blob([ia], {
type: mimeString
})
}, },
// //
imgUpload (formData) { imgUpload (formData) {
this.isUpload = true this.isUpload = true
Oss.upload(formData).then(res => { Axios({
this.form.bannerImg && Oss.del(this.form.bannerImg) method: 'post',
this.form.bannerImg = res.url url: this.api.fileUploadNakadai,
}) data: formData,
headers: {
'Content-Type': 'multipart/form-data',
...this.headers
},
}).then(({ data }) => {
this.form.bannerImg = data.filesResult.fileUrl
}).catch(res => { })
this.$refs.cropper.isDisabled = false this.$refs.cropper.isDisabled = false
this.isUpload = false this.isUpload = false
this.cropperModel = false this.cropperModel = false
@ -621,69 +654,71 @@ export default {
}, },
// //
handleRemove (e, fileList) { handleRemove (e, fileList) {
Oss.del(e.filePath)
e.id ? this.$post(`${this.api.batchDeletionParnerFile}?ids=${e.id}`).then(res => { e.id ? this.$post(`${this.api.batchDeletionParnerFile}?ids=${e.id}`).then(res => {
this.form.fileList = fileList this.form.fileList = fileList
}).catch(res => { }) : (this.form.fileList = fileList) }).catch(res => { }) : (this.form.fileList = fileList)
}, },
// banner
uploadSuccessBanner (res) {
let url = this.form.bannerImg
url && this.$del(this.api.delFile, [url.split('/').pop()]).then(res => { }).catch(e => { })
this.form.bannerImg = res.url
},
// //
fileBeforeUpload (file) { fileBeforeUpload (file) {
this.uploading++ this.uploading++
}, },
// //
uploadSuccessFile (file) { uploadSuccessFile (res) {
const { name, url } = file const { originalFileName, fileUrl } = res.filesResult
this.uploading-- this.uploading--
this.form.id ? this.form.id ?
this.$post(this.api.saveParnerFile, { this.$post(this.api.saveParnerFile, {
contentId: this.form.id, contentId: this.form.id,
id: '', id: '',
fileName: name, fileName: originalFileName,
filePath: url filePath: fileUrl
}).then(({ data }) => { }).then(({ data }) => {
this.form.fileList.push({ this.form.fileList.push({
fileName: name, fileName: originalFileName,
filePath: url, filePath: fileUrl,
name: name, name: originalFileName,
url, url: fileUrl,
id: data id: data
}) })
}).catch(res => { }) : }).catch(res => { }) :
this.form.fileList.push({ this.form.fileList.push({
fileName: name, fileName: originalFileName,
filePath: url, filePath: fileUrl,
name: name, name: originalFileName,
url url: fileUrl
}) })
}, },
// //
preview () { preview () {
window.open((Setting.isDev ? `http://${location.hostname}:8095` : this.$store.state.content.site.domainName) + `#/article?articleId=${this.form.id}&siteId=${this.form.siteId}&id=${this.form.columnId}`) window.open((Setting.isDev ? `http://${location.hostname}:8095` : this.$store.state.content.site.domainName) + `#/article?articleId=${this.form.id}&siteId=${this.form.siteId}&id=${this.form.columnId}`)
}, },
backPage () {
this.$router.push(this.$store.state.referrer || '/parnerOperation')
},
// //
back () { back () {
this.pass = true this.pass = true
// //
if (this.updateTime) { if (this.updateTime) {
this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', { this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', {
type: 'warning', type: 'warning'
closeOnClickModal: false
}).then(() => { }).then(() => {
this.submit(this.form.isRelease) this.submit(this.form.isRelease)
}).catch(() => { }).catch(() => {
this.backPage() this.$router.back()
}) })
} else { } else {
this.backPage() this.$router.back()
} }
}, },
// //
submit (isRelease, next) { submit (isRelease, next) {
if (this.submiting) return false if (this.submiting) return false
const form = JSON.parse(JSON.stringify(this.form)) const form = JSON.parse(JSON.stringify(this.form))
console.log('form=>', form)
if (!form.title) return Util.errorMsg('请填写标题') if (!form.title) return Util.errorMsg('请填写标题')
if (this.nameRepeat) return Util.errorMsg('该标题已重复!') if (this.nameRepeat) return Util.errorMsg('该标题已重复!')
// //
@ -704,7 +739,7 @@ export default {
delete form.children delete form.children
this.$post(this.api.updateParnerArticle, form).then(res => { this.$post(this.api.updateParnerArticle, form).then(res => {
Util.successMsg('修改成功') Util.successMsg('修改成功')
next ? next() : this.backPage() next ? next() : this.$router.back()
}).catch(err => { }).catch(err => {
this.submiting = false this.submiting = false
}) })

@ -0,0 +1,221 @@
<template>
<div class="page">
<div class="tool">
<div class="search-wrap">
<el-select v-model="field" @change="initData">
<el-option
v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input class="keyword" :placeholder="'请输入' + keywords.find(e => e.id === field).name" v-model.trim="keyword" clearable></el-input>
</div>
<div class="actions">
<el-button v-auth="'/parnerOperation:方案管理:批量删除'" @click="batchDel">批量删除</el-button>
<el-button v-auth="'/parnerOperation:方案管理:新增文章'" type="primary" @click="add" >新增文章</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange">
<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 show-overflow-tooltip prop="title" label="标题" align="center" min-width="150"></el-table-column>
<el-table-column prop="classificationName" label="所属分类" align="center" min-width="120" sortable="custom"></el-table-column>
<el-table-column prop="founderName" label="录入人" align="center" min-width="80"></el-table-column>
<el-table-column prop="editorName" label="修改人" align="center" min-width="80"></el-table-column>
<el-table-column prop="updateTime" label="修改日期" align="center" min-width="150" sortable="custom"></el-table-column>
<el-table-column prop="createTime" label="发布日期" align="center" min-width="100" sortable="custom"></el-table-column>
<el-table-column prop="workNumber" label="状态" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="170">
<template slot-scope="scope">
<el-button v-auth="'/parnerOperation:方案管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/parnerOperation:方案管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-switch
v-auth="'/parnerOperation:方案管理:禁用'"
v-if="scope.row.isRelease"
class="m-l-10"
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row, scope.$index)">
</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="total"></el-pagination>
</div>
</div>
</template>
<script>
import util from '@/libs/util'
export default {
data() {
return {
field: 'title',
keywords: [
{
id: 'title',
name: '标题'
},
{
id: 'founder',
name: '录入人'
},
{
id: 'editor',
name: '修改人'
}
],
keyword: '',
list: [],
page: 1,
pageSize: 10,
total: 0,
modifiedTimeSort: '',
releaseDateSort: 'desc',
classificationNameSort: '',
editTimeSort: '',
multipleSelection: [],
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted() {
this.getData()
},
methods: {
//
getData() {
const { keyword } = this
const data = {
pageNum: this.page,
pageSize: this.pageSize,
querySource: 3, //(3. 4.)
classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort,
createTimeSort: this.releaseDateSort,
title: this.field === 'title' ? keyword : '',
founderName: this.field === 'founder' ? keyword : '',
editorName: this.field === 'editor' ? keyword : ''
}
this.$post(this.api.schemeList, data).then(({ data }) => {
this.list = data.records
this.total = +data.total
}).catch(err => {})
},
currentChange(val) {
this.page = val
this.getData()
},
handleSelectionChange(val) {
this.multipleSelection = val
},
initData() {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
//
batchDel() {
const list = this.multipleSelection
if (list.length) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
const data = []
list.map(e => {
data.push('ids=' + e.id)
})
this.$post(`${this.api.batchDeletionScheme}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection()
util.successMsg("删除成功")
this.getData()
}).catch(res => {})
}).catch(() => {})
} else {
util.errorMsg('请先选择数据 !')
}
},
//
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.batchDeletionScheme}?ids=${row.id}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
},
//
switchOff(val, row) {
this.$post(`${this.api.enableOrDisableScheme}?id=${row.id}&isDisable=${val}`).then(res => {}).catch((res) => {})
},
//
add() {
this.$router.push(`/schemeSet`)
},
//
sortChange(column) {
const { order } = column
// 1
if (column.prop === 'classificationName') {
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.sequenceSort = ''
}
}
if (column.prop === 'updateTime') {
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.classificationNameSort = ''
this.releaseDateSort = ''
this.sequenceSort = ''
}
}
if (column.prop === 'createTime') {
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.classificationNameSort = ''
this.sequenceSort = ''
}
}
if (column.prop === 'sequence') {
this.sequenceSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.classificationNameSort = ''
}
}
this.getData()
},
//
edit(row) {
this.$router.push(`/schemeSet?id=${row.id}`)
},
}
};
</script>
<style lang="scss" scoped>
.m-l-10 {
margin-left: 10px;
}
</style>

@ -0,0 +1,269 @@
<template>
<div class="page">
<div class="tool">
<div class="search-wrap">
<el-select v-model="field" @change="initData">
<el-option
v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input class="keyword" :placeholder="'请输入' + keywords.find(e => e.id === field).name" v-model.trim="keyword" clearable></el-input>
</div>
<div class="actions">
<el-button v-auth="'/parnerOperation:合伙人资讯管理:批量删除'" @click="batchDel">批量删除</el-button>
<el-button v-auth="'/parnerOperation:合伙人资讯管理:新增文章'" type="primary" @click="add" >新增文章</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange">
<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 show-overflow-tooltip prop="title" label="标题" align="center" min-width="150"></el-table-column>
<el-table-column prop="classificationName" label="所属分类" align="center" min-width="120" sortable="custom"></el-table-column>
<el-table-column prop="founderName" label="录入人" align="center" min-width="80"></el-table-column>
<el-table-column prop="editorName" label="修改人" align="center" min-width="80"></el-table-column>
<el-table-column prop="updateTime" label="修改日期" align="center" min-width="150" sortable="custom"></el-table-column>
<el-table-column prop="releaseTime" label="发布日期" align="center" min-width="100" sortable="custom"></el-table-column>
<el-table-column prop="learnerNumber" label="总浏览" align="center" min-width="70"></el-table-column>
<el-table-column prop="workNumber" label="状态" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column prop="sequence" label="置顶" align="center" min-width="80" sortable="custom">
<template slot-scope="scope">
<i v-if="scope.row.isRelease" :class="['squ-icon', scope.row.isTop ? 'el-icon-check' : 'el-icon-close']" @click="sticky(scope.row)"></i>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="210">
<template slot-scope="scope">
<el-button v-auth="'/parnerOperation:合伙人资讯管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/parnerOperation:合伙人资讯管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-switch
v-auth="'/parnerOperation:合伙人资讯管理:禁用'"
v-if="scope.row.isRelease"
class="m-l-10"
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row, scope.$index)">
</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="total"></el-pagination>
</div>
</div>
</template>
<script>
import Setting from '@/setting'
import util from '@/libs/util'
import { mapMutations } from 'vuex'
export default {
data() {
return {
field: 'title',
keywords: [
{
id: 'title',
name: '标题'
},
{
id: 'founder',
name: '录入人'
},
{
id: 'editor',
name: '修改人'
}
],
keyword: '',
list: [],
page: 1,
pageSize: 10,
total: 0,
topSort: '',
classificationNameSort: '',
releaseDateSort: '',
editTimeSort: '',
multipleSelection: [],
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted() {
this.getData()
},
methods: {
//
getData() {
const { keyword } = this
this.$post(this.api.partnerOperatingList, {
pageNum: this.page,
pageSize: this.pageSize,
querySource: 3, //(3. 4.)
topSort: this.topSort,
classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort,
releaseDateSort: this.releaseDateSort,
typeId: 2, // (1.2.)
title: this.field === 'title' ? keyword : '',
founderName: this.field === 'founder' ? keyword : '',
editorName: this.field === 'editor' ? keyword : ''
}).then(({ page, total }) => {
page.forEach(e => {
e.editing = false
})
this.list = page
this.total = total
}).catch(err => {})
},
currentChange(val) {
this.page = val
this.getData()
},
handleSelectionChange(val) {
this.multipleSelection = val
},
initData() {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
//
batchDel() {
const list = this.multipleSelection
if (list.length) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
const data = []
list.map(e => {
data.push('ids=' + e.id)
})
this.$post(`${this.api.batchDeletionParnerArticle}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection()
util.successMsg("删除成功")
this.getData()
}).catch(res => {})
}).catch(() => {})
} else {
util.errorMsg('请先选择数据 !')
}
},
//
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.batchDeletionParnerArticle}?ids=${row.id}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
},
//
switchOff(val, row) {
this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => {}).catch((res) => {})
},
//
add() {
this.$router.push(`/learnMg?type=2`)
},
//
sortChange(column) {
const { order } = column
// 1
if (column.prop === 'classificationName') {
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.topSort = ''
}
}
if (column.prop === 'updateTime') {
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.classificationNameSort = ''
this.releaseDateSort = ''
this.topSort = ''
}
}
if (column.prop === 'releaseTime') {
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.classificationNameSort = ''
this.topSort = ''
}
}
if (column.prop === 'sequence') {
this.topSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.classificationNameSort = ''
}
}
this.getData()
},
//
submitSequence(row) {
if (!row.sequence) return Util.errorMsg('请输入排序')
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=${row.sequence}`).then(res => {
this.initData()
}).catch(res => {})
},
//
editSequence(row) {
this.list.forEach(e => {
e.editing = false
})
row.editing = true
},
//
sticky(row) {
this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => {
this.initData()
}).catch(res => {})
},
//
edit(row) {
this.$router.push(`/learnMg?id=${row.id}&type=2`)
},
}
};
</script>
<style lang="scss" scoped>
.m-l-10 {
margin-left: 10px;
}
.squ-icon {
font-size: 16px;
font-weight: 600;
cursor: pointer;
color: #f70000;
&.el-icon-check {
color: #05991e;
}
}
/deep/.squ-input {
width: auto;
.el-input__inner {
width: 60px;
padding: 0 10px;
}
}
</style>

@ -1,279 +0,0 @@
<template>
<div class="page">
<div class="tool">
<div class="search-wrap">
<el-select v-model="field"
@change="initData">
<el-option v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input class="keyword"
:placeholder="'请输入' + keywords.find(e => e.id === field).name"
v-model.trim="keyword"
clearable></el-input>
</div>
<div class="actions">
<el-button v-auth="'/parnerOperation:方案管理:批量删除'"
@click="batchDel">批量删除</el-button>
<el-button v-auth="'/parnerOperation:方案管理:新增文章'"
type="primary"
@click="add">新增文章</el-button>
</div>
</div>
<el-table :data="list"
class="table"
ref="table"
header-align="center"
@selection-change="handleSelectionChange"
row-key="id"
@sort-change="sortChange">
<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 show-overflow-tooltip
prop="title"
label="标题"
align="center"
min-width="150"></el-table-column>
<el-table-column prop="classificationName"
label="所属分类"
align="center"
min-width="120"
sortable="custom"></el-table-column>
<el-table-column prop="founderName"
label="录入人"
align="center"
min-width="80"></el-table-column>
<el-table-column prop="editorName"
label="修改人"
align="center"
min-width="80"></el-table-column>
<el-table-column prop="updateTime"
label="修改日期"
align="center"
min-width="150"
sortable="custom"></el-table-column>
<el-table-column prop="createTime"
label="发布日期"
align="center"
min-width="100"
sortable="custom"></el-table-column>
<el-table-column prop="workNumber"
label="状态"
align="center"
min-width="80">
<template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="170">
<template slot-scope="scope">
<el-button v-auth="'/parnerOperation:方案管理:编辑'"
type="text"
@click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/parnerOperation:方案管理:删除'"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
<el-switch v-auth="'/parnerOperation:方案管理:禁用'"
v-if="scope.row.isRelease"
class="m-l-10"
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row, scope.$index)">
</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="total"></el-pagination>
</div>
</div>
</template>
<script>
import util from '@/libs/util'
export default {
data () {
return {
field: this.$route.query.field || 'title',
keywords: [
{
id: 'title',
name: '标题'
},
{
id: 'founder',
name: '录入人'
},
{
id: 'editor',
name: '修改人'
}
],
keyword: this.$route.query.keyword || '',
list: [],
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
modifiedTimeSort: '',
releaseDateSort: 'desc',
classificationNameSort: '',
editTimeSort: '',
multipleSelection: [],
};
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted () {
this.getData()
},
methods: {
//
getData () {
const { keyword } = this
const data = {
pageNum: this.page,
pageSize: this.pageSize,
querySource: 3, //(3. 4.)
classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort,
createTimeSort: this.releaseDateSort,
title: this.field === 'title' ? keyword : '',
founderName: this.field === 'founder' ? keyword : '',
editorName: this.field === 'editor' ? keyword : ''
}
this.$post(this.api.schemeList, data).then(({ data }) => {
this.list = data.records
this.total = +data.total
}).catch(err => { })
},
currentChange (val) {
this.page = val
this.getData()
},
handleSelectionChange (val) {
this.multipleSelection = val
},
initData () {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
//
batchDel () {
const list = this.multipleSelection
if (list.length) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
const data = []
list.map(e => {
data.push('ids=' + e.id)
})
this.$post(`${this.api.batchDeletionScheme}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection()
util.successMsg("删除成功")
this.getData()
}).catch(res => { })
}).catch(() => { })
} else {
util.errorMsg('请先选择数据 !')
}
},
//
handleDelete (row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.batchDeletionScheme}?ids=${row.id}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => { })
}).catch(() => { })
},
//
switchOff (val, row) {
this.$post(`${this.api.enableOrDisableScheme}?id=${row.id}&isDisable=${val}`).then(res => { }).catch((res) => { })
},
//
sortChange (column) {
const { order } = column
// 1
if (column.prop === 'classificationName') {
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.sequenceSort = ''
}
}
if (column.prop === 'updateTime') {
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.classificationNameSort = ''
this.releaseDateSort = ''
this.sequenceSort = ''
}
}
if (column.prop === 'createTime') {
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.classificationNameSort = ''
this.sequenceSort = ''
}
}
if (column.prop === 'sequence') {
this.sequenceSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.classificationNameSort = ''
}
}
this.getData()
},
// url
setReferrer () {
this.$store.commit('setReferrer', `${this.$route.fullPath}&keyword=${this.keyword}&field=${this.field}&page=${this.page}`)
},
//
add () {
this.setReferrer()
this.$router.push(`/schemeSet`)
},
//
edit (row) {
this.setReferrer()
this.$router.push(`/schemeSet?id=${row.id}`)
},
}
};
</script>
<style lang="scss" scoped>
.m-l-10 {
margin-left: 10px;
}
</style>

@ -77,10 +77,15 @@
</el-form-item> </el-form-item>
<el-form-item prop="schemeFile" <el-form-item prop="schemeFile"
label="方案文件"> label="方案文件">
<Upload :max-size="100000" <el-upload :before-upload="fileBeforeUpload"
:file-list.sync="fileList" :on-success="uploadSuccessFile"
:on-remove="handleRemove" :action="this.api.fileUploadNakadai"
@onSuccess="uploadSuccessFile" /> :file-list="fileList"
:limit="1"
:on-exceed="handleExceed"
:headers="headers">
<el-button>上传</el-button>
</el-upload>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="btns"> <div class="btns">
@ -259,8 +264,6 @@ import Util from '@/libs/util'
import Editor from '@tinymce/tinymce-vue' import Editor from '@tinymce/tinymce-vue'
import editorConfig from '@/utils/editor' import editorConfig from '@/utils/editor'
import Cropper from '@/components/img-upload/Cropper' import Cropper from '@/components/img-upload/Cropper'
import Upload from '@/components/upload';
import Oss from '@/components/upload/upload.js'
import Axios from 'axios' import Axios from 'axios'
export default { export default {
data () { data () {
@ -329,8 +332,7 @@ export default {
}, },
components: { components: {
Editor, Editor,
Cropper, Cropper
Upload
}, },
watch: { watch: {
// , // ,
@ -355,8 +357,7 @@ export default {
// //
if (this.updateTime) { if (this.updateTime) {
this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', { this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', {
type: 'warning', type: 'warning'
closeOnClickModal: false
}).then(() => { }).then(() => {
this.submit(this.form.isRelease, next) this.submit(this.form.isRelease, next)
}).catch(() => { }).catch(() => {
@ -403,8 +404,6 @@ export default {
}, },
// //
addClass () { addClass () {
this.classifications.find(e => e.edit) ?
Util.errorMsg('请先保存分类!') :
this.classifications.push({ this.classifications.push({
edit: true, edit: true,
id: '', id: '',
@ -413,8 +412,6 @@ export default {
}, },
// //
editClass (row) { editClass (row) {
this.classifications.find(e => e.edit) ?
Util.errorMsg('请先保存分类!') :
this.$set(row, 'edit', 1) this.$set(row, 'edit', 1)
}, },
// //
@ -451,8 +448,7 @@ export default {
const list = this.classifications const list = this.classifications
if (list.find(e => e.edit && e.classificationName)) { if (list.find(e => e.edit && e.classificationName)) {
this.$confirm('所填写内容暂未保存,是否保存?', '提示', { this.$confirm('所填写内容暂未保存,是否保存?', '提示', {
type: 'warning', type: 'warning'
closeOnClickModal: false
}).then(() => { }).then(() => {
list.map(e => { list.map(e => {
e.edit && e.classificationName && this.submitClass(e, 0) e.edit && e.classificationName && this.submitClass(e, 0)
@ -519,7 +515,7 @@ export default {
}, },
handleCurrentChange (val) { handleCurrentChange (val) {
this.page = val; this.page = val;
this.getProduct(); this.getData();
}, },
handleSelectionChange (val) { handleSelectionChange (val) {
console.log("🚀 ~ file: schemeSet.vue:516 ~ handleSelectionChange ~ val:", val) console.log("🚀 ~ file: schemeSet.vue:516 ~ handleSelectionChange ~ val:", val)
@ -533,6 +529,7 @@ export default {
}).then(() => { }).then(() => {
this.checkeds.splice(i, 1) this.checkeds.splice(i, 1)
}).catch(() => { }) }).catch(() => { })
}, },
// //
productSubmit () { productSubmit () {
@ -556,17 +553,10 @@ export default {
fileBeforeUpload (file) { fileBeforeUpload (file) {
this.uploading++ this.uploading++
}, },
//
handleRemove () {
Oss.del(this.form.schemeFile)
this.fileList = []
this.form.fileName = ''
this.form.schemeFile = ''
},
// //
uploadSuccessFile (file) { uploadSuccessFile ({ filesResult }) {
this.form.fileName = file.name this.form.fileName = filesResult.originalFileName
this.form.schemeFile = file.url this.form.schemeFile = filesResult.fileUrl
}, },
// //
handleExceed (files, fileList) { handleExceed (files, fileList) {
@ -574,24 +564,20 @@ export default {
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
) )
}, },
backPage () {
this.$router.push(this.$store.state.referrer || '/parnerOperation?type=plan')
},
// //
back () { back () {
this.pass = true this.pass = true
// //
if (this.updateTime) { if (this.updateTime) {
this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', { this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', {
type: 'warning', type: 'warning'
closeOnClickModal: false
}).then(() => { }).then(() => {
this.submit(this.form.isRelease) this.submit(this.form.isRelease)
}).catch(() => { }).catch(() => {
this.backPage() this.$router.back()
}) })
} else { } else {
this.backPage() this.$router.back()
} }
}, },
// //
@ -625,7 +611,7 @@ export default {
if (form.id) { if (form.id) {
this.$post(this.api.updateScheme, form).then(res => { this.$post(this.api.updateScheme, form).then(res => {
Util.successMsg('修改成功') Util.successMsg('修改成功')
next ? next() : this.backPage() next ? next() : this.$router.back()
}).catch(err => { }).catch(err => {
this.submiting = false this.submiting = false
}) })

@ -0,0 +1,268 @@
<template>
<div class="page">
<div class="tool">
<div class="search-wrap">
<el-select v-model="field" @change="initData">
<el-option
v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
<el-input class="keyword" :placeholder="'请输入' + keywords.find(e => e.id === field).name" v-model.trim="keyword" clearable></el-input>
</div>
<div class="actions">
<el-button v-auth="'/parnerOperation:合伙人学习管理:批量删除'" @click="batchDel">批量删除</el-button>
<el-button v-auth="'/parnerOperation:合伙人学习管理:新增文章'" type="primary" @click="add" >新增文章</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange">
<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 show-overflow-tooltip prop="title" label="标题" align="center" min-width="150"></el-table-column>
<el-table-column prop="classificationName" label="所属分类" align="center" min-width="120" sortable="custom"></el-table-column>
<el-table-column prop="founderName" label="录入人" align="center" min-width="80"></el-table-column>
<el-table-column prop="editorName" label="修改人" align="center" min-width="80"></el-table-column>
<el-table-column prop="updateTime" label="修改日期" align="center" min-width="150" sortable="custom"></el-table-column>
<el-table-column prop="releaseTime" label="发布日期" align="center" min-width="100" sortable="custom"></el-table-column>
<el-table-column prop="learnerNumber" label="已学习人数" align="center" min-width="70"></el-table-column>
<el-table-column prop="workNumber" label="状态" align="center" min-width="80">
<template slot-scope="scope">
{{ scope.row.isRelease ? '已发布' : '草稿' }}
</template>
</el-table-column>
<el-table-column prop="sequence" label="置顶" align="center" min-width="80" sortable="custom">
<template slot-scope="scope">
<i v-if="scope.row.isRelease" :class="['squ-icon', scope.row.isTop ? 'el-icon-check' : 'el-icon-close']" @click="sticky(scope.row)"></i>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="210">
<template slot-scope="scope">
<el-button v-auth="'/parnerOperation:合伙人学习管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/parnerOperation:合伙人学习管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-switch
v-auth="'/parnerOperation:合伙人学习管理:禁用'"
v-if="scope.row.isRelease"
class="m-l-10"
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row, scope.$index)">
</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="total"></el-pagination>
</div>
</div>
</template>
<script>
import Setting from '@/setting'
import util from '@/libs/util'
export default {
data() {
return {
field: 'title',
keywords: [
{
id: 'title',
name: '标题'
},
{
id: 'founder',
name: '录入人'
},
{
id: 'editor',
name: '修改人'
}
],
keyword: '',
list: [],
page: 1,
pageSize: 10,
total: 0,
topSort: '',
classificationNameSort: '',
releaseDateSort: '',
editTimeSort: '',
multipleSelection: [],
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted() {
this.getData()
},
methods: {
//
getData() {
const { keyword } = this
this.$post(this.api.partnerOperatingList, {
pageNum: this.page,
pageSize: this.pageSize,
querySource: 3, //(3. 4.)
topSort: this.topSort,
classificationNameSort: this.classificationNameSort,
editTimeSort: this.editTimeSort,
releaseDateSort: this.releaseDateSort,
typeId: 1, // (1.2.)
title: this.field === 'title' ? keyword : '',
founderName: this.field === 'founder' ? keyword : '',
editorName: this.field === 'editor' ? keyword : ''
}).then(({ page, total }) => {
page.forEach(e => {
e.editing = false
})
this.list = page
this.total = total
}).catch(err => {})
},
currentChange(val) {
this.page = val
this.getData()
},
handleSelectionChange(val) {
this.multipleSelection = val
},
initData() {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
//
batchDel() {
const list = this.multipleSelection
if (list.length) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
const data = []
list.map(e => {
data.push('ids=' + e.id)
})
this.$post(`${this.api.batchDeletionParnerArticle}?${data.join('&')}`).then(res => {
this.$refs.table.clearSelection()
util.successMsg("删除成功")
this.getData()
}).catch(res => {})
}).catch(() => {})
} else {
util.errorMsg('请先选择数据 !')
}
},
//
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(`${this.api.batchDeletionParnerArticle}?ids=${row.id}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
},
//
switchOff(val, row) {
this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => {}).catch((res) => {})
},
//
add() {
this.$router.push(`/learnMg?type=1`)
},
//
sortChange(column) {
const { order } = column
// 1
if (column.prop === 'classificationName') {
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.topSort = ''
}
}
if (column.prop === 'updateTime') {
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.classificationNameSort = ''
this.releaseDateSort = ''
this.topSort = ''
}
}
if (column.prop === 'releaseTime') {
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.classificationNameSort = ''
this.topSort = ''
}
}
if (column.prop === 'sequence') {
this.topSort = order ? order === 'ascending' ? 'asc' : 'desc' : ''
if (order) {
this.editTimeSort = ''
this.releaseDateSort = ''
this.classificationNameSort = ''
}
}
this.getData()
},
//
submitSequence(row) {
if (!row.sequence) return Util.errorMsg('请输入排序')
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=${row.sequence}`).then(res => {
this.initData()
}).catch(res => {})
},
//
editSequence(row) {
this.list.forEach(e => {
e.editing = false
})
row.editing = true
},
//
sticky(row) {
this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => {
this.initData()
}).catch(res => {})
},
//
edit(row) {
this.$router.push(`/learnMg?id=${row.id}&type=1`)
},
}
};
</script>
<style lang="scss" scoped>
.m-l-10 {
margin-left: 10px;
}
.squ-icon {
font-size: 16px;
font-weight: 600;
cursor: pointer;
color: #f70000;
&.el-icon-check {
color: #05991e;
}
}
/deep/.squ-input {
width: auto;
.el-input__inner {
width: 60px;
padding: 0 10px;
}
}
</style>

@ -1,50 +0,0 @@
<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>

@ -11,23 +11,27 @@
<div> <div>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="系统归属"> <el-form-item label="系统归属">
<el-select v-model="form.belong" clearable placeholder="请选择系统归属" @change="initData"> <el-select v-model="systemAttribution" clearable placeholder="请选择系统归属"
<el-option v-for="(item, i) in belongs" :key="i" :label="item" :value="i"></el-option> @change="initData">
<el-option v-for="(item,index) in systemBelongList" :key="index"
:label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="系统类型"> <el-form-item label="系统类型">
<el-select v-model="form.type" clearable placeholder="请选择系统类型" @change="initData"> <el-select v-model="systemType" clearable placeholder="请选择系统类型"
<el-option v-for="(item, i) in types" :key="i" :label="item" :value="i"></el-option> @change="initData">
<el-option v-for="(item,index) in systemTypeList" :key="index"
:label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</div> </div>
<el-col :span="6"> <el-col :span="6">
<el-form-item> <el-form-item>
<el-input placeholder="请输入系统名称" prefix-icon="el-icon-search" v-model.trim="form.systemName" <el-input placeholder="请输入系统名称" prefix-icon="el-icon-search"
clearable></el-input> v-model.trim="systemSearch" clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
@ -40,32 +44,30 @@
<p class="hr_tag"></p> <p class="hr_tag"></p>
<span>服务列表</span> <span>服务列表</span>
</div> </div>
<el-table :data="list" class="table" stripe header-align="center"> <el-table :data="systemData" class="table" stripe header-align="center">
<!-- <el-table-column type="selection" width="55" align="center"></el-table-column> --> <!-- <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>
<el-table-column prop="systemName" 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="type" label="系统类型" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ types[scope.row.type] }} {{ systemTypeKeys[scope.row.type] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="supplierName" label="供应商" align="center"></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="belong" label="系统归属" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ belongs[scope.row.belong] }} {{ systemBelongKeys[scope.row.belong] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="state" label="系统状态" align="center"> <el-table-column prop="state" label="系统状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ states[scope.row.state] }} {{ systemStatusKeys[scope.row.state] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="payamount" label="系统后台" align="center"> <el-table-column prop="payamount" label="系统后台" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="toBackstage(scope.row)" <el-button type="text" @click="toBackstage(scope.row)" v-if="scope.row.systemId !== '11'" v-auth="'/configure:系统后台进入'">进入</el-button>
v-if="scope.row.systemId !== '11' && scope.row.systemId !== '12'"
v-auth="'/configure:系统后台进入'">进入</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="payamount" label="项目系统" align="center"> <el-table-column prop="payamount" label="项目系统" align="center">
@ -80,8 +82,8 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background @current-change="handleCurrentChange" layout="total, prev, pager, next" <el-pagination background @current-change="handleCurrentChange"
:current-page="page" :total="total"> layout="total, prev, pager, next" :total="totals">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
@ -90,32 +92,55 @@
<script> <script>
import Setting from "@/setting"; import Setting from "@/setting";
import qs from 'qs'
export default { export default {
data() { data() {
return { return {
userId: this.$store.state.userLoginId, userId: this.$store.state.userLoginId,
token: btoa(sessionStorage.getItem('token')), token: btoa(sessionStorage.getItem('token')),
form: { systemAttribution: "",
belong: this.$route.query.belong || '', systemType: "",
type: this.$route.query.type ? +this.$route.query.type : '', systemSearch: "",
systemName: this.$route.query.systemName || ''
},
searchTimer: null, searchTimer: null,
list: [], systemData: [],
total: 0, totals: 0,
belongs: { systemBelongList: [
{
label: "外部产品",
value: 1
},
{
label: "内部系统",
value: 0
}
],
systemBelongKeys: {
1: '外部产品', 1: '外部产品',
0: '内部系统' 0: '内部系统'
}, },
types: ['编程类', '流程类', 'AI类'], systemTypeList: [
states: ['运行中', '默认'], {
page: +this.$route.query.page || 1, label: "编程类",
value: 0
},
{
label: "流程类",
value: 1
}
],
systemTypeKeys: {
0: '编程类',
1: '流程类'
},
systemStatusKeys: {
0: '运行中',
1: '默认'
},
pageNo: +this.$route.query.page || 1,
pageSize: 10 pageSize: 10
}; };
}, },
watch: { watch: {
'form.systemName': function (val) { systemSearch: function(val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData(); this.initData();
@ -123,58 +148,58 @@ export default {
} }
}, },
mounted() { mounted() {
const { query } = this.$route
if (query.page) {
this.$router.push('/configure').catch(() => { })
}
this.getData(); this.getData();
}, },
methods: { methods: {
initData() { initData() {
this.page = 1; this.pageNum = 1;
this.getData(); this.getData();
}, },
getData() { getData() {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '服务配置') const sid = this.$store.state.dataPer.find(e => e.permissionName === '服务配置')
let data = { let data = {
...this.form, belong: this.systemAttribution,
pageNum: this.page, type: this.systemType,
systemName: this.systemSearch,
pageNum: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
supplierId: sid ? sid.supplierId : '' supplierId: sid ? sid.supplierId : ''
}; };
this.$post(this.api.queryServiceConfig, data).then(res => { this.$post(this.api.queryServiceConfig, data).then(res => {
this.list = res.serviceList.records; this.systemData = res.serviceList.records;
this.total = res.serviceList.total; this.totals = res.serviceList.total;
}).catch(res => { }).catch(res => {
}); });
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val; this.pageNo = val;
this.$router.push(`configure?page=${val}`) this.$router.push(`configure?page=${val}`)
this.getData(); this.getData();
}, },
// url edit(row) {
setReferrer () { this.$store.commit("configData", { config_id: row.systemId });
this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`) this.$router.push("/addconfigure");
}, },
// //
toBackstage(row) { toBackstage(row) {
this.setReferrer()
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}`) this.$router.push(`/backstage?systemId=${row.systemId}&show=1&name=${row.systemName}`)
}
}, },
getIntoProject(row) { getIntoProject(row) {
this.setReferrer()
this.$router.push(`/projectList?systemId=${row.systemId}&show=1&name=${row.systemName}`) this.$router.push(`/projectList?systemId=${row.systemId}&show=1&name=${row.systemName}`)
}, },
getIntoJudgement(row) { getIntoJudgement(row) {
this.setReferrer() // console.log(`${Setting.jumpPath}#/?systemId=${row.systemId}&token=${this.token}&referrer=${btoa(location.href)}`);
location.href = `${Setting.jumpPath}#/?systemId=${row.systemId}&token=${this.token}&referrer=${btoa(location.href)}`; location.href = `${Setting.jumpPath}#/?systemId=${row.systemId}&token=${this.token}&referrer=${btoa(location.href)}`;
}, },
setCookie(name, value) {
if (value) {
var days = 1;//
var exp = new Date();
exp.setTime(exp.getTime() + days * 24 * 60 * 60 * 1000);
//Cookie,toGMTString
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString + ";path=/;";
}
}
} }
}; };
</script> </script>
@ -183,8 +208,8 @@ export default {
.card { .card {
min-height: calc(100vh - 300px); min-height: calc(100vh - 300px);
} }
.mag { .mag {
margin-right: 20px; margin-right: 20px;
} }
</style> </style>

@ -194,8 +194,7 @@ export default {
// //
if ((id && updateTime > 1) || (!id && updateTime)) { if ((id && updateTime > 1) || (!id && updateTime)) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning', type: 'warning'
closeOnClickModal: false
}).then(() => { }).then(() => {
this.submit(this.postStatus ? 1 : 0, 1) this.submit(this.postStatus ? 1 : 0, 1)
this.backPage() this.backPage()

@ -57,7 +57,7 @@ export default {
}) })
}, },
back () { back () {
this.$router.push(this.$store.state.referrer || '/configure') this.$router.push('/configure')
} }
} }
}; };

@ -106,6 +106,7 @@
</template> </template>
<script> <script>
import org from "./modelType" import org from "./modelType"
import Setting from '@/setting'
import Bus from '@/libs/bus' import Bus from '@/libs/bus'
export default { export default {
data () { data () {
@ -113,7 +114,7 @@ export default {
systemId: this.$route.query.systemId, systemId: this.$route.query.systemId,
isTopLevel: true, // isTopLevel: true, //
listData: [], listData: [],
keyword: this.$route.query.keyword || '', keyword: '',
page: +this.$route.query.page || 1, page: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
@ -131,13 +132,6 @@ export default {
keyword: function (val) { keyword: function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
keyword: val
}
})
this.initData() this.initData()
}, 500) }, 500)
} }

@ -144,7 +144,7 @@ export default {
systemId: this.$route.query.systemId, systemId: this.$route.query.systemId,
isTopLevel: true, // isTopLevel: true, //
listData: [], listData: [],
keyword: this.$route.query.keyword || '', keyword: "",
page: +this.$route.query.page || 1, page: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
@ -169,13 +169,6 @@ export default {
keyword: function (val) { keyword: function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.$router.push({
path: 'backstage',
query: {
...this.$route.query,
keyword: val
}
})
this.initData() this.initData()
}, 500) }, 500)
} }

@ -1,15 +1,14 @@
<template> <template>
<div ref="main" class="main" v-loading="loading"> <div ref="main" class="main">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="mgb20">
<div class="flex-between"> <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"> <div v-if="!isDetail">
<el-button type="success" :loading="submiting === 0" <el-button type="success" @click="handleSubmit(0,projectManage.isOpen=1,projectManage.ztOpen = 1)">保存为草稿
@click="handleSubmit(0, projectManage.isOpen = 1, projectManage.ztOpen = 1)">保存为草稿
</el-button> </el-button>
<el-button type="primary" :loading="submiting === 1" @click="handleSubmit(1)">确定并发布</el-button> <el-button type="primary" @click="handleSubmit(1)">确定并发布</el-button>
</div> </div>
</div> </div>
</el-card> </el-card>
@ -25,15 +24,15 @@
<el-form label-width="80px"> <el-form label-width="80px">
<div style="display: flex"> <div style="display: flex">
<el-form-item label="项目名称"> <el-form-item label="项目名称">
<el-input :disabled="isDetail" v-model.trim="projectManage.projectName" placeholder="20个字符以内" <el-input :disabled="isDetail" v-model.trim="projectManage.projectName"
@blur="projectNameExistis"></el-input> placeholder="20个字符以内" @blur="projectNameExistis"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注"> <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>
<el-form-item label="项目用途"> <el-form-item label="项目权限">
<el-select :disabled="isDetail" v-model="projectManage.permissions" placeholder="请选择" <el-select :disabled="isDetail" v-model="projectManage.permissions"
@change="permissionChange"> placeholder="请选择" @change="permissionChange">
<el-option label="练习" :value="0"></el-option> <el-option label="练习" :value="0"></el-option>
<el-option label="考核" :value="1"></el-option> <el-option label="考核" :value="1"></el-option>
<el-option label="竞赛" :value="2"></el-option> <el-option label="竞赛" :value="2"></el-option>
@ -54,7 +53,7 @@
<el-form label-width="0"> <el-form label-width="0">
<el-form-item> <el-form-item>
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentTarget" <quill :border="true" :readonly="isDetail" v-model="projectManage.experimentTarget"
:type.sync="projectManage.experimentTargetType" radio :minHeight="150" :height="150" /> :minHeight="150" :height="150" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -70,8 +69,7 @@
<el-form label-width="0"> <el-form label-width="0">
<el-form-item> <el-form-item>
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentDescription" <quill :border="true" :readonly="isDetail" v-model="projectManage.experimentDescription"
:type.sync="projectManage.experimentDescriptionType" radio :minHeight="150" :height="150" :minHeight="150" :height="150" />
:index="1" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -106,43 +104,48 @@
<span>(待分配分值: {{ handDistributionScore }}/100)</span> <span>(待分配分值: {{ handDistributionScore }}/100)</span>
</div> </div>
</div> </div>
<el-button :disabled="isDetail" type="primary" icon="el-icon-plus" round @click="handleAddJudgment" <el-button :disabled="isDetail" type="primary" icon="el-icon-plus" round
style="margin-bottom: 10px">判分点 @click="handleAddJudgment" style="margin-bottom: 10px">判分点
</el-button> </el-button>
<el-button :disabled="isDetail" type="primary" icon="el-icon-delete" round @click="batchDeleteProjectJudgment" <el-button :disabled="isDetail" type="primary" icon="el-icon-delete" round
style="margin-bottom: 10px">批量删除 @click="batchDeleteProjectJudgment" style="margin-bottom: 10px">批量删除
</el-button> </el-button>
<div class="draggable"> <div class="draggable">
<el-table ref="projectJudgementTable" :data="projectJudgmentData" class="table" stripe header-align="center" <el-table
:use-virtual="isLc" :max-height="600" :row-height="60" :border="false" ref="projectJudgementTable"
@selection-change="handleSelectionProjectJudgment" row-key="judgmentId" v-loading="listLoading"> :data="projectJudgmentData"
class="table"
stripe
header-align="center"
@selection-change="handleSelectionProjectJudgment"
row-key="judgmentId"
v-loading="listLoading"
>
<el-table-column type="selection" width="55" align="center"></el-table-column> <el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column prop="sort" label="序号" width="80" align="center"> <el-table-column prop="sort" label="序号" width="80" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.sort }} {{ scope.row.sort }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="判分指标" align="center" show-overflow-tooltip <el-table-column prop="name" label="判分指标" align="center"></el-table-column>
min-width="140"></el-table-column> <el-table-column prop="name" label="判分点名称" align="center"></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"> <el-table-column label="实验要求" align="center" width="600">
<template slot-scope="scope"> <template slot-scope="scope">
<quill :readonly="true" elseRead="true" v-model="scope.row.experimentalRequirements" :index="2" /> <quill :border="true" :readonly="true" elseRead="true"
v-model="scope.row.experimentalRequirements" :minHeight="100"
:height="100" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="score" label="分数" align="center" width="120"> <el-table-column prop="score" label="分数" align="center" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input :disabled="isDetail" :key="scope.$index" type="number" step="0.1" <!--type="number" @blur="updateProjectJudgment"-->
v-model.trim="scope.row.score"></el-input> <el-input :disabled="isDetail" v-model.trim="scope.row.score"
<!-- @input="scoreChange(scope.row, scope.$index,$event)"></el-input>
@input="scoreChange(scope.row, scope.$index)" -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="140" align="center"> <el-table-column label="操作" width="140" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button :disabled="isDetail" type="text" style="margin-right: 10px" <el-button :disabled="isDetail" type="text" style="margin-right: 10px" @click="toJudgePoint('edit', scope.row)">自定义</el-button>
@click="toJudgePoint('edit', scope.row)">自定义</el-button>
<el-button :disabled="isDetail" type="text" @click="delJudgePoint(scope.$index)"> <el-button :disabled="isDetail" type="text" @click="delJudgePoint(scope.$index)">
删除 删除
</el-button> </el-button>
@ -169,7 +172,7 @@
<el-form label-width="0"> <el-form label-width="0">
<el-form-item prop="tips" label=""> <el-form-item prop="tips" label="">
<quill :border="true" :readonly="isDetail" v-model="projectManage.experimentHint" <quill :border="true" :readonly="isDetail" v-model="projectManage.experimentHint"
:type.sync="projectManage.experimentHintType" radio :minHeight="150" :height="400" :index="3" /> :minHeight="150" :height="150" />
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
@ -178,18 +181,24 @@
</el-row> </el-row>
<!--选择判分点对话框--> <!--选择判分点对话框-->
<el-dialog title="添加判分点" :visible.sync="dialogVisible" width="40%" :close-on-click-modal="false" <el-dialog title="添加判分点" :visible.sync="dialogVisible" width="40%" :close-on-click-modal="false" @close="closeJudgment">
@close="closeJudgment">
<div class="text-right mgb10"> <div class="text-right mgb10">
<div> <div>
<el-input placeholder="请输入需要查找的判分点" prefix-icon="el-icon-search" v-model.trim="judgementpointsquery" <el-input placeholder="请输入需要查找的判分点" prefix-icon="el-icon-search" v-model.trim="judgementpointsquery" clearable></el-input>
clearable></el-input>
</div> </div>
</div> </div>
<el-table v-loading="visibleLoading" :data="judgementData" ref="judgementTable" class="table" stripe <el-table
header-align="center" use-virtual :row-height="45" :max-height="400" :border="false" v-loading="visibleLoading"
@selection-change="handleSelectionJudgment" :row-key="rowKey"> :data="judgementData"
ref="judgementTable"
class="table"
stripe
header-align="center"
max-height="400"
@selection-change="handleSelectionJudgment"
:row-key="rowKey"
>
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <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"> <el-table-column prop="id" label="序号" align="center" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
@ -205,7 +214,7 @@
</el-table> </el-table>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="closeJudgment"> </el-button> <el-button @click="closeJudgment"> </el-button>
<el-button type="primary" :loading="savingJud" @click="saveJudgment"> </el-button> <el-button type="primary" @click="saveJudgment"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@ -215,13 +224,10 @@
import Setting from "@/setting"; import Setting from "@/setting";
import quill from "@/components/quill"; import quill from "@/components/quill";
import Sortable from "sortablejs"; import Sortable from "sortablejs";
import { UTable, UTableColumn } from 'umy-ui'
import Decimal from 'decimal.js'
export default { export default {
components: { components: {
quill, quill
UTable,
UTableColumn
}, },
data() { data() {
return { return {
@ -234,7 +240,7 @@ export default {
founder: 0, // (0 1) founder: 0, // (0 1)
projectName: "", // projectName: "", //
remark: '', remark: '',
permissions: 0, // (0 1 2) permissions: 0, // (0 1 2)
systemId: this.$route.query.systemId, // id systemId: this.$route.query.systemId, // id
hintOpen: 1, // (0 1 1) hintOpen: 1, // (0 1 1)
experimentHint: "", // experimentHint: "", //
@ -243,13 +249,10 @@ export default {
state: 0, // (0稿 1) state: 0, // (0稿 1)
isOpen: 0, // (0 1 0) isOpen: 0, // (0 1 0)
ztOpen: 0, // (0 1 0) ztOpen: 0, // (0 1 0)
isDel: 0, // (0 1 0) isDel: 0 // (0 1 0)
experimentTargetType: '0',
experimentDescriptionType: '0',
experimentHintType: '0',
}, },
projectJudgmentData: [], //() projectJudgmentData: [], //()
oriPer: '', // oriPer: '', //
selectedProjectJudgment: [], // selectedProjectJudgment: [], //
dialogVisible: false, // dialogVisible: false, //
@ -268,9 +271,7 @@ export default {
visibleLoading: false, // visibleLoading: false, //
listLoading:false,// listLoading:false,//
submiting: false, // submiting: false, //
updateTime: 0, updateTime: 0
savingJud: false,
loading: false,
}; };
}, },
computed: { computed: {
@ -280,11 +281,11 @@ export default {
projectFields() { projectFields() {
return this.$store.state.projectFields; return this.$store.state.projectFields;
}, },
handDistributionScore () { handDistributionScore: function() {
//100 //100
let score = 0; let score = 0;
this.projectJudgmentData.forEach(e => { this.projectJudgmentData.forEach(e => {
if (e.score && !isNaN(e.score)) score = Decimal(e.score).add(Decimal(score)) score += parseInt(e.score);
}); });
if (isNaN(score)) { if (isNaN(score)) {
return 0; return 0;
@ -293,12 +294,7 @@ export default {
this.$message.error("分配的数值已超过100"); this.$message.error("分配的数值已超过100");
} }
return score; return score;
}, }
//
isLc () {
const systemId = +this.$route.query.systemId
return systemId === 11 || systemId === 12 || systemId === 19
},
}, },
watch: { watch: {
// , // ,
@ -319,8 +315,6 @@ export default {
if (this.$route.query.projectId) { if (this.$route.query.projectId) {
this.projectId = this.$route.query.projectId; this.projectId = this.$route.query.projectId;
this.getInfoData(); this.getInfoData();
} else {
this.rowDrop()
} }
// //
if (JSON.stringify(this.projectFields) != "{}") { if (JSON.stringify(this.projectFields) != "{}") {
@ -328,6 +322,7 @@ export default {
this.projectManage = projectManage; this.projectManage = projectManage;
this.projectJudgmentData = projectJudgmentData; this.projectJudgmentData = projectJudgmentData;
} }
this.rowDrop();
this.$refs.main.scrollTop = 0; this.$refs.main.scrollTop = 0;
}, },
beforeDestroy() { beforeDestroy() {
@ -345,27 +340,21 @@ export default {
}, },
getInfoData() { // getInfoData() { //
if (!this.isToPoint) { if (!this.isToPoint) {
this.loading = true
this.$get(`${this.api.getProjectDetail}?projectId=${this.projectId}`).then(res => { this.$get(`${this.api.getProjectDetail}?projectId=${this.projectId}`).then(res => {
let { projectManage, projectJudgmentVos } = res; let { projectManage, projectJudgmentVos } = res;
if (!projectManage.remark) projectManage.remark = projectManage.projectName // if (!projectManage.remark) projectManage.remark = projectManage.projectName //
if (!projectManage.experimentDescriptionType) projectManage.experimentDescriptionType = '0'
if (!projectManage.experimentHintType) projectManage.experimentHintType = '0'
if (!projectManage.experimentTargetType) projectManage.experimentTargetType = '0'
this.projectManage = projectManage; this.projectManage = projectManage;
this.projectJudgmentData = projectJudgmentVos; this.projectJudgmentData = projectJudgmentVos;
this.oriPer = projectManage.permissions this.oriPer = projectManage.permissions
this.projectJudgmentData.forEach((e, i) => { this.projectJudgmentData.forEach((e, i) => {
e.sort = i + 1; e.sort = i + 1;
}); });
this.loading = false
this.$nextTick(() => { this.$nextTick(() => {
this.updateTime = 0 this.updateTime = 0
this.$refs.main.scrollTop = 0; this.$refs.main.scrollTop = 0;
this.rowDrop();
}); });
}).catch(err => { }).catch(err => {
this.loading = false console.log(err);
}); });
} }
}, },
@ -445,11 +434,11 @@ export default {
return true; return true;
}, },
handleSubmit(state) { // handleSubmit(state) { //
if (this.submiting === 0 || this.submiting === 1) return false if (this.submiting) return false
if (!this.judgmentRelease(state)) { // if (!this.judgmentRelease(state)) { //
return; return;
} }
this.submiting = state this.submiting = true
this.$store.dispatch("setSystemId", this.projectManage.systemId); this.$store.dispatch("setSystemId", this.projectManage.systemId);
this.projectManage.state = state; this.projectManage.state = state;
this.projectManage.ztOpen = state ? 0 : 1 this.projectManage.ztOpen = state ? 0 : 1
@ -487,7 +476,7 @@ export default {
updateProject(params) { // updateProject(params) { //
this.$post(this.api[params.projectManage.state ? 'updateProjectManage' : 'editProjectDraft'], params).then(res => { this.$post(this.api[params.projectManage.state ? 'updateProjectManage' : 'editProjectDraft'], params).then(res => {
if (res.status === 200) { if (res.status === 200) {
// //
if (!params.projectManage.founder && this.oriPer !== params.projectManage.permissions) { if (!params.projectManage.founder && this.oriPer !== params.projectManage.permissions) {
this.$get(`${this.api.checkConfig}?projectId=${this.projectId}`).then(res => { this.$get(`${this.api.checkConfig}?projectId=${this.projectId}`).then(res => {
this.$message.success(res.message === 'success' ? '更新实验项目成功' : res.message) this.$message.success(res.message === 'success' ? '更新实验项目成功' : res.message)
@ -495,7 +484,7 @@ export default {
} else { } else {
this.$message.success('更新实验项目成功') this.$message.success('更新实验项目成功')
} }
this.toList(); this.$router.back();
} }
}).catch(err => { }).catch(err => {
this.submiting = false this.submiting = false
@ -540,9 +529,8 @@ export default {
let y = index + 2; let y = index + 2;
this.projectJudgmentData.splice(x - 1, 1, ...this.projectJudgmentData.splice(y - 1, 1, this.projectJudgmentData[x - 1])); this.projectJudgmentData.splice(x - 1, 1, ...this.projectJudgmentData.splice(y - 1, 1, this.projectJudgmentData[x - 1]));
}, },
scoreChange (row, i) { scoreChange(row, index) { //
row.score = row.score.replace(/[^\d\.]/g, '') this.projectJudgmentData.splice(index, 1, row);
this.projectJudgmentData.splice(i, 1, row);
}, },
delJudgePoint(index) { // delJudgePoint(index) { //
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
@ -591,7 +579,7 @@ export default {
}; };
if (systemId == 2 || systemId == 3) { if (systemId == 2 || systemId == 3) {
console.log("系统id:", systemId); console.log("系统id:", systemId);
} else if (this.isLc) { } else if (systemId == 11 || systemId == 12) {
// () // ()
this.rowKey = "lcId"; this.rowKey = "lcId";
this.getProcessClassData(params); this.getProcessClassData(params);
@ -644,11 +632,10 @@ export default {
}, },
saveJudgment() { // saveJudgment() { //
if (this.selectedJudgment.length) { if (this.selectedJudgment.length) {
this.savingJud = true
this.judgementpointsquery = ""; this.judgementpointsquery = "";
this.dialogVisible = false; this.dialogVisible = false;
let tempArr = this.selectedJudgment.map(i => { let tempArr = this.selectedJudgment.map(i => {
this.$set(i, 'score', 0) i.score = 0;
return i; return i;
}); });
this.projectJudgmentData = this.projectJudgmentData.concat(tempArr); this.projectJudgmentData = this.projectJudgmentData.concat(tempArr);
@ -656,7 +643,6 @@ export default {
e.sort = i + 1; e.sort = i + 1;
}); });
this.$nextTick(() => { this.$nextTick(() => {
this.savingJud = false
this.$refs.projectJudgementTable.clearSelection(); this.$refs.projectJudgementTable.clearSelection();
}); });
} else { } else {
@ -666,16 +652,24 @@ export default {
// //
rowDrop() { rowDrop() {
// //
const tbody = document.querySelector(".el-table__body tbody"); const tbody = document.querySelector(".draggable .el-table__body-wrapper tbody");
const that = this; const _this = this;
this.$refs.projectJudgementTable && Sortable.create(tbody, { Sortable.create(tbody, {
// //
// draggable: ".draggable .el-table__row", draggable: ".draggable .el-table__row",
onUpdate ({ newIndex, oldIndex }) { onEnd({ newIndex, oldIndex }) {
console.log("🚀 ~ onEnd ~ newIndex, oldIndex:", newIndex, oldIndex) // : vue$nextTick
if (newIndex == oldIndex) return false _this.projectJudgmentData.splice(newIndex, 0, _this.projectJudgmentData.splice(oldIndex, 1)[0]);
const currentRow = that.projectJudgmentData.splice(oldIndex, 1)[0] let newArray = _this.projectJudgmentData.slice(0);
that.projectJudgmentData.splice(newIndex, 0, currentRow) _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;
});
} }
}); });
}, },
@ -728,7 +722,7 @@ export default {
console.log(systemId); console.log(systemId);
} else if (systemId == 3) { } else if (systemId == 3) {
console.log(systemId); console.log(systemId);
} else if (this.isLc) { } else if (systemId == 11 || systemId == 12) {
// //
href = `${jumpPath}/#/Transaction?isView=true&systemId=${systemId}&lcId=${row.judgmentId}&token=${this.token}&referrer=${btoa(location.href)}`; href = `${jumpPath}/#/Transaction?isView=true&systemId=${systemId}&lcId=${row.judgmentId}&token=${this.token}&referrer=${btoa(location.href)}`;
} else { } else {
@ -741,7 +735,7 @@ export default {
console.log(systemId); console.log(systemId);
} else if (systemId == 3) { } else if (systemId == 3) {
console.log(systemId); console.log(systemId);
} else if (this.isLc) { } else if (systemId == 11 || systemId == 12) {
// //
href = `${jumpPath}/#/Transaction?isEdit=true&systemId=${systemId}&lcId=${row.judgmentId}&token=${this.token}&referrer=${btoa(location.href)}`; href = `${jumpPath}/#/Transaction?isEdit=true&systemId=${systemId}&lcId=${row.judgmentId}&token=${this.token}&referrer=${btoa(location.href)}`;
} else { } else {
@ -760,15 +754,14 @@ export default {
}, },
// //
toList() { toList() {
this.$router.push(this.$store.state.innerReferrer) this.$router.back()
}, },
// //
back() { back() {
// //
if(this.updateTime){ if(this.updateTime){
this.$confirm('编辑的内容未保存,是否保存?', "提示", { this.$confirm('编辑的内容未保存,是否保存?', "提示", {
type: "warning", type: "warning"
closeOnClickModal: false
}).then(() => { }).then(() => {
this.handleSubmit(this.projectManage.state) this.handleSubmit(this.projectManage.state)
}).catch(() => { }).catch(() => {
@ -788,10 +781,9 @@ export default {
padding: 0; padding: 0;
border-bottom: 0; border-bottom: 0;
} }
.main{ .main{
overflow: auto; overflow: auto;
overflow-x: hidden; overflow-x: hidden;
height: calc(100vh - 161px); height: calc(100vh - 152px );
} }
</style> </style>

@ -4,7 +4,7 @@
shadow="hover" shadow="hover"
class="mgb20"> class="mgb20">
<el-page-header :content="'实验项目管理 / '+titleName" <el-page-header :content="'实验项目管理 / '+titleName"
@back="back"></el-page-header> @back="goBack"></el-page-header>
</el-card> </el-card>
<el-card shadow="hover" <el-card shadow="hover"
@ -19,7 +19,7 @@
<el-form label-width="80px"> <el-form label-width="80px">
<el-col :span="4"> <el-col :span="4">
<el-form-item label="来源"> <el-form-item label="来源">
<el-select v-model="form.founder" <el-select v-model="queryData.founder"
clearable clearable
placeholder="请选择创建人" placeholder="请选择创建人"
@change="initData"> @change="initData">
@ -32,7 +32,7 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="状态"> <el-form-item label="状态">
<el-select v-model="form.state" <el-select v-model="queryData.state"
clearable clearable
placeholder="请选择状态" placeholder="请选择状态"
@change="initData"> @change="initData">
@ -44,8 +44,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="用途"> <el-form-item label="权限">
<el-select v-model="form.permissions" <el-select v-model="queryData.permissions"
placeholder="请选择" placeholder="请选择"
@change="initData"> @change="initData">
<el-option v-for="item in permissionsList" <el-option v-for="item in permissionsList"
@ -59,7 +59,7 @@
<el-form-item> <el-form-item>
<el-input placeholder="请输入项目名称" <el-input placeholder="请输入项目名称"
prefix-icon="el-icon-search" prefix-icon="el-icon-search"
v-model="form.projectName" v-model="keyword"
clearable></el-input> clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -84,7 +84,7 @@
@click="delAllData">批量删除</el-button> @click="delAllData">批量删除</el-button>
</div> </div>
</div> </div>
<el-table :data="list" <el-table :data="listData"
class="table" class="table"
ref="table" ref="table"
stripe stripe
@ -117,10 +117,10 @@
min-width="140" min-width="140"
align="center"> align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ form.founder == 1 ? scope.row.schoolName : scope.row.creator }} {{ queryData.founder == 1 ? scope.row.schoolName : scope.row.creator }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="用途" <el-table-column label="权限"
min-width="120" min-width="120"
align="center"> align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -196,21 +196,23 @@
</template> </template>
<script> <script>
import qs from 'qs' import { mapState, mapActions } from 'vuex';
import Setting from "@/setting";
export default { export default {
data () { data () {
return { return {
showBack: Boolean(this.$route.query.show), showBack: Boolean(this.$route.query.show),
systemId: this.$route.query.systemId, systemId: this.$route.query.systemId,
titleName: this.$route.query.name, titleName: this.$route.query.name,
form: { queryData: {
platformId: 3, // :1 :3 platformId: 3, // :1 :3
founder: this.$route.query.founder ? +this.$route.query.founder : 0, // (0: 1:) founder: 0, // (0: 1:)
state: this.$route.query.state ? +this.$route.query.state : '', // (0:稿 1:) state: "", // (0:稿 1:)
permissions: this.$route.query.permissions ? +this.$route.query.permissions : '', // (0: 1: 2:) permissions: "", // (0: 1: 2:)
projectName: this.$route.query.projectName || ''
}, },
list: [], keyword: '',
status: '',
listData: [],
total: 0, total: 0,
permissionsList: [{ permissionsList: [{
value: '', value: '',
@ -271,7 +273,7 @@ export default {
}; };
}, },
watch: { watch: {
'form.projectName': function (val) { keyword: function (val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData(); this.initData();
@ -279,25 +281,28 @@ export default {
} }
}, },
mounted () { mounted () {
const { query } = this.$route if (this.$route.query.founder && this.$route.query.founder != 'undefined') {
if (query.page) { this.queryData.founder = +this.$route.query.founder
this.$router.push(`/projectList?systemId=${query.systemId}&show=${query.show}&name=${query.name}`).catch(() => { }) } else {
this.queryData.founder = 0
} }
this.getData(); this.getData();
}, },
methods: { methods: {
getData () { getData () {
let data = { let data = {
...this.form, ...this.queryData,
projectName: this.keyword,
pageNum: this.page, pageNum: this.page,
pageSize: this.pageSize, pageSize: this.pageSize,
systemId: this.systemId systemId: this.systemId
}; };
this.$post(this.api.queryProjectManage, data).then(res => { this.$post(this.api.queryProjectManage, data).then(res => {
this.list = res.data.records; this.listData = res.data.records;
this.total = res.data.total; this.total = res.data.total;
}).catch(err => { }); }).catch(err => {
console.log(err);
});
}, },
initData () { initData () {
this.page = 1; this.page = 1;
@ -305,19 +310,20 @@ export default {
}, },
handleCurrentChange (val) { // handleCurrentChange (val) { //
this.page = val; this.page = val;
this.$router.replace({
path: 'projectList',
query: {
...this.$route.query,
page: val
}
})
this.getData(); this.getData();
}, },
// url
setReferrer () {
this.$store.commit('setInnerReferrer', `${this.$route.path}?${qs.stringify(this.$route.query)}&${qs.stringify(this.form)}&page=${this.page}`)
},
add () { // add () { //
this.setReferrer() this.$router.push(`/projectAdd?systemId=${this.systemId}&founder=${this.queryData.founder}&isDetails=${this.$route.query.show}&name=${this.titleName}`);
this.$router.push(`/projectAdd?systemId=${this.systemId}&founder=${this.form.founder}&isDetails=${this.$route.query.show}&name=${this.titleName}`);
}, },
edit (row) { // edit (row) { //
this.setReferrer() this.$router.push(`/projectAdd?systemId=${this.systemId}&projectId=${row.projectId}&founder=${this.queryData.founder}&isDetails=${this.$route.query.show}&name=${this.titleName}`);
this.$router.push(`/projectAdd?systemId=${this.systemId}&projectId=${row.projectId}&founder=${this.form.founder}&isDetails=${this.$route.query.show}&name=${this.titleName}`);
}, },
handleSelectionChange (val) { // handleSelectionChange (val) { //
this.multipleSelection = val; this.multipleSelection = val;
@ -337,7 +343,8 @@ export default {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$post(`${this.api.deleteProjectManage}?projectIds=${ids}&platformId=${this.form.platformId}`).then(res => { this.$post(`${this.api.deleteProjectManage}?projectIds=${ids}&platformId=${this.queryData.platformId}`).then(res => {
console.log(ids)
if (res.status == 200) { if (res.status == 200) {
let delList = [] let delList = []
if (isNaN(ids) == 'NaN') { if (isNaN(ids) == 'NaN') {
@ -345,7 +352,7 @@ export default {
} else { } else {
delList.push(ids) delList.push(ids)
} }
if (delList.length == this.list.length) { if (delList.length == this.listData.length) {
if (this.page > 1) { if (this.page > 1) {
this.page = this.page - 1 this.page = this.page - 1
} }
@ -365,7 +372,7 @@ export default {
}); });
}, },
switchOff (row) { // switchOff (row) { //
this.$get(`${this.api.updateIsOpen}?isOpen=${row.ztOpen}&projectId=${row.projectId}&platformId=${this.form.platformId}`).then(res => { this.$get(`${this.api.updateIsOpen}?isOpen=${row.ztOpen}&projectId=${row.projectId}&platformId=${this.queryData.platformId}`).then(res => {
if (res.status === 200) { if (res.status === 200) {
this.$message.success('更新启用状态成功'); this.$message.success('更新启用状态成功');
this.getData(); this.getData();
@ -423,17 +430,19 @@ export default {
}); });
this.$post(`${this.api.copyProjectManage}`, this.currentRow).then(res => { this.$post(`${this.api.copyProjectManage}`, this.currentRow).then(res => {
if (res.status === 200) { if (res.status === 200) {
this.form.founder = 0 this.queryData.founder = 0
this.initData(); this.initData();
this.$message.success("复制实验项目成功"); this.$message.success("复制实验项目成功");
this.copyVisible = false; this.copyVisible = false;
} else { } else {
this.$message.error(res.message); this.$message.error(res.message);
} }
}).catch(err => { }); }).catch(err => {
console.log(err);
});
}, },
back () { // goBack () { //
this.$router.push(this.$store.state.referrer || '/configure') this.$router.back()
} }
} }
}; };

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save