重构完成

dev_2022-05-11
yujialong 3 years ago
parent 6f6321889f
commit 8bb1e0558e
  1. 1
      .gitignore
  2. 23
      README.md
  3. 1549
      package-lock.json
  4. 10
      package.json
  5. 3
      public/index.html
  6. BIN
      screenshots/wms1.png
  7. BIN
      screenshots/wms2.png
  8. BIN
      screenshots/wms3.png
  9. 34
      src/App.vue
  10. 9
      src/api/index.js
  11. 28
      src/assets/css/color-dark.css
  12. 4
      src/assets/css/icon.css
  13. 326
      src/assets/css/main.css
  14. 29
      src/assets/css/theme-green/color-green.css
  15. BIN
      src/assets/css/theme-green/fonts/element-icons.ttf
  16. BIN
      src/assets/css/theme-green/fonts/element-icons.woff
  17. 1
      src/assets/css/theme-green/index.css
  18. 105
      src/components/common/Header.vue
  19. 72
      src/components/common/Home.vue
  20. 186
      src/components/common/Tags.vue
  21. 80
      src/components/common/directives.js
  22. 338
      src/components/page/.vue
  23. 391
      src/components/page/AddExperimentOptions.vue
  24. 1138
      src/components/page/AddProject.vue
  25. 232
      src/components/page/Login.vue
  26. 544
      src/components/page/Program.vue
  27. 948
      src/components/page/ProgramOption.vue
  28. 960
      src/components/page/ProgramOptions.vue
  29. 280
      src/components/page/Report.vue
  30. 461
      src/components/page/ReportConfig.vue
  31. 361
      src/components/page/ShowExperimentOption.vue
  32. 401
      src/components/page/ShowExperimentOptions.vue
  33. 307
      src/components/page/TeacherComment.vue
  34. 350
      src/components/page/User.vue
  35. 309
      src/components/page/achievement.vue
  36. 218
      src/components/page/backstage.vue
  37. 442
      src/components/page/dashboard.vue
  38. 725
      src/components/page/evaluation.vue
  39. 418
      src/components/page/project.vue
  40. 115
      src/components/page/system.vue
  41. 124
      src/components/pdf/index.vue
  42. 4
      src/components/quill/index.vue
  43. 1
      src/components/quill/options.js
  44. 123
      src/config/index.js
  45. 0
      src/i18n/index.js
  46. 4
      src/layouts/footer/index.vue
  47. 84
      src/layouts/header/index.vue
  48. 46
      src/layouts/home/index.vue
  49. 79
      src/layouts/navbar/index.vue
  50. 28
      src/libs/auth/authentication.js
  51. 27
      src/libs/auth/generateBtnPermission.js
  52. 0
      src/libs/bus.js
  53. 12
      src/libs/index.js
  54. 10
      src/libs/random_str.js
  55. 0
      src/libs/resize/index.js
  56. 16
      src/libs/route/addRoutes.js
  57. 9
      src/libs/route/generateRoutes.js
  58. 43
      src/libs/util.cookies.js
  59. 83
      src/libs/util.db.js
  60. 162
      src/libs/util.js
  61. 57
      src/main.js
  62. 11
      src/mixins/app.js
  63. 8
      src/mixins/setBackground/index.js
  64. 201
      src/pages/account/login/index.vue
  65. 111
      src/pages/achievement/ass/index.vue
  66. 14
      src/pages/achievement/edit/index.vue
  67. 276
      src/pages/achievement/list/index.vue
  68. 39
      src/pages/achievement/show/index.vue
  69. 117
      src/pages/achievement/teach/index.vue
  70. 113
      src/pages/achievement/vir/index.vue
  71. 262
      src/pages/assessment/add/index.vue
  72. 389
      src/pages/assessment/list/index.vue
  73. 631
      src/pages/evaluation/list/index.vue
  74. 33
      src/pages/exception/error/403/index.vue
  75. 33
      src/pages/exception/error/404/index.vue
  76. 2
      src/pages/exception/i18n/index.vue
  77. 0
      src/pages/exception/icon/index.vue
  78. 1064
      src/pages/project/add/index.vue
  79. 391
      src/pages/project/list/index.vue
  80. 58
      src/pages/setting/person/index.vue
  81. 215
      src/pages/student/list/index.vue
  82. 61
      src/pages/system/list/index.vue
  83. 119
      src/pages/system/list/role.vue
  84. 214
      src/pages/system/list/staff.vue
  85. 21
      src/pages/system/list/staffSide.vue
  86. 8
      src/pages/system/list/stafftree.vue
  87. 1
      src/plugins/aliplayer/aliplayer-min.css
  88. 2
      src/plugins/aliplayer/aliplayer-min.js
  89. 25
      src/plugins/auth/index.js
  90. 12
      src/plugins/filters/index.js
  91. 14
      src/plugins/index.js
  92. 140
      src/plugins/requests/index.js
  93. 14
      src/plugins/throttle/index.js
  94. 11
      src/router/index.js
  95. 43
      src/router/modules/achievement.js
  96. 29
      src/router/modules/assessment.js
  97. 23
      src/router/modules/evaluation.js
  98. 29
      src/router/modules/project.js
  99. 23
      src/router/modules/setting.js
  100. 23
      src/router/modules/student.js
  101. Some files were not shown because too many files have changed in this diff Show More

1
.gitignore vendored

@ -3,7 +3,6 @@ node_modules
/dist /dist
example.html example.html
favicon.ico favicon.ico
或然服务端
# local env files # local env files
.env.local .env.local
.env.*.local .env.*.local

@ -0,0 +1,23 @@
# 该项目是前端项目基础模板
## 拉取该项目就可以直接上手开发.
---
### 注意事项:
1. api里面存放接口地址
2. assets里面存放静态文件,注意图片跟svg最好分开,方便后期管理
3. components存放公共组件
4. layouts存放页面布局组件,注意导航跟头部是分开的,放在一起太臃肿
5. libs存放工具包.封装了cookie,localStorate,sessionStorage的增删改查; auth是用来生成角色权限里控制的按钮,生成后添加到store里面; route是做动态路由的,同时把生成的路由集合添加到store里面
6. mixins可以自定义mixin
7. pages存放页面,一个模块为一个文件夹,默认有个list文件夹,默认跳转到list,要添加子模块的话直接建list的同级文件夹,里面统一命名index.vue
8. plugins里面aliplayer是阿里云播放器,按需引用; auth是按钮级别的鉴权; filters可以自定义filter; requests是全局请求配置文件; throttle为防抖
9. router为路由,跟pages一样,一个模块为一个文件夹,存放在modules里面; permission为路由全局控制; route里引用modules里面定义的路由模块,每加一个模块就要在这里引用
10. store存放store模块,直接在modules里定义文件就会自动引用,一个模块为一个文件夹,模块之间勿混淆使用
11. styles存放全局scss. default里设置项目主题色; font存放字体文件; layout存放布局样式; lib里面有定义工具class,可以直接引用里面的class; pages为页面的公用样式; common为全局公共样式; var可以定义mixin和全局变量
---
#### 全局配置都放在setting.js里面,项目参数,比如默认密码,平台id,都放在这里,页面里直接引入该文件即可,不要在页面里写死公共使用的系统参数。
#### vue.config.js里要定义固定端口,不然项目启动多了会乱,每开一个项目就开一个新的端口,每个项目端口不要冲突

1549
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -10,28 +10,28 @@
"dependencies": { "dependencies": {
"axios": "^0.18.0", "axios": "^0.18.0",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
"echarts": "^4.9.0", "echarts": "^4.8.0",
"element-theme": "^2.0.1", "element-theme": "^2.0.1",
"element-ui": "^2.13.0", "element-ui": "^2.13.0",
"lodash": "^4.17.20", "js-cookie": "^2.2.1",
"mavon-editor": "^2.6.17", "mavon-editor": "^2.6.17",
"postcss-px2rem": "^0.3.0", "postcss-px2rem": "^0.3.0",
"px2rem-loader": "^0.1.9", "px2rem-loader": "^0.1.9",
"quill": "^1.3.7",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-cropperjs": "^3.0.0", "vue-cropperjs": "^3.0.0",
"vue-i18n": "^8.10.0", "vue-i18n": "^8.10.0",
"vue-pdf": "^4.2.0",
"vue-quill-editor": "^3.0.6", "vue-quill-editor": "^3.0.6",
"vue-router": "^3.0.3", "vue-router": "^3.0.3",
"vue-schart": "^2.0.0", "vue-schart": "^2.0.0",
"vuedraggable": "^2.17.0", "vuedraggable": "^2.17.0",
"vuex": "^3.1.2" "vuex": "^3.4.0"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^3.9.0", "@vue/cli-plugin-babel": "^3.9.0",
"@vue/cli-service": "^3.9.0", "@vue/cli-service": "^3.9.0",
"element-theme-chalk": "^2.13.0", "element-theme-chalk": "^2.13.0",
"node-sass": "^4.14.1", "node-sass": "^4.13.0",
"sass-loader": "^8.0.0", "sass-loader": "^8.0.0",
"vue-template-compiler": "^2.6.10" "vue-template-compiler": "^2.6.10"
} }

@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<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">
<link rel="stylesheet" href="//at.alicdn.com/t/font_830376_qzecyukz0s.css"> <link rel="stylesheet" href="//at.alicdn.com/t/font_830376_qzecyukz0s.css">
<title>职站服务端管理系统</title> <title>项目模板</title>
</head> </head>
<body> <body>
<noscript> <noscript>
@ -14,4 +14,5 @@
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
</html> </html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

@ -1,30 +1,24 @@
<template> <template>
<div id="app"> <div id="app" >
<router-view></router-view> <router-view></router-view>
</div> </div>
</template> </template>
<script> <script>
import Setting from '@/setting';
import util from '@/libs/util';
export default { export default {
name: 'App', name: 'App',
created () { created () {
//sessionStorage //localStorage
if (sessionStorage.getItem("sta_server_store") ) { if (util.local.get(Setting.storeKey) ) {
this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(sessionStorage.getItem("sta_server_store")))) this.$store.replaceState(Object.assign({}, this.$store.state,util.local.get(Setting.storeKey)))
} }
//vuexsessionStorage //vuexlocalStorage
window.addEventListener("beforeunload",()=>{ window.addEventListener("beforeunload",()=>{
sessionStorage.setItem("sta_server_store",JSON.stringify(this.$store.state)) util.local.get(Setting.tokenKey) && util.local.set(Setting.storeKey,this.$store.state)
}) })
} }
} }
</script> </script>
<style>
@import "./assets/css/main.css";
/* @import "./assets/css/color-dark.css"; */
/*深色主题*/
@import "./assets/css/theme-green/color-green.css";
/* 浅绿色主题 */
</style>

@ -1,12 +1,9 @@
import config from '@/config' import Setting from '@/setting'
// let host = 'http://192.168.31.125:9090'//林 // let host = 'http://192.168.31.125:9090'//林
// let host = 'http://192.168.31.125:1010'//林
// let host = 'http://192.168.31.152:9090'//榕 // let host = 'http://192.168.31.152:9090'//榕
// let host = 'http://192.168.31.140:8090'//7 let host = Setting.apiBaseURL
let host = config.host let uploadURL = Setting.upload.apiURL
let host1 = 'http://39.108.250.202:8080/' let host1 = 'http://39.108.250.202:8080/'
// let loginhost = 'http://www.liuwanr.cn'
let uploadURL = 'http://8.134.8.197:8001/'
export default { export default {
fileupload: `${uploadURL}oss/manage/fileupload`, fileupload: `${uploadURL}oss/manage/fileupload`,

@ -1,28 +0,0 @@
.header{
background-color: #242f42;
}
.login-wrap{
background: #324157;
}
.plugins-tips{
background: #eef1f6;
}
.plugins-tips a{
color: #20a0ff;
}
.el-upload--text em {
color: #20a0ff;
}
.pure-button{
background: #20a0ff;
}
.tags-li.active {
border: 1px solid #409EFF;
background-color: #409EFF;
}
.message-title{
color: #20a0ff;
}
.collapse-btn:hover{
background: rgb(40,52,70);
}

@ -1,4 +0,0 @@
[class*=" icon-"], [class^=icon-] {
font-family: iconfont!important;
}

@ -1,326 +0,0 @@
* {
margin: 0;
padding: 0;
}
html,
body,
#app,
.wrapper {
width: 100%;
height: 100%;
}
body {
font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif;
font-size: 14px;
}
a {
text-decoration: none
}
i{
font-style: normal;
}
li {
list-style-type:none;
}
.content-box {
min-height: calc(100vh);
padding-bottom: 30px;
-webkit-transition: left .3s ease-in-out;
transition: left .3s ease-in-out;
background: #f0f0f0;
}
.content {
width: auto;
height: 100%;
padding: 20px;
box-sizing: border-box;
}
.content-collapse {
left: 65px;
}
.container {
padding: 30px;
background: #fff;
border: 1px solid #ddd;
border-radius: 5px;
}
.crumbs {
margin: 10px 0;
}
.el-table th {
background-color: #f5f7fa !important;
}
.pagination {
margin: 20px 0;
text-align: right;
}
.plugins-tips {
padding: 20px 10px;
margin-bottom: 20px;
}
.el-button+.el-tooltip {
margin-left: 10px;
}
.el-table tr:hover {
background: #f6faff;
}
.orderTable td .el-input{
width: 60%;
}
.orderTable .el-select>.el-input{
display: inline-block;
}
.mgb20 {
margin-bottom: 20px;
}
.move-enter-active,
.move-leave-active {
transition: opacity .5s;
}
.move-enter,
.move-leave {
opacity: 0;
}
/*BaseForm*/
.form-box {
width: 600px;
}
.form-box .line {
text-align: center;
}
.el-time-panel__content::after,
.el-time-panel__content::before {
margin-top: -7px;
}
.el-time-spinner__wrapper .el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default) {
padding-bottom: 0;
}
/*Upload*/
.pure-button {
width: 150px;
height: 40px;
line-height: 40px;
text-align: center;
color: #fff;
border-radius: 3px;
}
.g-core-image-corp-container .info-aside {
height: 45px;
}
.avatar-uploader .el-upload--text {
background-color: #fff;
border: 1px dashed #d9d9d9;
border-radius: 6px;
box-sizing: border-box;
width: 360px;
height: 180px;
text-align: center;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload--text .el-icon-upload {
font-size: 67px;
color: #97a8be;
margin: 40px 0 16px;
line-height: 50px;
}
.avatar-uploader .el-upload--text {
color: #97a8be;
font-size: 14px;
text-align: center;
}
.avatar-uploader .el-upload--text em {
font-style: normal;
}
/* .link_upload .el-upload-list{
width: 30%;
} */
/*VueEditor*/
.ql-container {
min-height: 400px;
}
.ql-snow .ql-tooltip {
transform: translateX(117.5px) translateY(10px) !important;
}
.editor-btn {
margin-top: 20px;
}
/*markdown*/
.v-note-wrapper .v-note-panel {
min-height: 500px;
}
.ms-login .el-tabs__nav-wrap::after{
background-color: #fff;
opacity: 0;
}
.ms-login .el-tabs__item{
padding: 0 90px;
color: #999;
}
.ms-login .el-tabs__item:hover{
color: #000;
}
.ms-login .el-tabs__item.is-active{
color: #333;
font-weight: bold;
}
.ms-login .el-tabs__active-bar{
background-color: #000;
border-radius:2px;
}
.ms-login .el-tabs__nav-scroll{
display: flex;
justify-content: center;
}
.ms-login .el-input__inner{
height: 80px;
line-height: 80px;
border:1px solid rgba(220,220,220,1);
border-radius:2px;
}
.el-row {
margin-bottom: 20px;
}
.mgb20 {
margin-bottom: 20px;
}
#app .el-table thead{
color: #fff;
}
#app .el-table th{
background-color: #9278FF!important;
font-size: 16px;
font-weight: normal;
}
#app .el-select{
display: unset;
}
/*flex*/
.flex-center{
display: flex;
align-items: center;
}
.flex-between{
display: flex;
align-items: center;
justify-content: space-between;
}
.flex-around{
display: flex;
align-items: center;
justify-content: space-around;
}
.flex-start-around{
display: flex;
align-items: flex-start;
justify-content: center;
}
.flex-end-around{
display: flex;
align-items: flex-end;
justify-content: center;
}
.flex-column{
display: flex;
align-items: center;
flex-direction: column;
}
.flex-start{
display: flex;
align-items: flex-start;
}
.flex-end{
display: flex;
align-items: flex-end;
}
.hr_tag{
background-color: #9278FF;
width: 3px;
height: 15px;
margin-right: 5px;
}
.user_header{
padding: 20px 0;
border-bottom: 1px dashed #eee;
}
.addhr_tag{
background-color: #666;
width: 6px;
height: 17px;
margin-right: 5px;
}
.per_title span{
font-size: 16px;
font-weight: bold;
}
.per_back{
margin-left: 5px;
}
.per_school{
margin-left: 30px;
}
.per_title:hover{
cursor:pointer;
}
/* 溢出省略号 */
.ellipsis{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.userRadio .el-radio{
margin-right: 10px!important;
}
.userRadio .el-radio__input{
display: none!important;
}

@ -1,29 +0,0 @@
.header{
background-color: #fff;
}
.login-wrap{
background: rgba(56, 157, 170, 0.82);;
}
.plugins-tips{
background: #f2f2f2;
}
.plugins-tips a{
color: #00d1b2;
}
.el-upload--text em {
color: #00d1b2;
}
.pure-button{
background: #00d1b2;
}
.pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus {
background-color: #00d1b2 !important;
border-color: #00d1b2 !important;
}
.tags-li.active {
border: 1px solid #9278FF;
background-color: #9278FF;
}
.collapse-btn:hover{
background: #00d1b2;
}

File diff suppressed because one or more lines are too long

@ -1,105 +0,0 @@
<template>
<div class="header flex-between">
<img class="logo hh" v-if="$config.isHh" src="../../assets/img/logo-hh.png" />
<img class="logo" v-else src="../../assets/img/logo.png" />
<div class="header-right">
<div class="header-user-con">
<div class="user" @click="toPersonalCenter">
<el-avatar :size="40" :src="avatar"></el-avatar>
<span class="user-avator">{{userName}}</span>
</div>
<el-divider class="ml20" direction="vertical"></el-divider>
<el-button type="text" class="ml20" @click="loginout">退出</el-button>
</div>
</div>
</div>
</template>
<script>
import bus from '../common/bus'
export default {
data() {
return {
collapse: false,
fullscreen: false,
name: 'huoran',
message: 2,
avatar: this.$store.state.avatar,
userName: this.$store.state.userName
};
},
mounted(){
bus.$on('updateAvatar',avatar => {
this.avatar = avatar
})
bus.$on('updateAccount',userName => {
this.userName = userName
})
},
methods: {
toPersonalCenter(){
this.$router.push('/personalcenter')
},
loginout() {
sessionStorage.removeItem('sta_server_username');
this.$store.commit("addProjectSystemIdData",{systemId : this.$config.systemId})
this.$store.replaceState({})
location.reload()
}
},
};
</script>
<style scoped lang="scss">
.header {
position: relative;
box-sizing: border-box;
width: 100%;
height: 60px;
font-size: 16px;
color: #333;
}
.header .logo {
float: left;
width: 150px;
margin-left: 20px;
&.hh{
width: 220px;
}
}
.header-right {
float: right;
padding-right: 50px;
}
.header-user-con {
display: flex;
height: 70px;
align-items: center;
.user{
display: inline-flex;
align-items: center;
cursor: pointer;
}
}
.user-avator {
margin-left: 10px;
}
.ml20{
margin-left: 20px;
}
.user-avator img {
display: block;
width: 40px;
height: 40px;
border-radius: 50%;
}
.header-right .el-button--text{
color: #333;
}
.header-right .el-divider--vertical{
width: 2px;
height: 15px;
}
.header-right .el-divider{
background-color: #333;
}
</style>

@ -1,72 +0,0 @@
<template>
<div class="wrapper">
<div class="placeholder"></div>
<div class="fixed">
<v-head></v-head>
<v-sidebar></v-sidebar>
</div>
<div class="content-box" :class="{'content-collapse':collapse}">
<!-- <v-tags></v-tags> -->
<div class="content">
<transition name="move" mode="out-in">
<keep-alive :include="tagsList">
<router-view></router-view>
</keep-alive>
</transition>
<el-backtop target=".content"></el-backtop>
</div>
</div>
<v-footer ref="footer"></v-footer>
</div>
</template>
<script>
import vHead from './Header.vue';
import vSidebar from './Sidebar.vue';
import vFooter from './Footer'
import vTags from './Tags.vue';
import bus from './bus';
export default {
data() {
return {
tagsList: [],
collapse: false
};
},
components: {
vHead,
vSidebar,
vFooter,
vTags
},
created() {
bus.$on('collapse-content', msg => {
this.collapse = msg;
});
// 使keep-alive
bus.$on('tags', msg => {
let arr = [];
for (let i = 0, len = msg.length; i < len; i++) {
msg[i].name && arr.push(msg[i].name);
}
this.tagsList = arr;
});
}
};
</script>
<style lang="scss" scoped>
.fixed{
z-index: 10;
position: fixed;
top: 0;
width: 100%;
background-color: #fff;
}
.placeholder{
height: 120px;
&.mini{
height: 60px;
}
}
</style>

@ -1,186 +0,0 @@
<template>
<div class="tags" v-if="showTags">
<ul>
<li class="tags-li" v-for="(item,index) in tagsList" :class="{'active': isActive(item.path)}" :key="index">
<router-link :to="item.path" class="tags-li-title">
{{item.title}}
</router-link>
<span class="tags-li-icon" @click="closeTags(index)"><i class="el-icon-close"></i></span>
</li>
</ul>
<div class="tags-close-box">
<el-dropdown @command="handleTags">
<el-button size="mini" type="primary">
标签选项<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu size="small" slot="dropdown">
<el-dropdown-item command="other">关闭其他</el-dropdown-item>
<el-dropdown-item command="all">关闭所有</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
</template>
<script>
import bus from './bus';
export default {
data() {
return {
tagsList: []
}
},
methods: {
isActive(path) {
return path === this.$route.fullPath;
},
//
closeTags(index) {
const delItem = this.tagsList.splice(index, 1)[0];
const item = this.tagsList[index] ? this.tagsList[index] : this.tagsList[index - 1];
if (item) {
delItem.path === this.$route.fullPath && this.$router.push(item.path);
}else{
this.$router.push('/dashboard');
}
},
//
closeAll(){
this.tagsList = [];
this.$router.push('/dashboard');
},
//
closeOther(){
const curItem = this.tagsList.filter(item => {
return item.path === this.$route.fullPath;
})
this.tagsList = curItem;
},
//
setTags(route){
const isExist = this.tagsList.some(item => {
return item.path === route.fullPath;
})
if(!isExist){
if(this.tagsList.length >= 8){
this.tagsList.shift();
}
this.tagsList.push({
title: route.meta.title,
path: route.fullPath,
name: route.matched[1].components.default.name
})
}
bus.$emit('tags', this.tagsList);
},
handleTags(command){
command === 'other' ? this.closeOther() : this.closeAll();
}
},
computed: {
showTags() {
return this.tagsList.length > 0;
}
},
watch:{
$route(newValue, oldValue){
this.setTags(newValue);
}
},
created(){
this.setTags(this.$route);
//
bus.$on('close_current_tags', () => {
for (let i = 0, len = this.tagsList.length; i < len; i++) {
const item = this.tagsList[i];
if(item.path === this.$route.fullPath){
if(i < len - 1){
this.$router.push(this.tagsList[i+1].path);
}else if(i > 0){
this.$router.push(this.tagsList[i-1].path);
}else{
this.$router.push('/');
}
this.tagsList.splice(i, 1);
break;
}
}
})
}
}
</script>
<style>
.tags {
position: relative;
height: 30px;
overflow: hidden;
background: #fff;
padding-right: 120px;
box-shadow: 0 5px 10px #ddd;
}
.tags ul {
box-sizing: border-box;
width: 100%;
height: 100%;
}
.tags-li {
float: left;
margin: 3px 5px 2px 3px;
border-radius: 3px;
font-size: 12px;
overflow: hidden;
cursor: pointer;
height: 23px;
line-height: 23px;
border: 1px solid #e9eaec;
background: #fff;
padding: 0 5px 0 12px;
vertical-align: middle;
color: #666;
-webkit-transition: all .3s ease-in;
-moz-transition: all .3s ease-in;
transition: all .3s ease-in;
}
.tags-li:not(.active):hover {
background: #f8f8f8;
}
.tags-li.active {
color: #fff;
}
.tags-li-title {
float: left;
max-width: 80px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-right: 5px;
color: #666;
}
.tags-li.active .tags-li-title {
color: #fff;
}
.tags-close-box {
position: absolute;
right: 0;
top: 0;
box-sizing: border-box;
padding-top: 1px;
text-align: center;
width: 110px;
height: 30px;
background: #fff;
box-shadow: -3px 0 15px 3px rgba(0, 0, 0, .1);
z-index: 10;
}
</style>

@ -1,80 +0,0 @@
import Vue from 'vue';
// v-dialogDrag: 弹窗拖拽属性
Vue.directive('dialogDrag', {
bind(el, binding, vnode, oldVnode) {
const dialogHeaderEl = el.querySelector('.el-dialog__header');
const dragDom = el.querySelector('.el-dialog');
dialogHeaderEl.style.cssText += ';cursor:move;'
dragDom.style.cssText += ';top:0px;'
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
const sty = (() => {
if (window.document.currentStyle) {
return (dom, attr) => dom.currentStyle[attr];
} else {
return (dom, attr) => getComputedStyle(dom, false)[attr];
}
})()
dialogHeaderEl.onmousedown = (e) => {
// 鼠标按下,计算当前元素距离可视区的距离
const disX = e.clientX - dialogHeaderEl.offsetLeft;
const disY = e.clientY - dialogHeaderEl.offsetTop;
const screenWidth = document.body.clientWidth; // body当前宽度
const screenHeight = document.documentElement.clientHeight; // 可见区域高度(应为body高度,可某些环境下无法获取)
const dragDomWidth = dragDom.offsetWidth; // 对话框宽度
const dragDomheight = dragDom.offsetHeight; // 对话框高度
const minDragDomLeft = dragDom.offsetLeft;
const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth;
const minDragDomTop = dragDom.offsetTop;
const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight;
// 获取到的值带px 正则匹配替换
let styL = sty(dragDom, 'left');
let styT = sty(dragDom, 'top');
// 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
if (styL.includes('%')) {
styL = +document.body.clientWidth * (+styL.replace(/\%/g, '') / 100);
styT = +document.body.clientHeight * (+styT.replace(/\%/g, '') / 100);
} else {
styL = +styL.replace(/\px/g, '');
styT = +styT.replace(/\px/g, '');
};
document.onmousemove = function (e) {
// 通过事件委托,计算移动的距离
let left = e.clientX - disX;
let top = e.clientY - disY;
// 边界处理
if (-(left) > minDragDomLeft) {
left = -(minDragDomLeft);
} else if (left > maxDragDomLeft) {
left = maxDragDomLeft;
}
if (-(top) > minDragDomTop) {
top = -(minDragDomTop);
} else if (top > maxDragDomTop) {
top = maxDragDomTop;
}
// 移动当前元素
dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`;
};
document.onmouseup = function (e) {
document.onmousemove = null;
document.onmouseup = null;
};
}
}
})

@ -1,338 +0,0 @@
<template>
<div>
<el-card shadow="hover" class="mgb20">
<div class="flex-between">
<div class="per_title" v-preventReClick @click="goback()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">查看报告</span>
</div>
</div>
</el-card>
<div>
<el-card shadow="hover" class="mgb20">
<h6 style="text-align: center;font-size: 20px">标准实验报告</h6>
<div class="flex-center mgb20 user_header">
<p class="addhr_tag"></p>
<span>基本信息</span>
</div>
<div>
<el-table :data="infoData" class="table" stripe header-align="center">
<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="experimentalClassName" label="学生班级" align="center">
</el-table-column>
<el-table-column prop="teacherName" label="指导老师" align="center">
</el-table-column>
<el-table-column prop="period" label="实验学时" align="center">
</el-table-column>
<el-table-column prop="laboratory" label="实验室名称" align="center">
</el-table-column>
<el-table-column prop="startTime" label="实验时间" align="center">
</el-table-column>
<el-table-column prop="score" label="实验成绩" align="center">
</el-table-column>
</el-table>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验项目名称</p>
</div>
<el-input v-model="form.projectName" type="textarea" :disabled="true" rows="5"></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验目的</p>
<span>得分50/60</span>
</div>
<el-input v-model="form.experimentGoal" type="textarea" :disabled="true" rows="5"></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验原理</p>
<span>得分50/60</span>
</div>
<el-input v-model="form.principle" type="textarea" :disabled="true" rows="5"></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验内容</p>
<span>得分50/60</span>
</div>
<el-input v-model="form.content" type="textarea" :disabled="true" rows="5"></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验步骤</p>
<span>得分50/60</span>
</div>
<el-input v-model="form.step" type="textarea" :disabled="true" rows="5"></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验数据</p>
<span>得分50/60</span>
</div>
<el-table :data="expData" class="table" stripe header-align="center">
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
{{scope.$index + 1}}
</template>
</el-table-column>
<el-table-column prop="module" label="模块" align="center">
</el-table-column>
<el-table-column prop="judgmentPointsName" label="考核点" align="center">
</el-table-column>
<el-table-column prop="userAnswer" label="学生答案" align="center">
</el-table-column>
<el-table-column prop="answer" label="参考答案" align="center">
</el-table-column>
<el-table-column prop="codeScore" label="得分" align="center">
</el-table-column>
</el-table>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验结论</p>
<span>得分50/60</span>
</div>
<el-input type="textarea" v-model="form.conclusion" rows="5" disabled></el-input>
<div class="flex-between" style="margin-top: 10px">
<span>教师评分</span>
<div>
<el-input style="display: inline-block;width: auto;" placeholder="请输入"></el-input> (10)
</div>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">总结及心得体会</p>
<span>得分50/60</span>
</div>
<el-input type="textarea" v-model="form.summarize" rows="5" disabled></el-input>
<div class="flex-between" style="margin-top: 10px">
<span>教师评分</span>
<div>
<el-input style="display: inline-block;width: auto;" placeholder="请输入"></el-input> (10)
</div>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">对本实验过程及方法手段的改进建议</p>
<span>得分50/60</span>
</div>
<el-input type="textarea" rows="5" v-model="form.improvement" disabled></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<span>老师评语</span>
</div>
<el-input type="textarea" rows="5" v-model="form.comment" disabled></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<p class="mgb20">教师签名</p>
<!-- <img src="" alt=""> -->
</el-card>
</div>
</div>
</template>
<script>
export default {
data (){
return {
title: '实验报告',
userId: this.$store.state.userId,
studentId: this.$store.state.studentId,
form: {
analysis: '',
conclusion: '',
content: '',
data: '',
experimentGoal: '',
experimentId: '',
experimentalClassName: '',
improvement: '',
laboratory: '',
period: '',
principle: '',
projectName: '',
score: 0,
step: '',
submitTime: '',
summarize: '',
teacherName: '',
userId: this.userId,
userName: '',
workNumber: '',
},
type: this.$route.query.type,
id: this.$route.query.id,
recordId: this.$route.query.recordId,
reportId: this.$route.query.reportId,
infoData: [],
expData: [],
accountData: [],
showData: '1',
autograph: '1',
pages: 1,
ipVisible: false,
fileList: [{name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}, {name: 'food2.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}],
}
},
mounted(){
this.getData()
},
methods: {
getData(){
if(this.type){
let data = {
recordId: this.id,
}
this.$get(this.api.queryVirtualReport,data).then(res => {
this.form = res.data.report
this.expData = res.data.data
let form = this.form
this.infoData.push({
workNumber: form.workNumber,
experimentalClassName: form.experimentalClassName,
teacherName: form.teacherName,
period: form.period,
laboratory: form.laboratory,
startTime: form.submitTime,
score: form.score,
userName: form.userName
})
}).catch(res => {});
}else{
let data = {
studentId: this.studentId,
projectId: this.id,
recordId: this.recordId,
reportId: this.reportId
}
this.$get(this.api.queryArchievement,data).then(res => {
this.form = res.data.report
this.expData = res.data.data
let form = this.form
this.infoData.push({
workNumber: form.workNumber,
experimentalClassName: form.experimentalClassName,
teacherName: form.teacherName,
period: form.period,
laboratory: form.laboratory,
startTime: form.submitTime,
score: form.score,
userName: form.userName
})
}).catch(res => {});
}
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
saveAdd(){
let data = {
systemId: this.configId,
systemName: this.form.systemName,
systemType: this.form.systemType,
systemAttribution: this.form.systemAttribution,
}
if(this.configId){
this.$post(this.api.updateServiceConfig,data).then((res) => {
this.$message.success('编辑成功');
this.goback()
}).catch((res) => {
})
}else{
this.$post(this.api.updateServiceConfig,data).then((res) => {
this.$message.success('添加成功');
this.goback()
}).catch((res) => {
})
}
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
SpanMethod({ row, column, rowIndex, columnIndex }) {
if (rowIndex % 2 === 0) {
if (columnIndex === 6) {
if(!row.Intranet){
return [1, 2];
}
}
// else if (columnIndex === 1) {
// return [0, 0];
// }
}
},
goback(){
this.$router.go(-1)
},
}
}
</script>
<style lang="scss" scoped>
/deep/.el-row{
padding-top: 20px;
margin: 0 !important;
}
.form-item{
display: flex;
align-items: center;
}
.form-item .el-input{
width: auto;
}
.form-item span{
margin-right: 10px;
}
.meta-title-wrap{
display: flex;
justify-content: space-between;
}
.flex-between{
span{
font-size: 13px;
}
}
.meta-title{
margin-bottom: 10px;
font-size: 14px;
}
.step-title{
margin-bottom: 10px;
font-size: 16px;
color: #9278ff;
}
.bd-title{
padding-top: 20px;
border-top: 1px dashed #ccc;
}
</style>

@ -1,391 +0,0 @@
<template>
<div>
<el-row :gutter="20">
<el-col :span="24">
<el-card shadow="hover" class="mgb20">
<div class="flex-between">
<div class="per_title" v-preventReClick @click="goback()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">修改分数</span>
</div>
<div>
<el-button type="success" size="small" round class="mag" v-preventReClick @click="saveAdd('form')">预览</el-button>
<el-button type="primary" size="small" round class="mag" v-preventReClick @click="saveAdd('form')">发布成绩</el-button>
</div>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<h6 style="text-align: center;font-size: 20px">实验成绩报告</h6>
<div class="flex-center mgb20 user_header">
<p class="addhr_tag"></p>
<span>基本信息</span>
</div>
<div>
<el-table :data="infoData" class="table" stripe header-align="center">
<el-table-column prop="projectName" label="实验名称" align="center">
</el-table-column>
<el-table-column prop="period" label="实验学时" align="center">
</el-table-column>
<el-table-column prop="userName" label="学生姓名" align="center">
</el-table-column>
<el-table-column prop="number" label="学生学号" align="center">
</el-table-column>
<el-table-column prop="class" label="学生班级" align="center">
</el-table-column>
<el-table-column prop="content" label="实验内容" align="center">
</el-table-column>
<el-table-column prop="desc" label="实验数据与结果分析" align="center">
</el-table-column>
<el-table-column prop="result" label="实验结论" align="center">
</el-table-column>
<el-table-column prop="experience" label="实验与心得体会" align="center">
</el-table-column>
<el-table-column prop="total" label="总分" align="center">
</el-table-column>
</el-table>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验项目名称</p>
</div>
<el-input v-model="form.projectName" type="textarea" rows="5"></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验目的</p>
</div>
<el-input v-model="form.experimentGoal" type="textarea" rows="5"></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验原理</p>
</div>
<el-input v-model="form.principle" type="textarea" rows="5"></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验内容</p>
</div>
<el-input v-model="form.content" type="textarea" rows="5"></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验器材设备元器件</p>
</div>
<el-input v-model="form.step" type="textarea" rows="5"></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验步骤</p>
</div>
<el-input v-model="form.step" type="textarea" rows="5"></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验数据</p>
<span>得分50/60</span>
</div>
<el-table :data="expData" class="table" stripe header-align="center">
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
{{scope.$index + 1}}
</template>
</el-table-column>
<el-table-column prop="module" label="模块" align="center">
</el-table-column>
<el-table-column prop="judgmentPointsName" label="考核点" align="center">
</el-table-column>
<el-table-column prop="userAnswer" label="学生答案" align="center">
</el-table-column>
<el-table-column prop="answer" label="参考答案" align="center">
</el-table-column>
<el-table-column prop="codeScore" label="得分" align="center">
</el-table-column>
</el-table>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验数据及结果分析</p>
</div>
<el-table :data="expData" class="table" stripe header-align="center">
<el-table-column prop="module" label="期权平仓方式" align="center">
</el-table-column>
<el-table-column prop="judgmentPointsName" label="期权合约" align="center">
</el-table-column>
<el-table-column prop="userAnswer" label="期权合约持仓时间段" align="center">
</el-table-column>
<el-table-column prop="answer" label="期权交易方向" align="center">
</el-table-column>
<el-table-column prop="codeScore" label="委托数量" align="center">
</el-table-column>
<el-table-column prop="codeScore" label="委托价格" align="center">
</el-table-column>
<el-table-column prop="codeScore" label="期货合约" align="center">
</el-table-column>
<el-table-column prop="codeScore" label="合约持仓时间段" align="center">
</el-table-column>
<el-table-column prop="codeScore" label="交易方向" align="center">
</el-table-column>
<el-table-column prop="codeScore" label="期权/期货合约盈亏" align="center">
</el-table-column>
<el-table-column prop="codeScore" label="现货盈亏" align="center">
</el-table-column>
<el-table-column prop="codeScore" label="手续费" align="center">
</el-table-column>
<el-table-column prop="codeScore" label="总盈亏" align="center">
</el-table-column>
</el-table>
<el-input style="margin-top: 20px" v-model="form.projectName" type="textarea" rows="5"></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验结论</p>
</div>
<el-input type="textarea" v-model="form.conclusion" rows="5"></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">总结及心得体会</p>
</div>
<el-input type="textarea" v-model="form.summarize" rows="5"></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">对本实验过程及方法手段的改进建议</p>
</div>
<el-input type="textarea" rows="5" v-model="form.improvement"></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<span>老师寄语</span>
</div>
<el-input type="textarea" rows="5"></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<p class="mgb20">教师签名</p>
<div class="mgb20">
<el-radio v-model="autograph" label="1">不使用</el-radio>
<el-radio v-model="autograph" label="2">已有签名</el-radio>
<el-radio v-model="autograph" label="3">重新上传</el-radio>
</div>
<el-row v-if="autograph != 1">
<el-col :span="6">
<el-select class="sign-select" v-model="signId" placeholder="请选择签名" size="mini" v-show="autograph == 2">
<el-option
v-for="item in signList"
:key="item.id"
:label="item.signatureName"
:value="item.id"
>
</el-option>
</el-select>
<el-upload
:data="{userId: userId}"
:limit="1"
:action="api.uploadSignature"
list-type="picture-card"
:on-remove="handleRemove"
:on-exceed="handleExceed"
:on-success="uploadSuccess">
<i class="el-icon-plus"></i>
</el-upload>
</el-col>
</el-row>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
data (){
return {
userId: this.$store.state.userLoginId,
id: this.$route.query.id,
infoData: [],
accountData: [],
analysisContent: '',
showData: '1',
autograph: '1',
form: {
projectName: '',
period: '',
userName: '',
content: '',
conclusion: '',
score: '',
},
pages: 1,
ipVisible: false,
configId : this.$store.state.configId,
keyword: '',
fileList: [{name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}],
isEdit: false,
signList: [],
signId: ''
}
},
mounted(){
this.getData()
this.getSgin()
},
methods: {
getData(){
let data = {
// reportId: this.id
reportId: 97
}
this.$get(this.api.queryReport,data).then(res => {
this.form = res.data.report
this.form.score = res.data.record.score
let form = this.form
this.infoData.push({
projectName: form.projectName,
period: form.period,
userName: form.userName,
content: form.content,
conclusion: form.conclusion,
score: form.score,
analysis: form.analysis
})
}).catch(res => {});
},
getSgin(){
let data = {
userId: this.userId
}
this.$get(this.api.querySignature,data).then(res => {
this.signList = res.data
}).catch(res => {});
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
saveAdd(){
let data = {
systemId: this.configId,
systemName: this.form.systemName,
systemType: this.form.systemType,
systemAttribution: this.form.systemAttribution,
}
if(this.configId){
this.$post(this.api.updateServiceConfig,data).then((res) => {
this.$message.success('编辑成功');
this.$router.back()
}).catch((res) => {
})
}else{
this.$post(this.api.updateServiceConfig,data).then((res) => {
this.$message.success('添加成功');
this.$router.back()
}).catch((res) => {
})
}
},
SpanMethod({ row, column, rowIndex, columnIndex }) {
if (rowIndex % 2 === 0) {
if (columnIndex === 6) {
if(!row.Intranet){
return [1, 2];
}
}
// else if (columnIndex === 1) {
// return [0, 0];
// }
}
},
editMsg(){
this.isEdit = true
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
uploadSuccess(res,file){
if(res.status == 200){
this.$message.success('上传成功')
this.getSgin()
}else{
this.$message.error(res.errmessage)
}
},
goback() {
this.$confirm('确定返回?未更新的信息将不会保存。', '提示', {
type: 'warning'
})
.then(() => {
this.$router.back()
})
.catch(() => {});
}
}
}
</script>
<style lang="scss" scoped>
.meta-title{
margin-bottom: 10px;
font-size: 20px;
}
.step-title{
margin-bottom: 10px;
font-size: 16px;
color: #9278ff;
}
.border_lf{
border-left: 1px dashed #eee;
padding: 0 60px;
}
.border_lf label{
width: 120px;
}
.pad_none{
padding: 0 0 0 60px;
}
.edit-msg{
font-size: 16px;
cursor: pointer;
}
.sign-select{
/deep/.el-input{
width: 150px;
margin-bottom: 10px;
}
}
.meta-title-wrap{
display: flex;
justify-content: space-between;
}
.meta-title{
margin-bottom: 10px;
font-size: 14px;
}
.step-title{
margin-bottom: 10px;
font-size: 16px;
color: #9278ff;
}
.bd-title{
padding-top: 20px;
border-top: 1px dashed #ccc;
}
</style>

File diff suppressed because it is too large Load Diff

@ -1,232 +0,0 @@
<template>
<div class="login-wrap">
<div class="header">
<img class="logo hh" v-if="$config.isHh" src="../../assets/img/logo-hh.png" />
<img class="logo" v-else src="../../assets/img/logo.png" />
</div>
<div class="ms-login">
<div class="ms-title">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="账号登录" name="0">
<el-form :model="param" :rules="rules" ref="param" label-width="0px" style="margin-top: 40px">
<el-form-item prop="username">
<el-input v-model="param.username" placeholder="请输入账号"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
type="password"
placeholder="请输入密码"
v-model="param.password"
@keyup.enter.native="submitForm('param')"
>
</el-input>
</el-form-item>
<!-- <el-button type="text" class="forget">忘记密码?</el-button> -->
<div class="login-btn">
<el-button type="primary" @click="submitForm('param')">马上登录</el-button>
</div>
<!-- <p class="login-tips">使用第三方账号直接登录</p>
<p class="thirdParty">
<i class="icon-weixin"></i>
<i class="icon-qq"></i>
</p> -->
</el-form>
</el-tab-pane>
<el-tab-pane label="手机号/邮箱登录" name="1">
<el-form :model="phoneParam" :rules="phoneRules" ref="phoneParam" label-width="0px" style="margin-top: 40px">
<el-form-item prop="userphone">
<el-input v-model="phoneParam.userphone" placeholder="请输入手机号/邮箱"></el-input>
</el-form-item>
<el-form-item prop="phonePassword">
<el-input
type="password"
placeholder="请输入密码"
v-model="phoneParam.phonePassword"
@keyup.enter.native="submitForm('phoneParam')"
>
</el-input>
</el-form-item>
<!-- <el-button type="text" class="forget">忘记密码?</el-button> -->
<div class="login-btn">
<el-button type="primary" @click="submitForm('phoneParam')">马上登录</el-button>
</div>
</el-form>
</el-tab-pane>
</el-tabs>
</div>
</div>
<v-footer class="footer"></v-footer>
</div>
</template>
<script>
import addRoutes from '@/libs/route/addRoutes'
import vFooter from '../common/Footer'
export default {
data: function() {
return {
param: {
username: '',
password: ''
},
rules: {
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
},
phoneParam: {
userphone: '',
phonePassword: ''
},
phoneRules: {
userphone: [{ required: true, message: '请输入手机号/邮箱', trigger: 'blur' }],
phonePassword: [{ required: true, message: '请输入密码', trigger: 'blur' }],
},
activeName: '0'
};
},
components: {
vFooter,
},
methods: {
submitForm(form) {
this.$refs[form].validate(valid => {
if (valid) {
let data = {
account: this.activeName == '0' ? this.param.username : this.phoneParam.userphone,
password: this.activeName == '0' ? this.param.password : this.phoneParam.phonePassword,
source: this.activeName
}
this.$get(this.api.logins,data).then(res => {
let data = res.message.retvalue
// if(data.roleId == 1 || data.roleId == 2 || data.roleId == 3){
// this.$post(this.api.updateLogInNumber,{userId: data.userId}).then(res => {}).catch(res => {});
res.message.listValue && this.$config.dynamicRoute && addRoutes(res.message.listValue)
this.$message.success('登录成功');
sessionStorage.setItem('sta_server_username', this.activeName == '0' ? this.param.username : this.phoneParam.userphone);
this.$store.commit("userLoginData", { userLogin_id : data.userId,userRole_id: data.roleId,schoolId: data.schoolId,token: data.token,userName: data.userName});
res.message.retvalue.userAvatars && this.$store.commit("userPhoto", { avatar : res.message.retvalue.userAvatars})
this.$store.commit("dataTime", { dataTime : res.message.retvalue.dataTime});
let redirect = decodeURIComponent(this.$route.query.redirect || '/dashboard')
this.$router.replace(redirect)
// }else{
// this.$message.error('');
// }
}).catch(res => {});
} else {
this.$message.error('请输入账号和密码');
return false;
}
});
},
handleClick(tab, event) {
console.log(tab, event);
}
},
};
</script>
<style lang="scss" scoped>
.login-wrap {
position: relative;
width: 100%;
height: 100%;
background-image: url(../../assets/img/login-bg.png);
background-size: 100%;
}
.ms-title {
width: 548px;
position: absolute;
left: 50%;
top: 50px;
transform: translate(-50%,0);
}
.ms-login {
position: absolute;
left: 50%;
top: 42px;
transform: translate(-50%,0);
width: 1200px;
height: 82%;
/* height: 884px; */
margin-top: 60px;
background-image: url(../../assets/img/login-input.png);
box-shadow:0px 0px 79px 0px rgba(11,15,65,0.36);
overflow: hidden;
}
.footer{
position: absolute;
bottom: 0;
left: 0;
width: 100%;
}
.login-btn {
text-align: center;
}
.login-btn button {
width: 100%;
height: 88px;
margin-bottom: 50px;
font-weight: bold;
background:linear-gradient(90deg,rgba(94,206,253,1),rgba(91,67,231,1));
box-shadow:0px 7px 27px 0px rgba(50,129,255,0.51);
border-radius:10px;
}
.login-tips {
text-align: center;
color: #999;
font-weight:bold;
}
.forget{
width: 100%;
margin-bottom: 28px;
text-align: right;
color: #999;
font-weight:bold;
}
.thirdParty{
width: 100%;
display: flex;
justify-content: center;
margin-top: 33px;
}
/* 头部 */
.header{
width: 100%;
height: 60px;
position: absolute;
top: 0;
left: 0;
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 18px;
}
.logo{
width: 150px;
margin-left: 20px;
&.hh{
width: 220px;
}
}
.header_title{
width: 33%;
display: flex;
justify-content: space-between;
align-items: center;
}
.header_title a{
cursor: pointer;
}
.header_title a:hover{
color: blueviolet;
}
.nul{
width:80px;
margin-right: 30px;
}
</style>

@ -1,544 +0,0 @@
<template>
<!-- 编程类 -->
<div>
<el-card shadow="hover" class="mgb20">
<div class="per_title" v-preventReClick @click="goback()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">查看判分点</span>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-center mgb20 user_header">
<p class="addhr_tag"></p>
<span>基本信息</span>
</div>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="150px">
<el-form-item label="请输入判分点名称" prop="judgmentPointsName">
<el-input :disabled="true" v-model="ruleForm.judgmentPointsName"></el-input>
</el-form-item>
<el-form-item label="实验要求" prop="experimentalRequirements">
<quill :border="true" :readonly="true" v-model="ruleForm.experimentalRequirements" :minHeight="150" :height="150" />
</el-form-item>
</el-form>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-center mgb20 user_header">
<p class="addhr_tag"></p>
<span>实验代码</span>
</div>
<div class="footer_inputs1">
<p style=" text-align: center;">参考答案</p>
<textarea id="memo1" :disabled="true" v-model="ruleForm.experimentcode" style="outline:none;"></textarea>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-center mgb20 user_header">
<p class="addhr_tag"></p>
<span>判分规则</span>
</div>
<el-table
:data="tableData"
:stripe="true"
:cell-style="rowClass"
:header-cell-style="headClass"
header-align="center"
ref="editTable"
>
<el-table-column
prop="decisionPointRule"
type="index"
label="序号"
align="center"
width="80"
></el-table-column>
<el-table-column label="编译器中正确答案" align="center">
<template slot-scope="scope">
<p class="p">字段一致性规则用户编辑器中至少出现如下语句</p>
<el-input
type="textarea"
:rows="2"
v-model="scope.row.judgmentRulesRule"
:disabled="scope.row.isShow"
></el-input>
</template>
</el-table-column>
<el-table-column align="center" width="150">
<template slot-scope="scope">
<el-button
type="primary"
:disabled="scope.row.isShow"
style="cursor:pointer;border-radius: 50%;"
circle
@click="getPerhaps(scope.row)"
>{{scope.row.perhaps==0?"且":"或"}}</el-button>
</template>
</el-table-column>
<el-table-column label="终端中正确答案" align="center">
<template slot-scope="scope">
<p class="p">运行结果一致性规则用户运行结果需要与下方代码运行结果一致</p>
<el-input
type="textarea"
:rows="2"
v-model="scope.row.judgmentRulesPoint"
:disabled="scope.row.isShow"
></el-input>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-link
size="mini"
type="primary"
:underline="false"
:disabled="scope.row.isShow"
v-show="scope.row.isShow"
@click="getHandleEdit(scope.row)"
>编辑</el-link>
<el-link
type="primary"
size="mini"
:underline="false"
v-show="!scope.row.isShow"
@click="getRule(scope.row)"
>保存</el-link>
<el-link
size="mini"
type="primary"
:underline="false"
v-show="!scope.row.isShow"
@click="dialogFormVisible(scope.$index,scope.row)"
>取消</el-link>
<el-link
size="mini"
type="primary"
:underline="false"
v-show="!scope.row.isShow"
@click="getRuleDelete(scope.$index,scope.row)"
>删除</el-link>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
</template>
<script>
import quill from '@/components/common/quill'
export default {
data() {
return {
ruleForm: {
judgmentPointsName: "",
experimentalRequirements: "",
experimentcode: ""
},
tableData: [],
id: "",
rules: {
judgmentPointsName: [
{ required: true, message: "内容不能为空", trigger: "blur" }
],
experimentalRequirements: [
{ required: true, message: "实验要求不能为空", trigger: "blur" }
],
experimentcode: [
{ required: true, message: "参考答案不能为空", trigger: "blur" }
]
},
decisionPointRule: "",
systemId: this.$config.systemId,
userId: "",
ruleIds: [],
jRP: "",
jRR: "",
isAdd: false
};
},
components: {quill},
mounted() {
this.getMesg();
},
methods: {
//
getPerhaps(a) {
if (a.perhaps == 1) {
a.perhaps = "0";
} else {
a.perhaps = "1";
}
},
//()
getMesg() {
if (this.$route.query.judgmentPointsId) {
this.$get(this.api.QueryPfdInformation, {
judgmentPointsId: this.$route.query.judgmentPointsId
})
.then(res => {
res.message.rules.map(e => {
this.$set(e, "isQie", true);
this.$set(e, "isShow", true);
});
this.ruleForm = {
judgmentPointsName: res.message.point.judgmentPointsName,
experimentalRequirements:
res.message.point.experimentalRequirements,
experimentcode: res.message.point.experimentcode
};
this.tableData = res.message.rules;
let arr1 = this.tableData;
let result1 = arr1.map(e => e.decisionPointRule);
this.ruleIds = this.ruleIds.concat(result1);
// this.decisionPointRule=res.message.rules[0].decisionPointRule;
})
.catch(err => {});
}
},
goback() {
this.$router.back()
},
//
headClass() {
return "text-align: center;";
},
//
rowClass() {
return "text-align: center;";
},
//
getRule(row) {
if (!row.judgmentRulesRule || !row.judgmentRulesPoint) {
this.$message({
showClose: true,
message: "内容不能为空",
type: "warning"
});
} else {
if (row.decisionPointRule) {
this.$post(this.api.UpdatePointOfJudgementRule, {
judgmentRulesRule: row.judgmentRulesRule,
judgmentRulesPoint: row.judgmentRulesPoint,
perhaps: String(row.perhaps),
decisionPointRule: row.decisionPointRule
})
.then(res => {
this.isAdd = false;
row.isShow = true;
this.getContent();
})
.catch(err => {
console.log(err);
});
} else {
//
this.$post(this.api.AddPfdgzInformation, {
judgmentRulesRule: row.judgmentRulesRule,
judgmentRulesPoint: row.judgmentRulesPoint,
perhaps: String(row.perhaps)
})
.then(s => {
this.isAdd = false;
row.isShow = true;
this.id = s.message;
this.ruleIds.push(this.id);
console.log(this.ruleIds);
this.getContent();
})
.catch(err => {
console.log(err);
});
}
}
},
//
dialogFormVisible(index, row) {
this.isAdd = false;
if (!row.decisionPointRule) {
this.tableData.splice(index, 1);
} else {
if (!row.judgmentRulesRule || !row.judgmentRulesPoint) {
this.$message({
showClose: true,
message: "内容不能为空",
type: "warning"
});
} else {
row.isShow = true;
row.judgmentRulesRule = this.jRR;
row.judgmentRulesPoint = this.jRP;
}
}
},
//
getHandleEdit(row) {
this.isAdd = true;
row.isShow = false;
this.jRR = row.judgmentRulesRule;
this.jRP = row.judgmentRulesPoint;
},
//
getRuleDelete(index, row) {
this.getContent();
if (!row.decisionPointRule) {
this.tableData.splice(index, 1);
this.isAdd = false;
} else {
this.$confirm("此操作将永久删除该内容, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true
})
.then(() => {
this.$post(this.api.DeletePointOfJudgementRule, {
decisionPointRule: this.decisionPointRule
})
.then(res => {
this.getContent();
this.isAdd = false;
})
.catch(err => {
console.log(err);
});
this.$message({
type: "success",
message: "删除成功!"
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除"
});
});
}
},
//
getContent() {
this.$get(this.api.QueryPfdgzInformation, {
ruleIds: this.ruleIds.join()
})
.then(s => {
s.message.map(e => {
this.$set(e, "isQie", true);
this.$set(e, "isShow", true);
});
this.tableData = s.message;
this.decisionPointRule = s.message[0].decisionPointRule;
})
.catch(err => {
console.log(err);
});
},
}
};
</script>
<style lang="scss" scoped>
//
/deep/ .el-link.el-link--primary {
padding-right: 10px;
}
/deep/ .el-button {
line-height: 0;
height: 30px;
width: 80px;
margin-top: 7px;
border-radius: 20px;
position: absolute;
right: 30px;
}
/deep/ .el-input__inner {
border: 1px solid #9278ff;
}
/deep/ .el-form-item {
margin-top: 15px;
}
//
/deep/ .el-button--text {
color: #9278ff;
}
/deep/ .el-button--text:focus,
.el-button--text:hover {
color: #9278ff;
}
.border {
width: 50px;
height: 50px;
border: 1px solid #9278ff;
border-radius: 50%;
margin: auto;
}
.p {
font-size: 12px;
font-weight: 600;
}
//
/deep/ .el-textarea__inner {
height: 145px;
width: 650px;
resize: none;
border: 1px solid #9278ff;
font-size: 12px;
border-radius: 5px;
}
/deep/ .el-textarea__inner:hover {
border: 1px solid #9278ff;
}
//
/deep/ ::-webkit-scrollbar {
width: 6px; //
height: 6px; //
}
//
/deep/ ::-webkit-scrollbar-thumb {
background-color: #9278ff;
border-radius: 3px;
-webkit-box-shadow: inset 0 0 5px #dddddd;
}
/deep/ ::-webkit-scrollbar-track {
/*滚动条里面轨道*/
-webkit-box-shadow: inset 0 0 5px #dddddd;
border-radius: 0;
background: #dddddd;
}
/deep/ .el-row {
padding: 0 20px;
}
/deep/ .el-table th {
font-size: 14px;
font-family: Microsoft YaHei;
color: rgba(255, 255, 255, 1);
background-color: #9278ff;
}
/deep/ .el-table td,
.el-table th {
padding-top: 0;
}
.footer_b p {
margin: 0;
padding-left: 10px;
font-size: 14px;
}
.footer_b {
padding: 10px 0;
border-top: 1px dashed #cccccc;
margin: 0 15px;
height: 45px;
line-height: 45px;
}
//
#memo {
margin-left: 10px;
height: 200px;
width: 800px;
resize: none;
border: 1px solid #9278ff;
font-size: 12px;
border-radius: 5px;
}
#memo1 {
height: 300px;
width: 1700px;
resize: none;
border: 1px solid #9278ff;
font-size: 12px;
border-radius: 5px;
padding: 10px 20px;
}
/deep/ .el-input--suffix .el-input__inner {
border: 1px solid #9278ff;
}
.footer_input p {
font-size: 12px;
padding-right: 20px;
}
.footer_input {
padding: 30px 0 20px 80px;
}
.footer_inputs {
padding: 30px 0 20px 80px;
}
.footer_inputs1 {
padding-bottom: 50px;
text-align: center;
}
.footer_inputs1 p {
margin: 0 0 15px 0;
font-size: 14px;
}
.footer_inputs p {
font-size: 12px;
padding-right: 20px;
}
/deep/ .el-input {
width: 30%;
}
/deep/ [class*=" el-icon-"],
[class^="el-icon-"] {
line-height: 3;
padding-left: 10px;
}
.header {
background-color: #ffffff;
height: 45px;
line-height: 45px;
font-size: 14px;
font-weight: 600;
position: relative;
}
.header span {
font-size: 14px;
font-weight: 600;
padding-left: 5px;
}
.header p {
padding-left: 20px;
margin: 0;
}
.footer_h {
border-top: 1px dashed #cccccc;
border-bottom: 1px dashed #cccccc;
margin: 0 15px;
height: 45px;
line-height: 45px;
}
.flex {
display: flex;
justify-content: flex-start;
}
.footer {
background-color: #ffffff;
}
.footer_h p {
padding-left: 10px;
font-size: 14px;
margin: 0;
}
.black {
width: 8px;
height: 18px;
background-color: #333;
margin-top: 10px;
}
.content {
position: relative;
top: 10px;
}
</style>

@ -1,948 +0,0 @@
<template>
<!-- 编程类 -->
<div>
<el-card shadow="hover" class="mgb20">
<div class="per_title" v-preventReClick @click="goback()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">查看判分点</span>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex footer_h">
<div class="black"></div>
<p>基本信息</p>
</div>
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="150px"
disabled
>
<el-form-item label="请输入判分点名称" prop="judgmentPointsName">
<el-input v-model="ruleForm.judgmentPointsName"></el-input>
</el-form-item>
<el-form-item label="实验要求" prop="experimentalRequirements">
<quill :border="true" :readonly="true" v-model="ruleForm.experimentalRequirements" :minHeight="150" :height="150" />
</el-form-item>
</el-form>
<div class="flex footer_b">
<div class="black"></div>
<p>判分规则</p>
</div>
</div>
<el-row>
<el-col :span="24">
<el-card shadow="hover">
<el-form disabled>
<el-table
:data="tableData"
:stripe="true"
:cell-style="rowClass"
:header-cell-style="headClass"
header-align="center"
ref="editTable"
>
<el-table-column
prop="decisionPointRule"
type="index"
label="序号"
align="center"
width="80"
></el-table-column>
<el-table-column label="流程判分正确答案" align="center">
<template slot-scope="scope">
<template v-if="scope.row.isInput">
<p class="p">
操作一致性规则用户完成的功能操作与下方设置的操作点一致
</p>
<div class="block">
<div class="line">
<span class="label">一级栏目</span>
<div class="action">
<el-select
v-model="scope.row.levelOne"
placeholder="请选择"
size="mini"
@change="getSubject(scope.row)"
>
<el-option
v-for="(item, index) in stepList"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</div>
</div>
<div class="line">
<span class="label">子级栏目</span>
<div class="action steps">
{{ scope.row.stepName }}
<el-radio-group
class="radio-wrap"
v-model="scope.row.levelTwo"
size="mini"
@change="getOption(scope.row)"
>
<el-radio
v-for="(item, index) in scope.row.subjectList"
:key="index"
:label="item.id"
>{{ item.name }}</el-radio
>
<!-- <div class="child">
<el-radio :label="9">备选项</el-radio>
<el-radio :label="10">备选项</el-radio>
</div> -->
</el-radio-group>
</div>
</div>
</div>
</template>
</template>
</el-table-column>
<el-table-column align="center" width="150">
<template slot-scope="scope">
<el-button
v-if="scope.row.isInput"
type="primary"
:disabled="scope.row.isShow"
style="cursor: pointer; border-radius: 50%"
circle
@click="getPerhaps(scope.row)"
>{{ scope.row.operatorOne == 1 ? "且" : "或" }}</el-button
>
<el-button
v-else
type="primary"
:disabled="scope.row.isShow"
style="cursor: pointer; border-radius: 50%"
circle
@click="getPerhapsColumn(scope.row)"
>{{ operatorTwo == 1 ? "且" : "或" }}</el-button
>
</template>
</el-table-column>
<el-table-column label="交易结果正确答案" align="center">
<template slot-scope="scope">
<template v-if="scope.row.isInput">
<p class="p">
交易结果一致性规则用户交易的结果需要与下面设置的交易指标要求一致
</p>
<div class="block">
<template v-if="scope.row.levelTwo">
<template v-if="scope.row.type == 1 && scope.row.subjectName">
<div class="line">
<span class="label" style="width: auto;text-align: left">{{scope.row.subjectName}}</span>
</div>
<div class="line">
<span class="label mini">正确答案</span>
<div class="action">
<el-select
multiple
v-model="scope.row.levelFour"
placeholder="请选择"
size="mini"
style="width: 100%"
>
<el-option
v-for="(item, index) in scope.row.optionList"
:key="index"
:label="item.childrenName"
:value="item.cid"
></el-option>
</el-select>
</div>
</div>
</template>
<template v-if="scope.row.type == 2">
<div class="line">
<span class="label" style="width: auto;text-align: left">{{scope.row.subjectName}}</span>
</div>
<div class="line">
<span class="label mini">正确答案</span>
<div class="action" style="flex: none">
<el-date-picker v-model="scope.row.levelFour" type="date" placeholder="选择日期"></el-date-picker>
</div>
</div>
</template>
<template v-if="scope.row.type == 3">
<div class="line">
<span class="label">
<el-checkbox v-model="scope.row.numOfWords">字数要求</el-checkbox>
</span
>
<div class="action a-line">
<el-select
v-model="scope.row.symbol"
placeholder="请选择"
size="mini"
>
<el-option
v-for="(item, index) in symbolList"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-input
type="number"
style="margin-left: 5px"
size="mini"
v-model="scope.row.numDes"
></el-input>
</div>
</div>
<div class="line">
<span class="label">
<el-checkbox v-model="scope.row.fieldOfReq">字段要求</el-checkbox>
</span>
<div class="action">
<el-input
class="mini-textarea"
type="textarea"
cols="3"
size="mini"
v-model="scope.row.levelFour"
></el-input>
</div>
</div>
</template>
<template v-if="scope.row.type == 4">
<div class="line">
<span class="label">选择指标</span>
<div class="action">
<el-select
v-model="scope.row.levelThree"
placeholder="请选择"
size="mini"
>
<el-option
v-for="(item, index) in scope.row.optionList"
:key="index"
:label="item.childrenName"
:value="item.cid"
></el-option>
</el-select>
</div>
</div>
<div class="line">
<span class="label">交易指标区间</span>
<div class="action">
<div class="inputs">
<el-select
v-model="scope.row.symbolInput1"
placeholder="请选择"
size="mini"
>
<el-option label="(" value="("></el-option>
<el-option label="[" value="["></el-option>
</el-select>
<el-input
v-model="scope.row.symbolInput2"
size="mini"
></el-input>
<el-input
v-model="scope.row.symbolInput3"
size="mini"
></el-input>
<el-select
v-model="scope.row.symbolInput4"
placeholder="请选择"
size="mini"
>
<el-option label=")" value=")"></el-option>
<el-option label="]" value="]"></el-option>
</el-select>
</div>
</div>
</div>
</template>
</template>
</div>
</template>
</template>
</el-table-column>
</el-table>
</el-form>
</el-card>
</el-col>
</el-row>
</el-card>
</div>
</template>
<script>
import quill from '@/components/common/quill'
export default {
data() {
return {
ruleList: [],
ruleForm: {
judgmentPointsName: "",
experimentalRequirements: "",
},
tableData: [],
id: this.$route.query.id,
rules: {
judgmentPointsName: [
{ required: true, message: "判分点名称不能为空", trigger: "blur" },
],
experimentalRequirements: [
{ required: true, message: "实验要求不能为空", trigger: "blur" },
],
},
decisionPointRule: "",
systemId: "",
userId: "",
projectId: '',
isAdd: false,
stepList: [],
childPointId: "",
index: "",
symbolList: [
{
id: 1,
name: ">",
},
{
id: 2,
name: ">=",
},
{
id: 3,
name: "<",
},
{
id: 4,
name: "<=",
},
],
operatorTwo: 1,
};
},
components: {quill},
mounted() {
this.systemId = this.getCookie("systemId");
this.systemId = this.systemId ? Number(this.systemId) : 1
this.projectId = Number(this.getCookie("projectId"));
this.userId = Number(this.getCookie("userId"))
this.getData()
},
methods: {
getPerhaps(a) {
a.operatorOne = a.operatorOne == 1 ? 2 : 1
},
getPerhapsColumn() {
this.operatorTwo = this.operatorTwo == 1 ? 2 : 1
},
getMesg() {
if (this.id) {
this.$get(this.api.queryDetailsTrading, {
tradingJudgmentPointsId: this.id,
}).then((res) => {
this.ruleForm = {
judgmentPointsName: res.message.point.judgmentPointsName,
experimentalRequirements: res.message.point.experimentalRequirements,
}
let rules = res.message.rules
let ruleList = []
let len = rules.length
let result = []
rules.map((e,i) => {
e.isInput= true
e.isShow = false
e.levelOne = Number(e.levelOne)
e.levelTwo = Number(e.levelTwo)
e.subjectList = []
e.optionList = []
e.subjectName = ''
e.symbolInput1 = ''
e.symbolInput2 = ''
e.symbolInput3 = ''
e.symbolInput4 = ''
e.numOfWords = true
e.fieldOfReq = true
e.symbol = ''
e.numDes = ''
e.reqDes = ''
e.isFirst = true
ruleList.push({
operatorOne: e.operatorOne,
operatorTwo: e.operatorTwo,
type: e.type,
levelOne: e.levelOne,
levelTwo: e.levelTwo,
levelThree: e.levelThree,
levelFour: e.levelFour
})
this.getSubject(e)
if(e.type == 1){
let levelFour = e.levelFour.split(',')
levelFour = levelFour.map(n => Number(n))
this.$set(e,'levelFour',levelFour)
}else if(e.type == 2){
}else if(e.type == 3){
if(e.levelThree === ''){
e.numOfWords = false
}else{
e.symbol = this.symbolList.find(n => n.name == e.levelThree.replace(/\d+/g,'')).id
e.numDes = e.levelThree.replace(/\D+/g,'')
}
if(e.levelFour === '') e.fieldOfReq = false
}else if(e.type == 4){
e.levelThree = Number(e.levelThree)
let levelFour = e.levelFour
e.symbolInput1 = levelFour[0]
e.symbolInput2 = levelFour.substring(1,levelFour.indexOf('-'))
e.symbolInput3 = levelFour.substring(levelFour.indexOf('-') + 1,levelFour.length - 1)
e.symbolInput4 = levelFour[levelFour.length - 1]
}
result.push(e)
if(len > 1 && i != len - 1) result.push({})
})
this.operatorTwo = rules[0].operatorTwo
this.ruleList = ruleList
this.tableData = result
}).catch((err) => {})
}
},
getData() {
this.$get(this.api.firstLevel)
.then((res) => {
this.stepList = res.list
this.getMesg()
}).catch((err) => {})
},
getSubject(row) {
row.name = this.stepList.find((n) => n.id == row.levelOne).name
this.$get(`${this.api.secondaryLevel}?id=${row.levelOne}`)
.then((res) => {
row.subjectList = res.list
row.isFirst || (row.levelTwo = '')
row.isFirst && row.id && this.getOption(row)
}).catch((err) => {})
},
getOption(row) {
row.subjectName = row.subjectList.find((n) => n.id == row.levelTwo).name
this.$get(`${this.api.thirdLevel}?id=${row.levelTwo}`)
.then((res) => {
row.optionList = res.list
row.type = row.optionList[0].type
if(!row.isFirst){
row.levelThree = ''
row.levelFour = ''
row.symbolInput1 = ''
row.symbolInput2 = ''
row.symbolInput3 = ''
row.symbolInput4 = ''
row.numOfWords = true
row.fieldOfReq = true
row.symbol = ''
row.numDes = ''
row.reqDes = ''
}
row.isFirst = false
console.log(11,row)
}).catch((err) => {})
},
Savejump(formName) {
if (this.ruleList.length && this.tableData.length) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.id) {
this.tableData.map(n => {
n.id && this.getRule(n)
})
let data = {
judgmentPointsName: this.ruleForm.judgmentPointsName,
experimentalRequirements: this.ruleForm.experimentalRequirements,
id: this.id,
}
this.$post(this.api.updateTrading, data)
.then((res) => {
this.$router.back()
}).catch((err) => {})
} else {
let data = {
tradingJudgmentPoints: {
judgmentPointsName: this.ruleForm.judgmentPointsName,
experimentalRequirements: this.ruleForm.experimentalRequirements,
projectId: this.projectId,
systemId: this.systemId,
userId: this.userId
},
tradingJudgmentPointsRuleList: this.ruleList
}
this.$post(this.api.addTrading, data)
.then((res) => {
this.$router.back()
}).catch((err) => {})
}
} else {
return false;
}
})
} else {
this.$message.error("错了哦,判分规则不能为空")
}
},
getCookie(cookie_name) {
//cookiekeyvalue
var allcookies = document.cookie; //
var cookie_pos = allcookies.indexOf(cookie_name); // cookie,
if (cookie_pos != -1) {
// cookie_pos1
//cookie1=
cookie_pos = cookie_pos + cookie_name.length + 1; //cookie
var cookie_end = allcookies.indexOf(";", cookie_pos);
if (cookie_end == -1) {
cookie_end = allcookies.length;
} //cookie
var value = unescape(allcookies.substring(cookie_pos, cookie_end));
}
return value;
},
Back() {
this.$router.back();
},
headClass() {
return "text-align: center;";
},
rowClass() {
return "text-align: center;";
},
getRule(row) {
if(!row.levelOne) return this.$message.warning('一级栏目不能为空')
if(!row.levelTwo) return this.$message.warning('子级栏目不能为空')
if(!row.levelFour.length && row.type == 1){
return this.$message.warning(`正确答案不能为空`)
}
if(!row.levelThree && row.type == 4){
return this.$message.warning(`选择指标不能为空`)
}
if(row.type == 3){
if(row.numOfWords && (!row.symbol || !row.numDes)) return this.$message.warning(`字数要求不能为空`)
if(row.fieldOfReq && !row.fieldOfReq) return this.$message.warning(`字段要求不能为空`)
}
if(row.type == 4 && (!row.symbolInput1 || !row.symbolInput2 || !row.symbolInput3 || !row.symbolInput4)) return this.$message.warning('交易指标区间不能为空')
let levelThree = row.levelThree
if(row.type != 1) levelThree = levelThree + ''
let levelFour = row.levelFour
if(row.type == 1){
levelThree = row.levelTwo
levelFour = levelFour.join(',')
}else if(row.type == 2){
let date = new Date(levelFour)
levelFour = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()
levelThree = row.levelTwo
}else if(row.type == 3){
if(row.numOfWords){
levelThree = this.symbolList.find((n) => n.id == row.symbol).name + row.numDes
if(row.symbol == 6) levelThree = '无限制'
}else{
levelThree = ''
}
levelFour = row.fieldOfReq ? row.levelFour : ''
}else if(row.type == 4){
levelFour = row.symbolInput1 + row.symbolInput2 + '-' + row.symbolInput3 + row.symbolInput4
}
let data = {
operatorOne: row.operatorOne,
operatorTwo: this.operatorTwo,
type: row.type,
levelOne: row.levelOne + '',
levelTwo: row.levelTwo + '',
levelThree,
levelFour
}
if (row.id) {
data.id = row.id
this.$post(this.api.updateRuleTrading,data)
.then((res) => {
this.isAdd = false
row.isShow = true
}).catch((err) => {})
}else{
this.ruleList.push({
operatorOne: row.operatorOne,
operatorTwo: this.operatorTwo,
type: row.type,
levelOne: row.levelOne + '',
levelTwo: row.levelTwo + '',
levelThree,
levelFour
})
if(this.id){
data.tradingJudgmentPointsId = this.id
this.$post(this.api.addRule,data)
.then((res) => {
this.isAdd = false
row.isShow = true
this.getMesg()
}).catch((err) => {})
}
this.isAdd = false;
row.isShow = true;
}
},
dialogFormVisible(index, row) {
this.isAdd = false
row.isShow = true
// if (!row.id) {
// this.tableData.splice(index, 1)
// if(index == 0 && this.tableData.length > 1){
// this.tableData.splice(0,1)
// }else if(!this.tableData[index-1].isInput){
// this.tableData.splice(index-1,1)
// }
// } else {
// row.isShow = true
// }
},
getHandleEdit(row) {
this.isAdd = true
row.isShow = false
},
getRuleDelete(index, row) {
if (!row.id) {
this.tableData.splice(index, 1)
index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1)
index ? this.ruleList.splice(index - 1, 1) : this.ruleList.splice(index, 1)
this.isAdd = false
this.getMesg()
} else {
this.$confirm("此操作将永久删除该内容, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
})
.then(() => {
this.$post(this.api.deleteRuleTrading + '?id=' + row.id)
.then((res) => {
this.getMesg()
this.tableData.splice(index, 1)
this.isAdd = false
this.$message({
type: "success",
message: "删除成功!"
})
})
.catch((err) => {})
})
.catch(() => {})
}
},
AddListRow() {
this.isAdd = true;
this.tableData.length && this.tableData.push({})
this.tableData.push({
isInput: true,
isShow: false,
type: "",
levelOne: "",
levelTwo: '',
levelThree: '',
levelFour: "",
subjectList: [],
operatorOne: 1,
optionList: [],
subjectName: '',
symbolInput1: '',
symbolInput2: '',
symbolInput3: '',
symbolInput4: '',
numOfWords: true,
fieldOfReq: true,
symbol: '',
numDes: '',
reqDes: '',
})
this.$nextTick(() => {
this.scrollToTop();
});
},
scrollToTop() {
const c = document.documentElement.scrollHeight || document.body.scrollHeight;
window.scrollTo(0, c);
},
goback(){
this.$router.back()
}
},
};
</script>
<style lang="scss" scoped>
@mixin block {
padding: 10px;
border: 1px solid #e4e7ed;
border-radius: 4px;
}
//
/deep/ .el-link.el-link--primary {
padding-right: 10px;
}
/deep/ .btn {
line-height: 0;
height: 30px;
width: 80px;
margin-top: 7px;
border-radius: 20px;
position: absolute;
right: 30px;
}
/deep/ .el-input__inner {
border: 1px solid #9278ff;
&[type=number]{
padding-right: 0;
}
}
/deep/ .el-form-item {
margin-top: 15px;
}
//
/deep/ .el-button--text {
color: #9278ff;
}
/deep/ .el-button--text:focus,
.el-button--text:hover {
color: #9278ff;
}
.border {
width: 50px;
height: 50px;
border: 1px solid #9278ff;
border-radius: 50%;
margin: auto;
}
.p {
font-size: 12px;
font-weight: 600;
}
//
/deep/ .el-textarea__inner {
height: 145px;
width: 650px;
resize: none;
border: 1px solid #9278ff;
font-size: 12px;
border-radius: 5px;
}
/deep/ .el-textarea__inner:hover {
border: 1px solid #9278ff;
}
//
/deep/ ::-webkit-scrollbar {
width: 6px; //
height: 6px; //
}
//
/deep/ ::-webkit-scrollbar-thumb {
background-color: #9278ff;
border-radius: 3px;
-webkit-box-shadow: inset 0 0 5px #dddddd;
}
/deep/ ::-webkit-scrollbar-track {
/*滚动条里面轨道*/
-webkit-box-shadow: inset 0 0 5px #dddddd;
border-radius: 0;
background: #dddddd;
}
/deep/ .el-row {
padding: 0 20px;
margin-bottom: 60px;
}
/deep/ .el-table th {
font-size: 14px;
font-family: Microsoft YaHei;
color: rgba(255, 255, 255, 1);
background-color: #9278ff;
}
.footer_b p {
margin: 0;
padding-left: 10px;
font-size: 14px;
}
.footer_b {
padding: 10px 0;
border-top: 1px dashed #cccccc;
margin: 0 15px;
height: 45px;
line-height: 45px;
}
//
#memo {
margin-left: 10px;
height: 200px;
width: 800px;
resize: none;
border: 1px solid #9278ff;
font-size: 12px;
border-radius: 5px;
}
#memo1 {
height: 300px;
width: 1700px;
resize: none;
border: 1px solid #9278ff;
font-size: 12px;
border-radius: 5px;
padding: 10px 20px;
}
/deep/ .el-input--suffix .el-input__inner {
border: 1px solid #9278ff;
}
.footer_input p {
font-size: 12px;
padding-right: 20px;
}
.footer_input {
padding: 30px 0 20px 80px;
}
.footer_inputs {
padding: 30px 0 20px 80px;
}
.footer_inputs1 {
padding-bottom: 50px;
text-align: center;
}
.footer_inputs1 p {
margin: 0 0 15px 0;
font-size: 14px;
}
.footer_inputs p {
font-size: 12px;
padding-right: 20px;
}
/deep/ .el-input {
width: 30%;
}
.header {
background-color: #ffffff;
height: 45px;
line-height: 45px;
font-size: 14px;
font-weight: 600;
position: relative;
}
.header span {
font-size: 14px;
font-weight: 600;
padding-left: 5px;
}
.header p {
padding-left: 20px;
margin: 0;
}
.footer_h {
margin: 0 15px;
height: 45px;
line-height: 45px;
}
.flex {
display: flex;
justify-content: flex-start;
}
.footer {
background-color: #ffffff;
}
.footer_h p {
padding-left: 10px;
font-size: 14px;
margin: 0;
}
.black {
width: 8px;
height: 18px;
background-color: #333;
margin-top: 10px;
}
.content {
position: relative;
top: 10px;
}
.back {
line-height: 3;
padding-left: 10px;
}
.block {
@include block;
height: 230px;
background-color: #fff;
.line {
display: flex;
align-items: center;
margin: 10px 0;
.label {
width: 100px;
margin-right: 10px;
text-align: right;
font-size: 12px;
}
.action {
flex: 1;
text-align: left;
/deep/.el-input {
width: 100%;
}
&.steps {
@include block;
display: inline-flex;
flex-direction: column;
height: 150px;
font-size: 12px;
overflow: auto;
.radio-wrap {
display: flex;
flex-direction: column;
.child {
display: flex;
flex-direction: column;
margin-left: 15px;
}
/deep/.el-radio {
margin: 3px 0;
}
}
}
.inputs {
display: flex;
align-items: center;
/deep/.el-input {
width: 100px;
margin: 0 5px;
&:first-child {
margin-left: 0;
}
}
}
&.a-line {
display: inline-flex;
}
.mini-textarea,
/deep/.mini-textarea .el-textarea__inner {
width: 100%;
}
}
}
}
</style>

@ -1,960 +0,0 @@
<template>
<!-- 编程类 -->
<div>
<el-card shadow="hover" class="mgb20">
<div class="per_title" v-preventReClick @click="goback()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">查看判分点</span>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20 user_header">
<p class="addhr_tag"></p>
<p>基本信息</p>
</div>
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="150px"
disabled
>
<el-form-item label="请输入判分点名称" prop="judgmentPointsName">
<el-input v-model="ruleForm.judgmentPointsName"></el-input>
</el-form-item>
<el-form-item label="实验要求" prop="experimentalRequirements">
<quill :border="true" :readonly="true" v-model="ruleForm.experimentalRequirements" :minHeight="150" :height="150" />
</el-form-item>
</el-form>
<div class="flex-center mgb20 user_header">
<p class="addhr_tag"></p>
<p>判分规则</p>
</div>
</div>
<el-row>
<el-col :span="24">
<el-card shadow="hover">
<el-form disabled>
<el-table
:data="tableData"
:stripe="true"
:cell-style="rowClass"
:header-cell-style="headClass"
header-align="center"
ref="editTable"
>
<el-table-column
prop="decisionPointRule"
type="index"
label="序号"
align="center"
width="80"
></el-table-column>
<el-table-column label="流程判分正确答案" align="center">
<template slot-scope="scope">
<template v-if="scope.row.isInput">
<p class="p">
操作一致性规则用户完成的功能操作与下方设置的操作点一致
</p>
<div class="block">
<div class="line">
<span class="label">一级栏目</span>
<div class="action">
<el-select
v-model="scope.row.levelOne"
placeholder="请选择"
size="mini"
@change="getSubject(scope.row)"
>
<el-option
v-for="(item, index) in stepList"
:key="index"
:label="item.stepName"
:value="item.id"
></el-option>
</el-select>
</div>
</div>
<div class="line">
<span class="label">子级栏目</span>
<div class="action steps">
{{ scope.row.stepName }}
<el-radio-group
class="radio-wrap"
v-model="scope.row.levelTwo"
size="mini"
@change="getOption(scope.row)"
>
<el-radio
v-for="(item, index) in scope.row.subjectList"
:key="index"
:label="item.id"
>{{ item.kdSubjectName }}</el-radio
>
<!-- <div class="child">
<el-radio :label="9">备选项</el-radio>
<el-radio :label="10">备选项</el-radio>
</div> -->
</el-radio-group>
</div>
</div>
</div>
</template>
</template>
</el-table-column>
<el-table-column align="center" width="150">
<template slot-scope="scope">
<el-button
v-if="scope.row.isInput"
type="primary"
:disabled="scope.row.isShow"
style="cursor: pointer; border-radius: 50%"
circle
@click="getPerhaps(scope.row)"
>{{ scope.row.operatorOne == 1 ? "且" : "或" }}</el-button
>
<el-button
v-else
type="primary"
:disabled="scope.row.isShow"
style="cursor: pointer; border-radius: 50%"
circle
@click="getPerhapsColumn(scope.row)"
>{{ operatorTwo == 1 ? "且" : "或" }}</el-button
>
</template>
</el-table-column>
<el-table-column label="交易结果正确答案" align="center">
<template slot-scope="scope">
<template v-if="scope.row.isInput">
<p class="p">
交易结果一致性规则用户交易的结果需要与下面设置的交易指标要求一致
</p>
<div class="block">
<template v-if="scope.row.type == 1 && scope.row.subjectName">
<div class="line">
<span class="label" style="width: auto;text-align: left">{{scope.row.subjectName}}</span>
</div>
<div class="line">
<div class="action">
<el-select
v-model="scope.row.levelThree"
placeholder="请选择"
size="mini"
>
<el-option
v-for="(item, index) in scope.row.optionList"
:key="index"
:label="item.itemDescription"
:value="item.id"
></el-option>
</el-select>
</div>
</div>
</template>
<template v-if="scope.row.type == 2">
<div class="line">
<span class="label">交易指标区间</span>
<div class="action">
<div class="inputs">
<el-select
v-model="scope.row.symbolInput1"
placeholder="请选择"
size="mini"
>
<el-option label="(" value="("></el-option>
<el-option label="[" value="["></el-option>
</el-select>
<el-input
v-model="scope.row.symbolInput2"
size="mini"
></el-input>
<el-input
v-model="scope.row.symbolInput3"
size="mini"
></el-input>
<el-select
v-model="scope.row.symbolInput4"
placeholder="请选择"
size="mini"
>
<el-option label=")" value=")"></el-option>
<el-option label="]" value="]"></el-option>
</el-select>
</div>
</div>
</div>
</template>
<template v-if="scope.row.type == 3">
<div class="line">
<span class="label">
<el-checkbox v-model="scope.row.numOfWords">字数要求</el-checkbox>
</span
>
<div class="action a-line">
<el-select
v-model="scope.row.symbol"
placeholder="请选择"
size="mini"
>
<el-option
v-for="(item, index) in symbolList"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-input
type="number"
style="margin-left: 5px"
size="mini"
v-model="scope.row.numDes"
></el-input>
</div>
</div>
<div class="line">
<span class="label">
<el-checkbox v-model="scope.row.fieldOfReq">字段要求</el-checkbox>
</span>
<div class="action">
<el-input
class="mini-textarea"
type="textarea"
cols="3"
size="mini"
v-model="scope.row.levelFour"
></el-input>
</div>
</div>
</template>
<template v-if="scope.row.type == 4">
<div class="line">
<span class="label">选择指标</span>
<div class="action">
<el-select
v-model="scope.row.levelThree"
placeholder="请选择"
size="mini"
>
<el-option
v-for="(item, index) in scope.row.optionList"
:key="index"
:label="item.itemDescription"
:value="item.id"
></el-option>
</el-select>
</div>
</div>
<div class="line">
<span class="label">交易指标区间</span>
<div class="action">
<div class="inputs">
<el-select
v-model="scope.row.symbolInput1"
placeholder="请选择"
size="mini"
>
<el-option label="(" value="("></el-option>
<el-option label="[" value="["></el-option>
</el-select>
<el-input
v-model="scope.row.symbolInput2"
size="mini"
></el-input>
<el-input
v-model="scope.row.symbolInput3"
size="mini"
></el-input>
<el-select
v-model="scope.row.symbolInput4"
placeholder="请选择"
size="mini"
>
<el-option label=")" value=")"></el-option>
<el-option label="]" value="]"></el-option>
</el-select>
</div>
</div>
</div>
</template>
</div>
</template>
</template>
</el-table-column>
</el-table>
</el-form>
</el-card>
</el-col>
</el-row>
</el-card>
</div>
</template>
<script>
import quill from '@/components/common/quill'
export default {
data() {
return {
ruleList: [],
ruleForm: {
judgmentPointsName: "",
experimentalRequirements: "",
},
tableData: [],
id: this.$route.query.id,
rules: {
judgmentPointsName: [
{ required: true, message: "判分点名称不能为空", trigger: "blur" },
],
experimentalRequirements: [
{ required: true, message: "实验要求不能为空", trigger: "blur" },
],
},
decisionPointRule: "",
systemId: "",
userId: "",
projectId: '',
isAdd: false,
stepList: [],
childPointId: "",
index: "",
symbolList: [
{
id: 1,
name: ">",
},
{
id: 2,
name: "<",
},
{
id: 3,
name: "=",
},
{
id: 4,
name: ">=",
},
{
id: 5,
name: "<=",
},
{
id: 6,
name: "无限制",
},
],
operatorTwo: 1,
};
},
components: {quill},
mounted() {
this.systemId = this.getCookie("systemId");
this.systemId = this.systemId ? Number(this.systemId) : 1
this.projectId = Number(this.getCookie("projectId"));
this.userId = Number(this.getCookie("userId"))
this.getData()
},
methods: {
getPerhaps(a) {
a.operatorOne = a.operatorOne == 1 ? 2 : 1
},
getPerhapsColumn() {
this.operatorTwo = this.operatorTwo == 1 ? 2 : 1
},
getMesg() {
if (this.id) {
this.$get(this.api.queryDetailsTrading, {
tradingJudgmentPointsId: this.id,
}).then((res) => {
this.ruleForm = {
judgmentPointsName: res.message.point.judgmentPointsName,
experimentalRequirements: res.message.point.experimentalRequirements,
}
let rules = res.message.rules
let ruleList = []
let len = rules.length
let result = []
rules.map((e,i) => {
e.isInput= true
e.isShow = false
e.levelOne = Number(e.levelOne)
e.levelTwo = Number(e.levelTwo)
e.subjectList = []
e.optionList = []
e.subjectName = ''
e.symbolInput1 = ''
e.symbolInput2 = ''
e.symbolInput3 = ''
e.symbolInput4 = ''
e.numOfWords = true
e.fieldOfReq = true
e.symbol = ''
e.numDes = ''
e.reqDes = ''
e.isFirst = true
ruleList.push({
operatorOne: e.operatorOne,
operatorTwo: e.operatorTwo,
type: e.type,
levelOne: e.levelOne,
levelTwo: e.levelTwo,
levelThree: e.levelThree,
levelFour: e.levelFour
})
this.getSubject(e)
if(e.type == 1){
this.$set(e,'levelThree',Number(e.levelThree))
}else if(e.type == 2){
let levelThree = e.levelThree
e.symbolInput1 = levelThree[0]
e.symbolInput2 = levelThree.substring(1,levelThree.indexOf('-'))
e.symbolInput3 = levelThree.substring(levelThree.indexOf('-') + 1,levelThree.length - 1)
e.symbolInput4 = levelThree[levelThree.length - 1]
}else if(e.type == 3){
if(e.levelThree === ''){
e.numOfWords = false
}else{
e.symbol = this.symbolList.find(n => n.name == e.levelThree.replace(/\d+/g,'')).id
e.numDes = e.levelThree.replace(/\D+/g,'')
}
if(e.levelFour === '') e.fieldOfReq = false
}else if(e.type == 4){
e.levelThree = Number(e.levelThree)
let levelFour = e.levelFour
e.symbolInput1 = levelFour[0]
e.symbolInput2 = levelFour.substring(1,levelFour.indexOf('-'))
e.symbolInput3 = levelFour.substring(levelFour.indexOf('-') + 1,levelFour.length - 1)
e.symbolInput4 = levelFour[levelFour.length - 1]
}
result.push(e)
if(len > 1 && i != len - 1) result.push({})
})
this.operatorTwo = rules[0].operatorTwo
this.ruleList = ruleList
this.tableData = result
}).catch((err) => {})
}
},
getData() {
this.$post(this.api.queryPoint)
.then((res) => {
this.stepList = res.subject
this.getMesg()
}).catch((err) => {})
},
getSubject(row) {
row.stepName = this.stepList.find((n) => n.id == row.levelOne).stepName;
let data = row.levelOne;
this.$post(this.api.querySubject, data)
.then((res) => {
row.subjectList = res.subject
row.type = row.subjectList[0].isChallenge
row.isFirst && row.id && this.getOption(row)
}).catch((err) => {})
},
getOption(row) {
row.subjectName = row.subjectList.find((n) => n.id == row.levelTwo).kdSubjectDescipription;
let data = row.levelTwo;
this.$post(this.api.queryItem, data)
.then((res) => {
row.optionList = res.subject
row.isFirst || (row.levelThree = '')
row.isFirst = false
}).catch((err) => {})
},
Savejump(formName) {
if (this.ruleList.length) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.id) {
let data = {
judgmentPointsName: this.ruleForm.judgmentPointsName,
experimentalRequirements: this.ruleForm.experimentalRequirements,
id: this.id,
}
this.$post(this.api.updateTrading, data)
.then((res) => {
this.$router.back()
}).catch((err) => {})
} else {
let data = {
tradingJudgmentPoints: {
judgmentPointsName: this.ruleForm.judgmentPointsName,
experimentalRequirements: this.ruleForm.experimentalRequirements,
projectId: this.projectId,
systemId: this.systemId,
userId: this.userId
},
tradingJudgmentPointsRuleList: this.ruleList
}
this.$post(this.api.addTrading, data)
.then((res) => {
this.$router.back()
}).catch((err) => {})
}
} else {
console.log("error submit!!");
return false;
}
})
this.getRule(this.tableData[0])
} else {
this.$message.error("错了哦,判分规则不能为空")
}
},
getCookie(cookie_name) {
//cookiekeyvalue
var allcookies = document.cookie; //
var cookie_pos = allcookies.indexOf(cookie_name); // cookie,
if (cookie_pos != -1) {
// cookie_pos1
//cookie1=
cookie_pos = cookie_pos + cookie_name.length + 1; //cookie
var cookie_end = allcookies.indexOf(";", cookie_pos);
if (cookie_end == -1) {
cookie_end = allcookies.length;
} //cookie
var value = unescape(allcookies.substring(cookie_pos, cookie_end));
}
return value;
},
Back() {
this.$router.back();
},
headClass() {
return "text-align: center;";
},
rowClass() {
return "text-align: center;";
},
getRule(row) {
if(!row.levelOne) return this.$message.warning('一级栏目不能为空')
if(!row.levelTwo) return this.$message.warning('子级栏目不能为空')
if(!row.levelThree && (row.type == 1 || row.type == 4)){
let msg = ''
if(row.type == 1) msg = '正确答案'
if(row.type == 4) msg = '选择指标'
return this.$message.warning(`${msg}不能为空`)
}
if(row.type == 3){
if(row.numOfWords && (!row.symbol || !row.numDes)) return this.$message.warning(`字数要求不能为空`)
if(row.fieldOfReq && !row.fieldOfReq) return this.$message.warning(`字段要求不能为空`)
}
if((row.type == 2 || row.type == 4) && (!row.symbolInput1 || !row.symbolInput2 || !row.symbolInput3 || !row.symbolInput4)) return this.$message.warning('交易指标区间不能为空')
let levelThree = row.levelThree + ''
let levelFour = row.levelFour
if(row.type == 2){
levelThree = row.symbolInput1 + row.symbolInput2 + '-' + row.symbolInput3 + row.symbolInput4
}else if(row.type == 3){
if(row.numOfWords){
levelThree = this.symbolList.find((n) => n.id == row.symbol).name + row.numDes
if(row.symbol == 6) levelThree = '无限制'
}else{
levelThree = ''
}
levelFour = row.fieldOfReq ? row.levelFour : ''
}else if(row.type == 4){
levelFour = row.symbolInput1 + row.symbolInput2 + '-' + row.symbolInput3 + row.symbolInput4
}
let data = {
operatorOne: row.operatorOne,
operatorTwo: this.operatorTwo,
type: row.type,
// type: 1,
levelOne: row.levelOne + '',
levelTwo: row.levelTwo + '',
levelThree,
levelFour
}
if (row.id) {
data.id = row.id
this.$post(this.api.updateRuleTrading,data)
.then((res) => {
this.isAdd = false
row.isShow = true
}).catch((err) => {})
}else{
this.ruleList.push({
operatorOne: row.operatorOne,
operatorTwo: this.operatorTwo,
type: row.type,
// type: 1,
levelOne: row.levelOne + '',
levelTwo: row.levelTwo + '',
levelThree,
levelFour
})
if(this.id){
data.tradingJudgmentPointsId = this.id
this.$post(this.api.addRule,data)
.then((res) => {
this.isAdd = false
row.isShow = true
this.getMesg()
}).catch((err) => {})
}
this.isAdd = false;
row.isShow = true;
}
},
dialogFormVisible(index, row) {
this.isAdd = false;
if (!row.decisionPointRule) {
this.tableData.splice(index, 1);
} else {
if (!row.judgmentRulesRule || !row.judgmentRulesPoint) {
this.$message({
showClose: true,
message: "内容不能为空",
type: "warning",
});
} else {
row.isShow = true;
row.judgmentRulesRule = this.jRR;
row.judgmentRulesPoint = this.jRP;
}
}
},
getHandleEdit(row) {
this.isAdd = true
row.isShow = false
this.jRR = row.judgmentRulesRule
this.jRP = row.judgmentRulesPoint
},
getRuleDelete(index, row) {
if (!row.id) {
this.tableData.splice(index, 1)
this.isAdd = false
this.getMesg()
} else {
this.$confirm("此操作将永久删除该内容, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
})
.then(() => {
this.$post(this.api.deleteRuleTrading + '?id=' + row.id)
.then((res) => {
this.getMesg()
this.tableData.splice(index, 1)
this.isAdd = false
this.$message({
type: "success",
message: "删除成功!"
})
})
.catch((err) => {})
})
.catch(() => {})
}
},
AddListRow() {
this.isAdd = true;
this.tableData.length && this.tableData.push({})
this.tableData.push({
isInput: true,
isShow: false,
type: "",
levelOne: "",
levelTwo: '',
levelThree: '',
levelFour: "",
subjectList: [],
operatorOne: 1,
optionList: [],
subjectName: '',
symbolInput1: '',
symbolInput2: '',
symbolInput3: '',
symbolInput4: '',
numOfWords: true,
fieldOfReq: true,
symbol: '',
numDes: '',
reqDes: '',
})
this.$nextTick(() => {
this.scrollToTop();
});
},
scrollToTop() {
const c = document.documentElement.scrollHeight || document.body.scrollHeight;
window.scrollTo(0, c);
},
goback(){
this.$router.back()
}
},
};
</script>
<style lang="scss" scoped>
@mixin block {
padding: 10px;
border: 1px solid #e4e7ed;
border-radius: 4px;
}
//
/deep/ .el-link.el-link--primary {
padding-right: 10px;
}
/deep/ .btn {
line-height: 0;
height: 30px;
width: 80px;
margin-top: 7px;
border-radius: 20px;
position: absolute;
right: 30px;
}
/deep/ .el-input__inner {
border: 1px solid #9278ff;
&[type=number]{
padding-right: 0;
}
}
/deep/ .el-form-item {
margin-top: 15px;
}
//
/deep/ .el-button--text {
color: #9278ff;
}
/deep/ .el-button--text:focus,
.el-button--text:hover {
color: #9278ff;
}
.border {
width: 50px;
height: 50px;
border: 1px solid #9278ff;
border-radius: 50%;
margin: auto;
}
.p {
font-size: 12px;
font-weight: 600;
}
//
/deep/ .el-textarea__inner {
height: 145px;
width: 650px;
resize: none;
border: 1px solid #9278ff;
font-size: 12px;
border-radius: 5px;
}
/deep/ .el-textarea__inner:hover {
border: 1px solid #9278ff;
}
//
/deep/ ::-webkit-scrollbar {
width: 6px; //
height: 6px; //
}
//
/deep/ ::-webkit-scrollbar-thumb {
background-color: #9278ff;
border-radius: 3px;
-webkit-box-shadow: inset 0 0 5px #dddddd;
}
/deep/ ::-webkit-scrollbar-track {
/*滚动条里面轨道*/
-webkit-box-shadow: inset 0 0 5px #dddddd;
border-radius: 0;
background: #dddddd;
}
/deep/ .el-row {
padding: 0 20px;
margin-bottom: 60px;
}
/deep/ .el-table th {
font-size: 14px;
font-family: Microsoft YaHei;
color: rgba(255, 255, 255, 1);
background-color: #9278ff;
}
.footer_b p {
margin: 0;
padding-left: 10px;
font-size: 14px;
}
.footer_b {
padding: 10px 0;
border-top: 1px dashed #cccccc;
margin: 0 15px;
height: 45px;
line-height: 45px;
}
//
#memo {
margin-left: 10px;
height: 200px;
width: 800px;
resize: none;
border: 1px solid #9278ff;
font-size: 12px;
border-radius: 5px;
}
#memo1 {
height: 300px;
width: 1700px;
resize: none;
border: 1px solid #9278ff;
font-size: 12px;
border-radius: 5px;
padding: 10px 20px;
}
/deep/ .el-input--suffix .el-input__inner {
border: 1px solid #9278ff;
}
.footer_input p {
font-size: 12px;
padding-right: 20px;
}
.footer_input {
padding: 30px 0 20px 80px;
}
.footer_inputs {
padding: 30px 0 20px 80px;
}
.footer_inputs1 {
padding-bottom: 50px;
text-align: center;
}
.footer_inputs1 p {
margin: 0 0 15px 0;
font-size: 14px;
}
.footer_inputs p {
font-size: 12px;
padding-right: 20px;
}
/deep/ .el-input {
width: 30%;
}
.header {
background-color: #ffffff;
height: 45px;
line-height: 45px;
font-size: 14px;
font-weight: 600;
position: relative;
}
.header span {
font-size: 14px;
font-weight: 600;
padding-left: 5px;
}
.header p {
padding-left: 20px;
margin: 0;
}
.footer_h {
margin: 0 15px;
height: 45px;
line-height: 45px;
}
.flex {
display: flex;
justify-content: flex-start;
}
.footer {
background-color: #ffffff;
}
.footer_h p {
padding-left: 10px;
font-size: 14px;
margin: 0;
}
.black {
width: 8px;
height: 18px;
background-color: #333;
margin-top: 10px;
}
.content {
position: relative;
top: 10px;
}
.back {
line-height: 3;
padding-left: 10px;
}
.block {
@include block;
height: 230px;
background-color: #fff;
.line {
display: flex;
align-items: center;
margin: 10px 0;
.label {
width: 100px;
margin-right: 10px;
text-align: right;
font-size: 12px;
}
.action {
flex: 1;
text-align: left;
/deep/.el-input {
width: 100%;
}
&.steps {
@include block;
display: inline-flex;
flex-direction: column;
height: 150px;
font-size: 12px;
overflow: auto;
.radio-wrap {
display: flex;
flex-direction: column;
.child {
display: flex;
flex-direction: column;
margin-left: 15px;
}
/deep/.el-radio {
margin: 3px 0;
}
}
}
.inputs {
display: flex;
align-items: center;
/deep/.el-input {
width: 100px;
margin: 0 5px;
&:first-child {
margin-left: 0;
}
}
}
&.a-line {
display: inline-flex;
}
.mini-textarea,
/deep/.mini-textarea .el-textarea__inner {
width: 100%;
}
}
}
}
</style>

@ -1,280 +0,0 @@
<template>
<div>
<el-row :gutter="20">
<el-col :span="24">
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>实验报告</span>
</div>
<div>
<el-form label-width="80px">
<el-col :span="8">
<el-form-item label="时间" class="userRadio">
<el-radio-group v-model="form.time">
<el-radio v-for="(item,index) in timeList" :key="index" :label="item.id" border>{{item.name}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="时间范围">
<el-date-picker
v-model="timeRange"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
</el-col>
</el-form>
</div>
</div>
</el-card>
</el-col>
<el-col :span="24">
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<el-tabs v-model="curTab" @tab-click="tabChange">
<el-tab-pane label="全部(100)" name="all"></el-tab-pane>
<el-tab-pane label="待评分(20)" name="wait"></el-tab-pane>
<el-tab-pane label="已完成(20)" name="already"></el-tab-pane>
</el-tabs>
<div>
<el-input placeholder="请输入关键词" prefix-icon="el-icon-search" v-model="form.keyword" clearable @keyup.enter.native="onSearch"></el-input>
</div>
</div>
<el-table :data="customerData" class="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>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
{{scope.$index + (pageNo - 1) * pageSize + 1}}
</template>
</el-table-column>
<el-table-column prop="schoolName" label="实验名称" align="center">
</el-table-column>
<el-table-column prop="countries" label="学校" align="center">
</el-table-column>
<el-table-column label="学生姓名" align="center">
<template slot-scope="scope">
<span class="ellipsis">{{scope.row.industryName}}</span>
</template>
</el-table-column>
<el-table-column prop="provinceName" label="分数" align="center">
</el-table-column>
<el-table-column prop="adminName" label="状态" align="center">
</el-table-column>
<el-table-column prop="adminPhone" label="提交时间" align="center">
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button v-if="false" type="text">评分</el-button>
<el-button v-else type="text" @click="edit(scope.row)">修改分数</el-button>
<el-button type="text" @click="permission">查看报告</el-button>
<el-button 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="totals" @current-change="handleCurrentChange" :current-page="pageNo">
</el-pagination>
</div>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import bus from '../common/bus';
export default {
name: 'dashboard',
data() {
return {
name: sessionStorage.getItem('ms_username'),
countryList: [{
name:'中国'
}],
customerData: [],
form: {
countries:'中国',
provinces: '',
city: '',
keyword: ''
},
multipleSelection: [],
timeList: [
{
id: 1,
name: '不限'
},
{
id: 2,
name: '近一个月'
},
{
id: 3,
name: '近六个月'
}
],
timeRange: '',
curTab: 'all',
provinceList: [],
cityList: [],
pageNo: 1,
pageSize: 10,
totals: 1,
ruleIds: []
};
},
components: {
},
computed: {
role() {
return this.name === 'admin' ? '超级管理员' : '普通用户';
}
},
mounted() {
this.getData()
this.getProvince()
},
methods: {
getData() {
let data = {
countries: this.form.countries,
provinceId: this.form.provinces,
cityId: this.form.city,
searchContent: this.form.keyword,
pageNo: this.pageNo,
pageSize: this.pageSize
}
this.$get(this.api.queryCustomer,data).then(res => {
this.customerData = res.message.rows
this.totals = res.message.total
}).catch(res => {});
},
getProvince(){
this.$get(this.api.queryProvince).then(res => {
this.provinceList = res.message
this.$store.commit("provinceData", { provinceList : this.provinceList});
}).catch(res => {});
},
//
clearprovince(){
this.form.city = ''
},
getCity(){
this.clearprovince()
this.getCityData()
this.pageNo = 1
this.getData()
},
getCityData(){
let data = {
provinceId: this.form.provinces
}
this.$get(this.api.queryCity,data).then(res => {
this.cityList = res.message
}).catch(res => {});
},
permission(){
this.$router.push('/permission')
},
addcustomer(){
this.$store.commit("customerData", { customer_id : ''});
this.$router.push('/addcustomer');
},
edit(row){
this.$store.commit("customerData", { customer_id : row.customerId });
this.$router.push('/addcustomer');
},
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
let str = '';
str += row.customerId+',';
var deleteList = str.split(',').map(Number);
deleteList.pop()
var arr = [];
var signAgainReq = new Object();
signAgainReq.customerId = deleteList[0];
arr.push(signAgainReq);
let data = {
customer: arr
}
this.$post(this.api.deleteCustomer,data).then(res => {
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
},
getRowKeys(row) {
return row.customerId;
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
delAllSelection() {
if(this.multipleSelection.length != ''){
const length = this.multipleSelection.length;
let str = '';
for (let i = 0; i < length; i++) {
str += this.multipleSelection[i].customerId+',';
}
var deleteList = str.split(',').map(Number);
deleteList.pop()
var arr = [];
for(var i = 0,len = deleteList.length; i < len; i++){
var signAgainReq = new Object();
signAgainReq.customerId = deleteList[i];
arr.push(signAgainReq);
}
//
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
let data = {
customer: arr
}
this.$post(this.api.deleteCustomer,data).then(res => {
this.multipleSelection = [];
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
}).catch(() => {});
}else{
this.$message.error('请先选择客户 !');
}
},
onSearch(){
this.pageNo = 1
this.getData()
},
handleCurrentChange(val) {
this.pageNo = val;
this.getData();
},
tabChange(tab,event) {
console.log(tab,event)
}
}
};
</script>
<style scoped>
.mag{
margin-right: 20px;
}
/deep/.el-tabs__nav-wrap::after{
display: none;
}
</style>

@ -1,461 +0,0 @@
<template>
<div>
<el-row :gutter="20">
<el-col :span="24">
<el-card shadow="hover" class="mgb20">
<div class="flex-between">
<div class="per_title" v-preventReClick @click="goback()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">实验报告配置</span>
</div>
<div>
<el-button type="primary" size="small" round v-preventReClick>确定</el-button>
</div>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div>
<p class="mgb20">实验报告名称</p>
<el-input
placeholder="请输入实验报告名称"
clearable
maxlength="15"
class="inline-input"
></el-input>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-center mgb20">
<p class="addhr_tag"></p>
<span>基本信息</span>
</div>
<div>
<el-form inline class="inline-form">
<div class="inner">
<el-form-item label="学生姓名">
<el-input placeholder="" size="small"></el-input>
</el-form-item>
<el-form-item label="学生学号">
<el-input placeholder="" size="small"></el-input>
</el-form-item>
<el-form-item label="学生班级">
<el-input placeholder="" size="small"></el-input>
</el-form-item>
</div>
<div class="inner">
<el-form-item label="实验名称">
<el-input placeholder="" size="small"></el-input>
</el-form-item>
<el-form-item label="实验学时">
<el-input placeholder="" size="small"></el-input>
</el-form-item>
</div>
</el-form>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>实验目的</span>
</div>
<div>
<span>得分0/60</span>
<el-button class="ml10" type="primary" size="small" v-preventReClick>编辑</el-button>
</div>
</div>
<el-input type="textarea" rows="5" disabled></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>实验原理</span>
</div>
<div>
<span>得分0/60</span>
<el-button class="ml10" type="primary" size="small" v-preventReClick>编辑</el-button>
</div>
</div>
<el-input type="textarea" rows="5" disabled></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>实验步骤</span>
</div>
<div>
<span>得分0/60</span>
<el-button class="ml10" type="primary" size="small" v-preventReClick>编辑</el-button>
</div>
</div>
<el-input type="textarea" rows="5" disabled></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>实验结果分析</span>
</div>
<div>
<span>得分0/60</span>
<el-button class="ml10" type="primary" size="small" v-preventReClick>编辑</el-button>
</div>
</div>
<div class="block">
<div class="flex-between mb10">
<p class="l-title">步骤1 判断平价关系确定交易方向</p>
<el-switch></el-switch>
</div>
<div class="inner">
<el-checkbox>日期</el-checkbox>
<el-checkbox>品种</el-checkbox>
</div>
<div>
<div class="flex-between">
<div class="inline-flex">
<el-checkbox></el-checkbox>
<span>设置结论选项</span>
<div class="input-wrap">
<div class="input" v-for="(item,index) in conclusion1" :key="index">
<el-input size="mini" v-model="item.val"></el-input>
<i class="plus el-icon-circle-plus-outline" @click="addColumn(1)"></i>
<i class="sub el-icon-remove-outline" v-if="conclusion1.length > 1" @click="delColumn(1,index)"></i>
</div>
</div>
</div>
<p>(0/0)</p>
</div>
<div class="flex-between">
<div class="inline-flex">
<el-checkbox></el-checkbox>
<span>设置主观题</span>
<el-input size="mini"></el-input>
</div>
<p>(0/0)</p>
</div>
</div>
</div>
<div class="block">
<div class="flex-between mb10">
<p class="l-title">步骤2 选择期货期权套利策略</p>
<el-switch></el-switch>
</div>
<div class="inner">
<el-checkbox>策略</el-checkbox>
<el-checkbox>套利组合</el-checkbox>
</div>
<div>
<div class="flex-between">
<div class="inline-flex">
<el-checkbox></el-checkbox>
<span>设置结论选项</span>
<div class="input-wrap">
<div class="input" v-for="(item,index) in conclusion2" :key="index">
<el-input size="mini" v-model="item.val"></el-input>
<i class="plus el-icon-circle-plus-outline" @click="addColumn(2)"></i>
<i class="sub el-icon-remove-outline" v-if="conclusion2.length > 1" @click="delColumn(2,index)"></i>
</div>
</div>
</div>
<p>(0/0)</p>
</div>
<div class="flex-between">
<div class="inline-flex">
<el-checkbox></el-checkbox>
<span>设置主观题</span>
<el-input size="mini"></el-input>
</div>
<p>(0/0)</p>
</div>
</div>
</div>
<div class="block">
<div class="flex-between mb10">
<p class="l-title">步骤3 判断平价关系确定交易方向</p>
<el-switch></el-switch>
</div>
<div class="inner">
<el-checkbox>策略</el-checkbox>
</div>
<div>
<div class="flex-between">
<div class="inline-flex">
<el-checkbox></el-checkbox>
<span>设置结论选项</span>
<div class="input-wrap">
<div class="input" v-for="(item,index) in conclusion3" :key="index">
<el-input size="mini" v-model="item.val"></el-input>
<i class="plus el-icon-circle-plus-outline" @click="addColumn(3)"></i>
<i class="sub el-icon-remove-outline" v-if="conclusion3.length > 1" @click="delColumn(3,index)"></i>
</div>
</div>
</div>
<p>(0/0)</p>
</div>
<div class="flex-between">
<div class="inline-flex">
<el-checkbox></el-checkbox>
<span>设置主观题</span>
<el-input size="mini"></el-input>
</div>
<p>(0/0)</p>
</div>
</div>
</div>
<div class="block">
<div class="flex-between mb10">
<p class="l-title">步骤4 选择期权期货套利策略</p>
<el-switch></el-switch>
</div>
<div class="inner">
<el-checkbox>策略</el-checkbox>
</div>
<div>
<div class="flex-between">
<div class="inline-flex">
<el-checkbox></el-checkbox>
<span>设置结论选项</span>
<div class="input-wrap">
<div class="input" v-for="(item,index) in conclusion4" :key="index">
<el-input size="mini" v-model="item.val"></el-input>
<i class="plus el-icon-circle-plus-outline" @click="addColumn(4)"></i>
<i class="sub el-icon-remove-outline" v-if="conclusion4.length > 1" @click="delColumn(4,index)"></i>
</div>
</div>
</div>
<p>(0/0)</p>
</div>
<div class="flex-between">
<div class="inline-flex">
<el-checkbox></el-checkbox>
<span>设置主观题</span>
<el-input size="mini"></el-input>
</div>
<p>(0/0)</p>
</div>
</div>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>实验结论</span>
</div>
<div>
<span>得分0/60</span>
</div>
</div>
<el-input type="textarea" rows="5" placeholder="请填写实验结论"></el-input>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>总结与心得体会</span>
</div>
<div>
<span>得分0/60</span>
</div>
</div>
<el-input type="textarea" rows="5" placeholder="请填写总结与心得体会"></el-input>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
data (){
return {
form: {
systemName: '',
systemType: '',
systemAttribution: ''
},
rules: {
systemName:[
{ required: true, message: '请输入系统名称', trigger: 'blur' }
],
systemType:[
{ required: true, message: '请选择系统类型', trigger: 'change' }
],
systemAttribution:[
{ required: true, message: '请选择系统归属', trigger: 'change' }
]
},
conclusion1: [{val: ''}],
conclusion2: [{val: ''}],
conclusion3: [{val: ''}],
conclusion4: [{val: ''}],
conclusion5: [{val: ''}],
conclusion6: [{val: ''}],
conclusion7: [{val: ''}],
conclusion8: [{val: ''}],
}
},
mounted(){
if(this.configId){
this.getData()
}
},
methods: {
getData(){
let data = {
systemId: this.configId
}
this.$get(this.api.queryServiceConfigDetails,data).then((res) => {
this.form = {
systemName: res.message[0].systemName,
systemType: res.message[0].systemType,
systemAttribution: res.message[0].systemAttribution,
}
}).catch((res) => {
})
},
saveAdd(){
let data = {
systemId: this.configId,
systemName: this.form.systemName,
systemType: this.form.systemType,
systemAttribution: this.form.systemAttribution,
}
if(this.configId){
this.$post(this.api.updateServiceConfig,data).then((res) => {
this.$message.success('编辑成功');
this.$router.back()
}).catch((res) => {
})
}else{
this.$post(this.api.updateServiceConfig,data).then((res) => {
this.$message.success('添加成功');
this.$router.back()
}).catch((res) => {
})
}
},
goback() {
this.$confirm('确定返回?未更新的信息将不会保存。', '提示', {
type: 'warning'
})
.then(() => {
this.$router.back()
})
.catch(() => {});
},
addColumn(index){
if(this[`conclusion${index}`].length > 4){
this.$message.warning('最多添加5个');
}else{
this[`conclusion${index}`].push({val: ''})
}
},
delColumn(index,i){
this[`conclusion${index}`].splice(i,1)
}
}
}
</script>
<style lang="scss" scoped>
.ml10{
margin-left: 10px;
}
.mb10{
margin-bottom: 10px;
}
.inline-input{
width: 200px;
}
.inline-form{
display: flex;
flex-direction: column;
.inner{
display: inline-flex;
&:first-child{
margin-bottom: 15px;
}
.el-form-item{
width: 33.33%;
margin: 0 20px;
font-size: 12px;
}
}
}
.flex-center{
font-size: 14px;
}
.flex-between{
font-size: 12px;
}
.block{
padding: 10px;
margin-bottom: 15px;
background-color: #f5f5f5;
.l-title{
font-size: 14px;
font-weight: bold;
}
.inner{
min-height: 100px;
padding: 10px;
margin-bottom: 10px;
border-radius: 8px;
border: 1px solid #ccc;
background-color: #fff;
box-sizing: border-box;
}
.inline-flex{
display: inline-flex;
margin-bottom: 10px;
font-size: 12px;
.input-wrap{
.input{
margin-bottom: 5px;
}
}
span{
margin: 0 10px 0 5px;
}
.el-input{
width: 400px;
}
i{
font-size: 16px;
cursor: pointer;
&:hover{
opacity: .8;
}
}
.plus{
margin-left: 10px;
color: #63e600;
}
.sub{
margin-left: 5px;
color: #636363;
}
}
}
</style>

@ -1,361 +0,0 @@
<template>
<div class="box">
<el-row :gutter="24">
<el-col :span="24">
<el-card shadow="hover" class="mgb20">
<div class="flex-between">
<div class="per_title" v-preventReClick @click="goback()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">查看报告</span>
</div>
</div>
</el-card>
<div id="pdfDom">
<h6 style="text-align: center;font-size: 20px">标准实验报告</h6>
<div class="flex-center mgb20 user_header">
<p class="addhr_tag"></p>
<span style="font-size: 18px">基本信息</span>
</div>
<div>
<el-table :data="infoData" class="info-table" style="margin-bottom: 40px" header-align="center">
<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="className" label="学生班级" align="center">
</el-table-column>
<el-table-column prop="teacherName" label="指导老师" align="center">
</el-table-column>
<el-table-column prop="period" label="实验学时" align="center">
</el-table-column>
<el-table-column prop="laboratory" label="实验室名称" align="center">
</el-table-column>
<el-table-column prop="startTime" label="实验时间" align="center">
</el-table-column>
<el-table-column prop="score" label="实验成绩" align="center">
</el-table-column>
</el-table>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 实验项目名称</p>
</div>
<el-input v-model="form.projectName" type="textarea" :disabled="true" rows="5"></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 实验目的</p>
</div>
<el-input v-model="form.purpose" type="textarea" :disabled="true" rows="5"></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 实验原理</p>
</div>
<el-input v-model="form.principle" type="textarea" :disabled="true" rows="5"></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 实验器材设备元器件</p>
</div>
<el-input v-model="form.equipment" type="textarea" :disabled="true" rows="5"></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 实验步骤</p>
</div>
<el-input v-model="form.step" type="textarea" :disabled="true" rows="5"></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验数据</p>
<!-- <span>得分50/60</span> -->
</div>
<el-table :data="sjData" class="table" stripe header-align="center">
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
{{scope.$index + 1}}
</template>
</el-table-column>
<el-table-column prop="judgmentPointsName" label="考核点" align="center">
</el-table-column>
<el-table-column prop="StudentAnswers" label="学生答案" align="center">
</el-table-column>
<el-table-column prop="ReferenceAnswer" label="参考答案" align="center">
</el-table-column>
<el-table-column prop="score" label="得分" align="center">
</el-table-column>
</el-table>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 实验数据及结果分析</p>
</div>
<el-table :data="expData" stripe header-align="center" class="mat20">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="ename" label="代码" align="center"></el-table-column>
<el-table-column prop="name" label="合约名称" align="center"></el-table-column>
<el-table-column prop="tradingDirection" label="方向(买/卖)" align="center"></el-table-column>
<el-table-column prop="entrustNumber" label="持仓/可用" align="center"></el-table-column>
<el-table-column prop="entrustPrice" label="均价/现价" align="center"></el-table-column>
<el-table-column prop="floatingPl" label="浮动盈亏" align="center"></el-table-column>
<el-table-column prop="preFreezingMargin" label="保证金" align="center"></el-table-column>
<el-table-column prop="tradeTime" label="最后交易日" align="center"></el-table-column>
<el-table-column prop="status" label="持仓状态" align="center"></el-table-column>
<el-table-column prop="createTime" label="开仓时间" align="center"></el-table-column>
<el-table-column prop="updateTime" label="平仓时间" align="center"></el-table-column>
</el-table>
<el-input style="margin-top: 20px" v-model="form.analysis" type="textarea" :disabled="true" rows="5"></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 实验结论</p>
</div>
<el-input type="textarea" v-model="form.conclusion" rows="5" disabled></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 总结及心得体会</p>
</div>
<el-input type="textarea" v-model="form.summarize" rows="5" disabled></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 对本实验过程及方法手段的改进建议</p>
</div>
<el-input type="textarea" rows="5" v-model="form.improvement" disabled></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 老师评语</p>
</div>
<el-input type="textarea" rows="5" v-model="form.comment" disabled></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 老师签名</p>
</div>
<el-upload
disabled
:action="api.uploadSignature"
:limit="1"
list-type="picture-card">
<i class="el-icon-plus"></i>
</el-upload>
</div>
</div>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
data (){
return {
id: this.$route.query.id,
title: '实验报告',
stuId: this.$route.query.stuId,
studentName: this.$route.query.studentName,
class: this.$route.query.class,
userId: this.$store.state.userLoginId,
studentId: this.$store.state.studentId,
userName: this.$store.state.name,
form: {
analysis: '',
conclusion: '',
content: '',
equipment: '',
data: '',
purpose: '',
experimentId: '',
experimentalClassName: '',
improvement: '',
laboratory: '',
period: '',
principle: '',
projectName: '',
score: 0,
step: '',
submitTime: '',
summarize: '',
teacherName: '',
userId: this.userId,
userName: this.userName,
workNumber: '',
analysis: '',
comment: ''
},
sjData: [],
infoData: [],
expData: [],
}
},
mounted(){
this.getData()
this.getSgin()
},
methods: {
getData(){
let data = {
reportId: this.id,
userId: this.stuId,
}
this.$get(this.api.getReport,data).then(res => {
let report = res.data.experimentalReportEntity
let steps = []
for(let i in report){
if(i.includes('steps') && report[i]) steps.push(JSON.parse(report[i]))
}
this.form = report
let expData = []
if(report.steps6) expData = JSON.parse(JSON.parse(report.steps6)).positionData
if(report.steps7) expData = expData.concat(JSON.parse(JSON.parse(report.steps7)).positionData)
if(report.steps8){
let updateTime = JSON.parse(JSON.parse(report.steps8)).achievementsData[0].updateTime
expData.map(n => {
n.updateTime = updateTime
})
}
this.expData = expData
this.sjData = JSON.parse(report.content)
this.infoData.push({
workNumber: report.workNumber,
className: this.class != 'undefined' ? this.class : '',
teacherName: report.teacherName,
period: report.period,
laboratory: report.laboratory,
startTime: report.creationTime,
score: report.score,
userName: this.studentName
})
}).catch(res => {})
},
getSgin(){
// let data = {
// userId: this.form.teacherId
// }
// this.$get(this.api.querySignature,data).then(res => {
// this.signList = res.data
// }).catch(res => {});
},
goback(){
this.$router.go(-1)
},
}
}
</script>
<style lang="scss" scoped>
.box{
padding: 0 50px;
background-color: #fff;
}
/deep/.el-textarea.is-disabled .el-textarea__inner{
background-color: #ebfafd;
}
#pdfDom{
padding: 50px;
/deep/.info-table{
border: 0;
th{
background-color: #fff !important;
.cell{
color: #444;
}
}
tr{
border: 0;
}
tr:hover,tr:hover>td{
background-color: #c6f2f8 !important;
}
td{
border: {
left: 4px solid #fff;
right: 4px solid #fff;
}
&:first-child{
border-left: 0;
}
&:last-child{
border-right: 0;
}
background-color: #c6f2f8;
border-bottom: 0;
}
}
/deep/.table th{
background-color: #a2a2a2 !important;
}
}
/deep/.cell{
font-size: 12px;
}
/deep/.el-row{
padding-top: 20px;
margin: 0 !important;
}
.form-item{
display: flex;
align-items: center;
}
.form-item .el-input{
width: auto;
}
.form-item span{
margin-right: 10px;
}
.meta-title-wrap{
display: flex;
justify-content: space-between;
align-items: center;
span{
font-size: 13px;
color: #444;
}
}
.flex-between{
span{
font-size: 13px;
color: #444;
}
}
.meta-title{
display: flex;
align-items: center;
padding: 10px 20px;
margin-bottom: 10px;
font-size: 16px;
color: #fff;
background-color: #9278FF;
i{
margin-right: 10px;
}
}
.step-title{
margin-bottom: 10px;
font-size: 16px;
color: #9278ff;
}
.bd-title{
padding-top: 20px;
border-top: 1px dashed #ccc;
}
</style>

@ -1,401 +0,0 @@
<template>
<div class="box">
<el-row :gutter="24">
<el-col :span="24">
<el-card shadow="hover" class="mgb20">
<div class="flex-between">
<div class="per_title" v-preventReClick @click="goback()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">查看报告</span>
</div>
</div>
</el-card>
<div id="pdfDom">
<h6 style="text-align: center;font-size: 20px">标准实验报告</h6>
<div class="flex-center mgb20 user_header">
<p class="addhr_tag"></p>
<span style="font-size: 18px">基本信息</span>
</div>
<div>
<el-table :data="infoData" class="info-table" style="margin-bottom: 40px" header-align="center">
<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="className" label="学生班级" align="center">
</el-table-column>
<el-table-column prop="teacherName" label="指导老师" align="center">
</el-table-column>
<el-table-column prop="period" label="实验学时" align="center">
</el-table-column>
<el-table-column prop="laboratory" label="实验室名称" align="center">
</el-table-column>
<el-table-column prop="startTime" label="实验时间" align="center">
</el-table-column>
<el-table-column prop="score" label="实验成绩" align="center">
</el-table-column>
</el-table>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 实验项目名称</p>
</div>
<el-input v-model="form.projectName" type="textarea" :disabled="true" rows="5"></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 实验目的</p>
</div>
<el-input v-model="form.purpose" type="textarea" :disabled="true" rows="5"></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 实验原理</p>
</div>
<el-input v-model="form.principle" type="textarea" :disabled="true" rows="5"></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 实验内容</p>
</div>
<el-input v-model="form.content" type="textarea" :disabled="true" rows="5"></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 实验器材设备元器件</p>
</div>
<el-input v-model="form.equipment" type="textarea" :disabled="true" rows="5"></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 实验步骤</p>
</div>
<el-input v-model="form.step" type="textarea" :disabled="true" rows="5"></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title">实验数据</p>
<!-- <span>得分50/60</span> -->
</div>
<el-table :data="sjData" class="table" stripe header-align="center">
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
{{scope.$index + 1}}
</template>
</el-table-column>
<el-table-column prop="judgmentPointsName" label="考核点" align="center">
</el-table-column>
<el-table-column prop="userAnswers" label="学生答案" align="center">
</el-table-column>
<el-table-column prop="referenceAnswer" label="参考答案" align="center">
</el-table-column>
<el-table-column prop="score" label="得分" align="center">
</el-table-column>
</el-table>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 实验数据及结果分析</p>
</div>
<el-table :data="expData" class="table" stripe header-align="center">
<el-table-column prop="remark" label="期权平仓方式" align="center">
</el-table-column>
<el-table-column prop="optionName" label="期权合约" width="130" align="center">
</el-table-column>
<el-table-column prop="date" label="期权合约持仓时间段" width="150" align="center">
</el-table-column>
<el-table-column prop="dirFuture" label="期权交易方向" align="center">
</el-table-column>
<el-table-column prop="nums" label="委托数量" align="center">
</el-table-column>
<el-table-column prop="price" label="委托价格" align="center">
</el-table-column>
<el-table-column prop="futureName" label="期货合约" align="center">
</el-table-column>
<el-table-column prop="dateFutures" label="合约持仓时间段" align="center">
</el-table-column>
<el-table-column prop="dir" label="交易方向" align="center">
</el-table-column>
<el-table-column prop="optionsMoney" label="期权/期货合约盈亏" width="120" align="center">
</el-table-column>
<el-table-column prop="presentLoss" label="现货盈亏" align="center">
</el-table-column>
<el-table-column prop="charge" label="手续费" align="center">
</el-table-column>
<el-table-column prop="totalLoss" label="总盈亏" align="center">
</el-table-column>
</el-table>
<el-input style="margin-top: 20px" v-model="form.analysis" type="textarea" :disabled="true" rows="5"></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 实验结论</p>
</div>
<el-input type="textarea" v-model="form.conclusion" rows="5" disabled></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 总结及心得体会</p>
</div>
<el-input type="textarea" v-model="form.summarize" rows="5" disabled></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 对本实验过程及方法手段的改进建议</p>
</div>
<el-input type="textarea" rows="5" v-model="form.improvement" disabled></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 老师评语</p>
</div>
<el-input type="textarea" rows="5" v-model="form.comment" disabled></el-input>
</div>
<div class="mgb20">
<div class="meta-title-wrap">
<p class="meta-title"><i class="el-icon-discount"></i> 老师签名</p>
</div>
<el-upload
disabled
:action="api.uploadSignature"
:limit="1"
list-type="picture-card">
<i class="el-icon-plus"></i>
</el-upload>
</div>
</div>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
data (){
return {
id: this.$route.query.id,
title: '实验报告',
stuId: this.$route.query.stuId,
studentName: this.$route.query.studentName,
class: this.$route.query.class,
userId: this.$store.state.userLoginId,
studentId: this.$store.state.studentId,
userName: this.$store.state.name,
form: {
analysis: '',
conclusion: '',
content: '',
equipment: '',
data: '',
purpose: '',
experimentId: '',
experimentalClassName: '',
improvement: '',
laboratory: '',
period: '',
principle: '',
projectName: '',
score: 0,
step: '',
submitTime: '',
summarize: '',
teacherName: '',
userId: this.userId,
userName: this.userName,
workNumber: '',
analysis: '',
comment: ''
},
sjData: [],
infoData: [],
expData: [],
}
},
mounted(){
this.getData()
this.getSgin()
},
methods: {
getData(){
let data = {
reportId: this.id,
userId: this.stuId,
}
this.$get(this.api.getReport,data).then(res => {
let report = res.data.experimentalReportEntity
let steps = []
for(let i in report){
if(i.includes('steps') && report[i]) steps.push(JSON.parse(report[i]))
}
this.form = report
this.expData = report.steps9 ? JSON.parse(report.steps9).recordsData: []
let score = res.data.score
let answerList = []
for(let i in res.data.userAnswersList){
answerList = answerList.concat(res.data.userAnswersList[i])
}
let sjData = []
answerList.map(n => {
if(n.type == 1){
this.$post(this.api.queryItem,n.levelThree)
.then((res) => {
n.levelFour = res.subject.find(e => e.id == n.levelFour).itemDescription
console.log(11,n)
}).catch((err) => {})
}
})
setTimeout(() => {
score.map(n => {
let item = answerList.find(e => e.tradingJudgmentPointsId == n.tradingJudgmentPointsId)
sjData.push({
judgmentPointsName: item.judgmentPointsName,
userAnswers: n.userAnswers,
referenceAnswer: item.levelFour,
score: n.score
})
})
},500)
this.sjData = sjData
this.infoData.push({
workNumber: report.workNumber,
className: this.class != 'undefined' ? this.class : '',
teacherName: report.teacherName,
period: report.period,
laboratory: report.laboratory,
startTime: report.creationTime,
score: report.score,
userName: this.studentName
})
}).catch(res => {})
},
getSgin(){
// let data = {
// userId: this.form.teacherId
// }
// this.$get(this.api.querySignature,data).then(res => {
// this.signList = res.data
// }).catch(res => {});
},
goback(){
this.$router.go(-1)
},
}
}
</script>
<style lang="scss" scoped>
.box{
padding: 0 50px;
background-color: #fff;
}
/deep/.el-textarea.is-disabled .el-textarea__inner{
background-color: #ebfafd;
}
#pdfDom{
padding: 50px;
/deep/.info-table{
border: 0;
th{
background-color: #fff !important;
.cell{
color: #444;
}
}
tr{
border: 0;
}
tr:hover,tr:hover>td{
background-color: #c6f2f8 !important;
}
td{
border: {
left: 4px solid #fff;
right: 4px solid #fff;
}
&:first-child{
border-left: 0;
}
&:last-child{
border-right: 0;
}
background-color: #c6f2f8;
border-bottom: 0;
}
}
/deep/.table th{
background-color: #a2a2a2 !important;
}
}
/deep/.cell{
font-size: 12px;
}
/deep/.el-row{
padding-top: 20px;
margin: 0 !important;
}
.form-item{
display: flex;
align-items: center;
}
.form-item .el-input{
width: auto;
}
.form-item span{
margin-right: 10px;
}
.meta-title-wrap{
display: flex;
justify-content: space-between;
align-items: center;
span{
font-size: 13px;
color: #444;
}
}
.flex-between{
span{
font-size: 13px;
color: #444;
}
}
.meta-title{
display: flex;
align-items: center;
padding: 10px 20px;
margin-bottom: 10px;
font-size: 16px;
color: #fff;
background-color: #9076FF;
i{
margin-right: 10px;
}
}
.step-title{
margin-bottom: 10px;
font-size: 16px;
color: #9278ff;
}
.bd-title{
padding-top: 20px;
border-top: 1px dashed #ccc;
}
</style>

@ -1,307 +0,0 @@
<template>
<div>
<el-card shadow="hover" class="mgb20">
<div class="flex-between">
<div class="per_title" v-preventReClick @click="goback()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">老师评语</span>
</div>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div>
<p class="mgb20">评语模板名称</p>
<el-input
placeholder="请输入评语模板名称"
clearable
class="inline-input"
></el-input>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<p class="l-title">老师寄语</p>
<el-switch></el-switch>
</div>
<div class="mgb20" style="display: flex;justify-content: flex-end;">
<div>
<el-button type="primary" size="small" round>导入</el-button>
<el-button type="primary" size="small" round>删除</el-button>
</div>
</div>
<el-table :data="listData" class="table" stripe header-align="center" row-key="id">
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column prop="name" label="分数" align="center">
<template slot-scope="scope">
<div class="inline">
<el-select v-model="scope.row.score1" size="mini">
<el-option v-for="item in scoreList" :key="item.id" :label="item.label" :value="item.id"></el-option>
</el-select>
<span></span>
<el-select v-model="scope.row.score2" size="mini">
<el-option v-for="item in scoreList" :key="item.id" :label="item.label" :value="item.id"></el-option>
</el-select>
</div>
</template>
</el-table-column>
<el-table-column label="评语" align="center">
<template slot-scope="scope">
<el-input type="textarea" rows="2" v-model="scope.row.comment"></el-input>
</template>
</el-table-column>
</el-table>
<div class="plus" @click="addData">
<i class="el-icon-circle-plus-outline"></i>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<p class="l-title">老师签名</p>
<el-switch></el-switch>
</div>
<div class="ags">
<div class="item">
<el-radio v-model="autograph" label="1">已有签名</el-radio>
<el-select v-model="agVal" size="mini">
<el-option v-for="item in autographList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<el-upload
class="avatar-uploader"
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"
name="file"
>
<img v-if="coverUrl" :src="coverUrl" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
<div class="item">
<el-radio v-model="autograph" label="2">重新上传</el-radio>
<el-select v-model="agVal" size="mini">
<el-option v-for="item in autographList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<el-upload
class="avatar-uploader"
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"
name="file"
>
<img v-if="coverUrl" :src="coverUrl" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
</div>
</el-card>
</div>
</template>
<script>
export default {
name: 'teachercomment',
data() {
return {
scoreList: [
{
id: 1,
label: 1
},{
id: 2,
label: 2
},{
id: 3,
label: 3
},
],
listData: [
{
id: 1,
score1: 1,
score2: 10,
comment: ''
},
{
id: 2,
score1: 1,
score2: 10,
comment: ''
},
],
autograph: '1',
agVal: 1,
autographList: [
{
id: 1,
name: '签名一'
},{
id: 2,
name: '签名二'
},
]
};
},
mounted() {
// this.getData()
},
methods: {
getData() {
// let data = {
// countries: this.form.countries,
// provinceId: this.form.provinces,
// cityId: this.form.city,
// searchContent: this.form.keyword,
// pageNo: this.pageNo,
// pageSize: this.pageSize
// }
// this.$get(this.api.queryCustomer,data).then(res => {
// this.listData = res.message.rows
// this.totals = res.message.total
// }).catch(res => {});
},
entry(){
this.$router.push('report')
},
goback() {
this.$confirm('确定返回?未更新的信息将不会保存。', '提示', {
type: 'warning'
})
.then(() => {
this.$router.back()
})
.catch(() => {});
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
uploadSuccess(res, file, fileList) {
this.coverUrl = res.data.filesResult.fileUrl
},
uploadLgSuccess(res, file, fileList) {
this.carouselUrl = res.data.filesResult.fileUrl
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList) {
this.uploadList = fileList
},
addData(){
this.listData.push({
id: '',
score1: '',
score2: '',
comment: '',
})
}
}
};
</script>
<style lang="scss" scoped>
.inline-input{
width: 200px;
}
.inline{
display: flex;
justify-content: center;
align-items: center;
.el-select{
width: 100px;
margin: 0 10px;
}
}
.plus{
padding: 10px 0;
text-align: center;
background-color: #9278FF;
cursor: pointer;
i{
font-size: 24px;
color: #fff;
}
}
.ags{
display: flex;
.item:first-child{
padding-right: 20px;
margin-right: 20px;
border-right: 1px dashed #ccc;
}
.el-radio{
margin-bottom: 10px;
}
/deep/.el-select{
.el-input{
width: 150px;
}
}
}
.avatar-uploader{
margin-top: 15px;
}
.avatar-uploader /deep/.el-upload {
width: 220px;
height: 140px;
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader-lg /deep/.el-upload {
width: 100%;
height: 300px;
}
.avatar-uploader .el-upload:hover {
border-color: #cb221c;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px !important;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 220px;
height: 140px;
display: block;
}
.avatar-lg {
width: 100%;
height: 300px;
display: block;
}
</style>

@ -1,350 +0,0 @@
<template>
<div>
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>筛选</span>
</div>
<div>
<el-form label-width="80px">
<el-row>
<el-col :span="6">
<el-form-item label="国家">
<el-select v-model="form.countries" clearable placeholder="请选择国家">
<el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="省份">
<el-select v-model="form.provinces" clearable placeholder="请选择省份" @change="getCity" @clear="clearprovince()">
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="城市">
<el-select v-model="form.city" clearable placeholder="请选择城市"
:disabled="form.provinces ? false : true" @clear="clearcity()" @change="getSchool">
<el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="学校">
<el-select v-model="form.schoolId" clearable placeholder="请选择学校" :disabled="form.city ? false : true" @change="getData()">
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row class="no-mb">
<el-col :span="10">
<el-form-item label="创建时间" class="userRadio">
<el-radio-group v-model="form.month" @change="itemRadio">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="自定义">
<el-date-picker v-model="form.date" align="right" unlink-panels type="daterange"
start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="selectTime" clearable></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="请输入用户姓名/学校名称" prefix-icon="el-icon-search" v-model="form.keyword" clearable @keyup.enter.native="onSearch"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
</el-card>
<el-card shadow="hover">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="hr_tag"></p>
<span>用户列表</span>
</div>
<div>
<el-button type="primary" size="small" round class="mag" @click="adduser">新增用户</el-button>
<el-button type="primary" size="small" round @click="delAllSelection">批量删除</el-button>
</div>
</div>
<el-table :data="userData" class="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>
<el-table-column type="index" width="100" label="序号" align="center">
</el-table-column>
<el-table-column prop="account" label="用户账号" align="center">
</el-table-column>
<el-table-column prop="username" label="姓名" align="center">
</el-table-column>
<el-table-column prop="countries" label="国家" align="center">
</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="creationTime" label="创建时间" align="center">
</el-table-column>
<el-table-column prop="logInNumber" label="登录次数" align="center">
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text">密码重置</el-button>
<el-button type="text">查看</el-button>
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="pageNo" layout="total, prev, pager, next" :total="totals">
</el-pagination>
</div>
</el-card>
</div>
</template>
<script>
import bus from '../common/bus';
export default {
name: 'dashboard',
data() {
return {
form: {
name: '',
countries: '中国',
provinces: '',
city: '',
schoolId: '',
keyword: '',
date:'',
startTime: '',
endTime: '',
month: ''
},
accountRoleList: [{
name: '超级管理员',
value: 1
},
{
name: '管理员',
value: 2
},
{
name: '教师',
value: 3
},
{
name: '学生',
value: 4
}],
countryList: [{
name:'中国'
}],
provinceList: this.$store.state.provinceList,
cityList: [],
schoolList: [],
userData:[],
dateList: [{
id: '',
name: '不限'
},
{
id: 3,
name: '3个月内'
},
{
id: 6,
name: '6个月内'
},
{
id: 9,
name: '9个月内'
},
{
id: 12,
name: '1年内'
}],
pageNo: 1,
pageSize: 10,
totals: 1,
multipleSelection: []
};
},
mounted() {
// this.getData()
},
methods: {
getData() {
// let data = {
// countries: this.form.countries,
// provinceId: this.form.provinces,
// cityId: this.form.city,
// schoolId: this.form.schoolId,
// month: this.form.month,
// creationTime: this.form.startTime,
// endTime: this.form.endTime,
// searchContent: this.form.keyword,
// pageNo: this.pageNo,
// pageSize: this.pageSize
// }
// this.$get(this.api.queryUser,data).then(res => {
// this.userData = res.message.rows
// this.totals = res.message.total
// }).catch(res => {});
},
//
clearprovince(){
this.form.city = '',
this.form.schoolId = ''
},
//
getCity(){
this.clearprovince()
this.getCityData()
this.pageNo = 1
this.getData()
},
getCityData(){
let data = {
provinceId: this.form.provinces
}
this.$get(this.api.queryCity,data).then(res => {
this.cityList = res.message
}).catch(res => {});
},
//
clearcity(){
this.form.schoolId = ''
},
// /
getSchool(){
this.clearcity()
this.getSchoolData()
this.pageNo = 1
this.getData()
},
getSchoolData(){
let data = {
provinceId: this.form.provinces,
cityId: this.form.city
}
this.$get(this.api.querySchool,data).then(res => {
this.schoolList = res.message
}).catch(res => {});
},
onSearch(){
this.pageNo = 1
this.getData()
},
itemRadio(val){
this.form.month = val
this.form.date = ''
this.form.startTime = ''
this.form.endTime = ''
this.getData()
},
selectTime(val){
if(val){
this.form.startTime = val[0]
this.form.endTime = val[1]
}else{
this.form.startTime = ''
this.form.endTime = ''
}
this.form.month = ''
this.getData()
},
currentChange(val) {
this.pageNo = val;
this.getData();
},
permission(){
this.$router.push('/permission')
},
adduser(){
this.$store.commit("userData", { user_id : '', roleId: ''});
this.$router.push('/adduser');
},
edit(row){
this.$store.commit("userData", { user_id : row.userId });
this.$router.push('/adduser');
},
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
let obj = {}
Object.assign(obj,
{
userId:row.userId,
phone: row.phone
})
let arr = []
arr.push(obj)
let data = arr
this.$post(this.api.deleteUser,data).then(res => {
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
},
getRowKeys(row) {
return row.userId;
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
delAllSelection() {
if(this.multipleSelection.length != ''){
let newArr = this.multipleSelection
let delList = newArr.map(item => {
return {
userId: item.userId,
phone: item.phone
}
})
//
this.$confirm('确定要删除选中用户吗?', '提示', {
type: 'warning'
})
.then(() => {
let data = delList
this.$post(this.api.deleteUser,data).then(res => {
this.multipleSelection = [];
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
}).catch(() => {});
}else{
this.$message.error('请先选择客户 !');
}
},
}
};
</script>
<style scoped>
.mag{
margin-right: 20px;
}
.no-mb /deep/.el-form-item{
margin-bottom: 0;
}
/deep/.el-row{
padding: 0 !important;
margin-bottom: 0;
}
</style>

@ -1,309 +0,0 @@
<template>
<div>
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>筛选</span>
</div>
<div>
<el-form label-width="100px">
<div>
<el-form-item label="时间" class="userRadio">
<el-radio-group v-model="month" @change="initData">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio>
</el-radio-group>
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</el-form-item>
</div>
<div class="flex-between no-mb">
<div class="flex-between">
<el-form-item label="实验项目分类" class="userRadio">
<el-radio-group v-model="projectPermissions" @change="initData">
<el-radio v-for="(item,index) in projectType" :key="index" :label="item.id" border>{{item.name}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="系统">
<el-select v-model="systemId" placeholder="请选择" @change="initData">
<el-option
v-for="item in systemList"
:key="item.value"
:label="item.label"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item>
<el-input placeholder="请输入实验项目名称/班级名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</el-form-item>
</div>
</div>
</el-form>
</div>
</div>
</el-card>
<el-card shadow="hover">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="hr_tag"></p>
<span>成绩管理</span>
</div>
<div>
<el-button
type="primary"
size="small"
icon="el-icon-delete"
round
class="bt_one"
@click="delAllData"
>批量删除</el-button>
</div>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" :selectable="disabledSelection"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
{{scope.$index + (pageNo - 1) * pageSize + 1}}
</template>
</el-table-column>
<template v-if="projectPermissions == 1">
<el-table-column prop="experimentalClassName" label="班级" align="center"></el-table-column>
<el-table-column prop="experimentalName" label="实验名称" align="center"></el-table-column>
</template>
<el-table-column prop="projectName" label="项目名称" align="center">
</el-table-column>
<el-table-column prop="projectPermissions" label="分类" align="center">
<template slot-scope="scope">
{{scope.row.projectPermissions == 2 ? '竞赛' : projectType.find(n => n.id === scope.row.projectPermissions).name}}
</template>
</el-table-column>
<el-table-column prop="number" label="成绩报告数量" align="center"></el-table-column>
<el-table-column prop="creationTime" label="创建时间" align="center">
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="entry(scope.row)" v-auth>成绩管理</el-button>
<el-button type="text" @click="handleDelete(scope.row)" :disabled="!scope.row.isdel">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo">
</el-pagination>
</div>
</el-card>
</div>
</template>
<script>
import { Loading } from 'element-ui'
export default {
name: 'achievement',
data() {
return {
userId: this.$store.state.userLoginId,
keyword: '',
systemId: this.$store.state.experimentData.systemId ? this.$store.state.experimentData.systemId : this.$config.systemId,
systemList: this.$config.systemList,
projectPermissions: this.$route.query.per ? Number(this.$route.query.per) : 0,
startingtime: '',
endTime: '',
month: '',
listData: [],
multipleSelection: [],
dateList: [
{
id: '',
name: '不限'
},
{
id: 1,
name: '近一个月'
},
{
id: 6,
name: '近六个月'
}
],
projectType: [
{
id: 0,
name: '练习'
},
{
id: 1,
name: '考核'
}
],
date: '',
pageNo: 1,
pageSize: 10,
totals: 1,
loadIns: null,
listDataAll: []
};
},
watch: {
month: function(val){
if(val){
let unit = 24 * 60 * 60 * 1000
this.date = [this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))]
}else{
this.date = []
}
},
date: function(val){
if(val){
this.startingtime = val[0]
this.endTime = val[1]
}else{
this.startingtime = ''
this.endTime = ''
}
this.initData()
},
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
},500)
}
},
mounted() {
this.getData()
},
methods: {
getData() {
this.loadIns = Loading.service({
background: 'rgba(255,255,255,.6)'
})
let data = {
searchContant: this.encodeString(this.keyword),
startTime: this.startingtime,
endTime: this.endTime,
month: this.month,
page: this.pageNo,
size: this.pageSize,
userId: this.userId
}
let url = this.api.queryAchievement
if(this.projectPermissions){
data.systemId = this.systemId
url = this.api.queryAchievementNew
}else{
data.systemId = this.systemId
data.projectPermissions = this.projectPermissions
}
this.$get(url,data).then(res => {
this.listData = res.data.list
this.totals = res.data.total
this.$nextTick(() => {
this.loadIns.close()
})
}).catch(res => {
this.loadIns.close()
})
},
handlePage(){
let list = this.listDataAll
let result = []
list.map(n => {
if(!n.projectHiddenEntity) result.push(n)
})
this.listData = result.slice((this.pageNo - 1) * this.pageSize,this.pageNo * this.pageSize)
this.totals = result.length
},
initData(){
this.$refs.table.clearSelection()
this.pageNo = 1
this.getData()
},
disabledSelection(row,index){
if(row.isdel == 0) return false
return true
},
entry(row){
if(this.projectPermissions){
this.$store.commit('addExperimentData',{experimentData: {
id: row.id,
name: row.projectName,
class: row.experimentalClassName,
systemId: this.systemId,
projectId: row.projectId,
experimentalName: row.experimentalName
}})
this.$router.push('experimentTeach')
}else{
this.$store.commit('addExperimentData',{experimentData: {
id: row.projectId,
name: row.projectName,
class: row.experimentalClassName,
systemId: this.systemId
}})
this.$router.push('experimentVir')
}
},
handleDelete(row) {
this.$confirm('该项目下的所有成绩报告将会删除,是否继续?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteReportById}?projectIds=${row.projectId}&projectPermissions=${row.projectPermissions}&ids=${row.id ? row.id : ''}`).then(res => {
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
},
delAllData() {
if(this.multipleSelection.length != ''){
let newArr = this.multipleSelection
let delList = newArr.map(item => {
return `projectIds=${item.projectId}`
})
let delList1 = newArr[0].id ? newArr.map(item => {
return `ids=${item.id}`
}) : []
this.$confirm('该项目下的所有成绩报告将会删除,是否继续?', '提示', {
type: 'warning'
})
.then(() => {
console.log(delList,delList1)
let data = `${delList.join('&')}&projectPermissions=${this.projectPermissions}&${delList1.length ? delList1.join('&') : ''}`
console.log(11,data)
this.$post(`${this.api.deleteReportById}?${data}`).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection()
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
}else{
this.$message.error('请先选择数据 !');
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleCurrentChange(val) {
this.pageNo = val;
this.getData();
},
}
};
</script>
<style lang="scss" scoped>
.no-mb /deep/.el-form-item{
margin-bottom: 0;
}
.el-radio.is-bordered+.el-radio.is-bordered{
margin-left: 0;
}
</style>

@ -1,218 +0,0 @@
<template>
<div>
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="hr_tag"></p>
<span>系统列表</span>
</div>
<div>
<el-input placeholder="请输入系统名称" prefix-icon="el-icon-search" v-model="systemSearch" clearable></el-input>
</div>
</div>
<el-table :data="customerData" class="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>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
{{scope.$index + (pageNo - 1) * pageSize + 1}}
</template>
</el-table-column>
<el-table-column prop="schoolName" label="系统名称" align="center">
</el-table-column>
<el-table-column prop="adminPhone" label="创建时间" align="center">
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="entry(scope.row)">进入</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo">
</el-pagination>
</div>
</el-card>
</div>
</template>
<script>
import bus from '../common/bus';
export default {
name: 'dashboard',
data() {
return {
systemSearch: '',
name: sessionStorage.getItem('ms_username'),
countryList: [{
name:'中国'
}],
customerData: [],
form: {
date:'',
project: '',
keyword: ''
},
multipleSelection: [],
dateList: [
{
id: 1,
name: '近一个月'
},
{
id: 2,
name: '近三个月'
},
{
id: 3,
name: '近六个月'
}
],
projectType: [
{
id: 1,
name: '不限'
},
{
id: 2,
name: '虚拟仿真实验'
},
{
id: 3,
name: '实验教学'
}
],
timeRange: '',
curTab: 'all',
provinceList: [],
cityList: [],
pageNo: 1,
pageSize: 10,
totals: 1,
ruleIds: []
};
},
components: {
},
computed: {
role() {
return this.name === 'admin' ? '超级管理员' : '普通用户';
}
},
mounted() {
// this.getData()
// this.getProvince()
},
methods: {
getData() {
let data = {
countries: this.form.countries,
provinceId: this.form.provinces,
cityId: this.form.city,
searchContent: this.form.keyword,
pageNo: this.pageNo,
pageSize: this.pageSize
}
this.$get(this.api.queryCustomer,data).then(res => {
this.customerData = res.message.rows
this.totals = res.message.total
}).catch(res => {});
},
entry(){
this.$router.push('/permission')
},
addcustomer(){
this.$store.commit("customerData", { customer_id : ''});
this.$router.push('/addcustomer');
},
edit(row){
this.$store.commit("customerData", { customer_id : row.customerId });
this.$router.push('/addcustomer');
},
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
let str = '';
str += row.customerId+',';
var deleteList = str.split(',').map(Number);
deleteList.pop()
var arr = [];
var signAgainReq = new Object();
signAgainReq.customerId = deleteList[0];
arr.push(signAgainReq);
let data = {
customer: arr
}
this.$post(this.api.deleteCustomer,data).then(res => {
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
},
getRowKeys(row) {
return row.customerId;
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
delAllSelection() {
if(this.multipleSelection.length != ''){
const length = this.multipleSelection.length;
let str = '';
for (let i = 0; i < length; i++) {
str += this.multipleSelection[i].customerId+',';
}
var deleteList = str.split(',').map(Number);
deleteList.pop()
var arr = [];
for(var i = 0,len = deleteList.length; i < len; i++){
var signAgainReq = new Object();
signAgainReq.customerId = deleteList[i];
arr.push(signAgainReq);
}
//
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
let data = {
customer: arr
}
this.$post(this.api.deleteCustomer,data).then(res => {
this.multipleSelection = [];
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
}).catch(() => {});
}else{
this.$message.error('请先选择客户 !');
}
},
onSearch(){
this.pageNo = 1
this.getData()
},
handleCurrentChange(val) {
this.pageNo = val;
this.getData();
},
tabChange(tab,event) {
console.log(tab,event)
}
}
};
</script>
<style scoped>
.mag{
margin-right: 20px;
}
/deep/.el-tabs__nav-wrap::after{
display: none;
}
</style>

@ -1,442 +0,0 @@
<template>
<div>
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>筛选</span>
</div>
<div>
<el-form label-width="80px">
<div>
<el-form-item label="实验时间" class="userRadio">
<el-radio-group v-model="form.month" @change="initData">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio>
</el-radio-group>
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" style="margin-left: 10px;"
start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</el-form-item>
</div>
<div class="flex-between no-mb">
<div class="flex-center">
<el-form-item label="发布类型">
<el-select v-model="form.type" clearable placeholder="请选择发布类型" @change="initData">
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="实验状态">
<el-select v-model="form.status" clearable placeholder="请选择实验状态" @change="initData">
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="系统" label-width="60px">
<el-select v-model="systemId" placeholder="请选择" @change="initData">
<el-option label="不限" value=""></el-option>
<el-option
v-for="item in systemList"
:key="item.value"
:label="item.label"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item>
<el-input placeholder="请输入实验班级/项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable @keyup.enter.native="onSearch"></el-input>
</el-form-item>
</div>
</div>
</el-form>
</div>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="hr_tag"></p>
<span>实验教学列表</span>
</div>
<div>
<el-button
type="primary"
size="small"
icon="el-icon-plus"
round
@click="add"
class="bt_one"
v-auth
>创建实验</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-delete"
round
class="bt_one"
@click="delAllData"
v-auth
>批量删除</el-button>
</div>
</div>
<el-table ref="table" :data="customerData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" :selectable="row => row.status!=2" width="50" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{scope.$index + (pageNo - 1) * pageSize + 1}}
</template>
</el-table-column>
<el-table-column prop="experimentalClassName" label="实验班级" align="center">
</el-table-column>
<el-table-column prop="experimentalName" label="考核名称" min-width="120" align="center">
</el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center">
</el-table-column>
<el-table-column prop="experimentalNumber" label="实验人数" align="center">
</el-table-column>
<el-table-column prop="experimentDuration" label="实验时长" align="center">
</el-table-column>
<el-table-column label="邀请码" align="center">
<template slot-scope="scope">
<span>{{scope.row.isCode == 0 ? scope.row.invitationCode : ''}}</span>
</template>
</el-table-column>
<el-table-column prop="adminName" label="发布类型" align="center">
<template slot-scope="scope">
<span>{{types[scope.row.type]}}</span>
</template>
</el-table-column>
<el-table-column prop="creationTime" width="150" label="创建时间" align="center">
</el-table-column>
<el-table-column prop="startTime" width="150" label="起始时间" align="center">
<template slot-scope="scope">
<span>{{transferTime(scope.row.startTime,scope.row.type)}}</span>
</template>
</el-table-column>
<el-table-column prop="stopTime" width="150" label="结束时间" align="center">
<template slot-scope="scope">
<span>{{transferTime(scope.row.stopTime,scope.row.type)}}</span>
</template>
</el-table-column>
<el-table-column prop="surplusTime" label="倒计时" align="center">
<!-- <template slot-scope="scope">
<span v-if="scope.row.status == 2" v-countdown="scope.row.surplusTime">{{scope.row.surplusTime}}</span>
<span v-else>00:00:00</span>
</template> -->
</el-table-column>
<el-table-column label="实验状态" align="center">
<template slot-scope="scope">
<span>{{status[scope.row.status]}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="170">
<template slot-scope="scope">
<template v-if="scope.row.status == 1">
<el-button type="text" @click="start(scope.row)" v-auth>启动</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth>修改</el-button>
</template>
<template v-else-if="scope.row.status == 2">
<el-button type="text" @click="finish(scope.row)" v-auth>提前结束</el-button>
</template>
<template v-else-if="scope.row.status == 3">
<el-button type="text" @click="show(scope.row)" v-auth>查看成绩</el-button>
</template>
<el-button v-if="scope.row.status == 1 || scope.row.status == 3" type="text" @click="delData(scope.row)" v-auth>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo">
</el-pagination>
</div>
</el-card>
</div>
</template>
<script>
import bus from '../common/bus';
import axios from 'axios';
export default {
name: 'dashboard',
data() {
return {
name: sessionStorage.getItem('ms_username'),
schoolId: this.$store.state.schoolId,
systemId: '',
systemList: this.$config.systemList,
keyword: '',
typeList: [
{
value: '',
name: '不限'
},
{
value: 1,
name: '手动发布'
},
{
value: 2,
name: '定时发布'
}
],
status: ['','待开始','进行中','已完成'],
types: ['','手动发布','定时发布'],
statusList: [
{
value: '',
name: '不限'
},
{
value: 1,
name: '待开始'
},
{
value: 2,
name: '进行中'
},
{
value: 3,
name: '已完成'
}
],
customerData: [],
form: {
type: '',
status: '',
startTime: '',
stopTime: '',
month: '',
searchContent: ''
},
multipleSelection: [],
dateList: [
{
id: '',
name: '不限'
},
{
id: 1,
name: '近一个月'
},
{
id: 3,
name: '近三个月'
},
{
id: 6,
name: '近六个月'
}
],
date: [],
pageNo: 1,
pageSize: 10,
totals: 0,
ruleIds: [],
timer: null
};
},
directives: {
countdown: {
bind: function(el,binding,vnode) {
let that = vnode.context
let time = binding.value
let timer = setInterval(() => {
let timeList = time.split(':')
let total = Number.parseInt(timeList[0] * 60 * 60) + Number.parseInt(timeList[1] * 60) + Number.parseInt(timeList[2])
if(total > 0){
--total
let hours = Math.floor(total / (60 * 60))
let minutes = Math.floor(total % (60 * 60) / 60)
let seconds = Math.floor(total % (60 * 60) % 60)
time = `${that.formateTime(hours)}:${that.formateTime(minutes)}:${that.formateTime(seconds)}`
}else{
clearInterval(timer)
}
// console.log(11,time)
el.innerHTML = time
},1000)
that.timerList.push(timer)
}
}
},
watch: {
'form.month': function(val){
if(val){
let unit = 24 * 60 * 60 * 1000
this.date = [this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))]
}else{
this.date = []
}
},
date: function(val){
if(val){
this.form.startTime = val[0]
this.form.stopTime = val[1]
}else{
this.form.startTime = ''
this.form.stopTime = ''
}
this.initData()
},
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
},500)
}
},
computed: {
role() {
return this.name === 'admin' ? '超级管理员' : '普通用户';
}
},
mounted() {
this.getData()
this.timer = setInterval(this.getData,1000)
this.$once('hook:beforeDestroy',() => {
clearInterval(this.timer)
})
},
methods: {
getData() {
let data = {
type: this.form.type,
startTime: this.form.startTime,
stopTime: this.form.stopTime,
month: this.form.month,
searchContent: this.encodeString(this.keyword),
status: this.form.status,
page: this.pageNo,
size: this.pageSize,
systemId: this.systemId,
schoolId: this.schoolId ? this.schoolId : ''
}
this.$get(this.api.expList,data).then(res => {
this.customerData = res.list.list
this.totals = res.list.totalCount
}).catch(res => {});
},
initData(){
this.$refs.table.clearSelection()
this.pageNo = 1
this.getData()
},
permission(){
this.$router.push('/permission')
},
add(){
this.$router.push('addclass')
},
edit(row){
this.$router.push(`addclass?id=${row.id}`)
},
show(row){
this.$store.commit('addExperimentData',{experimentData: {
systemId: this.systemId,
id: row.id,
projectId: row.projectId,
name: row.projectName,
experimentalName: row.experimentalName,
class: row.experimentalClassName,
}})
this.$router.push('experiment')
},
start(row){
let data = {
id: row.id,
startTime: this.formatDate("yyyy-MM-dd hh:mm:ss",new Date()),
status: 2
}
this.$post(this.api.expUpdate,data).then(res => {
if(res.errmessage == 'success') {
this.$message.success('启动成功!')
this.getData()
}
}).catch(res => {});
},
finish(row){
this.$confirm('确定要提前结束吗?', '提示', {
type: 'warning'
})
.then(() => {
let data = {
id: row.id,
stopTime: this.formatDate("yyyy-MM-dd hh:mm:ss",new Date()),
status: 3
}
this.$post(this.api.expUpdate,data).then(res => {
if(res.errmessage == 'success') {
this.$message.success('提前结束成功!')
this.getData()
}
}).catch(res => {})
})
.catch(() => {})
},
delData(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(this.api.expDelete,[row.id]).then(res => {
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
},
delAllData() {
if(this.multipleSelection.length != ''){
let newArr = this.multipleSelection
let delList = newArr.map(item => {
return item.id
})
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
let data = delList
this.$post(this.api.expDelete,data).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection()
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
}else{
this.$message.error('请先选择数据 !');
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
onSearch(){
this.pageNo = 1
this.getData()
},
handleCurrentChange(val) {
this.pageNo = val;
this.getData();
},
transferTime(date,type){
if(date == '0000-00-00 00:00:00') return '---'
return date
}
}
};
</script>
<style scoped>
.mag{
margin-right: 20px;
}
/deep/.el-tabs__nav-wrap::after{
display: none;
}
.no-mb /deep/.el-form-item{
margin-bottom: 0;
}
</style>

@ -1,725 +0,0 @@
<template>
<div>
<div class="Bank_m">
<div style="text-align: right">
<el-button type="primary" size="small" round @click="getInfo" v-auth>测评设置</el-button>
</div>
<el-dialog title="测评设置" :visible.sync="SetEvaluation" width="30%" :close-on-click-modal="false">
<div style="margin-bottom: 15px;">
<span class="radio">题目选择</span>
<el-radio v-model="info.evaluationType" label="1">随机</el-radio>
<el-radio v-model="info.evaluationType" label="0">自定义</el-radio>
</div>
<!-- 随机 -->
<el-card shadow="hover" class="card_m" v-show="info.evaluationType==1">
<div class="input flex_around">
<span>测评题目总数</span>
<el-input placeholder="请输入题目数量" type="number" v-model="info.questionNum"></el-input>
<span>(总数{{info.totalQuestionNum}})</span>
</div>
</el-card>
<!-- 自定义 -->
<el-card shadow="hover" class="card_m" v-show="info.evaluationType==0">
<div class="input">
<div class="check-wrap" :class="{checked: info.isSingleEnable}">
<el-checkbox v-model="info.isSingleEnable">单选题</el-checkbox>
<el-input placeholder="请输入题目数量" type="number" v-model="info.singleNum" :disabled="!info.isSingleEnable"></el-input>
<span>(总数{{info.totalSingleNum}})</span>
</div>
<div class="check-wrap" :class="{checked: info.isMultipleEnable}">
<el-checkbox v-model="info.isMultipleEnable">多选题</el-checkbox>
<el-input placeholder="请输入题目数量" type="number" v-model="info.multipleNum" :disabled="!info.isMultipleEnable"></el-input>
<span>(总数{{info.totalMultipleNum}})</span>
</div>
<div class="check-wrap" :class="{checked: info.isJudgmentEnable}">
<el-checkbox v-model="info.isJudgmentEnable">判断题</el-checkbox>
<el-input placeholder="请输入题目数量" type="number" v-model="info.judgmentNum" :disabled="!info.isJudgmentEnable"></el-input>
<span>(总数{{info.totalJudgmentNum}})</span>
</div>
</div>
</el-card>
<div class="jobNumber">
<div class="input">
<span style="margin:0px 15px 0px 35px">测评时长</span>
<el-input placeholder="请输入时间" type="number" v-model="info.duration"></el-input>
<span style="margin-left:15px">分钟</span>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="SetEvaluation = false"> </el-button>
<el-button type="primary" v-preventReClick @click="submitSetEva"> </el-button>
</span>
</el-dialog>
</div>
<el-row :gutter="20">
<el-col :span="24">
<el-card shadow="hover" class="mgb20">
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>测评题库</span>
</div>
<div class="flex-between">
<div>
<span style="margin-right: 15px;">题目类型</span>
<el-radio-group v-model="subject" @change="initData">
<el-radio
v-for="(item,index) in subjectList"
:key="index"
:label="item.id"
>{{item.name}}</el-radio>
</el-radio-group>
</div>
<div>
<el-input
placeholder="请输入题干"
prefix-icon="el-icon-search"
v-model="keyword"
clearable
></el-input>
</div>
</div>
</el-card>
</el-col>
<div>
<el-dialog :title="topicsTitle" :visible.sync="NewTopics" width="30%" @close="closeTopics" center :close-on-click-modal="false">
<el-form
:model="topicForm"
:rules="rules"
:disabled="isShowTopics"
ref="topicForm"
label-width="70px"
class="demo-topicForm"
>
<el-form-item label="题型" prop="questionType">
<el-radio-group v-model="topicForm.questionType" @change="questionTypeChange">
<el-radio label="单选题"></el-radio>
<el-radio label="多选题"></el-radio>
<el-radio label="判断题"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="题干" prop="questionStem">
<el-input type="textarea" v-model="topicForm.questionStem"></el-input>
</el-form-item>
<el-form-item label="选项" prop="optionA">
<div class="input flex_around bt">
<span>A</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionA"></el-input>
<el-checkbox v-model="topicForm.aisTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex_around bt">
<span>B</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionB"></el-input>
<el-checkbox v-model="topicForm.bisTrue">设为正确答案</el-checkbox>
</div>
<template v-if="topicForm.questionType != '判断题'">
<div class="input flex_around bt">
<span>C</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionC"></el-input>
<el-checkbox v-model="topicForm.cisTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex_around bt">
<span>D</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionD"></el-input>
<el-checkbox v-model="topicForm.disTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex_around bt">
<span>E</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionE"></el-input>
<el-checkbox v-model="topicForm.eisTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex_around">
<span>F</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionF"></el-input>
<el-checkbox v-model="topicForm.fisTrue">设为正确答案</el-checkbox>
</div>
</template>
</el-form-item>
<el-form-item label="答案解析" prop="answerAnalysis">
<el-input type="textarea" v-model="topicForm.answerAnalysis"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer" v-show="!isShowTopics">
<el-button v-preventReClick @click="NewTopics = false"> </el-button>
<el-button type="primary" @click="saveTopics"> </el-button>
</div>
</el-dialog>
<el-dialog title="批量上传" :visible.sync="BatchUpload" width="30%" @close="closeUpload" :close-on-click-modal="false" center>
<el-card shadow="hover" class="card_m" v-show="this.label=1">
<div class="Upload">
<div class="bt" @click="downloadTem">
<el-link :underline="false">
1.请下载模板
<i class="el-icon-download"></i>
</el-link>
</div>
<!-- <div class="bt">
<el-upload
accept=".xls,.xlsx"
:on-remove="handleRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.upload"
:file-list="uploadList"
name="file"
>
<el-link :underline="false">
2.请点击上传模板
<i class="el-icon-upload"></i>
</el-link>
</el-upload>
</div> -->
<div>
<el-upload
accept=".xls,.xlsx"
:on-remove="handleDataRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.import"
:file-list="uploadDataList"
name="file"
>
<el-link :underline="false">
2.请点击批量导入
<i class="el-icon-upload"></i>
</el-link>
</el-upload>
<el-link v-if="uploadFaild" type="primary" @click="showFaild">部分数据导入失败查看失败原因</el-link>
</div>
</div>
</el-card>
<span slot="footer" class="dialog-footer">
<el-button @click="BatchUpload = false"> </el-button>
<el-button type="primary" v-preventReClick @click="uploadSure"> </el-button>
</span>
</el-dialog>
</div>
<el-col :span="24">
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="hr_tag"></p>
<span>题目列表</span>
</div>
<div>
<el-button
type="primary"
size="small"
icon="el-icon-plus"
round
class="bt_one"
@click="addTopics"
v-auth
>新增题目</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-top"
round
class="bt_one"
@click="showBatchUpload"
v-auth
>批量上传</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-delete"
round
class="bt_one"
@click="delAllData"
v-auth
>批量删除</el-button>
</div>
</div>
<el-table
:data="orderData"
ref="table"
row-key="id"
class="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
:reserve-selection="true"
></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template
slot-scope="scope"
>{{scope.$index + (pageNo - 1) * pageSize + 1}}</template>
</el-table-column>
<el-table-column prop="questionStem" label="题干" align="center"></el-table-column>
<el-table-column prop="questionTypeName" label="题型" align="center"></el-table-column>
<el-table-column prop="modifyTime" label="时间" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<template v-if="scope.row.isEnable">
<el-button type="text" @click="showQues(scope.row)" v-auth>查看</el-button>
</template>
<template v-else>
<el-button type="text" @click="editQues(scope.row)" v-auth>修改</el-button>
</template>
<el-switch
v-model="scope.row.isEnable"
:active-text="scope.row.isEnable ? '关闭' : '启用'"
:active-value="1"
:inactive-value="0"
style="margin: 0 10px 0 5px"
@change="switchQues($event,scope.row,scope.$index)"
v-auth="'evaluation:禁用'"
></el-switch>
<el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination
background
@current-change="handleCurrentChange"
:current-page="pageNo"
:page-size="pageSize"
layout="total,prev, pager, next"
:total="dataTotal"
></el-pagination>
</div>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import bus from '../common/bus';
export default {
data() {
return {
topicForm: {
answer: '',
questionType : '单选题',
questionStem : '',
optionA:'',
optionB:'',
optionC:'',
optionD:'',
optionE:'',
optionF:'',
aisTrue: false,
bisTrue: false,
cisTrue: false,
disTrue: false,
eisTrue: false,
fisTrue: false,
answerAnalysis: ''
},
rules: {
questionType: [{ required: true, message: '请选择题型', trigger: 'change' }],
questionStem: [{ required: true, message: '请填写题干', trigger: 'blur' }],
// optionA: [{ required: true, message: '', trigger: 'change' }],
// optionB: [{ required: true, message: '', trigger: 'change' }]
},
value: true,
subject: '', //
keyword: '',
orderData: [],
subjectList: [
{
id: '',
name: '不限'
},
{
id: 1,
name: '单选题'
},
{
id: 2,
name: '多选题'
},
{
id: 3,
name: '判断题'
}
],
dataTotal: 0, // ()
pageNo: 1,
pageSize: 10,
currentPage: 1,
SetEvaluation: false,
radio: '1', //
topicsNumber: '', //
topicsTime: '', //
random: true,
custom: false,
info: {},
NewTopics: false, //
Customs: ['1', '2', '3'],
BatchUpload: false, //
questionType: ['','单选题','多选题','判断题'],
multipleSelection: [],
isShowTopics: false,
topicsTitle: '',
uploadList: [],
uploadDataList: [],
searchTimer: null,
uploadFaild: false,
token: ''
};
},
mounted() {
this.getData()
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
},500)
}
},
methods: {
getData() {
this.$get(this.api.list, {
page: this.pageNo,
size: this.pageSize,
questionStem: this.encodeString(this.keyword),
questionType: this.subject
})
.then(res => {
this.dataTotal = res.page.totalCount; //
this.pageNo = res.page.currPage; //
this.orderData = res.page.list;
this.$refs.table.clearSelection()
})
.catch(err => {})
},
initData(){
this.$refs.table.clearSelection()
this.pageNo = 1
this.getData()
},
resetForm() {
this.topicForm = {
answer: '',
questionType : '',
questionStem : '',
optionA:'',
optionB:'',
optionC:'',
optionD:'',
optionE:'',
optionF:'',
aisTrue: false,
bisTrue: false,
cisTrue: false,
disTrue: false,
eisTrue: false,
fisTrue: false,
answerAnalysis: ''
}
this.$nextTick(() => {
this.$refs.topicForm.clearValidate()
})
},
handleCurrentChange(val) {
this.pageNo = val
this.getData()
},
addTopics() {
this.topicForm.id = ''
this.topicsTitle = '新增题目'
this.NewTopics = true
},
getDetail(id) {
this.$get(this.api.infoId + id).then(res => {
this.topicForm = res.questions
this.topicForm.id = id
this.topicForm.questionType = this.questionType[this.topicForm.questionType]
this.NewTopics = true
}).catch(res => {});
},
editQues(row) {
this.topicsTitle = '编辑题目'
this.getDetail(row.id)
},
showQues(row) {
this.topicsTitle = '查看题目'
this.isShowTopics = true
this.getDetail(row.id)
},
closeTopics() {
this.isShowTopics = false
this.resetForm()
},
switchQues(val,row,index) {
this.$put(this.api.isenable, [row.id])
.then(res => {
if(res.status == 400){
this.$message.error(res.errmessage)
row.isEnable = row.isEnable == 1 ? 0 : 1
}
})
.catch(err => {});
},
delData(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(this.api.delete,[row.id]).then(res => {
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
delAllData() {
if(this.multipleSelection.length != ''){
let newArr = this.multipleSelection
let delList = newArr.map(item => {
return item.id
})
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
let data = delList
this.$post(this.api.delete,data).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection()
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
}else{
this.$message.error('请先选择题目 !');
}
},
downloadTem() {
location.href = this.api.questionsTemplate
},
getInfo() {
this.$get(this.api.info).then(res => {
this.info = res.data
this.info.evaluationType = this.info.evaluationType.toString()
this.info.isSingleEnable = Boolean(this.info.isSingleEnable)
this.info.isMultipleEnable = Boolean(this.info.isMultipleEnable)
this.info.isJudgmentEnable = Boolean(this.info.isJudgmentEnable)
this.SetEvaluation = true
}).catch(res => {});
},
questionTypeChange() {
for(let i in this.topicForm){
if(i.includes('isTrue')) this.topicForm[i] = false
}
},
submitSetEva() {
let info = this.info
if(info.evaluationType == 0){
let allEmpty = true
if(!info.isSingleEnable && !info.isMultipleEnable && !info.isJudgmentEnable) return this.$message.warning('请至少选择一种题型')
if(info.isSingleEnable == 1 && info.singleNum != 0) allEmpty = false
if(info.isMultipleEnable == 1 && info.multipleNum != 0) allEmpty = false
if(info.isJudgmentEnable == 1 && info.judgmentNum != 0) allEmpty = false
if(allEmpty) return this.$message.warning('请至少选中一种类型,并数量大于0')
if(info.isSingleEnable == 1 && info.singleNum > info.totalSingleNum) return this.$message.warning('单选题大于总数,请重新输入')
if(info.isMultipleEnable == 1 && info.multipleNum > info.totalMultipleNum) return this.$message.warning('多选题大于总数,请重新输入')
if(info.isJudgmentEnable == 1 && info.judgmentNum > info.totalJudgmentNum) return this.$message.warning('判断题大于总数,请重新输入')
}else{
if(info.questionNum === '') return this.$message.warning('请输入测评题目总数')
if(info.questionNum == 0) return this.$message.warning('测评题目总数不得为0')
}
if(info.duration === '') return this.$message.warning('请输入测评时长')
if(info.duration == 0) return this.$message.warning('测评时长不得为0')
this.info.isSingleEnable = Number(this.info.isSingleEnable)
this.info.isMultipleEnable = Number(this.info.isMultipleEnable)
this.info.isJudgmentEnable = Number(this.info.isJudgmentEnable)
this.$put(this.api.update,this.info).then(res => {
if(res.errmessage == 'success'){
this.$message.success('提交成功!');
this.SetEvaluation = false
}else{
this.$message.error(res.message);
}
}).catch(res => {});
},
saveTopics() {
this.$refs.topicForm.validate((valid) => {
if (valid) {
let topicForm = this.topicForm
let optionCount = 0
let answer = ''
let isInvalidAnswer = false
for(let n in topicForm) {
if(n.includes('option')) {
topicForm[n] != '' && ++optionCount
}
if(n.includes('isTrue') && topicForm[n]) {
let curOpt = n.replace('isTrue','')
answer += curOpt
if(!topicForm[`option${curOpt.toUpperCase()}`].length) isInvalidAnswer = true
}
}
if(optionCount < 2) return this.$message.warning('请至少添加两个选项!');
if(!answer) return this.$message.warning('请设置正确答案!');
if(topicForm.questionType != '多选题' && answer.length > 1) return this.$message.warning('单选题、判断题只能设置一个正确答案!');
if(isInvalidAnswer) return this.$message.warning('正确答案选项为空,请重新设置!');
this.topicForm.questionType = this.questionType.indexOf(this.topicForm.questionType)
this.topicForm.answer = answer.toUpperCase()
if(this.topicForm.id) {
this.$put(this.api.questionsUpdate,this.topicForm).then(res => {
if(res.errmessage == 'success') {
this.$message.success('提交成功!');
this.NewTopics = false
this.getData()
}else{
this.$message.error(res.message);
}
}).catch(res => {});
}else{
this.$post(this.api.save,this.topicForm).then(res => {
if(res.errmessage == 'success') {
this.$message.success('提交成功!');
this.NewTopics = false
this.getData()
}else{
this.$message.error(res.message);
}
}).catch(res => {});
}
}else{
return false;
}
})
},
showBatchUpload() {
this.BatchUpload = true
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
uploadSuccess(res, file, fileList) {
this.uploadFaild = false
if(res.data.token){
this.token = res.data.token
this.uploadFaild = true
}
},
showFaild(){
location.href = `${this.api.export_failure}?token=${this.token}`
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList) {
this.uploadList = fileList
},
handleDataRemove(file, fileList) {
this.uploadList = fileList
this.uploadFaild = false
},
uploadSure(){
this.BatchUpload = false
this.pageNo = 1
this.keyword = ''
this.getData()
},
closeUpload() {
this.uploadFaild = false
this.uploadList = []
this.uploadDataList = []
}
}
};
</script>
<style lang="scss" scoped>
::v-deep .el-checkbox-group{
font-size: 2px;
}
.Upload {
text-align: center;
}
.bt {
margin-bottom: 15px;
}
.bt_one {
margin-left: 10px;
}
.Bank_m {
margin-bottom: 20px;
}
.Bank img {
width: 15px;
height: 15px;
margin-right: 10px;
}
.Bank span {
font-size: 16px;
}
.jobNumber {
margin: 10px 0;
}
.flex_around {
display: flex;
justify-content: space-around;
align-items: center;
}
.card_m {
margin: 10px 0 20px 0;
}
.input ::v-deep .el-input {
width: 50%;
}
.radio {
margin: 0 15px 0 30px;
font-weight: 600;
}
.mag {
margin-right: 20px;
}
.check-wrap{
display: flex;
align-items: center;
margin-bottom: 15px;
}
.check-wrap .el-input{
margin: 0 15px;
}
.check-wrap.checked{
color: #9076FF;
}
</style>

@ -1,418 +0,0 @@
<template>
<div>
<el-card v-if="showBack" shadow="hover" class="mgb20">
<div class="flex-between">
<div class="per_title" v-preventReClick @click="goback()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
</div>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>筛选</span>
</div>
<div>
<el-form label-width="80px" class="flex-between no-mb">
<div class="flex-center">
<div>
<el-form-item label="创建人">
<el-select v-model="queryData.founder" clearable placeholder="请选择创建人" @change="initData">
<el-option v-for="(item,index) in founder" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item label="状态">
<el-select v-model="queryData.state" clearable placeholder="请选择状态" @change="initData">
<el-option v-for="(item,index) in state" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item label="权限">
<el-select v-model="queryData.projectPermissions" placeholder="请选择" @change="initData">
<el-option
v-for="item in projectPermissions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</div>
<div>
<el-form-item label="系统">
<el-select v-model="systemId" placeholder="请选择" @change="initData">
<el-option
v-for="item in systemList"
:key="item.value"
:label="item.label"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</div>
</div>
<div>
<el-form-item>
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</el-form-item>
</div>
</el-form>
</div>
</div>
</el-card>
<el-card shadow="hover">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="hr_tag"></p>
<span>项目列表</span>
</div>
<div>
<el-button type="primary" size="small" round @click="add" v-auth>新增项目</el-button>
<el-button type="primary" size="small" round @click="delAllData" v-auth>批量删除</el-button>
</div>
</div>
<el-table :data="projectData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">{{scope.$index + (pageNo - 1) * pageSize + 1}}</template>
</el-table-column>
<el-table-column prop="projectName" label="实验项目名称" align="center">
</el-table-column>
<el-table-column prop="founder" label="创建人" align="center"></el-table-column>
<el-table-column label="权限" align="center">
<template slot-scope="scope">
{{scope.row.projectPermissions == 2 ? '竞赛' : projectPermissions.find(n => n.value === scope.row.projectPermissions).label}}
</template>
</el-table-column>
<el-table-column prop="creationTime" label="创建时间" align="center">
</el-table-column>
<el-table-column prop="status" label="状态" align="center">
<template slot-scope="scope">
{{transferStatus(scope.row.state)}}
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)" v-auth v-if="roleId == 1 || (roleId == 13 && scope.row.founder != '超级管理员') || (roleId == 14 && scope.row.founder == '老师')">编辑</el-button>
<el-button type="text" @click="delData(scope.row)" v-auth v-if="roleId == 1 || (roleId == 13 && scope.row.founder != '超级管理员') || (roleId == 14 && scope.row.founder == '老师')">删除</el-button>
<el-button type="text" @click="copyData(scope.row)" v-auth>复制</el-button>
<el-switch
v-model="scope.row.enable"
:active-text="scope.row.enable ? '关闭' : '启用'"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 10px"
@change="switchOff($event,scope.row,scope.$index)"
></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="pageNo" layout="total, prev, pager, next" :total="totals"></el-pagination>
</div>
</el-card>
<el-dialog title="复制" :visible.sync="copyVisible" width="24%" center :close-on-click-modal="false">
<el-form>
<el-form-item>
<el-input placeholder="请输入项目名称" v-model="projectName" @change="projectNameExistis"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="copyVisible = false"> </el-button>
<el-button type="primary" @click="copySubmit"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import bus from '../common/bus';
export default {
data() {
return {
showBack: JSON.stringify(this.$store.state.addClass) == '{}' ? false : true,
roleId: this.$store.state.userRoleId.includes(',') ? 13 : Number(this.$store.state.userRoleId),
userId: this.$store.state.userLoginId,
systemId: this.$store.state.systemId ? this.$store.state.systemId : this.$config.systemId,
systemList: this.$config.systemList,
queryData: {
projectPermissions: "",
founder: "",
state: "",
projectName: "",
userId: this.$store.state.userLoginId,
systemId: this.systemId
},
keyword: '',
status: '',
projectData:[],
totals: 0,
projectPermissions: [
{
value: "",
label: "不限"
},
{
value: 0,
label: "练习"
},
{
value: 1,
label: "考核"
},
// {
// value: 2,
// label: ""
// }
],
founder: [
{
value: "",
label: "不限"
},
{
value: 1,
label: "超级管理员"
},
{
value: 13,
label: "管理员"
},
{
value: 14,
label: "老师"
}
],
state: [
{
value: "",
label: "不限"
},
{
value: 0,
label: "草稿箱"
},
{
value: 1,
label: "已发布"
}
],
pageNo: 1,
pageSize: 10,
multipleSelection: [],
copyVisible: false,
projectName: '',
projectNameRepeat: false,
currentRow: {},
projectDataAll: []
};
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
},500)
}
},
mounted() {
console.log(11,this.roleId)
this.getData()
},
methods: {
getData(){
this.$store.commit("addProjectSystemIdData",{systemId : this.systemId})
let data = this.queryData
data.pageNo = this.pageNo
data.pageSize = this.pageSize
data.projectName = this.encodeString(this.keyword)
data.systemId = this.systemId
this.$get(this.api.queryAllManagements,data).then(res => {
let list = res.pageInfo.list
let newList = []
// list.map(n => {
// if(this.roleId == 14){
// (n.userId == this.userId || n.founder == 1 || n.founder == 13) && newList.push(n)
// }else{
// newList.push(n)
// }
// })
list.map(n => {
if(n.founder.includes(',')){
n.founder = '管理员'
}else{
n.founder = this.roleStatus(n.founder)
}
})
this.projectData = list
this.totals = res.pageInfo.total
}).catch(res => {});
},
initData(){
this.pageNo = 1
this.getData()
},
handlePage(){
let list = this.projectDataAll
let result = list.slice((this.pageNo - 1) * this.pageSize,this.pageNo * this.pageSize)
this.projectData = result
},
transferStatus(status){
return status == 1 ? '已发布' : '草稿箱'
},
handleCurrentChange(val){
this.pageNo = val
this.getData()
},
add(){
this.$store.commit("addProjectSystemIdData", { systemId : this.systemId});
this.$router.push('/addproject');
},
edit(row){
this.$store.commit("addProjectSystemIdData", { systemId : row.systemId});
this.$router.push(`/addproject?id=${row.projectId}`);
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
delData(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(this.api.removeProjectManagement,[row.projectId]).then(res => {
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
},
delAllData() {
if(this.multipleSelection.length != ''){
let newArr = this.multipleSelection
let delList = newArr.map(item => {
return item.projectId
})
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(this.api.removeProjectManagement,delList).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection()
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
}else{
this.$message.error('请先选择项目 !');
}
},
projectNameExistis(){
let data = {
projectName: this.encodeString(this.projectName)
}
this.$get(this.api.isNameExistis,data).then(res => {
if(res.status != 200){
this.projectNameRepeat = true
this.$message.warning('该项目名称已存在')
}else{
this.projectNameRepeat = false
}
}).catch(res => {})
},
copyData(row){
this.currentRow.management = {
caseDescription: row.caseDescription,
experimentSuggests: row.experimentSuggests,
experimentalGoal: row.experimentalGoal,
founder: row.founder,
isstartexperimentSuggests: row.isstartexperimentSuggests,
isstartexperimental: row.isstartexperimental,
projectName: row.projectName,
projectPermissions: row.projectPermissions,
state: row.state,
systemId: row.systemId,
userId: row.userId,
knowledgePoints: row.knowledgePoints,
experimentIntroduction: row.experimentIntroduction
}
this.currentRow.founder = row.founder
this.projectName = row.projectName
this.projectNameRepeat = true
this.copyVisible = true
let data = {
projectId: row.projectId
}
this.$get(this.api.getZZJudgmentPoints,data).then((res) => {
this.currentRow.roleId = res.message.roleList.map(n => n.roleId)
let scoreList = res.message.scoreIndexList
let scores = []
for(let i in scoreList){
scores = scores.concat(scoreList[i])
}
let point = res.message.judgmentPointsList
point.map(n => {
let same = scores.find(e => e.judgmentPointsId == n.judgmentPointsId)
if(same) n.score = same.score
})
this.currentRow.pooints = point
this.$message.warning('请修改项目名称')
})
},
copySubmit(){
if(!this.projectName.length) return this.$message.warning('请填写项目名称')
if(this.projectNameRepeat) return this.$message.warning('该项目名称已存在')
let data = this.currentRow
data.management.projectName = this.projectName
data.founder = this.roleId
data.management.founder = this.roleId
data.management.userId = this.userId
data.pooints.map(n => {
n.userId = this.userId
})
let systemId = this.currentRow.management.systemId
let url = this.api.addProjectManagement
if(systemId == 2 || systemId == 3) url = this.api.addProjectManagementTrad
this.$post(url,data).then((res) => {
this.$message.success('复制成功');
this.copyVisible = false
this.getData()
})
},
switchOff(val,row,index) {
this.$get(this.api.enableProject,{
id: row.projectId,
enable: row.enable
})
.then(res => {
if(res.status != 200){
this.$message.error(res.errmessage)
row.enable = row.enable == 1 ? 0 : 1
}
})
.catch(err => {});
},
goback() {
this.$router.back()
},
}
};
</script>
<style scoped>
.no-mb /deep/.el-form-item{
margin-bottom: 0;
}
</style>

@ -1,115 +0,0 @@
<template>
<div class="Achievement-container">
<div class="tabs" v-if="showTabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a>
</div>
<div class="score-table" v-if="active == 'first'" v-auth="'系统设置:员工管理'">
<staff></staff>
</div>
<div class="score-table" v-else v-auth="'系统设置:角色权限'">
<role></role>
</div>
</div>
</template>
<script>
import staff from './Staff.vue';
import role from './Role.vue';
export default {
data() {
return {
active: 'first',
userId: this.$store.state.userId,
tabs: {
first: '员工管理',
second: '角色权限'
},
showTabs: true
};
},
components: {
staff,
role
},
created() {
this.$config.dynamicRoute && this.initTabs()
},
methods: {
tabChange(index){
this.active = index
},
initTabs(){
let btnPermissions = this.$store.state.btnPermissions
let showStaff = btnPermissions.includes('系统设置:员工管理')
let showRole = btnPermissions.includes('系统设置:角色权限')
if(!showStaff || !showRole){
this.showTabs = false
}
!showStaff && showRole && (this.active = 'second')
}
}
};
</script>
<style lang="scss" scopted>
.Achievement-container {
width: 100%;
box-shadow: 0px 0px 21px 0px rgba(48, 115, 248, 0.1);
text-align: center;
overflow: hidden;
.header {
width: 97%;
display: flex;
justify-content: space-between;
margin: 0 auto;
margin-top: 16px;
p {
margin-top: 14px;
font-size: 20px;
font-family: MicrosoftYaHeil;
color: #333333;
}
}
.score-table {
margin: 0 auto;
margin-top: 18px;
position: relative;
.block {
position: absolute;
right: 0px;
bottom: -50px;
}
}
.el-pagination.is-background .el-pager li:not(.disabled).active {
background-color: #9278ff;
color: #fff;
}
}
.tabs{
display: flex;
align-items: center;
padding: 20px 1.5% 20px;
margin: 0;
z-index: 999;
background-color: #fff;
.item{
padding: 12px 20px;
margin-right: 10px;
color:#606266;
line-height: 1;
border-radius: 4px;
background-color: #fff;
border: 1px solid #dcdfe6;
cursor: pointer;
&.active{
color: #fff;
background-color: #9278ff;
border-color: #9278ff;
}
}
}
</style>

@ -0,0 +1,124 @@
<template>
<div>
<el-dialog
custom-class="pdf-dia"
:close-on-click-modal="false"
:visible.sync="visible"
@close="closePdf"
:fullscreen="true"
:modal="false"
:append-to-body="true">
<div>
<button type="button" aria-label="Close" class="el-dialog__headerbtn" @click="closePdf"><i class="el-dialog__close el-icon el-icon-close"></i></button>
<div class="pdf">
<p class="arrow">
<span @click="changePdfPage(0)" class="turn el-icon-arrow-left" :class="{grey: currentPage==1}"></span>
{{currentPage}} / {{pageCount}}
<span @click="changePdfPage(1)" class="turn el-icon-arrow-right" :class="{grey: currentPage==pageCount}"></span>
</p>
<pdf
class="pdf-wrap"
:src="src"
:page="currentPage"
@num-pages="pageCount=$event"
@page-loaded="currentPage=$event"
@loaded="loadPdfHandler"
>
</pdf>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import pdf from "vue-pdf";
export default {
props: ['visible','src'],
data() {
return {
pdfVisible: false,
pdfSrc: '',
currentPage: 0,
pageCount: 0,
fileType: 'pdf',
};
},
components: { pdf },
mounted(){
this.addEvent()
},
methods: {
closePdf(){
this.$emit('update:visible',false)
this.$emit('update:src','')
this.currentPage = 1
},
changePdfPage (val) {
if (val === 0 && this.currentPage > 1) {
this.currentPage--
}
if (val === 1 && this.currentPage < this.pageCount) {
this.currentPage++
}
},
loadPdfHandler (e) {
this.currentPage = 1
},
addEvent(){
document.onkeydown = e => {
let key = window.event.keyCode
if(key == 37){
this.changePdfPage(0)
}else if(key == 39){
this.changePdfPage(1)
}
}
this.$once('hook:beforeDestroy',() => {
document.onkeydown = null
})
}
}
};
</script>
<style lang="scss" scoped>
/deep/.pdf-dia{
border-radius: 0 !important;
.el-dialog__header{
display: none;
}
.el-dialog__body{
padding: 0;
}
.el-dialog__headerbtn{
top: 10px;
.el-dialog__close{
color: #fff;
font-size: 16px;
}
}
.pdf{
.arrow{
display: flex;
justify-content: center;
align-items: center;
width: 100%;
padding: 10px 0;
font-size: 16px;
color: #fff;
background-color: #333;
.turn{
margin: 0 10px;
font-size: 18px;
cursor: pointer;
}
}
.pdf-wrap{
height: calc(100vh - 45px);
margin: 0 auto;
overflow: auto;
}
}
}
</style>

@ -1,5 +1,5 @@
<template> <template>
<div class="quill" :class="[classes,readonly ? 'readonly' : '']"> <div class="quill" :class="classes">
<div ref="editor" :style="styles" v-loading="loading"></div> <div ref="editor" :style="styles" v-loading="loading"></div>
<el-upload :action="this.api.fileupload" :before-upload="beforeUpload" :on-success="editorUploadSuccess" style="display: none"> <el-upload :action="this.api.fileupload" :before-upload="beforeUpload" :on-success="editorUploadSuccess" style="display: none">
@ -51,7 +51,7 @@
debug: 'warn', debug: 'warn',
modules: { modules: {
toolbar: { toolbar: {
container: this.readonly ? [] : toolbarOptions, container: toolbarOptions,
handlers: { handlers: {
'image': function (value) { 'image': function (value) {
if (value) { if (value) {

@ -7,6 +7,7 @@ export default [
[{ 'indent': '-1' }, { 'indent': '+1' }], [{ 'indent': '-1' }, { 'indent': '+1' }],
[{ 'direction': 'rtl' }], [{ 'direction': 'rtl' }],
[{ 'size': ['small', false, 'large', 'huge'] }], [{ 'size': ['small', false, 'large', 'huge'] }],
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }], [{ 'color': [] }, { 'background': [] }],
[{ 'font': [] }], [{ 'font': [] }],
[{ 'align': [] }], [{ 'align': [] }],

@ -1,123 +0,0 @@
const isHh = location.host.includes('10.196.131.73') //是否是河海版本
const isBeta = process.env.NODE_ENV === 'development' || location.host.includes('liuwanr.cn') //是否是职站测试
export default {
/**
* @description 域名切换liuwan职站测试环境occupationlab.com职站正式环境10.196.131.73河海版本
*/
host: (process.env.NODE_ENV === 'development' || location.host.includes('liuwanr.cn')) ? 'http://www.liuwanr.cn/' : (location.host.includes('10.196.131.73') ? 'http://10.196.131.73/' : 'http://www.occupationlab.com/'),
/**
* @description 是否是河海版本
*/
isHh,
/**
* @description 配置显示在浏览器标签的title
*/
title: isHh ? '教师管理端' : '职站服务端管理系统',
/**
* @description 学校id
*/
schoolId: isHh ? 729 : 2105,
/**
* @description 系统列表
*/
systemList: isHh ? [{
id: 1,
label: 'Python程序设计教学系统'
}
,{
id: 4,
label: '经济金融建模实验教学系统'
},
{
id: 6,
label: '金融随机过程实验教学系统'
},{
id: 7,
label: '量化投资策略建模实验教学系统'
},{
id: 8,
label: '大数据分析实验教学系统'
}] : (isBeta ? [{
id: 1,
label: 'Python程序设计教学系统'
}
// ,{
// id: 2,
// label: '跨国仿真系统'
// },{
// id: 3,
// label: '期权期货系统'
// }
,{
id: 4,
label: '经济金融建模实验教学系统'
},{
id: 5,
label: 'Python可视化实验教学系统'
},{
id: 6,
label: '金融随机过程实验教学系统'
},{
id: 7,
label: '量化投资策略建模实验教学系统'
},{
id: 8,
label: '大数据分析实验教学系统'
},{
id: 9,
label: 'Python数据清洗教学实验系统'
},{
id: 10,
label: 'Python数据采集(爬虫)教学实验系统'
}] : [{
id: 1,
label: 'Python程序设计教学系统'
},{
id: 4,
label: '经济金融建模实验教学系统'
},{
id: 5,
label: 'Python可视化实验教学系统'
},{
id: 6,
label: '金融随机过程实验教学系统'
},{
id: 7,
label: '量化投资策略建模实验教学系统'
},{
id: 8,
label: '大数据分析实验教学系统'
},{
id: 9,
label: 'Python数据清洗教学实验系统'
},{
id: 10,
label: 'Python数据采集(爬虫)教学实验系统'
}]),
/**
* @description 是否使用国际化默认为false
* 如果不使用则需要在路由中给需要在菜单中展示的路由设置meta: {title: 'xxx'}
* 用来在菜单中显示文字
*/
locale: 'zh',
/**
* @description 长时间未操作自动退出登录时间
*/
autoLogoutTime: 3600000,
/**
* @description 新增项目跳转判分点数据存储cookie的key
*/
projectData: 'sta_data',
/**
* @description 默认密码
*/
initialPassword: '111aaa',
/**
* @description 系统id
*/
systemId: 1,
/**
* @description 是否使用动态路由
*/
dynamicRoute: true
}

@ -1,8 +1,8 @@
<template> <template>
<div> <div>
<div class="copyright"> <div class="copyright">
<!-- <p>技术支持深圳或然科技有限公司</p> --> <a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">粤ICP备20072679号</a>
<a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">粤ICP备20072679号</a></div> </div>
</div> </div>
</template> </template>
<script> <script>

@ -0,0 +1,84 @@
<template>
<div class="header">
<img class="logo hh" v-if="isHh" src="@/assets/img/logo-hh.png" />
<img class="logo" v-else src="@/assets/img/logo.png" />
<div class="action">
<div class="user" @click="toPersonal">
<el-avatar :size="40" :src="avatar"></el-avatar>
<span class="m-l-10">{{userName}}</span>
</div>
<el-divider direction="vertical"></el-divider>
<el-button type="text" class="ml20" @click="logout">退出</el-button>
</div>
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex'
import util from '@/libs/util'
import Setting from '@/setting'
export default {
data() {
return {
isHh: Setting.isHh,
};
},
computed: {
...mapState('user', [
'avatar','userName'
]),
...mapState('auth', [
'routes'
])
},
mounted(){
},
methods: {
...mapActions('user', [
'logout'
]),
toPersonal(){
this.$router.push('/setting/person')
},
},
};
</script>
<style lang="scss" scoped>
.header {
position: relative;
height: 60px;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 16px;
color: #333;
background-color: #fff;
.logo {
height: 50px;
margin-left: 20px;
&.hh{
width: 220px;
}
}
.action {
display: flex;
padding-right: 50px;
align-items: center;
.user{
display: inline-flex;
align-items: center;
cursor: pointer;
}
.el-button--text{
margin-left: 20px;
color: #333;
}
.el-divider{
width: 2px;
height: 15px;
margin-left: 20px;
background-color: #333;
}
}
}
</style>

@ -0,0 +1,46 @@
<template>
<div class="main">
<v-head></v-head>
<div class="layout">
<navbar></navbar>
<div class="content">
<transition name="move" mode="out-in">
<router-view class="view"></router-view>
</transition>
<el-backtop target=".content"></el-backtop>
</div>
<v-footer ref="footer"></v-footer>
</div>
</div>
</template>
<script>
import vHead from '../header'
import navbar from '../navbar'
import vFooter from '../footer'
import Setting from '@/setting'
export default {
data() {
return {
};
},
components: {
vHead,
navbar,
vFooter
},
created() {
}
};
</script>
<style lang="scss" scoped>
.main{
min-height: 100%;
.content{
min-height: calc(100vh - 176px);
padding: 24px 24px 0;
}
}
</style>

@ -1,17 +1,6 @@
<template> <template>
<div> <div>
<el-menu class="sidebar-el-menu" :default-active="active" background-color="#324157" text-color="#bfcbd9" active-text-color="#9278FF" unique-opened mode="horizontal" router>
<el-menu
class="sidebar-el-menu"
:default-active="onRoutes"
:collapse="collapse"
background-color="#324157"
text-color="#bfcbd9"
active-text-color="#9278FF"
unique-opened
mode="horizontal"
router
>
<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">
@ -20,23 +9,11 @@
<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 <el-submenu v-if="subItem.subs" :index="subItem.index" :key="subItem.index">
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 <el-menu-item v-for="(threeItem,i) in subItem.subs" :key="i" :index="threeItem.index">{{ threeItem.title }}</el-menu-item>
v-for="(threeItem,i) in subItem.subs"
:key="i"
:index="threeItem.index"
>{{ threeItem.title }}</el-menu-item>
</el-submenu> </el-submenu>
<el-menu-item <el-menu-item v-else :index="subItem.index" :key="subItem.index">{{ subItem.title }}</el-menu-item>
v-else
:index="subItem.index"
:key="subItem.index"
>{{ subItem.title }}</el-menu-item>
</template> </template>
</el-submenu> </el-submenu>
</template> </template>
@ -52,51 +29,48 @@
</template> </template>
<script> <script>
import bus from '../common/bus'; import { mapState,mapActions } from 'vuex'
import Setting from '@/setting'
import util from '@/libs/util'
export default { export default {
data() { data() {
return { return {
collapse: false, active: this.$route.path,
defaultMenus: [ defaultMenus: [
{ {
icon: 'el-icon-takeaway-box', icon: 'el-icon-takeaway-box',
index: 'dashboard', index: '/assessment/list',
title: '考核管理' title: '考核管理'
}, },
{ {
icon: 'el-icon-collection', icon: 'el-icon-collection',
index: 'achievement', index: '/achievement/list',
title: '成绩管理' title: '成绩管理'
}, },
{ {
icon: 'el-icon-receiving', icon: 'el-icon-receiving',
index: 'evaluation', index: '/evaluation/list',
title: '测评管理' title: '测评管理'
}, },
{ {
icon: 'el-icon-postcard', icon: 'el-icon-postcard',
index: 'project', index: '/project/list',
title: '实验项目管理' title: '实验项目管理'
}, },
{ {
icon: 'el-icon-user', icon: 'el-icon-user',
index: 'student', index: '/student/list',
title: '学生管理' title: '学生管理'
}, },
// {
// icon: 'el-icon-office-building',
// index: 'backstage',
// title: ''
// },
{ {
icon: 'el-icon-setting', icon: 'el-icon-setting',
index: 'system', index: '/system/list',
title: '系统设置' title: '系统设置'
} }
], ],
menus: [], menus: [],
actives: { actives: {
dashboard: ['addclass'], dashboard: ['add'],
achievement: ['experiment','experimentVir','experimentTeach','addexperiment','addexperimentoptions','showExperiment','showExperimentoption','showExperimentoptions'], achievement: ['experiment','experimentVir','experimentTeach','addexperiment','addexperimentoptions','showExperiment','showExperimentoption','showExperimentoptions'],
project: ['addproject','program','programOption','programOptions'], project: ['addproject','program','programOption','programOptions'],
backstage: ['report'] backstage: ['report']
@ -104,27 +78,26 @@ export default {
}; };
}, },
computed: { computed: {
onRoutes() { ...mapState('auth', [
'routes'
])
},
watch: {
'$route'(to,from) {
let actives = this.actives let actives = this.actives
let path = this.$route.path.replace('/', '')
for(let i in this.actives){ for(let i in this.actives){
if(actives[i].includes(path)) return i if(actives[i].includes(this.$route.name)) this.active = `/${i}/list`
} }
return path this.active = this.$route.path
} }
}, },
created() { created() {
this.initMenu() this.initMenu()
// Event Bus
bus.$on('collapse', msg => {
this.collapse = msg;
bus.$emit('collapse-content', msg);
});
}, },
methods: { methods: {
initMenu(){ initMenu(){
if(this.$config.dynamicRoute){ if(Setting.dynamicRoute){
let routes = this.$store.state.routes[1].children let routes = this.routes
let menus = [] let menus = []
this.defaultMenus.map(e => { this.defaultMenus.map(e => {
routes.find(n => n.path == e.index) && menus.push(e) routes.find(n => n.path == e.index) && menus.push(e)
@ -138,7 +111,7 @@ export default {
}; };
</script> </script>
<style scoped> <style lang="scss" scoped>
.sidebar::-webkit-scrollbar { .sidebar::-webkit-scrollbar {
width: 0; width: 0;
} }

@ -1,28 +0,0 @@
/**
* @description 鉴权指令
* 当传入的权限当前用户没有时会移除该组件
* 用例<Tag v-auth">text</Tag> 或者:<Tag v-auth="'user:编辑'">text</Tag>
* */
import store from '@/store';
import config from '@/config'
export default {
inserted (el, binding, vnode) {
if(config.dynamicRoute){
let btnText = ''
if(binding.value){
btnText = binding.value
}else{
btnText = `${vnode.context.$route.name}:${el.innerText}`
}
const btnPermissions = store.state.btnPermissions;
if (btnText && btnPermissions && btnPermissions.length) {
const isPermission = btnPermissions.includes(btnText);
if (!isPermission) {
el.parentNode && el.parentNode.removeChild(el);
}
}
}
}
}

@ -6,17 +6,20 @@ import store from '@/store';
export default function(data){ export default function(data){
let result = [] let result = []
data.map(e => { data.map(e => {
e.children.map(n => { if(e.select){
if(n.children.length){ e.children.map(n => {
result.push(`${e.name}:${n.name}`) if(n.select){
n.children.map(j => { if(n.children.length){
e.menuUrl ? result.push(`${e.menuUrl}:${n.name}:${j.name}`) : result.push(`${n.menuUrl}:${j.name}`) result.push(`${e.name}:${n.name}`)
}) n.children.map(j => {
}else{ j.select && (e.path ? result.push(`${e.path}:${n.name}:${j.name}`) : result.push(`${n.path}:${j.name}`))
result.push(`${e.menuUrl}:${n.name}`) })
} }else{
}) result.push(`${e.path}:${n.name}`)
}
}
})
}
}) })
// console.log(11,result) store.dispatch('auth/addBtnAuth',result)
store.commit('addBtnPerData',{btnPermissions: result})
} }

@ -1,12 +0,0 @@
/**
* 插件
* */
import auth from './auth/authentication';
export default {
async install (Vue, options) {
// 指令
Vue.directive('auth', auth);
}
}

@ -0,0 +1,10 @@
// 生成随机字符串
export default function (len = 32) {
const $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
const maxPos = $chars.length;
let str = '';
for (let i = 0; i < len; i++) {
str += $chars.charAt(Math.floor(Math.random() * maxPos));
}
return str;
}

@ -2,7 +2,6 @@ import store from '@/store';
import router from '@/router'; import router from '@/router';
import generateBtnPermission from '../auth/generateBtnPermission'; import generateBtnPermission from '../auth/generateBtnPermission';
const newRoutes = [] const newRoutes = []
function createMeta(item){ function createMeta(item){
@ -12,12 +11,12 @@ function createMeta(item){
function createRoute(data){ function createRoute(data){
data.map(e => { data.map(e => {
if(e.menuUrl){ if(e.select && e.path){
let meta = createMeta(e) let meta = createMeta(e)
newRoutes.push({ newRoutes.push({
name: e.menuUrl, name: e.path,
path: e.menuUrl, path: e.path,
component: () => import(`@/components/page/${e.menuUrl}.vue`), path: () => import(`@/pages/${e.path}.vue`),
meta meta
}) })
} }
@ -28,11 +27,6 @@ function createRoute(data){
export default function(data,path){ export default function(data,path){
generateBtnPermission(data) generateBtnPermission(data)
createRoute(data) createRoute(data)
let routes = router.options.routes store.dispatch('auth/addRoutes',newRoutes)
routes[1].children = [...routes[1].children,...newRoutes]
store.commit("addRoutesData", { routes })
// router.addRoutes(routes) // router.addRoutes(routes)
setTimeout(() => {
!newRoutes.find(n => n.name == 'dashboard') && router.push(newRoutes[0].path)
},10)
} }

@ -3,16 +3,16 @@ import router from '@/router';
export default function(){ export default function(){
setTimeout(() => { setTimeout(() => {
let routes = store.state.routes let routes = store.state.auth.routes
routes.forEach(e => { routes.forEach(e => {
if(e.path == '/'){ if(e.path == '/'){
e.component = () => import('@/components/common/Home.vue') e.component = () => import('@/layouts/home/index.vue')
}else{ }else{
e.component = () => import(`@/components/page/${e.path}.vue`) e.component = () => import(`@/pages/${e.path}.vue`)
} }
e.children && e.children.forEach(n => { e.children && e.children.forEach(n => {
n.path && (n.component = () => import(`@/components/page/${n.path}.vue`)) n.path && (n.component = () => import(`@/pages/${n.path}.vue`))
}) })
}) })
@ -20,6 +20,7 @@ export default function(){
path: '*', path: '*',
redirect: '404' redirect: '404'
}) })
router.addRoutes(routes) router.addRoutes(routes)
},500) },500)
} }

@ -0,0 +1,43 @@
import Cookies from 'js-cookie';
import Setting from '@/setting';
const cookies = {};
/**
* @description 存储 cookie
* @param {String} name cookie name
* @param {String} value cookie value
* @param {Object} cookieSetting cookie setting
*/
cookies.set = function (name = 'default', value = '', cookieSetting = {}) {
let currentCookieSetting = {
expires: Setting.cookiesExpires
};
Object.assign(currentCookieSetting, cookieSetting);
Cookies.set(`admin-${name}`, value, currentCookieSetting);
};
/**
* @description 拿到 cookie
* @param {String} name cookie name
*/
cookies.get = function (name = 'default') {
return Cookies.get(`admin-${name}`);
};
/**
* @description 拿到 cookie 全部的值
*/
cookies.getAll = function () {
return Cookies.get();
};
/**
* @description 删除 cookie
* @param {String} name cookie name
*/
cookies.remove = function (name = 'default') {
return Cookies.remove(`admin-${name}`);
};
export default cookies;

@ -0,0 +1,83 @@
/**
* localStorage
* @调用_local.set('access_token', '123456', 5000);
* @调用_local.get('access_token');
*/
var _local = {
//存储,可设置过期时间
set(key, value, expires) {
let params = { key, value, expires };
if (expires) {
// 记录何时将值存入缓存,毫秒级
var data = Object.assign(params, { startTime: new Date().getTime() });
localStorage.setItem(key, JSON.stringify(data));
} else {
if (Object.prototype.toString.call(value) == '[object Object]') {
value = JSON.stringify(value);
}
if (Object.prototype.toString.call(value) == '[object Array]') {
value = JSON.stringify(value);
}
localStorage.setItem(key, value);
}
},
//取出
get(key) {
let item = localStorage.getItem(key);
// 先将拿到的试着进行json转为对象的形式
try {
item = JSON.parse(item);
} catch (error) {
// eslint-disable-next-line no-self-assign
item = item;
}
// 如果有startTime的值,说明设置了失效时间
if (item && item.startTime) {
let date = new Date().getTime();
// 如果大于就是过期了,如果小于或等于就还没过期
if (date - item.startTime > item.expires) {
localStorage.removeItem(key);
return false;
} else {
return item.value;
}
} else {
return item;
}
},
// 删除
remove(key) {
localStorage.removeItem(key);
},
// 清除全部
clear() {
localStorage.clear();
}
}
/**
* sessionStorage
*/
var _session = {
get: function (key) {
var data = sessionStorage[key];
if (!data || data === "null") {
return null;
}
return data;
},
set: function (key, value) {
sessionStorage[key] = value;
},
// 删除
remove(key) {
sessionStorage.removeItem(key);
},
// 清除全部
clear() {
sessionStorage.clear();
}
}
export { _local, _session }

@ -0,0 +1,162 @@
import cookies from './util.cookies'
import {_local,_session} from './util.db'
import { Message } from 'element-ui'
const roleList = {
'1': '超级管理员',
'13': '管理员',
'14': '老师',
'4': '学生'
}
const util = {
cookies,
local: _local,
session: _session,
// 传入身份证获取生日
getBirth(idCard) {
var birthday = "";
if(idCard != null && idCard != ""){
if(idCard.length == 15){
birthday = "19"+idCard.slice(6,12);
} else if(idCard.length == 18){
birthday = idCard.slice(6,14);
}
birthday = birthday.replace(/(.{4})(.{2})/,"$1-$2-");
//通过正则表达式来指定输出格式为:1990-01-01
}
return birthday;
},
// new Date('2020-11-12 00:00:00') 在IE下失效,因此把-替换成/
dateCompatible(date) {
return date.replace(/\-/g, '/')
},
// 日期时间前面补零
formateTime(num) {
return num < 10 ? `0${num}` : num
},
//返回格式化时间,传参例如:"yyyy-MM-dd hh:mm:ss"
formatDate(fmt,date) {
var date = date ? date : new Date()
var o = {
"M+" : date.getMonth()+1, //月份
"d+" : date.getDate(), //日
"h+" : date.getHours(), //小时
"m+" : date.getMinutes(), //分
"s+" : date.getSeconds(), //秒
"q+" : Math.floor((date.getMonth()+3)/3), //季度
"S" : date.getMilliseconds() //毫秒
};
if(/(y+)/.test(fmt)) {
fmt=fmt.replace(RegExp.$1, (date.getFullYear()+"").substr(4 - RegExp.$1.length));
}
for(var k in o) {
if(new RegExp("("+ k +")").test(fmt)){
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
}
}
return fmt;
},
// 移除数组中指定值
removeByValue(arr, val) {
for(var i=0; i<arr.length; i++) {
if(arr[i] == val) {
arr.splice(i, 1);
break;
}
}
},
// 传入文件后缀判断是否是视频
isVideo(ext) {
if('mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv'.includes(ext)) return true
return false
},
// 传入文件后缀判断是否是音频
isAudio(ext) {
if('mp3,aac,ape,flac,wav,wma,amr,mid'.includes(ext)) return true
return false
},
// 传入文件后缀判断是否是图片
isImg(ext) {
if('jpg,jpeg,png,gif,svg,psd'.includes(ext)) return true
return false
},
// 传入文件后缀判断是否是pdf以外的文档
isDoc(ext) {
if(!util.isVideo(ext) && !util.isAudio(ext) && !util.isImg(ext) && ext != 'pdf') return true
return false
},
// 循环去除html标签
removeHtmlTag(list,attr) {
list.map(n => {
n[attr] = n[attr].replace(/<\/?.+?>/gi,'')
})
return list
},
// 传入文件名获取文件后缀
getFileExt(fileName) {
return fileName.substring(fileName.lastIndexOf('.') + 1)
},
// 传入文件名和路径,下载图片视频,支持跨域,a标签加download不支持跨域
downloadFile(fileName,url) {
var x = new XMLHttpRequest()
x.open("GET", url, true)
x.responseType = 'blob'
x.onload=function(e) {
var url = window.URL.createObjectURL(x.response)
var a = document.createElement('a')
a.href = url
a.download = fileName
a.click()
}
x.send()
},
// 传入文件名和数据,下载文件
downloadFileDirect(fileName,data) {
if ('download' in document.createElement('a')) { // 非IE下载
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(data)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href) // 释放URL 对象
document.body.removeChild(elink)
} else { // IE10+下载
navigator.msSaveBlob(data, fileName)
}
},
// 传入字符串,返回去除[]后的字符串,因为通过get请求带入方括号的话会有问题
encodeStr(str) {
if(str.includes('[') || str.includes(']')){
let newStr = ''
for(let i of str){
if(i == '[' || i == ']'){
newStr += encodeURI(i)
}else{
newStr += i
}
}
return newStr
}
return str
},
// 成功提示
successMsg(message,duration = 3000) {
return Message.success({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration})
},
// 警告提示
warningMsg(message,duration = 3000) {
return Message.warning({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration})
},
// 错误提示
errorMsg(message,duration = 3000) {
return Message.error({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration})
},
// 传入roleId,返回角色名称
getRoleName(roleId){
return roleList[roleId] || '未知状态'
}
}
export default util

@ -1,68 +1,45 @@
import Vue from 'vue'; import Vue from 'vue';
import App from './App.vue'; import App from '@/App.vue';
import router from './router'; import router from '@/router';
import ElementUI from 'element-ui'; import ElementUI from 'element-ui';
import '@/styles/index.scss'
import VueI18n from 'vue-i18n'; import VueI18n from 'vue-i18n';
import { messages } from './components/common/i18n'; import mixinApp from '@/mixins/app';
// import 'element-ui/lib/theme-chalk/index.css'; // 默认主题 import { messages } from '@/i18n';
import './assets/css/theme-green/index.css'; // 浅绿色主题
import './assets/css/icon.css';
import './assets/icon/iconfont.css';
import './components/common/directives';
import 'babel-polyfill'; import 'babel-polyfill';
import './util/rem'; import '@/libs/resize';
import {post,get,del,put,getToken} from './utils/http'; import {post,get,del,put} from '@/plugins/requests/index.js';
import api from './utils/api'; import api from '@/api';
import store from './store' import store from '@/store'
import config from '@/config' import Setting from '@/setting';
import permission from '@/router/permission'; import permission from '@/router/permission';
import { systemStatus, systemTypeStatus, systemAttributionStatus, courseTypeStatus,
hoursStatus, roleStatus, orderTypeFn, orderStatusFn, orderNatureFn, Percentage, removeByValue, formatDate, formateTime, orderRoleType, orderRoleAttribute, setCookie, encodeString,logout } from './utils/core';
import preventReClick from './store/preventReClick' //防多次点击,重复提交
// 插件 // 插件
import plugins from '@/libs'; import plugins from '@/plugins';
import filters from '@/plugins/filters'
Vue.use(plugins); Vue.use(plugins);
Object.keys(filters).forEach(item => Vue.filter(item,filters[item]))
Vue.prototype.api = api; Vue.prototype.api = api;
Vue.prototype.$get = get; Vue.prototype.$get = get;
Vue.prototype.$post = post; Vue.prototype.$post = post;
Vue.prototype.$del = del; Vue.prototype.$del = del;
Vue.prototype.$put = put; Vue.prototype.$put = put;
Vue.prototype.getToken = getToken;
Vue.prototype.$config = config
Vue.prototype.systemStatus = systemStatus;
Vue.prototype.systemTypeStatus = systemTypeStatus;
Vue.prototype.systemAttributionStatus = systemAttributionStatus;
Vue.prototype.courseTypeStatus = courseTypeStatus;
Vue.prototype.hoursStatus = hoursStatus;
Vue.prototype.roleStatus = roleStatus;
Vue.prototype.orderTypeFn = orderTypeFn;
Vue.prototype.orderStatusFn = orderStatusFn;
Vue.prototype.orderNatureFn = orderNatureFn;
Vue.prototype.Percentage = Percentage;
Vue.prototype.removeByValue = removeByValue;
Vue.prototype.formatDate = formatDate;
Vue.prototype.orderRoleType = orderRoleType;
Vue.prototype.orderRoleAttribute = orderRoleAttribute;
Vue.prototype.formateTime = formateTime;
Vue.prototype.setCookie = setCookie;
Vue.prototype.encodeString = encodeString;
Vue.prototype.logout = logout;
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.use(VueI18n); Vue.use(VueI18n);
Vue.use(ElementUI); Vue.use(ElementUI);
const i18n = new VueI18n({ const i18n = new VueI18n({
locale: 'zh', locale: Setting.i18n.default,
messages messages
}); });
new Vue({ new Vue({
mixins: [mixinApp],
router, router,
store,
i18n, i18n,
store,
render: h => h(App) render: h => h(App)
}).$mount('#app'); }).$mount('#app');

@ -0,0 +1,11 @@
/**
* 通用混合
* */
export default {
methods: {
// 当 $route 更新时触发
appRouteChange (to, from) {
}
}
}

@ -0,0 +1,8 @@
export default {
beforeCreate() {
document.querySelector('body').setAttribute('style', 'background-color:#fff')
},
beforeDestroy() {
document.body.removeAttribute('style')
}
}

@ -0,0 +1,201 @@
<template>
<div class="wrap">
<div class="header">
<img class="logo hh" v-if="isHh" src="@/assets/img/logo-hh.png" />
<img class="logo" v-else src="@/assets/img/logo.png" />
</div>
<div class="main">
<div class="box">
<el-tabs v-model="type">
<el-tab-pane label="账号登录" name="0">
<el-form :model="param" :rules="rules" ref="param" label-width="0px" style="margin-top: 40px">
<el-form-item prop="username">
<el-input v-model="param.username" placeholder="请输入账号"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
type="password"
placeholder="请输入密码"
v-model="param.password"
@keyup.enter.native="submitForm('param')"
>
</el-input>
</el-form-item>
<el-button class="btn" type="primary" @click="submitForm('param')">马上登录</el-button>
</el-form>
</el-tab-pane>
<el-tab-pane label="手机号/邮箱登录" name="1">
<el-form :model="phoneParam" :rules="phoneRules" ref="phoneParam" label-width="0px" style="margin-top: 40px">
<el-form-item prop="userphone">
<el-input v-model="phoneParam.userphone" placeholder="请输入手机号/邮箱"></el-input>
</el-form-item>
<el-form-item prop="phonePassword">
<el-input
type="password"
placeholder="请输入密码"
v-model="phoneParam.phonePassword"
@keyup.enter.native="submitForm('phoneParam')"
>
</el-input>
</el-form-item>
<el-button class="btn" type="primary" @click="submitForm('phoneParam')">马上登录</el-button>
</el-form>
</el-tab-pane>
</el-tabs>
</div>
</div>
<v-footer class="footer"></v-footer>
</div>
</template>
<script>
import { mapActions } from 'vuex'
import vFooter from '@/layouts/footer'
import util from '@/libs/util'
import Setting from '@/setting'
export default {
data: function() {
return {
isHh: Setting.isHh,
param: {
username: '',
password: ''
},
rules: {
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
},
phoneParam: {
userphone: '',
phonePassword: ''
},
phoneRules: {
userphone: [{ required: true, message: '请输入手机号/邮箱', trigger: 'blur' }],
phonePassword: [{ required: true, message: '请输入密码', trigger: 'blur' }],
},
type: '0'
};
},
components: {
vFooter,
},
methods: {
...mapActions('user', [
'login'
]),
submitForm(form) {
this.$refs[form].validate(valid => {
if (valid) {
let data = {
account: this.type == '0' ? this.param.username : this.phoneParam.userphone,
password: this.type == '0' ? this.param.password : this.phoneParam.phonePassword,
source: this.type
}
this.login(data).then(() => {
let redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : '/index'
this.$router.replace(redirect)
}).catch(res => {})
} else {
return util.errorMsg('请输入账号和密码')
}
});
},
},
};
</script>
<style lang="scss" scoped>
.wrap{
position: relative;
width: 100%;
height: 100%;
background-image: url(../../../assets/img/login-bg.png);
background-size: 100%;
.header{
width: 100%;
height: 60px;
position: absolute;
top: 0;
left: 0;
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 18px;
.logo{
width: 150px;
margin-left: 20px;
&.hh{
width: 220px;
}
}
}
/deep/.main{
position: absolute;
left: 50%;
top: 42px;
transform: translate(-50%,0);
width: 1200px;
height: 82%;
margin-top: 60px;
background-image: url(../../../assets/img/login-input.png);
box-shadow:0px 0px 79px 0px rgba(11,15,65,0.36);
overflow: hidden;
.box {
width: 548px;
position: absolute;
left: 50%;
top: 50px;
transform: translate(-50%,0);
.el-tabs__nav-scroll{
display: flex;
justify-content: center;
}
.el-tabs__nav-wrap::after{
background-color: #fff;
opacity: 0;
.el-tabs__active-bar{
background-color: #000;
border-radius:2px;
}
.el-tabs__item{
padding: 0 90px;
color: #999;
&:hover{
color: #000;
}
&.is-active{
color: #333;
font-weight: bold;
}
}
}
.el-input__inner{
height: 80px;
line-height: 80px;
border:1px solid rgba(220,220,220,1);
border-radius:2px;
}
.btn {
width: 100%;
height: 88px;
margin-bottom: 50px;
font-weight: bold;
background:linear-gradient(90deg,rgba(94,206,253,1),rgba(91,67,231,1));
box-shadow:0px 7px 27px 0px rgba(50,129,255,0.51);
border-radius:10px;
}
}
}
.footer{
position: absolute;
bottom: 0;
left: 0;
width: 100%;
}
}
</style>

@ -1,12 +1,8 @@
<template> <template>
<div> <div>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between" style="margin-bottom: 10px"> <div class="flex-between m-b-10">
<div class="per_title" v-preventReClick @click="goback()"> <el-page-header @back="goBack" :content="experimentalName"></el-page-header>
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">{{experimentalName}}</span>
</div>
</div> </div>
<el-form label-width="100px"> <el-form label-width="100px">
<div class="flex-between"> <div class="flex-between">
@ -18,29 +14,25 @@
</el-form> </el-form>
</el-card> </el-card>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="m-b-20">
<div class="stat"> <div class="stat">
<div class="cka-Overview"> <div class="nums">
<div class="newPractice-card"> <div class="item">
<div class="newPractice-card-other"> <p class="name">实验总人数</p>
<p style="font-size:18px">实验总人数</p> <p class="val">{{total}}</p>
<p style="font-size:36px">{{totals}}</p> </div>
</div> <div class="item">
<div class="newPractice-card-other"> <p class="name">实验平均分</p>
<p style="font-size:18px">实验平均分</p> <p class="val">{{avg}}</p>
<p style="font-size:36px">{{avg}}</p>
</div>
</div> </div>
</div> </div>
<div class="chart" id="chart"></div> <div class="chart" id="chart"></div>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between mgb20"> <div class="flex-between m-b-20">
<div> <div></div>
</div>
<div> <div>
<el-button type="primary" size="small" @click="delAllData">批量删除</el-button> <el-button type="primary" size="small" @click="delAllData">批量删除</el-button>
<el-button type="primary" size="small" @click="exportData">导出</el-button> <el-button type="primary" size="small" @click="exportData">导出</el-button>
@ -50,7 +42,7 @@
<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">
{{scope.$index + (pageNo - 1) * pageSize + 1}} {{scope.$index + (page - 1) * pageSize + 1}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="schoolName" label="学校" align="center"> <el-table-column prop="schoolName" label="学校" align="center">
@ -76,7 +68,7 @@
</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="totals" @current-change="handleCurrentChange" :current-page="pageNo"> <el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
@ -84,23 +76,24 @@
</template> </template>
<script> <script>
import Setting from '@/setting'
import util from '@/libs/util'
import echarts from 'echarts' import echarts from 'echarts'
export default { export default {
name: 'experiment',
data() { data() {
return { return {
systemId: this.$store.state.experimentData.systemId, systemId: this.$route.query.systemId,
id: this.$store.state.experimentData.id, id: this.$route.query.id,
projectId: this.$store.state.experimentData.projectId, projectId: this.$route.query.projectId,
projectName: this.$store.state.experimentData.name, projectName: this.$route.query.name,
experimentalName: this.$store.state.experimentData.experimentalName, experimentalName: this.$route.query.experimentalName,
className: this.$store.state.experimentData.class, className: this.$route.query.class,
keyword: '', keyword: '',
listData: [], listData: [],
multipleSelection: [], multipleSelection: [],
pageNo: 1, page: 1,
pageSize: 10, pageSize: 10,
totals: 0, total: 0,
avg: 0, avg: 0,
}; };
}, },
@ -111,7 +104,7 @@ export default {
getData() { getData() {
let data = { let data = {
systemId: this.systemId, systemId: this.systemId,
page: this.pageNo, page: this.page,
size: this.pageSize, size: this.pageSize,
searchContant: this.keyword, searchContant: this.keyword,
projectId: this.id projectId: this.id
@ -124,7 +117,7 @@ export default {
score += n.score score += n.score
}) })
this.listData = list this.listData = list
this.totals = res.data.totalCount this.total = res.data.totalCount
this.avg = score ? (score / res.data.totalCount).toFixed(2) : 0 this.avg = score ? (score / res.data.totalCount).toFixed(2) : 0
this.getChart() this.getChart()
}).catch(res => {}); }).catch(res => {});
@ -143,9 +136,9 @@ export default {
this.$router.push(`showexperimentOptions?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`) this.$router.push(`showexperimentOptions?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`)
}else{ }else{
if(this.className){ if(this.className){
this.$router.push(`/showExperiment?id=${row.recordId}&projectId=${this.id}&reportId=${row.reportId}&studentId=${row.studentId}`) this.$router.push(`show?id=${row.recordId}&projectId=${this.id}&reportId=${row.reportId}&studentId=${row.studentId}`)
}else{ }else{
this.$router.push(`/showExperiment?id=${row.recordId}&type=1`) this.$router.push(`show?id=${row.recordId}&type=1`)
} }
} }
}, },
@ -196,14 +189,14 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}else{ }else{
this.$message.error('请先选择数据 !'); util.errorMsg('请先选择数据 !')
} }
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNo = val; this.page = val;
this.getData(); this.getData();
}, },
getChart(){ getChart(){
@ -255,7 +248,7 @@ export default {
}] }]
}) })
}, },
goback() { goBack() {
this.$router.back() this.$router.back()
}, },
} }
@ -263,37 +256,23 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.mag{
margin-right: 20px;
}
/deep/.el-tabs__nav-wrap::after{ /deep/.el-tabs__nav-wrap::after{
display: none; display: none;
} }
.stat{ .stat{
display: flex; display: flex;
.chart{ .nums {
flex: 1;
height: 300px;
}
}
.cka-Overview {
width: 600px;
margin-right: 20px;
p {
font-size: 20px;
}
.newPractice-card {
display: flex; display: flex;
align-items: center; align-items: center;
height: 100%; margin-right: 20px;
.newPractice-card-other:nth-child(1) { .item:nth-child(1) {
background-image: url('../../assets/img/total.png'); background-image: url('../../../assets/img/total.png');
} }
.newPractice-card-other:nth-child(2) { .item:nth-child(2) {
background-image: url('../../assets/img/avg.png'); background-image: url('../../../assets/img/avg.png');
} }
.newPractice-card-other { .item {
width: 300px; width: 300px;
padding: 30px 30px; padding: 30px 30px;
margin: 0 10px; margin: 0 10px;
@ -305,12 +284,16 @@ export default {
font-size: 18px; font-size: 18px;
color: #ffffff; color: #ffffff;
} }
p:last-child { .val{
margin-top: 10px; margin-top: 10px;
color: #ffffff; color: #ffffff;
font-size: 26px; font-size: 36px;
} }
} }
} }
.chart{
flex: 1;
height: 300px;
}
} }
</style> </style>

@ -4,14 +4,14 @@
<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="goback()"> <div class="per_title" @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">修改分数</span> <span class="per_school">修改分数</span>
</div> </div>
<div> <div>
<el-button type="success" size="small" round class="mag" v-preventReClick @click="saveAdd('form')">预览</el-button> <el-button type="success" size="small" round class="mag" @click="saveAdd('form')">预览</el-button>
<el-button type="primary" size="small" round class="mag" v-preventReClick @click="saveAdd('form')">发布成绩</el-button> <el-button type="primary" size="small" round class="mag" @click="saveAdd('form')">发布成绩</el-button>
</div> </div>
</div> </div>
</el-card> </el-card>
@ -265,13 +265,13 @@
} }
if(this.configId){ if(this.configId){
this.$post(this.api.updateServiceConfig,data).then((res) => { this.$post(this.api.updateServiceConfig,data).then((res) => {
this.$message.success('编辑成功'); util.successMsg('编辑成功');
this.$router.back() this.$router.back()
}).catch((res) => { }).catch((res) => {
}) })
}else{ }else{
this.$post(this.api.updateServiceConfig,data).then((res) => { this.$post(this.api.updateServiceConfig,data).then((res) => {
this.$message.success('添加成功'); util.successMsg('添加成功');
this.$router.back() this.$router.back()
}).catch((res) => { }).catch((res) => {
}) })
@ -299,10 +299,10 @@
}, },
uploadSuccess(res,file){ uploadSuccess(res,file){
if(res.status == 200){ if(res.status == 200){
this.$message.success('上传成功') util.successMsg('上传成功')
this.getSgin() this.getSgin()
}else{ }else{
this.$message.error(res.errmessage) util.errorMsg(res.errmessage)
} }
}, },
goback() { goback() {

@ -0,0 +1,276 @@
<template>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool mul">
<ul class="filter">
<li>
<label>时间</label>
<el-radio-group size="small" v-model="month" @change="initData">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio>
</el-radio-group>
<el-date-picker size="small" v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</li>
<li>
<label>实验项目分类</label>
<el-radio-group size="small" v-model="projectPermissions" @change="initData">
<el-radio v-for="(item,index) in projectType" :key="index" :label="item.id" border>{{item.name}}</el-radio>
</el-radio-group>
</li>
<li>
<label>系统</label>
<el-select size="small" v-model="systemId" placeholder="请选择" @change="initData">
<el-option
v-for="item in systemList"
:key="item.value"
:label="item.label"
:value="item.id"
></el-option>
</el-select>
</li>
<li>
<el-input size="small" placeholder="请输入实验项目名称/班级名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary" size="small" @click="delAllData">批量删除</el-button>
</div>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" :selectable="disabledSelection"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">
{{scope.$index + (page - 1) * pageSize + 1}}
</template>
</el-table-column>
<template v-if="projectPermissions == 1">
<el-table-column prop="experimentalClassName" label="班级" align="center"></el-table-column>
<el-table-column prop="experimentalName" label="实验名称" align="center"></el-table-column>
</template>
<el-table-column prop="projectName" label="项目名称" align="center">
</el-table-column>
<el-table-column prop="projectPermissions" label="分类" align="center">
<template slot-scope="scope">
{{scope.row.projectPermissions == 2 ? '竞赛' : projectType.find(n => n.id === scope.row.projectPermissions).name}}
</template>
</el-table-column>
<el-table-column prop="number" label="成绩报告数量" align="center"></el-table-column>
<el-table-column prop="creationTime" label="创建时间" align="center">
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="entry(scope.row)" v-auth>成绩管理</el-button>
<el-button type="text" @click="handleDelete(scope.row)" :disabled="!scope.row.isdel">删除</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>
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex'
import { Loading } from 'element-ui'
import util from '@/libs/util'
import Setting from '@/setting'
export default {
name: 'achievement',
data() {
return {
systemId: '',
systemList: Setting.systemList,
projectPermissions: this.$route.query.per ? Number(this.$route.query.per) : 0,
keyword: '',
startingtime: '',
endTime: '',
month: '',
listData: [],
multipleSelection: [],
dateList: [
{
id: '',
name: '不限'
},
{
id: 1,
name: '近一个月'
},
{
id: 6,
name: '近六个月'
}
],
projectType: [
{
id: 0,
name: '练习'
},
{
id: 1,
name: '考核'
}
],
date: '',
page: 1,
pageSize: 10,
total: 0,
loadIns: null,
listDataAll: []
};
},
computed: {
...mapState('user', [
'userId'
]),
...mapState('project', [
'lastSystemId'
]),
},
watch: {
month: function(val){
if(val){
let unit = 24 * 60 * 60 * 1000
this.date = [this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))]
}else{
this.date = []
}
},
date: function(val){
if(val){
this.startingtime = val[0]
this.endTime = val[1]
}else{
this.startingtime = ''
this.endTime = ''
}
this.initData()
},
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
},500)
}
},
mounted() {
this.systemId = this.lastSystemId ? this.lastSystemId : Setting.systemId
this.getData()
},
methods: {
...mapActions('project', [
'setSystemId'
]),
getData() {
this.loadIns = Loading.service({
background: 'rgba(255,255,255,.6)'
})
let data = {
searchContant: util.encodeStr(this.keyword),
startTime: this.startingtime,
endTime: this.endTime,
month: this.month,
page: this.page,
size: this.pageSize,
userId: this.userId
}
let url = this.api.queryAchievement
if(this.projectPermissions){
data.systemId = this.systemId
url = this.api.queryAchievementNew
}else{
data.systemId = this.systemId
data.projectPermissions = this.projectPermissions
}
this.$get(url,data).then(res => {
this.listData = res.data.list
this.total = res.data.total
this.$nextTick(() => {
this.loadIns.close()
})
}).catch(res => {
this.loadIns.close()
})
},
handlePage(){
let list = this.listDataAll
let result = []
list.map(n => {
if(!n.projectHiddenEntity) result.push(n)
})
this.listData = result.slice((this.page - 1) * this.pageSize,this.page * this.pageSize)
this.total = result.length
},
initData(){
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
disabledSelection(row,index){
if(row.isdel == 0) return false
return true
},
entry(row){
this.setSystemId(this.systemId)
if(this.projectPermissions){
this.$router.push(`teach?id=${row.id}&name=${row.experimentalName}&class=${row.experimentalClassName}&projectId=${row.projectId}&systemId=${this.systemId}`)
}else{
this.$router.push(`vir?id=${row.projectId}&name=${row.projectName}&class=${row.experimentalClassName}&systemId=${this.systemId}`)
}
},
handleDelete(row) {
this.$confirm('该项目下的所有成绩报告将会删除,是否继续?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(`${this.api.deleteReportById}?projectIds=${row.projectId}&projectPermissions=${row.projectPermissions}&ids=${row.id ? row.id : ''}`).then(res => {
util.successMsg('删除成功')
this.getData()
}).catch(res => {})
})
.catch(() => {})
},
delAllData() {
if(this.multipleSelection.length != ''){
let newArr = this.multipleSelection
let delList = newArr.map(item => {
return `projectIds=${item.projectId}`
})
let delList1 = newArr[0].id ? newArr.map(item => {
return `ids=${item.id}`
}) : []
this.$confirm('该项目下的所有成绩报告将会删除,是否继续?', '提示', {
type: 'warning'
})
.then(() => {
let data = `${delList.join('&')}&projectPermissions=${this.projectPermissions}&${delList1.length ? delList1.join('&') : ''}`
this.$post(`${this.api.deleteReportById}?${data}`).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection()
util.successMsg('删除成功')
this.getData()
}).catch(res => {})
})
.catch(() => {})
}else{
util.errorMsg('请先选择数据 !')
}
},
handleSelectionChange(val) {
this.multipleSelection = val
},
handleCurrentChange(val) {
this.page = val
this.getData()
},
}
};
</script>
<style lang="scss" scoped>
.el-radio.is-bordered+.el-radio.is-bordered{
margin-left: 0;
}
</style>

@ -2,19 +2,15 @@
<div class="box"> <div class="box">
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="24"> <el-col :span="24">
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between"> <div class="flex-between">
<div class="per_title" v-preventReClick @click="goback()"> <el-page-header @back="goBack" content="查看报告"></el-page-header>
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">查看报告</span>
</div>
</div> </div>
</el-card> </el-card>
<div id="pdfDom"> <div id="pdfDom">
<h6 style="text-align: center;font-size: 20px">标准实验报告</h6> <h6 style="text-align: center;font-size: 20px">标准实验报告</h6>
<div class="flex-center mgb20 user_header"> <div class="flex-center m-b-20 user_header">
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span style="font-size: 18px">基本信息</span> <span style="font-size: 18px">基本信息</span>
</div> </div>
@ -38,14 +34,14 @@
</el-table> </el-table>
</div> </div>
<div class="mgb20"> <div class="m-b-20">
<div class="meta-title-wrap"> <div class="meta-title-wrap">
<p class="meta-title"><img src="../../assets/img/cup.png" alt=""> 实验项目名称</p> <p class="meta-title"><img src="@/assets/img/cup.png" alt=""> 实验项目名称</p>
</div> </div>
<el-input v-model="form.proName" type="textarea" :disabled="true" rows="5"></el-input> <el-input v-model="form.proName" type="textarea" :disabled="true" rows="5"></el-input>
</div> </div>
<div class="mgb20"> <div class="m-b-20">
<div class="meta-title-wrap"> <div class="meta-title-wrap">
<p class="meta-title">实验目的</p> <p class="meta-title">实验目的</p>
</div> </div>
@ -53,7 +49,7 @@
<div class="pre-wrap" v-html="form.purpose"></div> <div class="pre-wrap" v-html="form.purpose"></div>
</div> </div>
<div class="mgb20"> <div class="m-b-20">
<div class="meta-title-wrap"> <div class="meta-title-wrap">
<p class="meta-title">实验数据</p> <p class="meta-title">实验数据</p>
</div> </div>
@ -80,7 +76,7 @@
</el-table> </el-table>
</div> </div>
<div class="mgb20"> <div class="m-b-20">
<div class="meta-title-wrap"> <div class="meta-title-wrap">
<p class="meta-title">实验总结与体会</p> <p class="meta-title">实验总结与体会</p>
</div> </div>
@ -93,11 +89,13 @@
</template> </template>
<script> <script>
import { mapState, mapActions } from 'vuex'
import util from '@/libs/util'
import Setting from '@/setting'
export default { export default {
data (){ data (){
return { return {
title: '实验报告', title: '实验报告',
userId: this.$store.state.userId,
form: { form: {
analysis: '', analysis: '',
conclusion: '', conclusion: '',
@ -142,6 +140,11 @@
], ],
} }
}, },
computed: {
...mapState('user', [
'userId'
]),
},
mounted(){ mounted(){
this.getData() this.getData()
}, },
@ -236,14 +239,14 @@
} }
if(this.configId){ if(this.configId){
this.$post(this.api.updateServiceConfig,data).then((res) => { this.$post(this.api.updateServiceConfig,data).then((res) => {
this.$message.success('编辑成功'); util.successMsg('编辑成功');
this.goback() this.goBack()
}).catch((res) => { }).catch((res) => {
}) })
}else{ }else{
this.$post(this.api.updateServiceConfig,data).then((res) => { this.$post(this.api.updateServiceConfig,data).then((res) => {
this.$message.success('添加成功'); util.successMsg('添加成功');
this.goback() this.goBack()
}).catch((res) => { }).catch((res) => {
}) })
} }
@ -267,7 +270,7 @@
// } // }
} }
}, },
goback(){ goBack(){
this.$router.go(-1) this.$router.go(-1)
}, },
exportPage(){ exportPage(){

@ -1,43 +1,37 @@
<template> <template>
<div> <div>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between" style="margin-bottom: 10px"> <div class="flex-between m-b-10">
<div class="per_title" v-preventReClick @click="goback()"> <el-page-header @back="goBack" :content="experimentalName"></el-page-header>
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">{{experimentalName}}</span>
</div>
</div> </div>
<el-form label-width="100px"> <el-form label-width="100px">
<div class="flex-between"> <div class="flex-between">
<div></div> <div></div>
<div> <div>
<el-input placeholder="请输入学校/学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> <el-input size="small" placeholder="请输入学校/学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div> </div>
</div> </div>
</el-form> </el-form>
</el-card> </el-card>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="m-b-20">
<div class="stat"> <div class="stat">
<div class="cka-Overview"> <div class="nums">
<div class="newPractice-card"> <div class="item">
<div class="newPractice-card-other"> <p class="name">实验总人数</p>
<p style="font-size:18px">实验总人数</p> <p class="val">{{total}}</p>
<p style="font-size:36px">{{totals}}</p> </div>
</div> <div class="item">
<div class="newPractice-card-other"> <p class="name">实验平均分</p>
<p style="font-size:18px">实验平均分</p> <p class="val">{{avg}}</p>
<p style="font-size:36px">{{avg}}</p>
</div>
</div> </div>
</div> </div>
<div class="chart" id="chart"></div> <div class="chart" id="chart"></div>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between mgb20"> <div class="flex-between m-b-20">
<div> <div>
</div> </div>
@ -50,7 +44,7 @@
<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">
{{scope.$index + (pageNo - 1) * pageSize + 1}} {{scope.$index + (page - 1) * pageSize + 1}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="schoolName" label="学校" align="center"> <el-table-column prop="schoolName" label="学校" align="center">
@ -76,7 +70,7 @@
</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="totals" @current-change="handleCurrentChange" :current-page="pageNo"> <el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
@ -84,24 +78,24 @@
</template> </template>
<script> <script>
import Setting from '@/setting'
import util from '@/libs/util'
import echarts from 'echarts' import echarts from 'echarts'
export default { export default {
name: 'experiment',
data() { data() {
return { return {
systemId: this.$store.state.experimentData.systemId, systemId: this.$route.query.systemId,
id: this.$store.state.experimentData.id, id: this.$route.query.id,
projectName: this.$store.state.experimentData.name, experimentalName: this.$route.query.name,
experimentalName: this.$store.state.experimentData.experimentalName, className: this.$route.query.class,
className: this.$store.state.experimentData.class, projectId: this.$route.query.projectId,
projectId: this.$store.state.experimentData.projectId,
keyword: '', keyword: '',
listDataAll: [], listDataAll: [],
listData: [], listData: [],
multipleSelection: [], multipleSelection: [],
pageNo: 1, page: 1,
pageSize: 10, pageSize: 10,
totals: 0, total: 0,
avg: 0, avg: 0,
}; };
}, },
@ -122,15 +116,15 @@ export default {
}) })
this.listDataAll = list this.listDataAll = list
this.handlePage() this.handlePage()
this.totals = list.length this.total = list.length
this.avg = score ? (score / list.length).toFixed(2) : 0 this.avg = score ? (score / list.length).toFixed(2) : 0
this.getChart() this.getChart()
}).catch(res => {}); }).catch(res => {});
}, },
handlePage(){ handlePage(){
let list = this.listDataAll let list = this.listDataAll
this.listData = list.slice((this.pageNo - 1) * this.pageSize,this.pageNo * this.pageSize) this.listData = list.slice((this.page - 1) * this.pageSize,this.page * this.pageSize)
this.totals = list.length this.total = list.length
}, },
edit(row){ edit(row){
if(this.systemId == 2 || this.systemId == 3){ if(this.systemId == 2 || this.systemId == 3){
@ -146,9 +140,9 @@ export default {
this.$router.push(`showexperimentOptions?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`) this.$router.push(`showexperimentOptions?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`)
}else{ }else{
if(this.className){ if(this.className){
this.$router.push(`/showExperiment?id=${row.recordId}&projectId=${row.projectId}&reportId=${row.reportId}&studentId=${row.studentId}`) this.$router.push(`show?id=${row.recordId}&projectId=${row.projectId}&reportId=${row.reportId}&studentId=${row.studentId}`)
}else{ }else{
this.$router.push(`/showExperiment?id=${row.recordId}&type=1`) this.$router.push(`show?id=${row.recordId}&type=1`)
} }
} }
}, },
@ -174,7 +168,7 @@ export default {
}) })
.then(() => { .then(() => {
this.$post(`${this.api.deleteReport}?reportId=${row.reportId}&recordId=${row.recordId}`).then(res => { this.$post(`${this.api.deleteReport}?reportId=${row.reportId}&recordId=${row.recordId}`).then(res => {
this.$message.success('删除成功'); util.successMsg('删除成功')
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {});
}) })
@ -194,20 +188,20 @@ export default {
}) })
.then(() => { .then(() => {
this.$post(`${this.api.deleteReport}?${delList.join('&')}&${delList1.join('&')}`).then(res => { this.$post(`${this.api.deleteReport}?${delList.join('&')}&${delList1.join('&')}`).then(res => {
this.$message.success('删除成功') util.successMsg('删除成功')
this.getData() this.getData()
}).catch(res => {}) }).catch(res => {})
}) })
.catch(() => {}); .catch(() => {});
}else{ }else{
this.$message.error('请先选择数据 !'); util.errorMsg('请先选择数据 !')
} }
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNo = val; this.page = val;
this.handlePage(); this.handlePage();
}, },
getChart(){ getChart(){
@ -259,45 +253,31 @@ export default {
}] }]
}) })
}, },
goback() { goBack() {
this.$router.push('achievement?per=1') this.$router.push('list?per=1')
}, },
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.mag{
margin-right: 20px;
}
/deep/.el-tabs__nav-wrap::after{ /deep/.el-tabs__nav-wrap::after{
display: none; display: none;
} }
.stat{ .stat{
display: flex; display: flex;
.chart{ .nums {
flex: 1;
height: 300px;
}
}
.cka-Overview {
width: 600px;
margin-right: 20px;
p {
font-size: 20px;
}
.newPractice-card {
display: flex; display: flex;
align-items: center; align-items: center;
height: 100%; margin-right: 20px;
.newPractice-card-other:nth-child(1) { .item:nth-child(1) {
background-image: url('../../assets/img/total.png'); background-image: url('../../../assets/img/total.png');
} }
.newPractice-card-other:nth-child(2) { .item:nth-child(2) {
background-image: url('../../assets/img/avg.png'); background-image: url('../../../assets/img/avg.png');
} }
.newPractice-card-other { .item {
width: 300px; width: 300px;
padding: 30px 30px; padding: 30px 30px;
margin: 0 10px; margin: 0 10px;
@ -309,13 +289,16 @@ export default {
font-size: 18px; font-size: 18px;
color: #ffffff; color: #ffffff;
} }
p:last-child { .val{
margin-top: 10px; margin-top: 10px;
color: #ffffff; color: #ffffff;
font-size: 26px; font-size: 36px;
} }
} }
} }
.chart{
flex: 1;
height: 300px;
}
} }
</style> </style>

@ -1,43 +1,37 @@
<template> <template>
<div> <div>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between" style="margin-bottom: 10px"> <div class="flex-between m-b-10">
<div class="per_title" v-preventReClick @click="goback()"> <el-page-header @back="goBack" :content="experimentName"></el-page-header>
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">{{experimentName}}</span>
</div>
</div> </div>
<el-form label-width="100px"> <el-form label-width="100px">
<div class="flex-between"> <div class="flex-between">
<div></div> <div></div>
<div> <div>
<el-input placeholder="请输入学校/学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> <el-input size="small" placeholder="请输入学校/学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div> </div>
</div> </div>
</el-form> </el-form>
</el-card> </el-card>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="m-b-20">
<div class="stat"> <div class="stat">
<div class="cka-Overview"> <div class="nums">
<div class="newPractice-card"> <div class="item">
<div class="newPractice-card-other"> <p class="name">实验总人数</p>
<p style="font-size:18px">实验总人数</p> <p class="val">{{total}}</p>
<p style="font-size:36px">{{totals}}</p> </div>
</div> <div class="item">
<div class="newPractice-card-other"> <p class="name">实验平均分</p>
<p style="font-size:18px">实验平均分</p> <p class="val">{{avg}}</p>
<p style="font-size:36px">{{avg}}</p>
</div>
</div> </div>
</div> </div>
<div class="chart" id="chart"></div> <div class="chart" id="chart"></div>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between mgb20"> <div class="flex-between m-b-20">
<div> <div>
</div> </div>
@ -50,7 +44,7 @@
<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">
{{scope.$index + (pageNo - 1) * pageSize + 1}} {{scope.$index + (page - 1) * pageSize + 1}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="schoolName" label="学校" align="center"> <el-table-column prop="schoolName" label="学校" align="center">
@ -71,7 +65,7 @@
</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="totals" @current-change="handleCurrentChange" :current-page="pageNo"> <el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
</el-pagination> </el-pagination>
</div> </div>
</el-card> </el-card>
@ -79,22 +73,23 @@
</template> </template>
<script> <script>
import Setting from '@/setting'
import util from '@/libs/util'
import echarts from 'echarts' import echarts from 'echarts'
export default { export default {
name: 'experiment',
data() { data() {
return { return {
systemId: this.$store.state.experimentData.systemId, systemId: this.$route.query.systemId,
projectId: this.$store.state.experimentData.id, projectId: this.$route.query.id,
experimentName: this.$store.state.experimentData.name, experimentName: this.$route.query.name,
className: this.$store.state.experimentData.class, className: this.$route.query.class,
keyword: '', keyword: '',
listDataAll: [], listDataAll: [],
listData: [], listData: [],
multipleSelection: [], multipleSelection: [],
pageNo: 1, page: 1,
pageSize: 10, pageSize: 10,
totals: 0, total: 0,
avg: 0, avg: 0,
}; };
}, },
@ -115,15 +110,15 @@ export default {
}) })
this.listDataAll = list this.listDataAll = list
this.handlePage() this.handlePage()
this.totals = list.length this.total = list.length
this.avg = score ? (score / list.length).toFixed(2) : 0 this.avg = score ? (score / list.length).toFixed(2) : 0
this.getChart() this.getChart()
}).catch(res => {}); }).catch(res => {});
}, },
handlePage(){ handlePage(){
let list = this.listDataAll let list = this.listDataAll
this.listData = list.slice((this.pageNo - 1) * this.pageSize,this.pageNo * this.pageSize) this.listData = list.slice((this.page - 1) * this.pageSize,this.page * this.pageSize)
this.totals = list.length this.total = list.length
}, },
edit(row){ edit(row){
if(this.systemId == 2 || this.systemId == 3){ if(this.systemId == 2 || this.systemId == 3){
@ -139,9 +134,9 @@ export default {
this.$router.push(`showexperimentOptions?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`) this.$router.push(`showexperimentOptions?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`)
}else{ }else{
if(this.class){ if(this.class){
this.$router.push(`/showExperiment?id=${row.recordId}&projectId=${this.projectId}&reportId=${row.reportId}`) this.$router.push(`show?id=${row.recordId}&projectId=${this.projectId}&reportId=${row.reportId}`)
}else{ }else{
this.$router.push(`/showExperiment?id=${row.recordId}&type=1`) this.$router.push(`show?id=${row.recordId}&type=1`)
} }
} }
}, },
@ -166,7 +161,7 @@ export default {
}) })
.then(() => { .then(() => {
this.$post(`${this.api.deleteReport}?reportId=${row.reportId}&recordId=${row.recordId}`).then(res => { this.$post(`${this.api.deleteReport}?reportId=${row.reportId}&recordId=${row.recordId}`).then(res => {
this.$message.success('删除成功') util.successMsg('删除成功')
this.getData() this.getData()
}).catch(res => {}) }).catch(res => {})
}) })
@ -186,20 +181,20 @@ export default {
}) })
.then(() => { .then(() => {
this.$post(`${this.api.deleteReport}?${delList.join('&')}&${delList1.join('&')}`).then(res => { this.$post(`${this.api.deleteReport}?${delList.join('&')}&${delList1.join('&')}`).then(res => {
this.$message.success('删除成功') util.successMsg('删除成功')
this.getData() this.getData()
}).catch(res => {}) }).catch(res => {})
}) })
.catch(() => {}); .catch(() => {});
}else{ }else{
this.$message.error('请先选择数据 !'); util.errorMsg('请先选择数据 !');
} }
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNo = val; this.page = val;
this.handlePage(); this.handlePage();
}, },
getChart(){ getChart(){
@ -251,45 +246,31 @@ export default {
}] }]
}) })
}, },
goback() { goBack() {
this.$router.push('achievement') this.$router.back()
}, },
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.mag{
margin-right: 20px;
}
/deep/.el-tabs__nav-wrap::after{ /deep/.el-tabs__nav-wrap::after{
display: none; display: none;
} }
.stat{ .stat{
display: flex; display: flex;
.chart{ .nums {
flex: 1;
height: 300px;
}
}
.cka-Overview {
width: 600px;
margin-right: 20px;
p {
font-size: 20px;
}
.newPractice-card {
display: flex; display: flex;
align-items: center; align-items: center;
height: 100%; margin-right: 20px;
.newPractice-card-other:nth-child(1) { .item:nth-child(1) {
background-image: url('../../assets/img/total.png'); background-image: url('../../../assets/img/total.png');
} }
.newPractice-card-other:nth-child(2) { .item:nth-child(2) {
background-image: url('../../assets/img/avg.png'); background-image: url('../../../assets/img/avg.png');
} }
.newPractice-card-other { .item {
width: 300px; width: 300px;
padding: 30px 30px; padding: 30px 30px;
margin: 0 10px; margin: 0 10px;
@ -301,12 +282,16 @@ export default {
font-size: 18px; font-size: 18px;
color: #ffffff; color: #ffffff;
} }
p:last-child { .val{
margin-top: 10px; margin-top: 10px;
color: #ffffff; color: #ffffff;
font-size: 26px; font-size: 36px;
} }
} }
} }
.chart{
flex: 1;
height: 300px;
}
} }
</style> </style>

@ -1,63 +1,59 @@
<template> <template>
<div> <div>
<el-form :disabled="isDetail"> <el-form :disabled="isDetail">
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between"> <div class="flex-between">
<div class="per_title" v-preventReClick @click="goback()"> <el-page-header @back="goBack" :content="isDetail ? '查看' : (id ? '更新' : '创建') + '教学实验'"></el-page-header>
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">{{isDetail ? '查看' : (id ? '更新' : '创建')}}教学实验</span>
</div>
<div> <div>
<el-button type="primary" size="small" round class="mag" v-preventReClick @click="upload" v-show="!isDetail">{{id ? '更新' : '创建'}}</el-button> <el-button type="primary" size="small" @click="upload" v-show="!isDetail">{{id ? '更新' : '创建'}}</el-button>
</div> </div>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="mgr20 mgb20"> <el-card shadow="hover" class="mgr20 m-b-20">
<div> <div>
<p class="mgb20">考核名称</p> <p class="m-b-20">考核名称</p>
<el-input <el-input
placeholder="请输入考核名称" placeholder="请输入考核名称"
v-model="experimentalName" v-model="experimentalName"
clearable clearable
maxlength="15" maxlength="15"
class="assName_input" class="inline-input"
@change="judgeExpName" @change="judgeExpName"
></el-input> ></el-input>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="mgr20 mgb20"> <el-card shadow="hover" class="mgr20 m-b-20">
<div> <div>
<p class="mgb20">班级名称</p> <p class="m-b-20">班级名称</p>
<el-input <el-input
placeholder="请输入班级名称" placeholder="请输入班级名称"
v-model="experimentalClassName" v-model="experimentalClassName"
clearable clearable
maxlength="15" maxlength="15"
class="assName_input" class="inline-input"
></el-input> ></el-input>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="m-b-20">
<div> <div>
<p class="mgb20">发布方式</p> <p class="m-b-20">发布方式</p>
<el-radio :disabled="id ? true : false" v-model="type" label="1" class="fons">手动发布</el-radio> <el-radio :disabled="id ? true : false" v-model="type" label="1" class="fons">手动发布</el-radio>
<el-radio :disabled="id ? true : false" v-model="type" label="2" class="fons">定时发布</el-radio> <el-radio :disabled="id ? true : false" v-model="type" label="2" class="fons">定时发布</el-radio>
</div> </div>
</el-card> </el-card>
<!-- 根据发布方式判断时间的显示 --> <!-- 根据发布方式判断时间的显示 -->
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="m-b-20">
<div> <div>
<p class="mgb20">实验时间</p> <p class="m-b-20">实验时间</p>
<!-- 手动发布显示 --> <!-- 手动发布显示 -->
<div v-if="type==1"> <div class="date-inputs" v-if="type==1">
实验时长 实验时长
<el-input size="small" v-model="duration.day" placeholder class="dateinput"></el-input> <el-input size="small" v-model="duration.day" placeholder></el-input>
<el-input size="small" v-model="duration.hour" placeholder class="dateinput"></el-input> <el-input size="small" v-model="duration.hour" placeholder></el-input>
<el-input size="small" v-model="duration.minute" placeholder class="dateinput"></el-input> <el-input size="small" v-model="duration.minute" placeholder></el-input>
</div> </div>
<!-- 定时发布显示 --> <!-- 定时发布显示 -->
@ -76,10 +72,10 @@
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="mgr20 mgb20"> <el-card shadow="hover" class="mgr20 m-b-20">
<div> <div>
<p class="mgb20">系统</p> <p class="m-b-20">系统</p>
<div class="assName_input"> <div class="inline-input">
<el-select v-model="systemId" placeholder="请选择" @change="initData"> <el-select v-model="systemId" placeholder="请选择" @change="initData">
<el-option <el-option
v-for="item in systemList" v-for="item in systemList"
@ -93,14 +89,14 @@
</el-card> </el-card>
<!-- 实训项目模块 --> <!-- 实训项目模块 -->
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="m-b-20">
<div class="flex-between mgb20"> <div class="flex-between m-b-20">
<span>实训项目</span> <span>实训项目</span>
<div style="display: inline-flex;"> <div style="display: inline-flex;">
<div> <div>
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> <el-input size="small" placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div> </div>
<el-button style="margin-left: 5px;" type="primary" size="small" round @click="toProject">自定义实验项目</el-button> <el-button style="margin-left: 5px" type="primary" size="small" round @click="toProject">自定义实验项目</el-button>
</div> </div>
</div> </div>
<!-- 实训项目表格 --> <!-- 实训项目表格 -->
@ -135,7 +131,7 @@
:page-size="pageSize" :page-size="pageSize"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
layout="total,prev, pager, next" layout="total,prev, pager, next"
:total="totals" :total="total"
></el-pagination> ></el-pagination>
</div> </div>
</el-card> </el-card>
@ -143,7 +139,7 @@
<!-- 邀请码 --> <!-- 邀请码 -->
<el-card shadow="hover"> <el-card shadow="hover">
<div style="margin-bottom: 10px"> <div style="margin-bottom: 10px">
<p class="mgb20">设置邀请码</p> <p class="m-b-20">设置邀请码</p>
<el-radio v-model="isCode" label="0"></el-radio> <el-radio v-model="isCode" label="0"></el-radio>
<el-radio v-model="isCode" label="1"></el-radio> <el-radio v-model="isCode" label="1"></el-radio>
</div> </div>
@ -156,15 +152,17 @@
</div> </div>
</template> </template>
<script> <script>
import Setting from '@/setting'
import util from '@/libs/util'
import { mapState, mapActions } from 'vuex'
export default { export default {
data() { data() {
return { return {
id: '', id: '',
systemId: this.$config.systemId, roleStatus: util.getRoleName,
systemList: this.$config.systemList, systemId: Setting.systemId,
systemList: Setting.systemList,
isDetail: true, isDetail: true,
userId: this.$store.state.userLoginId,
cacheData: this.$store.state.addClass,
duration: { duration: {
day: '', day: '',
hour: '', hour: '',
@ -172,7 +170,7 @@ export default {
}, },
keyword: '', keyword: '',
searchTimer: null, searchTimer: null,
date: '', // date: '',
experimentDuration: '0d0h0m', experimentDuration: '0d0h0m',
experimentalNumber: 0, experimentalNumber: 0,
projectId: '', projectId: '',
@ -198,19 +196,28 @@ export default {
projectPermissionsList: ['练习','考核','竞赛'], projectPermissionsList: ['练习','考核','竞赛'],
projectQueryData: { projectQueryData: {
userId: this.$store.state.userLoginId, userId: this.userId,
systemId: this.systemId systemId: this.systemId
}, },
pageNo: 1, page: 1,
pageSize: 5, pageSize: 5,
totals: 0, total: 0,
multipleSelection: [], multipleSelection: [],
isToProject: false, isToProject: false,
expNameRepeat: false expNameRepeat: false
}; };
}, },
computed: {
...mapState('user', [
'userId'
]),
...mapState('project', [
'assFields'
]),
},
mounted() { mounted() {
this.date = [this.formatDate("yyyy-MM-dd hh:mm:ss",new Date(new Date().getTime() + 300000)),this.formatDate("yyyy-MM-dd hh:mm:ss",new Date(new Date().getTime() + 300000))] console.log(22,this.assFields)
this.date = [util.formatDate("yyyy-MM-dd hh:mm:ss",new Date(new Date().getTime() + 300000)),util.formatDate("yyyy-MM-dd hh:mm:ss",new Date(new Date().getTime() + 300000))]
this.id = this.$route.query.id this.id = this.$route.query.id
this.isDetail = Boolean(this.$route.query.show) this.isDetail = Boolean(this.$route.query.show)
this.id && this.getData() this.id && this.getData()
@ -218,15 +225,13 @@ export default {
this.recoveryData() this.recoveryData()
}, },
beforeDestroy(){ beforeDestroy(){
if(!this.isToProject){ if(!this.isToProject) this.setAss({})
this.$store.commit("addClassData", { addClass : {} })
}
}, },
watch: { watch: {
date: function(val){ date: function(val){
if(val[0] != '0000-00-00 00:00:00'){ if(val[0] != '0000-00-00 00:00:00'){
this.startTime = this.formatDate("yyyy-MM-dd hh:mm:ss",new Date(val[0])) this.startTime = util.formatDate("yyyy-MM-dd hh:mm:ss",new Date(val[0]))
this.stopTime = this.formatDate("yyyy-MM-dd hh:mm:ss",new Date(val[1])) this.stopTime = util.formatDate("yyyy-MM-dd hh:mm:ss",new Date(val[1]))
} }
}, },
duration: { duration: {
@ -243,9 +248,12 @@ export default {
} }
}, },
methods: { methods: {
...mapActions('project', [
'setAss'
]),
getProjectData(){ getProjectData(){
let data = { let data = {
pageNo: this.pageNo, pageNo: this.page,
pageSize: 10000, pageSize: 10000,
userId: this.userId, userId: this.userId,
systemId: this.systemId, systemId: this.systemId,
@ -259,22 +267,22 @@ export default {
n.enable || result.push(n) n.enable || result.push(n)
}) })
this.projectDataAll = result this.projectDataAll = result
this.totals = result.length this.total = result.length
this.handlePage() this.handlePage()
}).catch(res => {}); }).catch(res => {});
}, },
handlePage(){ handlePage(){
let list = this.projectDataAll let list = this.projectDataAll
let result = list.slice((this.pageNo - 1) * this.pageSize,this.pageNo * this.pageSize) let result = list.slice((this.page - 1) * this.pageSize,this.page * this.pageSize)
this.projectData = result this.projectData = result
}, },
initData(){ initData(){
this.pageNo = 1 this.page = 1
this.getProjectData() this.getProjectData()
}, },
recoveryData(){ recoveryData(){
if(JSON.stringify(this.cacheData) != '{}'){ if(JSON.stringify(this.assFields) != '{}'){
let info = this.cacheData let info = this.assFields
this.experimentDuration = info.experimentDuration this.experimentDuration = info.experimentDuration
this.experimentalClassName = info.experimentalClassName this.experimentalClassName = info.experimentalClassName
this.experimentalName = info.experimentalName this.experimentalName = info.experimentalName
@ -318,7 +326,7 @@ export default {
let data = { let data = {
id: this.id, id: this.id,
experimentDuration: this.experimentDuration, experimentDuration: this.experimentDuration,
creationTime: this.id ? this.creationTime : this.formatDate("yyyy-MM-dd hh:mm:ss"), creationTime: this.id ? this.creationTime : util.formatDate("yyyy-MM-dd hh:mm:ss"),
experimentalClassName: this.experimentalClassName, experimentalClassName: this.experimentalClassName,
experimentalName: this.experimentalName, experimentalName: this.experimentalName,
experimentalNumber: this.experimentalNumber, experimentalNumber: this.experimentalNumber,
@ -341,14 +349,14 @@ export default {
} }
if(this.id){ if(this.id){
this.$post(this.api.expUpdate, data).then(res => { this.$post(this.api.expUpdate, data).then(res => {
this.$message.success('修改成功'); util.successMsg('修改成功');
this.$router.back() this.$router.back()
}) })
.catch(err => { .catch(err => {
}); });
}else{ }else{
this.$post(this.api.expSave, data).then(res => { this.$post(this.api.expSave, data).then(res => {
this.$message.success('创建成功'); util.successMsg('创建成功');
this.$router.back() this.$router.back()
}) })
.catch(err => { .catch(err => {
@ -377,7 +385,7 @@ export default {
this.formatDuration() this.formatDuration()
}else{ }else{
this.$message.error('查询失败'); util.errorMsg('查询失败');
} }
}) })
.catch(err => { .catch(err => {
@ -408,7 +416,7 @@ export default {
type: this.type, type: this.type,
expNameRepeat: this.expNameRepeat expNameRepeat: this.expNameRepeat
} }
this.$store.commit("addClassData", { addClass : data}) this.setAss(data)
this.isToProject = true this.isToProject = true
}, },
toProject(){ toProject(){
@ -419,7 +427,7 @@ export default {
this.handleCacheData() this.handleCacheData()
this.$router.push(`/addproject?id=${row.projectId}&show=1`) this.$router.push(`/addproject?id=${row.projectId}&show=1`)
}, },
goback() { goBack() {
if(this.isDetail){ if(this.isDetail){
this.$router.back() this.$router.back()
}else{ }else{
@ -453,11 +461,11 @@ export default {
// this.varifyInv() // this.varifyInv()
}, },
handleCurrentChange(val){ handleCurrentChange(val){
this.pageNo = val this.page = val
this.handlePage() this.handlePage()
}, },
judgeExpName(){ judgeExpName(){
this.$get(this.api.expCheck, { experimentalName: this.encodeString(this.experimentalName) }) this.$get(this.api.expCheck, { experimentalName: util.encodeStr(this.experimentalName) })
.then(res => { .then(res => {
if(res.errmessage != 'success') { if(res.errmessage != 'success') {
this.$message.warning('考核名称重复,请重新输入') this.$message.warning('考核名称重复,请重新输入')
@ -472,133 +480,13 @@ export default {
}; };
</script> </script>
<style scope> <style lang="scss" scoped>
.makeupList /deep/.el-upload-list__item { .inline-input{
display: none; width: 300px;
} }
.dateinput { .date-inputs{
width: 100px; .el-input{
display: inline-block; width: 100px;
} }
.mgb20-container { }
width: 98%;
}
.makeupList {
display: flex;
}
.makeupList /deep/.el-upload--text {
width: 100px;
display: inline-block;
height: 38px;
display: flex;
border: none;
}
.makeupList /deep/.el-upload-list {
}
.makeupList /deep/.el-icon-upload-success {
}
.mgb20-container1 /deep/ .el-checkbox__inner {
border-radius: 50%;
}
.mgb20-container1 /deep/ .el-tree .el-icon-caret-right {
background: #9278ff;
border-radius: 50%;
color: #fff;
margin-right: 5px;
}
.mgb20-container1 /deep/.el-tree-node .is-leaf + .el-checkbox .el-checkbox__inner {
display: inline-block;
}
.mgb20-container1 /deep/.el-tree-node .el-checkbox__input > .el-checkbox__inner {
display: none;
}
.mgb20-container1 /deep/ .el-tree-node__label {
color: #333333;
font-size: 18px;
}
.mgb20-container1 /deep/.el-tree-node__content {
height: 30px;
}
.mgb20-container1 /deep/.is-leaf {
display: none;
}
.el-row {
margin-bottom: 20px;
padding: 20px 16px;
}
.mg20 {
margin-left: 20px;
margin-top: 20px;
}
/* .mgb20 {
position: relative;
} */
.mag {
margin-right: 20px;
}
.mgr10 {
margin-right: 10px;
}
.mgr20 {
margin-top: 10px;
}
.assName_input {
width: 300px;
}
.foot_btn {
text-align: right;
margin-top: 20px;
}
.mgb20-input1 {
margin-left: 800px;
display: inline-block;
position: absolute;
right: 0px;
}
/* .mgb200 {
background-color: #9076ff;
color: #fff;
} */
.makeupList {
display: inline-block;
}
.btninput {
position: relative;
margin-bottom: 30px;
}
.classcard {
overflow: hidden;
}
.classspan {
display: inline-block;
height: 25px;
width: 80px;
background-color: #9076ff;
border-radius: 10px;
text-align: center;
line-height: 25px;
color: #fff;
margin-right: 10px;
float: left;
}
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
opacity: 0;
}
.addAssess /deep/ .row{
padding: 0;
margin-bottom: 0;
}
.addAssess .row /deep/ .el-form-item{
margin-bottom: 0;
}
</style> </style>

@ -0,0 +1,389 @@
<template>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool mul">
<ul class="filter">
<li>
<label>实验时间</label>
<el-radio-group size="small" v-model="form.month" @change="initData">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio>
</el-radio-group>
<el-date-picker size="small" v-model="date" align="right" unlink-panels type="daterange" style="margin-left: 10px;" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</li>
<li>
<label>发布类型</label>
<el-select size="small" v-model="form.type" clearable placeholder="请选择发布类型" @change="initData">
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</li>
<li>
<label>实验状态</label>
<el-select size="small" v-model="form.status" clearable placeholder="请选择实验状态" @change="initData">
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</li>
<li>
<label>系统</label>
<el-select size="small" v-model="systemId" placeholder="请选择" @change="initData">
<el-option label="不限" value=""></el-option>
<el-option
v-for="item in systemList"
:key="item.value"
:label="item.label"
:value="item.id"
></el-option>
</el-select>
</li>
<li>
<el-input size="small" placeholder="请输入实验班级/项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary" size="small" round @click="add" v-auth>创建实验</el-button>
<el-button type="primary" size="small" round @click="delAllData" v-auth>批量删除</el-button>
</div>
</div>
<el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" :selectable="row => row.status!=2" width="50" 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="experimentalClassName" label="实验班级" align="center">
</el-table-column>
<el-table-column prop="experimentalName" label="考核名称" min-width="120" align="center">
</el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center">
</el-table-column>
<el-table-column prop="experimentalNumber" label="实验人数" align="center">
</el-table-column>
<el-table-column prop="experimentDuration" label="实验时长" align="center">
</el-table-column>
<el-table-column label="邀请码" align="center">
<template slot-scope="scope">
<span>{{scope.row.isCode == 0 ? scope.row.invitationCode : ''}}</span>
</template>
</el-table-column>
<el-table-column prop="adminName" label="发布类型" align="center">
<template slot-scope="scope">
<span>{{types[scope.row.type]}}</span>
</template>
</el-table-column>
<el-table-column prop="creationTime" width="150" label="创建时间" align="center">
</el-table-column>
<el-table-column prop="startTime" width="150" label="起始时间" align="center">
<template slot-scope="scope">
<span>{{transferTime(scope.row.startTime,scope.row.type)}}</span>
</template>
</el-table-column>
<el-table-column prop="stopTime" width="150" label="结束时间" align="center">
<template slot-scope="scope">
<span>{{transferTime(scope.row.stopTime,scope.row.type)}}</span>
</template>
</el-table-column>
<el-table-column prop="surplusTime" label="倒计时" align="center">
<!-- <template slot-scope="scope">
<span v-if="scope.row.status == 2" v-countdown="scope.row.surplusTime">{{scope.row.surplusTime}}</span>
<span v-else>00:00:00</span>
</template> -->
</el-table-column>
<el-table-column label="实验状态" align="center">
<template slot-scope="scope">
<span>{{status[scope.row.status]}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="170">
<template slot-scope="scope">
<template v-if="scope.row.status == 1">
<el-button type="text" @click="start(scope.row)" v-auth>启动</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth>修改</el-button>
</template>
<template v-else-if="scope.row.status == 2">
<el-button type="text" @click="finish(scope.row)" v-auth>提前结束</el-button>
</template>
<template v-else-if="scope.row.status == 3">
<el-button type="text" @click="show(scope.row)" v-auth>查看成绩</el-button>
</template>
<el-button v-if="scope.row.status == 1 || scope.row.status == 3" type="text" @click="delData(scope.row)" v-auth>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"></el-pagination>
</div>
</div>
</template>
<script>
import Setting from '@/setting'
import util from '@/libs/util'
import { mapState, mapActions } from 'vuex'
export default {
data() {
return {
systemList: Setting.systemList,
systemId: '',
keyword: '',
typeList: [
{
value: '',
name: '不限'
},
{
value: 1,
name: '手动发布'
},
{
value: 2,
name: '定时发布'
}
],
status: ['','待开始','进行中','已完成'],
types: ['','手动发布','定时发布'],
statusList: [
{
value: '',
name: '不限'
},
{
value: 1,
name: '待开始'
},
{
value: 2,
name: '进行中'
},
{
value: 3,
name: '已完成'
}
],
listData: [],
form: {
type: '',
status: '',
startTime: '',
stopTime: '',
month: '',
searchContent: ''
},
multipleSelection: [],
dateList: [
{
id: '',
name: '不限'
},
{
id: 1,
name: '近一个月'
},
{
id: 3,
name: '近三个月'
},
{
id: 6,
name: '近六个月'
}
],
date: [],
page: 1,
pageSize: 10,
total: 0,
ruleIds: [],
timer: null
};
},
directives: {
countdown: {
bind: function(el,binding,vnode) {
let that = vnode.context
let time = binding.value
let timer = setInterval(() => {
let timeList = time.split(':')
let total = Number.parseInt(timeList[0] * 60 * 60) + Number.parseInt(timeList[1] * 60) + Number.parseInt(timeList[2])
if(total > 0){
--total
let hours = Math.floor(total / (60 * 60))
let minutes = Math.floor(total % (60 * 60) / 60)
let seconds = Math.floor(total % (60 * 60) % 60)
time = `${that.formateTime(hours)}:${that.formateTime(minutes)}:${that.formateTime(seconds)}`
}else{
clearInterval(timer)
}
el.innerHTML = time
},1000)
that.timerList.push(timer)
}
}
},
computed: {
...mapState('user', [
'schoolId'
]),
},
watch: {
'form.month': function(val){
if(val){
let unit = 24 * 60 * 60 * 1000
this.date = [this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))]
}else{
this.date = []
}
},
date: function(val){
if(val){
this.form.startTime = val[0]
this.form.stopTime = val[1]
}else{
this.form.startTime = ''
this.form.stopTime = ''
}
this.initData()
},
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
},500)
}
},
computed: {
role() {
return this.name === 'admin' ? '超级管理员' : '普通用户';
}
},
mounted() {
this.getData()
// this.timer = setInterval(this.getData,1000)
// this.$once('hook:beforeDestroy',() => {
// clearInterval(this.timer)
// })
},
methods: {
getData() {
let data = {
type: this.form.type,
startTime: this.form.startTime,
stopTime: this.form.stopTime,
month: this.form.month,
searchContent: util.encodeStr(this.keyword),
status: this.form.status,
page: this.page,
size: this.pageSize,
systemId: this.systemId,
schoolId: this.schoolId ? this.schoolId : ''
}
this.$get(this.api.expList,data).then(res => {
this.listData = res.list.list
this.total = res.list.totalCount
}).catch(res => {});
},
initData(){
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
add(){
this.$router.push('add')
},
edit(row){
this.$router.push(`add?id=${row.id}`)
},
show(row){
this.$router.push(`/achievement/ass?systemId=${this.systemId}&id=${row.id}&projectId=${row.projectId}&name=${row.projectName}&experimentalName=${row.experimentalName}&class=${row.experimentalClassName}`)
},
start(row){
let data = {
id: row.id,
startTime: this.formatDate("yyyy-MM-dd hh:mm:ss",new Date()),
status: 2
}
this.$post(this.api.expUpdate,data).then(res => {
if(res.errmessage == 'success') {
util.successMsg('启动成功!')
this.getData()
}
}).catch(res => {});
},
finish(row){
this.$confirm('确定要提前结束吗?', '提示', {
type: 'warning'
})
.then(() => {
let data = {
id: row.id,
stopTime: this.formatDate("yyyy-MM-dd hh:mm:ss",new Date()),
status: 3
}
this.$post(this.api.expUpdate,data).then(res => {
if(res.errmessage == 'success') {
util.successMsg('提前结束成功!')
this.getData()
}
}).catch(res => {})
})
.catch(() => {})
},
delData(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(this.api.expDelete,[row.id]).then(res => {
util.successMsg('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
},
delAllData() {
if(this.multipleSelection.length != ''){
let newArr = this.multipleSelection
let delList = newArr.map(item => {
return item.id
})
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
let data = delList
this.$post(this.api.expDelete,data).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection()
util.successMsg('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
}else{
util.errorMsg('请先选择数据 !');
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
onSearch(){
this.page = 1
this.getData()
},
handleCurrentChange(val) {
this.page = val;
this.getData();
},
transferTime(date,type){
if(date == '0000-00-00 00:00:00') return '---'
return date
}
}
};
</script>
<style lang="scss" scoped>
.el-radio-group{
white-space: nowrap;
}
</style>

@ -0,0 +1,631 @@
<template>
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool">
<ul class="filter">
<li>
<label>题目类型</label>
<el-radio-group v-model="subject" @change="initData">
<el-radio
v-for="(item,index) in subjectList"
:key="index"
:label="item.id"
>{{item.name}}</el-radio>
</el-radio-group>
</li>
<li>
<el-input size="small" placeholder="请输入题干" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary" size="small" @click="getInfo" v-auth>测评设置</el-button>
<el-button type="primary" size="small" @click="addTopics" v-auth>新增题目</el-button>
<el-button type="primary" size="small" @click="showBatchUpload" v-auth>批量上传</el-button>
<el-button type="primary" size="small" @click="delAllData" v-auth>批量删除</el-button>
</div>
</div>
<el-table :data="listData" ref="table" row-key="id" class="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template
slot-scope="scope"
>{{scope.$index + (page - 1) * pageSize + 1}}</template>
</el-table-column>
<el-table-column prop="questionStem" label="题干" align="center"></el-table-column>
<el-table-column prop="questionTypeName" label="题型" align="center"></el-table-column>
<el-table-column prop="modifyTime" label="时间" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<template v-if="scope.row.isEnable">
<el-button type="text" @click="showQues(scope.row)" v-auth>查看</el-button>
</template>
<template v-else>
<el-button type="text" @click="editQues(scope.row)" v-auth>修改</el-button>
</template>
<el-switch
v-model="scope.row.isEnable"
:active-text="scope.row.isEnable ? '关闭' : '启用'"
:active-value="1"
:inactive-value="0"
style="margin: 0 10px 0 5px"
@change="switchQues($event,scope.row,scope.$index)"
v-auth="'evaluation:禁用'"
></el-switch>
<el-button type="text" @click="delData(scope.row)" v-auth>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page" :page-size="pageSize" layout="total,prev, pager, next" :total="total"></el-pagination>
</div>
<el-dialog title="测评设置" :visible.sync="SetEvaluation" width="30%" :close-on-click-modal="false">
<div style="margin-bottom: 15px;">
<span class="radio">题目选择</span>
<el-radio v-model="info.evaluationType" label="1">随机</el-radio>
<el-radio v-model="info.evaluationType" label="0">自定义</el-radio>
</div>
<!-- 随机 -->
<el-card shadow="hover" class="card_m" v-show="info.evaluationType==1">
<div class="input flex_around">
<span>测评题目总数</span>
<el-input placeholder="请输入题目数量" type="number" v-model="info.questionNum"></el-input>
<span>(总数{{info.totalQuestionNum}})</span>
</div>
</el-card>
<!-- 自定义 -->
<el-card shadow="hover" class="card_m" v-show="info.evaluationType==0">
<div class="input">
<div class="check-wrap" :class="{checked: info.isSingleEnable}">
<el-checkbox v-model="info.isSingleEnable">单选题</el-checkbox>
<el-input placeholder="请输入题目数量" type="number" v-model="info.singleNum" :disabled="!info.isSingleEnable"></el-input>
<span>(总数{{info.totalSingleNum}})</span>
</div>
<div class="check-wrap" :class="{checked: info.isMultipleEnable}">
<el-checkbox v-model="info.isMultipleEnable">多选题</el-checkbox>
<el-input placeholder="请输入题目数量" type="number" v-model="info.multipleNum" :disabled="!info.isMultipleEnable"></el-input>
<span>(总数{{info.totalMultipleNum}})</span>
</div>
<div class="check-wrap" :class="{checked: info.isJudgmentEnable}">
<el-checkbox v-model="info.isJudgmentEnable">判断题</el-checkbox>
<el-input placeholder="请输入题目数量" type="number" v-model="info.judgmentNum" :disabled="!info.isJudgmentEnable"></el-input>
<span>(总数{{info.totalJudgmentNum}})</span>
</div>
</div>
</el-card>
<div class="jobNumber">
<div class="input">
<span style="margin:0px 15px 0px 35px">测评时长</span>
<el-input placeholder="请输入时间" type="number" v-model="info.duration"></el-input>
<span style="margin-left:15px">分钟</span>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="SetEvaluation = false"> </el-button>
<el-button size="small" type="primary" @click="submitSetEva"> </el-button>
</span>
</el-dialog>
<el-dialog :title="topicsTitle" :visible.sync="NewTopics" width="30%" @close="closeTopics" :close-on-click-modal="false">
<el-form
:model="topicForm"
:rules="rules"
:disabled="isShowTopics"
ref="topicForm"
label-width="70px"
class="demo-topicForm"
>
<el-form-item label="题型" prop="questionType">
<el-radio-group v-model="topicForm.questionType" @change="questionTypeChange">
<el-radio label="单选题"></el-radio>
<el-radio label="多选题"></el-radio>
<el-radio label="判断题"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="题干" prop="questionStem">
<el-input type="textarea" v-model="topicForm.questionStem"></el-input>
</el-form-item>
<el-form-item label="选项" prop="optionA">
<div class="input flex_around bt">
<span>A</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionA"></el-input>
<el-checkbox v-model="topicForm.aisTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex_around bt">
<span>B</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionB"></el-input>
<el-checkbox v-model="topicForm.bisTrue">设为正确答案</el-checkbox>
</div>
<template v-if="topicForm.questionType != '判断题'">
<div class="input flex_around bt">
<span>C</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionC"></el-input>
<el-checkbox v-model="topicForm.cisTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex_around bt">
<span>D</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionD"></el-input>
<el-checkbox v-model="topicForm.disTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex_around bt">
<span>E</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionE"></el-input>
<el-checkbox v-model="topicForm.eisTrue">设为正确答案</el-checkbox>
</div>
<div class="input flex_around">
<span>F</span>
<el-input placeholder="请输入题目" v-model="topicForm.optionF"></el-input>
<el-checkbox v-model="topicForm.fisTrue">设为正确答案</el-checkbox>
</div>
</template>
</el-form-item>
<el-form-item label="答案解析" prop="answerAnalysis">
<el-input type="textarea" v-model="topicForm.answerAnalysis"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer" v-show="!isShowTopics">
<el-button size="small" @click="NewTopics = false"> </el-button>
<el-button size="small" type="primary" @click="saveTopics"> </el-button>
</div>
</el-dialog>
<el-dialog title="批量上传" :visible.sync="BatchUpload" width="30%" @close="closeUpload" :close-on-click-modal="false">
<el-card shadow="hover" class="card_m" v-show="this.label=1">
<div class="Upload">
<div class="bt" @click="downloadTem">
<el-link :underline="false">
1.请下载模板
<i class="el-icon-download"></i>
</el-link>
</div>
<div>
<el-upload
accept=".xls,.xlsx"
:on-remove="handleDataRemove"
:on-error="uploadError"
:on-success="uploadSuccess"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.import"
:file-list="uploadDataList"
name="file"
>
<el-link :underline="false">
2.请点击批量导入
<i class="el-icon-upload"></i>
</el-link>
</el-upload>
<el-link v-if="uploadFaild" type="primary" @click="showFaild">部分数据导入失败查看失败原因</el-link>
</div>
</div>
</el-card>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="BatchUpload = false"> </el-button>
<el-button size="small" type="primary" @click="uploadSure"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex'
import util from '@/libs/util'
import Setting from '@/setting'
export default {
data() {
return {
topicForm: {
answer: '',
questionType : '单选题',
questionStem : '',
optionA:'',
optionB:'',
optionC:'',
optionD:'',
optionE:'',
optionF:'',
aisTrue: false,
bisTrue: false,
cisTrue: false,
disTrue: false,
eisTrue: false,
fisTrue: false,
answerAnalysis: ''
},
rules: {
questionType: [{ required: true, message: '请选择题型', trigger: 'change' }],
questionStem: [{ required: true, message: '请填写题干', trigger: 'blur' }],
// optionA: [{ required: true, message: '', trigger: 'change' }],
// optionB: [{ required: true, message: '', trigger: 'change' }]
},
value: true,
subject: '', //
keyword: '',
listData: [],
subjectList: [
{
id: '',
name: '不限'
},
{
id: 1,
name: '单选题'
},
{
id: 2,
name: '多选题'
},
{
id: 3,
name: '判断题'
}
],
page: 1,
pageSize: 10,
total: 0,
SetEvaluation: false,
radio: '1', //
topicsNumber: '', //
topicsTime: '', //
random: true,
custom: false,
info: {},
NewTopics: false, //
Customs: ['1', '2', '3'],
BatchUpload: false, //
questionType: ['','单选题','多选题','判断题'],
multipleSelection: [],
isShowTopics: false,
topicsTitle: '',
uploadList: [],
uploadDataList: [],
searchTimer: null,
uploadFaild: false,
token: ''
};
},
mounted() {
this.getData()
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
},500)
}
},
methods: {
getData() {
this.$get(this.api.list, {
page: this.page,
size: this.pageSize,
questionStem: util.encodeStr(this.keyword),
questionType: this.subject
})
.then(res => {
this.listData = res.page.list
this.total = res.page.totalCount
})
.catch(err => {})
},
initData(){
this.page = 1
this.getData()
this.$refs.table.clearSelection()
},
resetForm() {
this.topicForm = {
answer: '',
questionType : '',
questionStem : '',
optionA:'',
optionB:'',
optionC:'',
optionD:'',
optionE:'',
optionF:'',
aisTrue: false,
bisTrue: false,
cisTrue: false,
disTrue: false,
eisTrue: false,
fisTrue: false,
answerAnalysis: ''
}
this.$nextTick(() => {
this.$refs.topicForm.clearValidate()
})
},
handleCurrentChange(val) {
this.page = val
this.getData()
},
addTopics() {
this.topicForm.id = ''
this.topicsTitle = '新增题目'
this.NewTopics = true
},
getDetail(id) {
this.$get(this.api.infoId + id).then(res => {
this.topicForm = res.questions
this.topicForm.id = id
this.topicForm.questionType = this.questionType[this.topicForm.questionType]
this.NewTopics = true
}).catch(res => {});
},
editQues(row) {
this.topicsTitle = '编辑题目'
this.getDetail(row.id)
},
showQues(row) {
this.topicsTitle = '查看题目'
this.isShowTopics = true
this.getDetail(row.id)
},
closeTopics() {
this.isShowTopics = false
this.resetForm()
},
switchQues(val,row,index) {
this.$put(this.api.isenable, [row.id])
.then(res => {
if(res.status == 400){
util.errorMsg(res.errmessage)
row.isEnable = row.isEnable == 1 ? 0 : 1
}
})
.catch(err => {});
},
delData(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(this.api.delete,[row.id]).then(res => {
util.successMsg('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
delAllData() {
if(this.multipleSelection.length != ''){
let newArr = this.multipleSelection
let delList = newArr.map(item => {
return item.id
})
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
let data = delList
this.$post(this.api.delete,data).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection()
util.successMsg('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
}else{
util.errorMsg('请先选择题目 !');
}
},
downloadTem() {
location.href = this.api.questionsTemplate
},
getInfo() {
this.$get(this.api.info).then(res => {
this.info = res.data
this.info.evaluationType = this.info.evaluationType.toString()
this.info.isSingleEnable = Boolean(this.info.isSingleEnable)
this.info.isMultipleEnable = Boolean(this.info.isMultipleEnable)
this.info.isJudgmentEnable = Boolean(this.info.isJudgmentEnable)
this.SetEvaluation = true
}).catch(res => {});
},
questionTypeChange() {
for(let i in this.topicForm){
if(i.includes('isTrue')) this.topicForm[i] = false
}
},
submitSetEva() {
let info = this.info
if(info.evaluationType == 0){
let allEmpty = true
if(!info.isSingleEnable && !info.isMultipleEnable && !info.isJudgmentEnable) return this.$message.warning('请至少选择一种题型')
if(info.isSingleEnable == 1 && info.singleNum != 0) allEmpty = false
if(info.isMultipleEnable == 1 && info.multipleNum != 0) allEmpty = false
if(info.isJudgmentEnable == 1 && info.judgmentNum != 0) allEmpty = false
if(allEmpty) return this.$message.warning('请至少选中一种类型,并数量大于0')
if(info.isSingleEnable == 1 && info.singleNum > info.totalSingleNum) return this.$message.warning('单选题大于总数,请重新输入')
if(info.isMultipleEnable == 1 && info.multipleNum > info.totalMultipleNum) return this.$message.warning('多选题大于总数,请重新输入')
if(info.isJudgmentEnable == 1 && info.judgmentNum > info.totalJudgmentNum) return this.$message.warning('判断题大于总数,请重新输入')
}else{
if(info.questionNum === '') return this.$message.warning('请输入测评题目总数')
if(info.questionNum == 0) return this.$message.warning('测评题目总数不得为0')
}
if(info.duration === '') return this.$message.warning('请输入测评时长')
if(info.duration == 0) return this.$message.warning('测评时长不得为0')
this.info.isSingleEnable = Number(this.info.isSingleEnable)
this.info.isMultipleEnable = Number(this.info.isMultipleEnable)
this.info.isJudgmentEnable = Number(this.info.isJudgmentEnable)
this.$put(this.api.update,this.info).then(res => {
if(res.errmessage == 'success'){
util.successMsg('提交成功!');
this.SetEvaluation = false
}else{
util.errorMsg(res.message);
}
}).catch(res => {});
},
saveTopics() {
this.$refs.topicForm.validate((valid) => {
if (valid) {
let topicForm = this.topicForm
let optionCount = 0
let answer = ''
let isInvalidAnswer = false
for(let n in topicForm) {
if(n.includes('option')) {
topicForm[n] != '' && ++optionCount
}
if(n.includes('isTrue') && topicForm[n]) {
let curOpt = n.replace('isTrue','')
answer += curOpt
if(!topicForm[`option${curOpt.toUpperCase()}`].length) isInvalidAnswer = true
}
}
if(optionCount < 2) return this.$message.warning('请至少添加两个选项!');
if(!answer) return this.$message.warning('请设置正确答案!');
if(topicForm.questionType != '多选题' && answer.length > 1) return this.$message.warning('单选题、判断题只能设置一个正确答案!');
if(isInvalidAnswer) return this.$message.warning('正确答案选项为空,请重新设置!');
this.topicForm.questionType = this.questionType.indexOf(this.topicForm.questionType)
this.topicForm.answer = answer.toUpperCase()
if(this.topicForm.id) {
this.$put(this.api.questionsUpdate,this.topicForm).then(res => {
if(res.errmessage == 'success') {
util.successMsg('提交成功!');
this.NewTopics = false
this.getData()
}else{
util.errorMsg(res.message);
}
}).catch(res => {});
}else{
this.$post(this.api.save,this.topicForm).then(res => {
if(res.errmessage == 'success') {
util.successMsg('提交成功!');
this.NewTopics = false
this.getData()
}else{
util.errorMsg(res.message);
}
}).catch(res => {});
}
}else{
return false;
}
})
},
showBatchUpload() {
this.BatchUpload = true
},
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
uploadSuccess(res, file, fileList) {
this.uploadFaild = false
if(res.data.token){
this.token = res.data.token
this.uploadFaild = true
}
},
showFaild(){
location.href = `${this.api.export_failure}?token=${this.token}`
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove(file, fileList) {
this.uploadList = fileList
},
handleDataRemove(file, fileList) {
this.uploadList = fileList
this.uploadFaild = false
},
uploadSure(){
this.BatchUpload = false
this.page = 1
this.keyword = ''
this.getData()
},
closeUpload() {
this.uploadFaild = false
this.uploadList = []
this.uploadDataList = []
}
}
};
</script>
<style lang="scss" scoped>
::v-deep .el-checkbox-group{
font-size: 2px;
}
.Upload {
text-align: center;
}
.bt {
margin-bottom: 15px;
}
.bt_one {
margin-left: 10px;
}
.Bank_m {
margin-bottom: 20px;
}
.Bank img {
width: 15px;
height: 15px;
margin-right: 10px;
}
.Bank span {
font-size: 16px;
}
.jobNumber {
margin: 10px 0;
}
.flex_around {
display: flex;
justify-content: space-around;
align-items: center;
}
.card_m {
margin: 10px 0 20px 0;
}
.input ::v-deep .el-input {
width: 50%;
}
.radio {
margin: 0 15px 0 30px;
font-weight: 600;
}
.mag {
margin-right: 20px;
}
.check-wrap{
display: flex;
align-items: center;
margin-bottom: 15px;
}
.check-wrap .el-input{
margin: 0 15px;
}
.check-wrap.checked{
color: #9076FF;
}
</style>

@ -1,23 +1,26 @@
<template> <template>
<div class="error-page"> <div class="error-page">
<div class="error-code">4<span>0</span>3</div> <div class="error-code">4<span>0</span>3</div>
<div class="error-desc">啊哦~ 你没有权限访问该页面哦</div> <div class="error-desc">啊哦~ 你没有权限访问该页面哦</div>
<div class="error-handle"> <div class="error-handle">
<router-link to="/"> <router-link to="/">
<el-button type="primary" size="large">返回首页</el-button> <el-button type="primary" size="large" @click="toIndex">返回首页</el-button>
</router-link> </router-link>
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button> <el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
methods: { methods: {
goBack(){ toIndex(){
this.$router.go(-1); this.$router.push('/')
} },
} goBack(){
this.$router.go(-1);
}
}
} }
</script> </script>

@ -1,23 +1,26 @@
<template> <template>
<div class="error-page"> <div class="error-page">
<div class="error-code">4<span>0</span>4</div> <div class="error-code">4<span>0</span>4</div>
<div class="error-desc">啊哦~ 你所访问的页面不存在</div> <div class="error-desc">啊哦~ 你所访问的页面不存在</div>
<div class="error-handle"> <div class="error-handle">
<router-link to="/"> <router-link to="/">
<el-button type="primary" size="large">返回首页</el-button> <el-button type="primary" size="large" @click="toIndex">返回首页</el-button>
</router-link> </router-link>
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button> <el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
methods: { methods: {
goBack(){ toIndex(){
this.$router.go(-1); this.$router.push('/')
} },
} goBack(){
this.$router.go(-1);
}
}
} }
</script> </script>

@ -41,6 +41,6 @@ export default {
margin-bottom: 20px; margin-bottom: 20px;
} }
a{ a{
color: #409eff; color: #cb221c;
} }
</style> </style>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,391 @@
<template>
<div class="page">
<el-page-header class="m-b-20" content="实验项目管理" @back="goBack"></el-page-header>
<h6 class="p-title">筛选</h6>
<div class="tool mul">
<ul class="filter">
<li>
<label>创建人</label>
<el-select size="small" v-model="queryData.founder" clearable placeholder="请选择创建人" @change="initData">
<el-option v-for="(item,index) in founder" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</li>
<li>
<label>状态</label>
<el-select size="small" v-model="queryData.state" clearable placeholder="请选择状态" @change="initData">
<el-option v-for="(item,index) in state" :key="index" :label="item.label" :value="item.value"></el-option>
</el-select>
</li>
<li>
<label>权限</label>
<el-select size="small" v-model="queryData.projectPermissions" placeholder="请选择" @change="initData">
<el-option
v-for="item in projectPermissions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</li>
<li>
<label>系统</label>
<el-select size="small" v-model="systemId" placeholder="请选择" @change="initData">
<el-option
v-for="item in systemList"
:key="item.value"
:label="item.label"
:value="item.id"
></el-option>
</el-select>
</li>
<li>
<el-input size="small" placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</li>
</ul>
<div>
<el-button type="primary" size="small" @click="add" v-auth>新增项目</el-button>
<el-button type="primary" size="small" @click="delAllData" v-auth>批量删除</el-button>
</div>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">{{scope.$index + (page - 1) * pageSize + 1}}</template>
</el-table-column>
<el-table-column prop="projectName" label="实验项目名称" align="center">
</el-table-column>
<el-table-column prop="founder" label="创建人" align="center"></el-table-column>
<el-table-column label="权限" align="center">
<template slot-scope="scope">
{{scope.row.projectPermissions == 2 ? '竞赛' : projectPermissions.find(n => n.value === scope.row.projectPermissions).label}}
</template>
</el-table-column>
<el-table-column prop="creationTime" label="创建时间" align="center">
</el-table-column>
<el-table-column prop="status" label="状态" align="center">
<template slot-scope="scope">
{{transferStatus(scope.row.state)}}
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)" v-auth v-if="roleId == 1 || (roleId == 13 && scope.row.founder != '超级管理员') || (roleId == 14 && scope.row.founder == '老师')">编辑</el-button>
<el-button type="text" @click="delData(scope.row)" v-auth v-if="roleId == 1 || (roleId == 13 && scope.row.founder != '超级管理员') || (roleId == 14 && scope.row.founder == '老师')">删除</el-button>
<el-button type="text" @click="copyData(scope.row)" v-auth>复制</el-button>
<el-switch
v-model="scope.row.enable"
:active-text="scope.row.enable ? '关闭' : '启用'"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 10px"
@change="switchOff($event,scope.row,scope.$index)"
></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
<el-dialog title="复制" :visible.sync="copyVisible" width="24%" center :close-on-click-modal="false">
<el-form>
<el-form-item>
<el-input placeholder="请输入项目名称" v-model="projectName" @change="projectNameExistis"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="copyVisible = false"> </el-button>
<el-button type="primary" @click="copySubmit"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import Setting from '@/setting'
import util from '@/libs/util'
import { mapState, mapActions } from 'vuex'
export default {
data() {
return {
showBack: JSON.stringify(this.assFields) == '{}' ? false : true,
roleIdEd: this.roleId ? 13 : this.roleId,// roleId13roleId14113,1413.>
systemId: '',
systemList: Setting.systemList,
queryData: {
projectPermissions: "",
founder: "",
state: "",
projectName: "",
},
keyword: '',
status: '',
listData:[],
total: 0,
projectPermissions: [
{
value: "",
label: "不限"
},
{
value: 0,
label: "练习"
},
{
value: 1,
label: "考核"
},
// {
// value: 2,
// label: ""
// }
],
founder: [
{
value: "",
label: "不限"
},
{
value: 1,
label: "超级管理员"
},
{
value: 13,
label: "管理员"
},
{
value: 14,
label: "老师"
}
],
state: [
{
value: "",
label: "不限"
},
{
value: 0,
label: "草稿箱"
},
{
value: 1,
label: "已发布"
}
],
page: 1,
pageSize: 10,
multipleSelection: [],
copyVisible: false,
projectName: '',
projectNameRepeat: false,
currentRow: {},
listDataAll: []
};
},
computed: {
...mapState('user', [
'userId','roleId'
]),
...mapState('project', [
'lastSystemId','assFields'
]),
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
},500)
}
},
mounted() {
this.systemId = this.lastSystemId ? this.lastSystemId : Setting.systemId
this.getData()
},
methods: {
...mapActions('project', [
'setSystemId'
]),
getData(){
this.setSystemId(this.systemId)
let data = this.queryData
data.userId = this.userId
data.systemId = this.systemId
data.pageNo = this.page
data.pageSize = this.pageSize
data.projectName = util.encodeStr(this.keyword)
data.systemId = this.systemId
this.$get(this.api.queryAllManagements,data).then(res => {
let list = res.pageInfo.list
let newList = []
list.map(n => {
if(n.founder.includes(',')){
n.founder = '管理员'
}else{
n.founder = util.getRoleName(n.founder)
}
})
this.listData = list
this.total = res.pageInfo.total
}).catch(res => {});
},
initData(){
this.page = 1
this.getData()
},
handlePage(){
let list = this.listDataAll
let result = list.slice((this.page - 1) * this.pageSize,this.page * this.pageSize)
this.listData = result
},
transferStatus(status){
return status == 1 ? '已发布' : '草稿箱'
},
handleCurrentChange(val){
this.page = val
this.getData()
},
add(){
this.setSystemId(this.systemId)
this.$router.push('add')
},
edit(row){
this.setSystemId(row.systemId)
this.$router.push(`add?id=${row.projectId}`)
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
delData(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(this.api.removeProjectManagement,[row.projectId]).then(res => {
util.successMsg('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
},
delAllData() {
if(this.multipleSelection.length != ''){
let newArr = this.multipleSelection
let delList = newArr.map(item => {
return item.projectId
})
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(this.api.removeProjectManagement,delList).then(res => {
this.multipleSelection = [];
this.$refs.table.clearSelection()
util.successMsg('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
}else{
util.errorMsg('请先选择项目 !');
}
},
projectNameExistis(){
let data = {
projectName: util.encodeStr(this.projectName)
}
this.$get(this.api.isNameExistis,data).then(res => {
if(res.status != 200){
this.projectNameRepeat = true
this.$message.warning('该项目名称已存在')
}else{
this.projectNameRepeat = false
}
}).catch(res => {})
},
copyData(row){
this.currentRow.management = {
caseDescription: row.caseDescription,
experimentSuggests: row.experimentSuggests,
experimentalGoal: row.experimentalGoal,
founder: row.founder,
isstartexperimentSuggests: row.isstartexperimentSuggests,
isstartexperimental: row.isstartexperimental,
projectName: row.projectName,
projectPermissions: row.projectPermissions,
state: row.state,
systemId: row.systemId,
userId: row.userId,
knowledgePoints: row.knowledgePoints,
experimentIntroduction: row.experimentIntroduction
}
this.currentRow.founder = row.founder
this.projectName = row.projectName
this.projectNameRepeat = true
this.copyVisible = true
let data = {
projectId: row.projectId
}
this.$get(this.api.getZZJudgmentPoints,data).then((res) => {
this.currentRow.roleId = res.message.roleList.map(n => n.roleId)
let scoreList = res.message.scoreIndexList
let scores = []
for(let i in scoreList){
scores = scores.concat(scoreList[i])
}
let point = res.message.judgmentPointsList
point.map(n => {
let same = scores.find(e => e.judgmentPointsId == n.judgmentPointsId)
if(same) n.score = same.score
})
this.currentRow.pooints = point
this.$message.warning('请修改项目名称')
})
},
copySubmit(){
if(!this.projectName.length) return this.$message.warning('请填写项目名称')
if(this.projectNameRepeat) return this.$message.warning('该项目名称已存在')
let data = this.currentRow
data.management.projectName = this.projectName
data.founder = this.roleId
data.management.founder = this.roleId
data.management.userId = this.userId
data.pooints.map(n => {
n.userId = this.userId
})
let systemId = this.currentRow.management.systemId
let url = this.api.addProjectManagement
if(systemId == 2 || systemId == 3) url = this.api.addProjectManagementTrad
this.$post(url,data).then((res) => {
util.successMsg('复制成功');
this.copyVisible = false
this.getData()
})
},
switchOff(val,row,index) {
this.$get(this.api.enableProject,{
id: row.projectId,
enable: row.enable
})
.then(res => {
if(res.status != 200){
util.errorMsg(res.errmessage)
row.enable = row.enable == 1 ? 0 : 1
}
})
.catch(err => {});
},
goBack() {
this.$router.back()
},
}
};
</script>
<style lang="scss" scoped>
</style>

@ -2,13 +2,12 @@
<div class="wrap"> <div class="wrap">
<!-- 头像部分 --> <!-- 头像部分 -->
<div class="header"> <div class="header">
<!-- <img :src="this.$store.state.avatar" class="HeadPortrait" /> --> <el-avatar :size="80" :src="this.avatar" class="Headtop"></el-avatar>
<el-avatar :size="80" :src="this.$store.state.avatar" class="Headtop"></el-avatar>
<div style="color:#9278FF;font-size:14px;font-family:MicrosoftYaHei;margin-top:5px;"> <div style="color:#9278FF;font-size:14px;font-family:MicrosoftYaHei;margin-top:5px;">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
:action="this.api.uploadUserAvatars" :action="this.api.uploadUserAvatars"
:data="{userId:this.$store.state.userLoginId}" :data="{userId: this.userId}"
name="file" name="file"
:limit="3" :limit="3"
:on-success="getRes" :on-success="getRes"
@ -21,8 +20,8 @@
<!-- 用户信息 --> <!-- 用户信息 -->
<div class="card" style="margin-top: -65px"> <div class="card" style="margin-top: -65px">
<p class="block-title" style="display: flex;justify-content: space-between;align-items: center;"> <p class="block-title" style="display: flex;justify-content: space-between;align-items: center;">
<span><img src="../../assets/img/person/user.png" alt=""> 用户信息</span> <span><img src="@/assets/img/person/user.png" alt=""> 用户信息</span>
<el-button type="primary" size="small" v-preventReClick @click="save">更新资料</el-button> <el-button type="primary" size="small" @click="save">更新资料</el-button>
</p> </p>
<p class="meta-title"> <p class="meta-title">
<span>个人信息</span> <span>个人信息</span>
@ -259,13 +258,13 @@
</div> </div>
<div class="fold" v-if="archivesList.length > 1"> <div class="fold" v-if="archivesList.length > 1">
<img :class="{ 'arrowTransform': showArch, 'arrowTransformReturn': !showArch}" style="width: 21px;height: 17px;" src="../../assets/img/open.png" alt="" @click="foldArch"> <img :class="{ 'arrowTransform': showArch, 'arrowTransformReturn': !showArch}" style="width: 21px;height: 17px;" src="@/assets/img/open.png" alt="" @click="foldArch">
</div> </div>
</div> </div>
<div class="card mgb20"> <div class="card mgb20">
<p class="block-title" style="margin-bottom: 15px"> <p class="block-title" style="margin-bottom: 15px">
<span><img src="../../assets/img/person/manag.png" alt=""> 账号信息</span> <span><img src="@/assets/img/person/manag.png" alt=""> 账号信息</span>
</p> </p>
<div class="information"> <div class="information">
<div class="line"> <div class="line">
@ -384,12 +383,12 @@
</template> </template>
<script> <script>
import bus from '../common/bus' import Setting from '@/setting'
import _ from 'lodash'; import util from '@/libs/util'
import { mapState, mapActions } from 'vuex'
export default { export default {
data() { data() {
return { return {
userId: this.$store.state.userLoginId,
personalInformation: { personalInformation: {
userName: '', userName: '',
name:'', name:'',
@ -449,8 +448,8 @@ export default {
value: 2, value: 2,
label: '老师' label: '老师'
}], }],
provinceList: this.$store.state.provinceList, // provinceList: [],
cityList: [], // cityList: [],
// //
educationDegreeList: [ educationDegreeList: [
{ {
@ -509,6 +508,11 @@ export default {
accountReapeat: false accountReapeat: false
}; };
}, },
computed: {
...mapState('user', [
'userId','avatar'
]),
},
mounted() { mounted() {
this.getdata(); this.getdata();
this.getProvince() this.getProvince()
@ -517,10 +521,12 @@ export default {
}, },
methods: { methods: {
...mapActions('user', [
'setAvatar','setUserName'
]),
getProvince(){ getProvince(){
this.$get(this.api.queryProvince).then(res => { this.$get(this.api.queryProvince).then(res => {
this.provinceList = res.message this.provinceList = res.message
this.$store.commit("provinceData", { provinceList : this.provinceList});
}).catch(res => {}); }).catch(res => {});
}, },
// //
@ -562,8 +568,7 @@ export default {
}, },
// //
getRes(res) { getRes(res) {
this.$store.commit('userPhoto',{avatar:res.message}) this.setAvatar(res.message)
bus.$emit('updateAvatar',res.message)
}, },
uploadHeadImg: function() { uploadHeadImg: function() {
this.$el.querySelector('.hiddenInput').click(); this.$el.querySelector('.hiddenInput').click();
@ -696,7 +701,7 @@ export default {
this.$post(this.api.examinePassword,data) this.$post(this.api.examinePassword,data)
.then(res => { .then(res => {
if(res.errmessage == 'success'){ if(res.errmessage == 'success'){
this.$message.success('更换成功') util.successMsg('更换成功')
this.passwordVisible = false this.passwordVisible = false
} }
}) })
@ -849,7 +854,6 @@ export default {
} }
}, },
save() { save() {
// return console.log(11,this.personalInformation)
let isEmpty = false let isEmpty = false
this.archivesList.forEach((n,k) => { this.archivesList.forEach((n,k) => {
if(!n.personalCareerId) isEmpty = true if(!n.personalCareerId) isEmpty = true
@ -900,8 +904,9 @@ export default {
personalFileEntities personalFileEntities
} }
this.$put(this.api.userinfoUpdate,data).then(res => { this.$put(this.api.userinfoUpdate,data).then(res => {
bus.$emit('updateAccount',personalInformation.userName) this.setUserName(personalInformation.userName)
this.$message.success('提交成功!') // bus.$emit('updateAccount',personalInformation.userName)
util.successMsg('提交成功!')
}).catch(res => {}); }).catch(res => {});
}, },
emailCountdown(){ emailCountdown(){
@ -973,7 +978,7 @@ export default {
} }
this.$put(this.api.bingEmail,data).then(res => { this.$put(this.api.bingEmail,data).then(res => {
if(res.errmessage == 'success'){ if(res.errmessage == 'success'){
this.$message.success('绑定成功') util.successMsg('绑定成功')
this.personalInformation.email = this.email this.personalInformation.email = this.email
this.emailVisible = false this.emailVisible = false
} }
@ -1012,7 +1017,7 @@ export default {
} }
this.$put(this.api.bindPhone,data).then(res => { this.$put(this.api.bindPhone,data).then(res => {
if(res.errmessage == 'success'){ if(res.errmessage == 'success'){
this.$message.success('绑定成功') util.successMsg('绑定成功')
this.personalInformation.phone = this.phone this.personalInformation.phone = this.phone
this.phoneVisible = false this.phoneVisible = false
} }
@ -1034,15 +1039,12 @@ export default {
transform: rotateZ(0deg); transform: rotateZ(0deg);
} }
.wrap{ .wrap{
// height: calc(100vh - 60px); margin: -24px -24px 20px;
margin: -20px;
padding-top: 170px; padding-top: 170px;
// overflow: auto;
display:flex; display:flex;
align-items: center; align-items: center;
flex-direction:column; flex-direction:column;
background: #f6f6f6 url(../../assets/img/person/bg.png) 0 0/100% 500px no-repeat; background: #f6f6f6 url(../../../assets/img/person/bg.png) 0 0/100% 500px no-repeat;
box-sizing: border-box;
} }
.header{ .header{
z-index: 2; z-index: 2;
@ -1077,10 +1079,6 @@ input:focus {
} }
.Headtop { .Headtop {
margin-top: 10px; margin-top: 10px;
// width: 80px;
// height: 80px;
// background: url('../../assets/img/img.jpg');
// border-radius: 50%;
.head { .head {
width: 34px; width: 34px;

@ -1,79 +1,60 @@
<template> <template>
<div> <div class="page">
<el-card shadow="hover" class="mgb20"> <h6 class="p-title">筛选</h6>
<div class="tool">
<ul class="filter">
<li>
<el-input style="width: 250px;" size="small" placeholder="请输入学生账号/姓名/学校名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</li>
</ul>
<div> <div>
<div class="flex-center mgb20"> <el-button type="primary" size="small" v-auth @click="addStudent">新增学生</el-button>
<p class="hr_tag"></p> <el-button type="primary" size="small" v-auth @click="batchImport">批量导入</el-button>
<span>筛选</span> <el-button type="primary" size="small" v-auth @click="delAllSelection">批量删除</el-button>
</div>
<div>
<div style="display: flex;justify-content: flex-end;">
<div>
<el-input placeholder="请输入学生账号/姓名/学校名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
</div>
</div>
</div> </div>
</el-card> </div>
<el-card shadow="hover"> <el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys">
<div class="flex-between mgb20"> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<div class="flex-center"> <el-table-column type="index" width="100" label="序号" align="center">
<p class="hr_tag"></p> </el-table-column>
<span>学生列表</span> <el-table-column prop="account" label="账号" align="center">
</div> </el-table-column>
<div> <el-table-column prop="schoolName" label="院校" align="center">
<el-button type="primary" size="small" v-auth round @click="addStudent">新增学生</el-button> </el-table-column>
<el-button type="primary" size="small" v-auth round @click="batchImport">批量导入</el-button> <el-table-column prop="workNumber" label="学号" align="center">
<el-button type="primary" size="small" v-auth round @click="delAllSelection">批量删除</el-button> </el-table-column>
</div> <el-table-column prop="userName" label="学生姓名" align="center">
</div> </el-table-column>
<el-table :data="studentData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys"> <el-table-column prop="countries" label="账号角色" align="center">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <template slot-scope="scope">学生</template>
<el-table-column type="index" width="100" label="序号" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="loginNumber" label="登录次数" align="center">
<el-table-column prop="account" label="账号" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="lastLoginTime" label="上次登录时间" align="center">
<el-table-column prop="schoolName" label="院校" align="center"> </el-table-column>
</el-table-column> <el-table-column label="操作" align="center" width="300">
<el-table-column prop="workNumber" label="学号" align="center"> <template slot-scope="scope">
</el-table-column> <el-button type="text" v-auth @click="editStudent(scope.row,true)">查看</el-button>
<el-table-column prop="userName" label="学生姓名" align="center"> <el-button type="text" v-auth @click="editStudent(scope.row,false)">编辑</el-button>
</el-table-column> <el-button type="text" v-auth @click="resetPassword(scope.row)">重置密码</el-button>
<el-table-column prop="countries" label="账号角色" align="center"> <el-button type="text" v-auth @click="handleDelete(scope.row)">删除</el-button>
<template slot-scope="scope"> <el-switch
{{roleStatus(scope.row.roleId)}} v-model="scope.row.disableAccount"
</template> :active-value="0"
</el-table-column> :inactive-value="1"
<el-table-column prop="loginNumber" label="登录次数" align="center"> style="margin: 0 5px"
</el-table-column> @change="switchOff($event,scope.row,scope.$index)"
<el-table-column prop="lastLoginTime" label="上次登录时间" align="center"> v-auth="'学生管理:禁用'"
</el-table-column> ></el-switch>
<el-table-column label="操作" align="center" width="300"> </template>
<template slot-scope="scope"> </el-table-column>
<el-button type="text" v-auth @click="editStudent(scope.row,true)">查看</el-button> </el-table>
<el-button type="text" v-auth @click="editStudent(scope.row,false)">编辑</el-button> <div class="pagination">
<el-button type="text" v-auth @click="resetPassword(scope.row)">重置密码</el-button> <el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
<el-button type="text" v-auth @click="handleDelete(scope.row)">删除</el-button> </div>
<el-switch
v-model="scope.row.disableAccount"
:active-value="0"
:inactive-value="1"
style="margin: 0 5px"
@change="switchOff($event,scope.row,scope.$index)"
v-auth="'学生管理:禁用'"
></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="pageNo" layout="total, prev, pager, next" :total="totals">
</el-pagination>
</div>
</el-card>
<el-dialog :title="isDetail ? '查看学生' : (isAdd ? '新增学生' : '编辑学生')" :visible.sync="studentVisible" <el-dialog :title="isDetail ? '查看学生' : (isAdd ? '新增学生' : '编辑学生')" :visible.sync="studentVisible" width="30%" @close="closeStudent" class="dialog" :close-on-click-modal="false">
width="30%" center @close="closeStudent" class="dialog" :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" :disabled="isDetail" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" :disabled="isDetail" label-width="100px">
<el-form-item prop="account" label="学生账号"> <el-form-item prop="account" label="学生账号">
<el-input v-model="form.account" placeholder="请输入学生账号" @change="accountChange"></el-input> <el-input v-model="form.account" placeholder="请输入学生账号" @change="accountChange"></el-input>
@ -103,13 +84,12 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail"> <span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button @click="studentVisible = false">取消</el-button> <el-button size="small" @click="studentVisible = false">取消</el-button>
<el-button type="primary" @click="saveData"> </el-button> <el-button size="small" type="primary" @click="saveData"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 批量导入 --> <el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false">
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" center :close-on-click-modal="false">
<div style="text-align: center"> <div style="text-align: center">
<div style="margin-bottom: 10px;"><el-button type="primary" @click="downLoad">模板下载<i class="el-icon-download el-icon--right"></i></el-button></div> <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 <el-upload
@ -129,17 +109,12 @@
<el-link v-if="uploadFaild" type="primary" @click="showFaild">部分数据导入失败查看失败原因</el-link> <el-link v-if="uploadFaild" type="primary" @click="showFaild">部分数据导入失败查看失败原因</el-link>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="importVisible = false"> </el-button> <el-button size="small" @click="importVisible = false"> </el-button>
<el-button type="primary" @click="uploadSure"> </el-button> <el-button size="small" type="primary" @click="uploadSure"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog <el-dialog title="重置密码" :visible.sync="passwordVisible" :close-on-click-modal="false" @close="closePassword" width="30%">
title="重置密码"
:visible.sync="passwordVisible"
:close-on-click-modal="false"
@close="closePassword"
width="30%">
<el-form ref="passwordForm" :model="form" label-width="60px"> <el-form ref="passwordForm" :model="form" label-width="60px">
<el-form-item label="原密码"> <el-form-item label="原密码">
<el-input type="password" v-model="passwordForm.password" placeholder="请输入原密码"></el-input> <el-input type="password" v-model="passwordForm.password" placeholder="请输入原密码"></el-input>
@ -152,22 +127,23 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="passwordVisible = false"> </el-button> <el-button size="small" @click="passwordVisible = false"> </el-button>
<el-button type="primary" @click="editPassword"> </el-button> <el-button size="small" type="primary" @click="editPassword"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import bus from '../common/bus'; import Setting from '@/setting'
import util from '@/libs/util'
import { mapState, mapActions } from 'vuex'
export default { export default {
name: 'dashboard',
data() { data() {
return { return {
isDetail: false, isDetail: false,
keyword: '', keyword: '',
schoolId: this.$config.schoolId, schoolId: Setting.schoolId,
form: { form: {
userName: '', userName: '',
account: '', account: '',
@ -223,10 +199,10 @@ export default {
} }
] ]
}, },
studentData:[], listData:[],
pageNo: 1, page: 1,
pageSize: 10, pageSize: 10,
totals: 0, total: 0,
multipleSelection: [], multipleSelection: [],
uploadList: [], uploadList: [],
importVisible: false, importVisible: false,
@ -267,18 +243,18 @@ export default {
getData() { getData() {
let data = { let data = {
schoolId: this.schoolId, schoolId: this.schoolId,
seachContent: this.encodeString(this.keyword), seachContent: util.encodeStr(this.keyword),
page: this.pageNo, page: this.page,
size: this.pageSize size: this.pageSize
} }
this.$get(this.api.queryStudent,data).then(res => { this.$get(this.api.queryStudent,data).then(res => {
this.studentData = res.data.list this.listData = res.data.list
this.totals = res.data.totalCount this.total = res.data.totalCount
}).catch(res => {}); }).catch(res => {});
}, },
initData(){ initData(){
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.pageNo = 1 this.page = 1
this.getData() this.getData()
}, },
saveData() { saveData() {
@ -291,22 +267,22 @@ export default {
if(this.form.studentId) { if(this.form.studentId) {
this.$put(this.api.updateStudent,this.form).then(res => { this.$put(this.api.updateStudent,this.form).then(res => {
if(res.errmessage == 'success') { if(res.errmessage == 'success') {
this.$message.success('提交成功!'); util.successMsg('提交成功!');
this.studentVisible = false this.studentVisible = false
this.getData() this.getData()
}else{ }else{
this.$message.error(res.message); util.errorMsg(res.message);
} }
}).catch(res => {}); }).catch(res => {});
}else{ }else{
this.form.uniqueIdentificationAccount = new Date().getTime() this.form.uniqueIdentificationAccount = new Date().getTime()
this.$post(this.api.addStudent,this.form).then(res => { this.$post(this.api.addStudent,this.form).then(res => {
if(res.errmessage == 'success') { if(res.errmessage == 'success') {
this.$message.success('提交成功!'); util.successMsg('提交成功!');
this.studentVisible = false this.studentVisible = false
this.getData() this.getData()
}else{ }else{
this.$message.error(res.message); util.errorMsg(res.message);
} }
}).catch(res => {}); }).catch(res => {});
} }
@ -317,13 +293,13 @@ export default {
}, },
async accountChange(){ async accountChange(){
let res = await this.$get(this.api.queryAccountIsExist, { let res = await this.$get(this.api.queryAccountIsExist, {
account: this.encodeString(this.form.account), account: util.encodeStr(this.form.account),
schoolId: this.schoolId schoolId: this.schoolId
}); });
if(res.message.user.length){ if(res.message.user.length){
let roleId = res.message.user[0].roleId let roleId = res.message.user[0].roleId
if(roleId){ if(roleId){
this.accountMsg = roleId == 4 ? '该账号已存在' : (roleId.includes(',') ? '该账号已绑定老师和管理员' : `该账号已绑定${this.roleStatus(roleId)}`) this.accountMsg = roleId == 4 ? '该账号已存在' : (roleId.includes(',') ? '该账号已绑定老师和管理员' : `该账号已绑定${util.getRoleName(roleId)}`)
}else{ }else{
this.accountMsg = '该账号已存在' this.accountMsg = '该账号已存在'
} }
@ -335,7 +311,7 @@ export default {
}, },
async worknumberChange(){ async worknumberChange(){
let res = await this.$get(this.api.queryWorkNumberIsExist, { let res = await this.$get(this.api.queryWorkNumberIsExist, {
workNumber: this.encodeString(this.form.workNumber), workNumber: util.encodeStr(this.form.workNumber),
roleId: 4, roleId: 4,
schoolId: this.schoolId schoolId: this.schoolId
}); });
@ -364,7 +340,7 @@ export default {
getSchool(){ getSchool(){
this.clearcity() this.clearcity()
this.getSchoolData() this.getSchoolData()
this.pageNo = 1 this.page = 1
this.getData() this.getData()
}, },
getSchoolData(){ getSchoolData(){
@ -394,7 +370,7 @@ export default {
} }
}, },
currentChange(val) { currentChange(val) {
this.pageNo = val; this.page = val;
this.getData(); this.getData();
}, },
addStudent(){ addStudent(){
@ -419,7 +395,7 @@ export default {
}) })
.then(() => { .then(() => {
this.$post(this.api.daleteStudent,[row.studentId]).then(res => { this.$post(this.api.daleteStudent,[row.studentId]).then(res => {
this.$message.success('删除成功'); util.successMsg('删除成功');
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {});
}) })
@ -445,19 +421,19 @@ export default {
this.$post(this.api.daleteStudent,data).then(res => { this.$post(this.api.daleteStudent,data).then(res => {
this.multipleSelection = []; this.multipleSelection = [];
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.$message.success('删除成功'); util.successMsg('删除成功');
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {});
}).catch(() => {}); }).catch(() => {});
}else{ }else{
this.$message.error('请先选择数据 !'); util.errorMsg('请先选择数据 !');
} }
}, },
resetPassword(row){ resetPassword(row){
this.$confirm(`重置后的密码为:${this.$config.initialPassword},确定重置?`, '提示', { this.$confirm(`重置后的密码为:${this.$config.initialPassword},确定重置?`, '提示', {
}).then(() => { }).then(() => {
this.$put(this.api.reSetPassword,[row.userId]).then(res => { this.$put(this.api.reSetPassword,[row.userId]).then(res => {
if(res.errmessage == 'success') this.$message.success('重置成功') if(res.errmessage == 'success') util.successMsg('重置成功')
}).catch(res => {}); }).catch(res => {});
}).catch(() => { }).catch(() => {
}); });
@ -492,7 +468,7 @@ export default {
this.$put(this.api.reSetPassword,data) this.$put(this.api.reSetPassword,data)
.then(res => { .then(res => {
if(res.errmessage == 'success'){ if(res.errmessage == 'success'){
this.$message.success('更换成功') util.successMsg('更换成功')
this.passwordVisible = false this.passwordVisible = false
} }
}) })
@ -516,10 +492,10 @@ export default {
this.token = res.data.token this.token = res.data.token
this.uploadFaild = true this.uploadFaild = true
}else{ }else{
this.$message.success('上传成功') util.successMsg('上传成功')
} }
}else{ }else{
res.message ? this.$message.error(res.message) : this.$message.error('上传失败,请检查数据') res.message ? util.errorMsg(res.message) : util.errorMsg('上传失败,请检查数据')
} }
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
@ -538,7 +514,7 @@ export default {
}, },
uploadSure(){ uploadSure(){
this.importVisible = false this.importVisible = false
this.pageNo = 1 this.page = 1
this.keyword = '' this.keyword = ''
this.getData() this.getData()
}, },
@ -546,15 +522,6 @@ export default {
}; };
</script> </script>
<style scoped> <style lang="scss" scoped>
.mag{
margin-right: 20px;
}
.no-mb /deep/.el-form-item{
margin-bottom: 0;
}
/deep/.el-row{
padding: 0 !important;
margin-bottom: 0;
}
</style> </style>

@ -0,0 +1,61 @@
<template>
<div class="page" style="padding: 0">
<div class="tabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a>
</div>
<staff v-if="active == 'staff'" v-auth="'系统设置:员工管理'"></staff>
<role v-else v-auth="'系统设置:角色权限'"></role>
</div>
</template>
<script>
import Setting from '@/setting'
import { mapState } from 'vuex'
import staff from './staff'
import role from './role'
export default {
data() {
return {
active: 'staff',
tabs: {
staff: '员工管理',
role: '角色权限'
},
};
},
computed: {
...mapState('auth', [
'btns'
])
},
components: {
staff,
role
},
created() {
Setting.dynamicRoute && this.initTabs()
},
methods: {
tabChange(index){
this.active = index
},
initTabs(){
let btnPermissions = this.routes
let tab1 = btnPermissions.includes('系统设置:员工管理')
let tab2 = btnPermissions.includes('系统设置:角色权限')
if(!tab1){
delete this.tabs.staff
}
if(!tab2){
delete this.tabs.role
}
}
}
};
</script>
<style lang="scss" scoped>
</style>

@ -1,44 +1,41 @@
<template> <template>
<div> <div class="page">
<el-card shadow="hover"> <div class="tool">
<div class="flex-between mgb20"> <ul class="filter">
<div class="flex-center"> <li>
<p class="hr_tag"></p> <el-input size="small" placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
<span>角色列表</span> </li>
</div> </ul>
<div> <div>
<el-input placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> <!-- <el-button type="primary" size="small" round @click="addRole" v-auth="'system:角色权限:新增角色'">新增角色</el-button>
<!-- <el-button type="primary" size="small" round @click="addRole" v-auth="'system:角色权限:新增角色'">新增角色</el-button> <el-button type="primary" size="small" round @click="delAllSelection" v-auth="'system:角色权限:批量删除'">批量删除</el-button> -->
<el-button type="primary" size="small" round @click="delAllSelection" v-auth="'system:角色权限:批量删除'">批量删除</el-button> -->
</div>
</div> </div>
<el-table :data="roleData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys"> </div>
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys">
</el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column prop="name" label="角色名称" align="center" width="100"> <el-table-column type="index" width="100" label="序号" align="center">
</el-table-column> </el-table-column>
<el-table-column label="角色描述" align="center"> <el-table-column prop="name" label="角色名称" align="center" width="100">
<template slot-scope="scope"> </el-table-column>
<el-input placeholder="该角色用于管理全部功能权限" v-model="scope.row.description" disabled></el-input> <el-table-column label="角色描述" align="center">
</template> <template slot-scope="scope">
</el-table-column> <el-input placeholder="该角色用于管理全部功能权限" v-model="scope.row.description" disabled></el-input>
<el-table-column label="操作" align="center"> </template>
<template slot-scope="scope"> </el-table-column>
<el-button type="text" @click="showRole(scope.row)" v-auth="'system:角色权限:查看'">查看</el-button> <el-table-column label="操作" align="center">
<el-button type="text" @click="editRole(scope.row)" v-auth="'system:角色权限:编辑'">编辑</el-button> <template slot-scope="scope">
<!-- <el-button type="text" @click="handleDelete(scope.row)" v-auth="'system:角色权限:删除'">删除</el-button> --> <el-button type="text" @click="showRole(scope.row)" v-auth="'system:角色权限:查看'">查看</el-button>
</template> <el-button type="text" @click="editRole(scope.row)" v-auth="'system:角色权限:编辑'">编辑</el-button>
</el-table-column> <!-- <el-button type="text" @click="handleDelete(scope.row)" v-auth="'system:角色权限:删除'">删除</el-button> -->
</el-table> </template>
<div class="pagination"> </el-table-column>
<el-pagination background @current-change="currentChange" :current-page="pageNo" layout="total, prev, pager, next" :total="totals"> </el-table>
</el-pagination> <div class="pagination">
</div> <el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</el-card> </div>
<el-dialog :title="isDetail ? '查看角色' : (isAdd ? '新增角色' : '编辑角色')" :visible.sync="roleVisible" <el-dialog :title="isDetail ? '查看角色' : (isAdd ? '新增角色' : '编辑角色')" :visible.sync="roleVisible" width="30%" @close="closeRole" class="dialog" :close-on-click-modal="false">
width="30%" @close="closeRole" class="dialog" center :close-on-click-modal="false">
<el-form ref="form" label-width="100px" :disabled="isDetail"> <el-form ref="form" label-width="100px" :disabled="isDetail">
<el-form-item label="角色名称"> <el-form-item label="角色名称">
<el-input v-model="form.name " ref="account" placeholder="请输入角色名称"></el-input> <el-input v-model="form.name " ref="account" placeholder="请输入角色名称"></el-input>
@ -61,16 +58,18 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail"> <span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button @click="roleVisible = false"> </el-button> <el-button size="small" @click="roleVisible = false"> </el-button>
<el-button type="primary" @click="saveData"> </el-button> <el-button size="small" type="primary" @click="saveData"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import Setting from '@/setting'
import util from '@/libs/util'
import { mapState, mapActions } from 'vuex'
export default { export default {
name: 'dashboard',
data() { data() {
return { return {
keyword: '', keyword: '',
@ -81,7 +80,7 @@ export default {
name: '', name: '',
description: '', description: '',
}, },
roleData:[], listData:[],
data: [{ data: [{
id: 1, id: 1,
label: '一级 1', label: '一级 1',
@ -121,9 +120,9 @@ export default {
children: 'children', children: 'children',
label: 'name' label: 'name'
}, },
pageNo: 1, page: 1,
pageSize: 10, pageSize: 10,
totals: 0, total: 0,
multipleSelection: [], multipleSelection: [],
isAdd: true, isAdd: true,
roleVisible: false, roleVisible: false,
@ -145,17 +144,17 @@ export default {
methods: { methods: {
getData() { getData() {
let data = { let data = {
name: this.encodeString(this.keyword), name: util.encodeStr(this.keyword),
page: this.pageNo, page: this.page,
size: this.pageSize size: this.pageSize
} }
this.$get(this.api.rolePermissionList,data).then(res => { this.$get(this.api.rolePermissionList,data).then(res => {
this.roleData = res.data.list this.listData = res.data.list
this.totals = res.data.totalCount this.total = res.data.totalCount
}).catch(res => {}); }).catch(res => {});
}, },
currentChange(val) { currentChange(val) {
this.pageNo = val; this.page = val;
this.getData(); this.getData();
}, },
handleDelete(row) { handleDelete(row) {
@ -167,7 +166,7 @@ export default {
roleIds: [row.roleId] roleIds: [row.roleId]
} }
this.$post(`${this.api.delRolePermission}`,data).then(res => { this.$post(`${this.api.delRolePermission}`,data).then(res => {
this.$message.success('删除成功') util.successMsg('删除成功')
this.getData() this.getData()
}).catch(res => {}) }).catch(res => {})
}) })
@ -195,13 +194,13 @@ export default {
} }
this.$post(`${this.api.delRolePermission}`,data).then(res => { this.$post(`${this.api.delRolePermission}`,data).then(res => {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.$message.success('删除成功') util.successMsg('删除成功')
this.getData() this.getData()
}).catch(res => {}) }).catch(res => {})
}) })
.catch(() => {}) .catch(() => {})
}else{ }else{
this.$message.error('请先选择数据!') util.errorMsg('请先选择数据!')
} }
}, },
closeRole(){ closeRole(){
@ -288,13 +287,13 @@ export default {
} }
if(this.form.roleId){ if(this.form.roleId){
this.$post(this.api.updateRolePermission,data).then(res => { this.$post(this.api.updateRolePermission,data).then(res => {
this.$message.success('修改成功') util.successMsg('修改成功')
this.getData() this.getData()
this.roleVisible = false this.roleVisible = false
}).catch(res => {}) }).catch(res => {})
}else{ }else{
this.$post(this.api.saveRolePermission,data).then(res => { this.$post(this.api.saveRolePermission,data).then(res => {
this.$message.success('新增成功') util.successMsg('新增成功')
this.getData() this.getData()
this.roleVisible = false this.roleVisible = false
}).catch(res => {}) }).catch(res => {})
@ -303,16 +302,6 @@ export default {
} }
}; };
</script> </script>
<style lang="scss" scoped>
<style scoped>
.mag{
margin-right: 20px;
}
.no-mb /deep/.el-form-item{
margin-bottom: 0;
}
/deep/.el-row{
padding: 0 !important;
margin-bottom: 0;
}
</style> </style>

@ -1,67 +1,58 @@
<template> <template>
<div> <div class="wrap">
<el-container> <div class="side">
<el-aside width="350px"> <TeacherSide ref="getSelectData" @fircheck="fircheck" @twocheck="twocheck" @getData="getData" @delDep="delDep"></TeacherSide>
<TeacherSide ref="getSelectData" @fircheck="fircheck" @twocheck="twocheck" @getData="getData" </div>
@delDep="delDep"></TeacherSide>
</el-aside>
<el-main style="padding-top: 0"> <div class="right">
<el-col :span="24"> <div class="tool">
<el-card shadow="hover" class="mgb20 teacher_tab"> <ul class="filter">
<div class="flex-between mgb20"> <li>
<div> <el-input size="small" placeholder="请输入员工账号/姓名/工号" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
<el-input placeholder="请输入员工账号/姓名/工号" v-model="keyword"> </li>
<i slot="suffix" class="el-input__icon el-icon-search"></i> </ul>
</el-input> <div>
</div> <el-button type="primary" size="small" round @click="addTeacher" v-auth="'system:员工管理:新增员工'">新增员工</el-button>
<div> <el-button type="primary" size="small" round @click="batchImport" v-auth="'system:员工管理:批量导入'">批量导入</el-button>
<el-button type="primary" size="small" round @click="addTeacher" v-auth="'system:员工管理:新增员工'">新增员工</el-button> <el-button type="primary" size="small" round @click="delAllSelection" v-auth="'system:员工管理:批量删除'">批量删除</el-button>
<el-button type="primary" size="small" round @click="batchImport" v-auth="'system:员工管理:批量导入'">批量导入</el-button> </div>
<el-button type="primary" size="small" round @click="delAllSelection" v-auth="'system:员工管理:批量删除'">批量删除</el-button> </div>
</div>
</div> <el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange"> <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" label="序号" width="55" align="center">
<el-table-column type="index" label="序号" width="55" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="account" label="账号" align="center">
<el-table-column prop="account" label="账号" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="userName" label="职工姓名" align="center">
<el-table-column prop="userName" label="职工姓名" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="workNumber" label="职工工号" align="center">
<el-table-column prop="workNumber" label="职工工号" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="staffProfessionalArchitectureName" label="一级部门" align="center">
<el-table-column prop="staffProfessionalArchitectureName" label="一级部门" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="staffGradeName" label="二级部门" align="center">
<el-table-column prop="staffGradeName" label="二级部门" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="NewaccountRole" label="账号角色" align="center">
<el-table-column prop="NewaccountRole" label="账号角色" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="logInNumber" label="登录次数" align="center">
<el-table-column prop="logInNumber" label="登录次数" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="lastLoginTime" label="上次登录时间" align="center">
<el-table-column prop="lastLoginTime" label="上次登录时间" align="center"> </el-table-column>
</el-table-column> <el-table-column label="操作" width="200" align="center">
<el-table-column label="操作" width="200" align="center"> <template slot-scope="scope">
<template slot-scope="scope"> <el-button type="text" @click="showTeacher(scope.row)" v-auth="'system:员工管理:查看'">查看</el-button>
<el-button type="text" @click="showTeacher(scope.row)" v-auth="'system:员工管理:查看'">查看</el-button> <el-button type="text" @click="editTeacher(scope.row)" v-auth="'system:员工管理:编辑'">编辑</el-button>
<el-button type="text" @click="editTeacher(scope.row)" v-auth="'system:员工管理:编辑'">编辑</el-button> <el-button type="text" @click="resetPassword(scope.row)" v-auth="'system:员工管理:重置密码'">重置密码</el-button>
<el-button type="text" @click="resetPassword(scope.row)" v-auth="'system:员工管理:重置密码'">重置密码</el-button> <el-button type="text" @click="delTeacher(scope.row)" v-auth="'system:员工管理:删除'">删除</el-button>
<el-button type="text" @click="delTeacher(scope.row)" v-auth="'system:员工管理:删除'">删除</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" :current-page="page" @current-change="handleCurrentChange" :total="total"></el-pagination>
<el-pagination background layout="total, prev, pager, next" :current-page="pageNo" @current-change="handleCurrentChange" :total="totals"> </div>
</el-pagination> </div>
</div>
</el-card>
</el-col>
</el-main>
</el-container>
<!-- 新增用户 --> <el-dialog :title="isDetail ? '查看员工' : (isAddteacher ? '新增员工' : '编辑员工')" :visible.sync="teacherVisible" width="30%" @close="closeTeacher" class="dialog" :close-on-click-modal="false">
<el-dialog :title="isDetail ? '查看员工' : (isAddteacher ? '新增员工' : '编辑员工')" :visible.sync="teacherVisible"
width="30%" center @close="closeTeacher" class="dialog" :close-on-click-modal="false">
<el-form ref="teacherForm" :model="teacherForm" :rules="rules" label-width="120px" :disabled="isDetail"> <el-form ref="teacherForm" :model="teacherForm" :rules="rules" label-width="120px" :disabled="isDetail">
<el-form-item prop="userAccount" label="账号"> <el-form-item prop="userAccount" label="账号">
<el-input v-model="teacherForm.userAccount" ref="account" placeholder="请输入职工账号" @change="accountChange"></el-input> <el-input v-model="teacherForm.userAccount" ref="account" placeholder="请输入职工账号" @change="accountChange"></el-input>
@ -120,12 +111,6 @@
<el-form-item prop="email" label="邮箱"> <el-form-item prop="email" label="邮箱">
<el-input v-model="teacherForm.email" placeholder="请输入邮箱" @change="emailChange"></el-input> <el-input v-model="teacherForm.email" placeholder="请输入邮箱" @change="emailChange"></el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item prop="major" label="专业方向">
<el-select v-model="teacherForm.major" placeholder="请选择专业方向">
<el-option v-for="(item,index) in majorList1" :key="index"
:label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item> -->
<el-form-item prop="schoolId" label="所在院校"> <el-form-item prop="schoolId" label="所在院校">
<el-select v-model="teacherForm.schoolId" placeholder="默认为当前院校(可修改)" filterable disabled> <el-select v-model="teacherForm.schoolId" placeholder="默认为当前院校(可修改)" filterable disabled>
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option> <el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option>
@ -133,13 +118,12 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail"> <span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button @click="teacherVisible = false"> </el-button> <el-button size="small" @click="teacherVisible = false"> </el-button>
<el-button type="primary" @click="saveSure('teacherForm')"> </el-button> <el-button size="small" type="primary" @click="saveSure('teacherForm')"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 批量导入 --> <el-dialog title="批量导入" :visible.sync="importVisible" width="24%" :close-on-click-modal="false">
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" center :close-on-click-modal="false">
<div style="text-align: center"> <div style="text-align: center">
<div style="margin-bottom: 10px;"><el-button type="primary" @click="downLoad">模板下载<i class="el-icon-download el-icon--right"></i></el-button></div> <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 <el-upload
@ -159,22 +143,24 @@
<el-link v-if="uploadFaild" type="primary" @click="showFaild">部分数据导入失败查看失败原因</el-link> <el-link v-if="uploadFaild" type="primary" @click="showFaild">部分数据导入失败查看失败原因</el-link>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="importVisible = false"> </el-button> <el-button size="small" @click="importVisible = false"> </el-button>
<el-button type="primary" @click="uploadSure"> </el-button> <el-button size="small" type="primary" @click="uploadSure"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import TeacherSide from './StaffSide.vue'; import Setting from '@/setting'
import util from '@/libs/util'
import { mapState, mapActions } from 'vuex'
import TeacherSide from './staffSide'
export default { export default {
data() { data() {
return { return {
pages: 10,
isDetail: false, isDetail: false,
isAddteacher: false, isAddteacher: false,
teacherVisible: false, teacherVisible: false,
schoolId: this.$config.schoolId, schoolId: Setting.schoolId,
teacherForm: { teacherForm: {
teacherId: '', teacherId: '',
userName: '', userName: '',
@ -191,7 +177,7 @@ export default {
managerDepartment: '', managerDepartment: '',
userAccount: '', userAccount: '',
major: '', major: '',
schoolId: this.schoolId schoolId: Setting.schoolId
}, },
rules: { rules: {
userAccount: [ userAccount: [
@ -270,9 +256,9 @@ export default {
listData: [], listData: [],
importVisible: false, importVisible: false,
keyword: '', keyword: '',
pageNo: 1, page: 1,
pageSize: 10, pageSize: 10,
totals: 0, total: 0,
managerDepartmentList: [], managerDepartmentList: [],
teacherDepartmentList: [], teacherDepartmentList: [],
staffstateProfessId: '', staffstateProfessId: '',
@ -315,7 +301,8 @@ export default {
}, },
mounted(){ mounted(){
this.getData() this.getData()
this.teacherForm.schoolId = this.$config.schoolId this.teacherForm.schoolId = Setting.schoolId
console.log(33,this.schoolId,this.teacherForm.schoolId)
this.getSchoolData() this.getSchoolData()
}, },
methods: { methods: {
@ -368,24 +355,24 @@ export default {
let data = { let data = {
staffProfessionalArchitectureIds: (this.oneDepartmentIds && this.twoDepartmentIds) ? '' : this.oneDepartmentIds, staffProfessionalArchitectureIds: (this.oneDepartmentIds && this.twoDepartmentIds) ? '' : this.oneDepartmentIds,
staffGradeIds: this.twoDepartmentIds, staffGradeIds: this.twoDepartmentIds,
searchContent: this.encodeString(this.keyword), searchContent: util.encodeStr(this.keyword),
page: this.pageNo, page: this.page,
size: this.pageSize, size: this.pageSize,
schoolId: this.schoolId schoolId: this.schoolId
} }
this.$post(this.api.queryStaff,data).then(res => { this.$post(this.api.queryStaff,data).then(res => {
this.listData = res.data.list this.listData = res.data.list
this.totals = res.data.totalCount this.total = res.data.totalCount
this.listData.forEach(e => { this.listData.forEach(e => {
if(e.roleId.length > 1) { if(e.roleId.length > 1) {
let NewaccountRole = [] let NewaccountRole = []
let roleIds = e.roleId.split(',') let roleIds = e.roleId.split(',')
roleIds.forEach((n,k) => { roleIds.forEach((n,k) => {
NewaccountRole.push(this.roleStatus(n)) NewaccountRole.push(util.getRoleName(n))
}) })
e.NewaccountRole = NewaccountRole.join(',') e.NewaccountRole = NewaccountRole.join(',')
}else{ }else{
e.NewaccountRole = this.roleStatus(e.roleId) e.NewaccountRole = util.getRoleName(e.roleId)
} }
}) })
}).catch(res => {}); }).catch(res => {});
@ -446,7 +433,7 @@ export default {
this.teacherForm.schoolId = user.schoolId this.teacherForm.schoolId = user.schoolId
this.teacherForm.uniqueIdentificationAccount = user.uniqueIdentificationAccount this.teacherForm.uniqueIdentificationAccount = user.uniqueIdentificationAccount
or.forEach((n,i) => { or.forEach((n,i) => {
this.teacherForm.roleValue.push(this.roleStatus(n.roleId)) this.teacherForm.roleValue.push(util.getRoleName(n.roleId))
if(n.roleId == 13) { if(n.roleId == 13) {
this.teacherForm.managerMajor = n.staffProfessionalArchitectureId this.teacherForm.managerMajor = n.staffProfessionalArchitectureId
this.teacherForm.managerDepartment = n.staffGradeId this.teacherForm.managerDepartment = n.staffGradeId
@ -484,9 +471,9 @@ export default {
} }
this.$get(this.api.resetPwd,data).then(res => { this.$get(this.api.resetPwd,data).then(res => {
if(res.errmessage == 'success'){ if(res.errmessage == 'success'){
this.$message.success('重置成功') util.successMsg('重置成功')
}else{ }else{
this.$message.error('重置失败') util.errorMsg('重置失败')
} }
}).catch(res => {}); }).catch(res => {});
}).catch(() => { }).catch(() => {
@ -534,7 +521,7 @@ export default {
}, },
async accountChange(){ async accountChange(){
let res = await this.$get(this.api.queryAccountIsExist, { let res = await this.$get(this.api.queryAccountIsExist, {
account: this.encodeString(this.teacherForm.userAccount), account: util.encodeStr(this.teacherForm.userAccount),
schoolId: this.schoolId schoolId: this.schoolId
}); });
if(this.isAddteacher){ if(this.isAddteacher){
@ -545,7 +532,7 @@ export default {
let user = res.message.user[0]; let user = res.message.user[0];
let or = res.message.OR; let or = res.message.OR;
if(user.roleId){ if(user.roleId){
this.accountMsg = user.roleId.includes(',') ? '该账号已绑定老师和管理员' : `该账号已绑定${this.roleStatus(user.roleId)}` this.accountMsg = user.roleId.includes(',') ? '该账号已绑定老师和管理员' : `该账号已绑定${util.getRoleName(user.roleId)}`
}else{ }else{
this.accountMsg = '该账号已存在' this.accountMsg = '该账号已存在'
} }
@ -559,7 +546,7 @@ export default {
this.teacherForm.userId = user.userId this.teacherForm.userId = user.userId
this.isNewUser = 0 this.isNewUser = 0
or.forEach((n,i) => { or.forEach((n,i) => {
this.teacherForm.roleValue.push(this.roleStatus(n.roleId)) this.teacherForm.roleValue.push(util.getRoleName(n.roleId))
if(n.roleId == 13) { if(n.roleId == 13) {
this.teacherForm.managerMajor = n.oneDepartmentId this.teacherForm.managerMajor = n.oneDepartmentId
this.teacherForm.managerDepartment = n.twoDepartmentId this.teacherForm.managerDepartment = n.twoDepartmentId
@ -597,14 +584,14 @@ export default {
let msg = ''; let msg = '';
if(type == 13){ if(type == 13){
data = { data = {
workNumber: this.encodeString(this.teacherForm.managerWorkNumber), workNumber: util.encodeStr(this.teacherForm.managerWorkNumber),
roleId: 13, roleId: 13,
schoolId: this.teacherForm.schoolId schoolId: this.teacherForm.schoolId
} }
msg = '该管理员工号已存在' msg = '该管理员工号已存在'
}else if(type == 14){ }else if(type == 14){
data = { data = {
workNumber: this.encodeString(this.teacherForm.teacherWorkNumber), workNumber: util.encodeStr(this.teacherForm.teacherWorkNumber),
roleId: 14, roleId: 14,
schoolId: this.teacherForm.schoolId schoolId: this.teacherForm.schoolId
} }
@ -702,13 +689,13 @@ export default {
if(this.teacherForm.teacherId){ if(this.teacherForm.teacherId){
this.$put(this.api.updateStaff,data).then(res => { this.$put(this.api.updateStaff,data).then(res => {
this.teacherVisible = false this.teacherVisible = false
this.$message.success('编辑成功'); util.successMsg('编辑成功');
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {});
}else{ }else{
this.$post(this.api.addStaff,data).then(res => { this.$post(this.api.addStaff,data).then(res => {
this.teacherVisible = false this.teacherVisible = false
this.$message.success('添加成功'); util.successMsg('添加成功');
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {});
} }
@ -723,7 +710,7 @@ export default {
}) })
.then(() => { .then(() => {
this.$post(this.api.daleteBatchStaff,[row.userId]).then(res => { this.$post(this.api.daleteBatchStaff,[row.userId]).then(res => {
this.$message.success('删除成功') util.successMsg('删除成功')
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {});
}) })
@ -747,12 +734,12 @@ export default {
this.$post(this.api.daleteBatchStaff,data).then(res => { this.$post(this.api.daleteBatchStaff,data).then(res => {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.multipleSelection = []; this.multipleSelection = [];
this.$message.success('删除成功') util.successMsg('删除成功')
this.getData() this.getData()
}).catch(res => {}); }).catch(res => {});
}).catch(() => {}); }).catch(() => {});
}else{ }else{
this.$message.error('请先选择员工 !') util.errorMsg('请先选择员工 !')
} }
}, },
batchImport(){ batchImport(){
@ -761,11 +748,11 @@ export default {
this.uploadFaild = false this.uploadFaild = false
}, },
searchTeacher(){ searchTeacher(){
this.pageNo = 1; this.page = 1;
this.getData() this.getData()
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.pageNo = val; this.page = val;
this.getData(); this.getData();
}, },
downLoad(){ downLoad(){
@ -787,10 +774,10 @@ export default {
this.token = res.data.token this.token = res.data.token
this.uploadFaild = true this.uploadFaild = true
}else{ }else{
this.$message.success('上传成功') util.successMsg('上传成功')
} }
}else{ }else{
res.message ? this.$message.error(res.message) : this.$message.error('上传失败,请检查数据') res.message ? util.errorMsg(res.message) : util.errorMsg('上传失败,请检查数据')
} }
}, },
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
@ -809,7 +796,7 @@ export default {
}, },
uploadSure(){ uploadSure(){
this.importVisible = false this.importVisible = false
this.pageNo = 1 this.page = 1
this.keyword = '' this.keyword = ''
this.getData() this.getData()
}, },
@ -861,12 +848,17 @@ export default {
} }
}; };
</script> </script>
<style scoped> <style lang="scss" scoped>
.el-container{ .wrap{
background-color: #f0f0f0; display: flex;
} padding: 24px;
.mag{ .side{
margin-right: 20px; width: 350px;
margin-left: 20px; margin-right: 24px;
} }
.right{
width: calc(100% - 374px);
padding: 24px;
}
}
</style> </style>

@ -8,7 +8,6 @@
></lctree> ></lctree>
</div> </div>
<!-- 添加专业 -->
<el-dialog :title="Form.MajorId ? '编辑专业' : '新增专业'" :visible.sync="isaddMajor" width="24%" center @close="closeAdd" :close-on-click-modal="false"> <el-dialog :title="Form.MajorId ? '编辑专业' : '新增专业'" :visible.sync="isaddMajor" width="24%" center @close="closeAdd" :close-on-click-modal="false">
<el-form ref="Form" :model="Form" :rules="rules"> <el-form ref="Form" :model="Form" :rules="rules">
<el-form-item prop="majorName"> <el-form-item prop="majorName">
@ -21,7 +20,6 @@
</span> </span>
</el-dialog> </el-dialog>
<!-- 添加部门 -->
<el-dialog :title="Form.departmentId ? '编辑部门' : '新增部门'" :visible.sync="isAddDepartment" width="24%" center @close="closeAdd" :close-on-click-modal="false"> <el-dialog :title="Form.departmentId ? '编辑部门' : '新增部门'" :visible.sync="isAddDepartment" width="24%" center @close="closeAdd" :close-on-click-modal="false">
<el-form ref="Form" :model="Form" :rules="rules"> <el-form ref="Form" :model="Form" :rules="rules">
<el-form-item prop="departmentName"> <el-form-item prop="departmentName">
@ -36,7 +34,10 @@
</div> </div>
</template> </template>
<script> <script>
import lctree from './Stafftree'; import Setting from '@/setting'
import util from '@/libs/util'
import { mapState, mapActions } from 'vuex'
import lctree from './stafftree'
export default { export default {
props:["Data"], props:["Data"],
data() { data() {
@ -46,7 +47,7 @@ export default {
twoactive: 0, twoactive: 0,
isaddMajor: false, isaddMajor: false,
isAddDepartment: false, isAddDepartment: false,
schoolId: this.$config.schoolId, schoolId: Setting.schoolId,
Form: { Form: {
MajorId: '', MajorId: '',
majorName: '', majorName: '',
@ -139,7 +140,7 @@ export default {
} }
if(this.Form.MajorId){ if(this.Form.MajorId){
this.$post(this.api.updateStaffPro,data).then(res => { this.$post(this.api.updateStaffPro,data).then(res => {
this.$message.success('编辑成功'); util.successMsg('编辑成功');
this.isaddMajor = false this.isaddMajor = false
this.majorList.map(e =>{ this.majorList.map(e =>{
if(e.staffProfessionalArchitectureId == this.Form.MajorId){ if(e.staffProfessionalArchitectureId == this.Form.MajorId){
@ -151,7 +152,7 @@ export default {
}).catch(res => {}); }).catch(res => {});
}else{ }else{
this.$post(this.api.addStaffPro,data).then(res => { this.$post(this.api.addStaffPro,data).then(res => {
this.$message.success('添加成功'); util.successMsg('添加成功');
this.isaddMajor = false this.isaddMajor = false
let newData = { let newData = {
staffProfessionalArchitectureId: res.message, staffProfessionalArchitectureId: res.message,
@ -198,7 +199,7 @@ export default {
} }
if(this.Form.departmentId){ if(this.Form.departmentId){
this.$post(this.api.updateStaffGrade,data).then(res => { this.$post(this.api.updateStaffGrade,data).then(res => {
this.$message.success('编辑成功'); util.successMsg('编辑成功');
this.isAddDepartment = false this.isAddDepartment = false
this.majorList.map(e =>{ this.majorList.map(e =>{
e.children.map(r =>{ e.children.map(r =>{
@ -211,7 +212,7 @@ export default {
}).catch(res => {}); }).catch(res => {});
}else{ }else{
this.$post(this.api.addStaffGrade,data).then(res => { this.$post(this.api.addStaffGrade,data).then(res => {
this.$message.success('添加成功'); util.successMsg('添加成功');
this.isAddDepartment = false this.isAddDepartment = false
let newData = { let newData = {
staffGradeId: res.message, staffGradeId: res.message,
@ -242,7 +243,7 @@ export default {
staffProfessionalArchitectureId: item.staffProfessionalArchitectureId staffProfessionalArchitectureId: item.staffProfessionalArchitectureId
} }
this.$post(this.api.deleteStaffPro,data).then(res => { this.$post(this.api.deleteStaffPro,data).then(res => {
this.$message.success('删除成功'); util.successMsg('删除成功');
this.majorList.splice(index, 1) this.majorList.splice(index, 1)
this.$emit('getData') this.$emit('getData')
this.$get(`${this.api.dalStaffByProfessionalId}?staffProfessionalArchitectureId=${item.staffProfessionalArchitectureId}`).then(res => {}).catch(res => {}) this.$get(`${this.api.dalStaffByProfessionalId}?staffProfessionalArchitectureId=${item.staffProfessionalArchitectureId}`).then(res => {}).catch(res => {})
@ -259,7 +260,7 @@ export default {
staffGradeId: item.staffGradeId staffGradeId: item.staffGradeId
} }
this.$post(this.api.deleteStaffGrade,data).then(res => { this.$post(this.api.deleteStaffGrade,data).then(res => {
this.$message.success('删除成功'); util.successMsg('删除成功');
this.majorList.map(e =>{ this.majorList.map(e =>{
e.children.map(r =>{ e.children.map(r =>{
if(r.staffGradeId == item.staffGradeId){ if(r.staffGradeId == item.staffGradeId){

@ -2,15 +2,13 @@
<div class="side_view"> <div class="side_view">
<p class="side_icon mab20"> <p class="side_icon mab20">
<i class="icon-jiahao mar20" @click="addMajor"></i> <i class="icon-jiahao mar20" @click="addMajor"></i>
<!-- <i class="icon-delete"></i> -->
</p> </p>
<div class="side_tree" v-for="(item,index) in data" :key="index"> <div class="side_tree" v-for="(item,index) in data" :key="index">
<div class="item" @click.stop="open(item,1)"> <div class="item" @click.stop="open(item,1)">
<!-- <i :class="{ 'arrowTransform': !item.ifVisible, 'arrowTransformReturn': item.ifVisible}" class="icon-shixiangyoujiantou-"></i> -->
<img <img
v-if="item.children&&item.children.length!=0" v-if="item.children&&item.children.length!=0"
:class="{ 'arrowTransform': !item.ifVisible, 'arrowTransformReturn': item.ifVisible}" :class="{ 'arrowTransform': !item.ifVisible, 'arrowTransformReturn': item.ifVisible}"
src="../../assets/img/icon-xiangyou.png" src="@/assets/img/icon-xiangyou.png"
alt alt
/> />
<i v-else class="empty"></i> <i v-else class="empty"></i>
@ -215,8 +213,8 @@ li {
// //
.isActive { .isActive {
background: url('../../assets/img/icon-yigouxuan.png'); background: url('../../../assets/img/icon-yigouxuan.png');
background-size: 14px 14px; /*按比例缩放*/ background-size: 14px 14px;
} }
.side_view{ .side_view{

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,25 @@
/**
* @description 鉴权指令
* 当传入的权限当前用户没有时会移除该组件
* 用例<Tag v-auth>text</Tag> <Tag v-auth="'user:'">text</Tag>
* */
import store from '@/store'
export default {
inserted (el, binding, vnode) {
let btnText = ''
if(binding.value){
btnText = binding.value
}else{
btnText = `${vnode.context.$route.path}:${el.innerText}`
}
const btnPermissions = store.state.auth.btns
if (btnText && btnPermissions && btnPermissions.length) {
const isPermission = btnPermissions.includes(btnText)
if (!isPermission) {
el.parentNode && el.parentNode.removeChild(el)
}
}
}
}

@ -0,0 +1,12 @@
/**
* @description 返回缺省值
* 传入的如果是null就返回'--'
* 用例<Tag :default="val">text</Tag> <Tag>{{val | default}}</Tag>
* */
const defaultShow = (val) => {
return val == null ? '--' : val
}
module.exports = {
defaultShow
}

@ -0,0 +1,14 @@
/**
* 插件
* */
import directiveAuth from '@/plugins/auth';
import throttle from '@/plugins/throttle';
export default {
async install (Vue, options) {
// 指令
Vue.directive('auth', directiveAuth);
Vue.directive('throttle', throttle);
}
}

@ -0,0 +1,140 @@
import axios from 'axios'
import util from '@/libs/util'
import router from '@/router/index'
import Setting from '@/setting'
import store from '@/store'
const service = axios.create({
baseURL: Setting.apiBaseURL,
timeout: 10000000
})
// post请求头
service.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'
// 请求拦截器
service.interceptors.request.use(config => {
let token = util.local.get(Setting.tokenKey)
if(token) config.headers.token = token
return config
},err => {
util.errorMsg({
message: '退出登陆',
onClose: function () {
router.push({name: '/login'})
}
})
return Promise.reject(err)
})
// 响应拦截器
service.interceptors.response.use(
response => {
const res = response.data
if(res.status == 200 || res.status == 10000) {
return Promise.resolve(res).catch(e => {})
}else if(!res.status){
return Promise.resolve(res).catch(e => {})
}else {
util.errorMsg(res.errmessage)
return Promise.reject(res)
}
},
// 服务器状态码不是200的情况
error => {
if (error.response.status) {
switch (error.response.status) {
// 401: 未登录
// 未登录则跳转登录页面,并携带当前页面的路径
// 在登录成功后返回当前页面,这一步需要在登录页操作。
case 401:
util.local.remove(Setting.storeKey)
util.local.remove(Setting.tokenKey)
util.errorMsg('登录过期,请重新登录')
setTimeout(() => {
router.replace({
path: '/login',
query: {
redirect: router.currentRoute.fullPath
}
})
}, 1000)
break
case 500:
util.errorMsg('网络错误')
break
// 403 token过期
// 登录过期对用户进行提示
// 清除本地token和清空vuex中token对象
// 跳转登录页面
case 403:
util.local.remove(Setting.storeKey)
util.local.remove(Setting.tokenKey)
util.errorMsg('登录过期,请重新登录')
// 清除token
// store.commit('loginSuccess', null);
// 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
setTimeout(() => {
router.replace({
path: '/login',
query: {
redirect: router.currentRoute.fullPath
}
})
}, 1000)
break
// 404请求不存在
case 404:
util.errorMsg('网络请求不存在!')
break
// 其他错误,直接抛出错误提示
default:
util.errorMsg(error.response.data.message)
Promise.reject(res)
}
return Promise.reject(error.response)
}
}
);
function get(url, params){
return new Promise((resolve, reject) =>{
service.get(url, {params: params}).then(res => {
resolve(res)
}).catch(err => {
reject(err)
})
})
}
function post(url, params){
return new Promise((resolve, reject) =>{
service.post(url,params).then(res => {
resolve(res)
}).catch(err => {
reject(err.data)
})
})
}
function del(url, params){
return new Promise((resolve, reject) =>{
service.delete(url, {
params
}).then(res => {
resolve(res)
}).catch(err => {
reject(err.data)
})
})
}
function put(url, params){
return new Promise((resolve, reject) =>{
service.put(url, params).then(res => {
resolve(res)
}).catch(err => {
reject(err.data)
})
})
}
export { get,post,del,put }

@ -1,7 +1,11 @@
import Vue from 'vue' /**
* @description 节流指令
* 限制连续快速点击按钮
* 用例<Tag v-throttle>text</Tag>
* */
const preventReClick = Vue.directive('preventReClick', { export default{
inserted: function (el, binding) { inserted (el, binding, vnode) {
el.addEventListener('click', () => { el.addEventListener('click', () => {
if (!el.disabled) { if (!el.disabled) {
el.disabled = true el.disabled = true
@ -11,6 +15,4 @@ const preventReClick = Vue.directive('preventReClick', {
} }
}) })
} }
}); }
export { preventReClick }

@ -1,11 +1,12 @@
import Vue from 'vue'; import Vue from 'vue'
import Router from 'vue-router'; import Router from 'vue-router'
import routes from './routes'; import routes from './routes'
import Setting from '@/setting'
Vue.use(Router); Vue.use(Router)
const createRouter = () => new Router({ const createRouter = () => new Router({
mode: 'hash', mode: Setting.routerMode,
    base: process.env.BASE_URL,     base: process.env.BASE_URL,
scrollBehavior: () => ({ y: 0 }), scrollBehavior: () => ({ y: 0 }),
routes routes

@ -0,0 +1,43 @@
import BasicLayout from '@/layouts/home'
const meta = {}
const pre = 'achievement-'
export default {
path: '/achievement',
name: 'achievement',
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import('@/pages/achievement/list'),
meta: { title: '成绩管理' }
},{
name: `${pre}vir`,
path: `vir`,
component: () => import('@/pages/achievement/vir'),
meta: { title: '成绩管理' }
},{
name: `${pre}teach`,
path: `teach`,
component: () => import('@/pages/achievement/teach'),
meta: { title: '成绩管理' }
},{
name: `${pre}ass`,
path: `ass`,
component: () => import('@/pages/achievement/ass'),
meta: { title: '成绩管理' }
},{
name: `${pre}show`,
path: `show`,
component: () => import('@/pages/achievement/show'),
meta: { title: '实验报告' }
},
]
};

@ -0,0 +1,29 @@
import BasicLayout from '@/layouts/home'
const meta = {}
const pre = 'assessment-'
export default {
path: '/assessment',
name: 'assessment',
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import('@/pages/assessment/list'),
meta: { title: '考核管理' }
},
{
name: `${pre}add`,
path: `add`,
component: () => import('@/pages/assessment/add/index.vue'),
meta: { title: '添加考核' }
},
]
};

@ -0,0 +1,23 @@
import BasicLayout from '@/layouts/home'
const meta = {}
const pre = 'evaluation-'
export default {
path: '/evaluation',
name: 'evaluation',
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import('@/pages/evaluation/list'),
meta: { title: '测评管理' }
},
]
};

@ -0,0 +1,29 @@
import BasicLayout from '@/layouts/home'
const meta = {}
const pre = 'project-'
export default {
path: '/project',
name: 'project',
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import('@/pages/project/list'),
meta: { title: '实验项目管理' }
},
{
name: `${pre}add`,
path: `add`,
component: () => import('@/pages/project/add'),
meta: { title: '新增项目' }
},
]
};

@ -0,0 +1,23 @@
import BasicLayout from '@/layouts/home'
const meta = {}
const pre = 'setting-'
export default {
path: '/setting',
name: 'setting',
redirect: {
name: `${pre}person`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}person`,
path: `person`,
component: () => import('@/pages/setting/person'),
meta: { title: '个人中心' }
},
]
};

@ -0,0 +1,23 @@
import BasicLayout from '@/layouts/home'
const meta = {}
const pre = 'student-'
export default {
path: '/student',
name: 'student',
redirect: {
name: `${pre}list`
},
meta,
component: BasicLayout,
children: [
{
name: `${pre}list`,
path: `list`,
component: () => import('@/pages/student/list'),
meta: { title: '学生管理' }
},
]
};

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

Loading…
Cancel
Save