master
yujialong 4 years ago
commit 107a38012e
  1. 3
      .browserslistrc
  2. 22
      .gitignore
  3. 6
      .prettierrc
  4. 21
      LICENSE
  5. 5
      babel.config.js
  6. 13479
      package-lock.json
  7. 36
      package.json
  8. 5
      postcss.config.js
  9. 17
      public/index.html
  10. BIN
      screenshots/wms1.png
  11. BIN
      screenshots/wms2.png
  12. BIN
      screenshots/wms3.png
  13. 30
      src/App.vue
  14. 28
      src/assets/css/color-dark.css
  15. 4
      src/assets/css/icon.css
  16. 325
      src/assets/css/main.css
  17. 29
      src/assets/css/theme-green/color-green.css
  18. BIN
      src/assets/css/theme-green/fonts/element-icons.ttf
  19. BIN
      src/assets/css/theme-green/fonts/element-icons.woff
  20. 1
      src/assets/css/theme-green/index.css
  21. 539
      src/assets/icon/demo.css
  22. 446
      src/assets/icon/demo_index.html
  23. 71
      src/assets/icon/iconfont.css
  24. BIN
      src/assets/icon/iconfont.eot
  25. 1
      src/assets/icon/iconfont.js
  26. 93
      src/assets/icon/iconfont.json
  27. 62
      src/assets/icon/iconfont.svg
  28. BIN
      src/assets/icon/iconfont.ttf
  29. BIN
      src/assets/icon/iconfont.woff
  30. BIN
      src/assets/icon/iconfont.woff2
  31. BIN
      src/assets/img/icon-xiangyou.png
  32. BIN
      src/assets/img/icon-yigouxuan.png
  33. BIN
      src/assets/img/icon_.png
  34. BIN
      src/assets/img/icon_1.png
  35. BIN
      src/assets/img/images/back_02.png
  36. BIN
      src/assets/img/img.jpg
  37. BIN
      src/assets/img/login-bg.png
  38. BIN
      src/assets/img/login-input.png
  39. BIN
      src/assets/img/logo.png
  40. 103
      src/components/common/Header.vue
  41. 51
      src/components/common/Home.vue
  42. 135
      src/components/common/Sidebar.vue
  43. 186
      src/components/common/Tags.vue
  44. 6
      src/components/common/bus.js
  45. 80
      src/components/common/directives.js
  46. 30
      src/components/common/i18n.js
  47. 56
      src/components/page/403.vue
  48. 56
      src/components/page/404.vue
  49. 205
      src/components/page/Achievement.vue
  50. 547
      src/components/page/AddClass.vue
  51. 432
      src/components/page/AddExperiment.vue
  52. 1063
      src/components/page/AddProject.vue
  53. 218
      src/components/page/Backstage.vue
  54. 425
      src/components/page/Dashboard.vue
  55. 713
      src/components/page/Evaluation.vue
  56. 153
      src/components/page/Experiment.vue
  57. 46
      src/components/page/I18n.vue
  58. 225
      src/components/page/Icon.vue
  59. 191
      src/components/page/Login.vue
  60. 1432
      src/components/page/PersonalCenter.vue
  61. 543
      src/components/page/Program.vue
  62. 962
      src/components/page/ProgramOptions.vue
  63. 370
      src/components/page/Project.vue
  64. 280
      src/components/page/Report.vue
  65. 461
      src/components/page/ReportConfig.vue
  66. 421
      src/components/page/Role.vue
  67. 361
      src/components/page/ShowExperiment.vue
  68. 831
      src/components/page/Staff.vue
  69. 357
      src/components/page/StaffSide.vue
  70. 250
      src/components/page/Stafftree.vue
  71. 538
      src/components/page/Student.vue
  72. 103
      src/components/page/System.vue
  73. 307
      src/components/page/TeacherComment.vue
  74. 350
      src/components/page/User.vue
  75. 28
      src/config/index.js
  76. 81
      src/main.js
  77. 150
      src/router/index.js
  78. 72
      src/store/index.js
  79. 16
      src/store/preventReClick.js
  80. 16
      src/util/rem.js
  81. 130
      src/utils/api.js
  82. 228
      src/utils/core.js
  83. 438
      src/utils/http.js
  84. 37
      vue.config.js

@ -0,0 +1,3 @@
> 1%
last 2 versions
not ie <= 8

22
.gitignore vendored

@ -0,0 +1,22 @@
.DS_Store
node_modules
/dist
example.html
favicon.ico
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*

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

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016-2019 vue-manage-system
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/app'
]
}

13479
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,36 @@
{
"name": "vue-manage-system",
"version": "4.2.0",
"private": true,
"scripts": {
"dev": "npm run serve",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"axios": "^0.18.0",
"babel-polyfill": "^6.26.0",
"element-theme": "^2.0.1",
"element-ui": "^2.13.0",
"lodash": "^4.17.20",
"mavon-editor": "^2.6.17",
"postcss-px2rem": "^0.3.0",
"px2rem-loader": "^0.1.9",
"vue": "^2.6.10",
"vue-cropperjs": "^3.0.0",
"vue-i18n": "^8.10.0",
"vue-quill-editor": "^3.0.6",
"vue-router": "^3.0.3",
"vue-schart": "^2.0.0",
"vuedraggable": "^2.17.0",
"vuex": "^3.1.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.9.0",
"@vue/cli-service": "^3.9.0",
"element-theme-chalk": "^2.13.0",
"node-sass": "^4.14.1",
"sass-loader": "^8.0.0",
"vue-template-compiler": "^2.6.10"
}
}

@ -0,0 +1,5 @@
module.exports = {
plugins: {
autoprefixer: {}
}
}

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<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">
<link rel="stylesheet" href="//at.alicdn.com/t/font_830376_qzecyukz0s.css">
<title>四川大学虚拟仿真系统</title>
</head>
<body>
<noscript>
<strong>We're sorry but vms doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

@ -0,0 +1,30 @@
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<script>
export default {
name: 'App',
created () {
//sessionStorage
if (sessionStorage.getItem("cd_server_store") ) {
this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(sessionStorage.getItem("cd_server_store"))))
}
//vuexsessionStorage
window.addEventListener("beforeunload",()=>{
sessionStorage.setItem("cd_server_store",JSON.stringify(this.$store.state))
})
}
}
</script>
<style>
@import "./assets/css/main.css";
/* @import "./assets/css/color-dark.css"; */
/*深色主题*/
@import "./assets/css/theme-green/color-green.css";
/* 浅绿色主题 */
</style>

@ -0,0 +1,28 @@
.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);
}

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

@ -0,0 +1,325 @@
* {
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 {
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;
}

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

@ -0,0 +1,539 @@
/* Logo 字体 */
@font-face {
font-family: "iconfont logo";
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
}
.logo {
font-family: "iconfont logo";
font-size: 160px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* tabs */
.nav-tabs {
position: relative;
}
.nav-tabs .nav-more {
position: absolute;
right: 0;
bottom: 0;
height: 42px;
line-height: 42px;
color: #666;
}
#tabs {
border-bottom: 1px solid #eee;
}
#tabs li {
cursor: pointer;
width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 16px;
border-bottom: 2px solid transparent;
position: relative;
z-index: 1;
margin-bottom: -1px;
color: #666;
}
#tabs .active {
border-bottom-color: #f00;
color: #222;
}
.tab-container .content {
display: none;
}
/* 页面布局 */
.main {
padding: 30px 100px;
width: 960px;
margin: 0 auto;
}
.main .logo {
color: #333;
text-align: left;
margin-bottom: 30px;
line-height: 1;
height: 110px;
margin-top: -50px;
overflow: hidden;
*zoom: 1;
}
.main .logo a {
font-size: 160px;
color: #333;
}
.helps {
margin-top: 40px;
}
.helps pre {
padding: 20px;
margin: 10px 0;
border: solid 1px #e7e1cd;
background-color: #fffdef;
overflow: auto;
}
.icon_lists {
width: 100% !important;
overflow: hidden;
*zoom: 1;
}
.icon_lists li {
width: 100px;
margin-bottom: 10px;
margin-right: 20px;
text-align: center;
list-style: none !important;
cursor: default;
}
.icon_lists li .code-name {
line-height: 1.2;
}
.icon_lists .icon {
display: block;
height: 100px;
line-height: 100px;
font-size: 42px;
margin: 10px auto;
color: #333;
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
-moz-transition: font-size 0.25s linear, width 0.25s linear;
transition: font-size 0.25s linear, width 0.25s linear;
}
.icon_lists .icon:hover {
font-size: 100px;
}
.icon_lists .svg-icon {
/* 通过设置 font-size 来改变图标大小 */
width: 1em;
/* 图标和文字相邻时,垂直对齐 */
vertical-align: -0.15em;
/* 通过设置 color 来改变 SVG 的颜色/fill */
fill: currentColor;
/* path stroke 溢出 viewBox 部分在 IE 下会显示
normalize.css 中也包含这行 */
overflow: hidden;
}
.icon_lists li .name,
.icon_lists li .code-name {
color: #666;
}
/* markdown 样式 */
.markdown {
color: #666;
font-size: 14px;
line-height: 1.8;
}
.highlight {
line-height: 1.5;
}
.markdown img {
vertical-align: middle;
max-width: 100%;
}
.markdown h1 {
color: #404040;
font-weight: 500;
line-height: 40px;
margin-bottom: 24px;
}
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
color: #404040;
margin: 1.6em 0 0.6em 0;
font-weight: 500;
clear: both;
}
.markdown h1 {
font-size: 28px;
}
.markdown h2 {
font-size: 22px;
}
.markdown h3 {
font-size: 16px;
}
.markdown h4 {
font-size: 14px;
}
.markdown h5 {
font-size: 12px;
}
.markdown h6 {
font-size: 12px;
}
.markdown hr {
height: 1px;
border: 0;
background: #e9e9e9;
margin: 16px 0;
clear: both;
}
.markdown p {
margin: 1em 0;
}
.markdown>p,
.markdown>blockquote,
.markdown>.highlight,
.markdown>ol,
.markdown>ul {
width: 80%;
}
.markdown ul>li {
list-style: circle;
}
.markdown>ul li,
.markdown blockquote ul>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown>ul li p,
.markdown>ol li p {
margin: 0.6em 0;
}
.markdown ol>li {
list-style: decimal;
}
.markdown>ol li,
.markdown blockquote ol>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown code {
margin: 0 3px;
padding: 0 5px;
background: #eee;
border-radius: 3px;
}
.markdown strong,
.markdown b {
font-weight: 600;
}
.markdown>table {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
border: 1px solid #e9e9e9;
width: 95%;
margin-bottom: 24px;
}
.markdown>table th {
white-space: nowrap;
color: #333;
font-weight: 600;
}
.markdown>table th,
.markdown>table td {
border: 1px solid #e9e9e9;
padding: 8px 16px;
text-align: left;
}
.markdown>table th {
background: #F7F7F7;
}
.markdown blockquote {
font-size: 90%;
color: #999;
border-left: 4px solid #e9e9e9;
padding-left: 0.8em;
margin: 1em 0;
}
.markdown blockquote p {
margin: 0;
}
.markdown .anchor {
opacity: 0;
transition: opacity 0.3s ease;
margin-left: 8px;
}
.markdown .waiting {
color: #ccc;
}
.markdown h1:hover .anchor,
.markdown h2:hover .anchor,
.markdown h3:hover .anchor,
.markdown h4:hover .anchor,
.markdown h5:hover .anchor,
.markdown h6:hover .anchor {
opacity: 1;
display: inline-block;
}
.markdown>br,
.markdown>p>br {
clear: both;
}
.hljs {
display: block;
background: white;
padding: 0.5em;
color: #333333;
overflow-x: auto;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-string,
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #a71d5d;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #795da3;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}
/* 代码高亮 */
/* PrismJS 1.15.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre)>code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre)>code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}

@ -0,0 +1,446 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>IconFont Demo</title>
<link rel="shortcut icon" href="https://img.alicdn.com/tps/i4/TB1_oz6GVXXXXaFXpXXJDFnIXXX-64-64.ico" type="image/x-icon"/>
<link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
<link rel="stylesheet" href="demo.css">
<link rel="stylesheet" href="iconfont.css">
<script src="iconfont.js"></script>
<!-- jQuery -->
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/7bfddb60-08e8-11e9-9b04-53e73bb6408b.js"></script>
<!-- 代码高亮 -->
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/a3f714d0-08e6-11e9-8a15-ebf944d7534c.js"></script>
</head>
<body>
<div class="main">
<h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank">&#xe86b;</a></h1>
<div class="nav-tabs">
<ul id="tabs" class="dib-box">
<li class="dib active"><span>Unicode</span></li>
<li class="dib"><span>Font class</span></li>
<li class="dib"><span>Symbol</span></li>
</ul>
<a href="https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=1540265" target="_blank" class="nav-more">查看项目</a>
</div>
<div class="tab-container">
<div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe63d;</span>
<div class="name">已勾选32</div>
<div class="code-name">&amp;#xe63d;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe63e;</span>
<div class="name">未勾选32</div>
<div class="code-name">&amp;#xe63e;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe64a;</span>
<div class="name">未勾选40</div>
<div class="code-name">&amp;#xe64a;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe64b;</span>
<div class="name">已勾选40</div>
<div class="code-name">&amp;#xe64b;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe626;</span>
<div class="name">实 向右箭头-01</div>
<div class="code-name">&amp;#xe626;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe625;</span>
<div class="name">实 向下箭头-01</div>
<div class="code-name">&amp;#xe625;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe72d;</span>
<div class="name">加号-填充</div>
<div class="code-name">&amp;#xe72d;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe769;</span>
<div class="name">42指向上、上箭头</div>
<div class="code-name">&amp;#xe769;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe76b;</span>
<div class="name">44指向下、下箭头</div>
<div class="code-name">&amp;#xe76b;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe6e9;</span>
<div class="name">群蜂删除-充</div>
<div class="code-name">&amp;#xe6e9;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe614;</span>
<div class="name">qq</div>
<div class="code-name">&amp;#xe614;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe68a;</span>
<div class="name">微信-36</div>
<div class="code-name">&amp;#xe68a;</div>
</li>
</ul>
<div class="article markdown">
<h2 id="unicode-">Unicode 引用</h2>
<hr>
<p>Unicode 是字体在网页端最原始的应用方式,特点是:</p>
<ul>
<li>兼容性最好,支持 IE6+,及所有现代浏览器。</li>
<li>支持按字体的方式去动态调整图标大小,颜色等等。</li>
<li>但是因为是字体,所以不支持多色。只能使用平台里单色的图标,就算项目里有多色图标也会自动去色。</li>
</ul>
<blockquote>
<p>注意:新版 iconfont 支持多色图标,这些多色图标在 Unicode 模式下将不能使用,如果有需求建议使用symbol 的引用方式</p>
</blockquote>
<p>Unicode 使用步骤如下:</p>
<h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</code></h3>
<pre><code class="language-css"
>@font-face {
font-family: 'iconfont';
src: url('iconfont.eot');
src: url('iconfont.eot?#iefix') format('embedded-opentype'),
url('iconfont.woff2') format('woff2'),
url('iconfont.woff') format('woff'),
url('iconfont.ttf') format('truetype'),
url('iconfont.svg#iconfont') format('svg');
}
</code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
<pre><code class="language-css"
>.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
</code></pre>
<h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
<pre>
<code class="language-html"
>&lt;span class="iconfont"&gt;&amp;#x33;&lt;/span&gt;
</code></pre>
<blockquote>
<p>"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
</blockquote>
</div>
</div>
<div class="content font-class">
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-yigouxuan"></span>
<div class="name">
已勾选32
</div>
<div class="code-name">.icon-yigouxuan
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-weigouxuan"></span>
<div class="name">
未勾选32
</div>
<div class="code-name">.icon-weigouxuan
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-weigouxuan1"></span>
<div class="name">
未勾选40
</div>
<div class="code-name">.icon-weigouxuan1
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-yigouxuan1"></span>
<div class="name">
已勾选40
</div>
<div class="code-name">.icon-yigouxuan1
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-shixiangyoujiantou-"></span>
<div class="name">
实 向右箭头-01
</div>
<div class="code-name">.icon-shixiangyoujiantou-
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-shixiangxiajiantou-"></span>
<div class="name">
实 向下箭头-01
</div>
<div class="code-name">.icon-shixiangxiajiantou-
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-jiahao"></span>
<div class="name">
加号-填充
</div>
<div class="code-name">.icon-jiahao
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-up"></span>
<div class="name">
42指向上、上箭头
</div>
<div class="code-name">.icon-up
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-down"></span>
<div class="name">
44指向下、下箭头
</div>
<div class="code-name">.icon-down
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-delete"></span>
<div class="name">
群蜂删除-充
</div>
<div class="code-name">.icon-delete
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-qq"></span>
<div class="name">
qq
</div>
<div class="code-name">.icon-qq
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-weixin"></span>
<div class="name">
微信-36
</div>
<div class="code-name">.icon-weixin
</div>
</li>
</ul>
<div class="article markdown">
<h2 id="font-class-">font-class 引用</h2>
<hr>
<p>font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。</p>
<p>与 Unicode 使用方式相比,具有如下特点:</p>
<ul>
<li>兼容性良好,支持 IE8+,及所有现代浏览器。</li>
<li>相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。</li>
<li>因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。</li>
<li>不过因为本质上还是使用的字体,所以多色图标还是不支持的。</li>
</ul>
<p>使用步骤如下:</p>
<h3 id="-fontclass-">第一步:引入项目下面生成的 fontclass 代码:</h3>
<pre><code class="language-html">&lt;link rel="stylesheet" href="./iconfont.css"&gt;
</code></pre>
<h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3>
<pre><code class="language-html">&lt;span class="iconfont icon-xxx"&gt;&lt;/span&gt;
</code></pre>
<blockquote>
<p>"
iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
</blockquote>
</div>
</div>
<div class="content symbol">
<ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-yigouxuan"></use>
</svg>
<div class="name">已勾选32</div>
<div class="code-name">#icon-yigouxuan</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-weigouxuan"></use>
</svg>
<div class="name">未勾选32</div>
<div class="code-name">#icon-weigouxuan</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-weigouxuan1"></use>
</svg>
<div class="name">未勾选40</div>
<div class="code-name">#icon-weigouxuan1</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-yigouxuan1"></use>
</svg>
<div class="name">已勾选40</div>
<div class="code-name">#icon-yigouxuan1</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-shixiangyoujiantou-"></use>
</svg>
<div class="name">实 向右箭头-01</div>
<div class="code-name">#icon-shixiangyoujiantou-</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-shixiangxiajiantou-"></use>
</svg>
<div class="name">实 向下箭头-01</div>
<div class="code-name">#icon-shixiangxiajiantou-</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-jiahao"></use>
</svg>
<div class="name">加号-填充</div>
<div class="code-name">#icon-jiahao</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-up"></use>
</svg>
<div class="name">42指向上、上箭头</div>
<div class="code-name">#icon-up</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-down"></use>
</svg>
<div class="name">44指向下、下箭头</div>
<div class="code-name">#icon-down</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-delete"></use>
</svg>
<div class="name">群蜂删除-充</div>
<div class="code-name">#icon-delete</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-qq"></use>
</svg>
<div class="name">qq</div>
<div class="code-name">#icon-qq</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-weixin"></use>
</svg>
<div class="name">微信-36</div>
<div class="code-name">#icon-weixin</div>
</li>
</ul>
<div class="article markdown">
<h2 id="symbol-">Symbol 引用</h2>
<hr>
<p>这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:</p>
<ul>
<li>支持多色图标了,不再受单色限制。</li>
<li>通过一些技巧,支持像字体那样,通过 <code>font-size</code>, <code>color</code> 来调整样式。</li>
<li>兼容性较差,支持 IE9+,及现代浏览器。</li>
<li>浏览器渲染 SVG 的性能一般,还不如 png。</li>
</ul>
<p>使用步骤如下:</p>
<h3 id="-symbol-">第一步:引入项目下面生成的 symbol 代码:</h3>
<pre><code class="language-html">&lt;script src="./iconfont.js"&gt;&lt;/script&gt;
</code></pre>
<h3 id="-css-">第二步:加入通用 CSS 代码(引入一次就行):</h3>
<pre><code class="language-html">&lt;style&gt;
.icon {
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
&lt;/style&gt;
</code></pre>
<h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3>
<pre><code class="language-html">&lt;svg class="icon" aria-hidden="true"&gt;
&lt;use xlink:href="#icon-xxx"&gt;&lt;/use&gt;
&lt;/svg&gt;
</code></pre>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('.tab-container .content:first').show()
$('#tabs li').click(function (e) {
var tabContent = $('.tab-container .content')
var index = $(this).index()
if ($(this).hasClass('active')) {
return
} else {
$('#tabs li').removeClass('active')
$(this).addClass('active')
tabContent.hide().eq(index).fadeIn()
}
})
})
</script>
</body>
</html>

@ -0,0 +1,71 @@
@font-face {font-family: "iconfont";
src: url('iconfont.eot?t=1589437921018'); /* IE9 */
src: url('iconfont.eot?t=1589437921018#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAdgAAsAAAAADwwAAAcTAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCESgqOeIt2ATYCJAM0CxwABCAFhG0HgTMbpQxRlHBSFNlX2JThXqSJ4cz0aLyxzNkVgYOP2N97wQhUeQbPDZA1QByDeHha+9+5M7PrD1FpdI8mCSqJLulDJPFDxCQTvUQS6Qtka3ukU0/kuK8wfBBwMr1kmeTIb8hUohVh6lTeCHDCrRPPf5v6f+sQfS+QqgmpiZLNw+ZI6zMXZGL3nXY47elJFnjALaE4zjzyjJN773yuzM/7H4oZ9NV+v/q1g1ddvP1QmE5JlPRM7uAv5klMk0vWTBWTLpoJEUIja6hWSkNhOklN/ds4n0BvhyLMuZ6hKdArLC1Q4a4iG0Gfi1JaHEMbXtfsW8S8SpsepzuAJ+HLx28hoSepMmvby3e6LdC2EN2eV0ykW36MR/MlQFiJjGNAEej7WvtLgB6aM6evXtwH1glnTloW1snRYnBhky+LxyuL9glaGNmaDbRsJYR1tl+seImrgUGtEtLc//GMeo1WR9QYfUSrp7nohWgXDRrJBqpBcoAqkGagAGkBSiADQBlkEKiAbAI/N/mCYHoWi1HDEgWoBbGjlg7M/OpbgEMgnUf0fxab8kjK0tvq8cZ6/dpKwk4bNsXFx4bHR4RHcty4LVnR4xp/2TFxDN42tgefhUpEMeeqppXCU50JyT/gkVCD+EiEgl56LOkMN+6cAfyKs3dvomHU7fvnq96Uc/duIXMMqWmhNRoax1m8jNWfPorp2jlqumvHrolfe/2TcuIPCt3K589dhUNiT5OSEh4KoM9Jp1vK2GMnFjDdyaeFMrd06ki1gn9CmEz3OErpebmp+GzyAN+lMLw6dwkKh6Ve5dOnzp4W0+Y25TTfhHB10isXpxIB5GHDKcggnof+NCpCD+okAFyTPNGuRVgahmhLjZo1rnqnMlpD0ORJSluuY6jT+gPWHtaIeDKOaoradNDPruOQzulPGcBtz0C2YdbLrSFPIMGTrcNRDGC3YnJOm1JLceYK2sCWY5lqxICXIEU0gki2nkPFUteBwoqLMyTdKE7ZlOzE3yHfdSyOU2shl8RoxPJlx1bQ6C0Li3DLg+Sdi+c5evEkhtF3rBdfXpe0IiNcfW27+x6u5U4vs8zZZdu1R7Gblyc6AV9OB4Xp65HRDqcvw0Pi1DGbddntOKzYgkbhXJq+Y4bRVqszl746KdRPFV5FxSUb6XmKomd1yCb0nJbpz+aOIZskx0phXx8sHfNKyRjPsM8LGU/xJ9Qrv2JugdVBkBg/ZpUIDvpN0jfHD550XPKNDgkKEZ46l4dwq0sOxIecJlX2pxxA8GTwkCGMFqxVFf5PRZplCky9uCIQL/s/RFabTYZNkhtkQXFR28vKXwKUP5rZbFg+s3VAFTu5dBZG4G07t5tHuM2cFirh2BisrHKYoE8lzO1h/LkwjSD+VZF0qs1hQVK+d0xHOLN80q4B/P9utxQDmGt4DaEKE6Lc5lnI6VxDf/35owQHCAuKw95VG6l1bvXPY3J1slpepPBXdCx8EM+ubbd2tV48b2UtWLtYb89PZhvg2jsq5+zkBdIVVTFHfhEwNv0CxNiT02LKVxGSus1dt9VsXDZulogOJB1AkGQVg4e833uzaWatx7bPrLKyhBeBqlC3xGqNoe3MVQHmDmBs4jm+xFjW/sjcAgOiPOFawwe3bUeTa20vGNZgbV6tCtL/qEL/fmiFLjqCCDpZdQpkdKgx6tSuzlCdqnrMFsLMhWn9sKH4ezmjmvpp9Selw9oCS0Vtcbox4f967yYpc1lNwUzPAUT3N0R32yz0bof5Wblw2jzkuw4VkWFptzoKckHRUwszvHJS8IgkAfys2IvKr/LtZBa1LzvfHBmFD6/V9enLD7LLJD2tz7n3E8BkFcwVyA/DL8P0fCpXAdLntBfy9tQCpuUP2QBAWkwyYccYGYFWWc/HS8Of6pVNf1r8p8n48bn+wPLzm5gyWoneAh3ivzATiiRKljoz8hQTN3S0itSojpnbgvjFod7uBf2Rtsa7dej63gKVRdenkDS2Q9baZyzWY1AZnIBa6yT0juo9eLCWhhOlwxFrCYRVjkKywhfIVrlrLNa3UNngB9RWBQe9mxF1zMGBUFCnRoyUWLBpCStm1SU5sRRFFSeI7HUYtawUeswQzaNk4PKSsmJBL3ERbY4dPD65glIJS5rqxD3kYsThULFbU23ETEuslLobSkuluh1LzKoTkLM0hBH1A1pgJku2CjOVizQ+hUrPP4GQeTkYaS0tarYzCI2HMnusXImyHsZe3dWrxb1U9/CRVaBMggS79TUqJ6yHSSAcdq4Kc9evZUOYUSWsI7LdGpQy7Ul99ZL1qfObT4CedX+zSJGjRBV1NNFGF30MMcYsVugeKLLqDXiNLuQnSQjRvRwtrRzlsSoBxeiSl1SvLVQoF1FcZj0Jqi46odWosl43b1H9Lp2FOAgl7OKibs6cgOICAA==') format('woff2'),
url('iconfont.woff?t=1589437921018') format('woff'),
url('iconfont.ttf?t=1589437921018') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('iconfont.svg?t=1589437921018#iconfont') format('svg'); /* iOS 4.1- */
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-yigouxuan:before {
content: "\e63d";
}
.icon-weigouxuan:before {
content: "\e63e";
}
.icon-weigouxuan1:before {
content: "\e64a";
}
.icon-yigouxuan1:before {
content: "\e64b";
}
.icon-shixiangyoujiantou-:before {
content: "\e626";
}
.icon-shixiangxiajiantou-:before {
content: "\e625";
}
.icon-jiahao:before {
content: "\e72d";
}
.icon-up:before {
content: "\e769";
}
.icon-down:before {
content: "\e76b";
}
.icon-delete:before {
content: "\e6e9";
}
.icon-qq:before {
content: "\e614";
font-size: 60px;
color: #22aaf8;
margin-left: 32px;
}
.icon-weixin:before {
content: "\e68a";
font-size: 60px;
color: #10b747;
margin-right: 32px;
}

Binary file not shown.

File diff suppressed because one or more lines are too long

@ -0,0 +1,93 @@
{
"id": "1540265",
"name": "education",
"font_family": "iconfont",
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "2716513",
"name": "已勾选32",
"font_class": "yigouxuan",
"unicode": "e63d",
"unicode_decimal": 58941
},
{
"icon_id": "2716516",
"name": "未勾选32",
"font_class": "weigouxuan",
"unicode": "e63e",
"unicode_decimal": 58942
},
{
"icon_id": "2892929",
"name": "未勾选40",
"font_class": "weigouxuan1",
"unicode": "e64a",
"unicode_decimal": 58954
},
{
"icon_id": "2892954",
"name": "已勾选40",
"font_class": "yigouxuan1",
"unicode": "e64b",
"unicode_decimal": 58955
},
{
"icon_id": "5979965",
"name": "实 向右箭头-01",
"font_class": "shixiangyoujiantou-",
"unicode": "e626",
"unicode_decimal": 58918
},
{
"icon_id": "5979966",
"name": "实 向下箭头-01",
"font_class": "shixiangxiajiantou-",
"unicode": "e625",
"unicode_decimal": 58917
},
{
"icon_id": "8349103",
"name": "加号-填充",
"font_class": "jiahao",
"unicode": "e72d",
"unicode_decimal": 59181
},
{
"icon_id": "6129078",
"name": "42指向上、上箭头",
"font_class": "up",
"unicode": "e769",
"unicode_decimal": 59241
},
{
"icon_id": "6129081",
"name": "44指向下、下箭头",
"font_class": "down",
"unicode": "e76b",
"unicode_decimal": 59243
},
{
"icon_id": "410692",
"name": "群蜂删除-充",
"font_class": "delete",
"unicode": "e6e9",
"unicode_decimal": 59113
},
{
"icon_id": "468193",
"name": "qq",
"font_class": "qq",
"unicode": "e614",
"unicode_decimal": 58900
},
{
"icon_id": "7009153",
"name": "微信-36",
"font_class": "weixin",
"unicode": "e68a",
"unicode_decimal": 59018
}
]
}

@ -0,0 +1,62 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<!--
2013-9-30: Created.
-->
<svg>
<metadata>
Created by iconfont
</metadata>
<defs>
<font id="iconfont" horiz-adv-x="1024" >
<font-face
font-family="iconfont"
font-weight="500"
font-stretch="normal"
units-per-em="1024"
ascent="896"
descent="-128"
/>
<missing-glyph />
<glyph glyph-name="yigouxuan" unicode="&#58941;" d="M196.923077 896h630.153846a196.923077 196.923077 0 0 0 196.923077-196.923077v-630.153846a196.923077 196.923077 0 0 0-196.923077-196.923077H196.923077a196.923077 196.923077 0 0 0-196.923077 196.923077V699.076923a196.923077 196.923077 0 0 0 196.923077 196.923077z m0-78.769231a118.153846 118.153846 0 0 1-118.153846-118.153846v-630.153846a118.153846 118.153846 0 0 1 118.153846-118.153846h630.153846a118.153846 118.153846 0 0 1 118.153846 118.153846V699.076923a118.153846 118.153846 0 0 1-118.153846 118.153846H196.923077z m584.900923-258.205538a36.509538 36.509538 0 0 0 1.260308-51.633231l-299.480616-313.107692c-0.118154-0.157538-0.393846-0.236308-0.630154-0.472616l-0.393846-0.551384c-2.166154-2.126769-4.726154-3.229538-7.207384-4.726154-1.575385-0.866462-2.796308-2.166154-4.411077-2.835692a35.800615 35.800615 0 0 0-27.490462-0.07877c-1.260308 0.512-2.284308 1.614769-3.544615 2.284308-2.756923 1.457231-5.592615 2.835692-8.034462 5.12-0.196923 0.157538-0.275692 0.433231-0.512 0.669538-0.196923 0.118154-0.393846 0.196923-0.551384 0.354462l-150.843077 156.593231a36.430769 36.430769 0 0 0 0.945231 51.633231 36.391385 36.391385 0 0 0 51.63323-0.945231l124.455385-129.102769 273.092923 285.61723a36.548923 36.548923 0 0 0 51.712 1.181539z" horiz-adv-x="1024" />
<glyph glyph-name="weigouxuan" unicode="&#58942;" d="M196.923077 817.230769a118.153846 118.153846 0 0 1-118.153846-118.153846v-630.153846a118.153846 118.153846 0 0 1 118.153846-118.153846h630.153846a118.153846 118.153846 0 0 1 118.153846 118.153846V699.076923a118.153846 118.153846 0 0 1-118.153846 118.153846H196.923077z m0 78.769231h630.153846a196.923077 196.923077 0 0 0 196.923077-196.923077v-630.153846a196.923077 196.923077 0 0 0-196.923077-196.923077H196.923077a196.923077 196.923077 0 0 0-196.923077 196.923077V699.076923a196.923077 196.923077 0 0 0 196.923077 196.923077z" horiz-adv-x="1024" />
<glyph glyph-name="weigouxuan1" unicode="&#58954;" d="M256 768a128 128 0 0 1-128-128v-512a128 128 0 0 1 128-128h512a128 128 0 0 1 128 128V640a128 128 0 0 1-128 128H256z m0 51.2h512a179.2 179.2 0 0 0 179.2-179.2v-512a179.2 179.2 0 0 0-179.2-179.2H256a179.2 179.2 0 0 0-179.2 179.2V640a179.2 179.2 0 0 0 179.2 179.2z" horiz-adv-x="1024" />
<glyph glyph-name="yigouxuan1" unicode="&#58955;" d="M796.912941 598.437647L407.491765 203.294118l-156.611765 172.272941a30.177882 30.177882 0 0 1-44.574118-40.658824L361.411765 161.430588a60.235294 60.235294 0 0 1 85.232941-3.915294l2.409412 2.409412 390.927058 396.348235a30.117647 30.117647 0 1 1-43.068235 42.164706zM813.176471 896H210.823529a210.823529 210.823529 0 0 1-210.823529-210.823529v-602.352942a210.823529 210.823529 0 0 1 210.823529-210.823529h602.352942a210.823529 210.823529 0 0 1 210.823529 210.823529V685.176471a210.823529 210.823529 0 0 1-210.823529 210.823529z m150.588235-813.176471a150.588235 150.588235 0 0 0-150.588235-150.588235H210.823529a150.588235 150.588235 0 0 0-150.588235 150.588235V685.176471a150.588235 150.588235 0 0 0 150.588235 150.588235h602.352942a150.588235 150.588235 0 0 0 150.588235-150.588235z" horiz-adv-x="1024" />
<glyph glyph-name="shixiangyoujiantou-" unicode="&#58918;" d="M701.44 384L322.56 99.413V668.587L701.44 384z" horiz-adv-x="1024" />
<glyph glyph-name="shixiangxiajiantou-" unicode="&#58917;" d="M512 194.56L227.413 573.44h569.174L512 194.56z" horiz-adv-x="1024" />
<glyph glyph-name="jiahao" unicode="&#59181;" d="M512 864C246.4 864 32 649.6 32 384s214.4-480 480-480 480 214.4 480 480S777.6 864 512 864z m256-512h-224v-224c0-19.2-12.8-32-32-32s-32 12.8-32 32v224H256c-19.2 0-32 12.8-32 32s12.8 32 32 32h224V640c0 19.2 12.8 32 32 32s32-12.8 32-32v-224h224c19.2 0 32-12.8 32-32s-12.8-32-32-32z" horiz-adv-x="1024" />
<glyph glyph-name="up" unicode="&#59241;" d="M508.4 445.9l1.8 1.8-1.8-1.8zM508.2 447.9l2.2-2.2c-0.7 0.8-1.4 1.5-2.2 2.2zM511.1 485l1.8-1.8-1.8 1.8zM510.9 483l2.2 2.2c-0.8-0.7-1.5-1.4-2.2-2.2zM544 521.3v-336c0-17.6-14.4-32-32-32s-32 14.4-32 32v336c0 17.6 14.4 32 32 32s32-14.4 32-32zM511.9 614.7c-8.3 0-15.8-3.1-21.5-8.3l-2.2-2.2-21.5-21.5L291 407c-12.4-12.4-12.4-32.8 0-45.3 12.4-12.4 32.8-12.4 45.3 0L512 537.5l175.8-175.7c12.4-12.4 32.8-12.4 45.3 0 12.4 12.4 12.4 32.8-0.1 45.2L557.3 582.7l-21.8 21.8-1.8 1.8c-5.7 5.3-13.4 8.5-21.8 8.4z" horiz-adv-x="1024" />
<glyph glyph-name="down" unicode="&#59243;" d="M515.6 322.1l-1.8-1.8 1.8 1.8zM515.8 320.1l-2.2 2.2c0.7-0.8 1.4-1.5 2.2-2.2zM512.9 283l-1.8 1.8 1.8-1.8zM513.1 285l-2.2-2.2c0.8 0.7 1.5 1.4 2.2 2.2zM480 246.70000000000005v336c0 17.6 14.4 32 32 32s32-14.4 32-32v-336c0-17.6-14.4-32-32-32s-32 14.4-32 32zM512.1 153.29999999999995c8.3 0 15.8 3.1 21.5 8.3l2.2 2.2 21.5 21.5L733 361c12.4 12.4 12.4 32.8 0 45.3-12.4 12.4-32.8 12.4-45.3 0L512 230.5 336.2 406.2c-12.4 12.4-32.8 12.4-45.3 0-12.4-12.4-12.4-32.8 0.1-45.2l175.7-175.7 21.8-21.8 1.8-1.8c5.7-5.3 13.4-8.5 21.8-8.4z" horiz-adv-x="1024" />
<glyph glyph-name="delete" unicode="&#59113;" d="M512.019034 896C229.689856 896 0 666.310144 0 383.98096599999997c0-282.306337 229.689856-511.980966 512.019034-511.980966 282.321564 0 512.01142 229.67463 512.01142 511.980966C1024.030454 666.310144 794.340597 896 512.019034 896zM713.257467 174.96921199999997c-0.007613-22.109428-17.92965-40.107599-39.955331-40.107599L352.936215 134.86161200000004c-22.02568 0-39.940104 17.990558-39.940104 40.107599L312.996111 493.911419c0 7.704801 6.265861 13.978275 13.978275 13.978275 7.704801 0 13.970661-6.273474 13.970661-13.978275l0-318.942208c0-6.70744 5.382702-12.158663 11.991167-12.158663l320.365921 0c6.608465 0 11.991167 5.451223 11.991167 12.158663L685.293303 493.911419c0 7.704801 6.265861 13.978275 13.978275 13.978275s13.978275-6.273474 13.978275-13.978275L713.249853 174.96921199999997zM431.956104 216.02087700000004L431.956104 493.911419c0 7.704801 6.265861 13.978275 13.970661 13.978275 7.712414 0 13.978275-6.273474 13.978275-13.978275l0-277.882928c0-7.712414-6.265861-13.978275-13.978275-13.978275C438.229578 202.05021599999998 431.956104 208.31607699999995 431.956104 216.02087700000004zM566.340924 216.02087700000004L566.340924 493.911419c0 7.704801 6.265861 13.978275 13.978275 13.978275 7.704801 0 13.970661-6.273474 13.970661-13.978275l0-277.882928c0-7.712414-6.265861-13.978275-13.970661-13.978275C572.606785 202.05021599999998 566.340924 208.31607699999995 566.340924 216.02087700000004zM762.059614 549.002268L615.554197 549.002268c-3.730585 0-7.240381 1.454167-9.882244 4.09603l-52.08354 52.08354L471.987569 605.181838l-62.17896-52.844884c-2.497208-2.139377-5.717693-3.334687-9.044766-3.334687L261.978453 549.002268c-7.712414 0-13.978275 6.273474-13.978275 13.978275s6.265861 13.978275 13.978275 13.978275l133.653931 0 62.171347 52.844884c2.535275 2.14699 5.748147 3.327073 9.05238 3.327073l92.518517 0c3.730585 0 7.240381-1.454167 9.882244-4.09603l52.08354-52.08354 140.711589 0c7.712414 0 13.978275-6.265861 13.978275-13.970661C776.037889 555.275742 769.764415 549.002268 762.059614 549.002268z" horiz-adv-x="1025" />
<glyph glyph-name="qq" unicode="&#58900;" d="M512-128C229.226667-128 0 101.22666700000002 0 384 0 666.773333 229.226667 896 512 896 794.773333 896 1024 666.773333 1024 384 1024 101.22666700000002 794.773333-128 512-128ZM693.333333 437.333333C689.024 457.365333 682.666667 469.333333 682.666667 469.333333 682.666667 469.333333 682.944 498.666667 650.666667 565.333333 618.389333 632 522.666667 640 522.666667 640L512 640C512 640 416.277333 632 384 565.333333 351.722667 498.666667 352 469.333333 352 469.333333 352 469.333333 345.642667 457.365333 341.333333 437.333333 337.024 417.301333 341.333333 405.333333 341.333333 405.333333 341.333333 405.333333 286.656 349.578667 288 309.33333300000004 289.344 269.08799999999997 299.221333 243.45600000000002 320 266.66666699999996 340.778667 289.877333 341.333333 288 341.333333 288 341.333333 288 340.970667 270.66666699999996 352 256 363.029333 241.33333300000004 373.333333 234.66666699999996 373.333333 234.66666699999996 373.333333 234.66666699999996 317.386667 206.965333 330.666667 170.66666699999996 343.946667 134.36800000000005 384.874667 127.71199999999999 416 128 447.125333 128.288 512 149.33333300000004 512 149.33333300000004L522.666667 149.33333300000004C522.666667 149.33333300000004 587.541333 128.288 618.666667 128 649.792 127.71199999999999 690.72 134.36800000000005 704 170.66666699999996 717.28 206.965333 661.333333 234.66666699999996 661.333333 234.66666699999996 661.333333 234.66666699999996 671.637333 241.33333300000004 682.666667 256 693.696 270.66666699999996 693.333333 288 693.333333 288 693.333333 288 693.888 289.877333 714.666667 266.66666699999996 735.445333 243.45600000000002 745.322667 269.08799999999997 746.666667 309.33333300000004 748.010667 349.578667 693.333333 405.333333 693.333333 405.333333 693.333333 405.333333 697.642667 417.301333 693.333333 437.333333Z" horiz-adv-x="1024" />
<glyph glyph-name="weixin" unicode="&#59018;" d="M512-128C229.2-128 0 101.20000000000005 0 384S229.2 896 512 896s512-229.2 512-512-229.2-512-512-512z m105.6 582.1c-91.1 0-164.9-63.6-164.9-139.3 0-81.5 73.8-145.1 164.9-148.6 25.8 3.5 50.1 8.7 73.3 18.6l45.8-27.9-9.2 46.4c32.6 26.8 54.9 65.4 54.9 111.4 0.1 75.7-73.7 139.4-164.8 139.4z m-54.9-111.4c-17.2 0-27.5 10.4-27.5 27.9 0 8.2 10.3 18.6 27.5 18.6 8.1 0 18.3-10.4 18.3-18.6 0-17.5-10.2-27.9-18.3-27.9z m109.9 0c-8 0-18.3 10.4-18.3 27.9 0 8.2 10.3 18.6 18.3 18.6 17.2 0 27.5-10.4 27.5-18.6 0-17.5-10.2-27.9-27.5-27.9z m-55 130c2.5-3.1 5.9-3.4 9.2 0-13.7 77.2-94 139.3-192.4 139.3C328.6 612 242 537.1 242 444.9c0-53 28.3-99.9 73.3-130l-18.3-65 64.1 37.1c25.5-5.2 49.4-9.5 73.3-9.3 4-0.2 6.8 0 9.2 0-3 12-5 24.4-9.2 37.1 4.2 85.6 84 154.8 183.2 157.9z m-109.9 55.7c17.2 0 27.5-10.4 27.5-18.6 0-17.5-10.3-27.9-27.5-27.9-8 0-18.3 10.4-18.3 27.9 0 8.2 10.2 18.6 18.3 18.6z m-174.1-18.5c0 8.2 10.3 18.6 18.3 18.6 17.2 0 27.5-10.4 27.5-18.6 0-17.5-10.3-27.9-27.5-27.9-8 0-18.3 10.4-18.3 27.9z" horiz-adv-x="1024" />
</font>
</defs></svg>

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 829 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@ -0,0 +1,103 @@
<template>
<div class="header flex-between">
<div class="logo">
<img src="../../assets/img/logo.png">
</div>
<div class="header-right">
<div class="header-user-con">
<div class="user" @click="toPersonalCenter">
<el-avatar :size="40" :src="circleUrl"></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,
circleUrl: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
};
},
computed: {
username() {
let username = sessionStorage.getItem('cd_server_username');
return username ? username : this.name;
}
},
methods: {
toPersonalCenter(){
this.$router.push('/personalcenter')
},
loginout() {
sessionStorage.removeItem('cd_server_username');
this.$router.push('/login');
}
},
};
</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: 170px;
height: 40px;
margin-left: 20px;
}
.header .logo img{
width: 100%;
height: 100%;
}
.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>

@ -0,0 +1,51 @@
<template>
<div class="wrapper">
<v-head></v-head>
<v-sidebar></v-sidebar>
<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>
</div>
</template>
<script>
import vHead from './Header.vue';
import vSidebar from './Sidebar.vue';
import vTags from './Tags.vue';
import bus from './bus';
export default {
data() {
return {
tagsList: [],
collapse: false
};
},
components: {
vHead,
vSidebar,
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>

@ -0,0 +1,135 @@
<template>
<div>
<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 items">
<template v-if="item.subs">
<el-submenu :index="item.index" :key="item.index">
<template slot="title">
<i :class="item.icon"></i>
<span slot="title">{{ item.title }}</span>
</template>
<template v-for="subItem in item.subs">
<el-submenu
v-if="subItem.subs"
:index="subItem.index"
:key="subItem.index"
>
<template slot="title">{{ subItem.title }}</template>
<el-menu-item
v-for="(threeItem,i) in subItem.subs"
:key="i"
:index="threeItem.index"
>{{ threeItem.title }}</el-menu-item>
</el-submenu>
<el-menu-item
v-else
:index="subItem.index"
:key="subItem.index"
>{{ subItem.title }}</el-menu-item>
</template>
</el-submenu>
</template>
<template v-else>
<el-menu-item :index="item.index" :key="item.index">
<i :class="item.icon"></i>
<span slot="title">{{ item.title }}</span>
</el-menu-item>
</template>
</template>
</el-menu>
</div>
</template>
<script>
import bus from '../common/bus';
export default {
data() {
return {
collapse: false,
items: [
{
icon: 'el-icon-takeaway-box',
index: 'dashboard',
title: '班级教学'
},
{
icon: 'el-icon-collection',
index: 'achievement',
title: '成绩管理'
},
{
icon: 'el-icon-receiving',
index: 'evaluation',
title: '测评管理'
},
{
icon: 'el-icon-postcard',
index: 'project',
title: '实验项目管理'
},
{
icon: 'el-icon-user',
index: 'student',
title: '学生管理'
},
{
icon: 'el-icon-office-building',
index: 'backstage',
title: '业务后台'
},
{
icon: 'el-icon-setting',
index: 'system',
title: '系统设置'
}
],
actives: {
dashboard: ['addclass'],
achievement: ['experiment','addexperiment','showexperiment'],
project: ['addproject','program','programOptions'],
backstage: ['report']
}
};
},
computed: {
onRoutes() {
let actives = this.actives
let path = this.$route.path.replace('/', '')
for(let i in this.actives){
if(actives[i].includes(path)) return i
}
return path
}
},
created() {
// Event Bus
bus.$on('collapse', msg => {
this.collapse = msg;
bus.$emit('collapse-content', msg);
});
}
};
</script>
<style scoped>
.sidebar::-webkit-scrollbar {
width: 0;
}
.sidebar-el-menu:not(.el-menu--collapse) {
width: 100%;
}
.sidebar > ul {
height: 100%;
}
</style>

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

@ -0,0 +1,6 @@
import Vue from 'vue';
// 使用 Event Bus
const bus = new Vue();
export default bus;

@ -0,0 +1,80 @@
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;
};
}
}
})

@ -0,0 +1,30 @@
export const messages = {
'zh': {
i18n: {
breadcrumb: '国际化产品',
tips: '通过切换语言按钮,来改变当前内容的语言。',
btn: '切换英文',
title1: '常用用法',
p1: '要是你把你的秘密告诉了风,那就别怪风把它带给树。',
p2: '没有什么比信念更能支撑我们度过艰难的时光了。',
p3: '只要能把自己的事做好,并让自己快乐,你就领先于大多数人了。',
title2: '组件插值',
info: 'Element组件需要国际化,请参考 {action}。',
value: '文档'
}
},
'en': {
i18n: {
breadcrumb: 'International Products',
tips: 'Click on the button to change the current language. ',
btn: 'Switch Chinese',
title1: 'Common usage',
p1: "If you reveal your secrets to the wind you should not blame the wind for revealing them to the trees.",
p2: "Nothing can help us endure dark times better than our faith. ",
p3: "If you can do what you do best and be happy, you're further along in life than most people.",
title2: 'Component interpolation',
info: 'The default language of Element is Chinese. If you wish to use another language, please refer to the {action}.',
value: 'documentation'
}
}
}

@ -0,0 +1,56 @@
<template>
<div class="error-page">
<div class="error-code">4<span>0</span>3</div>
<div class="error-desc">啊哦~ 你没有权限访问该页面哦</div>
<div class="error-handle">
<router-link to="/">
<el-button type="primary" size="large">返回首页</el-button>
</router-link>
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>
</div>
</div>
</template>
<script>
export default {
methods: {
goBack(){
this.$router.go(-1);
}
}
}
</script>
<style scoped>
.error-page{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 100%;
height: 100%;
background: #f3f3f3;
box-sizing: border-box;
}
.error-code{
line-height: 1;
font-size: 250px;
font-weight: bolder;
color: #f02d2d;
}
.error-code span{
color: #00a854;
}
.error-desc{
font-size: 30px;
color: #777;
}
.error-handle{
margin-top: 30px;
padding-bottom: 200px;
}
.error-btn{
margin-left: 100px;
}
</style>

@ -0,0 +1,56 @@
<template>
<div class="error-page">
<div class="error-code">4<span>0</span>4</div>
<div class="error-desc">啊哦~ 你所访问的页面不存在</div>
<div class="error-handle">
<router-link to="/">
<el-button type="primary" size="large">返回首页</el-button>
</router-link>
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>
</div>
</div>
</template>
<script>
export default {
methods: {
goBack(){
this.$router.go(-1);
}
}
}
</script>
<style scoped>
.error-page{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 100%;
height: 100%;
background: #f3f3f3;
box-sizing: border-box;
}
.error-code{
line-height: 1;
font-size: 250px;
font-weight: bolder;
color: #2d8cf0;
}
.error-code span{
color: #00a854;
}
.error-desc{
font-size: 30px;
color: #777;
}
.error-handle{
margin-top: 30px;
padding-bottom: 200px;
}
.error-btn{
margin-left: 100px;
}
</style>

@ -0,0 +1,205 @@
<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="getData">
<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>
<el-form-item label="实验项目分类" class="userRadio">
<el-radio-group v-model="projectPermissions" @change="getData">
<el-radio v-for="(item,index) in projectType" :key="index" :label="item.id" border>{{item.name}}</el-radio>
</el-radio-group>
</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-table :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" 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" v-if="projectPermissions !== 0">
</el-table-column>
<el-table-column prop="projectName" label="实验项目名称" align="center">
</el-table-column>
<el-table-column prop="projectPermissions" label="分类" align="center">
<template slot-scope="scope">
{{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)">成绩管理</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>
export default {
name: 'achievement',
data() {
return {
userId: this.$store.state.userLoginId,
keyword: '',
systemId: this.$config.systemId,
projectPermissions: 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,
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.getData()
},
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.getData()
},500)
}
},
mounted() {
this.getData()
},
methods: {
getData() {
let data = {
searchContant: 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){
url = this.api.queryAchievementNew
}else{
data.systemId = this.systemId
data.projectPermissions = this.projectPermissions
}
this.$get(url,data).then(res => {
this.listDataAll = res.data
this.handlePage()
}).catch(res => {});
},
handlePage(){
let list = this.listDataAll
this.listData = list.slice((this.pageNo - 1) * this.pageSize,this.pageNo * this.pageSize)
this.totals = list.length
},
entry(row){
this.$store.commit('addExperimentData',{experimentData: {
id: row.projectId,
name: row.projectName,
class: row.experimentalClassName
}})
this.$router.push('experiment')
},
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;
}
</style>

@ -0,0 +1,547 @@
<template>
<div>
<el-form :disabled="isDetail">
<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">{{isDetail ? '查看' : (id ? '更新' : '创建')}}教学实验</span>
</div>
<div>
<el-button type="primary" size="small" round class="mag" v-preventReClick @click="upload" v-show="!isDetail">{{id ? '更新' : '创建'}}</el-button>
</div>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 mgb20">
<div>
<p class="mgb20">实验名称</p>
<el-input
placeholder="请输入实验名称"
v-model="experimentalName"
clearable
maxlength="15"
class="assName_input"
@change="judgeExpName"
></el-input>
</div>
</el-card>
<el-card shadow="hover" class="mgr20 mgb20">
<div>
<p class="mgb20">班级名称</p>
<el-input
placeholder="请输入班级名称"
v-model="experimentalClassName"
clearable
maxlength="15"
class="assName_input"
></el-input>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div>
<p class="mgb20">发布方式</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="2" class="fons">定时发布</el-radio>
</div>
</el-card>
<!-- 根据发布方式判断时间的显示 -->
<el-card shadow="hover" class="mgb20">
<div>
<p class="mgb20">实验时间</p>
<!-- 手动发布显示 -->
<div v-if="type==1">
实验时长
<el-input size="small" v-model="duration.day" placeholder class="dateinput"></el-input>
<el-input size="small" v-model="duration.hour" placeholder class="dateinput"></el-input> 小时
<el-input size="small" v-model="duration.minute" placeholder class="dateinput"></el-input>
</div>
<!-- 定时发布显示 -->
<div v-if="type==2" class="addAssess">
<span class="mgr10">开始时间:</span>
<el-date-picker
size="small"
v-model="date"
type="datetimerange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions"
></el-date-picker>
</div>
</div>
</el-card>
<!-- 实训项目模块 -->
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<span>实训项目</span>
<el-button type="primary" size="small" round @click="toProject">自定义实验项目</el-button>
</div>
<!-- 实训项目表格 -->
<el-table :data="projectData" class="table" stripe header-align="center">
<!-- 单选实训项目ID -->
<el-table-column width="60" label="选择" align="center">
<template slot-scope="scope">
<el-radio v-model="projectId" :label="scope.row.projectId">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
<el-table-column prop="auth" label="项目权限" align="center">
<template slot-scope="scope">
{{projectPermissionsList[scope.row.projectPermissions]}}
</template>
</el-table-column>
<el-table-column prop="creater" label="创建人" align="center">
<template slot-scope="scope">
{{roleStatus(scope.row.founder)}}
</template>
</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="showProject(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination
background
:page-size="pageSize"
@current-change="handleCurrentChange"
layout="total,prev, pager, next"
:total="totals"
></el-pagination>
</div>
</el-card>
<!-- 邀请码 -->
<el-card shadow="hover">
<div style="margin-bottom: 10px">
<p class="mgb20">设置邀请码</p>
<el-radio v-model="isCode" label="0"></el-radio>
<el-radio v-model="isCode" label="1"></el-radio>
</div>
<div v-show="isCode == 0">
<el-input style="display: inline-block;width: auto;margin-right: 10px" v-model.number="invitationCode" maxlength="6" placeholder="请设置6个数字"></el-input>
<el-button type="text" @click="createInv">随机</el-button>
</div>
</el-card>
</el-form>
</div>
</template>
<script>
export default {
data() {
return {
id: '',
systemId: this.$config.systemId,
isDetail: true,
userId: this.$store.state.userLoginId,
cacheData: this.$store.state.addClass,
duration: {
day: '',
hour: '',
minute: ''
},
date: '', //
experimentDuration: '0d0h0m',
experimentalNumber: 0,
projectId: '',
projectName: '',
status: '',
surplusTime: '',
experimentalName: '',//
experimentalClassName: '', //
type: '1',
isCode: '0', //
startTime: '0000-00-00 00:00:00', //
stopTime: '0000-00-00 00:00:00', //
invitationCode: '',
currPage: 1,
projectData: [],
invRepeat: false,
pickerOptions: {
disabledDate: time => {
return time.getTime() < new Date().getTime() - 86400000
}
},
projectPermissionsList: ['练习','考核','竞赛'],
projectQueryData: {
userId: this.$store.state.userLoginId,
systemId: this.systemId
},
pageNo: 1,
pageSize: 5,
totals: 0,
multipleSelection: [],
isToProject: false,
expNameRepeat: false
};
},
mounted() {
this.id = this.$route.query.id
this.isDetail = Boolean(this.$route.query.show)
this.id && this.getData()
this.getProjectData()
this.recoveryData()
},
beforeDestroy(){
if(!this.isToProject){
this.$store.commit("addClassData", { addClass : {} })
}
},
watch: {
date: function(val){
if(val[0] != '0000-00-00 00:00:00'){
this.startTime = this.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]))
}
},
duration: {
handler(n,o){
this.experimentDuration = `${n.day ? n.day : 0}d${n.hour ? n.hour : 0}h${n.minute ? n.minute : 0}m`
},
deep: true
}
},
methods: {
getProjectData(){
let data = this.projectQueryData
data.pageNo = this.pageNo
data.pageSize = this.pageSize
data.projectName = ''
this.$get(this.api.queryManagements,data).then(res => {
this.projectData = res.message.rows
this.totals = res.message.total
}).catch(res => {});
},
recoveryData(){
if(JSON.stringify(this.cacheData) != '{}'){
let info = this.cacheData
this.experimentDuration = info.experimentDuration
this.experimentalClassName = info.experimentalClassName
this.experimentalName = info.experimentalName
this.invitationCode = info.invitationCode
this.isCode = String(info.isCode)
this.projectId = info.projectId
this.startTime = info.startTime
this.stopTime = info.stopTime
this.surplusTime = info.surplusTime
this.type = String(info.type)
this.expNameRepeat = info.expNameRepeat
this.formatDuration()
}
},
upload() {
if(!this.experimentalName) return this.$message.warning('请填写实验名称')
if(this.expNameRepeat) return this.$message.warning('实验名称重复,请重新输入')
if(!this.experimentalClassName) return this.$message.warning('请填写班级名称')
if(this.type == 1){
this.status = 1
}else{
if(new Date().getTime() > new Date(this.startTime).getTime()) return this.$message.warning('开始时间不能早于当前时间')
this.status = 1
let timestamp = new Date(new Date(this.stopTime).getTime() - new Date(this.startTime).getTime())
let minute = 1000 * 60
let hour = minute * 60
let day = hour * 24
this.experimentDuration = `${Math.floor(timestamp / day)}d${Math.floor(timestamp % day / hour)}h${Math.floor(timestamp % day % hour / minute)}m`
}
if(this.type == 1 && this.experimentDuration == '0d0h0m') return this.$message.warning('请填写实验时长')
if(this.type == 2 && this.startTime == '0000-00-00 00:00:00') return this.$message.warning('请填写实验时间')
if(!this.projectId) return this.$message.warning('请选择实训项目')
this.projectName = this.projectData.find(n => n.projectId == this.projectId).projectName
if(this.isCode == 0){
if(!this.invitationCode) return this.$message.warning('请设置邀请码')
if(!this.invitationCode || String(this.invitationCode).length < 6 || isNaN(this.invitationCode)) return this.$message.warning('请输入6位纯数字邀请码')
// if(this.invRepeat) return this.$message.warning('')
}
let data = {
id: this.id,
experimentDuration: this.experimentDuration,
creationTime: this.id ? this.creationTime : this.formatDate("yyyy-MM-dd hh:mm:ss"),
experimentalClassName: this.experimentalClassName,
experimentalName: this.experimentalName,
experimentalNumber: this.experimentalNumber,
invitationCode: this.invitationCode,
isCode: this.isCode,
projectId: this.projectId,
projectName: this.projectName,
startTime: this.startTime,
status: Number(this.status),
stopTime: this.stopTime,
surplusTime: this.surplusTime,
type: Number(this.type),
userId: this.userId,
}
if(this.id){
this.$post(this.api.expUpdate, data).then(res => {
this.$message.success('修改成功');
this.$router.back()
})
.catch(err => {
});
}else{
this.$post(this.api.expSave, data).then(res => {
this.$message.success('创建成功');
this.$router.back()
})
.catch(err => {
});
}
},
getData() {
this.$get(this.api.expInfo + this.id)
.then(res => {
if(res.errmessage == 'success'){
let info = res.ExperimentalTeaching
this.creationTime = info.creationTime
this.experimentDuration = info.experimentDuration
this.experimentalClassName = info.experimentalClassName
this.experimentalName = info.experimentalName
this.experimentalNumber = info.experimentalNumber
this.invitationCode = info.invitationCode
this.isCode = String(info.isCode)
this.projectId = info.projectId
this.projectName = info.projectName
this.startTime = info.startTime
this.status = info.status
this.stopTime = info.stopTime
this.surplusTime = info.surplusTime
this.type = String(info.type)
this.formatDuration()
}else{
this.$message.error('查询失败');
}
})
.catch(err => {
});
},
formatDuration(){
let duration = this.experimentDuration.replace(/\D+/g,',').split(',')
this.duration = {
day: duration[0],
hour: duration[1],
minute: duration[2]
}
this.date = [this.startTime,this.stopTime]
},
handleCacheData(){
let data = {
id: this.id,
experimentDuration: this.experimentDuration,
experimentalClassName: this.experimentalClassName,
experimentalName: this.experimentalName,
invitationCode: this.invitationCode,
isCode: this.isCode,
projectId: this.projectId,
startTime: this.startTime,
stopTime: this.stopTime,
surplusTime: this.surplusTime,
type: this.type,
expNameRepeat: this.expNameRepeat
}
this.$store.commit("addClassData", { addClass : data})
this.isToProject = true
},
toProject(){
this.handleCacheData()
this.$router.push('/project')
},
showProject(row){
this.handleCacheData()
this.$router.push(`/addproject?id=${row.projectId}&show=1`)
},
goback() {
if(this.isDetail){
this.$router.back()
}else{
this.$confirm('确定返回?未更新的信息将不会保存。', '提示', {
type: 'warning'
})
.then(() => {
this.$router.back()
})
.catch(() => {});
}
},
varifyInv() {
this.$get(this.api.getInvitationCode, { invitationCode: this.invitationCode })
.then(res => {
if(res.InvitationCode) {
this.$message.warning('邀请码重复,请重新输入')
this.invRepeat = true
}else{
this.invRepeat = false
}
})
.catch(err => {});
},
createInv() {
let result = ''
for(let i=0; i<6; i++){
result += Math.floor(Math.random()*10)
}
this.invitationCode = result
// this.varifyInv()
},
handleCurrentChange(val){
this.pageNo = val
this.getProjectData()
},
judgeExpName(){
this.$get(this.api.expCheck, { experimentalName: this.experimentalName })
.then(res => {
if(res.errmessage != 'success') {
this.$message.warning('实验名称重复,请重新输入')
this.expNameRepeat = true
}else{
this.expNameRepeat = false
}
})
.catch(err => {});
},
},
};
</script>
<style scope>
.makeupList /deep/.el-upload-list__item {
display: none;
}
.dateinput {
width: 100px;
display: inline-block;
}
.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>

@ -0,0 +1,432 @@
<template>
<div class="box">
<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>
<div id="wrap">
<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="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>
<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" 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" 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" 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" 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" 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" 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>
<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,
stuId: this.$route.query.stuId,
studentName: this.$route.query.studentName,
class: this.$route.query.class,
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,
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.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>
.box{
padding: 0 50px;
background-color: #fff;
}
/deep/.el-textarea.is-disabled .el-textarea__inner{
background-color: #ebfafd;
}
#wrap{
/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>

File diff suppressed because it is too large Load Diff

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

@ -0,0 +1,425 @@
<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="getData">
<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-center">
<el-form-item label="发布类型">
<el-select v-model="form.type" clearable placeholder="请选择发布类型" @change="getData">
<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="getData">
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></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"
>创建实验</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-delete"
round
class="bt_one"
@click="delAllData"
>批量删除</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 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)">启动</el-button>
<el-button type="text" @click="edit(scope.row)">修改</el-button>
</template>
<template v-else-if="scope.row.status == 2">
<el-button type="text" @click="finish(scope.row)">提前结束</el-button>
</template>
<template v-else-if="scope.row.status == 3">
<el-button type="text" @click="show(scope.row)">查看成绩</el-button>
</template>
<el-button v-if="scope.row.status == 1 || scope.row.status == 3" type="text" @click="delData(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';
import axios from 'axios';
export default {
name: 'dashboard',
data() {
return {
name: sessionStorage.getItem('ms_username'),
schoolId: this.$store.state.schoolId,
systemId: this.$config.systemId,
systemList: [
{
id: 1,
label: 'Python实验系统'
},{
id: 2,
label: '跨国仿真系统'
},{
id: 3,
label: '期权期货系统'
},{
id: 4,
label: 'Python金融建模教学系统'
},{
id: 5,
label: 'Python数据可视化教学系统'
},
],
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: [],
timerList: []
};
},
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: {
date: function(val){
if(val){
this.form.startTime = val[0]
this.form.stopTime = val[1]
}else{
this.form.startTime = ''
this.form.stopTime = ''
}
this.getData()
},
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.getData()
},500)
}
},
computed: {
role() {
return this.name === 'admin' ? '超级管理员' : '普通用户';
}
},
mounted() {
this.getData()
this.$once('hook:beforeDestroy', function () {
this.timerList.forEach((n,k) => {
clearInterval(n)
})
this.timerList = []
})
},
methods: {
getData() {
let data = {
type: this.form.type,
startTime: this.form.startTime,
stopTime: this.form.stopTime,
month: this.form.month,
searchContent: 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
this.$refs.table.clearSelection()
}).catch(res => {});
},
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: {
id: row.projectId,
name: row.projectName
}})
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){
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 => {});
},
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.$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>

@ -0,0 +1,713 @@
<template>
<div>
<div class="Bank_m">
<div style="text-align: right">
<el-button type="primary" size="small" round @click="getInfo">测评设置</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="getData">
<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" :close-on-click-modal="false">
<el-form
:model="topicForm"
:rules="rules"
:disabled="isShowTopics"
ref="topicForm"
label-width="100px"
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 type="primary" @click="saveTopics"> </el-button>
<el-button v-preventReClick @click="NewTopics = false"> </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 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">
3.请点击批量导入
<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"
>新增题目</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-top"
round
class="bt_one"
@click="showBatchUpload"
>批量上传</el-button>
<el-button
type="primary"
size="small"
icon="el-icon-delete"
round
class="bt_one"
@click="delAllData"
>批量删除</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)">查看</el-button>
</template>
<template v-else>
<el-button type="text" @click="editQues(scope.row)">修改</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)"
></el-switch>
<el-button type="text" @click="delData(scope.row)">删除</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.getData()
},500)
}
},
methods: {
getData() {
this.$get(this.api.list, {
page: this.pageNo,
size: this.pageSize,
questionStem: 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 => {})
},
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.$message.success('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
}else{
this.$message.error('请先选择题目 !');
}
},
downloadTem() {
location.href = this.api.download
},
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
},
uploadSure(){
this.BatchUpload = false
this.pageNo = 1
this.keyword = ''
this.getData()
},
closeUpload() {
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>

@ -0,0 +1,153 @@
<template>
<div>
<el-card shadow="hover" class="mgb20">
<div class="flex-between" style="margin-bottom: 10px">
<div class="per_title" v-preventReClick @click="goback()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school">{{experimentName}}</span>
</div>
</div>
<el-form label-width="100px">
<div class="flex-between">
<div>
<el-button type="primary" size="small" @click="exportData">导出</el-button>
</div>
<div>
<el-input placeholder="请输入学校/学生姓名" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
</div>
</el-form>
</el-card>
<el-card shadow="hover" class="mgb20">
<el-table :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="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 v-if="className" prop="class" label="班级" align="center">
</el-table-column>
<el-table-column prop="studentName" label="学生姓名" align="center"></el-table-column>
<el-table-column prop="workNumber" label="学号" align="center"></el-table-column>
<el-table-column prop="score" label="分数" align="center"></el-table-column>
<el-table-column prop="creationTime" label="提交时间" align="center">
</el-table-column>
<el-table-column label="操作" align="center" width="220">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">修改分数</el-button>
<el-button type="text" @click="show(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 layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo">
</el-pagination>
</div>
</el-card>
</div>
</template>
<script>
export default {
name: 'experiment',
data() {
return {
systemId: this.$config.systemId,
projectId: this.$store.state.experimentData.id,
experimentName: this.$store.state.experimentData.name,
className: this.$store.state.experimentData.class,
keyword: '',
listData: [],
multipleSelection: [],
pageNo: 1,
pageSize: 10,
totals: 0,
};
},
mounted() {
this.getData()
},
methods: {
getData() {
let data = {
systemId: this.systemId,
page: this.pageNo,
size: this.pageSize,
searchContant: this.keyword,
projectId: this.projectId
}
this.$get(this.api.queryEvaluationReport,data).then(res => {
let list = res.data
list.map(n => n.class = this.className)
this.listData = list
// this.totals = res.data.totalCount
}).catch(res => {});
},
edit(row){
this.$router.push(`addexperiment?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`)
},
show(row){
this.$router.push(`/showexperiment?id=${row.reportId}&stuId=${row.userId}&studentName=${row.studentName}&class=${row.class}`)
},
exportData(){
if(this.multipleSelection.length != ''){
let newArr = this.multipleSelection
let exportList = newArr.map(item => {
return item.recordId
})
let data = {
ids: exportList,
projectId: this.projectId
}
this.$post(this.api.exportAchievement,data).then(res => {
this.multipleSelection = [];
}).catch(res => {});
}else{
this.$message.error('请先选择数据 !');
}
},
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
let data = {
reportId: '',
recordId: ''
}
this.$post(`${this.api.deleteReport}`,data).then(res => {
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleCurrentChange(val) {
this.pageNo = val;
this.getData();
},
goback() {
this.$router.back()
},
}
};
</script>
<style scoped>
.mag{
margin-right: 20px;
}
/deep/.el-tabs__nav-wrap::after{
display: none;
}
</style>

@ -0,0 +1,46 @@
<template>
<section class="main">
<div class="crumbs">
<el-breadcrumb separator="/">
<el-breadcrumb-item><i class="el-icon-lx-global"></i> {{$t('i18n.breadcrumb')}}</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="container">
<span>{{$t('i18n.tips')}}</span>
<el-button type="primary" @click="$i18n.locale = $i18n.locale === 'zh'?'en':'zh';">{{$t('i18n.btn')}}</el-button>
<div class="list">
<h2>{{$t('i18n.title1')}}</h2>
<p>{{$t('i18n.p1')}}</p>
<p>{{$t('i18n.p2')}}</p>
<p>{{$t('i18n.p3')}}</p>
</div>
<h2>{{$t('i18n.title2')}}</h2>
<div>
<i18n path="i18n.info" tag="p">
<a place="action" href="https://element.eleme.cn/2.0/#/zh-CN/component/i18n">{{ $t('i18n.value') }}</a>
</i18n>
</div>
</div>
</section>
</template>
<script>
export default {
data(){
return {
}
}
}
</script>
<style scoped>
.list{
padding: 30px 0;
}
.list p{
margin-bottom: 20px;
}
a{
color: #409eff;
}
</style>

@ -0,0 +1,225 @@
<template>
<div>
<div class="crumbs">
<el-breadcrumb separator="/">
<el-breadcrumb-item><i class="el-icon-lx-emoji"></i> 自定义图标</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="container">
<h2>使用方法</h2>
<p style="line-height: 50px;">
直接通过设置类名为 el-icon-lx-iconName 来使用即可例如{{iconList.length}}个图标
</p>
<p class="example-p">
<i class="el-icon-lx-redpacket_fill" style="font-size: 30px;color: #ff5900"></i>
<span>&lt;i class=&quot;el-icon-lx-redpacket_fill&quot;&gt;&lt;/i&gt;</span>
</p>
<p class="example-p">
<i class="el-icon-lx-weibo" style="font-size: 30px;color:#fd5656"></i>
<span>&lt;i class=&quot;el-icon-lx-weibo&quot;&gt;&lt;/i&gt;</span>
</p>
<p class="example-p">
<i class="el-icon-lx-emojifill" style="font-size: 30px;color: #ffc300"></i>
<span>&lt;i class=&quot;el-icon-lx-emojifill&quot;&gt;&lt;/i&gt;</span>
</p>
<br>
<h2>图标</h2>
<div class="search-box">
<el-input class="search" size="large" v-model="keyword" clearable placeholder="请输入图标名称"></el-input>
</div>
<ul>
<li class="icon-li" v-for="(item,index) in list" :key="index">
<div class="icon-li-content">
<i :class="`el-icon-lx-${item}`"></i>
<span>{{item}}</span>
</div>
</li>
</ul>
</div>
</div>
</template>
<script>
export default {
data: function(){
return {
keyword: '',
iconList: [
'attentionforbid',
'attentionforbidfill',
'attention',
'attentionfill',
'tag',
'tagfill',
'people',
'peoplefill',
'notice',
'noticefill',
'mobile',
'mobilefill',
'voice',
'voicefill',
'unlock',
'lock',
'home',
'homefill',
'delete',
'deletefill',
'notification',
'notificationfill',
'notificationforbidfill',
'like',
'likefill',
'comment',
'commentfill',
'camera',
'camerafill',
'warn',
'warnfill',
'time',
'timefill',
'location',
'locationfill',
'favor',
'favorfill',
'skin',
'skinfill',
'news',
'newsfill',
'record',
'recordfill',
'emoji',
'emojifill',
'message',
'messagefill',
'goods',
'goodsfill',
'crown',
'crownfill',
'move',
'add',
'hot',
'hotfill',
'service',
'servicefill',
'present',
'presentfill',
'pic',
'picfill',
'rank',
'rankfill',
'male',
'female',
'down',
'top',
'recharge',
'rechargefill',
'forward',
'forwardfill',
'info',
'infofill',
'redpacket',
'redpacket_fill',
'roundadd',
'roundaddfill',
'friendadd',
'friendaddfill',
'cart',
'cartfill',
'more',
'moreandroid',
'back',
'right',
'shop',
'shopfill',
'question',
'questionfill',
'roundclose',
'roundclosefill',
'roundcheck',
'roundcheckfill',
'global',
'mail',
'punch',
'exit',
'upload',
'read',
'file',
'link',
'full',
'group',
'friend',
'profile',
'addressbook',
'calendar',
'text',
'copy',
'share',
'wifi',
'vipcard',
'weibo',
'remind',
'refresh',
'filter',
'settings',
'scan',
'qrcode',
'cascades',
'apps',
'sort',
'searchlist',
'search',
'edit'
]
}
},
computed: {
list(){
return this.iconList.filter((item) => {
return item.indexOf(this.keyword) !== -1;
})
}
}
}
</script>
<style scoped>
.example-p{
height: 45px;
display: flex;
align-items: center;
}
.search-box{
text-align: center;
margin-top: 10px;
}
.search{
width: 300px;
}
ul,li{
list-style: none;
}
.icon-li{
display: inline-block;
padding: 10px;
width: 120px;
height: 120px;
}
.icon-li-content{
display: flex;
height: 100%;
flex-direction: column;
align-items: center;
justify-content: center;
cursor: pointer;
}
.icon-li-content i{
font-size: 36px;
color: #606266;
}
.icon-li-content span{
margin-top: 10px;
color: #787878;
}
</style>

@ -0,0 +1,191 @@
<template>
<div class="login-wrap">
<div class="header">
<div class="logo">
<img src="../../assets/img/logo.png">
</div>
</div>
<div class="ms-login">
<div class="ms-title">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="账号登录" name="first">
<el-form :model="param" :rules="rules" ref="login" label-width="0px" style="margin-top: 40px">
<el-form-item prop="username">
<el-input v-model="param.username" placeholder="username"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
type="password"
placeholder="password"
v-model="param.password"
@keyup.enter.native="submitForm()"
>
</el-input>
</el-form-item>
<el-button type="text" class="forget">忘记密码?</el-button>
<div class="login-btn">
<el-button type="primary" @click="submitForm()">马上登录</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="second">扫描登录</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
export default {
data: function() {
return {
param: {
username: 'admin',
password: 'admin',
},
rules: {
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
},
activeName: 'first'
};
},
methods: {
submitForm() {
this.$refs.login.validate(valid => {
if (valid) {
let data = {
account: this.param.username,
password: this.param.password
}
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 => {});
this.$message.success('登录成功');
sessionStorage.setItem('cd_server_username', this.param.username);
this.$store.commit("userLoginData", { userLogin_id : data.userId,userRole_id: data.roleId,schoolId: data.schoolId,token: data.token});
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 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;
}
.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: 171px;
height: 40px;
margin-left: 20px;
}
img{
width: 100%;
height: 100%;
}
.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>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,543 @@
<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">
<el-input type="textarea" :disabled="true" v-model="ruleForm.experimentalRequirements"></el-input>
</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 { log } from "util";
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
};
},
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>

@ -0,0 +1,962 @@
<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">
<el-input
type="textarea"
v-model="ruleForm.experimentalRequirements"
></el-input>
</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 { log } from "util";
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,
};
},
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>

@ -0,0 +1,370 @@
<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="getData()">
<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="getData()">
<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="getData()">
<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>
<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">新增项目</el-button>
<el-button type="primary" size="small" round @click="delAllData">批量删除</el-button>
</div>
</div>
<el-table :data="projectData" class="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">
</el-table-column>
<el-table-column prop="projectName" label="实验项目名称" align="center">
</el-table-column>
<el-table-column prop="people" label="创建人" align="center">
<template slot-scope="scope">
{{roleStatus(scope.row.founder)}}
</template>
</el-table-column>
<el-table-column label="权限" align="center">
<template slot-scope="scope">
{{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="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">编辑</el-button>
<el-button type="text" @click="delData(scope.row)">删除</el-button>
<el-button type="text" @click="copyData(scope.row)">复制</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" 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 {
systemId: this.$config.systemId,
showBack: JSON.stringify(this.$store.state.addClass) == '{}' ? false : true,
roleId: this.$store.state.userRoleId,
userId: this.$store.state.userLoginId,
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: 2,
label: "管理员"
},
{
value: 3,
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.getData()
},500)
}
},
mounted() {
this.getData()
},
methods: {
getData(){
let data = this.queryData
data.pageNo = this.pageNo
data.pageSize = this.pageSize
data.projectName = this.keyword
data.systemId = this.systemId
this.$get(this.api.queryAllManagements,data).then(res => {
this.projectDataAll = res.message
this.handlePage()
}).catch(res => {});
},
handlePage(){
let list = this.projectDataAll
let newList = []
list.map(n => {
if(this.roleId == 3){
(n.userId == this.userId || n.founder == 1 || n.founder == 2) && newList.push(n)
}else{
newList.push(n)
}
})
this.projectData = newList.slice((this.pageNo - 1) * this.pageSize,this.pageNo * this.pageSize)
this.totals = newList.length
},
transferStatus(status){
return status == 1 ? '已发布' : '草稿箱'
},
handleCurrentChange(val){
this.pageNo = val
this.handlePage()
},
add(){
this.$store.commit("configData", { config_id : ''});
this.$router.push('/addproject');
},
edit(row){
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.$message.success('删除成功');
this.getData()
}).catch(res => {});
})
.catch(() => {});
}else{
this.$message.error('请先选择项目 !');
}
},
projectNameExistis(){
let data = {
projectName: 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.getJudgmentPoints,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 => {
n.judgmentPointsId = n.id
let same = scores.find(e => e.judgmentPointsId == n.id)
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 = Number(this.roleId)
data.management.founder = this.roleId
data.management.userId = this.userId
data.pooints.map(n => {
n.userId = this.userId
})
this.$post(this.api.addProjectManagement,data).then((res) => {
this.$message.success('复制成功');
this.copyVisible = false
this.getData()
})
},
goback() {
this.$router.back()
},
}
};
</script>
<style scoped>
.no-mb /deep/.el-form-item{
margin-bottom: 0;
}
</style>

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

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

@ -0,0 +1,421 @@
<template>
<div>
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>筛选</span>
</div>
<div>
<div style="display: flex;justify-content: flex-end;">
<div>
<el-input placeholder="请输入角色名称" prefix-icon="el-icon-search" v-model="form.keyword" clearable></el-input>
</div>
</div>
</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="roleData" 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="roleName" label="角色名称" align="center" width="100">
</el-table-column>
<el-table-column label="角色描述" align="center">
<template slot-scope="scope">
<el-input placeholder="该角色用于管理全部功能权限" v-model="scope.row.des"></el-input>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<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>
<el-dialog :title="isAdd ? '新增角色' : '编辑角色'" :visible.sync="roleVisible"
width="30%" center @close="closeTeacher" class="dialog" :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item prop="userAccount" label="角色名称">
<el-input v-model.number="form.userAccount" ref="account" placeholder="请输入角色名称" @change="accountChange"></el-input>
</el-form-item>
<el-form-item prop="userName" label="角色描述">
<el-input v-model="form.userName" placeholder="请输入角色描述" type="textarea" rows="5"></el-input>
</el-form-item>
<el-form-item prop="role" label="角色权限">
<div>
<el-tree
:data="data"
show-checkbox
node-key="id"
:default-expanded-keys="[2, 3]"
:default-checked-keys="[5]"
:props="defaultProps">
</el-tree>
</div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="roleVisible = false"> </el-button>
<el-button type="primary" @click="saveSure('form')"> </el-button>
</span>
</el-dialog>
<!-- 批量导入 -->
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" center :close-on-click-modal="false">
<!-- <el-input placeholder="请上传文件"></el-input> -->
<div class="flex-start-around">
<!-- <el-button type="text" class="ml20" @click="loginout">浏览电脑</el-button> -->
<el-button type="primary" @click="downLoad">模板下载<i class="el-icon-download el-icon--right"></i></el-button>
<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.readStaff"
:file-list="uploadList"
:data="updata"
name="file"
>
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="importVisible = false"> </el-button>
<el-button type="primary" @click="uploadSure"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import bus from '../common/bus';
export default {
name: 'dashboard',
data() {
return {
count: 1,
form: {
userName: '',
account: '',
role: ''
},
rules: {
userAccount: [
{ required: true, message: '请输入职工账号', trigger: 'blur' },
{
pattern: /^[A-Za-z0-9]*$/,
message: '职工账号必须为数字',
trigger: 'blur'
}
],
userName: [
{ required: true, message: '请输入用户姓名', trigger: 'blur' }
],
role: [
{ required: true, message: '请输入所在院校', trigger: 'change' }
],
},
roleData:[
{
id: 1,
roleName: '管理员',
des: ''
},
{
id: 2,
roleName: '老师',
des: ''
},
],
data: [{
id: 1,
label: '一级 1',
children: [{
id: 4,
label: '二级 1-1',
children: [{
id: 9,
label: '三级 1-1-1'
}, {
id: 10,
label: '三级 1-1-2'
}]
}]
}, {
id: 2,
label: '一级 2',
children: [{
id: 5,
label: '二级 2-1'
}, {
id: 6,
label: '二级 2-2'
}]
}, {
id: 3,
label: '一级 3',
children: [{
id: 7,
label: '二级 3-1'
}, {
id: 8,
label: '二级 3-2'
}]
}],
defaultProps: {
children: 'children',
label: 'label'
},
pageNo: 1,
pageSize: 10,
totals: 2,
multipleSelection: [],
uploadList: [],
updata: {
schoolId: this.$store.state.schoolId,
schoolName: this.$store.state.schoolName
},
importVisible: false,
isAdd: true,
roleVisible: false
};
},
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.roleData = res.message.rows
// this.totals = res.message.total
// }).catch(res => {});
},
async accountChange(){
// let res = await this.$get(this.api.queryAccountIsExist, {
// account: this.teacherForm.userAccount,
// schoolId: this.updata.schoolId
// });
// this.isManager = false
// this.isTeacher = false
},
async phoneChange(){
},
batchImport(){
this.importVisible = true
},
// /
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()
},
closeTeacher(){
this.$refs.form.resetFields()
},
currentChange(val) {
this.pageNo = val;
this.getData();
},
permission(){
this.$router.push('/permission')
},
adduser(){
this.roleVisible = true
},
edit(row){
this.roleVisible = true
},
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('请先选择数据 !');
}
},
downLoad(){
window.open('http://www.liuwanr.cn:8080/makeuplist/excelExport?fileName=模板下载&titles=职工姓名,账号角色,职工账号,专业方向,部门,手机号,邮箱')
},
//
handleExceed(files, fileList) {
// console.log(files, fileList)
this.$message.warning(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
uploadSuccess(response, file, fileList) {
// this.uploadList.push({ name: file.name, url: response.message.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
},
uploadSure(){
this.importVisible = false
this.pageNo = 1
this.staffGradeId = ''
this.keyword = ''
this.getTeacher()
},
handleCheckChange(data, checked, indeterminate) {
console.log(data, checked, indeterminate);
},
handleNodeClick(data) {
console.log(data);
},
loadNode(node, resolve) {
if (node.level === 0) {
return resolve([{ name: 'region1' }, { name: 'region2' }]);
}
if (node.level > 3) return resolve([]);
var hasChild;
if (node.data.name === 'region1') {
hasChild = true;
} else if (node.data.name === 'region2') {
hasChild = false;
} else {
hasChild = Math.random() > 0.5;
}
setTimeout(() => {
var data;
if (hasChild) {
data = [{
name: 'zone' + this.count++
}, {
name: 'zone' + this.count++
}];
} else {
data = [];
}
resolve(data);
}, 500);
}
}
};
</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>

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

@ -0,0 +1,831 @@
<template>
<div>
<el-container>
<el-aside width="350px">
<TeacherSide ref="getSelectData" @fircheck="fircheck" @twocheck="twocheck" @getData="getData"></TeacherSide>
</el-aside>
<el-main style="padding-top: 0">
<el-col :span="24">
<el-card shadow="hover" class="mgb20 teacher_tab">
<div class="flex-between mgb20">
<div>
<el-input placeholder="请输入员工账号/姓名/工号" v-model="keyword">
<i slot="suffix" class="el-input__icon el-icon-search"></i>
</el-input>
</div>
<div>
<el-button type="primary" size="small" round @click="addTeacher">新增员工</el-button>
<el-button type="primary" size="small" round @click="batchImport">批量导入</el-button>
<el-button type="primary" size="small" round @click="delAllSelection">批量删除</el-button>
</div>
</div>
<el-table :data="listData" class="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" label="序号" width="55" 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="workNumber" label="职工工号" align="center">
</el-table-column>
<el-table-column prop="staffProfessionalArchitectureName" label="部门" align="center">
</el-table-column>
<el-table-column prop="NewaccountRole" label="账号角色" align="center">
</el-table-column>
<el-table-column prop="logInNumber" label="登录次数" align="center">
</el-table-column>
<el-table-column prop="lastLoginTime" label="上次登录时间" align="center">
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="showTeacher(scope.row)">查看</el-button>
<el-button type="text" @click="editTeacher(scope.row)">编辑</el-button>
<el-button type="text" @click="delTeacher(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :current-page="pageNo" @current-change="handleCurrentChange" :total="totals">
</el-pagination>
</div>
</el-card>
</el-col>
</el-main>
</el-container>
<!-- 新增用户 -->
<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-item prop="userAccount" label="账号">
<el-input v-model="teacherForm.userAccount" ref="account" placeholder="请输入职工账号" @change="accountChange"></el-input>
</el-form-item>
<el-form-item prop="userName" label="用户姓名">
<el-input v-model="teacherForm.userName" placeholder="请输入员工姓名"></el-input>
</el-form-item>
<el-form-item prop="roleValue" label="账号角色">
<el-checkbox-group v-model="teacherForm.roleValue" :disabled="!isAddteacher">
<el-checkbox label="老师"></el-checkbox>
<el-checkbox label="管理员"></el-checkbox>
<el-checkbox label="学生" disabled></el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item prop="uniqueIdentificationAccount" label="唯一标识">
<el-input disabled v-model="teacherForm.uniqueIdentificationAccount" placeholder="请输入职工工号获取唯一标识"></el-input>
</el-form-item>
<template v-if="teacherForm.roleValue.some((n) => n == '老师')">
<el-form-item prop="teacherWorkNumber" label="老师职工工号">
<el-input v-model="teacherForm.teacherWorkNumber" placeholder="请输入老师职工工号" @change="OnlyId(3)"></el-input>
</el-form-item>
<el-form-item prop="teacherMajor" label="老师一级部门">
<el-select v-model="teacherForm.teacherMajor" placeholder="请选择一级部门" @change="getDepartment(3)">
<el-option v-for="(item,index) in majorList" :key="index"
:label="item.staffProfessionalArchitectureName" :value="item.staffProfessionalArchitectureId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="teacherDepartment" label="老师二级部门">
<el-select v-model="teacherForm.teacherDepartment" placeholder="请选择二级部门" :disabled="teacherForm.teacherMajor ? false : true">
<el-option v-for="(item,index) in teacherDepartmentList" :key="index"
:label="item.staffGradeName" :value="item.staffGradeId"></el-option>
</el-select>
</el-form-item>
</template>
<template v-if="teacherForm.roleValue.some((n) => n == '管理员')">
<el-form-item prop="managerWorkNumber" label="管理员职工工号">
<el-input v-model="teacherForm.managerWorkNumber" placeholder="请输入管理员职工工号" @change="OnlyId(2)"></el-input>
</el-form-item>
<el-form-item prop="managerMajor" label="管理员一级部门">
<el-select v-model="teacherForm.managerMajor" placeholder="请选择一级部门" @change="getDepartment(2)">
<el-option v-for="(item,index) in majorList" :key="index"
:label="item.staffProfessionalArchitectureName" :value="item.staffProfessionalArchitectureId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="managerDepartment" label="管理员二级部门">
<el-select v-model="teacherForm.managerDepartment" placeholder="请选择二级部门" :disabled="teacherForm.managerMajor ? false : true">
<el-option v-for="(item,index) in managerDepartmentList" :key="index"
:label="item.staffGradeName" :value="item.staffGradeId"></el-option>
</el-select>
</el-form-item>
</template>
<el-form-item prop="phone" label="手机号">
<el-input v-model="teacherForm.phone" placeholder="请输入手机号" maxlength="11" @change="phoneChange"></el-input>
</el-form-item>
<el-form-item prop="email" label="邮箱">
<el-input v-model="teacherForm.email" placeholder="请输入邮箱"></el-input>
</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-select v-model="teacherForm.schoolId" placeholder="默认为当前院校(可修改)" filterable>
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button @click="teacherVisible = false"> </el-button>
<el-button type="primary" @click="saveSure('teacherForm')"> </el-button>
</span>
</el-dialog>
<!-- 批量导入 -->
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" center :close-on-click-modal="false">
<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>
<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.uploadFileStaff"
:file-list="uploadList"
name="file"
>
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload>
<el-link v-if="uploadFaild" type="primary" @click="showFaild">导入失败查看原因</el-link>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="importVisible = false"> </el-button>
<el-button type="primary" @click="uploadSure"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import TeacherSide from './StaffSide.vue';
export default {
data() {
return {
pages: 10,
isDetail: false,
isAddteacher: false,
teacherVisible: false,
schoolId: 2105,
teacherForm: {
teacherId: '',
userName: '',
roleValue: [],
tearcherAccount: '',
phone: '',
uniqueIdentificationAccount: '',
teacherWorkNumber: '',
managerWorkNumber: '',
email: '',
teacherMajor: '',
teacherDepartment: '',
managerMajor: '',
managerDepartment: '',
userAccount: '',
major: '',
schoolId: this.schoolId
},
rules: {
userAccount: [
{ required: true, message: '请输入职工账号', trigger: 'blur' },
// {
// pattern: /^[A-Za-z0-9]*$/,
// message: '',
// trigger: 'blur'
// }
],
userName: [
{ required: true, message: '请输入用户姓名', trigger: 'blur' }
],
roleValue: [
{ required: true, message: '请选择账号角色', trigger: 'change' }
],
tearcherAccount: [
{ required: true, message: '请输入老师职工工号', trigger: 'blur' },
{
pattern: /^[0-9]*$/,
message: '职工工号必须为数字',
trigger: 'blur'
}
],
uniqueIdentificationAccount: [
// { required: true, message: '', trigger: 'blur' },
],
teacherWorkNumber: [
{ required: true, message: '请输入老师职工工号', trigger: 'blur' },
{
pattern: /^[A-Za-z0-9]+$/,
message: '请输入正确的职工工号',
trigger: 'blur'
}
],
teacherDepartment: [
{ required: true, message: '请选择老师二级部门', trigger: 'change' }
],
managerMajor: [
{ required: true, message: '请选择管理员一级部门', trigger: 'change' }
],
managerWorkNumber: [
{ required: true, message: '请输入管理员职工工号', trigger: 'blur' },
{
pattern: /^[A-Za-z0-9]+$/,
message: '请输入正确的职工工号',
trigger: 'blur'
}
],
managerDepartment: [
{ required: true, message: '请选择管理员二级部门', trigger: 'change' }
],
teacherMajor: [
{ required: true, message: '请选择老师一级部门', trigger: 'change' }
],
phone: [
// { required: true, message: '', trigger: 'blur' },
{
pattern: /^1[3456789]\d{9}$/,
message: '请输入正确的手机号',
trigger: 'blur'
}
],
email: [
// { required: true, message: '', trigger: 'blur' },
{
pattern: /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/,
message: '请输入正确的邮箱',
trigger: 'blur'
}
],
schoolId: [
{ required: true, message: '请选择所在院校', trigger: 'change' }
],
},
listData: [],
importVisible: false,
keyword: '',
pageNo: 1,
pageSize: 10,
totals: 0,
managerDepartmentList: [],
teacherDepartmentList: [],
staffstateProfessId: '',
staffGradeId: '',
multipleSelection: [],
uploadList: [],
provinceId: this.$store.state.provinceId,
cityId: this.$store.state.cityId,
userId: this.$store.state.userId,
oneDepartmentIds: '',
twoDepartmentIds: '',
ProfessionalClassList: [],
subjectList: [],
ProfessionalList: [],
NoAdd: '',
AccountNoAdd: '',
managerNumberNoAdd: true,
teacherNumberNoAdd: true,
platformId: this.$store.state.platformId,
isManager: false,
isTeacher: false,
isNewUser: 1,
schoolList: [],
uploadFaild: false,
token: ''
};
},
components: {
TeacherSide
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.getData()
},500)
}
},
mounted(){
this.getData()
this.teacherForm.schoolId = 2105
this.getSchoolData()
// this.getSubject()
},
methods: {
handleCheck(data){
let oneDepartmentIds = []
let twoDepartmentIds = []
data.forEach( e => {
if(e.ischeck){
oneDepartmentIds.push(e.staffProfessionalArchitectureId)
}else{
this.removeByValue(oneDepartmentIds, e.staffProfessionalArchitectureId);
}
e.children.forEach( r => {
if(r.ischeck){
twoDepartmentIds.push(r.staffGradeId)
}else{
this.removeByValue(twoDepartmentIds, r.staffGradeId);
}
})
})
this.oneDepartmentIds = oneDepartmentIds.toString()
this.twoDepartmentIds = twoDepartmentIds.toString()
this.getData()
},
fircheck(val,val2){
val.ischeck = !val.ischeck
val.children.map( e => e.ischeck = val.ischeck)
this.handleCheck(val2)
},
twocheck(val,val2){
val.ischeck = !val.ischeck
val2.map( e => {
e.children.map( r => {
if(r.staffGradeId == val.staffGradeId){
if(e.children.every(i => i.ischeck)){
e.ischeck = true
}else{
e.ischeck = false
}
}
})
})
this.handleCheck(val2)
},
getData(){
let data = {
staffProfessionalArchitectureIds: this.oneDepartmentIds,
staffGradeIds: this.twoDepartmentIds,
searchContent: this.keyword,
page: this.pageNo,
size: this.pageSize,
schoolId: this.schoolId
}
this.$post(this.api.queryStaff,data).then(res => {
this.listData = res.data.list
this.totals = res.data.totalCount
this.listData.forEach(e => {
if(e.roleId.length > 1) {
let NewaccountRole = []
let roleIds = e.roleId.split(',')
roleIds.forEach((n,k) => {
NewaccountRole.push(this.roleStatus(n))
})
e.NewaccountRole = NewaccountRole.join(',')
}else{
e.NewaccountRole = this.roleStatus(e.roleId)
}
})
}).catch(res => {});
},
getSchoolData(){
let data = {
schoolName: '',
provinceId: '',
cityId: ''
}
this.$get(this.api.querySchool,data).then(res => {
this.schoolList = res.message
}).catch(res => {});
},
closeTeacher(){
this.teacherForm= {
teacherId: '',
userName: '',
roleValue: [],
tearcherAccount: '',
phone: '',
uniqueIdentificationAccount: '',
teacherWorkNumber: '',
managerWorkNumber: '',
email: '',
teacherMajor: '',
teacherDepartment: '',
managerMajor: '',
managerDepartment: '',
userAccount: '',
major: '',
schoolId: this.schoolId
}
this.isManager = false
this.isTeacher = false
this.$refs.teacherForm.clearValidate()
},
addTeacher(){
this.isDetail = false
this.teacherVisible = true
this.isAddteacher = true
this.teacherForm.teacherId = ''
this.majorList = this.$refs.getSelectData.majorList
this.$refs.teacherForm.clearValidate()
},
getStaffDetail(userId){
let data = {
userId: userId
}
this.$get(this.api.querystaffDetail,data).then(res => {
let user = res.data.userInfo;
let or = res.data.staffInfo;
this.teacherForm.userName = user.userName
this.teacherForm.phone = user.phone
this.teacherForm.email = user.email
this.teacherForm.userAccount = user.account
this.teacherForm.userId = user.userId
this.teacherForm.schoolId = user.schoolId
or.forEach((n,i) => {
this.teacherForm.roleValue.push(this.roleStatus(n.roleId))
if(n.roleId == 2) {
this.teacherForm.managerMajor = n.staffProfessionalArchitectureId
this.teacherForm.managerDepartment = n.staffGradeId
this.teacherForm.managerWorkNumber = n.workNumber
this.isManager = true
this.teacherForm.managerStaffId = n.staffId
this.getDepartment(2)
}else if(n.roleId == 3){
this.teacherForm.teacherMajor = n.staffProfessionalArchitectureId
this.teacherForm.teacherDepartment = n.staffGradeId
this.teacherForm.teacherWorkNumber = n.workNumber
this.isTeacher = true
this.teacherForm.teacherStaffId = n.staffId
this.getDepartment(3)
}
})
}).catch(res => {});
},
editTeacher(row){
this.isDetail = false
this.teacherVisible = true
this.isAddteacher = false
this.AccountNoAdd = false
this.teacherForm.teacherId = row.userId
this.majorList = this.$refs.getSelectData.majorList
this.isNewUser = 0
this.getStaffDetail(row.userId)
},
showTeacher(row){
this.isDetail = true
this.teacherVisible = true
this.isAddteacher = false
this.AccountNoAdd = false
this.teacherForm.teacherId = row.userId
this.majorList = this.$refs.getSelectData.majorList
this.isNewUser = 0
this.getStaffDetail(row.userId)
},
getDepartment(type){
let data = {
staffProfessionalArchitectureId: type == 2 ? this.teacherForm.managerMajor : this.teacherForm.teacherMajor
}
this.$get(this.api.queryStaffGrade,data).then(res => {
if(type == 2){
this.managerDepartmentList = res.message
}else{
this.teacherDepartmentList = res.message
}
}).catch(res => {});
},
async phoneChange(){
let res = await this.$get(this.api.queryPhone, { phone: this.teacherForm.phone });
if(res.message.length != 0){
this.$message.warning('该手机号已存在');
this.NoAdd = false
}else{
this.NoAdd = true
}
},
async accountChange(){
let res = await this.$get(this.api.queryAccountIsExist, {
account: this.teacherForm.userAccount,
schoolId: this.schoolId
});
if(this.isAddteacher){
this.isManager = false
this.isTeacher = false
}
if(res.message.user.length != 0){
let user = res.message.user[0];
let or = res.message.OR;
this.$message.warning('该账号已存在');
this.teacherForm.email = user.email
this.teacherForm.phone = user.phone
this.teacherForm.uniqueIdentificationAccount = user.uniqueIdentificationAccount
this.teacherForm.userName = user.userName
// this.teacherForm.schoolId = user.schoolId
this.teacherForm.userId = user.userId
this.isNewUser = 0
or.forEach((n,i) => {
this.teacherForm.roleValue.push(this.roleStatus(n.roleId))
if(n.roleId == 2) {
this.teacherForm.managerMajor = n.oneDepartmentId
this.teacherForm.managerDepartment = n.twoDepartmentId
this.teacherForm.managerWorkNumber = n.workNumber
this.teacherForm.managerSchoolId = n.schoolId
this.teacherForm.managerSchoolName = n.schoolName
this.isManager = true
this.getDepartment(2)
}else if(n.roleId == 3){
this.teacherForm.teacherMajor = n.oneDepartmentId
this.teacherForm.teacherDepartment = n.twoDepartmentId
this.teacherForm.teacherWorkNumber = n.workNumber
this.teacherForm.teacherSchoolId = n.schoolId
this.teacherForm.tacherSchoolName = n.schoolName
this.isTeacher = true
this.getDepartment(3)
}
})
this.AccountNoAdd = false
}else{
this.isNewUser = 1
this.AccountNoAdd = true
}
},
async submitOnlyId(){
if(this.teacherForm.managerWorkNumber != ''){
this.OnlyId(2)
}else if(this.teacherForm.teacherWorkNumber != ''){
this.OnlyId(3)
}
},
async OnlyId(type){
let data = {};
let msg = '';
if(type == 2){
data = {
workNumber: this.teacherForm.managerWorkNumber,
roleId: 2,
schoolId: this.teacherForm.schoolId
}
msg = '该管理员工号已存在'
}else if(type == 3){
data = {
workNumber: this.teacherForm.teacherWorkNumber,
roleId: 3,
schoolId: this.teacherForm.schoolId
}
msg = '该老师工号已存在'
}
let res = await this.$get(this.api.queryWorkNumberIsExist, data);
if(JSON.stringify(res.message) != '{}'){
this.$message.warning(msg);
type == 2 ? (this.managerNumberNoAdd = false) : (this.teacherNumberNoAdd = false)
}else{
let timestamp = Date.parse(new Date());
this.teacherForm.uniqueIdentificationAccount = `${this.schoolId}${this.teacherForm.uniqueIdentificationAccount}${timestamp}`
type == 2 ? (this.managerNumberNoAdd = true) : (this.teacherNumberNoAdd = true)
}
},
async saveSure(teacherForm){
this.$refs[teacherForm].validate((valid) => {
if (valid) {
if(this.isAddteacher) {
if(this.isManager && this.isTeacher) return this.$message.warning('该用户已经是老师和管理员,请重新添加');
if(this.isManager && !this.teacherForm.roleValue.some((n) => n == '老师')) return this.$message.warning('该用户已经是管理员');
if(this.isTeacher && !this.teacherForm.roleValue.some((n) => n == '管理员')) return this.$message.warning('该用户已经是老师');
if(!this.AccountNoAdd) return this.$message.warning('该账号已存在');
if(this.NoAdd == '' && this.teacherForm.phone){
this.phoneChange()
if(!this.NoAdd) return false
}else if(this.NoAdd === false) return this.$message.warning('该手机号已存在');
}
if(!this.managerNumberNoAdd) return this.$message.warning('该管理员工号已存在');
if(!this.teacherNumberNoAdd) return this.$message.warning('该老师工号已存在');
let roleId = []
this.teacherForm.roleValue.forEach((n,k) => {
n == '老师' && roleId.push(3)
n == '管理员' && roleId.push(2)
})
let data = {
userName: this.teacherForm.userName,
account: this.teacherForm.userAccount,
schoolId: this.teacherForm.schoolId,
roleId: roleId.join(','),
phone: this.teacherForm.phone,
email: this.teacherForm.email,
uniqueIdentificationAccount: this.teacherForm.uniqueIdentificationAccount ? this.teacherForm.uniqueIdentificationAccount : Date.parse(new Date()),
userId: this.teacherForm.userId ? this.teacherForm.userId : ''
}
data.staff = [];
// if(!this.isManager && this.teacherForm.managerWorkNumber){
if((!this.isAddteacher && this.isManager) || (this.isAddteacher && !this.isManager && this.teacherForm.managerWorkNumber)){
let oneDepartmentName = '';
for(let i in this.majorList){
if(this.majorList[i].staffProfessionalArchitectureId == this.teacherForm.managerMajor) {
oneDepartmentName = this.majorList[i].staffProfessionalArchitectureName
break;
}
}
console.log(11,this.managerDepartmentList,this.teacherForm.managerDepartment)
let twoDepartmentName = this.managerDepartmentList.find((n) => {
return n.staffGradeId == this.teacherForm.managerDepartment
}).staffGradeName;
let orList = {
roleId: 2,
staffId: this.teacherForm.managerStaffId,
workNumber: this.teacherForm.managerWorkNumber,
staffProfessionalArchitectureId: this.teacherForm.managerMajor,
staffGradeId: this.teacherForm.managerDepartment,
staffProfessionalArchitectureName: oneDepartmentName,
staffGradeName: twoDepartmentName,
};
data.staff.push(orList)
}
// if(!this.isTeacher && this.teacherForm.teacherWorkNumber){
if((!this.isAddteacher && this.isTeacher) || (this.isAddteacher && !this.isTeacher && this.teacherForm.teacherWorkNumber)){
let oneDepartmentName = '';
for(let i in this.majorList){
if(this.majorList[i].staffProfessionalArchitectureId == this.teacherForm.teacherMajor) {
oneDepartmentName = this.majorList[i].staffProfessionalArchitectureName
break;
}
}
console.log(22,this.teacherDepartmentList,this.teacherForm.teacherDepartment)
let twoDepartmentName = this.teacherDepartmentList.find((n) => {
return n.staffGradeId == this.teacherForm.teacherDepartment
}).staffGradeName;
let orList = {
roleId: 3,
staffId: this.teacherForm.teacherStaffId,
workNumber: this.teacherForm.teacherWorkNumber,
staffProfessionalArchitectureId: this.teacherForm.teacherMajor,
staffGradeId: this.teacherForm.teacherDepartment,
staffProfessionalArchitectureName: oneDepartmentName,
staffGradeName: twoDepartmentName,
};
data.staff.push(orList)
}
if(this.teacherForm.teacherId){
this.$put(this.api.updateStaff,data).then(res => {
this.teacherVisible = false
this.$message.success('编辑成功');
this.getData()
}).catch(res => {});
}else{
this.$post(this.api.addStaff,data).then(res => {
this.teacherVisible = false
this.$message.success('添加成功');
this.getData()
}).catch(res => {});
}
}else{
return false;
}
})
},
delTeacher(row){
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(this.api.daleteBatchStaff,[row.userId]).then(res => {
this.$message.success('删除成功')
this.getData()
}).catch(res => {});
})
.catch(() => {});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
delAllSelection() {
if(this.multipleSelection.length != ''){
let newArr = this.multipleSelection
let delList = newArr.map(item => {
return item.userId
})
//
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
let data = delList
this.$post(this.api.daleteBatchStaff,data).then(res => {
this.multipleSelection = [];
this.$message.success('删除成功')
this.getData()
}).catch(res => {});
}).catch(() => {});
}else{
this.$message.error('请先选择员工 !')
}
},
batchImport(){
this.importVisible = true
this.uploadList = []
this.uploadFaild = false
},
searchTeacher(){
this.pageNo = 1;
this.getData()
},
handleCurrentChange(val) {
this.pageNo = val;
this.getData();
},
downLoad(){
location.href = this.api.downloadStaff
},
showFaild(){
location.href = `${this.api.export_failureStaff}?token=${this.token}`
},
//
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
uploadSuccess(res, file, fileList) {
this.uploadFaild = false
if(res.errmessage == 'success'){
if(res.data.token){
this.token = res.data.token
this.uploadFaild = true
}else{
this.$message.success('上传成功')
}
}else{
res.message ? this.$message.error(res.message) : this.$message.error('上传失败,请检查数据')
}
},
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
this.uploadFaild = false
},
uploadSure(){
this.importVisible = false
this.pageNo = 1
this.keyword = ''
this.getData()
},
//
getSubject(){
this.$get(this.api.queryCourseDiscipline).then(res => {
this.subjectList = res.message
}).catch(res => {});
},
//
clearClass(){
this.teacherForm.professionalClassId = '',
this.teacherForm.professionalId = ''
},
//
getProfessionalClass(){
this.clearClass()
if(this.teacherForm.disciplineId){
this.getProfessionalClassData()
}
},
getProfessionalClassData(){
let data = {
disciplineId: this.teacherForm.disciplineId
}
this.$get(this.api.queryCourseProfessionalClass,data).then(res => {
this.ProfessionalClassList = res.message
}).catch(res => {});
},
//
clearProfess(){
this.teacherForm.professionalId = ''
},
//
getProfessional(){
this.clearProfess()
if(this.teacherForm.professionalClassId){
this.getProfessionalData()
}
},
getProfessionalData(){
let data = {
professionalClassId: this.teacherForm.professionalClassId
}
this.$get(this.api.queryCourseProfessional,data).then(res => {
this.ProfessionalList = res.message
}).catch(res => {});
}
}
};
</script>
<style scoped>
.el-container{
background-color: #f0f0f0;
}
.mag{
margin-right: 20px;
margin-left: 20px;
}
</style>

@ -0,0 +1,357 @@
<template>
<div>
<div>
<lctree :data="majorList"
@addMajor="addMajor" @editMajor="editMajor" @delMajor="delMajor"
@addDepartment="addDepartment" @editDepartment="editDepartment" @delDepartment="delDepartment"
@fircheckitem="fircheckitem" @twocheckitem="twocheckitem"
></lctree>
</div>
<!-- 添加专业 -->
<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-item prop="majorName">
<el-input placeholder="请输入专业名称" v-model="Form.majorName" @change="majorChange"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="isaddMajor = false"> </el-button>
<el-button type="primary" @click="sure('Form')"> </el-button>
</span>
</el-dialog>
<!-- 添加部门 -->
<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-item prop="departmentName">
<el-input placeholder="请输入部门名称" v-model="Form.departmentName"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="isAddDepartment = false"> </el-button>
<el-button type="primary" @click="sureDepartment('Form')"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import lctree from './Stafftree';
export default {
props:["Data"],
data() {
return {
majorList: [],
firactive: 0,
twoactive: 0,
isaddMajor: false,
isAddDepartment: false,
schoolId: 2105,
Form: {
MajorId: '',
majorName: '',
departmentId: '',
departmentName: ''
},
rules: {
majorName: [
{ required: true, message: '请输入专业名称', trigger: 'blur' }
],
departmentName: [
{ required: true, message: '请输入部门名称', trigger: 'blur' }
]
},
staffstateProfessId: '',
staffstateId: '',
majorNoAdd: true
};
},
components: {
lctree
},
mounted(){
this.getStaff()
},
methods: {
getStaff(){
let data = {
schoolId: this.schoolId
}
this.$get(this.api.queryStaffPro,data).then(res => {
if(res.message){
res.message.map(e => {
(e.ifVisible = false), (e.ischeck = false), (e.label = e.staffProfessionalArchitectureName);
let data = {
staffProfessionalArchitectureId: e.staffProfessionalArchitectureId
}
this.$get(this.api.queryStaffGrade,data).then(res => {
res.message.map(e => {
(e.ischeck = false), (e.label = e.staffGradeName);
})
e.children = res.message
}).catch(res => {});
})
}
setTimeout(() => {
this.majorList = res.message
}, 500);
}).catch(res => {});
},
//
fircheckitem(item){
this.$emit("fircheck",item,this.majorList)
},
//
twocheckitem(item){
this.$emit("twocheck",item,this.majorList)
},
closeAdd(){
this.$refs.Form.resetFields()
},
//
addMajor(){
this.Form.MajorId = ''
this.Form.majorName = ''
this.isaddMajor = true
},
editMajor(item){
this.Form.MajorId = item.staffProfessionalArchitectureId,
this.Form.majorName = item.staffProfessionalArchitectureName
this.isaddMajor = true
},
async majorChange(){
let res = await this.$get(this.api.queryStaffPAN, { name: this.Form.majorName });
if(res.message.length != 0){
this.$message.warning('该一级部门已存在');
this.majorNoAdd = false
}else{
this.majorNoAdd = true
}
},
sure(Form){
this.$refs[Form].validate((valid) => {
if (valid) {
if(!this.majorNoAdd) return this.$message.warning('该一级部门已存在');
let data = {
staffProfessionalArchitectureName: this.Form.majorName,
staffProfessionalArchitectureId: this.Form.MajorId,
schoolId: this.schoolId,
}
if(this.Form.MajorId){
this.$post(this.api.updateStaffPro,data).then(res => {
this.$message.success('编辑成功');
this.isaddMajor = false
this.majorList.map(e =>{
if(e.staffProfessionalArchitectureId == this.Form.MajorId){
e.staffProfessionalArchitectureName = this.Form.majorName
e.label = this.Form.majorName
}
})
this.$emit('getData')
}).catch(res => {});
}else{
this.$post(this.api.addStaffPro,data).then(res => {
this.$message.success('添加成功');
this.isaddMajor = false
let newData = {
staffProfessionalArchitectureId: res.message,
staffProfessionalArchitectureName: this.Form.majorName,
label: this.Form.majorName,
ifVisible: false,
ischeck: false,
children: []
}
this.majorList.push(newData)
}).catch(res => {});
}
}else{
return false;
}
})
},
//
addDepartment(item){
this.Form.departmentId = ''
this.Form.departmentName = ''
this.isAddDepartment = true
this.Form.MajorId = item.staffProfessionalArchitectureId
},
editDepartment(item){
this.Form.departmentId = item.staffGradeId,
this.Form.departmentName = item.staffGradeName
this.isAddDepartment = true
for (let j = 0; j < this.majorList.length; j++) {
for (let k = 0; k < this.majorList[j].children.length; k++) {
if(this.majorList[j].children[k].staffGradeName == item.staffGradeName){
this.Form.MajorId = this.majorList[j].staffProfessionalArchitectureId
}
}
}
},
sureDepartment(Form){
this.$refs[Form].validate((valid) => {
if (valid) {
let data = {
staffGradeName: this.Form.departmentName,
staffProfessionalArchitectureId: this.Form.MajorId,
staffGradeId: this.Form.departmentId
}
if(this.Form.departmentId){
this.$post(this.api.updateStaffGrade,data).then(res => {
this.$message.success('编辑成功');
this.isAddDepartment = false
this.majorList.map(e =>{
e.children.map(r =>{
if(r.staffGradeId == this.Form.departmentId){
r.staffGradeName = this.Form.departmentName
r.label = this.Form.departmentName
}
})
})
}).catch(res => {});
}else{
this.$post(this.api.addStaffGrade,data).then(res => {
this.$message.success('添加成功');
this.isAddDepartment = false
let newData = {
staffGradeId: res.message,
staffGradeName: this.Form.departmentName,
label: this.Form.departmentName,
ifVisible: false,
ischeck: false
}
this.majorList.map(e =>{
if(e.staffProfessionalArchitectureId == this.Form.MajorId){
e.ifVisible = true
e.children.push(newData)
}
})
}).catch(res => {});
}
}else{
return false;
}
})
},
delMajor(item,index){
this.$confirm('确定要删除该专业吗?', '提示', {
type: 'warning'
})
.then(() => {
let data = {
staffProfessionalArchitectureId: item.staffProfessionalArchitectureId
}
this.$post(this.api.deleteStaffPro,data).then(res => {
this.$message.success('删除成功');
this.majorList.splice(index, 1)
}).catch(res => {});
})
.catch(() => {});
},
delDepartment(item,indx){
this.$confirm('确定要删除该部门吗?', '提示', {
type: 'warning'
})
.then(() => {
let data = {
staffGradeId: item.staffGradeId
}
this.$post(this.api.deleteStaffGrade,data).then(res => {
this.$message.success('删除成功');
this.majorList.map(e =>{
e.children.map(r =>{
if(r.staffGradeId == item.staffGradeId){
e.children.splice(indx,1)
if(e.children.length == 0){
e.ifVisible = false
}
}
})
})
}).catch(res => {});
})
.catch(() => {});
}
}
};
</script>
<style scoped>
.side_view{
height: 800px;
padding: 40px 20px;
background-color: #fff;
box-shadow:-2px 0px 57px 0px rgba(192,189,216,0.39);
}
.side_icon{
text-align: right;
}
.side_icon i{
cursor:pointer;
font-size: 20px;
color: #9278FF;
}
.side_tree{
width: 100%;
font-size: 14px;
color: #333;
}
.side_tree i{
color: #9278FF;
margin-left: 10px;
}
.fir_back{
width: 100%;
padding: 15px 0;
background:rgba(255,255,255,1);
/* box-shadow:1px 14px 29px 0px rgba(138,97,250,0.19); */
border-radius:10px;
text-align: left;
}
.fir_back:first-child{
margin-top: 20px;
}
.fir_back:hover{
box-shadow:1px 14px 29px 0px rgba(138,97,250,0.19);
cursor:pointer;
}
.fir_back span{
margin-left: 10px;
}
.two_active{
color: #9278FF;
}
/* .two_active:hover{
color: #9278FF;
cursor:pointer;
} */
.two_back:hover{
cursor:pointer;
color: #9278FF;
}
.mar_top{
margin-top: 20px;
}
.back_active{
box-shadow:1px 14px 29px 0px rgba(138,97,250,0.19);
}
.bor_lef{
padding: 20px 0 0 0;
margin-left: 40px;
}
.three_lef{
margin-left: 60px;
padding: 20px 0;
}
.three_text{
font-size: 14px;
margin-top: 10px;
}
.teacher_tab{
margin-left: 20px;
}
.icon_select:before{
transform: rotate(180deg);
}
.list-enter-active, .list-leave-active { transition: all 1s; }
.list-enter, .list-leave-to { opacity: 0; transform: translateY(-30px); }
</style>

@ -0,0 +1,250 @@
<template>
<div class="side_view">
<p class="side_icon mab20">
<i class="icon-jiahao mar20" @click="addMajor"></i>
<!-- <i class="icon-delete"></i> -->
</p>
<div class="side_tree" v-for="(item,index) in data" :key="index">
<div class="item" @click.stop="open(item,1)">
<!-- <i :class="{ 'arrowTransform': !item.ifVisible, 'arrowTransformReturn': item.ifVisible}" class="icon-shixiangyoujiantou-"></i> -->
<img
v-if="item.children&&item.children.length!=0"
:class="{ 'arrowTransform': !item.ifVisible, 'arrowTransformReturn': item.ifVisible}"
src="../../assets/img/icon-xiangyou.png"
alt
/>
<i v-else class="empty"></i>
<i :class="item.ischeck ? 'icon-yigouxuan' : 'icon-weigouxuan'" @click.stop="fircheckitem(item)"></i>
<span>{{item.label}}</span>
<svg t="1604370117041" class="icon edit ft" @click.stop="editMajor(item)" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9029" width="16" height="16"><path d="M511.979 30.125c-266.13 0-481.871 215.741-481.871 481.871s215.741 481.871 481.871 481.871S993.85 778.126 993.85 511.996 778.109 30.125 511.979 30.125zM459.644 693.015c-15.876 18.135-22.818 22.486-44.972 30.657-34.111 12.787-96.687 36.27-137.374 51.515-7.706 3.056-36.735 1.495-24.578-27.036 13.784-39.757 34.045-98.414 45.636-131.894 8.436-23.615 11.758-29.76 28.73-45.603l175.271-175.271 124.055 124.088C626.413 519.471 508.469 642.264 459.644 693.015zM653.084 492.867 528.996 368.779l26.605-26.605 124.088 124.121L653.084 492.867zM759.469 386.482l-53.176 53.209L582.205 315.569l53.209-53.176c19.596-19.596 51.316-19.596 70.912 0l53.209 53.176C779.065 335.166 779.065 366.919 759.469 386.482z" p-id="9030" fill="#9076ff"></path></svg>
<i class="el-icon-circle-plus ft" @click.stop="addDepartment(item)"></i>
<i class="icon-delete ft" @click.stop="delMajor(item,index)"></i>
</div>
<div v-show="item.ifVisible" v-if="item.children&&item.children.length!=0">
<div v-for="(item1,index1) in item.children" :key="index1">
<div class="item2" @click.stop="open(item1,2)">
<i :class="item1.ischeck ? 'icon-yigouxuan' : 'icon-weigouxuan'" @click.stop="twocheckitem(item1)"></i>
<span>{{item1.label}}</span>
<svg t="1604370117041" class="icon edit ft" @click.stop="editDepartment(item1)" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9029" width="16" height="16"><path d="M511.979 30.125c-266.13 0-481.871 215.741-481.871 481.871s215.741 481.871 481.871 481.871S993.85 778.126 993.85 511.996 778.109 30.125 511.979 30.125zM459.644 693.015c-15.876 18.135-22.818 22.486-44.972 30.657-34.111 12.787-96.687 36.27-137.374 51.515-7.706 3.056-36.735 1.495-24.578-27.036 13.784-39.757 34.045-98.414 45.636-131.894 8.436-23.615 11.758-29.76 28.73-45.603l175.271-175.271 124.055 124.088C626.413 519.471 508.469 642.264 459.644 693.015zM653.084 492.867 528.996 368.779l26.605-26.605 124.088 124.121L653.084 492.867zM759.469 386.482l-53.176 53.209L582.205 315.569l53.209-53.176c19.596-19.596 51.316-19.596 70.912 0l53.209 53.176C779.065 335.166 779.065 366.919 759.469 386.482z" p-id="9030" fill="#9076ff"></path></svg>
<i class="icon-delete ft" @click.stop="delDepartment(item1,index1)"></i>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
Array.prototype.removeByValue = function (val) {
for (var i = 0; i < this.length; i++) {
if (JSON.stringify(this[i]).indexOf(JSON.stringify(val)) != -1) {
this.splice(i, 1);
break;
}
}
};
export default {
data() {
return {
chooseList: []
};
},
watch: {
chooseList(n, o) {
this.$emit('chooseNode', n);
}
},
props: {
data: {
type: Array
}
},
methods: {
//
open(item,type) {
item.ifVisible = !item.ifVisible;
type == 1 ? this.$emit('fircheckitem',item) : this.$emit('twocheckitem',item)
},
//removeByvaluemain.js
choose(item) {
item.ifVisible = !item.ifVisible;
if (item.ifVisible) {
this.chooseList.push(item);
} else {
this.chooseList.removeByValue(item);
}
},
fircheckitem(item){
this.$emit('fircheckitem',item);
},
twocheckitem(item){
this.$emit('twocheckitem',item);
},
//
addMajor(){
this.$emit('addMajor');
},
editMajor(item){
this.$emit('editMajor',item);
},
delMajor(item,index){
this.$emit('delMajor',item,index);
},
//
addDepartment(item){
this.$emit('addDepartment',item);
},
editDepartment(item){
this.$emit('editDepartment',item);
},
delDepart(item,index){
this.$emit('delDepart',item,index);
},
//
addClass(item){
this.$emit('addClass',item);
},
editDepartment(item){
this.$emit('editDepartment',item);
},
delDepartment(item,index){
this.$emit('delDepartment',item,index);
},
//
isHasObj(arr, val) {
var flag = 0; //1 0
for (var i = 0; i < arr.length; i++) {
if (JSON.stringify(arr[i]).indexOf(JSON.stringify(val)) != -1) {
flag = 1;
}
}
if (flag == 1) {
return true;
} else {
return false;
}
}
}
};
</script>
<style lang="scss" scoped>
$insideColor: rgba(245, 242, 255, 0.8); //
$outColor: rgba(255, 255, 255, 0.8); //
//,item
@mixin public {
cursor: pointer;
font-size: 18px;
color: #333333;
display: flex;
align-items: center;
img {
height: 20px;
width: 20px;
margin-left: 10px;
}
}
.main {
width: 100%;
}
.item {
@include public;
width: 100%;
padding: 15px 0;
background:rgba(255,255,255,1);
box-shadow:1px 14px 29px 0px rgba(138,97,250,0.19);
border-radius:10px;
text-align: left;
margin-top: 20px;
}
.item:first{
margin-top: 0;
}
.item .empty{
width: 20px;
}
.edit{
width: 16px !important;
height: 16px !important;
margin-left: 10px;
}
.item2 {
@include public;
margin-top: 20px;
margin-left:60px
}
.item2:hover{
color: #9278FF;
}
//ul,li
ul,
li {
padding: 0;
margin: 0;
list-style: none;
}
// 使
.arrowTransform {
transition: 0.4s;
transform-origin: center;
transform: rotateZ(0deg);
}
.arrowTransformReturn {
transition: 0.4s;
transform-origin: center;
transform: rotateZ(90deg);
}
//
.checkBox {
width: 14px;
height: 14px;
border-radius: 7px;
margin-left: 10px;
margin-right: 10px;
border: 2px solid rgba(146, 120, 255, 1);
}
//
.isActive {
background: url('../../assets/img/icon-yigouxuan.png');
background-size: 14px 14px; /*按比例缩放*/
}
.side_view{
// height: 800px;
padding: 40px 20px;
background-color: #fff;
box-shadow:-2px 0px 57px 0px rgba(192,189,216,0.39);
i {
color: #9278FF;
}
}
.side_icon{
text-align: right;
}
.side_icon i{
cursor:pointer;
font-size: 20px;
}
.side_tree{
width: 100%;
font-size: 14px;
color: #333;
i{
margin-left: 10px;
}
span{
margin-left: 5px;
font-size: 14px;
}
}
</style>

@ -0,0 +1,538 @@
<template>
<div>
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>筛选</span>
</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>
</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="addStudent">新增学生</el-button>
<el-button type="primary" size="small" round @click="batchImport">批量导入</el-button>
<el-button type="primary" size="small" round @click="delAllSelection">批量删除</el-button>
</div>
</div>
<el-table :data="studentData" 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="schoolName" 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">
<template slot-scope="scope">
{{roleStatus(scope.row.roleId)}}
</template>
</el-table-column>
<el-table-column prop="loginNumber" label="登录次数" align="center">
</el-table-column>
<el-table-column prop="lastLoginTime" label="上次登录时间" align="center">
</el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button type="text" @click="editStudent(scope.row,true)">查看</el-button>
<el-button type="text" @click="editStudent(scope.row,false)">编辑</el-button>
<el-button type="text" @click="resetPassword(scope.row)">重置密码</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-switch
v-model="scope.row.disableAccount"
:active-value="0"
:inactive-value="1"
style="margin: 0 5px"
@change="switchOff($event,scope.row,scope.$index)"
></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="currentChange" :current-page="pageNo" layout="total, prev, pager, next" :total="totals">
</el-pagination>
</div>
</el-card>
<el-dialog :title="isDetail ? '查看学生' : (isAdd ? '新增学生' : '编辑学生')" :visible.sync="studentVisible"
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-item prop="account" label="账号">
<el-input v-model="form.account" placeholder="请输入学生账号" @change="accountChange"></el-input>
</el-form-item>
<el-form-item prop="userName" label="学生姓名">
<el-input v-model="form.userName" placeholder="请输入学生姓名"></el-input>
</el-form-item>
<el-form-item prop="roleId" label="账号角色">
学生
</el-form-item>
<el-form-item prop="workNumber" label="学生学号">
<el-input v-model="form.workNumber" placeholder="" @change="worknumberChange"></el-input>
</el-form-item>
<el-form-item prop="phone" label="手机号">
<el-input v-model="form.phone" placeholder="可用于登录平台,以及找回密码" maxlength="11" @change="phoneChange"></el-input>
</el-form-item>
<el-form-item prop="email" label="邮箱">
<el-input v-model="form.email" placeholder="可用于登录平台,以及找回密码"></el-input>
</el-form-item>
<el-form-item prop="schoolAppellationId" label="所在院校">
<el-select v-model="form.schoolAppellationId" placeholder="默认为当前院校(可修改)" filterable>
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="uniqueIdentificationAccount" label="唯一标识">
<el-input disabled v-model="form.uniqueIdentificationAccount"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer" v-if="!isDetail">
<el-button @click="studentVisible = false">取消</el-button>
<el-button type="primary" @click="saveData"> </el-button>
</span>
</el-dialog>
<!-- 批量导入 -->
<el-dialog title="批量导入" :visible.sync="importVisible" width="24%" center :close-on-click-modal="false">
<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>
<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.uploadFile"
:file-list="uploadList"
name="file"
>
<el-button type="primary" class="ml20">上传文件<i class="el-icon-upload2 el-icon--right"></i></el-button>
</el-upload>
<el-link v-if="uploadFaild" type="primary" @click="showFaild">导入失败查看原因</el-link>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="importVisible = false"> </el-button>
<el-button type="primary" @click="uploadSure"> </el-button>
</span>
</el-dialog>
<el-dialog
title="重置密码"
:visible.sync="passwordVisible"
:close-on-click-modal="false"
@close="closePassword"
width="30%">
<el-form ref="passwordForm" :model="form" label-width="60px">
<el-form-item label="原密码">
<el-input type="password" v-model="passwordForm.password" placeholder="请输入原密码"></el-input>
</el-form-item>
<el-form-item label="新密码">
<el-input type="password" v-model="passwordForm.newPassword" placeholder="请输入新密码" @keyup.enter.native="editPassword"></el-input>
</el-form-item>
<el-form-item label="新密码">
<el-input type="password" v-model="passwordForm.reNewPassword" placeholder="请确认新密码" @keyup.enter.native="editPassword"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="passwordVisible = false"> </el-button>
<el-button type="primary" @click="editPassword"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import bus from '../common/bus';
export default {
name: 'dashboard',
data() {
return {
isDetail: false,
keyword: '',
schoolId: 2105,
form: {
userName: '',
account: '',
phone: '',
uniqueIdentificationAccount: '',
workNumber: '',
email: '',
account: '',
roleId: 4,
schoolId: 2105,
schoolAppellationId: ''
},
rules: {
account: [
{ required: true, message: '请输入账号', trigger: 'blur' },
// {
// pattern: /^[A-Za-z0-9]*$/,
// message: '',
// trigger: 'blur'
// }
],
userName: [
{ required: true, message: '请输入学生姓名', trigger: 'blur' }
],
schoolAppellationId: [
{ required: true, message: '请选择所在院校', trigger: 'change' }
],
// uniqueIdentificationAccount: [
// { required: true, message: '', trigger: 'blur' },
// ],
workNumber: [
{ required: true, message: '请输入学生学号', trigger: 'blur' }
],
phone: [
// { required: true, message: '', trigger: 'blur' },
{
pattern: /^1[3456789]\d{9}$/,
message: '请输入正确的手机号',
trigger: 'blur'
}
],
email: [
// { required: true, message: '', trigger: 'blur' },
{
pattern: /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/,
message: '请输入正确的邮箱',
trigger: 'blur'
}
]
},
studentData:[],
pageNo: 1,
pageSize: 10,
totals: 0,
multipleSelection: [],
uploadList: [],
importVisible: false,
isAdd: true,
studentVisible: false,
accountReapeat: false,
phoneRepeat: false,
workNumberReapeat: false,
isDetail: false,
resetVisible: false,
passwordVisible: false,
passwordForm: {
password: '',
newPassword: '',
reNewPassword: ''
},
schoolList: [],
uploadFaild: false,
token: ''
};
},
mounted() {
this.form.schoolAppellationId = 2105
this.getData()
this.getSchoolData()
},
watch: {
keyword: function(val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.getData()
},500)
}
},
methods: {
getData() {
let data = {
schoolId: this.schoolId,
seachContent: this.keyword,
page: this.pageNo,
size: this.pageSize
}
this.$get(this.api.queryStudent,data).then(res => {
this.studentData = res.data.list
this.totals = res.data.totalCount
}).catch(res => {});
},
saveData() {
this.$refs.form.validate((valid) => {
if (valid) {
if(this.accountReapeat) return this.$message.warning('该账号已存在')
if(this.workNumberReapeat) return this.$message.warning('该学生学号已存在')
if(this.phoneRepeat) return this.$message.warning('该手机号已存在')
// return console.log(11,this.form)
if(this.form.studentId) {
this.$put(this.api.updateStudent,this.form).then(res => {
if(res.errmessage == 'success') {
this.$message.success('提交成功!');
this.studentVisible = false
this.getData()
}else{
this.$message.error(res.message);
}
}).catch(res => {});
}else{
this.form.uniqueIdentificationAccount = new Date().getTime()
this.$post(this.api.addStudent,this.form).then(res => {
if(res.errmessage == 'success') {
this.$message.success('提交成功!');
this.studentVisible = false
this.getData()
}else{
this.$message.error(res.message);
}
}).catch(res => {});
}
}else{
return false;
}
})
},
async accountChange(){
let res = await this.$get(this.api.queryAccountIsExist, {
account: this.form.account,
schoolId: this.schoolId
});
if(res.message.user.length){
this.$message.warning('该账号已存在');
this.accountReapeat = true
}else{
this.accountReapeat = false
}
},
async worknumberChange(){
let res = await this.$get(this.api.queryWorkNumberIsExist, {
workNumber: this.form.workNumber,
roleId: 4,
schoolId: this.schoolId
});
if(JSON.stringify(res.message) != '{}'){
this.$message.warning('该学生学号已存在');
this.workNumberReapeat = true
}else{
this.workNumberReapeat = false
}
},
async phoneChange(){
let res = await this.$get(this.api.queryPhone, { phone: this.regForm.phone });
if(res.message.length != 0){
this.$message.warning('该手机号已存在');
this.phoneRepeat = true
}else{
this.phoneRepeat = false
}
},
batchImport(){
this.importVisible = true
this.uploadList = []
this.uploadFaild = false
},
// /
getSchool(){
this.clearcity()
this.getSchoolData()
this.pageNo = 1
this.getData()
},
getSchoolData(){
let data = {
schoolName: '',
provinceId: '',
cityId: ''
}
this.$get(this.api.querySchool,data).then(res => {
this.schoolList = res.message
}).catch(res => {});
},
closeStudent(){
this.isDetail = false
this.$refs.form.clearValidate()
this.form = {
schoolId: 2105,
userName: '',
account: '',
phone: '',
uniqueIdentificationAccount: '',
workNumber: '',
email: '',
account: '',
roleId: 4,
schoolAppellationId: 2105
}
},
currentChange(val) {
this.pageNo = val;
this.getData();
},
addStudent(){
this.isAdd = true
this.studentVisible = true
},
editStudent(row,isDetail){
this.isAdd = false
this.isDetail = isDetail
this.studentVisible = true
this.form = Object.assign({},row)
this.$nextTick(() => {
this.$refs.form.clearValidate()
})
},
downLoad(){
location.href = this.api.download
},
handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
})
.then(() => {
this.$post(this.api.daleteStudent,[row.studentId]).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 item.studentId
})
this.$confirm('确定要删除选中用户吗?', '提示', {
type: 'warning'
})
.then(() => {
let data = delList
this.$post(this.api.daleteStudent,data).then(res => {
this.multipleSelection = [];
this.$message.success('删除成功');
this.getData()
}).catch(res => {});
}).catch(() => {});
}else{
this.$message.error('请先选择数据 !');
}
},
resetPassword(row){
this.$confirm(`重置后的密码为:${this.$config.initialPassword},确定重置?`, '提示', {
}).then(() => {
this.$put(this.api.reSetPassword,[row.userId]).then(res => {
if(res.errmessage == 'success') this.$message.success('重置成功')
}).catch(res => {});
}).catch(() => {
});
},
switchOff(val,row,index) {
console.log(11,val,row)
let data = {
studentId: row.studentId,
disableAccount: row.disableAccount ? 0 : 1
}
this.$put(this.api.disableAccount,data)
.then(res => {})
.catch(err => {});
},
closePassword() {
this.passwordForm = {
password: '',
newPassword: '',
reNewPassword: ''
}
},
editPassword(){
if(!this.passwordForm.password) return this.$message.warning('请输入原密码')
if(!this.passwordForm.newPassword) return this.$message.warning('请输入新密码')
if(!this.passwordForm.reNewPassword) return this.$message.warning('请确认新密码')
if(this.passwordForm.newPassword.length < 6 || this.passwordForm.reNewPassword.length < 6) return this.$message.warning('请输入6位数以上的密码')
if(this.passwordForm.newPassword !== this.passwordForm.reNewPassword) return this.$message.warning('输入的新密码不一致,请重新确认')
if(this.passwordForm.password === this.passwordForm.newPassword) return this.$message.warning('原密码跟新密码不能一致')
let data = this.passwordForm
data.userid = this.userId
this.$put(this.api.reSetPassword,data)
.then(res => {
if(res.errmessage == 'success'){
this.$message.success('更换成功')
this.passwordVisible = false
}
})
.catch(err => {
console.log(err);
});
},
//
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
showFaild(){
location.href = `${this.api.export_failure}?token=${this.token}`
},
uploadSuccess(res, file, fileList) {
this.uploadFaild = false
if(res.errmessage == 'success'){
if(res.data.token){
this.token = res.data.token
this.uploadFaild = true
}else{
this.$message.success('上传成功')
}
}else{
res.message ? this.$message.error(res.message) : this.$message.error('上传失败,请检查数据')
}
},
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
this.uploadFaild = false
},
uploadSure(){
this.importVisible = false
this.pageNo = 1
this.keyword = ''
this.getData()
},
}
};
</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>

@ -0,0 +1,103 @@
<template>
<div class="Achievement-container">
<div class="tabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == activeName}" @click="tabChange(index)">{{item}}</a>
</div>
<div class="score-table" v-if="activeName == 'first'">
<staff></staff>
</div>
<div class="score-table" v-else>
<role></role>
</div>
</div>
</template>
<script>
import staff from './Staff.vue';
import role from './Role.vue';
export default {
data() {
return {
activeName: 'first',
userId: this.$store.state.userId,
tabs: {
first: '员工管理',
second: '角色权限'
}
};
},
components: {
staff,
role
},
created() {
},
methods: {
tabChange(index){
this.activeName = index
}
}
};
</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,307 @@
<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>

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

@ -0,0 +1,28 @@
export default {
/**
* @description 配置显示在浏览器标签的title
*/
title: '四川大学虚拟仿真系统',
/**
* @description 是否使用国际化默认为false
* 如果不使用则需要在路由中给需要在菜单中展示的路由设置meta: {title: 'xxx'}
* 用来在菜单中显示文字
*/
locale: 'zh',
/**
* @description 跳转子系统链接
*/
subSystem: 'https://org.modao.cc/app/a53fc614d08c0fd3dd0790914f22935a5922e64f?simulator_type=device&sticky#screen=skdyef0teme1njb',
/**
* @description 新增项目跳转判分点数据存储cookie的key
*/
projectData: 'cd_data',
/**
* @description 默认密码
*/
initialPassword: 'huoran123',
/**
* @description 系统id
*/
systemId: 2,
}

@ -0,0 +1,81 @@
import Vue from 'vue';
import App from './App.vue';
import router from './router';
import ElementUI from 'element-ui';
import VueI18n from 'vue-i18n';
import { messages } from './components/common/i18n';
// import 'element-ui/lib/theme-chalk/index.css'; // 默认主题
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 './util/rem';
import {post,get,del,put} from './utils/http';
import api from './utils/api';
import store from './store'
import config from '@/config'
import { systemStatus, systemTypeStatus, systemAttributionStatus, courseTypeStatus,
hoursStatus, roleStatus, orderTypeFn, orderStatusFn, orderNatureFn, Percentage, removeByValue, formatDate, formateTime, orderRoleType, orderRoleAttribute, setCookie } from './utils/core';
import preventReClick from './store/preventReClick' //防多次点击,重复提交
Vue.prototype.api = api;
Vue.prototype.$get = get;
Vue.prototype.$post = post;
Vue.prototype.$del = del;
Vue.prototype.$put = put;
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.config.productionTip = false;
Vue.use(VueI18n);
Vue.use(ElementUI);
const i18n = new VueI18n({
locale: 'zh',
messages
});
//使用钩子函数对路由进行权限跳转
router.beforeEach((to, from, next) => {
document.title = `${to.meta.title} | ${config.title}`;
const role = sessionStorage.getItem('cd_server_username');
if (!role && to.path !== '/login') {
next('/login')
// if(to.fullPath != '/404' && to.fullPath != '/'){
// next({
// path: '/login',
// query: {redirect: to.fullPath}
// })
// }else{
// next('/login')
// }
} else if(role && to.path == '/login') {
next('/dashboard')
} else {
next();
}
});
new Vue({
router,
store,
i18n,
render: h => h(App)
}).$mount('#app');

@ -0,0 +1,150 @@
import Vue from 'vue';
import Router from 'vue-router';
Vue.use(Router);
export default new Router({
mode: 'hash',
    base: process.env.BASE_URL,
routes: [
{
path: '/',
redirect: '/login'
},
{
path: '/',
component: () => import('../components/common/Home.vue'),
meta: { title: '自述文件' },
children: [
{
path: '/personalcenter',
component: () => import('../components/page/PersonalCenter.vue'),
meta: {
title: '个人中心'
}
},
{
path: '/dashboard',
component: () => import('../components/page/Dashboard.vue'),
meta: { title: '班级教学' }
},
{
path: '/addclass',
component: () => import('../components/page/AddClass.vue'),
meta: { title: '新建班级' }
},
{
path: '/achievement',
component: () => import('../components/page/Achievement.vue'),
meta: { title: '成绩管理' }
},
{
path: '/experiment',
component: () => import('../components/page/Experiment.vue'),
meta: { title: '成绩管理' }
},
{
path: '/addexperiment',
component: () => import('../components/page/AddExperiment.vue'),
meta: { title: '修改分数' }
},
{
path: '/showexperiment',
component: () => import('../components/page/ShowExperiment.vue'),
meta: { title: '查看成绩报告' }
},
{
path: '/user',
component: () => import('../components/page/User.vue'),
meta: { title: '用户管理' }
},
{
path: '/evaluation',
component: () => import('../components/page/Evaluation.vue'),
meta: { title: '测评管理' }
},
{
path: '/project',
component: () => import('../components/page/Project.vue'),
meta: { title: '实验项目管理' }
},
{
path: '/addproject',
component: () => import('../components/page/AddProject.vue'),
meta: { title: '新增项目' }
},
{
path: '/program',
component: () => import('../components/page/Program.vue'),
meta: { title: '查看判分点' }
},
{
path: '/programOptions',
component: () => import('../components/page/ProgramOptions.vue'),
meta: { title: '查看判分点' }
},
{
path: '/student',
component: () => import('../components/page/Student.vue'),
meta: { title: '学生管理' }
},
{
path: '/backstage',
component: () => import('../components/page/Backstage.vue'),
meta: { title: '业务后台' }
},
{
path: '/report',
component: () => import('../components/page/Report.vue'),
meta: { title: '实验报告管理' }
},
{
path: '/reportconfig',
component: () => import('../components/page/ReportConfig.vue'),
meta: { title: '实验报告配置' }
},
{
path: '/teachercomment',
component: () => import('../components/page/TeacherComment.vue'),
meta: { title: '老师评语' }
},
{
path: '/staff',
component: () => import('../components/page/Staff.vue'),
meta: { title: '用户管理' }
},
{
path: '/system',
component: () => import('../components/page/System.vue'),
meta: { title: '系统设置' }
},
{
// 国际化组件
path: '/i18n',
component: () => import(/* webpackChunkName: "i18n" */ '../components/page/I18n.vue'),
meta: { title: '国际化' }
},
{
path: '/404',
component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
meta: { title: '404' }
},
{
path: '/403',
component: () => import(/* webpackChunkName: "403" */ '../components/page/403.vue'),
meta: { title: '403' }
}
]
},
{
path: '/login',
component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
meta: { title: '登录' }
},
{
path: '*',
redirect: '/404'
}
]
});

@ -0,0 +1,72 @@
import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);
const store = new Vuex.Store({
state: {
userPhoto:'http://liuwanr.oss-cn-shenzhen.aliyuncs.com/userAvatars/20200710155726.jpg',
customerId:'',
courseId:'',
userId: '',
roleId: '',
manager:{},
provinceList: [],
configId: '',
systemId: '',
orderId: '',
userLoginId: '',
userRoleId: '',
schoolId: '',
addClass: {},
addProject: {},
experimentData: {
id: '',
name: ''
},
token: ''
},
mutations:{
userData (state, payload) {
state.userId = payload.user_id,
state.roleId = payload.roleId
},
userPhoto(state,payload){
state.userPhoto = payload.userPhoto
},
customerData (state, payload) {
state.customerId = payload.customer_id
},
courseData (state, payload) {
state.courseId = payload.course_id
},
managerData (state, payload) {
state.manager = payload.form
},
provinceData (state, payload) {
state.provinceList = payload.provinceList
},
configData (state, payload) {
state.configId = payload.config_id
},
systemData (state, payload) {
state.systemId = payload.system_id
state.orderId = payload.order_id
},
userLoginData (state, payload) {
state.userLoginId = payload.userLogin_id
state.userRoleId = payload.userRole_id
state.schoolId = payload.schoolId
state.token = payload.token
},
addClassData (state, payload) {
state.addClass = payload.addClass
},
addProjectData (state, payload) {
state.addProject = payload.addProject
},
addExperimentData (state, payload) {
state.experimentData = payload.experimentData
}
}
});
export default store;

@ -0,0 +1,16 @@
import Vue from 'vue'
const preventReClick = Vue.directive('preventReClick', {
inserted: function (el, binding) {
el.addEventListener('click', () => {
if (!el.disabled) {
el.disabled = true
setTimeout(() => {
el.disabled = false
}, binding.value || 1000)
}
})
}
});
export { preventReClick }

@ -0,0 +1,16 @@
// rem等比适配配置文件
// 基准大小
const baseSize = 16
// 设置 rem 函数
function setRem () {
// 当前页面宽度相对于 1920宽的缩放比例,可根据自己需要修改。
const scale = document.documentElement.clientWidth / 1920
// 设置页面根节点字体大小(“Math.min(scale, 2)” 指最高放大比例为2,可根据实际业务需求调整)
document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + 'px'
}
// 初始化
setRem()
// 改变窗口大小时重新设置 rem
window.onresize = function () {
setRem()
}

@ -0,0 +1,130 @@
let host = 'http://139.9.247.137'
// let host = 'http://192.168.31.125:9090'
// let host = 'http://192.168.31.125:1010'
export default {
logins: `${host}/liuwanr/userInfo/adminLogins`, //登录
updateLogInNumber: `http://139.9.247.137/liuwanr/userInfo/updateLogInNumber`, //用户登录修改登录次数和登陆时间
uploadUserAvatars: `${host}/liuwanr/user/uploadUserAvatars`, //上传头像
queryProvince: `${host}/liuwanr/province/queryProvince`, //查询省份
queryCity: `${host}/liuwanr/city/queryCity`, //查询城市
querySchoolData: `${host}/liuwanr/customer/querySchool`, //根据学校名称查询学校信息
queryAccountIsExist:`${host}/liuwanr/userInfo/queryAccountIsExist`,//查询员工,学生账号是否存在接口
queryWorkNumberIsExist:`${host}/liuwanr/userInfo/queryWorkNumberIsExist`,//查询学号、工号是否存在
querySchool: `${host}/liuwanr/customer/querySchool`, //根据学校名称查询学校信息
queryPersonalCenter:`${host}/liuwanr/personalCenter/queryPersonalCenter`,
addStaffPro: `${host}/liuwanr/staffProfessionalArchitecture/addStaffProfessionalArchitecture`, //添加员工专业
queryStaffPro: `${host}/liuwanr/staffProfessionalArchitecture/queryAllStaffProfessionalArchitecture`, //查询员工专业
deleteStaffPro: `${host}/liuwanr/staffProfessionalArchitecture/deleteStaffProfessionalArchitecture`, //删除员工专业
deleteStaffGrade: `${host}/liuwanr/staffGrade/deleteStaffGrade`, //删除员工部门
updateStaffPro: `${host}/liuwanr/staffProfessionalArchitecture/updateStaffProfessionalArchitecture`, //编辑员工专业
queryStaffGrade: `${host}/liuwanr/staffGrade/queryStaffGrade`, //查询员工部门
queryStaffGradeDetails: `${host}/liuwanr/staffGrade/queryStaffGradeDetails`, //查询员工部门详情
addStaffGrade: `${host}/liuwanr/staffGrade/addStaffGrade`, //新增员工部门
updateStaffGrade: `${host}/liuwanr/staffGrade/updateStaffGrade`, //编辑员工部门
queryCourseDiscipline: `${host}/liuwanr/course/queryCourseDiscipline`, //查询课程学科
queryCourseProfessionalClass: `${host}/liuwanr/course/queryCourseProfessionalClass`, //查询专业类
queryCourseProfessional: `${host}/liuwanr/course/queryCourseProfessional`, //查询专业
queryPhone: `${host}/liuwanr/user/queryPhone`, //查询电话是否存在
queryStaffPAN:`${host}/liuwanr/staffProfessionalArchitecture/queryStaffPAN`,//查询员工专业是否存在
// 个人中心
userinfo:`${host}/evaluation/tms/userInfo/userinfo`,
userinfoUpdate:`${host}/evaluation/tms/userInfo/updateUser`,
sendEmailCode:`${host}/evaluation/tms/user/sendEmailCode`,//发送邮箱验证码
bingEmail:`${host}/evaluation/tms/user/bingEmail`,//邮箱验证并更新
sendPhoneCode:`${host}/evaluation/tms/user/sendPhoneCode`,//发送手机验证码
bindPhone:`${host}/evaluation/tms/user/bindPhone`,//校验手机验证码
// 测评管理
list: `${host}/evaluation/tms/questions/list`, //分页加条件查询试题信息
info: `${host}/evaluation/tms/evaluationrules/info`, //测评规则信息的展示
update: `${host}/evaluation/tms/evaluationrules/update`, //修改测评规则信息
delete: `${host}/evaluation/tms/questions/delete`, //批量删除试题信息
download: `${host}/evaluation/tms/questions/download`, //excel模板文件下载
import: `${host}/evaluation/tms/questions/import`, //通过excel批量导入
infoId: `${host}/evaluation/tms/questions/info/`, //根据试题id查询试题详情信息
isenable: `${host}/evaluation/tms/questions/isenable`, //是否禁用试题
save: `${host}/evaluation/tms/questions/save`, //新增一道试题
questionsUpdate: `${host}/evaluation/tms/questions/update`, //根据试题id修改试题信息
upload: `${host}/evaluation/tms/questions/upload`, //excel模板文件上传
export_failure: `${host}/evaluation/tms/questions/export_failure`, //导出导入失败的数据和失败原因
expDelete: `${host}/evaluation/tms/exp/delete`, //删除实验教学
expList: `${host}/evaluation/tms/exp/list`, //实验教学列表
expSave: `${host}/evaluation/tms/exp/save`, //添加实验教学
expUpdate: `${host}/evaluation/tms/exp/update`, //修改实验教学
expInfo: `${host}/evaluation/tms/exp/getById/`, //实验教学详情
expCheck: `${host}/evaluation/tms/exp/check`, //实验名称判重
getInvitationCode: `${host}/evaluation/tms/exp/getInvitationCode`, //查询邀请码是否存在
expInfo1: `${host}/evaluation/tms/exp/upload`, //实验教学提前结束
queryAllManagements: `${host}/project/ProjectManagement/queryAllManagements`, //项目管理列表信息
queryManagements: `${host}/project/ProjectManagement/queryManagements`, //项目管理列表信息
addRole: `${host}/project/ProjectManagement/addRole`, //新增案例对象
avgValues: `${host}/project/ProjectManagement/avgValues`, //平均分配分值
getByRoleId: `${host}/project/ProjectManagement/getByRoleId`, //根据角色id查询信息
getByjudgmentPointsId: `${host}/project/ProjectManagement/getByjudgmentPointsId`, //实验任务表格信息的展示
queryAllJudgmentPoints: `${host}/project/ProjectManagement/queryAllJudgmentPoints`, //添加判分点面板的数据展示+条件筛选
getProjectId: `${host}/project/ProjectManagement/getTrdingJudgmentPoints`, //根据项目管理id查询对应信息
updateProjectManagement: `${host}/project/ProjectManagement/newUpdateProjectManagement`, //编辑项目管理
addProjectManagement: `${host}/project/ProjectManagement/newAddProjectManagement`, //添加项目管理
removeProjectManagement: `${host}/project/ProjectManagement/removeProjectManagement`, //删除
getJudgmentPoints: `${host}/project/ProjectManagement/getJudgmentPoints`, //复制项目获取数据
updateRole: `${host}/project/ProjectManagement/updateRole`, //修改实验数据—角色信息
isNameExistis: `${host}/project/ProjectManagement/isNameExistis`, //项目名称是否存在
QueryPfdInformation: `${host}/judgment/pointOfJudgement/queryPfdInformation`, //判分点详细信息
// 学生管理
addStudent: `${host}/evaluation/tms/student/addStudent`,
daleteStudent: `${host}/evaluation/tms/student/daleteStudent`,
disableAccount: `${host}/evaluation/tms/student/disableAccount`,
queryStudent: `${host}/evaluation/tms/student/queryStudent`,
reSetPassword: `${host}/evaluation/tms/student/reSetPassword`,
updateStudent: `${host}/evaluation/tms/student/updateStudent`,
download: `${host}/evaluation/tms/student/download`,
uploadFile: `${host}/evaluation/tms/student/uploadFile`,
export_failure: `${host}/evaluation/tms/student/export_failure`,
queryAccountStudent:`${host}/evaluation/tms/student/queryAccount`,
// 员工管理
addStaff: `${host}/evaluation/tms/system/addStaff`,
daleteBatchStaff: `${host}/evaluation/tms/system/daleteBatchStaff`,
queryStaff: `${host}/evaluation/tms/system/queryStaff`,
querystaffDetail: `${host}/evaluation/tms/system/querystaffDetail`,
updateStaff: `${host}/evaluation/tms/system/updateStaff`,
downloadStaff: `${host}/evaluation/tms/system/download`,
export_failureStaff: `${host}/evaluation/tms/system/export_failure`,
uploadFileStaff: `${host}/evaluation/tms/system/uploadFile`,
queryAccountStaff:`${host}/evaluation/tms/system/queryAccount`,
// 成绩管理
addReport: `${host}/evaluation/Achievement/addReport`,
deleteReport: `${host}/evaluation/Achievement/deleteReport`,
exportAchievement:`${host}/evaluation/Achievement/exportAchievement`,
queryAchievement:`${host}/evaluation/Achievement/list`,
queryAchievementNew:`${host}/evaluation/Achievement/newList`,
queryEvaluationReport:`${host}/evaluation/Achievement/reportList`,
queryReport:`${host}/evaluation/Achievement/queryReport`,
getReport: `${host}/evaluation/Achievement/getReport`,
// 教师评语
addComment: `${host}/evaluation/comment/addComment`,
queryComment: `${host}/evaluation/comment/queryComment`,
updateComment:`${host}/evaluation/comment/updateComment`,
// 老师签名照
daleteSignature: `${host}/evaluation/signature/daleteSignature`,
querySignature: `${host}/evaluation/signature/querySignature`,
uploadSignature:`${host}/evaluation/signature/uploadSignature`,
// 科大川大
queryListTrading: `${host}/judgment/tradingJudgmentPoints/query`,
queryDetailsTrading: `${host}/judgment/tradingJudgmentPoints/queryDetails`,
queryPoint: `${host}/sichuan/point/firstLevel`,
querySubject: `${host}/sichuan/point/secondaryLevel`,
queryItem: `${host}/sichuan/point/thirdLevel`,
}

@ -0,0 +1,228 @@
const pad2 = str => ('0' + str).substr(-2)
function fMoney (s, n) {
n = n > 0 && n <= 20 ? n : 2
s = parseFloat((s + '').replace(/[^\d\.-]/g, '')).toFixed(n) + ''
let l = s.split('.')[0].split('').reverse()
let r = s.split('.')[1]
let t = ''
for(let i = 0; i < l.length; i ++ ) {
t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? ',' : '')
}
return t.split('').reverse().join('') + '.' + r
}
function formateTime(num) {
return num < 10 ? `0${num}` : num
}
function toDateTime (date, time) {
if (!date) return ''
date = date.toString()
time = time ? time.toString() : ''
let str = `${date.substr(0, 4)}-${date.substr(4, 2)}-${date.substr(6, 2)}`
if (date.length == 14) {
str += ` ${date.substr(8, 2)}:${date.substr(10, 2)}:${date.substr(12, 2)}`
} else if (date.length == 6) {
str = `${date.substr(0, 2)}:${date.substr(2, 2)}:${date.substr(4, 2)}`
} else if (time) {
str += ` ${time.substr(0, 2)}:${time.substr(2, 2)}:${time.substr(4, 2)}`
}
return str
}
function Percentage(num, total) {
if (num == 0 || total == 0){
return 0;
}
return (Math.round(num / total * 10000) / 100.00);// 小数点后两位百分比
}
function fMoney2 (m) {
return parseFloat(m).toFixed(2)
}
function orderRoleType (sts) {
const status = {
0: '借款人',
1: '贷款人',
2: '保荐人',
}
return status[sts] || '未知状态'
}
function orderRoleAttribute (sts) {
const status = {
0: '个人',
1: '公司',
}
return status[sts] || '未知状态'
}
function systemStatus (sts) {
const status = {
'1': '运行中',
'2': '故障中'
}
return status[sts] || '未知状态'
}
function systemTypeStatus (sts) {
const status = {
'1': '工具',
'2': '实训',
'3': '网站'
}
return status[sts] || '未知状态'
}
function systemAttributionStatus (sts) {
const status = {
'1': '外部产品',
'2': '内部系统'
}
return status[sts] || '未知状态'
}
function courseTypeStatus (sts) {
const status = {
'1': '实训课程',
'2': '理论课程'
}
return status[sts] || '未知状态'
}
function hoursStatus (sts) {
const status = {
'1': '32课时',
'2': '64课时'
}
return status[sts] || '未知状态'
}
function roleStatus (sts) {
const status = {
'1': '超级管理员',
'2': '管理员',
'3': '老师',
'4': '学生'
}
return status[sts] || '未知状态'
}
function orderTypeFn (sts) {
const status = {
'1': '正式',
'2': '试用'
}
return status[sts] || '未知状态'
}
function orderStatusFn (sts) {
const status = {
'1': '待发货',
'2': '已完成',
'3': '已取消'
}
return status[sts] || '未知状态'
}
function orderNatureFn (sts) {
const status = {
'1': '初签',
'2': '续签'
}
return status[sts] || '未知状态'
}
// 获取出生日期
function 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;
}
// 获取性别
function getSex(idCard) {
var sexStr = '';
if (parseInt(idCard.slice(-2, -1)) % 2 == 1) {
sexStr = 'man';
}
else {
sexStr = 'woman';
}
return sexStr;
}
function removeByValue(arr, val) {
for(var i=0; i<arr.length; i++) {
if(arr[i] == val) {
arr.splice(i, 1);
break;
}
}
}
//返回格式化时间,传参例如:"yyyy-MM-dd hh:mm:ss"
function 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;
}
function setCookie(name, value, expiredays) {
var days = 1; //定义一天
var exp = new Date();
expiredays != -1 ? exp.setTime(exp.getTime() + days * 24 * 60 * 60 * 1000) : exp.setTime(exp.getTime() - 1)
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString+";path=/;";
}
export {
fMoney,
formateTime,
toDateTime,
Percentage,
fMoney2,
orderRoleType,
orderRoleAttribute,
systemStatus,
systemTypeStatus,
systemAttributionStatus,
courseTypeStatus,
hoursStatus,
roleStatus,
orderTypeFn,
orderStatusFn,
orderNatureFn,
getBirth,
getSex,
removeByValue,
formatDate,
setCookie
}

@ -0,0 +1,438 @@
import axios from 'axios';
import QS from 'qs';
import store from '../store/index'
import { Message } from 'element-ui'
import router from '../router/index'
// 环境的切换
// if (process.env.NODE_ENV == 'development') {
// axios.defaults.baseURL = '/api';
// } else if (process.env.NODE_ENV == 'debug') {
// axios.defaults.baseURL = '';
// } else if (process.env.NODE_ENV == 'production') {
// axios.defaults.baseURL = 'http://api.123dailu.com/';
// }
// 请求超时时间
axios.defaults.timeout = 30000;
// post请求头
axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8';
// 请求拦截器
axios.interceptors.request.use(config => {
let token = store.state.token
if(token){
config.headers.token = token
}
return config
}, err => {
Message.error({
message: '退出登陆',
onClose: function () {
router.push({name: 'login'});
}
})
return Promise.reject(err);
})
// 响应拦截器
// axios.interceptors.response.use(
// response => {
// consol.log(response.status)
// if (response.status === 200) {
// return Promise.resolve(response);
// } else {
// return Promise.reject(response);
// }
// },
// // 服务器状态码不是200的情况
// error => {
// if (error.response.status) {
// switch (error.response.status) {
// // 401: 未登录
// // 未登录则跳转登录页面,并携带当前页面的路径
// // 在登录成功后返回当前页面,这一步需要在登录页操作。
// case 500:
// router.replace({
// path: '/login',
// // query: { redirect: router.currentRoute.fullPath }
// });
// break;
// // 403 token过期
// // 登录过期对用户进行提示
// // 清除本地token和清空vuex中token对象
// // 跳转登录页面
// case 403:
// // Toast({
// // message: '登录过期,请重新登录',
// // duration: 1000,
// // forbidClick: true
// // });
// // 清除token
// sessionStorage.removeItem('token');
// store.commit('loginSuccess', null);
// // 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
// setTimeout(() => {
// router.replace({
// path: '/login',
// query: {
// redirect: router.currentRoute.fullPath
// }
// });
// }, 1000);
// break;
// // 404请求不存在
// case 404:
// router.replace({
// path: '/404',
// });
// break;
// // 其他错误,直接抛出错误提示
// default:
// router.replace({
// path: '/500',
// });
// }
// return Promise.reject(error.response);
// }
// }
// );
/**
* get方法对应get请求
*/
export function get(url, params){
return new Promise((resolve, reject) =>{
axios.get(url, {
params: params
})
.then(res => {
if(res.data.code == 99999){
this.$message.error(
res.data.message
)
}else{
if (res.data.status) {
switch (res.data.status) {
case 200:
resolve(res.data);
break;
case 201:
resolve(res.data);
break;
case 10000:
resolve(res.data);
break;
case 500:
this.$message.error(
res.data.errmessage
);
break;
case 300:
this.$message.error(
res.data.errmessage
);
reject(res)
break;
case 404:
this.$message.error(
res.data.errmessage
);
break;
case 403:
this.$message.error(
res.data.errmessage
);
break;
case 401:
Message.error("token失效,请重新登录");
sessionStorage.removeItem('token');
router.replace('/login')
break;
case 405:
this.$message.error(
res.data.errmessage
);
break;
case 406:
this.$message.error(
res.data.errmessage
);
break;
case 1000201:
this.$message.error(
res.data.errmessage
);
break;
default:
reject(res)
}
}else if(res.data.code == 99999){
Message.error(res.data.message);
}else{
if(!res.data.success) {
resolve(res.data);
}
}
}
})
.catch(err => {
reject(err.data)
this.$message({
showClose: true,
message: '请求失败,请刷新页面重新进行请求',
type: 'error'
});
})
});
}
/**
* post方法对应post请求
*/
export function post(url, params) {
return new Promise((resolve, reject) => {
axios.post(url,params)
.then(res => {
if(res.data.code == 99999){
this.$message.error(
res.data.message
)
}else{
if (res.data.status) {
switch (res.data.status) {
case 200:
resolve(res.data);
break;
case 500:
this.$message.error(
res.data.errmessage
);
break;
case 300:
this.$message.error(
res.data.errmessage
);
reject(res)
break;
case 404:
this.$message.error(
res.data.errmessage
);
break;
case 403:
this.$message.error(
res.data.errmessage
);
break;
case 401:
Message.error("token失效,请重新登录");
sessionStorage.removeItem('token');
router.replace('/login')
break;
case 405:
this.$message.error(
res.data.errmessage
);
break;
case 406:
this.$message.error(
res.data.errmessage
);
break;
case 1000201:
this.$message.error(
res.data.errmessage
);
break;
default:
reject(res)
}
}else if(res.data.code == 99999){
Message.error(res.data.message);
}else{
if(!res.data.success) {
resolve(res.data);
}
}
}
})
.catch(err => {
reject(err.data)
this.$message({
showClose: true,
message: '请求失败,请刷新页面重新进行请求',
type: 'error'
});
})
});
}
/**
* delete方法对应delete请求
*/
export function del(url, params){
return new Promise((resolve, reject) =>{
axios.delete(url, {params})
.then(res => {
if(res.data.code == 99999){
this.$message.error(
res.data.message
)
}else{
if (res.data.status) {
switch (res.data.status) {
case 200:
resolve(res.data);
break;
// case 300:
// this.$message.error(
// res.data.errmessage
// );
// break;
case 500:
this.$message.error(
res.data.errmessage
);
break;
case 404:
this.$message.error(
res.data.errmessage
);
router.replace({
path: '/404',
});
break;
case 403:
this.$message.error(
res.data.errmessage
);
break;
case 401:
Message.error("token失效,请重新登录");
sessionStorage.removeItem('token');
router.replace('/login')
break;
case 405:
this.$message.error(
res.data.errmessage
);
break;
case 406:
this.$message.error(
res.data.errmessage
);
break;
case 1000201:
this.$message.error(
res.data.errmessage
);
break;
default:
reject(res)
}
}else if(res.data.code == 99999){
Message.error(res.data.message);
}else{
if(!res.data.success) {
resolve(res.data);
}
}
}
})
.catch(err => {
reject(err.data)
this.$message({
showClose: true,
message: '请求失败,请刷新页面重新进行请求',
type: 'error'
});
})
});
}
/**
* put修改
* @param {} url
* @param {*} params
*/
export function put(url, params){
return new Promise((resolve, reject) =>{
axios.put(url, params)
.then(res => {
if(res.data.code == 99999){
this.$message.error(
res.data.message
)
}else{
if (res.data.status) {
switch (res.data.status) {
case 200:
resolve(res.data);
break;
case 300:
this.$message.error(
res.data.errmessage
);
reject(res)
break;
case 500:
this.$message.error(
res.data.errmessage
);
break;
case 400:
resolve(res.data);
break;
case 404:
this.$message.error(
res.data.errmessage
);
break;
case 403:
this.$message.error(
res.data.errmessage
);
break;
case 401:
Message.error("token失效,请重新登录");
sessionStorage.removeItem('token');
router.replace('/login')
break;
case 405:
this.$message.error(
res.data.errmessage
);
break;
case 406:
this.$message.error(
res.data.errmessage
);
break;
case 1000201:
this.$message.error(
res.data.errmessage
);
break;
default:
reject(res)
}
}else if(res.data.code == 99999){
Message.error(res.data.message);
}else{
if(!res.data.success) {
resolve(res.data);
}
}
}
})
.catch(err => {
reject(err.data)
this.$message({
showClose: true,
message: '请求失败,请刷新页面重新进行请求',
type: 'error'
});
})
});
}

@ -0,0 +1,37 @@
// 引入等比适配插件
const px2rem = require('postcss-px2rem')
// 配置基本大小
const postcss = px2rem({
// 基准大小 baseSize,需要和rem.js中相同
remUnit: 16
})
// 使用等比适配插件
module.exports = {
lintOnSave: true,
css: {
loaderOptions: {
postcss: {
plugins: [
postcss
]
}
}
},
publicPath: './',
  outputDir: 'dist',
  assetsDir: 'static'
// devServer: {
// proxy: {
// "/api": {
// target: "http://192.168.0.106:8080",
// changeOrigin: true,
// ws: true,
// pathRewrite: {
// "^/api": ""
// }
// }
// }
// }
}
Loading…
Cancel
Save