Compare commits

..

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

  1. 8
      .prettierrc
  2. 3095
      package-lock.json
  3. 16
      package.json
  4. 31
      public/index.html
  5. 58
      src/App.vue
  6. 28
      src/assets/css/color-dark.css
  7. 7
      src/assets/css/default/index.scss
  8. 263
      src/assets/css/main.css
  9. 189
      src/assets/css/station.scss
  10. 29
      src/assets/css/theme-green/color-green.css
  11. BIN
      src/assets/css/theme-green/fonts/element-icons.ttf
  12. BIN
      src/assets/css/theme-green/fonts/element-icons.woff
  13. 1
      src/assets/css/theme-green/index.css
  14. BIN
      src/assets/img/ach1.png
  15. BIN
      src/assets/img/ach2.png
  16. 1
      src/assets/img/drag.svg
  17. 1
      src/assets/img/empty.svg
  18. BIN
      src/assets/img/exts/excel.png
  19. BIN
      src/assets/img/exts/pdf.png
  20. BIN
      src/assets/img/exts/pic.png
  21. BIN
      src/assets/img/exts/ppt.png
  22. BIN
      src/assets/img/exts/txt.png
  23. BIN
      src/assets/img/exts/video.png
  24. BIN
      src/assets/img/exts/word.png
  25. BIN
      src/assets/img/full.png
  26. BIN
      src/assets/img/mini.jpg
  27. BIN
      src/assets/img/project.png
  28. 1
      src/assets/img/right.svg
  29. 1
      src/assets/img/shrink.svg
  30. 1
      src/assets/img/tag-active.svg
  31. 1
      src/assets/img/tag.svg
  32. BIN
      src/assets/img/wechat-code.jpeg
  33. BIN
      src/assets/img/workbench/1.png
  34. BIN
      src/assets/img/workbench/10.png
  35. BIN
      src/assets/img/workbench/11.png
  36. BIN
      src/assets/img/workbench/12.png
  37. BIN
      src/assets/img/workbench/13.png
  38. BIN
      src/assets/img/workbench/14.png
  39. BIN
      src/assets/img/workbench/15.png
  40. BIN
      src/assets/img/workbench/16.png
  41. BIN
      src/assets/img/workbench/2.png
  42. BIN
      src/assets/img/workbench/3.png
  43. BIN
      src/assets/img/workbench/4.png
  44. BIN
      src/assets/img/workbench/5.png
  45. BIN
      src/assets/img/workbench/6.png
  46. BIN
      src/assets/img/workbench/7.png
  47. BIN
      src/assets/img/workbench/8.png
  48. BIN
      src/assets/img/workbench/9.png
  49. 1
      src/assets/img/wrong.svg
  50. 232
      src/components/Header.vue
  51. 149
      src/components/Navbar.vue
  52. 387
      src/components/Sidebar.vue
  53. 362
      src/components/codemirror.vue
  54. 208
      src/components/img-upload/Cropper.vue
  55. 565
      src/components/quill/index.vue
  56. 32
      src/components/upload/config.js
  57. 140
      src/components/upload/index.vue
  58. 40
      src/components/upload/upload.js
  59. 2
      src/const/match.js
  60. 50
      src/const/ques.js
  61. 28
      src/const/source.js
  62. 34
      src/const/testPaper.js
  63. 4
      src/libs/aliyun/aliyun-oss-sdk-6.17.1.min.js
  64. 7
      src/libs/aliyun/aliyun-upload-sdk-1.5.6.min.js
  65. 38
      src/libs/route/addRoutes.js
  66. 185
      src/libs/util.js
  67. 56
      src/libs/zip.js
  68. 17
      src/main.js
  69. 564
      src/router/index.js
  70. 76
      src/setting.js
  71. 34
      src/store/index.js
  72. 1014
      src/utils/api.js
  73. 4
      src/utils/core.js
  74. 247
      src/utils/editor.js
  75. 296
      src/utils/http.js
  76. 82
      src/utils/util.js
  77. 111
      src/views/Home.vue
  78. 898
      src/views/Login.vue
  79. 2007
      src/views/course/AddCurriculum.vue
  80. 204
      src/views/course/AddLink.vue
  81. 318
      src/views/course/Curriculum.vue
  82. 1080
      src/views/course/content/index.vue
  83. 610
      src/views/course/content/source.vue
  84. 1816
      src/views/course/contentSettings.vue
  85. 1209
      src/views/course/detail.vue
  86. 332
      src/views/course/list.vue
  87. 2211
      src/views/customer/AddCustomer.vue
  88. 289
      src/views/customer/Order.vue
  89. 446
      src/views/customer/Permission.vue
  90. 567
      src/views/customer/customer.vue
  91. 1483
      src/views/data/Framework.vue
  92. 526
      src/views/data/Introduce.vue
  93. 1352
      src/views/data/Product.vue
  94. 781
      src/views/devLogin.vue
  95. 415
      src/views/information/addArticle/index.vue
  96. 447
      src/views/information/columnManage/index.vue
  97. 393
      src/views/information/contentManage/contentList.vue
  98. 141
      src/views/information/contentManage/index.vue
  99. 117
      src/views/information/list/index.vue
  100. 251
      src/views/market/index.vue
  101. Some files were not shown because too many files have changed in this diff Show More

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

3095
package-lock.json generated

File diff suppressed because it is too large Load Diff

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

@ -1,19 +1,18 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="深圳或然科技中台" /> <meta name="keywords" content="深圳或然科技中台">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<meta name="viewport" content="width=device-width, user-scalable=yes, shrink-to-fit=no" /> <script src="/styles/tinymce/tinymce.min.js"></script>
<title>深圳或然科技中台</title> <title>深圳或然科技中台</title>
</head> </head>
<body> <body>
<noscript> <noscript>
<strong>We're sorry but vms doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong>We're sorry but vms doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
<script src="/dev/styles/tinymce/tinymce.min.js"></script> </body>
</body>
</html> </html>

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

@ -1,7 +0,0 @@
/* 改变主题色变量 */
$--color-primary: #062c87;
/* 改变 icon 字体路径变量,必需 */
$--font-path: '~element-ui/lib/theme-chalk/fonts';
@import "~element-ui/packages/theme-chalk/src/index";

@ -8,33 +8,27 @@ body,
#app, #app,
.wrapper { .wrapper {
width: 100%; width: 100%;
min-height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
body { body {
min-width: 1200px; font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif;
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif;
font-size: 14px; font-size: 14px;
} }
.ip {
z-index: 1;
position: fixed;
top: 0;
left: 0;
}
a { a {
text-decoration: none; text-decoration: none
} }
i { i{
font-style: normal; font-style: normal;
} }
li { li {
list-style-type: none; list-style-type:none;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 8px; width: 8px;
height: 8px; height: 8px;
@ -46,32 +40,55 @@ li {
background: #d7d7d7; background: #d7d7d7;
} }
.flex { .flex {
display: flex; display: flex;
} }
.j-between { .j-between {
justify-content: space-between; justify-content: space-between;
} }
.a-center { .a-center {
align-items: center; align-items: center;
} }
.m-b-10 { .m-b-10 {
margin-bottom: 10px; margin-bottom: 10px;
} }
.el-table th > .cell { .el-table th>.cell {
font-size: 14px; font-size: 14px;
}
.content-box {
-webkit-transition: left .3s ease-in-out;
transition: left .3s ease-in-out;
background: #f0f0f0;
flex: 1;
}
.content {
width: auto;
min-height: 100%;
padding: 20px;
box-sizing: border-box;
} }
.content-collapse {
left: 65px;
}
.container {
padding: 30px;
background: #fff;
border: 1px solid #ddd;
border-radius: 5px;
}
.p-title { .p-title {
padding-left: 5px; padding-left: 5px;
margin-bottom: 24px; margin-bottom: 24px;
line-height: 1; line-height: 1;
font-size: 14px; font-size: 14px;
color: #585858; color: #585858;
border-left: 3px solid #062c87; border-left: 3px solid #9278ff;
} }
.el-upload-list { .el-upload-list{
width: 100%; width: 100%;
max-width: 400px; max-width: 400px;
} }
.page { .page {
position: relative; position: relative;
@ -98,7 +115,7 @@ li {
margin-right: 6px; margin-right: 6px;
font-size: 14px; font-size: 14px;
line-height: 14px; line-height: 14px;
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, .65);
white-space: nowrap; white-space: nowrap;
} }
@ -106,7 +123,7 @@ li {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 24px; padding: 0 24px;
border-bottom: 1px solid rgba(0, 0, 0, 0.06); border-bottom: 1px solid rgba(0, 0, 0, .06);
} }
.tabs .item { .tabs .item {
position: relative; position: relative;
@ -131,7 +148,7 @@ li {
border-radius: 2px; border-radius: 2px;
} }
.tabs .item.active:after { .tabs .item.active:after {
border-bottom-color: #062c87; border-bottom-color: #9278ff;
} }
.crumbs { .crumbs {
@ -152,7 +169,7 @@ li {
margin-bottom: 20px; margin-bottom: 20px;
} }
.el-button + .el-tooltip { .el-button+.el-tooltip {
margin-left: 10px; margin-left: 10px;
} }
@ -160,14 +177,14 @@ li {
background: #f6faff; background: #f6faff;
} }
.orderTable td .el-input { .orderTable td .el-input{
width: 60%; width: 60%;
} }
.orderTable td .normal { .orderTable td .normal{
width: 90%; width: 90%;
} }
.orderTable .el-select > .el-input { .orderTable .el-select>.el-input{
display: inline-block; display: inline-block;
} }
@ -181,7 +198,7 @@ li {
.move-enter-active, .move-enter-active,
.move-leave-active { .move-leave-active {
transition: opacity 0.5s; transition: opacity .5s;
} }
.move-enter, .move-enter,
@ -253,6 +270,16 @@ li {
font-style: normal; font-style: normal;
} }
/* .link_upload .el-upload-list{
width: 30%;
} */
/*VueEditor*/
.ql-container {
min-height: 400px;
}
.ql-snow .ql-tooltip { .ql-snow .ql-tooltip {
transform: translateX(117.5px) translateY(10px) !important; transform: translateX(117.5px) translateY(10px) !important;
} }
@ -267,158 +294,159 @@ li {
min-height: 500px; min-height: 500px;
} }
.ms-login .el-tabs__nav-wrap::after { .ms-login .el-tabs__nav-wrap::after{
background-color: #fff; background-color: #fff;
opacity: 0; opacity: 0;
} }
.ms-login .el-tabs__item { .ms-login .el-tabs__item{
padding: 0 90px; padding: 0 90px;
color: #999; color: #999;
} }
.ms-login .el-tabs__item:hover { .ms-login .el-tabs__item:hover{
color: #000; color: #000;
} }
.ms-login .el-tabs__item.is-active { .ms-login .el-tabs__item.is-active{
color: #333; color: #333;
font-weight: bold; font-weight: bold;
} }
.ms-login .el-tabs__active-bar { .ms-login .el-tabs__active-bar{
background-color: #000; background-color: #000;
border-radius: 2px; border-radius:2px;
} }
.ms-login .el-tabs__nav-scroll { .ms-login .el-tabs__nav-scroll{
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.ms-login .el-input__inner { .ms-login .el-input__inner{
height: 80px; height: 80px;
line-height: 80px; line-height: 80px;
border: 1px solid rgba(220, 220, 220, 1); border:1px solid rgba(220,220,220,1);
border-radius: 2px; border-radius:2px;
} }
.el-row { .el-row {
margin-bottom: 20px; margin-bottom: 20px;
} }
#app .el-table thead { #app .el-table thead{
color: #fff; color: #fff;
} }
#app .el-table th { #app .el-table th{
background-color: #fafafc !important; background-color: #9278FF!important;
font-size: 16px; font-size: 16px;
font-weight: normal; font-weight: normal;
color: #000;
} }
.el-input__inner[type='number'] { .el-input__inner[type=number] {
padding-right: 0; padding-right: 0;
} }
/*flex*/ /*flex*/
.flex-center { .flex-center{
display: flex; display: flex;
align-items: center; align-items: center;
} }
.flex-c-c { .flex-c-c{
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.flex-between { .flex-between{
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.flex-around { .flex-around{
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-around; justify-content: space-around;
} }
.flex-start-around { .flex-start-around{
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
justify-content: center; justify-content: center;
} }
.flex-end-around { .flex-end-around{
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
justify-content: center; justify-content: center;
} }
.flex-column { .flex-column{
display: flex; display: flex;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
} }
.flex-start { .flex-start{
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
} }
.hr_tag { .hr_tag{
background-color: #062c87; background-color: #9278FF;
width: 3px; width: 3px;
height: 15px; height: 15px;
margin-right: 5px; margin-right: 5px;
} }
.user_header { .user_header{
padding: 20px 0; padding: 20px 0;
border-bottom: 1px dashed #eee; border-bottom: 1px dashed #eee;
} }
.border-b-dashed { .border-b-dashed{
border-bottom: 1px dashed #e3e3e3; border-bottom: 1px dashed #e3e3e3;
width: 100%; width: 100%;
height: 1px; height: 1px;
margin-bottom: 20px; margin-bottom: 20px;
} }
.shadow { .shadow{
border: 0.0625rem solid #ebeef5; border: 0.0625rem solid #EBEEF5;
background-color: #fff; background-color: #FFF;
color: #303133; color: #303133;
-webkit-transition: 0.3s; -webkit-transition: .3s;
transition: 0.3s; transition: .3s;
} }
.shadow :hover { .shadow :hover{
box-shadow: 0 0.125rem 0.75rem 0 rgb(0 0 0 / 10%); box-shadow: 0 0.125rem 0.75rem 0 rgb(0 0 0 / 10%);
} }
.flex-col { .flex-col{
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.addhr_tag { .addhr_tag{
background-color: #666; background-color: #666;
width: 6px; width: 6px;
height: 17px; height: 17px;
margin-right: 5px; margin-right: 5px;
} }
.per_title span { .per_title span{
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
} }
.per_back { .per_back{
margin-left: 5px; margin-left: 5px;
} }
.per_school { .per_school{
margin-left: 30px; margin-left: 30px;
} }
.per_title:hover { .per_title:hover{
cursor: pointer; cursor:pointer;
} }
/* 溢出省略号 */ /* 溢出省略号 */
.ellipsis { .ellipsis{
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.userRadio .el-radio { .userRadio .el-radio{
margin-right: 10px !important; margin-right: 10px!important;
} }
.userRadio .el-radio__input { .userRadio .el-radio__input{
display: none !important; display: none!important;
} }
.cursor { .cursor {
cursor: pointer; cursor: pointer;
@ -426,87 +454,40 @@ li {
.el-switch__label span { .el-switch__label span {
font-size: 12px; font-size: 12px;
} }
.m-r-5 { .m-b-20 {
margin-right: 5px; margin-bottom: 20px;
} }
.m-r-10 { .m-r-10 {
margin-right: 10px; margin-right: 10px;
}
.m-b-20 {
margin-bottom: 20px;
} }
@media (max-width: 720px) { @media (max-width: 720px) {
.el-message { .el-message {
min-width: auto !important; min-width: auto !important;
width: 85%; width: 85%;
} }
} }
.el-tooltip__popper { .el-tooltip__popper {
max-width: 100% !important; max-width: 500px !important;
} }
.no-atTheMoment > .el-picker-panel__footer > .el-button--text:first-child { .no-atTheMoment > .el-picker-panel__footer > .el-button--text:first-child{
display: none; display: none;
} }
.tox-notifications-container { .tox-notifications-container {
display: none; display: none;
} }
.mce-content-body:not([dir='rtl']) blockquote { .mce-content-body:not([dir=rtl]) blockquote {
border-left: 0; border-left: 0;
background-color: #ccc; background-color: #ccc;
} }
.search-wrap { .search-wrap {
display: flex; display: flex;
} }
.search-wrap .el-select { .search-wrap .el-select {
width: 140px; width: 140px;
} }
.search-wrap .keyword .el-input__inner { .search-wrap .keyword .el-input__inner {
border-left: 0; border-left: 0;
} }
.search-wrap .el-input__inner { .search-wrap .el-input__inner {
border-radius: 0; border-radius: 0;
}
.edui-default {
line-height: normal;
}
.html-parse {
table {
display: table;
margin-bottom: 10px;
border-collapse: collapse;
th,
td {
padding: 5px 10px;
border: 1px solid #DDD;
}
}
ol {
padding-left: 30px;
li {
list-style-type: decimal;
}
}
ul {
padding-left: 30px;
li {
list-style-type: disc;
}
}
}
.files-tip {
li {
line-height: 1.8;
cursor: pointer;
}
}
.el-drawer__header > :first-child {
font-size: 16px;
font-weight: 600;
color: #333;
} }

@ -1,189 +0,0 @@
.msg {
li {
margin-bottom: 10px;
border-top: 1px solid #f1f1f1;
&:first-child {
border-top: 0;
}
.li-wrap {
position: relative;
display: flex;
justify-content: space-between;
padding: 16px 0;
.avatar {
width: 48px;
height: 48px;
border-radius: 50%;
}
.texts {
flex: 1;
margin-left: 24px;
.name {
color: rgba(0, 0, 0, 0.85);
font-size: 16px;
}
.date {
color: rgba(0, 0, 0, 0.45);
font-size: 14px;
}
/deep/img {
max-width: 95%;
}
}
.reply-name {
color: #062c87;
}
.action {
display: inline-flex;
align-items: center;
margin: 15px 10px 0 0;
.icon {
margin: 0 5px;
color: #062c87;
font-size: 18px;
cursor: pointer;
&:hover {
opacity: 0.8;
}
&:first-child {
margin-right: 5px;
}
&.del {
color: rgba(0, 0, 0, 0.65);
border: 1px solid rgba(0, 0, 0, 0.15);
}
}
}
.like-wrap {
display: inline-flex;
align-items: center;
cursor: pointer;
}
}
.reply {
margin-top: 20px;
}
}
&.children {
margin-left: 72px;
padding-left: 24px;
background-color: rgba(0, 0, 0, 0.02);
border-radius: 8px;
li {
border-top-color: rgba(0, 0, 0, 0.06);
}
}
}
.toggle {
margin: 16px 0;
text-align: center;
color: #062c87;
font-size: 14px;
span {
cursor: pointer;
}
}
/deep/.quill {
background-color: #fff;
}
/deep/.timeline {
padding-left: 9%;
overflow: hidden;
.el-timeline-item {
padding-bottom: 40px;
}
.el-timeline-item__node--normal {
top: 30px;
}
.el-timeline-item__wrapper {
top: 15px;
padding-left: 40px;
}
.el-timeline-item__tail {
height: 250%;
border-left-width: 1px;
}
.sign {
position: relative;
display: inline-block;
margin-left: -12.5%;
font-size: 14px;
color: #062c87;
}
.draft {
.ver,
.sign {
color: #b1b1b1;
}
}
.ver {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 10px;
margin: -22px 0 20px;
font-size: 15px;
color: #062c87;
border-bottom: 1px dashed #bfbfbf;
}
.des {
p,
span,
em {
font-size: 14px !important;
}
}
.withdraw {
margin-right: 10px;
font-size: 13px;
color: #979797;
}
.action {
margin-left: 15px;
i {
margin-left: 8px;
font-size: 14px;
color: #062c87;
cursor: pointer;
&:hover {
opacity: 0.9;
}
}
}
.detail {
li {
margin-bottom: 20px;
}
.name {
display: flex;
align-items: center;
margin-bottom: 5px;
font-size: 15px;
font-weight: 600;
img {
width: 20px;
margin-right: 5px;
}
}
.val {
font-size: 14px;
line-height: 1.8;
white-space: pre-wrap;
p {
position: relative;
color: #6a6a6a;
&:before {
content: '';
display: inline-block;
width: 5px;
height: 5px;
margin: 0 10px 0 5px;
vertical-align: middle;
border-radius: 20px;
background-color: #c5b8ff;
}
}
}
}
}

@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1734423793915" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7651" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M362.666667 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="7652"></path><path d="M661.333333 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="7653"></path><path d="M362.666667 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="7654"></path><path d="M661.333333 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="7655"></path><path d="M362.666667 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="7656"></path><path d="M661.333333 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="7657"></path></svg>

Before

Width:  |  Height:  |  Size: 946 B

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 343 B

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

Before

Width:  |  Height:  |  Size: 593 B

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

Before

Width:  |  Height:  |  Size: 766 B

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

Before

Width:  |  Height:  |  Size: 545 B

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

Before

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

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

Before

Width:  |  Height:  |  Size: 768 B

@ -1,178 +1,116 @@
<template> <template>
<div class="header flex-between"> <div class="header flex-between">
<div class="logo"> <div class="logo">
<img class="cursor" @click="goHome" src="../assets/img/logo.png"> <img class="cursor" @click="goHome" src="../assets/img/logo.png">
</div> </div>
<div class="header-right"> <div class="header-right">
<div class="header-user-con"> <div class="header-user-con">
<div class="user" @click="toPerson"> <div class="user" @click="toPerson">
<el-avatar :size="40" :src="$store.state.avatar"></el-avatar> <el-avatar :size="40" :src="$store.state.avatar"></el-avatar>
<span class="user-avator">{{ userName }}</span> <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>
<el-divider class="ml20" direction="vertical"></el-divider>
<el-button type="text" class="ml20" @click="logout">退出</el-button>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
import Bus from '@/libs/bus'
import Setting from '@/setting'
export default { export default {
data () { data() {
return { return {
timer: null, userName: ''
Setting, };
userName: '',
};
},
mounted () {
this.getUserInfo()
},
methods: {
toPerson () {
if (this.$route.path.split('/').pop() !== 'person') {
this.$router.push('/person')
}
},
async logout () {
await this.$post(this.api.logout)
localStorage.removeItem('ms_username')
localStorage.removeItem('token')
sessionStorage.clear()
location.reload()
},
goHome () {
this.$router.push('/customer')
},
// socket
open () {
console.log("socket连接成功");
},
// socket
error () {
console.log("连接错误");
}, },
// mounted(){
getMessage (msg) { this.userName || this.getUserInfo()
console.log("==websocket接收数据==");
console.log(JSON.parse(msg.data));
const { content } = JSON.parse(msg.data)
// 1234-id
content == 1 && Bus.$emit('matchSocket')
content == 4 && Bus.$emit('modelSocket')
}, },
// socket methods: {
close () { getUserInfo(){
console.log("socket已经关闭"); this.$get(this.api.queryUserInfoDetails).then(({ result }) => {
let userInfo = result.hrUserInfo
if(userInfo.userAvatars) this.$store.commit('userAvatar',{avatar: userInfo.userAvatars})
this.userName = userInfo.userName
const { id } = result.userAccount
id && this.$store.commit('SET_ACCOUNTID', id)
this.$store.commit('SET_USERNAME', this.userName)
}).catch(err => {})
},
toPerson(){
if(this.$route.path.split('/').pop()!=='person'){
this.$router.push('/person')
}
},
loginout() {
localStorage.removeItem('ms_username');
localStorage.removeItem('token');
sessionStorage.clear()
location.reload()
},
goHome(){
this.$router.push('/customer')
}
}, },
initSocket ({ id, account }) {
// socket
this.socket = new WebSocket(`wss://${Setting.isDev ? '192.168.31.51' : location.host}/nakadai/websocket/${id}/${account}`)
// this.socket = new WebSocket(`ws://121.37.12.51:9100/nakadai/websocket/${id}/${account}`)
// socket
this.socket.onopen = this.open;
// socket
this.socket.onerror = this.error;
// socket
this.socket.onmessage = this.getMessage;
},
//
heartbeatDetection () {
this.timer = setInterval(async () => {
sessionStorage.getItem('token') ? await this.$get(this.api.heartbeatDetection) : clearInterval(this.timer)
}, 58 * 1000)
},
getUserInfo () {
this.$get(this.api.queryUserInfoDetails).then(({ result }) => {
let userInfo = result.hrUserInfo
if (userInfo.userAvatars) this.$store.commit('userAvatar', { avatar: userInfo.userAvatars })
this.userName = userInfo.userName
const { id } = result.userAccount
id && this.$store.commit('SET_ACCOUNTID', id)
this.$store.commit('SET_USERNAME', this.userName)
this.initSocket(result.userAccount)
Setting.isPro && this.heartbeatDetection()
}).catch(err => { })
},
},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.header { .header {
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
height: 60px; height: 60px;
font-size: 16px; font-size: 16px;
color: #333; color: #333;
} }
.header .logo { .header .logo {
float: left; float: left;
width: 170px; width: 170px;
height: 40px; height: 40px;
margin-left: 20px; margin-left: 20px;
} }
.header .logo img{
.header .logo img { width: 100%;
width: 100%; height: 100%;
height: 100%;
} }
.header-right { .header-right {
float: right; float: right;
padding-right: 50px; padding-right: 50px;
} }
.header-user-con { .header-user-con {
display: flex; display: flex;
height: 70px; height: 70px;
align-items: center; align-items: center;
} }
.header-user-con .user{
.header-user-con .user { display: inline-flex;
display: inline-flex; align-items: center;
align-items: center; cursor: pointer;
cursor: pointer;
} }
.user-avator { .user-avator {
cursor: pointer; cursor: pointer;
margin-left: 10px; margin-left: 10px;
font-size: 12px; font-size: 12px;
} }
.ml20{
.ml20 { margin-left: 20px;
margin-left: 20px;
} }
.user-avator img { .user-avator img {
display: block; display: block;
width: 40px; width: 40px;
height: 40px; height: 40px;
border-radius: 50%; border-radius: 50%;
} }
/deep/.header-right .el-button--text{
/deep/.header-right .el-button--text { color: #333;
color: #333; span {
font-size: 12px;
span { }
font-size: 12px;
}
} }
.header-right .el-divider--vertical{
.header-right .el-divider--vertical { width: 2px;
width: 2px; height: 15px;
height: 15px;
} }
.header-right .el-divider{
.header-right .el-divider { background-color: #333;
background-color: #333;
} }
</style> </style>

@ -1,149 +0,0 @@
<template>
<div class="menus">
<el-menu class="nav" :default-active="onRoutes" background-color="#062c87" text-color="#fff"
active-text-color="#333" unique-opened mode="horizontal" router @select="handleSelect">
<template v-for="item in menus">
<template v-if="item.subs">
<el-submenu :index="item.index" :key="item.index">
<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 Setting from '@/setting'
import addRoutes from '@/libs/route/addRoutes'
export default {
data () {
return {
menuList: [
{
icon: 'el-icon-school',
index: '/workbench',
title: '工作台'
},
{
icon: 'el-icon-user',
index: '/customer',
title: '客户管理'
},
{
icon: 'el-icon-shopping-bag-2',
index: '/user',
title: '用户管理'
},
{
icon: 'el-icon-document-checked',
index: '/order',
title: '订单管理'
},
{
icon: 'el-icon-office-building',
index: '/system',
title: '系统配置'
},
],
menus: [],
onRoutes: this.$route.path
};
},
watch: {
"$route.path": function (val) {
this.menuList.map(e => {
if (val.replace('/', '') === e.index) {
this.handleSelect(val.replace('/', ''))
this.$forceUpdate();
}
})
}
},
mounted () {
sessionStorage.getItem('token') && this.getPer() //
},
methods: {
handleSelect (index) {
this.onRoutes = index
this.$store.commit('setInfoTab', '1')
this.$store.commit('setColumnId', '')
this.$store.commit('setCompetitionCache', null)
},
initMenu () {
if (Setting.dynamicRoute) {
this.menus = this.menuList
return false
const routes = this.$store.state.routes
const menus = []
this.menuList.map(e => {
routes.find(n => n.path === e.index) && menus.push(e)
})
this.menus = menus
} else {
this.menus = this.menuList
}
},
//
getPer () {
this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`).then(res => {
const routes = res.permissionMenu[0].children
addRoutes(routes)
this.initMenu()
this.$store.commit('setDataPer', res.dataPermissionList)
}).catch(err => {
if (err.status === 500) {
localStorage.removeItem('ms_username');
sessionStorage.clear()
location.reload()
}
})
},
}
};
</script>
<style lang="scss" scoped>
.menus {
z-index: 2000;
position: sticky;
top: 0;
display: flex;
justify-content: center;
background-color: #062c87;
/deep/.nav {
border-bottom: 0;
&>.el-menu-item {
height: 56px;
padding: 0 30px;
line-height: 56px;
}
&>.el-menu-item.is-active {
background-color: #fff !important;
border-bottom: 0;
}
}
}
</style>

@ -1,234 +1,193 @@
<template> <template>
<div class="sidebar"> <div>
<el-menu :default-active="active" :default-openeds="['1', '2', '3', '4']" background-color="#fff" text-color="#333" <el-menu
active-text-color="#062c87" router> class="sidebar-el-menu"
<template v-for="item in menus"> :default-active="onRoutes"
<template v-if="item.children"> background-color="#324157"
<el-submenu :index="item.index" :key="item.index"> text-color="#bfcbd9"
<template slot="title"> active-text-color="#9278FF"
<span slot="title">{{ item.title }}</span> unique-opened
mode="horizontal"
router
@select="handleSelect"
>
<template v-for="item in menus">
<template v-if="item.subs">
<el-submenu :index="item.index" :key="item.index">
<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> </template>
<template v-for="subItem in item.children"> </el-menu>
<el-submenu v-if="subItem.children" :index="subItem.index" :key="subItem.index"> </div>
<template slot="title">{{ subItem.title }}</template>
<el-menu-item v-for="(threeItem, i) in subItem.children" :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">
<span slot="title">{{ item.title }}</span>
</el-menu-item>
</template>
</template>
</el-menu>
</div>
</template> </template>
<script> <script>
import Setting from '@/setting' import Setting from '@/setting'
import addRoutes from '@/libs/route/addRoutes'
export default { export default {
props: ['path'], data() {
data () { return {
return { menuList: [
active: '', {
defaultMenus: [ icon: 'el-icon-school',
{ index: '/customer',
index: '1', title: '客户管理'
title: '系统后台', },
children: [ {
{ icon: 'el-icon-user',
index: '/configure?id=1', index: '/user',
title: 'Python系统' title: '用户管理'
}, },
{ {
index: '/theoryExam', icon: 'el-icon-shopping-bag-2',
title: '理论考试系统' index: '/order',
}, title: '订单管理'
{ },
index: '/configure?id=3', {
title: '金融产品设计及数字化营销沙盘系统' icon: 'el-icon-document-checked',
}, index: '/curriculum',
{ title: '课程管理'
index: '/configure?id=4', },
title: '银行综合系统' {
}, icon: 'el-icon-notebook-2',
{ index: '/data',
index: '/configure?id=5', title: '数据管理'
title: '众筹系统' },
}, {
] icon: 'el-icon-tickets',
}, index: '/match',
{ title: '大赛管理'
index: '2', },
title: '职站教学后台', {
children: [ icon: 'el-icon-takeaway-box',
{ index: '/theoreticalCourse',
index: '/curriculum', title: '理论课程'
title: '教学课程管理' },
}, {
{ icon: 'el-icon-box',
index: '/theoreticalCourse', index: '/information',
title: '精品课程管理' title: '资讯管理'
}, },
{ {
index: '/information', icon: 'el-icon-receiving',
title: '资讯管理' index: '/configure',
}, title: '服务配置'
{ },
index: '/resourse', {
title: '资源库' icon: 'el-icon-office-building',
}, index: '/system',
] title: '系统配置'
},
{
icon: 'el-icon-s-check',
index: '/parner',
title: '合伙管理'
},
{
icon: 'el-icon-data-line',
index: '/parnerOperation',
title: '合伙运营'
},
{
icon: 'el-icon-s-shop',
index: '/shop',
title: '商城管理'
},
],
menus: [],
onRoutes: this.$route.path
};
},
watch:{
"$route.path":function(val){
this.menuList.map(e=>{
if(val.replace('/', '')===e.index){
this.handleSelect(val.replace('/', ''))
this.$forceUpdate();
}
})
}
},
mounted() {
sessionStorage.getItem('sideBar') && this.handleSelect(sessionStorage.getItem('sideBar'))
sessionStorage.getItem('token') && this.getPer() //
},
methods:{
handleSelect(index){
this.onRoutes = index
this.$store.commit('setOrderParam', null)
this.$store.commit('setInfoTab', '1')
this.$store.commit('setColumnId', '')
sessionStorage.setItem('sideBar',index)
}, },
{ initMenu() {
index: '3', if (Setting.dynamicRoute) {
title: '职站商城后台', const routes = this.$store.state.routes
children: [ const menus = []
{ this.menuList.map(e => {
index: '/shop', routes.find(n => n.path === e.index) && menus.push(e)
title: '产品管理' })
}, this.menus = menus
{ } else {
index: '/market', this.menus = this.menuList
title: '营销管理' }
},
{
index: '/parnerOperation',
title: '小程序内容管理'
},
{
index: '/parner',
title: '销售代理人管理'
},
]
}, },
{ //
index: '4', getPer() {
title: '运营后台', this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`).then(res => {
children: [ const routes = res.permissionMenu[0].children
{ addRoutes(routes)
index: '/match', this.initMenu()
title: '大赛管理' this.$store.commit('setDataPer', res.dataPermissionList)
}, }).catch(err => {
{ if (err.status === 500) {
index: '/data', localStorage.removeItem('ms_username');
title: '数据管理' sessionStorage.clear()
}, location.reload()
{ }
index: '/review', })
title: '评阅管理'
},
]
}, },
],
menus: [],
};
},
watch: {
path: {
handler (val) {
this.active = val === '/configure' ? `/configure?id=${this.$route.query.id}` : val
},
immediate: true
} }
},
mounted () {
Setting.dynamicRoute && this.initTabs()
},
methods: {
initTabs () {
const { btns } = this.$store.state
const tabs = this.defaultMenus
btns.includes('/configure') && this.menus.push(tabs[0])
const children1 = []
btns.includes('/curriculum') && children1.push(tabs[1].children[0])
btns.includes('/theoreticalCourse') && children1.push(tabs[1].children[1])
btns.includes('/information') && children1.push(tabs[1].children[2])
btns.includes('/resourse') && children1.push(tabs[1].children[3])
this.menus.push({
index: '2',
title: '职站教学后台',
children: children1
})
const children2 = []
btns.includes('/shop:产品管理') && children2.push(tabs[2].children[0])
btns.includes('/shop:营销推广管理') && children2.push(tabs[2].children[1])
btns.includes('/parnerOperation') && children2.push(tabs[2].children[2])
btns.includes('/parner') && children2.push(tabs[2].children[3])
this.menus.push({
index: '3',
title: '职站商城后台',
children: children2
})
const children3 = []
btns.includes('/match') && children3.push(tabs[3].children[0])
btns.includes('/data') && children3.push(tabs[3].children[1])
btns.includes('/review') && children3.push(tabs[3].children[2])
this.menus.push({
index: '4',
title: '运营后台',
children: children3
})
},
handleSelect (index) {
},
}
}; };
</script> </script>
<style lang="scss" scoped> <style scoped>
.sidebar {
min-width: 200px;
max-width: 200px;
height: calc(100vh - 116px);
overflow: auto;
// transition: .5s;
transform: translateX(-200px);
&.show {
transform: translateX(0);
}
/deep/.el-menu {
border-right: 0 !important;
.el-menu-item,
.el-submenu__title {
height: 40px;
line-height: 40px;
&.is-active {
font-weight: 600;
}
}
.el-menu .el-menu-item {
padding: 0 20px 0 40px !important;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
.sidebar::-webkit-scrollbar { .sidebar::-webkit-scrollbar {
width: 0; width: 0;
} }
.sidebar-el-menu:not(.el-menu--collapse) { .sidebar-el-menu:not(.el-menu--collapse) {
width: 100%; width: 100%;
} }
.sidebar > ul {
.sidebar>ul { height: 100%;
height: 100%;
} }
</style> </style>

@ -1,45 +1,37 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<div class="left"> <div class="left">
<codemirror v-model="codeVal" <codemirror
:options="cmOption" v-model="codeVal"
class="code-mirror" :options="cmOption"
@ready="ready" class="code-mirror"
ref="codemirror"></codemirror> @ready="ready"
<el-button class="run btn" ref="codemirror"
type="primary" ></codemirror>
@click="runCode">运行</el-button> <el-button
class="run btn"
type="primary"
@click="runCode"
>运行</el-button>
</div> </div>
<div class="code-right answer"> <div class="code-right answer">
<p class="text-wrapper">{{ runResult }}</p> <p class="text-wrapper">{{ runResult }}</p>
<div class="pic-wrap" <div class="pic-wrap" v-if="picSrcList.length">
v-if="picSrcList.length"> <div class="pic-item" v-for="(img, i) in picSrcList" :key="i">
<div class="pic-item" <el-image
v-for="(img, i) in picSrcList" class="pic"
:key="i"> :src="img"
<el-image class="pic" :preview-src-list="picSrcList">
:src="img"
:preview-src-list="picSrcList">
</el-image> </el-image>
<el-button class="download-btn btn" <el-button class="download-btn btn" type="primary" size="mini" @click="downloadPic(i)">下载图片</el-button>
type="primary" <a :ref="'picLink' + i" style="display: none;" download="运行结果.png" :href="img">下载图片</a>
size="mini"
@click="downloadPic(i)">下载图片</el-button>
<a :ref="'picLink' + i"
style="display: none;"
download="运行结果.png"
:href="img">下载图片</a>
</div> </div>
</div> </div>
<div class="result-right t-color" <div class="result-right t-color" v-show="isError">
v-show="isError"> <img src="@/assets/img/yes.png" alt />运行成功
<img src="@/assets/img/yes.png"
alt />运行成功
</div> </div>
<div class="result-wrong" <div class="result-wrong" v-show="isError === 0">
v-show="isError === 0"> <img src="@/assets/img/error.png" alt />
<img src="@/assets/img/error.png"
alt />
{{errLine}}行出现错误 {{errLine}}行出现错误
</div> </div>
</div> </div>
@ -90,7 +82,7 @@ import "codemirror/theme/base16-light.css";
import { Loading } from 'element-ui'; import { Loading } from 'element-ui';
export default { export default {
props: ['code', 'codeId', 'projectId', 'retResult', 'readOnly'], props: ['code', 'codeId', 'projectId', 'retResult', 'readOnly'],
data () { data() {
return { return {
codeVal: this.code, codeVal: this.code,
runResult: '', // runResult: '', //
@ -130,25 +122,25 @@ export default {
codemirror codemirror
}, },
watch: { watch: {
codeVal (val) { codeVal(val) {
this.$emit("update:code", val) this.$emit("update:code", val)
} }
}, },
mounted () { mounted() {
}, },
methods: { methods: {
// //
ready () { ready() {
const code = this.$refs.codemirror.codemirror const code = this.$refs.codemirror.codemirror
code.setSize("auto", "calc(100vh - 370px)"); code.setSize("auto", "calc(100vh - 370px)");
code.on('keypress', function () { code.on('keypress', function() {
// //
code.showHint() code.showHint()
}); });
}, },
// //
runCode () { runCode() {
let code = this.codeVal let code = this.codeVal
if (!code) { if (!code) {
this.$message({ this.$message({
@ -177,7 +169,7 @@ export default {
let firtImg = '' let firtImg = ''
try { try {
imgList = eval(result) imgList = eval(result)
} catch (error) { } } catch (error) {}
if (imgList && imgList.length) firtImg = imgList[0] if (imgList && imgList.length) firtImg = imgList[0]
// //
if (photo) { if (photo) {
@ -190,7 +182,7 @@ export default {
* 这段是为要下载图片的项目案例写的后端会返回图片名称的数组前端负责循环这个数组然后下载下来 * 这段是为要下载图片的项目案例写的后端会返回图片名称的数组前端负责循环这个数组然后下载下来
* 只有该系统有这段代码因为其他7个系统没有下载图片的项目后续如果加了直接把这段代码复制过去即可 * 只有该系统有这段代码因为其他7个系统没有下载图片的项目后续如果加了直接把这段代码复制过去即可
*/ */
imgList.map((n, i) => { imgList.map((n,i) => {
// util.downloadFile(`${i+1}.jpg`,n) // util.downloadFile(`${i+1}.jpg`,n)
}) })
this.isError = 0 this.isError = 0
@ -210,7 +202,7 @@ export default {
} }
}, },
// //
downloadPic (i) { downloadPic(i) {
this.$refs['picLink' + i][0].click() this.$refs['picLink' + i][0].click()
} }
} }
@ -219,174 +211,176 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 8px; width: 8px;
height: 8px; height: 8px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
width: 5px; width: 5px;
border-radius: 6px; border-radius: 6px;
background: rgba(173, 173, 173, 0.7); background: rgba(173,173,173,.7);
} }
.wrap { .wrap {
display: flex; display: flex;
} }
.left { .left{
position: relative; position: relative;
width: calc(100% - 400px); width: calc(100% - 400px);
}
.code-mirror {
line-height: 30px;
} }
.text-wrapper { .text-wrapper {
white-space: pre-wrap; white-space: pre-wrap;
} }
/deep/.answer { /deep/.answer {
.el-tab-pane { .el-tab-pane {
padding: 0 10px; padding: 0 10px;
height: 340px; height: 340px;
overflow: hidden; overflow: hidden;
overflow-y: auto; overflow-y: auto;
white-space: pre-wrap; white-space: pre-wrap;
} }
.el-dialog--center { .el-dialog--center {
width: 500px; width: 500px;
height: 500px; height: 500px;
} }
.el-dialog__title { .el-dialog__title {
font-size: 22px; font-size: 22px;
font-weight: 500; font-weight: 500;
} }
.el-tabs__nav-wrap::after { .el-tabs__nav-wrap::after {
background-color: #333; background-color: #333;
} }
.el-tabs__active-bar { .el-tabs__active-bar {
height: 0; height: 0;
background-color: #fff; background-color: #fff;
} }
.el-tabs__header { .el-tabs__header {
background-color: #333; background-color: #333;
} }
.el-dialog--center .el-dialog__body { .el-dialog--center .el-dialog__body {
padding: 0; padding: 0;
} }
.el-tabs__item { .el-tabs__item {
width: 80px; width: 80px;
color: #fff; color: #fff;
} }
.el-tabs--top .el-tabs__item.is-top:nth-child(2) { .el-tabs--top .el-tabs__item.is-top:nth-child(2) {
padding-left: 20px; padding-left: 20px;
} }
.el-tabs__item.is-active { .el-tabs__item.is-active {
color: #fff !important; color: #fff !important;
background-color: #333 !important; background-color: #333 !important;
} }
.tips-btn { .tips-btn {
margin-top: 10px; margin-top: 10px;
height: 40px; height: 40px;
width: 90px; width: 90px;
border: none; border: none;
position: absolute; position: absolute;
right: 0; right: 0;
background: rgba(255, 49, 49, 1); background: rgba(255, 49, 49, 1);
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
&:hover, &:hover,
&:focus, &:focus,
&:active { &:active {
background: rgba(255, 49, 49, 1); background: rgba(255, 49, 49, 1);
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
}
} }
}
}
/deep/.CodeMirror-wrap pre.CodeMirror-line,
.CodeMirror-wrap pre.CodeMirror-line-like {
height: 30px;
line-height: 30px;
} }
.result-right { .result-right {
background-color: rgba(43, 40, 22, 1); background-color: rgba(43, 40, 22, 1);
} }
.result-wrong { .result-wrong {
background-color: rgba(43, 22, 22, 1); background-color: rgba(43, 22, 22, 1);
color: #f00; color: #f00;
} }
.result-wrong, .result-wrong,
.result-right { .result-right {
position: absolute; position: absolute;
left: 20px; left: 20px;
right: 20px; right: 20px;
display: flex; display: flex;
align-items: center; align-items: center;
bottom: 10px; bottom: 10px;
padding: 5px 10px; padding: 5px 10px;
img { img {
width: 40px; width: 40px;
height: 40px; height: 40px;
margin-top: 5px; margin-top: 5px;
margin-right: 10px; margin-right: 10px;
} }
} }
.code-right { .code-right {
width: 500px; width: 500px;
color: #fff; color: #fff;
background: #1b1b1b; background: #1b1b1b;
display: inline-block; display: inline-block;
position: relative; position: relative;
overflow-x: auto; overflow-x: auto;
p { p {
font-size: 18px; font-size: 18px;
margin: 10px; margin: 10px;
position: absolute;
width: calc(100% - 14px);
top: 0;
bottom: -8px;
overflow: auto;
}
}
.pic-wrap {
position: absolute; position: absolute;
left: 0; width: calc(100% - 14px);
right: 0; top: 0;
bottom: 5px; bottom: -8px;
display: flex;
max-width: calc(100% - 50px);
margin: 0 auto;
text-align: center;
overflow: auto; overflow: auto;
.pic-item { }
margin: 0 5px 5px; }
&:only-child { .pic-wrap {
.pic { position: absolute;
width: 80%; left: 0;
} right: 0;
} bottom: 5px;
} display: flex;
.pic { max-width: calc(100% - 50px);
display: block; margin: 0 auto;
width: 100px; text-align: center;
margin: 0 auto 10px; overflow: auto;
.pic-item {
margin: 0 5px 5px;
&:only-child {
.pic {
width: 80%;
}
} }
}
.pic {
display: block;
width: 100px;
margin: 0 auto 10px;
}
} }
.code-mask { .code-mask{
z-index: 2; z-index: 2;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
bottom: 0; bottom: 0;
right: 0; right: 0;
} }
.run { .run{
z-index: 99; z-index:99;
position: absolute; position:absolute;
right: 50px; right: 50px;
bottom: 15px; bottom:15px;
width: 100px; width:100px;
color: #fff; color:#fff;
} }
.download-btn { .download-btn{
color: #fff; color:#fff;
} }
/deep/.answer-wrap { /deep/.answer-wrap{
pre { pre{
width: 100%; width: 100%;
white-space: pre-wrap; white-space: pre-wrap;
} }
img { img{
max-width: 100%; max-width: 100%;
} }
} }
</style> </style>

@ -3,31 +3,33 @@
<div class="cropper-content"> <div class="cropper-content">
<!-- 剪裁框 --> <!-- 剪裁框 -->
<div class="cropper"> <div class="cropper">
<vueCropper ref="cropper" <vueCropper
:img="option.img" ref="cropper"
:output-size="option.size" :img="option.img"
:output-type="option.outputType" :output-size="option.size"
:info="true" :output-type="option.outputType"
:full="option.full" :info="true"
:can-move="option.canMove" :full="option.full"
:can-move-box="option.canMoveBox" :can-move="option.canMove"
:original="option.original" :can-move-box="option.canMoveBox"
:auto-crop="option.autoCrop" :original="option.original"
:auto-crop-width="autoCropWidth" :auto-crop="option.autoCrop"
:auto-crop-height="autoCropHeight" :auto-crop-width="option.autoCropWidth"
:fixed-box="option.fixedBox" :auto-crop-height="option.autoCropHeight"
:fixed="fixed" :fixed-box="option.fixedBox"
:fixed-number="fixedNumber" :fixed="fixed"
@real-time="realTime"></vueCropper> :fixed-number="fixedNumber"
@realTime="realTimes"
></vueCropper>
<!-- <vueCropper ref="cropper" :img="option.img" :outputSize="option.size" :outputType="option.outputType"></vueCropper> -->
</div> </div>
<!-- 预览框 --> <!-- 预览框 -->
<div class="show-preview" <div
:style="{'width': '500px', 'height': '400px', 'overflow': 'hidden', 'margin': '0 25px', 'display':'flex', 'align-items' : 'center'}"> class="show-preview"
:style="{'width': '500px', 'height': '400px', 'overflow': 'hidden', 'margin': '0 25px', 'display':'flex', 'align-items' : 'center'}">
<div :style="previews.div" <div :style="previews.div" class="preview">
class="preview"> <img :src="previews.url" :style="previews.img" />
<img :src="previews.url"
:style="previews.img" />
</div> </div>
</div> </div>
</div> </div>
@ -41,10 +43,11 @@
</div>--> </div>-->
<!-- 确认上传按钮 --> <!-- 确认上传按钮 -->
<div class="upload-btn"> <div class="upload-btn">
<el-button type="primary" <el-button
:loading="isUpload" type="primary"
:disabled="isDisabled" :loading="isUpload"
@click.prevent="uploadImg('blob')"> :disabled="isDisabled"
@click.prevent="uploadImg('blob')">
上传 上传
</el-button> </el-button>
</div> </div>
@ -56,7 +59,7 @@
import { import {
VueCropper VueCropper
} from 'vue-cropper' } from 'vue-cropper'
import { compress, compressAccurately } from 'image-conversion' import {compress, compressAccurately} from 'image-conversion'
export default { export default {
components: { components: {
VueCropper VueCropper
@ -85,30 +88,22 @@ export default {
fixed: { fixed: {
type: Boolean, type: Boolean,
default: true default: true
},
// (:80%)
autoCropWidth: {
type: Number,
default: 480
},
// (:80%)
autoCropHeight: {
type: Number,
default: 124
} }
}, },
data () { data() {
return { return {
previews: {}, // previews: {}, //
option: { option: {
img: '', // () img: '', // ()
size: 1, // (:1) size: 0.8, // (:1)
full: true, // true (:false) full: true, // true (:false)
outputType: 'png', // (:jpg) outputType: 'jpg', // (:jpg)
canMove: true, // (:true) canMove: true, // (:true)
original: false, // (:false) original: false, // (:false)
canMoveBox: true, // (:true) canMoveBox: true, // (:true)
autoCrop: true, // (:false) autoCrop: true, // (:false)
autoCropWidth: 480, // (:80%)
autoCropHeight: 124, // (:80%)
fixedBox: false, // (:false) fixedBox: false, // (:false)
fixed: true, // (:true) fixed: true, // (:true)
fixedNumber: [1, 0.26], // (:[1:1]) fixedNumber: [1, 0.26], // (:[1:1])
@ -118,38 +113,39 @@ export default {
} }
}, },
methods: { methods: {
changeScale (num) { changeScale(num) {
// //
num = num || 1 num = num || 1
this.$refs.cropper.changeScale(num) this.$refs.cropper.changeScale(num)
}, },
rotateLeft () { rotateLeft() {
// //
this.$refs.cropper.rotateLeft() this.$refs.cropper.rotateLeft()
}, },
rotateRight () { rotateRight() {
// //
this.$refs.cropper.rotateRight() this.$refs.cropper.rotateRight()
}, },
updateImg (file) { updateImg(file) {
this.option.img = file.url this.option.img = file.url
// this.option.size = file.size / 1024 > 200 ? 0.9 : 0.95 this.option.size = file.size / 1024 > 200 ? 0.9 : 0.95
}, },
realTime (data) { realTimes(data) {
console.log('data=>',data)
// //
this.previews = data this.previews = data
}, },
close () { close() {
}, },
uploadImg (type) { uploadImg(type) {
this.isDisabled = true this.isDisabled = true
// //
const that = this const that = this
if (type === 'blob') { if (type === 'blob') {
this.$refs.cropper.getCropBlob(data => { this.$refs.cropper.getCropBlob(data => {
// compress(data, 1).then(res => { compress(data, 0.8).then(res => {
that.$emit('upload', data) that.$emit('upload', res)
// }) })
}) })
} else { } else {
this.$refs.cropper.getCropData(data => { this.$refs.cropper.getCropData(data => {
@ -162,81 +158,81 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.cropper-content { .cropper-content {
display: flex; display: flex;
display: -webkit-flex; display: -webkit-flex;
justify-content: flex-end; justify-content: flex-end;
-webkit-justify-content: flex-end; -webkit-justify-content: flex-end;
} }
.cropper-content .cropper { .cropper-content .cropper {
width: 500px; width: 500px;
height: 400px; height: 400px;
} }
.cropper-content .show-preview { .cropper-content .show-preview {
flex: 1; flex: 1;
-webkit-flex: 1; -webkit-flex: 1;
display: flex; display: flex;
display: -webkit-flex; display: -webkit-flex;
justify-content: center; justify-content: center;
-webkit-justify-content: center; -webkit-justify-content: center;
overflow: hidden; overflow: hidden;
border: 1px solid #cccccc; border: 1px solid #cccccc;
background: #cccccc; background: #cccccc;
margin-left: 40px; margin-left: 40px;
} }
.preview { .preview {
overflow: hidden; overflow: hidden;
border: 1px solid #cccccc; border: 1px solid #cccccc;
background: #cccccc; background: #cccccc;
} }
.footer-btn { .footer-btn {
margin-top: 30px; margin-top: 30px;
display: flex; display: flex;
display: -webkit-flex; display: -webkit-flex;
justify-content: flex-end; justify-content: flex-end;
-webkit-justify-content: flex-end; -webkit-justify-content: flex-end;
} }
.footer-btn .scope-btn { .footer-btn .scope-btn {
width: 500px; width: 500px;
display: flex; display: flex;
display: -webkit-flex; display: -webkit-flex;
justify-content: space-between; justify-content: space-between;
-webkit-justify-content: space-between; -webkit-justify-content: space-between;
} }
.footer-btn .upload-btn { .footer-btn .upload-btn {
flex: 1; flex: 1;
-webkit-flex: 1; -webkit-flex: 1;
display: flex; display: flex;
display: -webkit-flex; display: -webkit-flex;
justify-content: center; justify-content: center;
-webkit-justify-content: center; -webkit-justify-content: center;
} }
.footer-btn .btn { .footer-btn .btn {
outline: none; outline: none;
display: inline-block; display: inline-block;
line-height: 1; line-height: 1;
white-space: nowrap; white-space: nowrap;
cursor: pointer; cursor: pointer;
-webkit-appearance: none; -webkit-appearance: none;
text-align: center; text-align: center;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
outline: 0; outline: 0;
margin: 0; margin: 0;
-webkit-transition: 0.1s; -webkit-transition: 0.1s;
transition: 0.1s; transition: 0.1s;
font-weight: 500; font-weight: 500;
padding: 8px 15px; padding: 8px 15px;
font-size: 12px; font-size: 12px;
border-radius: 3px; border-radius: 3px;
color: #fff; color: #fff;
background-color: #67c23a; background-color: #67c23a;
border-color: #67c23a; border-color: #67c23a;
} }
</style> </style>

@ -1,344 +1,253 @@
<template> <template>
<div> <div class="quill" ref="quill" :class="classes">
<el-radio-group v-if="!readonly && radio" class="type-radio" v-model="editorType" @change="typeChange"> <div ref="editor" :style="styles" v-loading="loading"></div>
<el-radio label="0">富文本</el-radio> <el-upload
<el-radio label="1">markdown</el-radio> :headers="headers"
</el-radio-group> :action="this.api.fileupload"
:before-upload="beforeUpload"
<div v-show="editorType == 0" class="quill" ref="quill" :class="classes"> :on-success="editorUploadSuccess"
<div ref="editor" :style="styles" v-loading="loading"></div> style="display: none">
<Upload :max-size="1000" :limit="100" @beforeUpload="beforeUpload" @onSuccess="editorUploadSuccess" <el-button class="editorUpload" type="primary">点击上传</el-button>
style="display: none"> </el-upload>
<div slot="trigger">
<el-button :id="'editorUpload' + index" type="primary">点击上传</el-button>
</div>
</Upload>
</div> </div>
<mavon-editor class="md" v-model="mdVal" v-show="editorType == 1" ref="md" :ishljs="true" :subfield="false"
@change="mdChange" @imgAdd="imgAdd" />
</div>
</template> </template>
<script> <script>
import Quill from 'quill'; import Quill from 'quill';
import 'quill/dist/quill.core.css'; import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css'; import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css'; import 'quill/dist/quill.bubble.css';
import toolbarOptions from './options' import toolbarOptions from './options'
import { mavonEditor } from 'mavon-editor'
import 'mavon-editor/dist/css/index.css' export default {
import Upload from '@/components/upload'; name: 'quill',
import Oss from '@/components/upload/upload.js' props: {
value: {
export default { type: String,
name: 'quill', default: ''
components: { },
Upload, readonly: {
mavonEditor type: Boolean,
}, default:false
props: { },
value: { toTop: {
type: String, type: Boolean,
default: '' default:true
}, },
readonly: { border: {
type: Boolean, type: Boolean,
default: false default:false
}, },
toTop: { height: {
type: Boolean, type: Number
default: true },
}, minHeight: {
border: { type: Number
type: Boolean, },
default: false /*
}, * 原本的readOnly失效,对比其他项目发现是quill版本不同导致
height: { * 使用props传入elseRead = 'true'手动隐藏工具栏
type: Number */
}, elseRead:{
minHeight: { type:String,default:'false'
type: Number
},
/*
* 原本的readOnly失效,对比其他项目发现是quill版本不同导致
* 使用props传入elseRead = 'true'手动隐藏工具栏
*/
elseRead: {
type: String, default: 'false'
},
//
index: {
type: Number,
default: 0
},
//
radio: {
type: Boolean,
default: false
},
//
type: {
type: String,
default: '0'
},
},
data () {
const that = this
return {
headers: {
token: sessionStorage.getItem('token')
},
editorType: '0',
mdVal: '',
Quill: null,
currentValue: '',
options: {
theme: 'snow',
bounds: document.body,
debug: 'warn',
modules: {
toolbar: {
container: toolbarOptions,
handlers: {
'image': function (value) {
if (value) {
// iview
document.querySelector("#editorUpload" + that.index).click();
} else {
this.Quill.format('image', false);
}
}
} }
}
}, },
placeholder: '', data () {
readOnly: this.readonly return {
}, headers: {
loading: false token: sessionStorage.getItem('token')
} },
}, Quill: null,
computed: { currentValue: '',
classes () { options: {
return [ theme: 'snow',
{ bounds: document.body,
'quill-no-border': !this.border debug: 'warn',
} modules: {
]; toolbar: {
}, container: toolbarOptions,
styles () { handlers: {
let style = {}; 'image': function (value) {
if (this.minHeight) { if (value) {
style.minHeight = `${this.minHeight}px`; // iview
} document.querySelector('.editorUpload').click()
if (this.height) { } else {
style.height = `${this.height}px`; this.Quill.format('image', false);
} }
return style; }
}, }
}
}, },
watch: { placeholder: '',
type: { readOnly: this.readonly
handler (val) { },
this.editorType = val loading: false
},
immediate: true
},
value: {
handler (val) {
if (this.type == 0) {
if (val !== this.currentValue) {
this.currentValue = val;
if (this.Quill) {
this.Quill.pasteHTML(this.value);
} }
} },
} computed: {
if (!this.mdVal) this.mdVal = val classes () {
}, return [
immediate: true {
} 'quill-no-border': !this.border
}, }
mounted () { ];
this.init(); },
// styles () {
if (this.elseRead === 'true') { let style = {};
let children = this.$refs.quill.children[0].style if (this.minHeight) {
children.padding = '0' style.minHeight = `${this.minHeight}px`;
children.overflow = 'hidden' }
children.height = '0' if (this.height) {
children.border = '0' style.height = `${this.height}px`;
} }
}, return style;
beforeDestroy () { },
//
this.Quill = null;
},
methods: {
//
typeChange (val) {
this.$emit('update:type', val)
if (!this.mdVal) this.mdVal = this.value
},
init () { },
const editor = this.$refs.editor; watch: {
// value: {
this.Quill = new Quill(editor, this.options); handler (val) {
const ins = this.Quill if (val !== this.currentValue) {
// this.currentValue = val;
ins.pasteHTML(this.currentValue); if (this.Quill) {
if (this.toTop) { this.Quill.pasteHTML(this.value);
this.$nextTick(() => { }
window.scrollTo(0, 0) }
}) },
} immediate: true
//
ins.on('text-change', (delta, oldDelta, source) => {
const html = this.$refs.editor.children[0].innerHTML;
const text = ins.getText();
const quill = this.Quill;
//
this.currentValue = html;
// v-model
this.$emit('input', html);
//
this.$emit('on-change', { html, text, quill });
});
// quill
ins.on('text-change', (delta, oldDelta, source) => {
this.$emit('on-text-change', delta, oldDelta, source);
});
ins.on('selection-change', (range, oldRange, source) => {
this.$emit('on-selection-change', range, oldRange, source);
});
ins.on('editor-change', (eventName, ...args) => {
this.$emit('on-editor-change', eventName, ...args);
});
//
ins.root.addEventListener('paste', evt => {
if (evt.clipboardData && evt.clipboardData.files && evt.clipboardData.files.length) {
evt.preventDefault();
//
[].forEach.call(evt.clipboardData.files, file => {
if (!file.type.match(/^image\/(gif|jpe?g|a?png|bmp)/i)) {
return
} }
// ossbase64 },
Oss.upload(file).then(res => { created(){
var range = ins.getSelection() },
if (range) { mounted () {
// this.init();
ins.insertEmbed(range.index, 'image', res.url) //
// if(this.elseRead==='true'){
ins.setSelection(range.index + 1) let children = this.$refs.quill.children[0].style
} children.padding = '0'
}) children.overflow = 'hidden'
}); children.height = '0'
} children.borderTop = '0'
}, false) }
}, },
beforeUpload (file) { beforeDestroy () {
this.loading = true //
}, this.Quill = null;
// quill },
editorUploadSuccess (file) { methods: {
// init () {
let quill = this.Quill const editor = this.$refs.editor;
// //
if (file.url) { this.Quill = new Quill(editor, this.options);
// const ins = this.Quill
let lengths; //
if (quill.getSelection() == null) { ins.pasteHTML(this.currentValue);
lengths = 1 if(this.toTop){
} else { this.$nextTick(() => {
lengths = quill.getSelection().index; window.scrollTo(0,0)
})
}
//
ins.on('text-change', (delta, oldDelta, source) => {
const html = this.$refs.editor.children[0].innerHTML;
const text = ins.getText();
const quill = this.Quill;
//
this.currentValue = html;
// v-model
this.$emit('input', html);
//
this.$emit('on-change', { html, text, quill });
});
// quill
ins.on('text-change', (delta, oldDelta, source) => {
this.$emit('on-text-change', delta, oldDelta, source);
});
ins.on('selection-change', (range, oldRange, source) => {
this.$emit('on-selection-change', range, oldRange, source);
});
ins.on('editor-change', (eventName, ...args) => {
this.$emit('on-editor-change', eventName, ...args);
});
//
ins.root.addEventListener('paste', evt => {
if (evt.clipboardData && evt.clipboardData.files && evt.clipboardData.files.length) {
evt.preventDefault();
//
[].forEach.call(evt.clipboardData.files, file => {
if (!file.type.match(/^image\/(gif|jpe?g|a?png|bmp)/i)) {
return
}
const param = new FormData()
param.append('file', file)
// base64
this.$post(this.api.fileupload, param, {
headers: { "Content-Type": "multipart/form-data" }
}).then(res => {
var range = ins.getSelection()
if (range) {
//
ins.insertEmbed(range.index, 'image', res.data.filesResult.fileUrl)
//
ins.setSelection(range.index + 1)
}
}).catch(res => {})
});
}
}, false)
},
beforeUpload(file){
this.loading = true
},
editorUploadSuccess (res) {
//
let quill = this.Quill
//
if (res.data.filesResult.fileUrl) {
//
let lengths;
if ( quill.getSelection() == null){
lengths = 1
}else{
lengths = quill.getSelection().index;
}
// res
quill.insertEmbed(lengths, 'image', res.data.filesResult.fileUrl)
//
quill.setSelection(lengths + 1)
} else {
this.$message.success('图片插入失败')
}
this.loading = false
},
} }
// res }
quill.insertEmbed(lengths, 'image', file.url)
//
quill.setSelection(lengths + 1)
} else {
this.$message.success('图片插入失败')
}
this.loading = false
},
//
mdChange (val) {
this.$emit('input', val)
},
// markdown
imgAdd (pos, $file) {
let $vm = this.$refs.md
// oss
Oss.upload($file).then(res => {
$vm.$img2Url(pos, res.url);
})
},
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.type-radio { .quill-no-border{
margin-bottom: 20px; .ql-toolbar.ql-snow{
} border: none;
border-bottom: 1px solid #e8eaec;
.quill-no-border { }
.ql-toolbar.ql-snow { .ql-container.ql-snow{
border: none; border: none;
border-bottom: 1px solid #e8eaec; }
}
.ql-container.ql-snow {
border: none;
}
}
.else {
.ql-toolbar.ql-snow {
height: 0;
overflow: hidden;
padding: 0;
border-top: 0;
}
}
/deep/.ql-snow {
position: relative;
.ql-tooltip {
position: absolute !important;
top: 0 !important;
left: -100px !important;
transform: translateY(10px);
}
}
.md {
max-height: 300px;
}
/deep/.v-note-wrapper .v-note-panel {
min-height: 200px;
}
/deep/.markdown-body {
ul {
list-style: disc;
li {
list-style: inherit;
} }
} .else{
.ql-toolbar.ql-snow{
ol { height: 0;
list-style: decimal; overflow: hidden;
padding: 0;
li { border-top: 0;
list-style: inherit; }
}
/deep/.ql-snow {
position: relative;
.ql-tooltip {
position: absolute !important;
top: 0 !important;
left: -100px !important;
transform: translateY(10px);
}
} }
}
}
</style> </style>

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

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

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

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

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

@ -1,28 +0,0 @@
export default {
types: [
{
id: 1,
name: '演示文稿类'
},
{
id: 2,
name: '视频类'
},
{
id: 3,
name: '图形类'
},
{
id: 4,
name: '文本类'
},
{
id: 5,
name: '音频类'
},
{
id: 6,
name: '其他'
},
],
}

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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

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

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

@ -2,18 +2,17 @@ import Vue from 'vue';
import App from './App.vue'; import App from './App.vue';
import router from './router'; import router from './router';
import ElementUI from 'element-ui'; import ElementUI from 'element-ui';
import "@/assets/css/default/index.scss"; // import 'element-ui/lib/theme-chalk/index.css'; // 默认主题
import './assets/css/theme-green/index.css'; // 浅绿色主题
import './assets/css/icon.css'; import './assets/css/icon.css';
import './assets/icon/iconfont.css'; import './assets/icon/iconfont.css';
import 'babel-polyfill'; import 'babel-polyfill';
import './utils/rem'; import './utils/rem';
import { post, get, del, put } from './utils/http'; import {post,get,del,put} from './utils/http';
import api from './utils/api'; import api from './utils/api';
import store from './store' import store from './store'
import { import { systemStatus, systemTypeStatus, systemAttributionStatus, courseTypeStatus,
systemStatus, systemTypeStatus, systemAttributionStatus, courseTypeStatus, hoursStatus, roleStatus, orderTypeFn, orderStatusFn, orderNatureFn, Percentage, removeByValue, isIE, encodeString, formatDate, downloadFile, dateCompatible } from './utils/core';
hoursStatus, roleStatus, orderTypeFn, orderStatusFn, orderNatureFn, Percentage, removeByValue, isIE, encodeString, formatDate, downloadFile, dateCompatible
} from './utils/core';
import preventReClick from './utils/preventReClick' //防多次点击,重复提交 import preventReClick from './utils/preventReClick' //防多次点击,重复提交
import plugins from '@/directive'; import plugins from '@/directive';
@ -45,7 +44,7 @@ Vue.use(ElementUI, { size: 'small' });
Vue.use(plugins); Vue.use(plugins);
new Vue({ new Vue({
router, router,
store, store,
render: h => h(App) render: h => h(App)
}).$mount('#app'); }).$mount('#app');

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

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

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

File diff suppressed because it is too large Load Diff

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

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

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

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

@ -1,95 +1,34 @@
<template> <template>
<div class="wrapper"> <div class="wrapper">
<v-head></v-head> <v-head></v-head>
<Navbar></Navbar> <v-sidebar></v-sidebar>
<div class="layout"> <div class="content-box" >
<Sidebar :class="{ show: showSidebar }" :path.sync="path" /> <div class="content">
<div class="content-box"> <transition name="move" mode="out-in">
<transition name="move" mode="out-in"> <!-- <keep-alive> -->
<router-view></router-view> <router-view></router-view>
</transition> <!-- </keep-alive> -->
<el-backtop target=".content-box"></el-backtop> </transition>
</div> <el-backtop target=".content"></el-backtop>
</div>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
import vHead from '../components/Header.vue' import vHead from '../components/Header.vue';
import Navbar from '../components/Navbar.vue' import vSidebar from '../components/Sidebar.vue';
import Sidebar from '../components/Sidebar.vue'
import Setting from "@/setting"
import util from "@/libs/util"
export default { export default {
data () { data() {
return { return {
showSidebar: false, tagsList: [],
path: '', };
}; },
}, components: {
components: { vHead,
vHead, vSidebar,
Navbar, },
Sidebar, created() {
},
watch: {
'$route.path': {
handler (val) {
this.path = val
//
this.showSidebar = ['/configure', '/curriculum', '/information', '/shop', '/market', '/parnerOperation', '/parner', '/match', '/data', '/review', '/theoreticalCourse', '/resourse'].includes(val)
},
immediate: true
} }
},
created () {
},
methods: {
// ,退
autoLogout () {
let lastTime = new Date().getTime();
document.onmousedown = () => {
lastTime = new Date().getTime();
};
const timer = setInterval(() => {
if (sessionStorage.getItem('token') && (new Date().getTime() - lastTime) > Setting.autoLogoutTime) {
clearInterval(timer)
util.errorMsg("由于您已经有三个小时没有操作,系统自动登出,请重新登录。页面刷新到登录页。");
setTimeout(() => {
localStorage.removeItem('ms_username');
localStorage.removeItem('token');
sessionStorage.clear()
location.reload()
}, 1500);
}
}, 1000);
}
}
}; };
</script> </script>
<style lang="scss" scoped>
.layout {
display: flex;
background: #f5f7fa;
.content-box {
width: calc(100vw - 208px);
padding: 20px;
box-sizing: border-box;
// -webkit-transition: left 0.3s ease-in-out;
// transition: left 0.3s ease-in-out;
}
.sidebar:not(.show) {
margin-left: -200px;
&+.content-box {
width: 100%;
}
}
}
</style>

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

File diff suppressed because it is too large Load Diff

@ -0,0 +1,204 @@
<template>
<div>
<el-row :gutter="20">
<el-col :span="24">
<el-card shadow="hover" class="mgb20">
<div class="flex-between">
<div class="per_title" @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" round class="mag" @click="saveAdd('form')">确定
</el-button>
</div>
</div>
</el-card>
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20 user_header">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>环节1.1</span>
</div>
<el-button type="primary" round class="mag" @click="addcourse()">添加环节</el-button>
</div>
<div>
<el-form :model="form" ref="form" label-width="120px" class="courseware">
<ul class="mgb20">
<li v-for="(item,index) in form.courseList" :key="index" class="flex-between">
<div style="width: 50%;">
<el-form-item label="环节名称" :prop="'courseList.' + index + '.linkName'"
:rules="{required: true, message: '请输入项目课件', trigger: 'blur'}">
<el-input placeholder="请输入项目课件" v-model="item.linkName"></el-input>
</el-form-item>
<el-form-item label="资源添加" :prop="'courseList.' + index + '.fileLink'"
:rules="{required: true, message: '请添加文件', trigger: 'blur'}">
<el-upload
class="link_upload"
:headers="{token}"
:action="api.uploadFiles"
:on-remove="(file, fileList)=>{return handleRemove(file, fileList, index)}"
:on-error="uploadError"
:on-success="(response, file, fileList)=>{return uploadSuccess(response, file, fileList, index)}"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:file-list="item.uploadList">
<el-button size="medium" type="primary" icon="el-icon-upload"
class="uploadTitle">点击上传
</el-button>
</el-upload>
</el-form-item>
</div>
<div>
<el-button size="medium" type="primary" @click="delCourse(index)">删除课件
</el-button>
</div>
</li>
</ul>
</el-form>
</div>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
data() {
return {
token: this.$store.state.loginToken,
form: {
courseList: [{
projectId: this.$store.state.systemId,
courseId: this.$store.state.courseId,
linkName: "",
fileLink: "",
uploadList: []
}]
}
};
},
mounted() {
this.getData();
},
methods: {
getData() {
let data = {
projectId: this.form.courseList[0].projectId,
courseId: this.form.courseList[0].courseId
};
this.$get(this.api.queryLinkDetails, data).then((res) => {
res.message.map(e => {
var arr = [];
arr.push({ name: e.linkName, url: e.fileLink });
this.$set(e, "uploadList", arr);
});
this.form.courseList = res.message;
}).catch((res) => {
});
},
saveAdd(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
var arr = this.form.courseList.map(v => {
var obj = {
...v
};
delete obj.uploadList;
return obj;
});
let data = {
courseLink: arr
};
this.$post(this.api.addCourseLink, data).then((res) => {
this.$message.success("添加成功!");
this.goback();
}).catch((res) => {
});
}
});
},
addcourse() {
this.form.courseList = this.form.courseList.concat({
projectId: this.$store.state.systemId,
courseId: this.$store.state.courseId,
linkName: "",
fileLink: "",
uploadList: []
});
},
//
handleExceed(files, fileList) {
this.$message.warning(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
);
},
uploadSuccess(response, file, fileList, idx) {
this.form.courseList[idx].uploadList.push({ name: file.name, url: response.message.fileUrl });
this.form.courseList[idx].fileLink = 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, idx) {
let uploadList = this.form.courseList[idx].uploadList;
uploadList.forEach((item, index) => {
if (file.name == item.name) {
uploadList.splice(index, 1);
}
});
},
delCourse(index) {
this.$confirm("确定要删除该课件吗?", "提示", {
type: "warning"
})
.then(() => {
this.form.courseList.splice(index, 1);
this.$message.success("删除成功");
})
.catch(() => {
});
},
goback() {
this.$router.go(-1);
}
}
};
</script>
<style scoped>
/* .courseware ul .el-input{
width: 30%;
} */
.courseware ul li {
margin-top: 20px;
padding: 0 0 10px 0;
border-bottom: 1px dashed #eee;
}
.courseware ul li:first-child {
margin-top: 0;
}
.courseware ul li:last-child {
border-bottom: none;
}
.uploadTitle {
height: 40px !important;
font-size: 16px;
}
</style>

@ -0,0 +1,318 @@
<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-col :span="4">
<el-form-item label="学科类别">
<el-select v-model="form.categoryId" clearable
@change="getProfessionalClass()" @clear="clearClass()">
<el-option v-for="(item,index) in subjectList" :key="index"
:label="item.disciplineName"
:value="item.disciplineId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="专业类">
<el-select v-model="form.professionalCategoryId" clearable
:disabled="form.categoryId ? false : true"
@change="getProfessional()" @clear="clearProfess()">
<el-option v-for="(item,index) in ProfessionalClassList" :key="index"
:label="item.professionalClassName"
:value="item.professionalClassId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="专业">
<el-select v-model="form.professionalId" clearable
:disabled="form.professionalCategoryId ? false : true"
@change="getData()">
<el-option v-for="(item,index) in ProfessionalList" :key="index"
:label="item.professionalName"
:value="item.professionalId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="课程类别">
<el-select v-model="form.curriculumType" clearable
@change="getData()">
<el-option label="理论课程" :value="0"></el-option>
<el-option label="实训课程" :value="1"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="请输入课程名称" prefix-icon="el-icon-search"
v-model="form.curriculumName" clearable
@keyup.enter.native="onSearch"></el-input>
</el-form-item>
</el-col>
</el-form>
</div>
</div>
</el-card>
<el-card shadow="hover" class="card">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="hr_tag"></p>
<span>课程列表</span>
</div>
<div>
<el-button type="primary" round @click="addcourse" v-auth>新增课程</el-button>
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
</div>
</div>
<el-table v-loading="loading" :data="courseData" class="table" ref="table" stripe header-align="center"
@selection-change="handleSelectionChange" :row-key="getRowKeys">
<el-table-column type="selection" width="55" align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="curriculumName" label="课程名称" align="center"></el-table-column>
<el-table-column prop="curriculumType" label="课程类型" align="center">
<template slot-scope="scope">
<span class="ellipsis">{{ courseTypeStatus[scope.row.curriculumType] }}</span>
</template>
</el-table-column>
<el-table-column prop="userName" label="创建人" align="center"></el-table-column>
<el-table-column label="配置的实训应用" align="center">
<template slot-scope="scope">
<span class="ellipsis">{{ scope.row.sysName }}</span>
</template>
</el-table-column>
<el-table-column prop="orderVolume" label="订单量" align="center"></el-table-column>
<el-table-column prop="expectedCourse" label="预计课时" align="center"></el-table-column>
<el-table-column label="上架/下架" align="center">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isShelves"
:active-value="1"
:inactive-value="0"
@change="changeSwitch($event, scope.row)"
v-auth="'/curriculum:上下架'">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)" v-auth>编辑</el-button>
<el-button type="text" @click="config(scope.row)" v-auth>内容设置</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="pageNo"
layout="total, prev, pager, next" :total="totals"></el-pagination>
</div>
</el-card>
</div>
</template>
<script>
export default {
name: "customer",
data() {
return {
courseTypeStatus: {
0: "理论课程",
1: "实训课程"
},
name: localStorage.getItem("ms_username"),
courseData: [],
form: {
categoryId: "",
professionalCategoryId: "",
professionalId: "",
curriculumType: "",
curriculumName: ""
},
pageNo: +this.$route.query.page || 1,
pageSize: 10,
totals: 0,
subjectList: [], //
ProfessionalClassList: [], //
ProfessionalList: [], //
multipleSelection: [],
loading: false,
searchTimer: null
};
},
watch: {
"form.curriculumName": function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted() {
this.getSubject();
this.getData();
},
methods: {
getRowKeys(row) {
return row.cid;
},
//
getData() {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
let data = {
...this.form,
pageNum: this.pageNo,
pageSize: this.pageSize,
supplierId: sid ? sid.supplierId : ''
};
this.$post(this.api.curriculumList, data).then(res => {
this.courseData = res.page.records;
this.totals = res.page.total;
this.loading = false;
}).catch(err => {
});
},
initData() {
this.pageNo = 1;
this.getData();
},
//
getSubject() {
this.$get(this.api.courseDiscipline).then(res => {
this.subjectList = res.list;
}).catch(err => {
});
},
//
clearClass() {
this.form.professionalCategoryId = "";
this.form.professionalId = "";
},
//
getProfessionalClass() {
this.clearClass();
this.getProfessionalClassData();
this.pageNo = 1;
this.getData();
},
getProfessionalClassData() {
let data = {
disciplineId: this.form.categoryId
};
this.$get(this.api.courseProfessionalClass, data).then(res => {
this.ProfessionalClassList = res.list;
}).catch(err => {
});
},
//
clearProfess() {
this.form.professionalId = "";
},
//
getProfessional() {
this.clearProfess();
this.getProfessionalData();
this.pageNo = 1;
this.getData();
},
getProfessionalData() {
let data = {
professionalClassId: this.form.professionalCategoryId
};
this.$get(this.api.courseProfessional, data).then(res => {
this.ProfessionalList = res.list;
}).catch(err => {
});
},
//
addcourse() {
this.$router.push("/addcurriculum");
},
//
edit(row) {
this.$router.push(`/addcurriculum?cid=${row.cid}`);
},
//
config(row) {
this.$router.push(`/contentSettings?cid=${row.cid}&name=${row.curriculumName}`);
},
//
handleDelete(row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.delCourse}?cids=${row.cid}`).then(res => {
this.getData();
this.$message.success("删除成功");
}).catch(err => {
});
}).catch(() => {
});
},
//
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
delAllSelection() {
if (this.multipleSelection.length) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(i => i.cid);
this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => {
if(ids.length == this.courseData.length){
if(this.pageNo > 1){
this.pageNo = this.pageNo-1
}
}
this.getData();
this.$message.success("删除成功");
this.$refs.table.clearSelection()
}).catch(err => {
});
}).catch(() => {
});
} else {
this.$message.warning("请先选择课程 !");
}
},
//
handleCurrentChange(val) {
this.pageNo = val;
this.$router.push(`curriculum?page=${val}`)
this.getData();
},
//
onSearch() {
this.pageNo = 1;
this.getData();
},
//
changeSwitch(value, row) {
this.$post(`${this.api.isShelves}?cid=${row.cid}&isShelves=${value}`).then((res) => {
this.getData();
this.$message.success("修改上下架状态成功!");
}).catch((res) => {
});
}
}
};
</script>
<style scoped>
.card {
min-height: calc(100vh - 300px);
}
.mag {
margin-right: 20px;
}
</style>

File diff suppressed because it is too large Load Diff

@ -1,610 +0,0 @@
<template>
<el-drawer title="添加系统资源" :visible.sync="sourceVisible" size="1200px" :close-on-click-modal="false"
custom-class="source-dia" @closed="closeDia">
<div class="overflow" v-loading="loading">
<div class="left">
<div class="tabs mgb20">
<a class="item" v-for="(item, i) in tabs" :key="i" :class="{ active: i == active }" @click="tabChange(i)">{{
item
}}</a>
</div>
<template v-if="active !== 'tab3'">
<el-input class="mgb10" style="width: 300px" placeholder="请输入资源名称" prefix-icon="el-icon-search"
v-model="keyword" clearable></el-input>
<div class="course">
<div v-for="(course, i) in course" :key="i" class="item">
<div class="line">
<i :class="`el-icon-caret-right arrow ${course.shrink ? 'active' : ''}`"
@click="course.shrink = !course.shrink"></i>
<el-checkbox class="check" v-model="course.check" @change="checkCourse(course)"></el-checkbox>
<img v-if="course.coverUrl" class="cover" :src="course.coverUrl" alt="">
<span class="course-name">{{ course.curriculumName || course.courseName }}</span>
</div>
<div v-if="course.shrink" class="chapters">
<!-- 章节 -->
<div v-for="(chapter, j) in course.chapters" :key="j" class="">
<div class="line">
<i :class="`el-icon-caret-right arrow ${chapter.shrink ? 'active' : ''}`"
@click="chapter.shrink = !chapter.shrink"></i>
<el-checkbox class="check" v-model="chapter.check" @change="checkChapter(chapter, course)">{{
chapter.name
}}</el-checkbox>
</div>
<!-- 小节 -->
<div v-if="chapter.shrink" class="sections">
<div v-for="(section, k) in chapter.subsections" :key="k" class="line">
<el-checkbox class="check" v-model="section.check" @change="checkSection(section, chapter)">
<img v-if="section.fileType === 'pptx'" src="@/assets/img/exts/ppt.png" alt="">
<img v-else-if="section.fileType === 'mp4'" src="@/assets/img/exts/video.png" alt="">
<img v-else-if="section.fileType === 'doc' || section.fileType === 'docx'"
src="@/assets/img/exts/word.png" alt="">
<img v-else-if="section.fileType === 'xlsx' || section.fileType === 'xls'"
src="@/assets/img/exts/excel.png" alt="">
<img v-else-if="section.fileType === 'txt'" src="@/assets/img/exts/txt.png" alt="">
<img v-else-if="section.fileType === 'pdf'" src="@/assets/img/exts/pdf.png" alt="">
<img v-else src="@/assets/img/exts/pic.png" alt="">
{{ section.name }}</el-checkbox>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<!-- 文件素材 -->
<div v-else class="materials">
<div class="types">
<div class="flex-center m-b-10">
<p class="addhr_tag"></p>
<span>资源类型</span>
</div>
<ul class="lines">
<li v-for="(item, i) in sourceType" :key="i" :class="['line', { active: curType === item.name }]"
@click="checkType(item)">{{ item.name }}</li>
</ul>
</div>
<div class="sources">
<div class="flex-center m-b-10">
<p class="addhr_tag"></p>
<span>资源列表</span>
</div>
<el-input class="m-b-10" placeholder="请输入资源名称" prefix-icon="el-icon-search" v-model="keyword"
clearable></el-input>
<ul class="lines">
<el-checkbox v-if="sources.length" v-model="checkAll" label="全选" @change="checkAllChange"></el-checkbox>
<li v-for="(item, i) in sources" :key="i" class="line">
<el-checkbox v-model="item.check" :label="item.resourceName" @change="sourceChange(item)"></el-checkbox>
</li>
</ul>
</div>
</div>
</div>
<div class="right">
<div v-if="$parent.curSection.id" class="m-b-20">
<p class="total m-b-10">原资源共1个</p>
<div v-html="$parent.curSection.name"></div>
</div>
<template v-if="checked.length">
<div class="flex-between m-b-10">
<p class="total">已选资源{{ checked.length }}</p>
<el-button type="text" @click="batchDelChecked">批量移除</el-button>
</div>
<el-input placeholder="请输入资源名称" prefix-icon="el-icon-search" v-model="checkedKeyword" clearable></el-input>
<div class="lines">
<template v-for="(item, i) in checked">
<div v-if="!item.name || item.name.includes(checkedKeyword)" :key="i" class="line">
<div class="check-left">
<el-checkbox v-model="item.check"></el-checkbox>
<span class="serial">{{ i + 1 }}</span>
<el-tooltip effect="dark" :content="item.name" placement="top-start">
<p class="checked-name ellipsis">{{ item.name }}</p>
</el-tooltip>
</div>
<i class="el-icon-delete action-icon" @click="delChecked(item)"></i>
</div>
</template>
</div>
</template>
<div v-else class="empty">
<img class="icon" src="@/assets/img/empty.svg" alt="">
<p>暂无数据</p>
</div>
</div>
</div>
<div class="btns">
<el-button @click="sourceVisible = false">取消</el-button>
<el-button type="primary" :loading="submiting" @click="submit">确定</el-button>
</div>
</el-drawer>
</template>
<script>
import Setting from '@/setting'
import Util from '@/libs/util'
import _ from 'lodash'
import SourceConst from '@/const/source'
export default {
props: ['visible'],
data () {
return {
sourceVisible: false,
active: 'tab1',
tabs: {
tab1: '教学课程',
tab2: '精品课程',
tab3: '文件素材',
},
sourceType: [],
curType: '全部',
sources: [],
checkAll: false,
keyword: '',
searchTimer: null,
checkedKeyword: '',
allSections: [],
course: [],
checked: [],
submiting: false,
loading: false,
};
},
watch: {
'keyword': function (val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(this.getCourse, 500)
},
visible () {
this.sourceVisible = this.visible
this.visible && this.init()
}
},
mounted () {
},
methods: {
//
init () {
this.checked = []
this.curType = '全部'
this.sourceType = [
{
id: '',
name: '全部'
},
...SourceConst.types
]
this.sourceType.forEach(e => {
e.check = false
})
this.getCourse()
},
//
async getCourse () {
try {
this.loading = true
this.checkAll = false
const { checked } = this
if (this.active === 'tab3') {
const { page } = await this.$post(this.api.resourceLibrary, {
pageNum: 1,
pageSize: 10000,
platformId: Setting.platformId,
type: 2,
keyword: this.keyword,
displayFileType: this.curType === '全部' ? [] : [this.curType],
})
const list = page.records
list.forEach(e => {
const cur = checked.find(m => m.resourceName && m.id === e.id)
e.name = e.resourceName
e.check = !!cur
})
this.sources = list
} else {
const { list } = await this.$post(`${this.api[this.active === 'tab1' ? 'curriculumTree' : 'boutiqueCurriculumTree']}?name=${this.keyword}`)
if (list.length) {
const all = []
list.forEach(e => {
e.shrink = false
e.check = false
e.chapters.forEach(n => {
n.shrink = false
n.check = false
all.push(...n.subsections)
n.subsections.forEach(m => {
const cur = checked.find(j => m.cid === j.cid && m.id === j.id)
m.check = !!cur
})
})
})
list.forEach(e => {
e.shrink = false
e.check = false
e.chapters.forEach(n => {
n.shrink = false
n.check = n.subsections.every(m => m.check)
})
})
list.forEach(e => {
e.shrink = false
e.check = e.chapters.every(m => m.check)
})
list[0].shrink = true
list[0].chapters[0].shrink = true
this.allSections = all
}
this.course = list
}
} finally {
this.loading = false
}
},
initData () {
this.page = 1;
this.getData();
},
tabChange (index) {
this.keyword = ''
this.active = index
this.getCourse()
},
//
checkCourse (row) {
const { check } = row
const { checked } = this
row.chapters.forEach(e => {
e.check = check
e.subsections.forEach(n => {
n.check = check
const cur = checked.findIndex(m => m.id === n.id)
if (check) {
if (cur === -1) {
const section = _.cloneDeep(n)
section.check = false
checked.push(section)
}
} else {
cur !== -1 && checked.splice(cur, 1)
}
})
})
},
//
checkChapter (row, course) {
const { check } = row
const { checked } = this
row.subsections.forEach(n => {
n.check = check
const cur = checked.findIndex(m => m.id === n.id)
if (check) {
if (cur === -1) {
const section = _.cloneDeep(n)
section.check = false
checked.push(section)
}
} else {
cur !== -1 && checked.splice(cur, 1)
}
})
course.check = course.chapters.every(e => e.check)
},
//
async checkSection (row, chapter) {
const { check } = row
const { checked } = this
const cur = checked.findIndex(m => m.id === row.id)
if (check) {
if (cur === -1) {
const section = _.cloneDeep(row)
section.check = false
this.checked.push(section)
}
} else {
cur !== -1 && this.checked.splice(cur, 1)
}
chapter.check = chapter.subsections.every(e => e.check)
},
//
checkAllChange (val) {
this.sources.map(e => {
e.check = val
this.sourceChange(e)
})
},
//
checkType ({ name }) {
this.curType = name
this.getCourse()
},
//
sourceChange (row) {
const { check } = row
const { checked } = this
const cur = checked.findIndex(m => m.id === row.id)
if (check) {
if (cur === -1) {
const section = _.cloneDeep(row)
section.check = false
this.checked.push(section)
}
} else {
cur !== -1 && this.checked.splice(cur, 1)
}
},
//
async batchDelChecked (val) {
try {
const checked = this.checked.filter(e => e.check)
if (checked.length) {
checked.map(e => {
const cur = this.allSections.find(n => n.id === e.id)
if (cur) {
cur.check = false
}
})
this.checked = this.checked.filter(e => !e.check)
} else {
Util.warningMsg('请选择数据')
}
} catch (e) { }
},
//
async delChecked (item) {
try {
const cur = this.allSections.find(e => e.id === item.id)
if (cur) cur.check = false
this.checked.splice(this.checked.findIndex(e => e.id === item.id), 1)
} catch (e) { }
},
//
async submit () {
try {
if (this.submiting) return false
const { checked } = this
if (checked.length) {
this.submiting = true
const { chapterId, id } = this.$parent
const result = checked.map(e => {
return {
chapterId,
cid: id,
resourceId: e.id,
type: e.cid ? 0 : e.resourceName ? 2 : 1,
}
})
const old = this.$parent.curSection //
if (old.id) {
//
await this.$post(this.api.replaceResource, {
chapterId: old.chapterId,
cid: +id,
subsectionId: old.id,
newResource: result
})
} else {
//
await this.$post(this.api.combinationResource, result)
}
this.sourceVisible = false
this.$parent.switchTypeVisible = false
this.$parent.getData()
this.submiting = false
} else {
Util.warningMsg('请选择资源')
}
} catch (e) {
this.submiting = false
}
},
//
closeDia () {
this.$emit('update:visible', false)
}
}
};
</script>
<style lang="scss" scoped>
/deep/.source-dia {
.el-drawer__header {
padding-bottom: 20px;
margin-bottom: 0;
border-bottom: 1px solid #eee;
}
.overflow {
display: flex;
}
.btns {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: 14px 0;
text-align: center;
background-color: #fff;
box-shadow: 4px -2px 6px 0px rgba(198, 198, 198, 0.3500);
}
.empty {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100%;
font-size: 14px;
text-align: center;
color: #a3a3a3;
}
.left {
width: 700px;
padding: 0 15px;
border-right: 1px solid #eee;
box-sizing: border-box;
.course {
height: calc(100vh - 263px);
overflow: auto;
.item {
padding: 10px;
margin-bottom: 10px;
background-color: #f9f9f9;
}
}
.line {
display: flex;
align-items: center;
}
.arrow {
font-size: 16px;
color: #9f9f9f;
cursor: pointer;
transition: .3s;
&.active {
transform: rotate(90deg);
}
}
.check {
margin: 0 10px;
img {
vertical-align: middle;
}
}
.cover {
width: 100px;
max-height: 80px;
margin-right: 15px;
border-radius: 6px;
}
.course-name {
font-size: 14px;
color: #333;
}
.chapters {
padding-left: 26px;
margin-top: 10px;
.line {
margin-bottom: 10px;
}
}
.chapter-name {
font-size: 13px;
color: #ccc;
}
.sections {
padding-left: 43px;
}
}
.right {
flex: 1;
padding: 15px;
.total {
font-size: 15px;
color: #333;
font-weight: 600;
}
.lines {
height: calc(100vh - 228px);
padding-right: 10px;
margin-top: 10px;
overflow: auto;
}
.line {
display: flex;
padding: 5px 0;
color: #333;
}
.serial {
width: 32px;
margin: 0 12px;
text-align: center;
white-space: nowrap;
}
.check-left {
display: inline-flex;
align-items: center;
}
.checked-name {
width: 360px;
margin-right: 20px;
}
.action-icon {
font-size: 14px;
cursor: pointer;
}
}
.materials {
display: flex;
gap: 20px;
}
.types {
width: 250px;
height: calc(100vh - 223px);
padding: 15px;
background-color: #f9f9f9;
box-sizing: border-box;
overflow: auto;
.line {
margin-bottom: 10px;
cursor: pointer;
&.active {
font-weight: 600;
color: #062c87;
}
}
}
.sources {
flex: 1;
padding: 10px;
.line {
margin-top: 8px;
}
}
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,332 +0,0 @@
<template>
<div>
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>筛选</span>
</div>
<div>
<el-form label-width="80px">
<el-col :span="4">
<el-form-item label="学科类别">
<el-select v-model="form.categoryId" clearable @change="getProfessionalClass()" @clear="clearClass()">
<el-option v-for="(item, index) in subjectList" :key="index" :label="item.disciplineName"
:value="item.disciplineId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="专业类">
<el-select v-model="form.professionalCategoryId" clearable :disabled="form.categoryId ? false : true"
@change="getProfessional()" @clear="clearProfess()">
<el-option v-for="(item, index) in ProfessionalClassList" :key="index"
:label="item.professionalClassName" :value="item.professionalClassId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="专业">
<el-select v-model="form.professionalId" clearable
:disabled="form.professionalCategoryId ? false : true" @change="getData()">
<el-option v-for="(item, index) in ProfessionalList" :key="index" :label="item.professionalName"
:value="item.professionalId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="课程类别">
<el-select v-model="form.curriculumType" clearable @change="getData()">
<el-option v-for="(item, i) in courseTypeStatus" :key="i" :label="item" :value="i"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="请输入课程名称" prefix-icon="el-icon-search" v-model="form.curriculumName" clearable
@keyup.enter.native="onSearch"></el-input>
</el-form-item>
</el-col>
</el-form>
</div>
</div>
</el-card>
<el-card shadow="hover" class="card">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="hr_tag"></p>
<span>课程列表</span>
</div>
<div>
<el-button type="primary" round @click="addcourse" v-auth="'/curriculum:新增课程'">新增课程</el-button>
<el-button type="primary" round @click="delAllSelection" v-auth="'/curriculum:批量删除'">批量删除</el-button>
</div>
</div>
<el-table v-loading="loading" :data="courseData" class="table" ref="table" header-align="center"
@selection-change="handleSelectionChange" row-key="cid">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="70" label="序号" align="center"></el-table-column>
<el-table-column prop="curriculumName" label="课程名称" align="center"></el-table-column>
<el-table-column prop="curriculumType" label="课程类别" width="90" align="center">
<template slot-scope="scope">
<span class="ellipsis">{{ courseTypeStatus[scope.row.curriculumType] }}</span>
</template>
</el-table-column>
<el-table-column label="配置的系统" align="center">
<template slot-scope="scope">
<span class="ellipsis">{{ scope.row.sysName }}</span>
</template>
</el-table-column>
<el-table-column prop="expectedCourse" label="预计课时" width="90" align="center"></el-table-column>
<el-table-column prop="orderVolume" label="订单量" width="90" align="center"></el-table-column>
<el-table-column prop="userName" label="创建人" width="120" align="center"></el-table-column>
<el-table-column label="上架/下架" width="90" align="center">
<template slot-scope="scope">
<el-switch v-model="scope.row.isShelves" :active-value="1" :inactive-value="0"
@change="changeSwitch($event, scope.row)" v-auth="'/curriculum:上下架'">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" width="240" align="center">
<template slot-scope="scope">
<el-button type="text" @click="preview(scope.row)">预览课程</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth="'/curriculum:编辑'">编辑</el-button>
<el-button type="text" @click="config(scope.row)" v-auth="'/curriculum:内容设置'">内容设置</el-button>
<el-button type="text" @click="copy(scope.row)">复制</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth="'/curriculum:删除'">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page"
layout="total, prev, pager, next" :total="totals"></el-pagination>
</div>
</el-card>
</div>
</template>
<script>
import Setting from '@/setting'
import qs from 'qs'
import Util from '@/libs/util'
export default {
data () {
return {
courseTypeStatus: {
0: '理论课程',
1: '实训课程',
2: '理实课程',
},
name: localStorage.getItem("ms_username"),
courseData: [],
form: {
categoryId: +this.$route.query.categoryId || '',
professionalCategoryId: +this.$route.query.professionalCategoryId || '',
professionalId: +this.$route.query.professionalId || '',
curriculumType: this.$route.query.curriculumType || '',
curriculumName: this.$route.query.curriculumName || ''
},
page: +this.$route.query.page || 1,
pageSize: 10,
totals: 0,
subjectList: [], //
ProfessionalClassList: [], //
ProfessionalList: [], //
multipleSelection: [],
loading: false,
searchTimer: null
};
},
watch: {
"form.curriculumName": function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted () {
this.getSubject();
this.getData();
},
methods: {
async getData () {
try {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
this.loading = true
const { page } = await this.$post(this.api.curriculumList, {
...this.form,
pageNum: this.page,
pageSize: this.pageSize,
supplierId: sid ? sid.supplierId : '',
platformId: Setting.platformId
})
this.courseData = page.records
this.totals = page.total
this.loading = false
} finally {
this.loading = false
}
},
initData () {
this.page = 1;
this.getData();
},
//
async getSubject () {
const { list } = await this.$get(this.api.courseDiscipline)
this.subjectList = list
this.form.professionalCategoryId && this.getProfessionalClassData()
},
//
clearClass () {
this.form.professionalCategoryId = ''
this.form.professionalId = ''
},
//
getProfessionalClass () {
this.clearClass();
this.getProfessionalClassData();
this.page = 1;
this.getData();
},
async getProfessionalClassData () {
const { list } = await this.$get(this.api.courseProfessionalClass, {
disciplineId: this.form.categoryId
})
this.ProfessionalClassList = list
this.form.professionalId && this.getProfessionalData()
},
//
clearProfess () {
this.form.professionalId = ''
},
//
getProfessional () {
this.clearProfess();
this.getProfessionalData();
this.page = 1;
this.getData();
},
async getProfessionalData () {
const { list } = await this.$get(this.api.courseProfessional, {
professionalClassId: this.form.professionalCategoryId
})
this.ProfessionalList = list
},
// url
setReferrer () {
this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`)
},
//
addcourse () {
this.setReferrer()
this.$router.push("/curriculum/detail");
},
//
edit (row) {
this.setReferrer()
this.$router.push(`/curriculum/detail?cid=${row.cid}`);
},
//
preview (row) {
this.setReferrer()
this.$router.push(`/station?courseId=${row.cid || ''}&curriculumName=${encodeURIComponent(row.curriculumName)}&mallId=${row.mallId || ''}`)
},
//
config (row) {
this.setReferrer()
this.$router.push(`/curriculum/content?cid=${row.cid}&name=${row.curriculumName}`);
},
//
async copy (row) {
this.$confirm('确定要复制吗', "提示", {
type: "warning"
}).then(async () => {
await this.$post(`${this.api.copySelfBuildCourse}?cid=${row.cid}`)
Util.successMsg('复制成功')
this.initData()
}).catch(() => { })
return
this.$router.push(`/curriculum/detail?cid=${row.cid}&copy=1`)
},
//
handleDelete (row) {
this.$post(`${this.api.deleteCoursePrompt}?cids=${row.cid}`).then(({ status }) => {
if (status === 200) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.delCourse}?cids=${row.cid}`).then(res => {
this.getData();
this.$message.success("删除成功");
}).catch(err => { })
}).catch(() => {
});
}
}).catch(err => { })
},
//
handleSelectionChange (val) {
this.multipleSelection = val;
},
//
delAllSelection () {
if (this.multipleSelection.length) {
let cids = []
this.multipleSelection.forEach(i => {
cids.push('cids=' + i.cid)
});
this.$post(`${this.api.deleteCoursePrompt}?${cids.join('&')}`).then(({ status }) => {
if (status === 200) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(i => i.cid);
this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => {
if (ids.length == this.courseData.length) {
if (this.page > 1) {
this.page = this.page - 1
}
}
this.getData();
this.$message.success("删除成功");
this.$refs.table.clearSelection()
}).catch(err => { })
}).catch(() => { })
}
}).catch(err => { })
} else {
this.$message.warning("请先选择课程 !");
}
},
//
handleCurrentChange (val) {
this.page = val;
this.$router.push(`/curriculum?page=${val}`)
this.getData();
},
//
onSearch () {
this.page = 1;
this.getData();
},
//
changeSwitch (value, row) {
this.$post(`${this.api.isShelves}?cid=${row.cid}&isShelves=${value}`).then((res) => {
this.getData();
this.$message.success("修改上下架状态成功!");
}).catch((res) => {
});
}
}
};
</script>
<style scoped>
.card {
min-height: calc(100vh - 300px);
}
</style>

File diff suppressed because it is too large Load Diff

@ -1,176 +1,157 @@
<template> <template>
<div> <div>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="mgb20">
<div class="flex-between"> <div class="flex-between">
<div class="per_title" v-preventReClick @click="back"> <div class="per_title" v-preventReClick @click="back">
<i class="el-icon-arrow-left"></i> <i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span> <span class="per_back">返回</span>
<span class="per_school">{{ $route.query.userName }}的订单</span> <span class="per_school">{{ $route.query.userName }}的订单</span>
</div> </div>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="card"> <el-card shadow="hover" class="card">
<div class="flex-between mgb20"> <div class="flex-between mgb20">
<div class="flex-center"> <div class="flex-center">
<p class="hr_tag"></p> <p class="hr_tag"></p>
<span>订单列表</span> <span>订单列表</span>
</div> </div>
<el-input style="width: 300px" placeholder="请输入订单编号/产品名称" prefix-icon="el-icon-search" v-model="keyword" <el-input style="width: 300px" placeholder="请输入订单编号/产品名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
clearable></el-input> </div>
</div> <el-table :data="orderData" class="table" ref="table" stripe header-align="center"
<el-table :data="orderData" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys">
@selection-change="handleSelectionChange" :row-key="getRowKeys"> <el-table-column type="index" width="100" label="序号" align="center">
<el-table-column type="index" width="100" label="序号" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="orderNumber" label="订单编号" align="center">
<el-table-column prop="orderNumber" label="订单编号" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="customerName" label="客户名称" align="center">
<el-table-column prop="customerName" label="客户名称" align="center"> <template slot-scope="scope">
<template slot-scope="scope"> {{ customerName }}
{{ customerName }} </template>
</template> </el-table-column>
</el-table-column> <el-table-column prop="productName" label="产品内容" align="center" show-overflow-tooltip></el-table-column>
<el-table-column prop="productName" label="产品内容" align="center" show-overflow-tooltip></el-table-column> <el-table-column prop="orderAmount" label="订单金额(元)" align="center">
<el-table-column prop="orderAmount" label="订单金额(元)" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="createTime" label="订单日期" align="center">
<el-table-column prop="createTime" label="订单日期" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="orderType" label="订单类型" align="center">
<el-table-column prop="orderType" label="订单类型" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="orderStatus" label="订单状态" align="center">
<el-table-column prop="orderStatus" label="订单状态" align="center"> </el-table-column>
</el-table-column> <el-table-column prop="orderNature" label="订单性质" align="center">
<el-table-column prop="orderNature" label="订单性质" align="center"> </el-table-column>
</el-table-column> <el-table-column label="操作" align="center">
<el-table-column label="操作" align="center"> <template slot-scope="scope">
<template slot-scope="scope"> <el-button type="text" @click="toDetail(scope.row)">查看</el-button>
<el-button type="text" @click="toDetail(scope.row)">查看</el-button> </template>
</template> </el-table-column>
</el-table-column> </el-table>
</el-table> <div class="pagination">
<div class="pagination"> <el-pagination background layout="total, prev, pager, next"
<el-pagination background layout="total, prev, pager, next" @current-change="handleCurrentChange" @current-change="handleCurrentChange" :current-page="page" :total="totals">
:current-page="page" :total="totals"> </el-pagination>
</el-pagination> </div>
</div> </el-card>
</el-card> </div>
</div>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
businessManagerId: this.$route.query.businessManagerId, businessManagerId: this.$route.query.businessManagerId,
teamId: this.$route.query.teamId, teamId: this.$route.query.teamId,
customerId: this.$route.query.customerId, customerId: this.$route.query.customerId,
customerName: this.$route.query.customerName, customerName: this.$route.query.customerName,
keyword: "", keyword: "",
orderData: [], orderData: [],
page: 1, page: 1,
pageSize: 10, pageSize: 10,
totals: 0, totals: 0,
searchTimer: null searchTimer: null
}; };
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
created () {
const { orderParam } = this.$store.state
if (orderParam) {
this.keyword = orderParam.keyword
this.page = orderParam.page
this.$store.commit('setOrderParam', null)
}
this.getData();
},
methods: {
getData () {
let data = {
businessManagerId: this.businessManagerId,
teamId: this.teamId,
keywords: this.keyword,
customerId: this.customerId,
pageNum: this.page,
pageSize: this.pageSize,
};
this.$post(this.api.getBusinessManagerOrder, data).then(({ data }) => {
const { records } = data
records.forEach(e => {
e.orderType = this.orderTypeFn(e.orderType);
e.orderStatus = this.orderStatusFn(e.orderStatus);
e.orderNature = this.orderNatureFn(e.orderNature);
});
this.orderData = records
this.totals = data.total
}).catch(res => { })
}, },
initData () { watch: {
this.page = 1 keyword: function(val) {
this.getData() clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
}, },
handleCurrentChange (val) { created() {
this.page = val this.getData();
this.getData()
}, },
toDetail (row) { methods: {
this.$store.commit('setOrderParam', { getData() {
keyword: this.keyword, let data = {
page: this.page, businessManagerId: this.businessManagerId,
}) teamId: this.teamId,
this.$router.push({ keywords: this.keyword,
path: '/AddOrder', customerId: this.customerId,
query: { pageNum: this.page,
val: 'watch', pageSize: this.pageSize,
orderId: row.orderId, };
orderStatus: row.orderStatus === '已完成' ? 1 : 0, this.$post(this.api.getBusinessManagerOrder, data).then(({ data }) => {
const { records } = data
records.forEach(e => {
e.orderType = this.orderTypeFn(e.orderType);
e.orderStatus = this.orderStatusFn(e.orderStatus);
e.orderNature = this.orderNatureFn(e.orderNature);
});
this.orderData = records
this.totals = data.total
}).catch(res => {})
},
initData() {
this.page = 1
this.getData()
},
toDetail(row) {
this.$router.push({
path:'/AddOrder',
query:{
val: 'watch',
orderId: row.orderId,
orderStatus: row.orderStatus === '已完成' ? 1 : 0
}
})
},
back() {
this.$router.back()
} }
})
},
back () {
this.$router.back()
} }
}
}; };
</script> </script>
<style scoped> <style scoped>
.card { .card {
min-height: calc(100vh - 300px); min-height: calc(100vh - 300px);
} }
.mag { .mag {
margin-right: 20px; margin-right: 20px;
} }
.cell{
.cell { white-space:pre-wrap;
white-space: pre-wrap; width: 140px;
width: 140px; overflow: hidden;
overflow: hidden; text-overflow: ellipsis;
text-overflow: ellipsis; display: -webkit-box;
display: -webkit-box; -webkit-line-clamp: 2;
-webkit-line-clamp: 2; line-clamp: 2;
line-clamp: 2; -webkit-box-orient: vertical;
-webkit-box-orient: vertical;
} }
.tags{
.tags { border: none;
border: none; background: none;color: #000;
background: none; white-space:pre-wrap;
color: #000; width: 140px;
white-space: pre-wrap; overflow: hidden;
width: 140px; text-overflow: ellipsis;
overflow: hidden; display: -webkit-box;
text-overflow: ellipsis; -webkit-line-clamp: 2;
display: -webkit-box; line-clamp: 2;
-webkit-line-clamp: 2; -webkit-box-orient: vertical;
line-clamp: 2;
-webkit-box-orient: vertical;
} }
</style> </style>

@ -1,248 +1,244 @@
<template> <template>
<div> <div>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="mgb20">
<div class="per_title" v-preventReClick @click="goback()"> <div class="per_title" v-preventReClick @click="goback()">
<i class="el-icon-arrow-left"></i> <i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span> <span class="per_back">返回</span>
<span class="per_school">{{ customerName }}</span> <span class="per_school">{{customerName}}</span>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="mgb20">
<div class="flex-center mgb20 user_header"> <div class="flex-center mgb20 user_header">
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>代理配置</span> <span>代理配置</span>
</div> </div>
<div class="flex-between"> <div class="flex-between">
<span>内网地址配置</span> <span>内网地址配置</span>
<div class="border_lf flex-column"> <div class="border_lf flex-column">
<p class="marb30">平台服务</p> <p class="marb30">平台服务</p>
<div class="flex-center"> <div class="flex-center">
<label>IP</label> <label>IP</label>
<el-input placeholder="请输入IP地址" class="mar_input"></el-input> <el-input placeholder="请输入IP地址" class="mar_input"></el-input>
<label>端口</label> <label>端口</label>
<el-input placeholder="请输入端口号"></el-input> <el-input placeholder="请输入端口号"></el-input>
</div> </div>
</div> </div>
<div class="border_lf pad_none flex-column"> <div class="border_lf pad_none flex-column">
<p class="marb30">流媒体服务</p> <p class="marb30">流媒体服务</p>
<div class="flex-center"> <div class="flex-center">
<label>IP</label> <label>IP</label>
<el-input placeholder="请输入IP地址" class="mar_input"></el-input> <el-input placeholder="请输入IP地址" class="mar_input"></el-input>
<label>端口</label> <label>端口</label>
<el-input placeholder="请输入端口号"></el-input> <el-input placeholder="请输入端口号"></el-input>
</div> </div>
</div> </div>
</div> </div>
</el-card> </el-card>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="mgb20">
<div class="flex-center mgb20"> <div class="flex-center mgb20">
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>应用列表</span> <span>应用列表</span>
</div> </div>
<el-table :data="permissionData" class="table" :span-method="SpanMethod" header-align="center"> <el-table :data="permissionData" class="table" stripe :span-method="SpanMethod" header-align="center">
<el-table-column prop="id" label="序号" align="center"> <el-table-column prop="id" label="序号" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="age" label="应用名称" align="center"> <el-table-column prop="age" label="应用名称" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="storeName" label="使用期限" align="center"> <el-table-column prop="storeName" label="使用期限" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="total" label="启用时间" align="center"> <el-table-column prop="total" label="启用时间" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="payamount" label="结束时间" align="center"> <el-table-column prop="payamount" label="结束时间" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="payamount" label="剩余时间" align="center"> <el-table-column prop="payamount" label="剩余时间" align="center">
</el-table-column> </el-table-column>
<el-table-column label="IP" align="center"> <el-table-column label="IP" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="tab_temp" v-if="scope.row.Intranet != ''"> <div class="tab_temp" v-if="scope.row.Intranet != ''">
<div class="flex-center"> <div class="flex-center">
<label>内网:</label> <label>内网:</label>
<el-input v-model="scope.row.Intranet" placeholder="请输入IP地址"></el-input> <el-input v-model="scope.row.Intranet" placeholder="请输入IP地址"></el-input>
</div> </div>
<div class="flex-center mar10"> <div class="flex-center mar10">
<label>外网:</label> <label>外网:</label>
<el-input v-model="scope.row.extranet" placeholder="请输入端口号"></el-input> <el-input v-model="scope.row.extranet" placeholder="请输入端口号"></el-input>
</div> </div>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="端口" align="center"> <el-table-column label="端口" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="tab_temp" v-if="scope.row.Intranet != ''"> <div class="tab_temp" v-if="scope.row.Intranet != ''">
<div class="flex-center"> <div class="flex-center">
<label>内网:</label> <label>内网:</label>
<el-input v-model="scope.row.Intranet" placeholder="请输入内网IP地址"></el-input> <el-input v-model="scope.row.Intranet" placeholder="请输入内网IP地址"></el-input>
</div> </div>
<div class="flex-center mar10"> <div class="flex-center mar10">
<label>外网:</label> <label>外网:</label>
<el-input v-model="scope.row.extranet" placeholder="请输入外网IP地址"></el-input> <el-input v-model="scope.row.extranet" placeholder="请输入外网IP地址"></el-input>
</div> </div>
</div> </div>
<div v-else> <div v-else>
<el-button type="plain" @click="chooseIp">选择IP与端口</el-button> <el-button type="plain" @click="chooseIp">选择IP与端口</el-button>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch v-model="scope.row.swtich" active-text="开启" inactive-text="关闭" <el-switch
@change="changeSwitch(scope.row)"> v-model="scope.row.swtich"
</el-switch> active-text="开启"
</template> inactive-text="关闭"
</el-table-column> @change="changeSwitch(scope.row)">
</el-table> </el-switch>
<div class="pagination"> </template>
<el-pagination background layout="total, prev, pager, next" :total="totals"> </el-table-column>
</el-pagination> </el-table>
</div> <div class="pagination">
</el-card> <el-pagination background layout="total, prev, pager, next" :total="totals">
</el-col> </el-pagination>
</el-row> </div>
</el-card>
</el-col>
</el-row>
<!-- 选择IP --> <!-- 选择IP -->
<el-dialog :visible.sync="ipVisible" width="70%" center> <el-dialog :visible.sync="ipVisible" width="70%" center>
<div class="flex-center mgb20"> <div class="flex-center mgb20">
<p class="hr_tag"></p> <p class="hr_tag"></p>
<span>客户列表</span> <span>客户列表</span>
</div>
<el-table :data="permissionData" class="table" header-align="center">
<el-table-column type="index" width="100" label="序号" align="center">
</el-table-column>
<el-table-column prop="age" label="服务器名称" align="center">
</el-table-column>
<el-table-column label="IP" align="center">
<template slot-scope="scope">
<div class="tab_temp">
<div class="flex-center">
<label>内网:</label>
<el-input v-model="scope.row.Intranet" placeholder="请输入IP地址"></el-input>
</div>
<div class="flex-center mar10">
<label>外网:</label>
<el-input v-model="scope.row.extranet" placeholder="请输入端口号"></el-input>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="端口" align="center">
<template slot-scope="scope">
<div class="tab_temp">
<div class="flex-center">
<label>内网:</label>
<el-input v-model="scope.row.Intranet" placeholder="请输入内网IP地址"></el-input>
</div>
<div class="flex-center mar10">
<label>外网:</label>
<el-input v-model="scope.row.extranet" placeholder="请输入外网IP地址"></el-input>
</div>
</div> </div>
</template> <el-table :data="permissionData" class="table" stripe header-align="center">
</el-table-column> <el-table-column type="index" width="100" label="序号" align="center">
<el-table-column label="选择" align="center"> </el-table-column>
<template slot-scope="scope"> <el-table-column prop="age" label="服务器名称" align="center">
<i class="el-icon-success radio_icon"></i> </el-table-column>
</template> <el-table-column label="IP" align="center">
</el-table-column> <template slot-scope="scope">
</el-table> <div class="tab_temp">
<span slot="footer" class="dialog-footer"> <div class="flex-center">
<el-button @click="teacherVisible = false"> </el-button> <label>内网:</label>
<el-button type="primary" @click="editSure('teacherForm')"> </el-button> <el-input v-model="scope.row.Intranet" placeholder="请输入IP地址"></el-input>
</span> </div>
</el-dialog> <div class="flex-center mar10">
</div> <label>外网:</label>
<el-input v-model="scope.row.extranet" placeholder="请输入端口号"></el-input>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="端口" align="center">
<template slot-scope="scope">
<div class="tab_temp">
<div class="flex-center">
<label>内网:</label>
<el-input v-model="scope.row.Intranet" placeholder="请输入内网IP地址"></el-input>
</div>
<div class="flex-center mar10">
<label>外网:</label>
<el-input v-model="scope.row.extranet" placeholder="请输入外网IP地址"></el-input>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="选择" align="center">
<template slot-scope="scope">
<i class="el-icon-success radio_icon"></i>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="teacherVisible = false"> </el-button>
<el-button type="primary" @click="editSure('teacherForm')"> </el-button>
</span>
</el-dialog>
</div>
</template> </template>
<script> <script>
export default { export default {
data () { data (){
return { return {
customerName: this.$route.query.name, customerName: this.$route.query.name,
permissionData: [{ permissionData: [{
id: 1, id: 1,
age: '小额贷系统', age: '小额贷系统',
storeName: '1个月', storeName: '1个月',
total: '2019.01.02 11:00', total: '2019.01.02 11:00',
payamount: '2019.01.02 11:00', payamount: '2019.01.02 11:00',
payamount: '700d12h1min', payamount: '700d12h1min',
swtich: true, swtich: true,
Intranet: '10.20.202.1', Intranet: '10.20.202.1',
extranet: '10.20.202.1' extranet: '10.20.202.1'
}, },
{ {
id: 2, id: 2,
age: '小额贷系统', age: '小额贷系统',
storeName: '1个月', storeName: '1个月',
total: '2019.01.02 11:00', total: '2019.01.02 11:00',
payamount: '2019.01.02 11:00', payamount: '2019.01.02 11:00',
payamount: '700d12h1min', payamount: '700d12h1min',
swtich: true, swtich: true,
Intranet: '', Intranet: '',
extranet: '' extranet: ''
}], }],
totals: 1, totals: 1,
ipVisible: false ipVisible: false
} }
}, },
methods: { methods: {
SpanMethod ({ row, column, rowIndex, columnIndex }) { SpanMethod({ row, column, rowIndex, columnIndex }) {
if (rowIndex % 2 === 0) { if (rowIndex % 2 === 0) {
if (columnIndex === 6) { if (columnIndex === 6) {
if (!row.Intranet) { if(!row.Intranet){
return [1, 2]; return [1, 2];
} }
}
// else if (columnIndex === 1) {
// return [0, 0];
// }
}
},
chooseIp(){
this.ipVisible = true
},
goback(){
this.$router.go(-1)
}
} }
// else if (columnIndex === 1) {
// return [0, 0];
// }
}
},
chooseIp () {
this.ipVisible = true
},
goback () {
this.$router.go(-1)
} }
}
}
</script> </script>
<style scoped> <style scoped>
.border_lf { .border_lf{
border-left: 1px dashed #eee; border-left: 1px dashed #eee;
padding: 0 60px; padding: 0 60px;
} }
.border_lf label{
.border_lf label { width: 120px;
width: 120px;
} }
.pad_none{
.pad_none { padding: 0 0 0 60px;
padding: 0 0 0 60px;
} }
.mar_input{
.mar_input { margin-right: 80px;
margin-right: 80px;
} }
.marb30{
.marb30 { margin-bottom: 30px;
margin-bottom: 30px;
} }
.tab_temp label{
.tab_temp label { width: 60px;
width: 60px;
} }
.mar10{
.mar10 { margin-top: 10px;
margin-top: 10px;
} }
.radio_icon{
.radio_icon { font-size: 26px;
font-size: 26px; color: #9278FF;
color: #9278FF;
} }
</style> </style>

@ -1,340 +1,269 @@
<template> <template>
<div v-loading="loading"> <div>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="mgb20">
<div> <div>
<div class="flex-center mgb20"> <div class="flex-center mgb20">
<p class="hr_tag"></p> <p class="hr_tag"></p>
<span>筛选</span> <span>筛选</span>
</div> </div>
<div> <div>
<el-form label-width="80px"> <el-form label-width="80px">
<el-col :span="4"> <el-col :span="4">
<el-form-item label="省份"> <el-form-item label="国家">
<el-select v-model="form.provinces" clearable placeholder="请选择省份" @change="getCity" <el-select v-model="form.countries" placeholder="请选择国家">
@clear="clearprovince"> <el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.name"></el-option>
<el-option v-for="(item, index) in provinceList" :key="index" :label="item.provinceName" </el-select>
:value="item.provinceId"></el-option> </el-form-item>
</el-select> </el-col>
</el-form-item> <el-col :span="4">
</el-col> <el-form-item label="省份">
<el-col :span="4"> <el-select v-model="form.provinces" clearable placeholder="请选择省份" @change="getCity" @clear="clearprovince">
<el-form-item label="城市"> <el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
<el-select v-model="form.city" clearable placeholder="请选择城市" :disabled="form.provinces ? false : true" </el-select>
@change="initData"> </el-form-item>
<el-option v-for="(item, index) in cityList" :key="index" :label="item.cityName" </el-col>
:value="item.cityId"></el-option> <el-col :span="4">
</el-select> <el-form-item label="城市">
</el-form-item> <el-select v-model="form.city" clearable placeholder="请选择城市" :disabled="form.provinces ? false : true" @change="initData">
</el-col> <el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option>
<el-col :span="4"> </el-select>
<el-form-item label="客户类型"> </el-form-item>
<el-select v-model="form.customerType" placeholder="请选择客户类型" @change="initData"> </el-col>
<el-option v-for="(item, index) in customerTypeList" :key="index" :label="item.name" <el-col :span="6">
:value="item.value"></el-option> <el-form-item>
</el-select> <el-input placeholder="支持客户,联系人,账号搜索" prefix-icon="el-icon-search" v-model="form.keyword" clearable></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> </el-form>
<el-form-item> </div>
<el-input placeholder="支持客户,联系人,账号搜索" prefix-icon="el-icon-search" v-model="form.keyword" </div>
clearable></el-input> </el-card>
</el-form-item>
</el-col>
</el-form>
</div>
</div>
</el-card>
<el-card shadow="hover" class="card"> <el-card shadow="hover" class="card">
<div class="flex-between mgb20"> <div class="flex-between mgb20">
<div class="flex-center"> <div class="flex-center">
<p class="hr_tag"></p> <p class="hr_tag"></p>
<span>客户列表</span> <span>客户列表</span>
</div> </div>
<div> <div>
<el-button type="primary" round class="mag" @click="exportData">导出客户列表</el-button> <el-button type="primary" round class="mag" @click="addcustomer" v-auth>新增</el-button>
<el-button type="primary" round class="mag" @click="addcustomer" v-auth>新增</el-button> <el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button>
<el-button type="primary" round @click="delAllSelection" v-auth>批量删除</el-button> </div>
</div> </div>
</div> <el-table v-loading="loading" :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="customerId">
<el-table :data="listData" class="table" ref="table" header-align="center" <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
@selection-change="handleSelectionChange" row-key="customerId"> <el-table-column type="index" width="100" label="序号" align="center">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <template slot-scope="scope">
<el-table-column type="index" width="100" label="序号" align="center"> {{scope.$index + (page - 1) * pageSize + 1}}
<template slot-scope="scope"> </template>
{{ scope.$index + (page - 1) * pageSize + 1 }} </el-table-column>
</template> <el-table-column prop="customerName" label="客户名称" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="customerName" label="客户名称" align="center"> <el-table-column label="行业" align="center">
</el-table-column> <template slot-scope="scope">
<el-table-column label="行业" align="center"> <span class="ellipsis">{{scope.row.industryName}}</span>
<template slot-scope="scope"> </template>
<span class="ellipsis">{{ scope.row.industryName }}</span> </el-table-column>
</template> <el-table-column prop="countries" label="国家" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="countries" label="客户类型" align="center"> <el-table-column prop="provinceName" label="省份" align="center">
<template slot-scope="scope"> </el-table-column>
<span v-if="scope.row.customerType">{{ customerTypeList.find(e => e.value == scope.row.customerType).name <el-table-column prop="cityName" label="城市" align="center">
}}</span> </el-table-column>
</template> <el-table-column prop="name" label="联系人" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="provinceName" label="省份" align="center"> <el-table-column prop="account" label="账号" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="cityName" label="城市" align="center"> <el-table-column prop="loginNumber" label="登录次数" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="name" label="联系人" align="center"> <el-table-column label="操作" width="270" align="center">
</el-table-column> <template slot-scope="scope">
<el-table-column prop="account" label="账号" align="center"> <el-button type="text" @click="resetPassword(scope.row)" v-auth>重置密码</el-button>
</el-table-column> <el-button type="text" @click="show(scope.row)" v-auth>查看</el-button>
<el-table-column prop="loginNumber" label="登录次数" align="center"> <el-button type="text" @click="edit(scope.row)" v-auth>编辑</el-button>
</el-table-column> <el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button>
<el-table-column label="操作" width="270" align="center"> </template>
<template slot-scope="scope"> </el-table-column>
<el-button type="text" @click="resetPassword(scope.row)" v-auth>重置密码</el-button> </el-table>
<el-button type="text" @click="show(scope.row)" v-auth>查看</el-button> <div class="pagination">
<el-button type="text" @click="edit(scope.row)" v-auth>管理</el-button> <el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
<el-button type="text" @click="handleDelete(scope.row)" v-auth>删除</el-button> </el-pagination>
</template> </div>
</el-table-column> </el-card>
</el-table> </div>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange"
:current-page="page">
</el-pagination>
</div>
</el-card>
</div>
</template> </template>
<script> <script>
import Setting from '@/setting' import Setting from '@/setting'
import axios from 'axios';
import util from "@/libs/util";
import qs from 'qs'
export default { export default {
name: 'customer', name: 'customer',
data () { data() {
return { return {
loading: false, loading:false,
searchTimer: null, searchTimer: null,
countryList: [{ countryList: [{
name: '中国' name:'中国'
}], }],
customerTypeList: [ listData: [],
{ form: {
value: '', countries:'中国',
name: '不限' provinces: '',
}, city: '',
{ keyword: ''
name: '正式', },
value: 1 multipleSelection: [],
}, provinceList: [],
{ cityList: [],
name: '试用', page: +this.$route.query.page || 1,
value: 2 pageSize: 10,
}, total: 0,
{ ruleIds: []
name: '到期', };
value: 3
}],
listData: [],
form: {
customerType: +this.$route.query.customerType || '',
provinces: +this.$route.query.provinces || '',
city: +this.$route.query.city || '',
keyword: this.$route.query.keyword || ''
},
multipleSelection: [],
provinceList: [],
cityList: [],
page: +this.$route.query.page || 1,
pageSize: 10,
total: 0,
ruleIds: []
};
},
watch: {
'form.keyword': function (val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
},
},
mounted () {
const { query } = this.$route
if (query.page) {
this.$router.push('/customer').catch(() => { })
}
this.getData()
this.getProvince()
},
methods: {
getData () {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '客户管理')
this.loading = true
this.$post(this.api.queryCustomer, {
provinceId: this.form.provinces,
cityId: this.form.city,
customerType: this.form.customerType,
searchContent: this.form.keyword,
page: this.page,
size: this.pageSize,
supplierId: (sid && !sid.all) ? sid.supplierId : ''
}).then(res => {
this.listData = res.message.list
this.total = res.message.totalCount
this.loading = false
}).catch(res => {
this.loading = false
})
},
initData () {
this.page = 1
this.getData()
},
getProvince () {
this.$get(this.api.queryProvince).then(res => {
this.provinceList = res.list
this.$store.commit("provinceData", { provinceList: this.provinceList })
this.form.city && this.getCityData()
}).catch(res => { })
},
clearprovince () {
this.form.city = ''
},
getCity () {
this.clearprovince()
this.getCityData()
this.page = 1
this.initData()
}, },
getCityData () { watch: {
let data = { 'form.keyword': function(val) {
provinceId: this.form.provinces clearTimeout(this.searchTimer)
} this.searchTimer = setTimeout(() => {
this.$get(this.api.queryCity, data).then(res => { this.initData()
this.cityList = res.list },500)
}).catch(res => { })
},
permission (row) {
this.$router.push(`/permission?name=${row.customerName}`)
},
//
async exportData () {
let sid = this.$store.state.dataPer.find(e => e.permissionName === '客户管理')
sid = (sid && !sid.all) ? sid.supplierId : ''
let list = this.multipleSelection
//
if (!list.length) {
const res = await this.$post(this.api.queryCustomer, {
page: 1,
size: 1000,
supplierId: sid
})
list = res.message.list
}
const ids = list.map(e => e.customerId)
axios.post(this.api.exportClient, {
exportCustomerIds: ids,
supplierId: sid
}, {
headers: {
token: this.token
}, },
responseType: 'blob'
}).then((res) => {
util.downloadFileDirect(`客户列表.xlsx`, new Blob([res.data]))
}).catch(res => { })
},
// url
setReferrer () {
this.$store.commit('setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`)
},
addcustomer () {
this.setReferrer()
this.$router.push('addcustomer')
},
edit (row) {
this.setReferrer()
this.$router.push(`addcustomer?id=${row.customerId}`)
}, },
show (row) { mounted() {
this.setReferrer() this.getData()
this.$router.push(`addcustomer?id=${row.customerId}&show=true`) this.getProvince()
}, },
handleDelete (row) { methods: {
this.$confirm('确定要删除吗?', '提示', { getData() {
type: 'warning' const sid = this.$store.state.dataPer.find(e => e.permissionName === '客户管理')
}).then(() => { this.loading = true
this.$post(this.api.delCustomers, [row.customerId]).then(res => { this.$post(this.api.queryCustomer,{
this.$message.success('删除成功') countries: this.form.countries,
if (this.listData.length == 2) { provinceId: this.form.provinces,
cityId: this.form.city,
} else { searchContent: this.form.keyword,
if (this.page > 1) { page: this.page,
this.page = this.page - 1 size: this.pageSize,
supplierId: (sid && !sid.all) ? sid.supplierId : ''
}).then(res => {
this.listData = res.message.list
this.total = res.message.totalCount
this.loading = false
}).catch(res => {
this.loading = false
})
},
initData(){
this.page = 1
this.getData()
},
getProvince(){
this.$get(this.api.queryProvince).then(res => {
this.provinceList = res.list
this.$store.commit("provinceData", { provinceList : this.provinceList})
}).catch(res => {})
},
clearprovince(){
this.form.city = ''
},
getCity(){
this.clearprovince()
this.getCityData()
this.page = 1
this.initData()
},
getCityData(){
let data = {
provinceId: this.form.provinces
} }
} this.$get(this.api.queryCity,data).then(res => {
this.getData() this.cityList = res.list
}).catch(res => { }) }).catch(res => {})
}).catch(() => { }) },
}, permission(row){
handleSelectionChange (val) { this.$router.push(`/permission?name=${row.customerName}`)
this.multipleSelection = val },
}, addcustomer(){
delAllSelection () { this.$router.push('addcustomer')
if (this.multipleSelection.length != '') { },
let arr = this.multipleSelection edit(row){
let delList = arr.map(item => { this.$router.push(`addcustomer?id=${row.customerId}`)
return item.customerId },
}) show(row){
this.$confirm('确定要删除吗?', '提示', { this.$router.push(`addcustomer?id=${row.customerId}&show=true`)
type: 'warning' },
}).then(() => { handleDelete(row) {
this.$post(this.api.delCustomers, delList).then(res => { this.$confirm('确定要删除吗?', '提示', {
this.multipleSelection = []; type: 'warning'
if (delList.length == this.listData.length) { }).then(() => {
if (this.page > 1) { this.$post(this.api.delCustomers,[row.customerId]).then(res => {
this.page = this.page - 1 this.$message.success('删除成功')
} if(this.listData.length == 2){
}else{
if(this.page > 1){
this.page = this.page-1
}
}
this.getData()
}).catch(res => {})
}).catch(() => {})
},
handleSelectionChange(val) {
this.multipleSelection = val
},
delAllSelection() {
if(this.multipleSelection.length != ''){
let arr = this.multipleSelection
let delList = arr.map(item => {
return item.customerId
})
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.$post(this.api.delCustomers,delList).then(res => {
this.multipleSelection = [];
if(delList.length == this.listData.length){
if(this.page > 1){
this.page = this.page-1
}
}
this.$refs.table.clearSelection()
this.$message.success('删除成功')
this.getData()
}).catch(res => {})
}).catch(() => {})
}else{
this.$message.error('请先选择数据')
} }
this.$refs.table.clearSelection() },
this.$message.success('删除成功') handleCurrentChange(val) {
this.page = val
this.$store.commit('SET_C_PAGE', val)
this.$router.push(`customer?page=${val}`)
this.getData() this.getData()
}).catch(res => { }) },
}).catch(() => { }) resetPassword(row){
} else { this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, '提示', {
this.$message.error('请先选择数据') }).then(() => {
} this.$get(this.api.resetPwdCustomer,{
}, customerId: row.customerId,
handleCurrentChange (val) { }).then(res => {
this.page = val if(res.message == 'success'){
this.$router.push(`customer?page=${val}`) this.$message.success('重置成功')
this.getData() }else{
}, this.$message.error('重置失败')
resetPassword (row) { }
this.$confirm(`重置后的密码为:${Setting.initialPassword},确定重置?`, '提示', { }).catch(res => {});
}).then(() => { }).catch(() => {
this.$get(this.api.resetPwdCustomer, { });
customerId: row.customerId, },
}).then(res => { }
if (res.message == 'success') {
this.$message.success('重置成功')
} else {
this.$message.error('重置失败')
}
}).catch(res => { });
}).catch(() => {
});
},
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.card { .card {
min-height: calc(100vh - 300px); min-height: calc(100vh - 300px);
} }
</style> </style>

File diff suppressed because it is too large Load Diff

@ -1,301 +1,281 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<div class="side"> <div class="side">
<el-tree ref="type" :data="typeList" node-key="id" accordion :default-expanded-keys="defaultActive" <el-tree ref="type" :data="typeList" node-key="id" accordion :default-expanded-keys="defaultActive" :current-node-key="categoryId" :props="defaultProps" :highlight-current="true" @current-change="typeClick"></el-tree>
:current-node-key="categoryId" :props="defaultProps" :highlight-current="true"
@current-change="typeClick"></el-tree>
</div>
<div class="right">
<div class="flex-between" style="margin-bottom: 10px;">
<p>数据简介</p>
<el-button v-if="introduceText && !editing" type="primary" @click="editing = !editing"
v-auth="'/data:数据简介:编辑'">编辑</el-button>
</div>
<div class="intro" v-if="!introduceText && !editing">
<p class="text">请添加简介</p>
<div class="btn">
<el-button type="primary" @click="edit">添加</el-button>
</div>
</div>
<template v-if="introduceText || editing">
<el-input placeholder="请输入简介" v-model="introduce" type="textarea" rows="5" :disabled="!editing"></el-input>
<div class="field">
<p class="label">数据源</p>
<el-input style="width: 250px" placeholder="请输入数据源" v-model="dataSource" type="text"
:disabled="!editing"></el-input>
</div>
</template>
<div class="field">
<p class="label">关键字</p>
<div class="tag-add" v-if="editing">
<el-input placeholder="请输入关键字" size="small" v-model="newKeyword"></el-input>
<span v-if="editing">
<el-button @click="save"
style="color: #062c87;border: 1px solid #062c87;border-radius:5px;height: 25px;line-height: 0px">
</el-button>
</span>
</div> </div>
<div class="tag-wrap">
<el-tag :key="tag.id" :type="editing ? '' : 'info'" v-for="tag in keywordList" :closable="editing" <div class="right">
:disable-transitions="false" @close="delKeyword(tag)"> <div class="flex-between" style="margin-bottom: 10px;">
{{ tag.keyword }} <p>数据简介</p>
</el-tag> <el-button v-if="introduceText && !editing" type="primary" @click="editing = !editing" v-auth="'/data:数据简介:编辑'">编辑</el-button>
</div>
<div class="intro" v-if="!introduceText && !editing">
<p class="text">请添加简介</p>
<div class="btn">
<el-button type="primary" @click="edit">添加</el-button>
</div>
</div>
<template v-if="introduceText || editing">
<el-input placeholder="请输入简介" v-model="introduce" type="textarea" rows="5" :disabled="!editing"></el-input>
<div class="field">
<p class="label">数据源</p>
<el-input style="width: 250px" placeholder="请输入数据源" v-model="dataSource" type="text" :disabled="!editing"></el-input>
</div>
</template>
<div class="field">
<p class="label">关键字</p>
<div class="tag-add" v-if="editing">
<el-input placeholder="请输入关键字" size="small" v-model="newKeyword"></el-input>
<span v-if="editing">
<el-button @click="save" style="color: #9076FF;border: 1px solid #9076FF;border-radius:5px;height: 25px;line-height: 0px"> </el-button>
</span>
</div>
<div class="tag-wrap">
<el-tag
:key="tag.id"
:type="editing ? '' : 'info'"
v-for="tag in keywordList"
:closable="editing"
:disable-transitions="false"
@close="delKeyword(tag)">
{{tag.keyword}}
</el-tag>
</div>
</div>
<div class="btns" v-if="editing">
<el-button @click="editing = false"> </el-button>
<el-button type="primary" @click="confirmData"> </el-button>
</div>
</div> </div>
</div>
<div class="btns" v-if="editing">
<el-button @click="editing = false"> </el-button>
<el-button type="primary" @click="confirmData"> </el-button>
</div>
</div> </div>
</div>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
id: this.$route.query.id || '', typeList: [],
typeList: [], defaultProps: {
defaultProps: { children: 'children',
children: 'children', label: 'label'
label: 'label' },
}, defaultActive: [],
defaultActive: [], editing: false,
editing: false, edited: false,
edited: false, introduce: '',
introduce: '', dataSource: '',
dataSource: '', introduceText: '',
introduceText: '', categoryId: '',
categoryId: '', keywordList: [],
keywordList: [], newKeyword: ''
newKeyword: '' };
};
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.getData()
}, 500)
}
},
mounted () {
this.getData()
},
methods: {
getData () {
//
this.$post(this.api.getTableByClassification).then(res => {
// idlabel
function handleId (data) {
data.map(n => {
n.id = String(n.id)
n.label = n.categoryName
if (n.children.length) {
handleId(n.children)
}
})
}
handleId(res)
this.typeList = res
if (!this.edited) {
// id
if (res[0].children.length) {
let item = res[0].children[0]
this.categoryId = item.id
this.dataSource = res[0].children[0].dataSource
this.defaultActive = [res[0].children[0].id]
// this.defaultActive = [item.id]
this.introduceText = item.introduce
this.introduce = item.introduce
} else {
this.categoryId = res[0].id
this.dataSource = res[0].dataSource
this.defaultActive = [res[0].children[0].id]
// this.defaultActive = [res[0].id]
this.introduceText = res[0].introduce
this.introduce = res[0].introduce
}
this.$nextTick(() => {
this.$refs.type.setCurrentKey(this.categoryId)
})
} else if (this.id) {
this.$nextTick(() => {
this.defaultActive = [+this.id]
this.$refs.type.setCurrentKey(+this.id)
})
}
this.getKeyword()
}).catch(res => { })
},
//
typeClick (data, node) {
this.$router.push(`/data?tab=third&id=${data.id}`).catch(e => { })
this.editing = false
this.categoryId = data.id
this.defaultActive = [data.id]
this.introduceText = data.introduce
this.introduce = data.introduce
this.dataSource = data.dataSource
this.getKeyword()
},
//
getKeyword () {
this.$get(this.api.getKeywordByCategoryId, {
categoryId: this.categoryId
}).then(res => {
this.keywordList = res.keywords
}).catch(res => { })
}, },
// watch: {
edit () { keyword: function(val) {
this.editing = true clearTimeout(this.searchTimer)
this.introduce = this.introduceText this.searchTimer = setTimeout(() => {
this.getData()
},500)
}
}, },
// mounted(){
saveType () {
const id = this.categoryId // id
this.$post(this.api.updateCategory, {
id,
introduce: this.introduce,
dataSource: this.dataSource
}).then(res => {
this.$message.success(this.introduceText ? '编辑成功' : '新增成功')
this.introduceText = this.introduce
this.editing = false
this.edited = true
this.getData() this.getData()
}).catch(res => { })
},
//
delKeyword (item) {
this.$post(`${this.api.deleteKeyword}?categoryId=${this.categoryId}&keyword=${item.keyword}`).then(res => {
this.$message.success('删除成功')
this.getKeyword()
}).catch(res => { })
},
save () {
const keyword = this.newKeyword
if (keyword) {
if (this.keywordList.find(e => e.keyword === keyword)) return this.$message.error('请不要输入重复关键字!')
// this.confirmEdit()
this.$post(this.api.addKeyword, {
categoryId: this.categoryId,
keyword
}).then(res => {
this.newKeyword = ''
this.getKeyword()
}).catch(res => { })
} else {
this.confirmEdit()
}
}, },
// methods: {
confirmData () { getData(){
const keyword = this.newKeyword // //
// this.$post(this.api.getTableByClassification).then(res => {
if (keyword) { // idlabel
// function handleId(data){
if (this.keywordList.find(e => e.keyword === keyword)) return this.$message.error('请不要输入重复关键字!') data.map(n => {
this.saveType() n.id = String(n.id)
// n.label = n.categoryName
this.$post(this.api.addKeyword, { if(n.children.length){
categoryId: this.categoryId, handleId(n.children)
keyword }
}).then(res => { })
this.newKeyword = '' // }
this.getKeyword() handleId(res)
}).catch(res => { }) console.log(res)
} else {
this.saveType() this.typeList = res
} // id
if (!this.edited) {
if(res[0].children.length){
let item = res[0].children[0]
this.categoryId = item.id
this.dataSource = res[0].children[0].dataSource
this.defaultActive = [res[0].children[0].id]
// this.defaultActive = [item.id]
this.introduceText = item.introduce
this.introduce = item.introduce
}else{
this.categoryId = res[0].id
this.dataSource = res[0].dataSource
this.defaultActive = [res[0].children[0].id]
// this.defaultActive = [res[0].id]
this.introduceText = res[0].introduce
this.introduce = res[0].introduce
}
this.$nextTick(() => {
this.$refs.type.setCurrentKey(this.categoryId)
})
}
this.getKeyword()
}).catch(res => {})
},
//
typeClick(data,node){
console.log(data)
this.editing = false
this.categoryId = data.id
this.defaultActive = [data.id]
this.introduceText = data.introduce
this.introduce = data.introduce
this.dataSource = data.dataSource
this.getKeyword()
},
//
getKeyword(){
this.$get(this.api.getKeywordByCategoryId,{
categoryId: this.categoryId
}).then(res => {
this.keywordList = res.keywords
}).catch(res => {})
},
//
edit(){
this.editing = true
this.introduce = this.introduceText
},
//
saveType(){
const id = this.categoryId // id
this.$post(this.api.updateCategory,{
id,
introduce: this.introduce,
dataSource: this.dataSource
}).then(res => {
this.$message.success(this.introduceText ? '编辑成功' : '新增成功')
this.introduceText = this.introduce
this.editing = false
this.edited = true
// this.getData()
}).catch(res => {})
},
//
delKeyword(item) {
this.$post(`${this.api.deleteKeyword}?categoryId=${this.categoryId}&keyword=${item.keyword}`).then(res => {
this.$message.success('删除成功')
this.getKeyword()
}).catch(res => {})
},
save(){
const keyword = this.newKeyword
if (keyword) {
if (this.keywordList.find(e => e.keyword === keyword)) return this.$message.error('请不要输入重复关键字!')
// this.confirmEdit()
this.$post(this.api.addKeyword,{
categoryId: this.categoryId,
keyword
}).then(res => {
this.newKeyword = ''
this.getKeyword()
}).catch(res => {})
} else {
this.confirmEdit()
}
},
//
confirmData() {
const keyword = this.newKeyword //
//
if (keyword) {
//
if (this.keywordList.find(e => e.keyword === keyword)) return this.$message.error('请不要输入重复关键字!')
this.saveType()
//
this.$post(this.api.addKeyword,{
categoryId: this.categoryId,
keyword
}).then(res => {
this.newKeyword = '' //
this.getKeyword()
}).catch(res => {})
} else {
this.saveType()
}
}
} }
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.wrap { .wrap {
display: flex; display: flex;
height: calc(100vh - 223px); height: calc(100vh - 223px);
padding: 0 24px; padding: 0 24px;
.side {
.side { width: 300px;
width: 300px; padding: 24px 10px 24px 0;
padding: 24px 10px 24px 0; margin-right: 24px;
margin-right: 24px; border-right: 1px solid rgba(0, 0, 0, 0.06);
border-right: 1px solid rgba(0, 0, 0, 0.06);
}
.right {
width: calc(100% - 374px);
padding: 24px 0;
}
.intro {
padding: 20px;
margin: 20px 0;
border: 1px solid #dcdcdc;
border-radius: 4px;
.text {
margin-bottom: 20px;
} }
} .right {
width: calc(100% - 374px);
.field { padding: 24px 0;
margin-top: 20px; }
text-align: left; .intro{
padding: 20px;
.label { margin: 20px 0;
margin-bottom: 10px; border: 1px solid #dcdcdc;
border-radius: 4px;
.text{
margin-bottom: 20px;
}
}
.field {
margin-top: 20px;
text-align: left;
.label {
margin-bottom: 10px;
}
}
.tag-wrap {
display: flex;
align-items: center;
}
.btns{
margin-top: 20px;
} }
}
.tag-wrap {
display: flex;
align-items: center;
}
.btns {
margin-top: 20px;
}
} }
.tag-add { .tag-add {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 10px; margin-bottom: 10px;
.el-input {
.el-input { width: 200px;
width: 200px; }
} .el-button {
margin-left: 5px;
.el-button { }
margin-left: 5px;
}
} }
.mag{
.mag { margin-right: 20px;
margin-right: 20px; margin-left: 20px;
margin-left: 20px;
} }
.el-tag + .el-tag {
.el-tag+.el-tag { margin-left: 10px;
margin-left: 10px;
} }
.button-new-tag { .button-new-tag {
margin-left: 10px; margin-left: 10px;
height: 32px; height: 32px;
line-height: 30px; line-height: 30px;
padding-top: 0; padding-top: 0;
padding-bottom: 0; padding-bottom: 0;
} }
.input-new-tag { .input-new-tag {
width: 90px; width: 90px;
margin-left: 10px; margin-left: 10px;
vertical-align: bottom; vertical-align: bottom;
} }
</style> </style>

File diff suppressed because it is too large Load Diff

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

@ -1,231 +1,211 @@
<template> <template>
<div> <div>
<el-card shadow="hover" <el-card shadow="hover" class="m-b-20">
class="m-b-20"> <div class="flex-between">
<div class="flex-between"> <el-page-header @back="goBack" :content="'新增文章'"></el-page-header>
<el-page-header @back="goBack"
:content="'新增文章'"></el-page-header>
</div>
</el-card>
<el-card shadow="hover"
class="m-b-20">
<el-form :model="form"
:rules="rules"
ref="form"
label-width="90px"
label-suffix=":"
size="small">
<el-form-item prop="coverUrl"
label="封面图">
<el-upload class="avatar-uploader"
accept=".jpg,.png,.jpeg"
:on-remove="handleRemove"
:on-error="uploadError"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
action=""
:http-request="handleRequest">
<img v-if="form.coverUrl"
:src="form.coverUrl"
class="avatar">
<div class="uploader-default"
v-else>
<i class="el-icon-plus"></i>
<p>上传封面</p>
</div> </div>
</el-upload> </el-card>
</el-form-item> <el-card shadow="hover" class="m-b-20">
<el-form-item prop="author" <el-form :model="form" :rules="rules" ref="form" label-width="90px" label-suffix=":" size="small">
label="作者"> <el-form-item prop="coverUrl" label="封面图">
<div class="d-inline-block"> <el-upload
<el-input placeholder="请输入作者" class="avatar-uploader"
v-model="form.author" accept=".jpg,.png,.jpeg"
clearable></el-input> :on-remove="handleRemove"
</div> :on-error="uploadError"
</el-form-item> :on-success="uploadSuccess"
<el-form-item prop="date" :before-remove="beforeRemove"
label="日期"> :limit="1"
<div class="d-inline-block"> :on-exceed="handleExceed"
<el-date-picker v-model="form.date" :action="this.api.fileupload"
type="date" :headers="headers"
value-format="yyyy-MM-dd HH:mm:ss" name="file"
placeholder="选择日期"></el-date-picker> >
</div> <img v-if="form.coverUrl" :src="form.coverUrl" class="avatar">
</el-form-item> <div class="uploader-default" v-else>
<el-form-item prop="title" <i class="el-icon-plus"></i>
label="文章标题"> <p>上传封面</p>
<el-input placeholder="请输入文章标题" </div>
v-model="form.title" </el-upload>
clearable></el-input> </el-form-item>
</el-form-item> <el-form-item prop="author" label="作者">
<el-form-item prop="content" <div class="d-inline-block">
label="文章内容"> <el-input placeholder="请输入作者" v-model="form.author" clearable></el-input>
<quill :border="true" </div>
v-model="form.content" </el-form-item>
:uploading.sync="uploading" <el-form-item prop="date" label="日期">
:height="400" /> <div class="d-inline-block">
</el-form-item> <el-date-picker v-model="form.date" type="date" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期"></el-date-picker>
<el-form-item> </div>
<el-button type="primary" </el-form-item>
@click="saveData">确定</el-button> <el-form-item prop="title" label="文章标题">
</el-form-item> <el-input placeholder="请输入文章标题" v-model="form.title" clearable></el-input>
</el-form> </el-form-item>
</el-card> <el-form-item prop="content" label="文章内容">
</div> <quill :border="true" v-model="form.content" :uploading.sync="uploading" :height="400" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="saveData">确定</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</template> </template>
<script> <script>
import Oss from '@/components/upload/upload.js'
import quill from "@/components/quill"; import quill from "@/components/quill";
import util from "@/libs/util"; import util from "@/libs/util";
export default { export default {
name: "addarticle", name: "addarticle",
data () { data() {
return { return {
headers: { headers: {
token: sessionStorage.getItem('token') token: sessionStorage.getItem('token')
}, },
form: { form: {
columnId: +this.$route.query.columnId, columnId: +this.$route.query.columnId,
sort: +this.$route.query.sort, sort: +this.$route.query.sort,
id: '', id: '',
coverUrl: '', coverUrl: '',
author: '', author: '',
date: '', date: '',
title: '', title: '',
content: '', content: '',
createUser: this.$store.state.userName createUser: this.$store.state.userName
}, },
rules: { rules: {
coverUrl: [ coverUrl: [
{ required: true, message: '请上传封面', trigger: 'change' } { required: true, message: '请上传封面', trigger: 'change' }
], ],
author: [ author: [
{ required: true, message: '请输入作者', trigger: 'blur' } { required: true, message: '请输入作者', trigger: 'blur' }
], ],
date: [ date: [
{ required: true, message: '请选择日期', trigger: 'change' } { required: true, message: '请选择日期', trigger: 'change' }
], ],
title: [ title: [
{ required: true, message: '请输入文章标题', trigger: 'blur' } { required: true, message: '请输入文章标题', trigger: 'blur' }
], ],
content: [ content: [
{ required: true, message: '请输入文章内容', trigger: 'blur' } { required: true, message: '请输入文章内容', trigger: 'blur' }
], ],
}, },
uploadList: [], uploadList: [],
uploadDataList: [], uploadDataList: [],
submiting: false, submiting: false,
uploading: false uploading: false
}; };
},
components: {
quill
},
mounted () {
this.id = this.$route.query.id;
this.id && this.getData();
},
methods: {
//
goBack () {
this.$router.back();
}, },
getData () { components: {
this.$get(`${this.api.getArticle}?articleId=${this.id}`).then(({ article }) => { quill
this.form = article
}).catch(err => { })
}, },
saveData () { mounted() {
this.$refs.form.validate((valid) => { this.id = this.$route.query.id;
if (valid) { this.id && this.getData();
if (this.submiting) return false },
const { form } = this methods: {
if (this.uploading) return util.warningMsg("图片正在上传中,请稍等"); //
this.submiting = true goBack() {
if (form.id) { this.$router.back();
this.$put(this.api.editArticle, form).then(res => { },
this.submiting = false; getData() {
util.successMsg("修改成功"); this.$get(`${this.api.getArticle}?articleId=${this.id}`).then(({ article }) => {
this.back(); this.form = article
}) }).catch(err => {})
.catch(err => { },
this.submiting = false; saveData() {
}); this.$refs.form.validate((valid) => {
} else { if (valid) {
this.$post(this.api.addArticle, form).then(res => { if (this.submiting) return false
this.submiting = false; const { form } = this
util.successMsg("创建成功"); if (this.uploading) return util.warningMsg("图片正在上传中,请稍等");
this.back(); this.submiting = true
if (form.id) {
this.$put(this.api.editArticle, form).then(res => {
this.submiting = false;
util.successMsg("修改成功");
this.back();
})
.catch(err => {
this.submiting = false;
});
} else {
this.$post(this.api.addArticle, form).then(res => {
this.submiting = false;
util.successMsg("创建成功");
this.back();
})
.catch(err => {
this.submiting = false;
});
}
}
})
},
handleCurrentChange(val) {
this.currPage = val;
},
handleExceed(files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
},
uploadSuccess(res, file, fileList) {
if (this.form.coverUrl) {
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
}).catch(res => {
});
}
this.form.coverUrl = 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) {
let fileName = this.form.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.form.coverUrl = "";
}).catch(res => {
});
},
uploadSure() {
this.BatchUpload = false;
this.pageNo = 1;
this.keyword = "";
this.getData();
},
back() {
this.$router.back();
},
goback() {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: "warning"
}) })
.catch(err => { .then(() => {
this.submiting = false; this.back();
}); })
} .catch(() => {
});
},
addSponsor() {
this.sponsorList.push("");
},
delSponsor(index) {
this.sponsorList.splice(index, 1);
},
addOrganizer() {
this.organzinerList.push("");
},
delOrganizer(index) {
this.organzinerList.splice(index, 1);
} }
})
},
handleCurrentChange (val) {
this.currPage = val;
},
handleExceed (files, fileList) {
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`);
},
//
async handleRequest ({ file }) {
this.form.coverUrl && Oss.del(this.form.coverUrl)
Oss.upload(file).then(res => {
this.form.coverUrl = res.url
})
},
uploadError (err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
},
beforeRemove (file, fileList) {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove (file, fileList) {
Oss.del(this.form.coverUrl)
this.form.coverUrl = ''
},
uploadSure () {
this.BatchUpload = false;
this.pageNo = 1;
this.keyword = "";
this.getData();
},
back () {
this.$router.back();
},
goback () {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: "warning",
closeOnClickModal: false
})
.then(() => {
this.back();
})
.catch(() => {
});
},
addSponsor () {
this.sponsorList.push("");
},
delSponsor (index) {
this.sponsorList.splice(index, 1);
},
addOrganizer () {
this.organzinerList.push("");
},
delOrganizer (index) {
this.organzinerList.splice(index, 1);
} }
}
}; };
</script> </script>
@ -241,7 +221,7 @@ $avatar-width: 104px;
overflow: hidden; overflow: hidden;
&:hover { &:hover {
border-color: #409eff; border-color: #409EFF;
} }
.uploader-default { .uploader-default {
@ -292,8 +272,7 @@ $avatar-width: 104px;
/deep/ .d-inline-block { /deep/ .d-inline-block {
width: 216px; width: 216px;
.el-select, .el-select, .el-input {
.el-input {
width: 100%; width: 100%;
} }
} }

@ -1,257 +1,220 @@
<template> <template>
<div> <div>
<div class="page"> <div class="page">
<div class="btn-wrap"> <div class="btn-wrap">
<template v-if="sorting"> <template v-if="sorting">
<el-button class="action-btn" <el-button class="action-btn" type="primary" round @click="cancelSort">取消</el-button>
type="primary" <el-button class="action-btn" type="primary" round @click="sortSubmit">保存</el-button>
round
@click="cancelSort">取消</el-button>
<el-button class="action-btn"
type="primary"
round
@click="sortSubmit">保存</el-button>
</template>
<template v-if="!sorting">
<el-button v-auth="'栏目管理:更改排序'"
class="action-btn"
type="primary"
round
@click="openSort">更改排序
</el-button>
<el-button v-auth="'栏目管理:添加栏目'"
class="action-btn"
type="primary"
round
@click="handleColumn(false, 0, 0)">添加栏目
</el-button>
</template>
</div>
<div class="page-content"
style="padding-top: 24px; margin-top: 24px">
<div class="el-table">
<div class="list">
<div class="thead">
<span>栏目名称</span>
<span><em :class="{hide: sorting}"
style="font-style: normal">操作</em></span>
</div>
</div>
<el-tree :data="list"
node-key="id"
default-expand-all
:draggable="sorting"
:allow-drop="allowDrop">
<span class="custom-tree-node"
slot-scope="{ node, data }">
<span class="name">{{ data.name }}</span>
<span class="action"
v-show="!sorting">
<el-button v-auth="'栏目管理:编辑'"
type="text"
@click.stop="handleColumn(data)">编辑</el-button>
<el-divider v-auth="'栏目管理:编辑'"
direction="vertical"></el-divider>
<template v-if="node.level < 4">
<el-button v-auth="'栏目管理:新增'"
type="text"
@click.stop="handleColumn(data, data.id, data.level + 1)">新增</el-button>
<el-divider v-auth="'栏目管理:新增'"
direction="vertical"></el-divider>
</template> </template>
<el-button v-auth="'栏目管理:删除'" <template v-if="!sorting">
type="text" <el-button v-auth="'栏目管理:更改排序'" class="action-btn" type="primary" round @click="openSort">更改排序
@click.stop="delData(data)">删除</el-button> </el-button>
</span> <el-button v-auth="'栏目管理:添加栏目'" class="action-btn" type="primary" round @click="handleColumn(false, 0, 0)">添加栏目
</span> </el-button>
</el-tree> </template>
</div>
<div class="page-content" style="padding-top: 24px; margin-top: 24px">
<div class="el-table">
<div class="list">
<div class="thead">
<span>栏目名称</span>
<span><em :class="{hide: sorting}" style="font-style: normal">操作</em></span>
</div>
</div>
<el-tree :data="list" node-key="id" default-expand-all :draggable="sorting" :allow-drop="allowDrop">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span class="name">{{ data.name }}</span>
<span class="action" v-show="!sorting">
<el-button v-auth="'栏目管理:编辑'" type="text" @click.stop="handleColumn(data)">编辑</el-button>
<el-divider v-auth="'栏目管理:编辑'" direction="vertical"></el-divider>
<template v-if="node.level < 4">
<el-button v-auth="'栏目管理:新增'" type="text" @click.stop="handleColumn(data, data.id, data.level + 1)">新增</el-button>
<el-divider v-auth="'栏目管理:新增'" direction="vertical"></el-divider>
</template>
<el-button v-auth="'栏目管理:删除'" type="text" @click.stop="delData(data)">删除</el-button>
</span>
</span>
</el-tree>
</div>
</div>
</div> </div>
</div>
</div>
<el-dialog :title="!curRow.id ? '添加栏目' : '编辑栏目'" <el-dialog :title="!curRow.id ? '添加栏目' : '编辑栏目'" :visible.sync="columnVisible" width="400px"
:visible.sync="columnVisible" :close-on-click-modal="false" @close="closeColumn">
width="400px" <el-form>
:close-on-click-modal="false" <el-form-item>
@close="closeColumn"> <el-input placeholder="栏目名称" v-model="curRow.name"></el-input>
<el-form> </el-form-item>
<el-form-item> </el-form>
<el-input placeholder="栏目名称" <span slot="footer" class="dialog-footer">
v-model="curRow.name"></el-input> <el-button @click="columnVisible = false"> </el-button>
</el-form-item> <el-button type="primary" @click="columnSubmit"> </el-button>
</el-form> </span>
<span slot="footer" </el-dialog>
class="dialog-footer"> </div>
<el-button @click="columnVisible = false"> </el-button>
<el-button type="primary"
@click="columnSubmit"> </el-button>
</span>
</el-dialog>
</div>
</template> </template>
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
import Setting from '@/setting' import Setting from '@/setting'
export default { export default {
name: "columnManage", name: "columnManage",
data () { data() {
return { return {
activeName: "first", activeName: "first",
tabs: { tabs: {
first: "栏目管理" first: "栏目管理"
}, },
name: this.$store.state.name, name: this.$store.state.name,
originList: [], originList: [],
list: [], list: [],
multipleSelection: [], multipleSelection: [],
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
columnVisible: false, columnVisible: false,
curRow: {}, curRow: {},
sortObj: null, sortObj: null,
sorting: false, sorting: false,
parentId: '', parentId: '',
isAddType: false, isAddType: false,
defaultProps: { defaultProps: {
label: "name" label: "name"
}, },
level: 0 level: 0
}; };
},
mounted () {
this.getData();
},
beforeRouteLeave (to, from, next) {
if (JSON.stringify(this.originList) !== JSON.stringify(this.list)) {
this.$confirm("确定返回?排序尚未保存。", "提示", {
type: "warning",
closeOnClickModal: false
})
.then(() => {
next();
})
.catch(() => {
});
} else {
next();
}
},
methods: {
getData () {
this.$get(this.api.queryAllColumns, {
school: 0
}).then(({ columnTree }) => {
this.list = columnTree
this.originList = JSON.parse(JSON.stringify(this.list));
this.total = columnTree.length
}).catch(res => {
});
},
delData (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
.then(() => {
this.$del(`${this.api.deleteColumn}/${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
})
.catch(() => {
});
}, },
handleColumn (row, parentId, level) { mounted() {
this.columnVisible = true this.getData();
if (row) {
this.curRow = JSON.parse(JSON.stringify(row))
}
if (typeof parentId === 'number') {
this.curRow = {
parentId,
level,
name: '',
platformId: Setting.platformId
}
}
}, },
// list beforeRouteLeave(to, from, next) {
handleList (data, parent = {}) { if (JSON.stringify(this.originList) !== JSON.stringify(this.list)) {
data.map((n, i) => { this.$confirm("确定返回?排序尚未保存。", "提示", {
n.parentId = parent.id || 0 type: "warning"
n.level = this.level })
n.sort = i .then(() => {
if (n.children.length) { next();
this.level++ })
this.handleList(n.children, n) .catch(() => {
});
} else { } else {
this.level = 0 next();
} }
})
}, },
sortSubmit () { methods: {
this.level = 0 getData() {
let list = JSON.parse(JSON.stringify(this.list)) this.$get(this.api.queryAllColumns, {
this.handleList(list) school: 0
this.$post(this.api.columnReorder, { }).then(({ columnTree }) => {
columnTree: list this.list = columnTree
}).then(res => { this.originList = JSON.parse(JSON.stringify(this.list));
util.successMsg("保存成功"); this.total = columnTree.length
this.sorting = false; }).catch(res => {
this.getData(); });
}).catch(res => { },
}); delData(row) {
}, this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
columnSubmit () { type: "warning"
const row = this.curRow })
if (!row.name) return util.warningMsg("请填写栏目名称"); .then(() => {
if (this.curRow.id) { this.$del(`${this.api.deleteColumn}/${row.id}`).then(res => {
this.$put(this.api.editColumn, row).then(res => { util.successMsg("删除成功");
util.successMsg("修改成功"); this.getData();
this.columnVisible = false; }).catch(res => {
this.getData(); });
}).catch(res => { })
}); .catch(() => {
} else { });
this.$post(this.api.addColumn, row).then(res => { },
util.successMsg("添加成功"); handleColumn(row, parentId, level) {
this.columnVisible = false; this.columnVisible = true
this.getData(); if (row) {
}).catch(res => { this.curRow = JSON.parse(JSON.stringify(row))
}); }
} if (typeof parentId === 'number') {
}, this.curRow = {
cancelSort () { parentId,
this.sorting = false; level,
this.list = JSON.parse(JSON.stringify(this.originList)); name: '',
this.sortObj.destroy(); platformId: Setting.platformId
}, }
openSort () { }
this.sorting = true; },
}, // list
handleSelectionChange (val) { handleList(data, parent = {}) {
this.multipleSelection = val; data.map((n, i) => {
}, n.parentId = parent.id || 0
handleCurrentChange (val) { n.level = this.level
this.pageNo = val; n.sort = i
this.getData(); if (n.children.length) {
}, this.level++
closeColumn () { this.handleList(n.children, n)
this.curRow = {} } else {
}, this.level = 0
allowDrop (draggingNode, dropNode, type) { }
console.log("🚀 ~ file: index.vue ~ line 207 ~ allowDrop ~ draggingNode, dropNode, type", draggingNode, dropNode.level, type) })
if (dropNode.level == 4 && draggingNode.childNodes.length == 0) { },
return type !== "inner"; sortSubmit() {
} else if ((draggingNode.childNodes.length > 0 && dropNode.level == 4) || (draggingNode.childNodes.length > 0 && type == "inner")) { this.level = 0
return false; let list = JSON.parse(JSON.stringify(this.list))
} else { this.handleList(list)
return true; this.$post(this.api.columnReorder, {
} columnTree: list
}).then(res => {
util.successMsg("保存成功");
this.sorting = false;
this.getData();
}).catch(res => {
});
},
columnSubmit() {
const row = this.curRow
if (!row.name) return util.warningMsg("请填写栏目名称");
if (this.curRow.id) {
this.$put(this.api.editColumn, row).then(res => {
util.successMsg("修改成功");
this.columnVisible = false;
this.getData();
}).catch(res => {
});
} else {
this.$post(this.api.addColumn, row).then(res => {
util.successMsg("添加成功");
this.columnVisible = false;
this.getData();
}).catch(res => {
});
}
},
cancelSort() {
this.sorting = false;
this.list = JSON.parse(JSON.stringify(this.originList));
this.sortObj.destroy();
},
openSort() {
this.sorting = true;
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleCurrentChange(val) {
this.pageNo = val;
this.getData();
},
closeColumn() {
this.curRow = {}
},
allowDrop(draggingNode, dropNode, type) {
console.log("🚀 ~ file: index.vue ~ line 207 ~ allowDrop ~ draggingNode, dropNode, type", draggingNode, dropNode.level, type)
if (dropNode.level == 4 && draggingNode.childNodes.length == 0) {
return type !== "inner";
} else if ((draggingNode.childNodes.length > 0 && dropNode.level == 4) || (draggingNode.childNodes.length > 0 && type == "inner")) {
return false;
} else {
return true;
}
}
} }
}
}; };
</script> </script>
@ -279,7 +242,7 @@ export default {
&:first-child { &:first-child {
padding-left: 23.5vw; padding-left: 23.5vw;
@media (max-width: 1270px) { @media(max-width: 1270px) {
padding-left: 25.5%; padding-left: 25.5%;
} }
} }
@ -294,14 +257,14 @@ export default {
/deep/ .el-tree { /deep/ .el-tree {
.el-tree-node__expand-icon { .el-tree-node__expand-icon {
margin-left: 22.5vw; margin-left: 22.5vw;
@media (max-width: 1270px) { @media(max-width: 1270px) {
margin-left: 23.5%; margin-left: 23.5%;
} }
} }
.el-tree-node__content { .el-tree-node__content {
padding: 5px; padding: 5px;
border-bottom: 0.0625rem solid #ebeef5; border-bottom: 0.0625rem solid #EBEEF5;
} }
} }
@ -320,7 +283,7 @@ export default {
.action { .action {
width: 8.5vw; width: 8.5vw;
text-align: left; text-align: left;
@media (max-width: 1270px) { @media(max-width: 1270px) {
width: 16%; width: 16%;
} }
} }

@ -1,226 +1,231 @@
<template> <template>
<div class="page"> <div class="page">
<!-- <div class="tabs">--> <!-- <div class="tabs">-->
<!-- <a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == activeName}" @click="tabChange(index)">{{item}}</a>--> <!-- <a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == activeName}" @click="tabChange(index)">{{item}}</a>-->
<!-- </div>--> <!-- </div>-->
<div class="btn-wrap"> <div class="btn-wrap">
<el-button v-auth="'内容管理:保存排序'" class="action-btn" type="primary" @click="sortSubmit">保存排序</el-button> <el-button v-auth="'内容管理:保存排序'" class="action-btn" type="primary" @click="sortSubmit">保存排序</el-button>
<el-button v-auth="'内容管理:批量删除'" class="action-btn" type="primary" @click="delAllData">批量删除</el-button> <el-button v-auth="'内容管理:批量删除'" class="action-btn" type="primary" @click="delAllData">批量删除</el-button>
<el-button v-auth="'内容管理:新增文章'" class="action-btn" type="primary" @click="addArticle">新增文章</el-button> <el-button v-auth="'内容管理:新增文章'" class="action-btn" type="primary" @click="addArticle">新增文章</el-button>
</div>
<div class="page-content" style="padding-top: 24px">
<el-table ref="table" :data="list" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="title" label="标题" show-overflow-tooltip align="center">
</el-table-column>
<el-table-column prop="title" label="栏目" show-overflow-tooltip align="center">
{{ columnName }}
</el-table-column>
<el-table-column prop="name" label="排序值" width="80" align="center">
<template slot-scope="scope">
<el-input class="sort-input" width="120" min="1" v-model.number="scope.row.sort" type="number"></el-input>
<span>{{ scope.row.sort }}</span>
</template>
</el-table-column>
<el-table-column prop="date" label="添加日期" align="center">
<template slot-scope="scope">
{{ transferDate(scope.row.date) }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="170">
<template slot-scope="scope">
<el-button v-auth="'内容管理:编辑'" type="text" @click="editArticle(scope)">编辑</el-button>
<el-divider v-auth="'内容管理:编辑'" direction="vertical"></el-divider>
<el-button v-auth="'内容管理:删除'" type="text" @click="delData(scope.row)">删除</el-button>
</template>
</el-table-column>
<el-table-column prop="name" label="文章发布状态" width="120" align="center">
<template slot-scope="scope">
<el-switch
v-auth="'内容管理:禁用'"
class="off"
v-model="scope.row.status"
:active-value="0"
:inactive-value="1"
style="margin: 0 5px"
:active-text="scope.row.status ? '关' : '开'"
@change="switchOff($event,scope.row,scope.$index)"
></el-switch>
<span>{{ scope.row.status ? "禁用" : "启用" }}</span>
</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>
</div>
</div> </div>
<div class="page-content" style="padding-top: 24px">
<el-table ref="table" :data="list" class="table" header-align="center" @selection-change="handleSelectionChange"
row-key="id">
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope">
{{ scope.$index + (pageNo - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="title" label="标题" show-overflow-tooltip align="center">
</el-table-column>
<el-table-column prop="title" label="栏目" show-overflow-tooltip align="center">
{{ columnName }}
</el-table-column>
<el-table-column prop="name" label="排序值" width="80" align="center">
<template slot-scope="scope">
<el-input class="sort-input" width="120" min="1" v-model.number="scope.row.sort" type="number"></el-input>
<span>{{ scope.row.sort }}</span>
</template>
</el-table-column>
<el-table-column prop="date" label="添加日期" align="center">
<template slot-scope="scope">
{{ transferDate(scope.row.date) }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="170">
<template slot-scope="scope">
<el-button v-auth="'内容管理:编辑'" type="text" @click="editArticle(scope)">编辑</el-button>
<el-divider v-auth="'内容管理:编辑'" direction="vertical"></el-divider>
<el-button v-auth="'内容管理:删除'" type="text" @click="delData(scope.row)">删除</el-button>
</template>
</el-table-column>
<el-table-column prop="name" label="文章发布状态" width="120" align="center">
<template slot-scope="scope">
<el-switch v-auth="'内容管理:禁用'" class="off" v-model="scope.row.status" :active-value="0" :inactive-value="1"
style="margin: 0 5px" :active-text="scope.row.status ? '关' : '开'"
@change="switchOff($event, scope.row, scope.$index)"></el-switch>
<span>{{ scope.row.status ? "禁用" : "启用" }}</span>
</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>
</div>
</div>
</template> </template>
<script> <script>
import util from "@/libs/util"; import util from "@/libs/util";
export default { export default {
data () { data() {
return { return {
activeName: "first", activeName: "first",
tabs: { tabs: {
first: "栏目内容管理" first: "栏目内容管理"
}, },
columns: this.$parent.menuList, columns: this.$parent.menuList,
columnName: '', columnName: '',
list: [], list: [],
multipleSelection: [], multipleSelection: [],
pageNo: +this.$route.query.page || 1, pageNo: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
totals: 0, totals: 0,
originList: [] originList: []
}; };
},
props: {
columnId: ""
},
watch: {
columnId () {
this.getColumnName(this.$parent.menuList)
this.getData();
}
},
mounted () {
this.getColumnName(this.$parent.menuList)
this.getData();
},
methods: {
getData (id) {
let data = {
columnId: this.columnId
};
this.$get(`${this.api.queryArticleByCondition}/${this.pageNo}/${this.pageSize}`, data).then(({ articleList, total }) => {
this.list = articleList;
this.totals = total;
if (JSON.stringify(this.originList) !== '{}') this.originList = JSON.parse(JSON.stringify(articleList))
if (!this.list.length && this.totals) {
this.pageNo--;
this.getData();
}
}).catch(res => {
});
},
handleSelectionChange (val) {
this.multipleSelection = val;
}, },
handleCurrentChange (val) { props: {
this.pageNo = val; columnId: ""
this.$router.push(`/information?page=${val}`)
this.getData();
},
//
getColumnName (data) {
data.map(e => {
if (e.id == this.columnId) {
this.columnName = e.name
} else {
this.getColumnName(e.children)
}
})
}, },
addArticle () { watch: {
this.$router.push(`/addArticle?columnId=${this.columnId}&sort=${this.list.length + 1}`); columnId() {
}, this.getColumnName(this.$parent.menuList)
editArticle (scope) {
this.$router.push(`/addArticle?columnId=${this.columnId}&id=${scope.row.id}&sort=${scope.$index + 1}`);
},
delData (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
.then(() => {
this.$del(`${this.api.deleteArticles}?articleIds=${row.id}`).then(res => {
util.successMsg("删除成功");
this.getData(); this.getData();
}).catch(res => { }
});
})
.catch(() => {
});
}, },
transferDate (date) { mounted() {
return date.replace(" 00:00:00", ""); this.getColumnName(this.$parent.menuList)
this.getData();
}, },
delAllData () { methods: {
if (this.multipleSelection.length != "") { getData(id) {
let newArr = this.multipleSelection; let data = {
let delList = newArr.map(item => { columnId: this.columnId
return item.id; };
}); this.$get(`${this.api.queryArticleByCondition}/${this.pageNo}/${this.pageSize}`, data).then(({ articleList, total }) => {
this.list = articleList;
let title = newArr[0].title; this.totals = total;
if (title.length > 14) { if (JSON.stringify(this.originList) !== '{}') this.originList = JSON.parse(JSON.stringify(articleList))
title = title.substr(0, 14) + "……"; if (!this.list.length && this.totals) {
} this.pageNo--;
this.$confirm(`此批量删除操作不可逆,是否确认删除${title}${newArr.length}个选中项?`, "提示", { this.getData();
type: "warning" }
})
.then(() => {
this.$del(`${this.api.deleteArticles}?articleIds=${delList.join(",")}`).then(res => {
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
}).catch(res => { }).catch(res => {
}); });
if (this.multipleSelection.length === this.list.length && this.pageNo > 1) { },
this.handleCurrentChange(this.pageNo - 1) handleSelectionChange(val) {
this.multipleSelection = val;
},
handleCurrentChange(val) {
this.pageNo = val;
this.$router.push(`list?page=${val}`)
this.getData();
},
//
getColumnName(data) {
data.map(e => {
if (e.id == this.columnId) {
this.columnName = e.name
} else {
this.getColumnName(e.children)
} }
}) })
.catch(() => { },
}); addArticle() {
} else { this.$router.push(`/addArticle?columnId=${this.columnId}&sort=${this.list.length + 1}`);
util.errorMsg("请先选择数据 !"); },
} editArticle(scope) {
}, this.$router.push(`/addArticle?columnId=${this.columnId}&id=${scope.row.id}&sort=${scope.$index + 1}`);
switchOff (val, row, index) { },
this.$put(`${this.api.enableArticle}/${row.id}/${val}`) delData(row) {
.then(res => { this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
val == 1 ? util.errorMsg("该文章已隐藏,对学生端用户不可见") : util.successMsg("该文章已发布,对学生端用户可见"); type: "warning"
}) })
.catch(err => { .then(() => {
}); this.$del(`${this.api.deleteArticles}?articleIds=${row.id}`).then(res => {
}, util.successMsg("删除成功");
sortSubmit () { this.getData();
if (this.list.length) { }).catch(res => {
if (this.list.find(n => n.sort < 1)) return util.errorMsg("排序值最小为1"); });
let data = { articleList: this.list }; })
this.$post(this.api.articleSort, data).then(res => { .catch(() => {
util.successMsg("保存成功"); });
this.getData() },
}) transferDate(date) {
.catch(err => { return date.replace(" 00:00:00", "");
}); },
} else { delAllData() {
util.errorMsg("数据为空"); if (this.multipleSelection.length != "") {
} let newArr = this.multipleSelection;
let delList = newArr.map(item => {
return item.id;
});
let title = newArr[0].title;
if (title.length > 14) {
title = title.substr(0, 14) + "……";
}
this.$confirm(`此批量删除操作不可逆,是否确认删除${title}${newArr.length}个选中项?`, "提示", {
type: "warning"
})
.then(() => {
this.$del(`${this.api.deleteArticles}?articleIds=${delList.join(",")}`).then(res => {
this.$refs.table.clearSelection();
util.successMsg("删除成功");
this.getData();
}).catch(res => {
});
if(this.multipleSelection.length === this.list.length && this.pageNo>1) {
this.handleCurrentChange(this.pageNo - 1)
}
})
.catch(() => {
});
} else {
util.errorMsg("请先选择数据 !");
}
},
switchOff(val, row, index) {
this.$put(`${this.api.enableArticle}/${row.id}/${val}`)
.then(res => {
val == 1 ? util.errorMsg("该文章已隐藏,对学生端用户不可见") : util.successMsg("该文章已发布,对学生端用户可见");
})
.catch(err => {
});
},
sortSubmit() {
if (this.list.length) {
if (this.list.find(n => n.sort < 1)) return util.errorMsg("排序值最小为1");
let data = { articleList: this.list };
this.$post(this.api.articleSort, data).then(res => {
util.successMsg("保存成功");
this.getData()
})
.catch(err => {
});
} else {
util.errorMsg("数据为空");
}
}
} }
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.btn-wrap { .btn-wrap {
text-align: right; text-align: right;
} }
.sort-input { .sort-input {
/deep/ .el-input__inner { /deep/ .el-input__inner {
padding: 0 0 0 10px; padding: 0 0 0 10px;
} }
} }
.sort-input+span { .sort-input + span {
display: none; display: none;
} }
.off+span { .off + span {
display: none; display: none;
} }
</style> </style>

@ -2,8 +2,7 @@
<!-- 内容管理 --> <!-- 内容管理 -->
<div class="flex"> <div class="flex">
<div class="menu-con"> <div class="menu-con">
<el-tree ref="column" :data="menuList" :props="{ label: 'name' }" highlight-current :expand-on-click-node="false" <el-tree ref="column" :data="menuList" :props="{ label: 'name' }" highlight-current :expand-on-click-node="false" default-expand-all node-key="id" @node-click="handleSelect"></el-tree>
default-expand-all node-key="id" @node-click="handleSelect"></el-tree>
</div> </div>
<div class="right"> <div class="right">
<ContentList ref="content" v-show="menuList.length" :columnId="columnId" /> <ContentList ref="content" v-show="menuList.length" :columnId="columnId" />
@ -16,75 +15,74 @@ import menuTree from '@/components/menuTree'
import ContentList from "./contentList"; import ContentList from "./contentList";
import Setting from '@/setting' import Setting from '@/setting'
export default { export default {
name: "contentManage", name: "contentManage",
components: { components: {
menuTree, menuTree,
ContentList ContentList
},
data () {
return {
menuList: [],
activeName: this.$store.state.columnId,
columnId: "",
ids: [],
curId: ''
};
},
mounted () {
this.getMenuData();
},
methods: {
getMenuData () {
this.$get(this.api.queryAllColumns, {
school: 0
}).then(res => {
this.menuList = res.columnTree
const storeId = this.$store.state.columnId
if (this.menuList.length) {
this.getId(this.menuList)
this.columnId = this.menuList[0].id
if (!storeId) {
this.$store.commit('setColumnId', this.columnId)
} else {
this.columnId = storeId
}
}
this.$nextTick(() => {
this.$refs.column.setCurrentKey(this.columnId)
})
}).catch(err => {
});
}, },
// id便 data() {
getId (data) { return {
data.map(e => { menuList: [],
this.ids.push(e.id) activeName: this.$store.state.columnId,
e.children.length && this.getId(e.children) columnId: "",
}) ids: [],
curId: ''
};
}, },
setColumnId (id) { mounted() {
this.columnId = id this.getMenuData();
this.$store.commit('setColumnId', id)
}, },
handleSelect (key) { methods: {
const { content } = this.$refs getMenuData() {
const { list, originList } = content this.$get(this.api.queryAllColumns, {
// school: 0
if (JSON.stringify(list) !== JSON.stringify(originList)) { }).then(res => {
this.$confirm(`您已更改了文章排序,是否保存更改?`, '提示', { this.menuList = res.columnTree
type: 'warning', const storeId = this.$store.state.columnId
closeOnClickModal: false if (this.menuList.length) {
}).then(() => { this.getId(this.menuList)
content.sortSubmit() this.columnId = this.menuList[0].id
this.setColumnId(key.id) if (!storeId) {
}).catch(() => { this.$store.commit('setColumnId', this.columnId)
this.setColumnId(key.id) } else {
}) this.columnId = storeId
} else { }
this.setColumnId(key.id) }
} this.$nextTick(() => {
this.$refs.column.setCurrentKey(this.columnId)
})
}).catch(err => {
});
},
// id便
getId(data) {
data.map(e => {
this.ids.push(e.id)
e.children.length && this.getId(e.children)
})
},
setColumnId(id) {
this.columnId = id
this.$store.commit('setColumnId', id)
},
handleSelect(key) {
const { content } = this.$refs
const { list, originList } = content
//
if (JSON.stringify(list) !== JSON.stringify(originList)) {
this.$confirm(`您已更改了文章排序,是否保存更改?`, '提示', {
type: 'warning'
}).then(() => {
content.sortSubmit()
this.setColumnId(key.id)
}).catch(() => {
this.setColumnId(key.id)
})
} else {
this.setColumnId(key.id)
}
}
} }
}
}; };
</script> </script>
@ -93,19 +91,16 @@ export default {
width: 210px; width: 210px;
height: calc(100vh - 250px); height: calc(100vh - 250px);
border-right: solid 1px #e6e6e6; border-right: solid 1px #e6e6e6;
background-color: #f2f6fc; background-color: #F2F6FC;
/deep/.el-tree-node__content { /deep/.el-tree-node__content {
height: 50px; height: 50px;
} }
} }
.right { .right {
flex: 1; flex: 1;
} }
/deep/.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
/deep/.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
color: #fff; color: #fff;
background-color: #062c87; background-color: #9278ff;
} }
</style> </style>

@ -1,67 +1,66 @@
<template> <template>
<!-- 资讯管理 --> <!-- 资讯管理 -->
<div class="page"> <div class="page">
<ul class="column-tab"> <ul class="column-tab">
<li :class="{ active: tabsName == 1 }" @click="handleClick(1)"><i class="el-icon-collection-tag"></i> 栏目管理</li> <li :class="{active: tabsName == 1}" @click="handleClick(1)"><i class="el-icon-collection-tag"></i> 栏目管理</li>
<li :class="{ active: tabsName == 2 }" @click="handleClick(2)"><i class="el-icon-document"></i> 内容管理</li> <li :class="{active: tabsName == 2}" @click="handleClick(2)"><i class="el-icon-document"></i> 内容管理</li>
</ul> </ul>
<columnManage class="flex-1" ref="content1" v-if="tabsName == 1" /> <columnManage class="flex-1" ref="content1" v-if="tabsName == 1" />
<ContentManage class="flex-1" ref="content2" v-if="tabsName == 2" /> <ContentManage class="flex-1" ref="content2" v-if="tabsName == 2" />
</div> </div>
</template> </template>
<script> <script>
import ColumnManage from "../columnManage"; import ColumnManage from "../columnManage";
import ContentManage from "../contentManage"; import ContentManage from "../contentManage";
export default { export default {
components: { components: {
ColumnManage, ColumnManage,
ContentManage ContentManage
},
data () {
return {
tabsName: this.$store.state.tabId
};
},
//
beforeRouteLeave (to, from, next) {
this.routeLeave(next, true)
},
methods: {
switchTab (id) {
this.tabsName = id
this.$store.commit('setInfoTab', id)
this.$store.commit('setColumnId', '')
}, },
// data() {
routeLeave (fn, param) { return {
const tab = this.tabsName tabsName: this.$store.state.tabId
let content = this.$refs['content' + tab] };
if (tab == 2) content = content.$refs.content
const { list, originList } = content
//
if (JSON.stringify(list) !== JSON.stringify(originList)) {
this.$confirm(`您已更改了${tab == 1 ? '栏目' : '文章'}排序,是否保存更改?`, '提示', {
type: 'warning',
closeOnClickModal: false
}).then(() => {
content.sortSubmit()
fn(param)
}).catch(() => {
fn(param)
})
} else {
fn(param)
}
}, },
// tab //
handleClick (id) { beforeRouteLeave(to, from, next) {
this.routeLeave(this.switchTab, id) this.routeLeave(next, true)
} },
}, methods: {
mounted () { switchTab(id) {
this.tabsName = id
this.$store.commit('setInfoTab', id)
this.$store.commit('setColumnId', '')
},
//
routeLeave(fn, param) {
const tab = this.tabsName
let content = this.$refs['content' + tab]
if (tab == 2) content = content.$refs.content
const { list, originList } = content
//
if (JSON.stringify(list) !== JSON.stringify(originList)) {
this.$confirm(`您已更改了${tab == 1 ? '栏目' : '文章'}排序,是否保存更改?`, '提示', {
type: 'warning'
}).then(() => {
content.sortSubmit()
fn(param)
}).catch(() => {
fn(param)
})
} else {
fn(param)
}
},
// tab
handleClick(id) {
this.routeLeave(this.switchTab, id)
}
},
mounted() {
} }
}; };
</script> </script>
@ -69,28 +68,22 @@ export default {
.flex-1 { .flex-1 {
flex: 1; flex: 1;
} }
.page { .page {
display: flex; display: flex;
} }
.column-tab { .column-tab {
width: 120px; width: 120px;
border-right: solid 1px #e6e6e6; border-right: solid 1px #e6e6e6;
li { li {
display: flex; display: flex;
align-items: center; align-items: center;
height: 60px; height: 60px;
cursor: pointer; cursor: pointer;
i { i {
margin-right: 5px; margin-right: 5px;
} }
&:hover, &.active {
&:hover, color: #9278FF;
&.active {
color: #062c87;
} }
} }
} }

@ -1,251 +0,0 @@
<template>
<div class="page">
<div style="margin-bottom: 10px;text-align: right;">
<el-button v-auth="'/shop:营销推广管理:新增'" type="primary" round @click="add">新增</el-button>
</div>
<el-table :data="list" class="table" ref="table" header-align="center" row-key="id">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="courseName" label="图片" min-width="150" align="center">
<template slot-scope="scope">
<img width="100" :src="scope.row.banner" alt="">
</template>
</el-table-column>
<el-table-column prop="title" label="标题" min-width="150" align="center"></el-table-column>
<el-table-column prop="subheading" label="副标题" min-width="150" align="center"></el-table-column>
<el-table-column prop="url" label="链接" min-width="150" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="250">
<template slot-scope="scope">
<el-switch v-model="scope.row.isOpen" :active-value="0" :inactive-value="1"
@change="switchOff($event, scope.row)" v-auth="'/shop:营销推广管理:禁用'">
</el-switch>
<el-button style="margin-left: 10px;" v-auth="'/shop:营销推广管理:编辑'" type="text"
@click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/shop:营销推广管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog :title="(form.id ? '编辑' : '新增') + 'banner'" :visible.sync="bannerVisible" width="500px" class="dialog"
:close-on-click-modal="false">
<el-form ref="form" label-width="60px">
<el-form-item label="图片">
<el-upload class="avatar-uploader" accept=".jpg,.png,.jpeg,.gif" :on-change="changeFile"
:show-file-list="false" action="" :auto-upload="false">
<img v-if="form.banner" :src="form.banner" class="avatar">
<div class="uploader-default" v-else>
<i class="el-icon-plus"></i>
<p>上传图片</p>
</div>
</el-upload>
</el-form-item>
<el-form-item label="标题">
<el-input v-model="form.title" placeholder="请输入标题" maxlength="100"></el-input>
</el-form-item>
<el-form-item label="副标题">
<el-input v-model="form.subheading" placeholder="请输入副标题" maxlength="100"></el-input>
</el-form-item>
<el-form-item label="链接">
<el-input v-model="form.url" placeholder="请输入链接" maxlength="100"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="bannerVisible = false">取消</el-button>
<el-button type="primary" @click="submitBanner">确定</el-button>
</span>
</el-dialog>
<!-- 剪裁组件弹窗 -->
<el-dialog title="图片裁剪" append-to-body :visible.sync="cropperModel" width="1100px" :close-on-click-modal="false">
<Cropper ref="cropper" :img-file.sync="file" :is-upload="isUpload" :fixed="true" :fixedNumber.sync="fixedNumber"
:autoCropWidth="500" :autoCropHeight="138.8" @upload="customUpload" />
</el-dialog>
</div>
</template>
<script>
import Util from "@/libs/util";
import Setting from '@/setting'
import Cropper from '@/components/img-upload/Cropper'
import Axios from 'axios'
import Oss from '@/components/upload/upload.js'
export default {
data () {
return {
headers: {
token: sessionStorage.getItem("token")
},
list: [],
bannerVisible: false,
form: {
id: '',
banner: '',
title: '',
subheading: '',
url: '',
},
cropperModel: false,
isUpload: false,
fixedNumber: [5.4, 1],
file: ''
};
},
components: {
Cropper
},
mounted () {
this.getList()
},
methods: {
getList () {
this.$post(this.api.listMarketing, {
pageNum: 1,
pageSize: 1000
}).then(({ page }) => {
this.list = page.records;
this.total = page.total;
}).catch(res => {
});
},
//
customUpload (data) {
data.name = this.file.name
this.imgUpload(data)
},
//
imgUpload (formData) {
this.isUpload = true
Oss.upload(formData).then(res => {
this.form.banner && Oss.del(this.form.banner)
this.form.banner = res.url
})
this.$refs.cropper.isDisabled = false
this.isUpload = false
this.cropperModel = false
},
//
changeFile (file) {
const { size, name } = file
const ext = name.substring(name.lastIndexOf('.') + 1)
if (!Util.isImg(ext)) {
this.$message.error('请上传图片!')
return false
}
this.file = file
this.cropperModel = true
this.$nextTick(() => {
this.$refs.cropper.updateImg({
url: window.URL.createObjectURL(file.raw),
size: file.size
})
})
},
add () {
this.form = {
id: '',
banner: '',
title: '',
subheading: '',
url: '',
}
this.bannerVisible = true
},
edit (row) {
this.form = JSON.parse(JSON.stringify(row))
this.bannerVisible = true
},
// banner
submitBanner () {
const { form } = this
if (!form.banner) return Util.errorMsg('请上传图片')
this.$post(this.api[form.id ? 'updateMarketing' : 'saveMarketing'], form).then(res => {
this.getList()
this.bannerVisible = false
}).catch(res => { })
},
handleDelete (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
.then(() => {
this.$post(`${this.api.delMarketing}?ids=${row.id}`).then(res => {
Util.successMsg("删除成功");
this.getList();
}).catch(res => {
});
})
.catch(() => {
});
},
switchOff (val, row) {
this.$post(`${this.api.bannerEnableOrDisable}?id=${row.id}&isDisable=${row.isOpen}`).then(res => { }).catch(err => { })
}
}
};
</script>
<style lang="scss" scoped>
.m-l-10 {
margin-left: 10px;
}
$avatar-width: 104px;
/deep/ .avatar-uploader {
.el-upload {
position: relative;
width: $avatar-width;
height: $avatar-width;
border: 1px dashed #d9d9d9;
border-radius: 2px;
cursor: pointer;
overflow: hidden;
&:hover {
border-color: #409eff;
}
.uploader-default {
display: flex;
flex-direction: column;
justify-content: center;
width: $avatar-width !important;
height: $avatar-width;
text-align: center;
background: rgba(0, 0, 0, 0.04);
i {
font-size: 20px;
font-weight: bold;
color: #8c939d;
}
p {
margin-top: 10px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
line-height: 1;
}
}
.avatar {
width: $avatar-width;
height: $avatar-width;
display: block;
}
}
.el-upload__tip {
margin-top: 0;
p {
font-size: 14px;
color: rgba(0, 0, 0, 0.45);
line-height: 1;
&:first-child {
margin-bottom: 5px;
}
}
}
}
</style>

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

Loading…
Cancel
Save