parent
6f6321889f
commit
8bb1e0558e
154 changed files with 7195 additions and 12722 deletions
@ -0,0 +1,23 @@ |
||||
# 该项目是前端项目基础模板 |
||||
## 拉取该项目就可以直接上手开发. |
||||
|
||||
--- |
||||
|
||||
### 注意事项: |
||||
1. api里面存放接口地址 |
||||
2. assets里面存放静态文件,注意图片跟svg最好分开,方便后期管理 |
||||
3. components存放公共组件 |
||||
4. layouts存放页面布局组件,注意导航跟头部是分开的,放在一起太臃肿 |
||||
5. libs存放工具包.封装了cookie,localStorate,sessionStorage的增删改查; auth是用来生成角色权限里控制的按钮,生成后添加到store里面; route是做动态路由的,同时把生成的路由集合添加到store里面 |
||||
6. mixins可以自定义mixin |
||||
7. pages存放页面,一个模块为一个文件夹,默认有个list文件夹,默认跳转到list,要添加子模块的话直接建list的同级文件夹,里面统一命名index.vue |
||||
8. plugins里面aliplayer是阿里云播放器,按需引用; auth是按钮级别的鉴权; filters可以自定义filter; requests是全局请求配置文件; throttle为防抖 |
||||
9. router为路由,跟pages一样,一个模块为一个文件夹,存放在modules里面; permission为路由全局控制; route里引用modules里面定义的路由模块,每加一个模块就要在这里引用 |
||||
10. store存放store模块,直接在modules里定义文件就会自动引用,一个模块为一个文件夹,模块之间勿混淆使用 |
||||
11. styles存放全局scss. default里设置项目主题色; font存放字体文件; layout存放布局样式; lib里面有定义工具class,可以直接引用里面的class; pages为页面的公用样式; common为全局公共样式; var可以定义mixin和全局变量 |
||||
|
||||
--- |
||||
|
||||
#### 全局配置都放在setting.js里面,项目参数,比如默认密码,平台id,都放在这里,页面里直接引入该文件即可,不要在页面里写死公共使用的系统参数。 |
||||
|
||||
#### vue.config.js里要定义固定端口,不然项目启动多了会乱,每开一个项目就开一个新的端口,每个项目端口不要冲突 |
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 81 KiB |
Before Width: | Height: | Size: 112 KiB |
@ -1,30 +1,24 @@ |
||||
<template> |
||||
<div id="app"> |
||||
<div id="app" > |
||||
<router-view></router-view> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Setting from '@/setting'; |
||||
import util from '@/libs/util'; |
||||
export default { |
||||
name: 'App', |
||||
created () { |
||||
//在页面加载时读取sessionStorage里的状态信息 |
||||
if (sessionStorage.getItem("sta_server_store") ) { |
||||
this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(sessionStorage.getItem("sta_server_store")))) |
||||
//在页面加载时读取localStorage里的状态信息 |
||||
if (util.local.get(Setting.storeKey) ) { |
||||
this.$store.replaceState(Object.assign({}, this.$store.state,util.local.get(Setting.storeKey))) |
||||
} |
||||
|
||||
//在页面刷新时将vuex里的信息保存到sessionStorage里 |
||||
//在页面刷新时将vuex里的信息保存到localStorage里 |
||||
window.addEventListener("beforeunload",()=>{ |
||||
sessionStorage.setItem("sta_server_store",JSON.stringify(this.$store.state)) |
||||
util.local.get(Setting.tokenKey) && util.local.set(Setting.storeKey,this.$store.state) |
||||
}) |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
@import "./assets/css/main.css"; |
||||
/* @import "./assets/css/color-dark.css"; */ |
||||
/*深色主题*/ |
||||
@import "./assets/css/theme-green/color-green.css"; |
||||
/* 浅绿色主题 */ |
||||
</style> |
@ -1,12 +1,9 @@ |
||||
import config from '@/config' |
||||
import Setting from '@/setting' |
||||
// let host = 'http://192.168.31.125:9090'//林
|
||||
// let host = 'http://192.168.31.125:1010'//林
|
||||
// let host = 'http://192.168.31.152:9090'//榕
|
||||
// let host = 'http://192.168.31.140:8090'//7
|
||||
let host = config.host |
||||
let host = Setting.apiBaseURL |
||||
let uploadURL = Setting.upload.apiURL |
||||
let host1 = 'http://39.108.250.202:8080/' |
||||
// let loginhost = 'http://www.liuwanr.cn'
|
||||
let uploadURL = 'http://8.134.8.197:8001/' |
||||
|
||||
export default { |
||||
fileupload: `${uploadURL}oss/manage/fileupload`, |
@ -1,28 +0,0 @@ |
||||
.header{ |
||||
background-color: #242f42; |
||||
} |
||||
.login-wrap{ |
||||
background: #324157; |
||||
} |
||||
.plugins-tips{ |
||||
background: #eef1f6; |
||||
} |
||||
.plugins-tips a{ |
||||
color: #20a0ff; |
||||
} |
||||
.el-upload--text em { |
||||
color: #20a0ff; |
||||
} |
||||
.pure-button{ |
||||
background: #20a0ff; |
||||
} |
||||
.tags-li.active { |
||||
border: 1px solid #409EFF; |
||||
background-color: #409EFF; |
||||
} |
||||
.message-title{ |
||||
color: #20a0ff; |
||||
} |
||||
.collapse-btn:hover{ |
||||
background: rgb(40,52,70); |
||||
} |
@ -1,4 +0,0 @@ |
||||
|
||||
[class*=" icon-"], [class^=icon-] { |
||||
font-family: iconfont!important; |
||||
} |
@ -1,326 +0,0 @@ |
||||
* { |
||||
margin: 0; |
||||
padding: 0; |
||||
} |
||||
|
||||
html, |
||||
body, |
||||
#app, |
||||
.wrapper { |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
|
||||
body { |
||||
font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif; |
||||
font-size: 14px; |
||||
} |
||||
|
||||
a { |
||||
text-decoration: none |
||||
} |
||||
i{ |
||||
font-style: normal; |
||||
} |
||||
li { |
||||
list-style-type:none; |
||||
} |
||||
|
||||
|
||||
.content-box { |
||||
min-height: calc(100vh); |
||||
padding-bottom: 30px; |
||||
-webkit-transition: left .3s ease-in-out; |
||||
transition: left .3s ease-in-out; |
||||
background: #f0f0f0; |
||||
} |
||||
|
||||
.content { |
||||
width: auto; |
||||
height: 100%; |
||||
padding: 20px; |
||||
box-sizing: border-box; |
||||
} |
||||
|
||||
.content-collapse { |
||||
left: 65px; |
||||
} |
||||
|
||||
.container { |
||||
padding: 30px; |
||||
background: #fff; |
||||
border: 1px solid #ddd; |
||||
border-radius: 5px; |
||||
} |
||||
|
||||
.crumbs { |
||||
margin: 10px 0; |
||||
} |
||||
|
||||
.el-table th { |
||||
background-color: #f5f7fa !important; |
||||
} |
||||
|
||||
.pagination { |
||||
margin: 20px 0; |
||||
text-align: right; |
||||
} |
||||
|
||||
.plugins-tips { |
||||
padding: 20px 10px; |
||||
margin-bottom: 20px; |
||||
} |
||||
|
||||
.el-button+.el-tooltip { |
||||
margin-left: 10px; |
||||
} |
||||
|
||||
.el-table tr:hover { |
||||
background: #f6faff; |
||||
} |
||||
|
||||
.orderTable td .el-input{ |
||||
width: 60%; |
||||
} |
||||
|
||||
.orderTable .el-select>.el-input{ |
||||
display: inline-block; |
||||
} |
||||
|
||||
.mgb20 { |
||||
margin-bottom: 20px; |
||||
} |
||||
|
||||
.move-enter-active, |
||||
.move-leave-active { |
||||
transition: opacity .5s; |
||||
} |
||||
|
||||
.move-enter, |
||||
.move-leave { |
||||
opacity: 0; |
||||
} |
||||
|
||||
/*BaseForm*/ |
||||
|
||||
.form-box { |
||||
width: 600px; |
||||
} |
||||
|
||||
.form-box .line { |
||||
text-align: center; |
||||
} |
||||
|
||||
.el-time-panel__content::after, |
||||
.el-time-panel__content::before { |
||||
margin-top: -7px; |
||||
} |
||||
|
||||
.el-time-spinner__wrapper .el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default) { |
||||
padding-bottom: 0; |
||||
} |
||||
|
||||
/*Upload*/ |
||||
|
||||
.pure-button { |
||||
width: 150px; |
||||
height: 40px; |
||||
line-height: 40px; |
||||
text-align: center; |
||||
color: #fff; |
||||
border-radius: 3px; |
||||
} |
||||
|
||||
.g-core-image-corp-container .info-aside { |
||||
height: 45px; |
||||
} |
||||
|
||||
.avatar-uploader .el-upload--text { |
||||
background-color: #fff; |
||||
border: 1px dashed #d9d9d9; |
||||
border-radius: 6px; |
||||
box-sizing: border-box; |
||||
width: 360px; |
||||
height: 180px; |
||||
text-align: center; |
||||
cursor: pointer; |
||||
position: relative; |
||||
overflow: hidden; |
||||
} |
||||
|
||||
.avatar-uploader .el-upload--text .el-icon-upload { |
||||
font-size: 67px; |
||||
color: #97a8be; |
||||
margin: 40px 0 16px; |
||||
line-height: 50px; |
||||
} |
||||
|
||||
.avatar-uploader .el-upload--text { |
||||
color: #97a8be; |
||||
font-size: 14px; |
||||
text-align: center; |
||||
} |
||||
|
||||
.avatar-uploader .el-upload--text em { |
||||
font-style: normal; |
||||
} |
||||
|
||||
/* .link_upload .el-upload-list{ |
||||
width: 30%; |
||||
} */ |
||||
|
||||
/*VueEditor*/ |
||||
|
||||
.ql-container { |
||||
min-height: 400px; |
||||
} |
||||
|
||||
.ql-snow .ql-tooltip { |
||||
transform: translateX(117.5px) translateY(10px) !important; |
||||
} |
||||
|
||||
.editor-btn { |
||||
margin-top: 20px; |
||||
} |
||||
|
||||
/*markdown*/ |
||||
|
||||
.v-note-wrapper .v-note-panel { |
||||
min-height: 500px; |
||||
} |
||||
|
||||
.ms-login .el-tabs__nav-wrap::after{ |
||||
background-color: #fff; |
||||
opacity: 0; |
||||
} |
||||
.ms-login .el-tabs__item{ |
||||
padding: 0 90px; |
||||
color: #999; |
||||
} |
||||
.ms-login .el-tabs__item:hover{ |
||||
color: #000; |
||||
} |
||||
.ms-login .el-tabs__item.is-active{ |
||||
color: #333; |
||||
font-weight: bold; |
||||
} |
||||
.ms-login .el-tabs__active-bar{ |
||||
background-color: #000; |
||||
border-radius:2px; |
||||
} |
||||
.ms-login .el-tabs__nav-scroll{ |
||||
display: flex; |
||||
justify-content: center; |
||||
} |
||||
|
||||
.ms-login .el-input__inner{ |
||||
height: 80px; |
||||
line-height: 80px; |
||||
border:1px solid rgba(220,220,220,1); |
||||
border-radius:2px; |
||||
} |
||||
|
||||
.el-row { |
||||
margin-bottom: 20px; |
||||
} |
||||
|
||||
.mgb20 { |
||||
margin-bottom: 20px; |
||||
} |
||||
|
||||
#app .el-table thead{ |
||||
color: #fff; |
||||
} |
||||
#app .el-table th{ |
||||
background-color: #9278FF!important; |
||||
font-size: 16px; |
||||
font-weight: normal; |
||||
} |
||||
#app .el-select{ |
||||
display: unset; |
||||
} |
||||
|
||||
/*flex*/ |
||||
.flex-center{ |
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
.flex-between{ |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: space-between; |
||||
} |
||||
.flex-around{ |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: space-around; |
||||
} |
||||
.flex-start-around{ |
||||
display: flex; |
||||
align-items: flex-start; |
||||
justify-content: center; |
||||
} |
||||
.flex-end-around{ |
||||
display: flex; |
||||
align-items: flex-end; |
||||
justify-content: center; |
||||
} |
||||
.flex-column{ |
||||
display: flex; |
||||
align-items: center; |
||||
flex-direction: column; |
||||
} |
||||
.flex-start{ |
||||
display: flex; |
||||
align-items: flex-start; |
||||
} |
||||
.flex-end{ |
||||
display: flex; |
||||
align-items: flex-end; |
||||
} |
||||
|
||||
.hr_tag{ |
||||
background-color: #9278FF; |
||||
width: 3px; |
||||
height: 15px; |
||||
margin-right: 5px; |
||||
} |
||||
|
||||
.user_header{ |
||||
padding: 20px 0; |
||||
border-bottom: 1px dashed #eee; |
||||
} |
||||
.addhr_tag{ |
||||
background-color: #666; |
||||
width: 6px; |
||||
height: 17px; |
||||
margin-right: 5px; |
||||
} |
||||
|
||||
.per_title span{ |
||||
font-size: 16px; |
||||
font-weight: bold; |
||||
} |
||||
.per_back{ |
||||
margin-left: 5px; |
||||
} |
||||
.per_school{ |
||||
margin-left: 30px; |
||||
} |
||||
.per_title:hover{ |
||||
cursor:pointer; |
||||
} |
||||
|
||||
/* 溢出省略号 */ |
||||
.ellipsis{ |
||||
overflow: hidden; |
||||
text-overflow: ellipsis; |
||||
white-space: nowrap; |
||||
} |
||||
|
||||
.userRadio .el-radio{ |
||||
margin-right: 10px!important; |
||||
} |
||||
.userRadio .el-radio__input{ |
||||
display: none!important; |
||||
} |
@ -1,29 +0,0 @@ |
||||
.header{ |
||||
background-color: #fff; |
||||
} |
||||
.login-wrap{ |
||||
background: rgba(56, 157, 170, 0.82);; |
||||
} |
||||
.plugins-tips{ |
||||
background: #f2f2f2; |
||||
} |
||||
.plugins-tips a{ |
||||
color: #00d1b2; |
||||
} |
||||
.el-upload--text em { |
||||
color: #00d1b2; |
||||
} |
||||
.pure-button{ |
||||
background: #00d1b2; |
||||
} |
||||
.pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus { |
||||
background-color: #00d1b2 !important; |
||||
border-color: #00d1b2 !important; |
||||
} |
||||
.tags-li.active { |
||||
border: 1px solid #9278FF; |
||||
background-color: #9278FF; |
||||
} |
||||
.collapse-btn:hover{ |
||||
background: #00d1b2; |
||||
} |
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -1,105 +0,0 @@ |
||||
<template> |
||||
<div class="header flex-between"> |
||||
<img class="logo hh" v-if="$config.isHh" src="../../assets/img/logo-hh.png" /> |
||||
<img class="logo" v-else src="../../assets/img/logo.png" /> |
||||
<div class="header-right"> |
||||
<div class="header-user-con"> |
||||
<div class="user" @click="toPersonalCenter"> |
||||
<el-avatar :size="40" :src="avatar"></el-avatar> |
||||
<span class="user-avator">{{userName}}</span> |
||||
</div> |
||||
<el-divider class="ml20" direction="vertical"></el-divider> |
||||
<el-button type="text" class="ml20" @click="loginout">退出</el-button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import bus from '../common/bus' |
||||
export default { |
||||
data() { |
||||
return { |
||||
collapse: false, |
||||
fullscreen: false, |
||||
name: 'huoran', |
||||
message: 2, |
||||
avatar: this.$store.state.avatar, |
||||
userName: this.$store.state.userName |
||||
}; |
||||
}, |
||||
mounted(){ |
||||
bus.$on('updateAvatar',avatar => { |
||||
this.avatar = avatar |
||||
}) |
||||
bus.$on('updateAccount',userName => { |
||||
this.userName = userName |
||||
}) |
||||
}, |
||||
methods: { |
||||
toPersonalCenter(){ |
||||
this.$router.push('/personalcenter') |
||||
}, |
||||
loginout() { |
||||
sessionStorage.removeItem('sta_server_username'); |
||||
this.$store.commit("addProjectSystemIdData",{systemId : this.$config.systemId}) |
||||
this.$store.replaceState({}) |
||||
location.reload() |
||||
} |
||||
}, |
||||
}; |
||||
</script> |
||||
<style scoped lang="scss"> |
||||
.header { |
||||
position: relative; |
||||
box-sizing: border-box; |
||||
width: 100%; |
||||
height: 60px; |
||||
font-size: 16px; |
||||
color: #333; |
||||
} |
||||
.header .logo { |
||||
float: left; |
||||
width: 150px; |
||||
margin-left: 20px; |
||||
&.hh{ |
||||
width: 220px; |
||||
} |
||||
} |
||||
.header-right { |
||||
float: right; |
||||
padding-right: 50px; |
||||
} |
||||
.header-user-con { |
||||
display: flex; |
||||
height: 70px; |
||||
align-items: center; |
||||
|
||||
.user{ |
||||
display: inline-flex; |
||||
align-items: center; |
||||
cursor: pointer; |
||||
} |
||||
} |
||||
.user-avator { |
||||
margin-left: 10px; |
||||
} |
||||
.ml20{ |
||||
margin-left: 20px; |
||||
} |
||||
.user-avator img { |
||||
display: block; |
||||
width: 40px; |
||||
height: 40px; |
||||
border-radius: 50%; |
||||
} |
||||
.header-right .el-button--text{ |
||||
color: #333; |
||||
} |
||||
.header-right .el-divider--vertical{ |
||||
width: 2px; |
||||
height: 15px; |
||||
} |
||||
.header-right .el-divider{ |
||||
background-color: #333; |
||||
} |
||||
</style> |
@ -1,72 +0,0 @@ |
||||
<template> |
||||
<div class="wrapper"> |
||||
<div class="placeholder"></div> |
||||
<div class="fixed"> |
||||
<v-head></v-head> |
||||
<v-sidebar></v-sidebar> |
||||
</div> |
||||
<div class="content-box" :class="{'content-collapse':collapse}"> |
||||
<!-- <v-tags></v-tags> --> |
||||
<div class="content"> |
||||
<transition name="move" mode="out-in"> |
||||
<keep-alive :include="tagsList"> |
||||
<router-view></router-view> |
||||
</keep-alive> |
||||
</transition> |
||||
<el-backtop target=".content"></el-backtop> |
||||
</div> |
||||
</div> |
||||
<v-footer ref="footer"></v-footer> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import vHead from './Header.vue'; |
||||
import vSidebar from './Sidebar.vue'; |
||||
import vFooter from './Footer' |
||||
import vTags from './Tags.vue'; |
||||
import bus from './bus'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
tagsList: [], |
||||
collapse: false |
||||
}; |
||||
}, |
||||
components: { |
||||
vHead, |
||||
vSidebar, |
||||
vFooter, |
||||
vTags |
||||
}, |
||||
created() { |
||||
bus.$on('collapse-content', msg => { |
||||
this.collapse = msg; |
||||
}); |
||||
|
||||
// 只有在标签页列表里的页面才使用keep-alive,即关闭标签之后就不保存到内存中了。 |
||||
bus.$on('tags', msg => { |
||||
let arr = []; |
||||
for (let i = 0, len = msg.length; i < len; i++) { |
||||
msg[i].name && arr.push(msg[i].name); |
||||
} |
||||
this.tagsList = arr; |
||||
}); |
||||
} |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
.fixed{ |
||||
z-index: 10; |
||||
position: fixed; |
||||
top: 0; |
||||
width: 100%; |
||||
background-color: #fff; |
||||
} |
||||
.placeholder{ |
||||
height: 120px; |
||||
&.mini{ |
||||
height: 60px; |
||||
} |
||||
} |
||||
</style> |
@ -1,186 +0,0 @@ |
||||
<template> |
||||
<div class="tags" v-if="showTags"> |
||||
<ul> |
||||
<li class="tags-li" v-for="(item,index) in tagsList" :class="{'active': isActive(item.path)}" :key="index"> |
||||
<router-link :to="item.path" class="tags-li-title"> |
||||
{{item.title}} |
||||
</router-link> |
||||
<span class="tags-li-icon" @click="closeTags(index)"><i class="el-icon-close"></i></span> |
||||
</li> |
||||
</ul> |
||||
<div class="tags-close-box"> |
||||
<el-dropdown @command="handleTags"> |
||||
<el-button size="mini" type="primary"> |
||||
标签选项<i class="el-icon-arrow-down el-icon--right"></i> |
||||
</el-button> |
||||
<el-dropdown-menu size="small" slot="dropdown"> |
||||
<el-dropdown-item command="other">关闭其他</el-dropdown-item> |
||||
<el-dropdown-item command="all">关闭所有</el-dropdown-item> |
||||
</el-dropdown-menu> |
||||
</el-dropdown> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import bus from './bus'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
tagsList: [] |
||||
} |
||||
}, |
||||
methods: { |
||||
isActive(path) { |
||||
return path === this.$route.fullPath; |
||||
}, |
||||
// 关闭单个标签 |
||||
closeTags(index) { |
||||
const delItem = this.tagsList.splice(index, 1)[0]; |
||||
const item = this.tagsList[index] ? this.tagsList[index] : this.tagsList[index - 1]; |
||||
if (item) { |
||||
delItem.path === this.$route.fullPath && this.$router.push(item.path); |
||||
}else{ |
||||
this.$router.push('/dashboard'); |
||||
} |
||||
}, |
||||
// 关闭全部标签 |
||||
closeAll(){ |
||||
this.tagsList = []; |
||||
this.$router.push('/dashboard'); |
||||
}, |
||||
// 关闭其他标签 |
||||
closeOther(){ |
||||
const curItem = this.tagsList.filter(item => { |
||||
return item.path === this.$route.fullPath; |
||||
}) |
||||
this.tagsList = curItem; |
||||
}, |
||||
// 设置标签 |
||||
setTags(route){ |
||||
const isExist = this.tagsList.some(item => { |
||||
return item.path === route.fullPath; |
||||
}) |
||||
if(!isExist){ |
||||
if(this.tagsList.length >= 8){ |
||||
this.tagsList.shift(); |
||||
} |
||||
this.tagsList.push({ |
||||
title: route.meta.title, |
||||
path: route.fullPath, |
||||
name: route.matched[1].components.default.name |
||||
}) |
||||
} |
||||
bus.$emit('tags', this.tagsList); |
||||
}, |
||||
handleTags(command){ |
||||
command === 'other' ? this.closeOther() : this.closeAll(); |
||||
} |
||||
}, |
||||
computed: { |
||||
showTags() { |
||||
return this.tagsList.length > 0; |
||||
} |
||||
}, |
||||
watch:{ |
||||
$route(newValue, oldValue){ |
||||
this.setTags(newValue); |
||||
} |
||||
}, |
||||
created(){ |
||||
this.setTags(this.$route); |
||||
// 监听关闭当前页面的标签页 |
||||
bus.$on('close_current_tags', () => { |
||||
for (let i = 0, len = this.tagsList.length; i < len; i++) { |
||||
const item = this.tagsList[i]; |
||||
if(item.path === this.$route.fullPath){ |
||||
if(i < len - 1){ |
||||
this.$router.push(this.tagsList[i+1].path); |
||||
}else if(i > 0){ |
||||
this.$router.push(this.tagsList[i-1].path); |
||||
}else{ |
||||
this.$router.push('/'); |
||||
} |
||||
this.tagsList.splice(i, 1); |
||||
break; |
||||
} |
||||
} |
||||
}) |
||||
} |
||||
} |
||||
|
||||
</script> |
||||
|
||||
|
||||
<style> |
||||
.tags { |
||||
position: relative; |
||||
height: 30px; |
||||
overflow: hidden; |
||||
background: #fff; |
||||
padding-right: 120px; |
||||
box-shadow: 0 5px 10px #ddd; |
||||
} |
||||
|
||||
.tags ul { |
||||
box-sizing: border-box; |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
|
||||
.tags-li { |
||||
float: left; |
||||
margin: 3px 5px 2px 3px; |
||||
border-radius: 3px; |
||||
font-size: 12px; |
||||
overflow: hidden; |
||||
cursor: pointer; |
||||
height: 23px; |
||||
line-height: 23px; |
||||
border: 1px solid #e9eaec; |
||||
background: #fff; |
||||
padding: 0 5px 0 12px; |
||||
vertical-align: middle; |
||||
color: #666; |
||||
-webkit-transition: all .3s ease-in; |
||||
-moz-transition: all .3s ease-in; |
||||
transition: all .3s ease-in; |
||||
} |
||||
|
||||
.tags-li:not(.active):hover { |
||||
background: #f8f8f8; |
||||
} |
||||
|
||||
.tags-li.active { |
||||
color: #fff; |
||||
} |
||||
|
||||
.tags-li-title { |
||||
float: left; |
||||
max-width: 80px; |
||||
overflow: hidden; |
||||
white-space: nowrap; |
||||
text-overflow: ellipsis; |
||||
margin-right: 5px; |
||||
color: #666; |
||||
} |
||||
|
||||
.tags-li.active .tags-li-title { |
||||
color: #fff; |
||||
} |
||||
|
||||
.tags-close-box { |
||||
position: absolute; |
||||
right: 0; |
||||
top: 0; |
||||
box-sizing: border-box; |
||||
padding-top: 1px; |
||||
text-align: center; |
||||
width: 110px; |
||||
height: 30px; |
||||
background: #fff; |
||||
box-shadow: -3px 0 15px 3px rgba(0, 0, 0, .1); |
||||
z-index: 10; |
||||
} |
||||
|
||||
</style> |
@ -1,80 +0,0 @@ |
||||
import Vue from 'vue'; |
||||
|
||||
// v-dialogDrag: 弹窗拖拽属性
|
||||
Vue.directive('dialogDrag', { |
||||
bind(el, binding, vnode, oldVnode) { |
||||
const dialogHeaderEl = el.querySelector('.el-dialog__header'); |
||||
const dragDom = el.querySelector('.el-dialog'); |
||||
|
||||
dialogHeaderEl.style.cssText += ';cursor:move;' |
||||
dragDom.style.cssText += ';top:0px;' |
||||
|
||||
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
|
||||
const sty = (() => { |
||||
if (window.document.currentStyle) { |
||||
return (dom, attr) => dom.currentStyle[attr]; |
||||
} else { |
||||
return (dom, attr) => getComputedStyle(dom, false)[attr]; |
||||
} |
||||
})() |
||||
|
||||
dialogHeaderEl.onmousedown = (e) => { |
||||
// 鼠标按下,计算当前元素距离可视区的距离
|
||||
const disX = e.clientX - dialogHeaderEl.offsetLeft; |
||||
const disY = e.clientY - dialogHeaderEl.offsetTop; |
||||
|
||||
const screenWidth = document.body.clientWidth; // body当前宽度
|
||||
const screenHeight = document.documentElement.clientHeight; // 可见区域高度(应为body高度,可某些环境下无法获取)
|
||||
|
||||
const dragDomWidth = dragDom.offsetWidth; // 对话框宽度
|
||||
const dragDomheight = dragDom.offsetHeight; // 对话框高度
|
||||
|
||||
const minDragDomLeft = dragDom.offsetLeft; |
||||
const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth; |
||||
|
||||
const minDragDomTop = dragDom.offsetTop; |
||||
const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight; |
||||
|
||||
|
||||
// 获取到的值带px 正则匹配替换
|
||||
let styL = sty(dragDom, 'left'); |
||||
let styT = sty(dragDom, 'top'); |
||||
|
||||
// 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
|
||||
if (styL.includes('%')) { |
||||
styL = +document.body.clientWidth * (+styL.replace(/\%/g, '') / 100); |
||||
styT = +document.body.clientHeight * (+styT.replace(/\%/g, '') / 100); |
||||
} else { |
||||
styL = +styL.replace(/\px/g, ''); |
||||
styT = +styT.replace(/\px/g, ''); |
||||
}; |
||||
|
||||
document.onmousemove = function (e) { |
||||
// 通过事件委托,计算移动的距离
|
||||
let left = e.clientX - disX; |
||||
let top = e.clientY - disY; |
||||
|
||||
// 边界处理
|
||||
if (-(left) > minDragDomLeft) { |
||||
left = -(minDragDomLeft); |
||||
} else if (left > maxDragDomLeft) { |
||||
left = maxDragDomLeft; |
||||
} |
||||
|
||||
if (-(top) > minDragDomTop) { |
||||
top = -(minDragDomTop); |
||||
} else if (top > maxDragDomTop) { |
||||
top = maxDragDomTop; |
||||
} |
||||
|
||||
// 移动当前元素
|
||||
dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`; |
||||
}; |
||||
|
||||
document.onmouseup = function (e) { |
||||
document.onmousemove = null; |
||||
document.onmouseup = null; |
||||
}; |
||||
} |
||||
} |
||||
}) |
@ -1,338 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between"> |
||||
<div class="per_title" v-preventReClick @click="goback()"> |
||||
<i class="el-icon-arrow-left"></i> |
||||
<span class="per_back">返回</span> |
||||
<span class="per_school">查看报告</span> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<div> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<h6 style="text-align: center;font-size: 20px">标准实验报告</h6> |
||||
<div class="flex-center mgb20 user_header"> |
||||
<p class="addhr_tag"></p> |
||||
<span>基本信息</span> |
||||
</div> |
||||
|
||||
<div> |
||||
<el-table :data="infoData" class="table" stripe header-align="center"> |
||||
<el-table-column prop="userName" label="学生姓名" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="workNumber" label="学生学号" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="experimentalClassName" label="学生班级" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="teacherName" label="指导老师" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="period" label="实验学时" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="laboratory" label="实验室名称" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="startTime" label="实验时间" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="score" label="实验成绩" align="center"> |
||||
</el-table-column> |
||||
</el-table> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">一、实验项目名称</p> |
||||
</div> |
||||
<el-input v-model="form.projectName" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">二、实验目的</p> |
||||
<span>得分:50/60</span> |
||||
</div> |
||||
<el-input v-model="form.experimentGoal" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">三、实验原理</p> |
||||
<span>得分:50/60</span> |
||||
</div> |
||||
<el-input v-model="form.principle" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">四、实验内容</p> |
||||
<span>得分:50/60</span> |
||||
</div> |
||||
<el-input v-model="form.content" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">五、实验步骤</p> |
||||
<span>得分:50/60</span> |
||||
</div> |
||||
<el-input v-model="form.step" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">六、实验数据</p> |
||||
<span>得分:50/60</span> |
||||
</div> |
||||
<el-table :data="expData" class="table" stripe header-align="center"> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.$index + 1}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="module" label="模块" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="judgmentPointsName" label="考核点" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="userAnswer" label="学生答案" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="answer" label="参考答案" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="codeScore" label="得分" align="center"> |
||||
</el-table-column> |
||||
</el-table> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">七、实验结论</p> |
||||
<span>得分:50/60</span> |
||||
</div> |
||||
<el-input type="textarea" v-model="form.conclusion" rows="5" disabled></el-input> |
||||
<div class="flex-between" style="margin-top: 10px"> |
||||
<span>教师评分</span> |
||||
<div> |
||||
<el-input style="display: inline-block;width: auto;" placeholder="请输入"></el-input> (10分) |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">八、总结及心得体会</p> |
||||
<span>得分:50/60</span> |
||||
</div> |
||||
<el-input type="textarea" v-model="form.summarize" rows="5" disabled></el-input> |
||||
<div class="flex-between" style="margin-top: 10px"> |
||||
<span>教师评分</span> |
||||
<div> |
||||
<el-input style="display: inline-block;width: auto;" placeholder="请输入"></el-input> (10分) |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">九、对本实验过程及方法、手段的改进建议</p> |
||||
<span>得分:50/60</span> |
||||
</div> |
||||
<el-input type="textarea" rows="5" v-model="form.improvement" disabled></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between mgb20"> |
||||
<span>老师评语</span> |
||||
</div> |
||||
<el-input type="textarea" rows="5" v-model="form.comment" disabled></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<p class="mgb20">教师签名</p> |
||||
<!-- <img src="" alt=""> --> |
||||
</el-card> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
data (){ |
||||
return { |
||||
title: '实验报告', |
||||
userId: this.$store.state.userId, |
||||
studentId: this.$store.state.studentId, |
||||
form: { |
||||
analysis: '', |
||||
conclusion: '', |
||||
content: '', |
||||
data: '', |
||||
experimentGoal: '', |
||||
experimentId: '', |
||||
experimentalClassName: '', |
||||
improvement: '', |
||||
laboratory: '', |
||||
period: '', |
||||
principle: '', |
||||
projectName: '', |
||||
score: 0, |
||||
step: '', |
||||
submitTime: '', |
||||
summarize: '', |
||||
teacherName: '', |
||||
userId: this.userId, |
||||
userName: '', |
||||
workNumber: '', |
||||
}, |
||||
type: this.$route.query.type, |
||||
id: this.$route.query.id, |
||||
recordId: this.$route.query.recordId, |
||||
reportId: this.$route.query.reportId, |
||||
infoData: [], |
||||
expData: [], |
||||
accountData: [], |
||||
showData: '1', |
||||
autograph: '1', |
||||
pages: 1, |
||||
ipVisible: false, |
||||
fileList: [{name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}, {name: 'food2.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}], |
||||
} |
||||
}, |
||||
mounted(){ |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
getData(){ |
||||
if(this.type){ |
||||
let data = { |
||||
recordId: this.id, |
||||
} |
||||
this.$get(this.api.queryVirtualReport,data).then(res => { |
||||
this.form = res.data.report |
||||
this.expData = res.data.data |
||||
let form = this.form |
||||
this.infoData.push({ |
||||
workNumber: form.workNumber, |
||||
experimentalClassName: form.experimentalClassName, |
||||
teacherName: form.teacherName, |
||||
period: form.period, |
||||
laboratory: form.laboratory, |
||||
startTime: form.submitTime, |
||||
score: form.score, |
||||
userName: form.userName |
||||
}) |
||||
}).catch(res => {}); |
||||
}else{ |
||||
let data = { |
||||
studentId: this.studentId, |
||||
projectId: this.id, |
||||
recordId: this.recordId, |
||||
reportId: this.reportId |
||||
} |
||||
this.$get(this.api.queryArchievement,data).then(res => { |
||||
this.form = res.data.report |
||||
this.expData = res.data.data |
||||
let form = this.form |
||||
this.infoData.push({ |
||||
workNumber: form.workNumber, |
||||
experimentalClassName: form.experimentalClassName, |
||||
teacherName: form.teacherName, |
||||
period: form.period, |
||||
laboratory: form.laboratory, |
||||
startTime: form.submitTime, |
||||
score: form.score, |
||||
userName: form.userName |
||||
}) |
||||
}).catch(res => {}); |
||||
} |
||||
}, |
||||
handleRemove(file, fileList) { |
||||
console.log(file, fileList); |
||||
}, |
||||
handlePreview(file) { |
||||
console.log(file); |
||||
}, |
||||
saveAdd(){ |
||||
let data = { |
||||
systemId: this.configId, |
||||
systemName: this.form.systemName, |
||||
systemType: this.form.systemType, |
||||
systemAttribution: this.form.systemAttribution, |
||||
} |
||||
if(this.configId){ |
||||
this.$post(this.api.updateServiceConfig,data).then((res) => { |
||||
this.$message.success('编辑成功'); |
||||
this.goback() |
||||
}).catch((res) => { |
||||
}) |
||||
}else{ |
||||
this.$post(this.api.updateServiceConfig,data).then((res) => { |
||||
this.$message.success('添加成功'); |
||||
this.goback() |
||||
}).catch((res) => { |
||||
}) |
||||
} |
||||
}, |
||||
handleRemove(file, fileList) { |
||||
console.log(file, fileList); |
||||
}, |
||||
handlePictureCardPreview(file) { |
||||
this.dialogImageUrl = file.url; |
||||
this.dialogVisible = true; |
||||
}, |
||||
SpanMethod({ row, column, rowIndex, columnIndex }) { |
||||
if (rowIndex % 2 === 0) { |
||||
if (columnIndex === 6) { |
||||
if(!row.Intranet){ |
||||
return [1, 2]; |
||||
} |
||||
} |
||||
// else if (columnIndex === 1) { |
||||
// return [0, 0]; |
||||
// } |
||||
} |
||||
}, |
||||
goback(){ |
||||
this.$router.go(-1) |
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
/deep/.el-row{ |
||||
padding-top: 20px; |
||||
margin: 0 !important; |
||||
} |
||||
.form-item{ |
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
.form-item .el-input{ |
||||
width: auto; |
||||
} |
||||
.form-item span{ |
||||
margin-right: 10px; |
||||
} |
||||
.meta-title-wrap{ |
||||
display: flex; |
||||
justify-content: space-between; |
||||
} |
||||
.flex-between{ |
||||
span{ |
||||
font-size: 13px; |
||||
} |
||||
} |
||||
.meta-title{ |
||||
margin-bottom: 10px; |
||||
font-size: 14px; |
||||
} |
||||
.step-title{ |
||||
margin-bottom: 10px; |
||||
font-size: 16px; |
||||
color: #9278ff; |
||||
} |
||||
.bd-title{ |
||||
padding-top: 20px; |
||||
border-top: 1px dashed #ccc; |
||||
} |
||||
</style> |
@ -1,391 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-row :gutter="20"> |
||||
<el-col :span="24"> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between"> |
||||
<div class="per_title" v-preventReClick @click="goback()"> |
||||
<i class="el-icon-arrow-left"></i> |
||||
<span class="per_back">返回</span> |
||||
<span class="per_school">修改分数</span> |
||||
</div> |
||||
<div> |
||||
<el-button type="success" size="small" round class="mag" v-preventReClick @click="saveAdd('form')">预览</el-button> |
||||
<el-button type="primary" size="small" round class="mag" v-preventReClick @click="saveAdd('form')">发布成绩</el-button> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<h6 style="text-align: center;font-size: 20px">实验成绩报告</h6> |
||||
<div class="flex-center mgb20 user_header"> |
||||
<p class="addhr_tag"></p> |
||||
<span>基本信息</span> |
||||
</div> |
||||
|
||||
<div> |
||||
<el-table :data="infoData" class="table" stripe header-align="center"> |
||||
<el-table-column prop="projectName" label="实验名称" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="period" label="实验学时" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="userName" label="学生姓名" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="number" label="学生学号" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="class" label="学生班级" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="content" label="实验内容" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="desc" label="实验数据与结果分析" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="result" label="实验结论" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="experience" label="实验与心得体会" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="total" label="总分" align="center"> |
||||
</el-table-column> |
||||
</el-table> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">实验项目名称</p> |
||||
</div> |
||||
<el-input v-model="form.projectName" type="textarea" rows="5"></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">实验目的</p> |
||||
</div> |
||||
<el-input v-model="form.experimentGoal" type="textarea" rows="5"></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">实验原理</p> |
||||
</div> |
||||
<el-input v-model="form.principle" type="textarea" rows="5"></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">实验内容</p> |
||||
</div> |
||||
<el-input v-model="form.content" type="textarea" rows="5"></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">实验器材(设备、元器件)</p> |
||||
</div> |
||||
<el-input v-model="form.step" type="textarea" rows="5"></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">实验步骤</p> |
||||
</div> |
||||
<el-input v-model="form.step" type="textarea" rows="5"></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">实验数据</p> |
||||
<span>得分:50/60</span> |
||||
</div> |
||||
<el-table :data="expData" class="table" stripe header-align="center"> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.$index + 1}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="module" label="模块" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="judgmentPointsName" label="考核点" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="userAnswer" label="学生答案" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="answer" label="参考答案" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="codeScore" label="得分" align="center"> |
||||
</el-table-column> |
||||
</el-table> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">实验数据及结果分析</p> |
||||
</div> |
||||
<el-table :data="expData" class="table" stripe header-align="center"> |
||||
<el-table-column prop="module" label="期权平仓方式" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="judgmentPointsName" label="期权合约" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="userAnswer" label="期权合约持仓时间段" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="answer" label="期权交易方向" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="codeScore" label="委托数量" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="codeScore" label="委托价格" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="codeScore" label="期货合约" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="codeScore" label="合约持仓时间段" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="codeScore" label="交易方向" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="codeScore" label="期权/期货合约盈亏" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="codeScore" label="现货盈亏" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="codeScore" label="手续费" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="codeScore" label="总盈亏" align="center"> |
||||
</el-table-column> |
||||
</el-table> |
||||
<el-input style="margin-top: 20px" v-model="form.projectName" type="textarea" rows="5"></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">实验结论</p> |
||||
</div> |
||||
<el-input type="textarea" v-model="form.conclusion" rows="5"></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">总结及心得体会</p> |
||||
</div> |
||||
<el-input type="textarea" v-model="form.summarize" rows="5"></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">对本实验过程及方法、手段的改进建议</p> |
||||
</div> |
||||
<el-input type="textarea" rows="5" v-model="form.improvement"></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between mgb20"> |
||||
<span>老师寄语</span> |
||||
</div> |
||||
<el-input type="textarea" rows="5"></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<p class="mgb20">教师签名</p> |
||||
<div class="mgb20"> |
||||
<el-radio v-model="autograph" label="1">不使用</el-radio> |
||||
<el-radio v-model="autograph" label="2">已有签名</el-radio> |
||||
<el-radio v-model="autograph" label="3">重新上传</el-radio> |
||||
</div> |
||||
<el-row v-if="autograph != 1"> |
||||
<el-col :span="6"> |
||||
<el-select class="sign-select" v-model="signId" placeholder="请选择签名" size="mini" v-show="autograph == 2"> |
||||
<el-option |
||||
v-for="item in signList" |
||||
:key="item.id" |
||||
:label="item.signatureName" |
||||
:value="item.id" |
||||
> |
||||
</el-option> |
||||
</el-select> |
||||
<el-upload |
||||
:data="{userId: userId}" |
||||
:limit="1" |
||||
:action="api.uploadSignature" |
||||
list-type="picture-card" |
||||
:on-remove="handleRemove" |
||||
:on-exceed="handleExceed" |
||||
:on-success="uploadSuccess"> |
||||
<i class="el-icon-plus"></i> |
||||
</el-upload> |
||||
</el-col> |
||||
</el-row> |
||||
</el-card> |
||||
</el-col> |
||||
</el-row> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
data (){ |
||||
return { |
||||
userId: this.$store.state.userLoginId, |
||||
id: this.$route.query.id, |
||||
infoData: [], |
||||
accountData: [], |
||||
analysisContent: '', |
||||
showData: '1', |
||||
autograph: '1', |
||||
form: { |
||||
projectName: '', |
||||
period: '', |
||||
userName: '', |
||||
content: '', |
||||
conclusion: '', |
||||
score: '', |
||||
}, |
||||
pages: 1, |
||||
ipVisible: false, |
||||
configId : this.$store.state.configId, |
||||
keyword: '', |
||||
fileList: [{name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}], |
||||
isEdit: false, |
||||
signList: [], |
||||
signId: '' |
||||
} |
||||
}, |
||||
mounted(){ |
||||
this.getData() |
||||
this.getSgin() |
||||
}, |
||||
methods: { |
||||
getData(){ |
||||
let data = { |
||||
// reportId: this.id |
||||
reportId: 97 |
||||
} |
||||
this.$get(this.api.queryReport,data).then(res => { |
||||
this.form = res.data.report |
||||
this.form.score = res.data.record.score |
||||
let form = this.form |
||||
this.infoData.push({ |
||||
projectName: form.projectName, |
||||
period: form.period, |
||||
userName: form.userName, |
||||
content: form.content, |
||||
conclusion: form.conclusion, |
||||
score: form.score, |
||||
analysis: form.analysis |
||||
}) |
||||
}).catch(res => {}); |
||||
}, |
||||
getSgin(){ |
||||
let data = { |
||||
userId: this.userId |
||||
} |
||||
this.$get(this.api.querySignature,data).then(res => { |
||||
this.signList = res.data |
||||
}).catch(res => {}); |
||||
}, |
||||
handleRemove(file, fileList) { |
||||
console.log(file, fileList); |
||||
}, |
||||
saveAdd(){ |
||||
let data = { |
||||
systemId: this.configId, |
||||
systemName: this.form.systemName, |
||||
systemType: this.form.systemType, |
||||
systemAttribution: this.form.systemAttribution, |
||||
} |
||||
if(this.configId){ |
||||
this.$post(this.api.updateServiceConfig,data).then((res) => { |
||||
this.$message.success('编辑成功'); |
||||
this.$router.back() |
||||
}).catch((res) => { |
||||
}) |
||||
}else{ |
||||
this.$post(this.api.updateServiceConfig,data).then((res) => { |
||||
this.$message.success('添加成功'); |
||||
this.$router.back() |
||||
}).catch((res) => { |
||||
}) |
||||
} |
||||
}, |
||||
SpanMethod({ row, column, rowIndex, columnIndex }) { |
||||
if (rowIndex % 2 === 0) { |
||||
if (columnIndex === 6) { |
||||
if(!row.Intranet){ |
||||
return [1, 2]; |
||||
} |
||||
} |
||||
// else if (columnIndex === 1) { |
||||
// return [0, 0]; |
||||
// } |
||||
} |
||||
}, |
||||
editMsg(){ |
||||
this.isEdit = true |
||||
}, |
||||
handleExceed(files, fileList) { |
||||
this.$message.warning( |
||||
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
||||
); |
||||
}, |
||||
uploadSuccess(res,file){ |
||||
if(res.status == 200){ |
||||
this.$message.success('上传成功') |
||||
this.getSgin() |
||||
}else{ |
||||
this.$message.error(res.errmessage) |
||||
} |
||||
}, |
||||
goback() { |
||||
this.$confirm('确定返回?未更新的信息将不会保存。', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$router.back() |
||||
}) |
||||
.catch(() => {}); |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.meta-title{ |
||||
margin-bottom: 10px; |
||||
font-size: 20px; |
||||
} |
||||
.step-title{ |
||||
margin-bottom: 10px; |
||||
font-size: 16px; |
||||
color: #9278ff; |
||||
} |
||||
.border_lf{ |
||||
border-left: 1px dashed #eee; |
||||
padding: 0 60px; |
||||
} |
||||
.border_lf label{ |
||||
width: 120px; |
||||
} |
||||
.pad_none{ |
||||
padding: 0 0 0 60px; |
||||
} |
||||
.edit-msg{ |
||||
font-size: 16px; |
||||
cursor: pointer; |
||||
} |
||||
.sign-select{ |
||||
/deep/.el-input{ |
||||
width: 150px; |
||||
margin-bottom: 10px; |
||||
} |
||||
} |
||||
.meta-title-wrap{ |
||||
display: flex; |
||||
justify-content: space-between; |
||||
} |
||||
.meta-title{ |
||||
margin-bottom: 10px; |
||||
font-size: 14px; |
||||
} |
||||
.step-title{ |
||||
margin-bottom: 10px; |
||||
font-size: 16px; |
||||
color: #9278ff; |
||||
} |
||||
.bd-title{ |
||||
padding-top: 20px; |
||||
border-top: 1px dashed #ccc; |
||||
} |
||||
</style> |
File diff suppressed because it is too large
Load Diff
@ -1,232 +0,0 @@ |
||||
<template> |
||||
<div class="login-wrap"> |
||||
<div class="header"> |
||||
<img class="logo hh" v-if="$config.isHh" src="../../assets/img/logo-hh.png" /> |
||||
<img class="logo" v-else src="../../assets/img/logo.png" /> |
||||
</div> |
||||
|
||||
<div class="ms-login"> |
||||
<div class="ms-title"> |
||||
<el-tabs v-model="activeName" @tab-click="handleClick"> |
||||
<el-tab-pane label="账号登录" name="0"> |
||||
<el-form :model="param" :rules="rules" ref="param" label-width="0px" style="margin-top: 40px"> |
||||
<el-form-item prop="username"> |
||||
<el-input v-model="param.username" placeholder="请输入账号"></el-input> |
||||
</el-form-item> |
||||
<el-form-item prop="password"> |
||||
<el-input |
||||
type="password" |
||||
placeholder="请输入密码" |
||||
v-model="param.password" |
||||
@keyup.enter.native="submitForm('param')" |
||||
> |
||||
</el-input> |
||||
</el-form-item> |
||||
<!-- <el-button type="text" class="forget">忘记密码?</el-button> --> |
||||
<div class="login-btn"> |
||||
<el-button type="primary" @click="submitForm('param')">马上登录</el-button> |
||||
</div> |
||||
<!-- <p class="login-tips">使用第三方账号直接登录</p> |
||||
<p class="thirdParty"> |
||||
<i class="icon-weixin"></i> |
||||
<i class="icon-qq"></i> |
||||
</p> --> |
||||
</el-form> |
||||
</el-tab-pane> |
||||
|
||||
<el-tab-pane label="手机号/邮箱登录" name="1"> |
||||
<el-form :model="phoneParam" :rules="phoneRules" ref="phoneParam" label-width="0px" style="margin-top: 40px"> |
||||
<el-form-item prop="userphone"> |
||||
<el-input v-model="phoneParam.userphone" placeholder="请输入手机号/邮箱"></el-input> |
||||
</el-form-item> |
||||
<el-form-item prop="phonePassword"> |
||||
<el-input |
||||
type="password" |
||||
placeholder="请输入密码" |
||||
v-model="phoneParam.phonePassword" |
||||
@keyup.enter.native="submitForm('phoneParam')" |
||||
> |
||||
</el-input> |
||||
</el-form-item> |
||||
<!-- <el-button type="text" class="forget">忘记密码?</el-button> --> |
||||
<div class="login-btn"> |
||||
<el-button type="primary" @click="submitForm('phoneParam')">马上登录</el-button> |
||||
</div> |
||||
</el-form> |
||||
</el-tab-pane> |
||||
</el-tabs> |
||||
</div> |
||||
</div> |
||||
|
||||
<v-footer class="footer"></v-footer> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import addRoutes from '@/libs/route/addRoutes' |
||||
import vFooter from '../common/Footer' |
||||
export default { |
||||
data: function() { |
||||
return { |
||||
param: { |
||||
username: '', |
||||
password: '' |
||||
}, |
||||
rules: { |
||||
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }], |
||||
password: [{ required: true, message: '请输入密码', trigger: 'blur' }], |
||||
}, |
||||
phoneParam: { |
||||
userphone: '', |
||||
phonePassword: '' |
||||
}, |
||||
phoneRules: { |
||||
userphone: [{ required: true, message: '请输入手机号/邮箱', trigger: 'blur' }], |
||||
phonePassword: [{ required: true, message: '请输入密码', trigger: 'blur' }], |
||||
}, |
||||
activeName: '0' |
||||
}; |
||||
}, |
||||
components: { |
||||
vFooter, |
||||
}, |
||||
methods: { |
||||
submitForm(form) { |
||||
this.$refs[form].validate(valid => { |
||||
if (valid) { |
||||
let data = { |
||||
account: this.activeName == '0' ? this.param.username : this.phoneParam.userphone, |
||||
password: this.activeName == '0' ? this.param.password : this.phoneParam.phonePassword, |
||||
source: this.activeName |
||||
} |
||||
this.$get(this.api.logins,data).then(res => { |
||||
let data = res.message.retvalue |
||||
// if(data.roleId == 1 || data.roleId == 2 || data.roleId == 3){ |
||||
// this.$post(this.api.updateLogInNumber,{userId: data.userId}).then(res => {}).catch(res => {}); |
||||
res.message.listValue && this.$config.dynamicRoute && addRoutes(res.message.listValue) |
||||
this.$message.success('登录成功'); |
||||
sessionStorage.setItem('sta_server_username', this.activeName == '0' ? this.param.username : this.phoneParam.userphone); |
||||
this.$store.commit("userLoginData", { userLogin_id : data.userId,userRole_id: data.roleId,schoolId: data.schoolId,token: data.token,userName: data.userName}); |
||||
res.message.retvalue.userAvatars && this.$store.commit("userPhoto", { avatar : res.message.retvalue.userAvatars}) |
||||
this.$store.commit("dataTime", { dataTime : res.message.retvalue.dataTime}); |
||||
let redirect = decodeURIComponent(this.$route.query.redirect || '/dashboard') |
||||
this.$router.replace(redirect) |
||||
// }else{ |
||||
// this.$message.error('该用户没有权限'); |
||||
// } |
||||
}).catch(res => {}); |
||||
} else { |
||||
this.$message.error('请输入账号和密码'); |
||||
return false; |
||||
} |
||||
}); |
||||
}, |
||||
handleClick(tab, event) { |
||||
console.log(tab, event); |
||||
} |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.login-wrap { |
||||
position: relative; |
||||
width: 100%; |
||||
height: 100%; |
||||
background-image: url(../../assets/img/login-bg.png); |
||||
background-size: 100%; |
||||
} |
||||
.ms-title { |
||||
width: 548px; |
||||
position: absolute; |
||||
left: 50%; |
||||
top: 50px; |
||||
transform: translate(-50%,0); |
||||
} |
||||
.ms-login { |
||||
position: absolute; |
||||
left: 50%; |
||||
top: 42px; |
||||
transform: translate(-50%,0); |
||||
width: 1200px; |
||||
height: 82%; |
||||
/* height: 884px; */ |
||||
margin-top: 60px; |
||||
background-image: url(../../assets/img/login-input.png); |
||||
box-shadow:0px 0px 79px 0px rgba(11,15,65,0.36); |
||||
overflow: hidden; |
||||
} |
||||
.footer{ |
||||
position: absolute; |
||||
bottom: 0; |
||||
left: 0; |
||||
width: 100%; |
||||
} |
||||
.login-btn { |
||||
text-align: center; |
||||
} |
||||
.login-btn button { |
||||
width: 100%; |
||||
height: 88px; |
||||
margin-bottom: 50px; |
||||
font-weight: bold; |
||||
background:linear-gradient(90deg,rgba(94,206,253,1),rgba(91,67,231,1)); |
||||
box-shadow:0px 7px 27px 0px rgba(50,129,255,0.51); |
||||
border-radius:10px; |
||||
} |
||||
.login-tips { |
||||
text-align: center; |
||||
color: #999; |
||||
font-weight:bold; |
||||
} |
||||
.forget{ |
||||
width: 100%; |
||||
margin-bottom: 28px; |
||||
text-align: right; |
||||
color: #999; |
||||
font-weight:bold; |
||||
} |
||||
.thirdParty{ |
||||
width: 100%; |
||||
display: flex; |
||||
justify-content: center; |
||||
margin-top: 33px; |
||||
} |
||||
|
||||
/* 头部 */ |
||||
.header{ |
||||
width: 100%; |
||||
height: 60px; |
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
background-color: #fff; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
font-size: 18px; |
||||
} |
||||
.logo{ |
||||
width: 150px; |
||||
margin-left: 20px; |
||||
&.hh{ |
||||
width: 220px; |
||||
} |
||||
} |
||||
.header_title{ |
||||
width: 33%; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
} |
||||
.header_title a{ |
||||
cursor: pointer; |
||||
} |
||||
.header_title a:hover{ |
||||
color: blueviolet; |
||||
} |
||||
.nul{ |
||||
width:80px; |
||||
margin-right: 30px; |
||||
} |
||||
</style> |
@ -1,544 +0,0 @@ |
||||
<template> |
||||
<!-- 编程类 --> |
||||
<div> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="per_title" v-preventReClick @click="goback()"> |
||||
<i class="el-icon-arrow-left"></i> |
||||
<span class="per_back">返回</span> |
||||
<span class="per_school">查看判分点</span> |
||||
</div> |
||||
</el-card> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-center mgb20 user_header"> |
||||
<p class="addhr_tag"></p> |
||||
<span>基本信息</span> |
||||
</div> |
||||
|
||||
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="150px"> |
||||
<el-form-item label="请输入判分点名称" prop="judgmentPointsName"> |
||||
<el-input :disabled="true" v-model="ruleForm.judgmentPointsName"></el-input> |
||||
</el-form-item> |
||||
<el-form-item label="实验要求" prop="experimentalRequirements"> |
||||
<quill :border="true" :readonly="true" v-model="ruleForm.experimentalRequirements" :minHeight="150" :height="150" /> |
||||
</el-form-item> |
||||
</el-form> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-center mgb20 user_header"> |
||||
<p class="addhr_tag"></p> |
||||
<span>实验代码</span> |
||||
</div> |
||||
|
||||
<div class="footer_inputs1"> |
||||
<p style=" text-align: center;">参考答案</p> |
||||
<textarea id="memo1" :disabled="true" v-model="ruleForm.experimentcode" style="outline:none;"></textarea> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-center mgb20 user_header"> |
||||
<p class="addhr_tag"></p> |
||||
<span>判分规则</span> |
||||
</div> |
||||
|
||||
<el-table |
||||
:data="tableData" |
||||
:stripe="true" |
||||
:cell-style="rowClass" |
||||
:header-cell-style="headClass" |
||||
header-align="center" |
||||
ref="editTable" |
||||
> |
||||
<el-table-column |
||||
prop="decisionPointRule" |
||||
type="index" |
||||
label="序号" |
||||
align="center" |
||||
width="80" |
||||
></el-table-column> |
||||
<el-table-column label="编译器中正确答案" align="center"> |
||||
<template slot-scope="scope"> |
||||
<p class="p">字段一致性规则:用户编辑器中至少出现如下语句</p> |
||||
<el-input |
||||
type="textarea" |
||||
:rows="2" |
||||
v-model="scope.row.judgmentRulesRule" |
||||
:disabled="scope.row.isShow" |
||||
></el-input> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column align="center" width="150"> |
||||
<template slot-scope="scope"> |
||||
<el-button |
||||
type="primary" |
||||
:disabled="scope.row.isShow" |
||||
style="cursor:pointer;border-radius: 50%;" |
||||
circle |
||||
@click="getPerhaps(scope.row)" |
||||
>{{scope.row.perhaps==0?"且":"或"}}</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="终端中正确答案" align="center"> |
||||
<template slot-scope="scope"> |
||||
<p class="p">运行结果一致性规则:用户运行结果需要与下方代码运行结果一致</p> |
||||
<el-input |
||||
type="textarea" |
||||
:rows="2" |
||||
v-model="scope.row.judgmentRulesPoint" |
||||
:disabled="scope.row.isShow" |
||||
></el-input> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center" width="300"> |
||||
<template slot-scope="scope"> |
||||
<el-link |
||||
size="mini" |
||||
type="primary" |
||||
:underline="false" |
||||
:disabled="scope.row.isShow" |
||||
v-show="scope.row.isShow" |
||||
@click="getHandleEdit(scope.row)" |
||||
>编辑</el-link> |
||||
<el-link |
||||
type="primary" |
||||
size="mini" |
||||
:underline="false" |
||||
v-show="!scope.row.isShow" |
||||
@click="getRule(scope.row)" |
||||
>保存</el-link> |
||||
<el-link |
||||
size="mini" |
||||
type="primary" |
||||
:underline="false" |
||||
v-show="!scope.row.isShow" |
||||
@click="dialogFormVisible(scope.$index,scope.row)" |
||||
>取消</el-link> |
||||
<el-link |
||||
size="mini" |
||||
type="primary" |
||||
:underline="false" |
||||
v-show="!scope.row.isShow" |
||||
@click="getRuleDelete(scope.$index,scope.row)" |
||||
>删除</el-link> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
</el-card> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import quill from '@/components/common/quill' |
||||
export default { |
||||
data() { |
||||
return { |
||||
ruleForm: { |
||||
judgmentPointsName: "", |
||||
experimentalRequirements: "", |
||||
experimentcode: "" |
||||
}, |
||||
tableData: [], |
||||
id: "", |
||||
rules: { |
||||
judgmentPointsName: [ |
||||
{ required: true, message: "内容不能为空", trigger: "blur" } |
||||
], |
||||
experimentalRequirements: [ |
||||
{ required: true, message: "实验要求不能为空", trigger: "blur" } |
||||
], |
||||
experimentcode: [ |
||||
{ required: true, message: "参考答案不能为空", trigger: "blur" } |
||||
] |
||||
}, |
||||
decisionPointRule: "", |
||||
systemId: this.$config.systemId, |
||||
userId: "", |
||||
ruleIds: [], |
||||
jRP: "", |
||||
jRR: "", |
||||
isAdd: false |
||||
}; |
||||
}, |
||||
components: {quill}, |
||||
mounted() { |
||||
this.getMesg(); |
||||
}, |
||||
|
||||
methods: { |
||||
//且或判断 |
||||
getPerhaps(a) { |
||||
if (a.perhaps == 1) { |
||||
a.perhaps = "0"; |
||||
} else { |
||||
a.perhaps = "1"; |
||||
} |
||||
}, |
||||
//判分点详细信息查询(通过首页编辑按钮) |
||||
getMesg() { |
||||
if (this.$route.query.judgmentPointsId) { |
||||
this.$get(this.api.QueryPfdInformation, { |
||||
judgmentPointsId: this.$route.query.judgmentPointsId |
||||
}) |
||||
.then(res => { |
||||
res.message.rules.map(e => { |
||||
this.$set(e, "isQie", true); |
||||
this.$set(e, "isShow", true); |
||||
}); |
||||
this.ruleForm = { |
||||
judgmentPointsName: res.message.point.judgmentPointsName, |
||||
experimentalRequirements: |
||||
res.message.point.experimentalRequirements, |
||||
experimentcode: res.message.point.experimentcode |
||||
}; |
||||
this.tableData = res.message.rules; |
||||
let arr1 = this.tableData; |
||||
let result1 = arr1.map(e => e.decisionPointRule); |
||||
this.ruleIds = this.ruleIds.concat(result1); |
||||
// this.decisionPointRule=res.message.rules[0].decisionPointRule; |
||||
}) |
||||
.catch(err => {}); |
||||
} |
||||
}, |
||||
goback() { |
||||
this.$router.back() |
||||
}, |
||||
|
||||
// 表头样式设置 |
||||
headClass() { |
||||
return "text-align: center;"; |
||||
}, |
||||
|
||||
// 表格样式设置 |
||||
rowClass() { |
||||
return "text-align: center;"; |
||||
}, |
||||
// 编辑判分点规则 保存按钮 |
||||
getRule(row) { |
||||
if (!row.judgmentRulesRule || !row.judgmentRulesPoint) { |
||||
this.$message({ |
||||
showClose: true, |
||||
message: "内容不能为空", |
||||
type: "warning" |
||||
}); |
||||
} else { |
||||
if (row.decisionPointRule) { |
||||
this.$post(this.api.UpdatePointOfJudgementRule, { |
||||
judgmentRulesRule: row.judgmentRulesRule, |
||||
judgmentRulesPoint: row.judgmentRulesPoint, |
||||
perhaps: String(row.perhaps), |
||||
decisionPointRule: row.decisionPointRule |
||||
}) |
||||
.then(res => { |
||||
this.isAdd = false; |
||||
row.isShow = true; |
||||
this.getContent(); |
||||
}) |
||||
.catch(err => { |
||||
console.log(err); |
||||
}); |
||||
} else { |
||||
//新增判分规则 |
||||
this.$post(this.api.AddPfdgzInformation, { |
||||
judgmentRulesRule: row.judgmentRulesRule, |
||||
judgmentRulesPoint: row.judgmentRulesPoint, |
||||
perhaps: String(row.perhaps) |
||||
}) |
||||
.then(s => { |
||||
this.isAdd = false; |
||||
row.isShow = true; |
||||
this.id = s.message; |
||||
this.ruleIds.push(this.id); |
||||
console.log(this.ruleIds); |
||||
this.getContent(); |
||||
}) |
||||
.catch(err => { |
||||
console.log(err); |
||||
}); |
||||
} |
||||
} |
||||
}, |
||||
|
||||
//取消 |
||||
dialogFormVisible(index, row) { |
||||
this.isAdd = false; |
||||
if (!row.decisionPointRule) { |
||||
this.tableData.splice(index, 1); |
||||
} else { |
||||
if (!row.judgmentRulesRule || !row.judgmentRulesPoint) { |
||||
this.$message({ |
||||
showClose: true, |
||||
message: "内容不能为空", |
||||
type: "warning" |
||||
}); |
||||
} else { |
||||
row.isShow = true; |
||||
row.judgmentRulesRule = this.jRR; |
||||
row.judgmentRulesPoint = this.jRP; |
||||
} |
||||
} |
||||
}, |
||||
//编辑 |
||||
getHandleEdit(row) { |
||||
this.isAdd = true; |
||||
row.isShow = false; |
||||
this.jRR = row.judgmentRulesRule; |
||||
this.jRP = row.judgmentRulesPoint; |
||||
}, |
||||
//删除 |
||||
getRuleDelete(index, row) { |
||||
this.getContent(); |
||||
if (!row.decisionPointRule) { |
||||
this.tableData.splice(index, 1); |
||||
this.isAdd = false; |
||||
} else { |
||||
this.$confirm("此操作将永久删除该内容, 是否继续?", "提示", { |
||||
confirmButtonText: "确定", |
||||
cancelButtonText: "取消", |
||||
type: "warning", |
||||
center: true |
||||
}) |
||||
.then(() => { |
||||
this.$post(this.api.DeletePointOfJudgementRule, { |
||||
decisionPointRule: this.decisionPointRule |
||||
}) |
||||
.then(res => { |
||||
this.getContent(); |
||||
this.isAdd = false; |
||||
}) |
||||
.catch(err => { |
||||
console.log(err); |
||||
}); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "删除成功!" |
||||
}); |
||||
}) |
||||
.catch(() => { |
||||
this.$message({ |
||||
type: "info", |
||||
message: "已取消删除" |
||||
}); |
||||
}); |
||||
} |
||||
}, |
||||
// 判分点规则信息查询 |
||||
getContent() { |
||||
this.$get(this.api.QueryPfdgzInformation, { |
||||
ruleIds: this.ruleIds.join() |
||||
}) |
||||
.then(s => { |
||||
s.message.map(e => { |
||||
this.$set(e, "isQie", true); |
||||
this.$set(e, "isShow", true); |
||||
}); |
||||
this.tableData = s.message; |
||||
this.decisionPointRule = s.message[0].decisionPointRule; |
||||
}) |
||||
.catch(err => { |
||||
console.log(err); |
||||
}); |
||||
}, |
||||
|
||||
|
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
// 后面修改的样式 |
||||
/deep/ .el-link.el-link--primary { |
||||
padding-right: 10px; |
||||
} |
||||
/deep/ .el-button { |
||||
line-height: 0; |
||||
height: 30px; |
||||
width: 80px; |
||||
margin-top: 7px; |
||||
border-radius: 20px; |
||||
position: absolute; |
||||
right: 30px; |
||||
} |
||||
|
||||
/deep/ .el-input__inner { |
||||
border: 1px solid #9278ff; |
||||
} |
||||
/deep/ .el-form-item { |
||||
margin-top: 15px; |
||||
} |
||||
// 第二部分 |
||||
/deep/ .el-button--text { |
||||
color: #9278ff; |
||||
} |
||||
/deep/ .el-button--text:focus, |
||||
.el-button--text:hover { |
||||
color: #9278ff; |
||||
} |
||||
.border { |
||||
width: 50px; |
||||
height: 50px; |
||||
border: 1px solid #9278ff; |
||||
border-radius: 50%; |
||||
margin: auto; |
||||
} |
||||
.p { |
||||
font-size: 12px; |
||||
font-weight: 600; |
||||
} |
||||
// 文本框 |
||||
/deep/ .el-textarea__inner { |
||||
height: 145px; |
||||
width: 650px; |
||||
resize: none; |
||||
border: 1px solid #9278ff; |
||||
font-size: 12px; |
||||
border-radius: 5px; |
||||
} |
||||
/deep/ .el-textarea__inner:hover { |
||||
border: 1px solid #9278ff; |
||||
} |
||||
|
||||
// 滚动条的宽度 |
||||
/deep/ ::-webkit-scrollbar { |
||||
width: 6px; // 横向滚动条 |
||||
height: 6px; // 纵向滚动条 必写 |
||||
} |
||||
// 滚动条的滑块 |
||||
/deep/ ::-webkit-scrollbar-thumb { |
||||
background-color: #9278ff; |
||||
border-radius: 3px; |
||||
-webkit-box-shadow: inset 0 0 5px #dddddd; |
||||
} |
||||
/deep/ ::-webkit-scrollbar-track { |
||||
/*滚动条里面轨道*/ |
||||
-webkit-box-shadow: inset 0 0 5px #dddddd; |
||||
border-radius: 0; |
||||
background: #dddddd; |
||||
} |
||||
/deep/ .el-row { |
||||
padding: 0 20px; |
||||
} |
||||
|
||||
/deep/ .el-table th { |
||||
font-size: 14px; |
||||
font-family: Microsoft YaHei; |
||||
color: rgba(255, 255, 255, 1); |
||||
background-color: #9278ff; |
||||
} |
||||
/deep/ .el-table td, |
||||
.el-table th { |
||||
padding-top: 0; |
||||
} |
||||
.footer_b p { |
||||
margin: 0; |
||||
padding-left: 10px; |
||||
font-size: 14px; |
||||
} |
||||
.footer_b { |
||||
padding: 10px 0; |
||||
border-top: 1px dashed #cccccc; |
||||
margin: 0 15px; |
||||
height: 45px; |
||||
line-height: 45px; |
||||
} |
||||
|
||||
// 第一部分 |
||||
|
||||
#memo { |
||||
margin-left: 10px; |
||||
height: 200px; |
||||
width: 800px; |
||||
resize: none; |
||||
border: 1px solid #9278ff; |
||||
font-size: 12px; |
||||
border-radius: 5px; |
||||
} |
||||
#memo1 { |
||||
height: 300px; |
||||
width: 1700px; |
||||
resize: none; |
||||
border: 1px solid #9278ff; |
||||
font-size: 12px; |
||||
border-radius: 5px; |
||||
padding: 10px 20px; |
||||
} |
||||
/deep/ .el-input--suffix .el-input__inner { |
||||
border: 1px solid #9278ff; |
||||
} |
||||
.footer_input p { |
||||
font-size: 12px; |
||||
padding-right: 20px; |
||||
} |
||||
.footer_input { |
||||
padding: 30px 0 20px 80px; |
||||
} |
||||
.footer_inputs { |
||||
padding: 30px 0 20px 80px; |
||||
} |
||||
.footer_inputs1 { |
||||
padding-bottom: 50px; |
||||
text-align: center; |
||||
} |
||||
.footer_inputs1 p { |
||||
margin: 0 0 15px 0; |
||||
font-size: 14px; |
||||
} |
||||
.footer_inputs p { |
||||
font-size: 12px; |
||||
padding-right: 20px; |
||||
} |
||||
/deep/ .el-input { |
||||
width: 30%; |
||||
} |
||||
/deep/ [class*=" el-icon-"], |
||||
[class^="el-icon-"] { |
||||
line-height: 3; |
||||
padding-left: 10px; |
||||
} |
||||
.header { |
||||
background-color: #ffffff; |
||||
height: 45px; |
||||
line-height: 45px; |
||||
font-size: 14px; |
||||
font-weight: 600; |
||||
position: relative; |
||||
} |
||||
.header span { |
||||
font-size: 14px; |
||||
font-weight: 600; |
||||
padding-left: 5px; |
||||
} |
||||
.header p { |
||||
padding-left: 20px; |
||||
margin: 0; |
||||
} |
||||
.footer_h { |
||||
border-top: 1px dashed #cccccc; |
||||
border-bottom: 1px dashed #cccccc; |
||||
margin: 0 15px; |
||||
height: 45px; |
||||
line-height: 45px; |
||||
} |
||||
.flex { |
||||
display: flex; |
||||
justify-content: flex-start; |
||||
} |
||||
.footer { |
||||
background-color: #ffffff; |
||||
} |
||||
.footer_h p { |
||||
padding-left: 10px; |
||||
font-size: 14px; |
||||
margin: 0; |
||||
} |
||||
.black { |
||||
width: 8px; |
||||
height: 18px; |
||||
background-color: #333; |
||||
margin-top: 10px; |
||||
} |
||||
.content { |
||||
position: relative; |
||||
top: 10px; |
||||
} |
||||
</style> |
@ -1,280 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-row :gutter="20"> |
||||
<el-col :span="24"> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div> |
||||
<div class="flex-center mgb20"> |
||||
<p class="hr_tag"></p> |
||||
<span>实验报告</span> |
||||
</div> |
||||
<div> |
||||
<el-form label-width="80px"> |
||||
<el-col :span="8"> |
||||
<el-form-item label="时间" class="userRadio"> |
||||
<el-radio-group v-model="form.time"> |
||||
<el-radio v-for="(item,index) in timeList" :key="index" :label="item.id" border>{{item.name}}</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-form-item label="时间范围"> |
||||
<el-date-picker |
||||
v-model="timeRange" |
||||
type="daterange" |
||||
range-separator="-" |
||||
start-placeholder="开始日期" |
||||
end-placeholder="结束日期"> |
||||
</el-date-picker> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-form> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
</el-col> |
||||
|
||||
<el-col :span="24"> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between mgb20"> |
||||
<el-tabs v-model="curTab" @tab-click="tabChange"> |
||||
<el-tab-pane label="全部(100)" name="all"></el-tab-pane> |
||||
<el-tab-pane label="待评分(20)" name="wait"></el-tab-pane> |
||||
<el-tab-pane label="已完成(20)" name="already"></el-tab-pane> |
||||
</el-tabs> |
||||
<div> |
||||
<el-input placeholder="请输入关键词" prefix-icon="el-icon-search" v-model="form.keyword" clearable @keyup.enter.native="onSearch"></el-input> |
||||
</div> |
||||
</div> |
||||
<el-table :data="customerData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys"> |
||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.$index + (pageNo - 1) * pageSize + 1}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="schoolName" label="实验名称" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="countries" label="学校" align="center"> |
||||
</el-table-column> |
||||
<el-table-column label="学生姓名" align="center"> |
||||
<template slot-scope="scope"> |
||||
<span class="ellipsis">{{scope.row.industryName}}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="provinceName" label="分数" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="adminName" label="状态" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="adminPhone" label="提交时间" align="center"> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-button v-if="false" type="text">评分</el-button> |
||||
<el-button v-else type="text" @click="edit(scope.row)">修改分数</el-button> |
||||
<el-button type="text" @click="permission">查看报告</el-button> |
||||
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo"> |
||||
</el-pagination> |
||||
</div> |
||||
</el-card> |
||||
</el-col> |
||||
</el-row> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import bus from '../common/bus'; |
||||
export default { |
||||
name: 'dashboard', |
||||
data() { |
||||
return { |
||||
name: sessionStorage.getItem('ms_username'), |
||||
countryList: [{ |
||||
name:'中国' |
||||
}], |
||||
customerData: [], |
||||
form: { |
||||
countries:'中国', |
||||
provinces: '', |
||||
city: '', |
||||
keyword: '' |
||||
}, |
||||
multipleSelection: [], |
||||
timeList: [ |
||||
{ |
||||
id: 1, |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: '近一个月' |
||||
}, |
||||
{ |
||||
id: 3, |
||||
name: '近六个月' |
||||
} |
||||
], |
||||
timeRange: '', |
||||
curTab: 'all', |
||||
provinceList: [], |
||||
cityList: [], |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
totals: 1, |
||||
ruleIds: [] |
||||
}; |
||||
}, |
||||
components: { |
||||
|
||||
}, |
||||
computed: { |
||||
role() { |
||||
return this.name === 'admin' ? '超级管理员' : '普通用户'; |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getData() |
||||
this.getProvince() |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
let data = { |
||||
countries: this.form.countries, |
||||
provinceId: this.form.provinces, |
||||
cityId: this.form.city, |
||||
searchContent: this.form.keyword, |
||||
pageNo: this.pageNo, |
||||
pageSize: this.pageSize |
||||
} |
||||
this.$get(this.api.queryCustomer,data).then(res => { |
||||
this.customerData = res.message.rows |
||||
this.totals = res.message.total |
||||
}).catch(res => {}); |
||||
}, |
||||
getProvince(){ |
||||
this.$get(this.api.queryProvince).then(res => { |
||||
this.provinceList = res.message |
||||
this.$store.commit("provinceData", { provinceList : this.provinceList}); |
||||
}).catch(res => {}); |
||||
}, |
||||
// 清除省份 |
||||
clearprovince(){ |
||||
this.form.city = '' |
||||
}, |
||||
getCity(){ |
||||
this.clearprovince() |
||||
this.getCityData() |
||||
this.pageNo = 1 |
||||
this.getData() |
||||
}, |
||||
getCityData(){ |
||||
let data = { |
||||
provinceId: this.form.provinces |
||||
} |
||||
this.$get(this.api.queryCity,data).then(res => { |
||||
this.cityList = res.message |
||||
}).catch(res => {}); |
||||
}, |
||||
permission(){ |
||||
this.$router.push('/permission') |
||||
}, |
||||
addcustomer(){ |
||||
this.$store.commit("customerData", { customer_id : ''}); |
||||
this.$router.push('/addcustomer'); |
||||
}, |
||||
edit(row){ |
||||
this.$store.commit("customerData", { customer_id : row.customerId }); |
||||
this.$router.push('/addcustomer'); |
||||
}, |
||||
handleDelete(row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
let str = ''; |
||||
str += row.customerId+','; |
||||
var deleteList = str.split(',').map(Number); |
||||
deleteList.pop() |
||||
var arr = []; |
||||
var signAgainReq = new Object(); |
||||
signAgainReq.customerId = deleteList[0]; |
||||
arr.push(signAgainReq); |
||||
|
||||
let data = { |
||||
customer: arr |
||||
} |
||||
this.$post(this.api.deleteCustomer,data).then(res => { |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
getRowKeys(row) { |
||||
return row.customerId; |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val; |
||||
}, |
||||
delAllSelection() { |
||||
if(this.multipleSelection.length != ''){ |
||||
const length = this.multipleSelection.length; |
||||
let str = ''; |
||||
for (let i = 0; i < length; i++) { |
||||
str += this.multipleSelection[i].customerId+','; |
||||
} |
||||
var deleteList = str.split(',').map(Number); |
||||
deleteList.pop() |
||||
var arr = []; |
||||
for(var i = 0,len = deleteList.length; i < len; i++){ |
||||
var signAgainReq = new Object(); |
||||
signAgainReq.customerId = deleteList[i]; |
||||
arr.push(signAgainReq); |
||||
} |
||||
// 批量删除 |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
let data = { |
||||
customer: arr |
||||
} |
||||
this.$post(this.api.deleteCustomer,data).then(res => { |
||||
this.multipleSelection = []; |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}).catch(() => {}); |
||||
}else{ |
||||
this.$message.error('请先选择客户 !'); |
||||
} |
||||
}, |
||||
onSearch(){ |
||||
this.pageNo = 1 |
||||
this.getData() |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.pageNo = val; |
||||
this.getData(); |
||||
}, |
||||
tabChange(tab,event) { |
||||
console.log(tab,event) |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style scoped> |
||||
.mag{ |
||||
margin-right: 20px; |
||||
} |
||||
/deep/.el-tabs__nav-wrap::after{ |
||||
display: none; |
||||
} |
||||
</style> |
||||
|
@ -1,461 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-row :gutter="20"> |
||||
<el-col :span="24"> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between"> |
||||
<div class="per_title" v-preventReClick @click="goback()"> |
||||
<i class="el-icon-arrow-left"></i> |
||||
<span class="per_back">返回</span> |
||||
<span class="per_school">实验报告配置</span> |
||||
</div> |
||||
<div> |
||||
<el-button type="primary" size="small" round v-preventReClick>确定</el-button> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div> |
||||
<p class="mgb20">实验报告名称</p> |
||||
<el-input |
||||
placeholder="请输入实验报告名称" |
||||
clearable |
||||
maxlength="15" |
||||
class="inline-input" |
||||
></el-input> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-center mgb20"> |
||||
<p class="addhr_tag"></p> |
||||
<span>基本信息</span> |
||||
</div> |
||||
<div> |
||||
<el-form inline class="inline-form"> |
||||
<div class="inner"> |
||||
<el-form-item label="学生姓名"> |
||||
<el-input placeholder="" size="small"></el-input> |
||||
</el-form-item> |
||||
<el-form-item label="学生学号"> |
||||
<el-input placeholder="" size="small"></el-input> |
||||
</el-form-item> |
||||
<el-form-item label="学生班级"> |
||||
<el-input placeholder="" size="small"></el-input> |
||||
</el-form-item> |
||||
</div> |
||||
<div class="inner"> |
||||
<el-form-item label="实验名称"> |
||||
<el-input placeholder="" size="small"></el-input> |
||||
</el-form-item> |
||||
<el-form-item label="实验学时"> |
||||
<el-input placeholder="" size="small"></el-input> |
||||
</el-form-item> |
||||
</div> |
||||
</el-form> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="addhr_tag"></p> |
||||
<span>实验目的</span> |
||||
</div> |
||||
<div> |
||||
<span>得分:0/60</span> |
||||
<el-button class="ml10" type="primary" size="small" v-preventReClick>编辑</el-button> |
||||
</div> |
||||
</div> |
||||
<el-input type="textarea" rows="5" disabled></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="addhr_tag"></p> |
||||
<span>实验原理</span> |
||||
</div> |
||||
<div> |
||||
<span>得分:0/60</span> |
||||
<el-button class="ml10" type="primary" size="small" v-preventReClick>编辑</el-button> |
||||
</div> |
||||
</div> |
||||
<el-input type="textarea" rows="5" disabled></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="addhr_tag"></p> |
||||
<span>实验步骤</span> |
||||
</div> |
||||
<div> |
||||
<span>得分:0/60</span> |
||||
<el-button class="ml10" type="primary" size="small" v-preventReClick>编辑</el-button> |
||||
</div> |
||||
</div> |
||||
<el-input type="textarea" rows="5" disabled></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="addhr_tag"></p> |
||||
<span>实验结果分析</span> |
||||
</div> |
||||
<div> |
||||
<span>得分:0/60</span> |
||||
<el-button class="ml10" type="primary" size="small" v-preventReClick>编辑</el-button> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="block"> |
||||
<div class="flex-between mb10"> |
||||
<p class="l-title">步骤1 判断平价关系确定交易方向</p> |
||||
<el-switch></el-switch> |
||||
</div> |
||||
<div class="inner"> |
||||
<el-checkbox>日期</el-checkbox> |
||||
<el-checkbox>品种</el-checkbox> |
||||
</div> |
||||
<div> |
||||
<div class="flex-between"> |
||||
<div class="inline-flex"> |
||||
<el-checkbox></el-checkbox> |
||||
<span>设置结论选项</span> |
||||
<div class="input-wrap"> |
||||
<div class="input" v-for="(item,index) in conclusion1" :key="index"> |
||||
<el-input size="mini" v-model="item.val"></el-input> |
||||
<i class="plus el-icon-circle-plus-outline" @click="addColumn(1)"></i> |
||||
<i class="sub el-icon-remove-outline" v-if="conclusion1.length > 1" @click="delColumn(1,index)"></i> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<p>(0/0分)</p> |
||||
</div> |
||||
<div class="flex-between"> |
||||
<div class="inline-flex"> |
||||
<el-checkbox></el-checkbox> |
||||
<span>设置主观题</span> |
||||
<el-input size="mini"></el-input> |
||||
</div> |
||||
<p>(0/0分)</p> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="block"> |
||||
<div class="flex-between mb10"> |
||||
<p class="l-title">步骤2 选择期货期权套利策略</p> |
||||
<el-switch></el-switch> |
||||
</div> |
||||
<div class="inner"> |
||||
<el-checkbox>策略</el-checkbox> |
||||
<el-checkbox>套利组合</el-checkbox> |
||||
</div> |
||||
<div> |
||||
<div class="flex-between"> |
||||
<div class="inline-flex"> |
||||
<el-checkbox></el-checkbox> |
||||
<span>设置结论选项</span> |
||||
<div class="input-wrap"> |
||||
<div class="input" v-for="(item,index) in conclusion2" :key="index"> |
||||
<el-input size="mini" v-model="item.val"></el-input> |
||||
<i class="plus el-icon-circle-plus-outline" @click="addColumn(2)"></i> |
||||
<i class="sub el-icon-remove-outline" v-if="conclusion2.length > 1" @click="delColumn(2,index)"></i> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<p>(0/0分)</p> |
||||
</div> |
||||
<div class="flex-between"> |
||||
<div class="inline-flex"> |
||||
<el-checkbox></el-checkbox> |
||||
<span>设置主观题</span> |
||||
<el-input size="mini"></el-input> |
||||
</div> |
||||
<p>(0/0分)</p> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="block"> |
||||
<div class="flex-between mb10"> |
||||
<p class="l-title">步骤3 判断平价关系确定交易方向</p> |
||||
<el-switch></el-switch> |
||||
</div> |
||||
<div class="inner"> |
||||
<el-checkbox>策略</el-checkbox> |
||||
</div> |
||||
<div> |
||||
<div class="flex-between"> |
||||
<div class="inline-flex"> |
||||
<el-checkbox></el-checkbox> |
||||
<span>设置结论选项</span> |
||||
<div class="input-wrap"> |
||||
<div class="input" v-for="(item,index) in conclusion3" :key="index"> |
||||
<el-input size="mini" v-model="item.val"></el-input> |
||||
<i class="plus el-icon-circle-plus-outline" @click="addColumn(3)"></i> |
||||
<i class="sub el-icon-remove-outline" v-if="conclusion3.length > 1" @click="delColumn(3,index)"></i> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<p>(0/0分)</p> |
||||
</div> |
||||
<div class="flex-between"> |
||||
<div class="inline-flex"> |
||||
<el-checkbox></el-checkbox> |
||||
<span>设置主观题</span> |
||||
<el-input size="mini"></el-input> |
||||
</div> |
||||
<p>(0/0分)</p> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="block"> |
||||
<div class="flex-between mb10"> |
||||
<p class="l-title">步骤4 选择期权期货套利策略</p> |
||||
<el-switch></el-switch> |
||||
</div> |
||||
<div class="inner"> |
||||
<el-checkbox>策略</el-checkbox> |
||||
</div> |
||||
<div> |
||||
<div class="flex-between"> |
||||
<div class="inline-flex"> |
||||
<el-checkbox></el-checkbox> |
||||
<span>设置结论选项</span> |
||||
<div class="input-wrap"> |
||||
<div class="input" v-for="(item,index) in conclusion4" :key="index"> |
||||
<el-input size="mini" v-model="item.val"></el-input> |
||||
<i class="plus el-icon-circle-plus-outline" @click="addColumn(4)"></i> |
||||
<i class="sub el-icon-remove-outline" v-if="conclusion4.length > 1" @click="delColumn(4,index)"></i> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<p>(0/0分)</p> |
||||
</div> |
||||
<div class="flex-between"> |
||||
<div class="inline-flex"> |
||||
<el-checkbox></el-checkbox> |
||||
<span>设置主观题</span> |
||||
<el-input size="mini"></el-input> |
||||
</div> |
||||
<p>(0/0分)</p> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="addhr_tag"></p> |
||||
<span>实验结论</span> |
||||
</div> |
||||
<div> |
||||
<span>得分:0/60</span> |
||||
</div> |
||||
</div> |
||||
<el-input type="textarea" rows="5" placeholder="请填写实验结论"></el-input> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="addhr_tag"></p> |
||||
<span>总结与心得体会</span> |
||||
</div> |
||||
<div> |
||||
<span>得分:0/60</span> |
||||
</div> |
||||
</div> |
||||
<el-input type="textarea" rows="5" placeholder="请填写总结与心得体会"></el-input> |
||||
</el-card> |
||||
</el-col> |
||||
</el-row> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
data (){ |
||||
return { |
||||
form: { |
||||
systemName: '', |
||||
systemType: '', |
||||
systemAttribution: '' |
||||
}, |
||||
rules: { |
||||
systemName:[ |
||||
{ required: true, message: '请输入系统名称', trigger: 'blur' } |
||||
], |
||||
systemType:[ |
||||
{ required: true, message: '请选择系统类型', trigger: 'change' } |
||||
], |
||||
systemAttribution:[ |
||||
{ required: true, message: '请选择系统归属', trigger: 'change' } |
||||
] |
||||
}, |
||||
conclusion1: [{val: ''}], |
||||
conclusion2: [{val: ''}], |
||||
conclusion3: [{val: ''}], |
||||
conclusion4: [{val: ''}], |
||||
conclusion5: [{val: ''}], |
||||
conclusion6: [{val: ''}], |
||||
conclusion7: [{val: ''}], |
||||
conclusion8: [{val: ''}], |
||||
} |
||||
}, |
||||
mounted(){ |
||||
if(this.configId){ |
||||
this.getData() |
||||
} |
||||
}, |
||||
methods: { |
||||
getData(){ |
||||
let data = { |
||||
systemId: this.configId |
||||
} |
||||
this.$get(this.api.queryServiceConfigDetails,data).then((res) => { |
||||
this.form = { |
||||
systemName: res.message[0].systemName, |
||||
systemType: res.message[0].systemType, |
||||
systemAttribution: res.message[0].systemAttribution, |
||||
} |
||||
}).catch((res) => { |
||||
}) |
||||
}, |
||||
saveAdd(){ |
||||
let data = { |
||||
systemId: this.configId, |
||||
systemName: this.form.systemName, |
||||
systemType: this.form.systemType, |
||||
systemAttribution: this.form.systemAttribution, |
||||
} |
||||
if(this.configId){ |
||||
this.$post(this.api.updateServiceConfig,data).then((res) => { |
||||
this.$message.success('编辑成功'); |
||||
this.$router.back() |
||||
}).catch((res) => { |
||||
}) |
||||
}else{ |
||||
this.$post(this.api.updateServiceConfig,data).then((res) => { |
||||
this.$message.success('添加成功'); |
||||
this.$router.back() |
||||
}).catch((res) => { |
||||
}) |
||||
} |
||||
}, |
||||
goback() { |
||||
this.$confirm('确定返回?未更新的信息将不会保存。', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$router.back() |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
addColumn(index){ |
||||
if(this[`conclusion${index}`].length > 4){ |
||||
this.$message.warning('最多添加5个'); |
||||
}else{ |
||||
this[`conclusion${index}`].push({val: ''}) |
||||
} |
||||
}, |
||||
delColumn(index,i){ |
||||
this[`conclusion${index}`].splice(i,1) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.ml10{ |
||||
margin-left: 10px; |
||||
} |
||||
.mb10{ |
||||
margin-bottom: 10px; |
||||
} |
||||
.inline-input{ |
||||
width: 200px; |
||||
} |
||||
.inline-form{ |
||||
display: flex; |
||||
flex-direction: column; |
||||
|
||||
.inner{ |
||||
display: inline-flex; |
||||
|
||||
&:first-child{ |
||||
margin-bottom: 15px; |
||||
} |
||||
.el-form-item{ |
||||
width: 33.33%; |
||||
margin: 0 20px; |
||||
font-size: 12px; |
||||
} |
||||
} |
||||
} |
||||
.flex-center{ |
||||
font-size: 14px; |
||||
} |
||||
.flex-between{ |
||||
font-size: 12px; |
||||
} |
||||
.block{ |
||||
padding: 10px; |
||||
margin-bottom: 15px; |
||||
background-color: #f5f5f5; |
||||
|
||||
.l-title{ |
||||
font-size: 14px; |
||||
font-weight: bold; |
||||
} |
||||
.inner{ |
||||
min-height: 100px; |
||||
padding: 10px; |
||||
margin-bottom: 10px; |
||||
border-radius: 8px; |
||||
border: 1px solid #ccc; |
||||
background-color: #fff; |
||||
box-sizing: border-box; |
||||
} |
||||
.inline-flex{ |
||||
display: inline-flex; |
||||
margin-bottom: 10px; |
||||
font-size: 12px; |
||||
|
||||
.input-wrap{ |
||||
.input{ |
||||
margin-bottom: 5px; |
||||
} |
||||
} |
||||
span{ |
||||
margin: 0 10px 0 5px; |
||||
} |
||||
.el-input{ |
||||
width: 400px; |
||||
} |
||||
i{ |
||||
font-size: 16px; |
||||
cursor: pointer; |
||||
|
||||
&:hover{ |
||||
opacity: .8; |
||||
} |
||||
} |
||||
.plus{ |
||||
margin-left: 10px; |
||||
color: #63e600; |
||||
} |
||||
.sub{ |
||||
margin-left: 5px; |
||||
color: #636363; |
||||
} |
||||
} |
||||
} |
||||
</style> |
@ -1,361 +0,0 @@ |
||||
<template> |
||||
<div class="box"> |
||||
<el-row :gutter="24"> |
||||
<el-col :span="24"> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between"> |
||||
<div class="per_title" v-preventReClick @click="goback()"> |
||||
<i class="el-icon-arrow-left"></i> |
||||
<span class="per_back">返回</span> |
||||
<span class="per_school">查看报告</span> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<div id="pdfDom"> |
||||
<h6 style="text-align: center;font-size: 20px">标准实验报告</h6> |
||||
<div class="flex-center mgb20 user_header"> |
||||
<p class="addhr_tag"></p> |
||||
<span style="font-size: 18px">基本信息</span> |
||||
</div> |
||||
|
||||
<div> |
||||
<el-table :data="infoData" class="info-table" style="margin-bottom: 40px" header-align="center"> |
||||
<el-table-column prop="userName" label="学生姓名" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="workNumber" label="学生学号" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="className" label="学生班级" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="teacherName" label="指导老师" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="period" label="实验学时" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="laboratory" label="实验室名称" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="startTime" label="实验时间" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="score" label="实验成绩" align="center"> |
||||
</el-table-column> |
||||
</el-table> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 实验项目名称</p> |
||||
</div> |
||||
<el-input v-model="form.projectName" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 实验目的</p> |
||||
</div> |
||||
<el-input v-model="form.purpose" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 实验原理</p> |
||||
</div> |
||||
<el-input v-model="form.principle" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 实验器材(设备、元器件)</p> |
||||
</div> |
||||
<el-input v-model="form.equipment" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 实验步骤</p> |
||||
</div> |
||||
<el-input v-model="form.step" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">实验数据</p> |
||||
<!-- <span>得分:50/60</span> --> |
||||
</div> |
||||
<el-table :data="sjData" class="table" stripe header-align="center"> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.$index + 1}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="judgmentPointsName" label="考核点" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="StudentAnswers" label="学生答案" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="ReferenceAnswer" label="参考答案" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="score" label="得分" align="center"> |
||||
</el-table-column> |
||||
</el-table> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 实验数据及结果分析</p> |
||||
</div> |
||||
<el-table :data="expData" stripe header-align="center" class="mat20"> |
||||
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> |
||||
<el-table-column prop="ename" label="代码" align="center"></el-table-column> |
||||
<el-table-column prop="name" label="合约名称" align="center"></el-table-column> |
||||
<el-table-column prop="tradingDirection" label="方向(买/卖)" align="center"></el-table-column> |
||||
<el-table-column prop="entrustNumber" label="持仓/可用" align="center"></el-table-column> |
||||
<el-table-column prop="entrustPrice" label="均价/现价" align="center"></el-table-column> |
||||
<el-table-column prop="floatingPl" label="浮动盈亏" align="center"></el-table-column> |
||||
<el-table-column prop="preFreezingMargin" label="保证金" align="center"></el-table-column> |
||||
<el-table-column prop="tradeTime" label="最后交易日" align="center"></el-table-column> |
||||
<el-table-column prop="status" label="持仓状态" align="center"></el-table-column> |
||||
<el-table-column prop="createTime" label="开仓时间" align="center"></el-table-column> |
||||
<el-table-column prop="updateTime" label="平仓时间" align="center"></el-table-column> |
||||
</el-table> |
||||
<el-input style="margin-top: 20px" v-model="form.analysis" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 实验结论</p> |
||||
</div> |
||||
<el-input type="textarea" v-model="form.conclusion" rows="5" disabled></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 总结及心得体会</p> |
||||
</div> |
||||
<el-input type="textarea" v-model="form.summarize" rows="5" disabled></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 对本实验过程及方法、手段的改进建议</p> |
||||
</div> |
||||
<el-input type="textarea" rows="5" v-model="form.improvement" disabled></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 老师评语</p> |
||||
</div> |
||||
<el-input type="textarea" rows="5" v-model="form.comment" disabled></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 老师签名</p> |
||||
</div> |
||||
<el-upload |
||||
disabled |
||||
:action="api.uploadSignature" |
||||
:limit="1" |
||||
list-type="picture-card"> |
||||
<i class="el-icon-plus"></i> |
||||
</el-upload> |
||||
</div> |
||||
</div> |
||||
</el-col> |
||||
</el-row> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
data (){ |
||||
return { |
||||
id: this.$route.query.id, |
||||
title: '实验报告', |
||||
stuId: this.$route.query.stuId, |
||||
studentName: this.$route.query.studentName, |
||||
class: this.$route.query.class, |
||||
userId: this.$store.state.userLoginId, |
||||
studentId: this.$store.state.studentId, |
||||
userName: this.$store.state.name, |
||||
form: { |
||||
analysis: '', |
||||
conclusion: '', |
||||
content: '', |
||||
equipment: '', |
||||
data: '', |
||||
purpose: '', |
||||
experimentId: '', |
||||
experimentalClassName: '', |
||||
improvement: '', |
||||
laboratory: '', |
||||
period: '', |
||||
principle: '', |
||||
projectName: '', |
||||
score: 0, |
||||
step: '', |
||||
submitTime: '', |
||||
summarize: '', |
||||
teacherName: '', |
||||
userId: this.userId, |
||||
userName: this.userName, |
||||
workNumber: '', |
||||
analysis: '', |
||||
comment: '' |
||||
}, |
||||
sjData: [], |
||||
infoData: [], |
||||
expData: [], |
||||
} |
||||
}, |
||||
mounted(){ |
||||
this.getData() |
||||
this.getSgin() |
||||
}, |
||||
methods: { |
||||
getData(){ |
||||
let data = { |
||||
reportId: this.id, |
||||
userId: this.stuId, |
||||
} |
||||
this.$get(this.api.getReport,data).then(res => { |
||||
let report = res.data.experimentalReportEntity |
||||
let steps = [] |
||||
for(let i in report){ |
||||
if(i.includes('steps') && report[i]) steps.push(JSON.parse(report[i])) |
||||
} |
||||
this.form = report |
||||
let expData = [] |
||||
if(report.steps6) expData = JSON.parse(JSON.parse(report.steps6)).positionData |
||||
if(report.steps7) expData = expData.concat(JSON.parse(JSON.parse(report.steps7)).positionData) |
||||
if(report.steps8){ |
||||
let updateTime = JSON.parse(JSON.parse(report.steps8)).achievementsData[0].updateTime |
||||
expData.map(n => { |
||||
n.updateTime = updateTime |
||||
}) |
||||
} |
||||
this.expData = expData |
||||
this.sjData = JSON.parse(report.content) |
||||
this.infoData.push({ |
||||
workNumber: report.workNumber, |
||||
className: this.class != 'undefined' ? this.class : '', |
||||
teacherName: report.teacherName, |
||||
period: report.period, |
||||
laboratory: report.laboratory, |
||||
startTime: report.creationTime, |
||||
score: report.score, |
||||
userName: this.studentName |
||||
}) |
||||
}).catch(res => {}) |
||||
}, |
||||
getSgin(){ |
||||
// let data = { |
||||
// userId: this.form.teacherId |
||||
// } |
||||
// this.$get(this.api.querySignature,data).then(res => { |
||||
// this.signList = res.data |
||||
// }).catch(res => {}); |
||||
}, |
||||
goback(){ |
||||
this.$router.go(-1) |
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.box{ |
||||
padding: 0 50px; |
||||
background-color: #fff; |
||||
} |
||||
/deep/.el-textarea.is-disabled .el-textarea__inner{ |
||||
background-color: #ebfafd; |
||||
} |
||||
#pdfDom{ |
||||
padding: 50px; |
||||
/deep/.info-table{ |
||||
border: 0; |
||||
th{ |
||||
background-color: #fff !important; |
||||
.cell{ |
||||
color: #444; |
||||
} |
||||
} |
||||
tr{ |
||||
border: 0; |
||||
} |
||||
tr:hover,tr:hover>td{ |
||||
background-color: #c6f2f8 !important; |
||||
} |
||||
td{ |
||||
border: { |
||||
left: 4px solid #fff; |
||||
right: 4px solid #fff; |
||||
} |
||||
&:first-child{ |
||||
border-left: 0; |
||||
} |
||||
&:last-child{ |
||||
border-right: 0; |
||||
} |
||||
background-color: #c6f2f8; |
||||
border-bottom: 0; |
||||
} |
||||
} |
||||
/deep/.table th{ |
||||
background-color: #a2a2a2 !important; |
||||
} |
||||
} |
||||
|
||||
/deep/.cell{ |
||||
font-size: 12px; |
||||
} |
||||
/deep/.el-row{ |
||||
padding-top: 20px; |
||||
margin: 0 !important; |
||||
} |
||||
.form-item{ |
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
.form-item .el-input{ |
||||
width: auto; |
||||
} |
||||
.form-item span{ |
||||
margin-right: 10px; |
||||
} |
||||
.meta-title-wrap{ |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
span{ |
||||
font-size: 13px; |
||||
color: #444; |
||||
} |
||||
} |
||||
.flex-between{ |
||||
span{ |
||||
font-size: 13px; |
||||
color: #444; |
||||
} |
||||
} |
||||
.meta-title{ |
||||
display: flex; |
||||
align-items: center; |
||||
padding: 10px 20px; |
||||
margin-bottom: 10px; |
||||
font-size: 16px; |
||||
color: #fff; |
||||
background-color: #9278FF; |
||||
i{ |
||||
margin-right: 10px; |
||||
} |
||||
} |
||||
.step-title{ |
||||
margin-bottom: 10px; |
||||
font-size: 16px; |
||||
color: #9278ff; |
||||
} |
||||
.bd-title{ |
||||
padding-top: 20px; |
||||
border-top: 1px dashed #ccc; |
||||
} |
||||
</style> |
@ -1,401 +0,0 @@ |
||||
<template> |
||||
<div class="box"> |
||||
<el-row :gutter="24"> |
||||
<el-col :span="24"> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between"> |
||||
<div class="per_title" v-preventReClick @click="goback()"> |
||||
<i class="el-icon-arrow-left"></i> |
||||
<span class="per_back">返回</span> |
||||
<span class="per_school">查看报告</span> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<div id="pdfDom"> |
||||
<h6 style="text-align: center;font-size: 20px">标准实验报告</h6> |
||||
<div class="flex-center mgb20 user_header"> |
||||
<p class="addhr_tag"></p> |
||||
<span style="font-size: 18px">基本信息</span> |
||||
</div> |
||||
|
||||
<div> |
||||
<el-table :data="infoData" class="info-table" style="margin-bottom: 40px" header-align="center"> |
||||
<el-table-column prop="userName" label="学生姓名" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="workNumber" label="学生学号" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="className" label="学生班级" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="teacherName" label="指导老师" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="period" label="实验学时" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="laboratory" label="实验室名称" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="startTime" label="实验时间" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="score" label="实验成绩" align="center"> |
||||
</el-table-column> |
||||
</el-table> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 实验项目名称</p> |
||||
</div> |
||||
<el-input v-model="form.projectName" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 实验目的</p> |
||||
</div> |
||||
<el-input v-model="form.purpose" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 实验原理</p> |
||||
</div> |
||||
<el-input v-model="form.principle" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 实验内容</p> |
||||
</div> |
||||
<el-input v-model="form.content" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 实验器材(设备、元器件)</p> |
||||
</div> |
||||
<el-input v-model="form.equipment" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 实验步骤</p> |
||||
</div> |
||||
<el-input v-model="form.step" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title">实验数据</p> |
||||
<!-- <span>得分:50/60</span> --> |
||||
</div> |
||||
<el-table :data="sjData" class="table" stripe header-align="center"> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.$index + 1}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="judgmentPointsName" label="考核点" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="userAnswers" label="学生答案" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="referenceAnswer" label="参考答案" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="score" label="得分" align="center"> |
||||
</el-table-column> |
||||
</el-table> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 实验数据及结果分析</p> |
||||
</div> |
||||
<el-table :data="expData" class="table" stripe header-align="center"> |
||||
<el-table-column prop="remark" label="期权平仓方式" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="optionName" label="期权合约" width="130" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="date" label="期权合约持仓时间段" width="150" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="dirFuture" label="期权交易方向" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="nums" label="委托数量" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="price" label="委托价格" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="futureName" label="期货合约" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="dateFutures" label="合约持仓时间段" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="dir" label="交易方向" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="optionsMoney" label="期权/期货合约盈亏" width="120" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="presentLoss" label="现货盈亏" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="charge" label="手续费" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="totalLoss" label="总盈亏" align="center"> |
||||
</el-table-column> |
||||
</el-table> |
||||
<el-input style="margin-top: 20px" v-model="form.analysis" type="textarea" :disabled="true" rows="5"></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 实验结论</p> |
||||
</div> |
||||
<el-input type="textarea" v-model="form.conclusion" rows="5" disabled></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 总结及心得体会</p> |
||||
</div> |
||||
<el-input type="textarea" v-model="form.summarize" rows="5" disabled></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 对本实验过程及方法、手段的改进建议</p> |
||||
</div> |
||||
<el-input type="textarea" rows="5" v-model="form.improvement" disabled></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 老师评语</p> |
||||
</div> |
||||
<el-input type="textarea" rows="5" v-model="form.comment" disabled></el-input> |
||||
</div> |
||||
|
||||
<div class="mgb20"> |
||||
<div class="meta-title-wrap"> |
||||
<p class="meta-title"><i class="el-icon-discount"></i> 老师签名</p> |
||||
</div> |
||||
<el-upload |
||||
disabled |
||||
:action="api.uploadSignature" |
||||
:limit="1" |
||||
list-type="picture-card"> |
||||
<i class="el-icon-plus"></i> |
||||
</el-upload> |
||||
</div> |
||||
</div> |
||||
</el-col> |
||||
</el-row> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
data (){ |
||||
return { |
||||
id: this.$route.query.id, |
||||
title: '实验报告', |
||||
stuId: this.$route.query.stuId, |
||||
studentName: this.$route.query.studentName, |
||||
class: this.$route.query.class, |
||||
userId: this.$store.state.userLoginId, |
||||
studentId: this.$store.state.studentId, |
||||
userName: this.$store.state.name, |
||||
form: { |
||||
analysis: '', |
||||
conclusion: '', |
||||
content: '', |
||||
equipment: '', |
||||
data: '', |
||||
purpose: '', |
||||
experimentId: '', |
||||
experimentalClassName: '', |
||||
improvement: '', |
||||
laboratory: '', |
||||
period: '', |
||||
principle: '', |
||||
projectName: '', |
||||
score: 0, |
||||
step: '', |
||||
submitTime: '', |
||||
summarize: '', |
||||
teacherName: '', |
||||
userId: this.userId, |
||||
userName: this.userName, |
||||
workNumber: '', |
||||
analysis: '', |
||||
comment: '' |
||||
}, |
||||
sjData: [], |
||||
infoData: [], |
||||
expData: [], |
||||
} |
||||
}, |
||||
mounted(){ |
||||
this.getData() |
||||
this.getSgin() |
||||
}, |
||||
methods: { |
||||
getData(){ |
||||
let data = { |
||||
reportId: this.id, |
||||
userId: this.stuId, |
||||
} |
||||
this.$get(this.api.getReport,data).then(res => { |
||||
let report = res.data.experimentalReportEntity |
||||
let steps = [] |
||||
for(let i in report){ |
||||
if(i.includes('steps') && report[i]) steps.push(JSON.parse(report[i])) |
||||
} |
||||
this.form = report |
||||
this.expData = report.steps9 ? JSON.parse(report.steps9).recordsData: [] |
||||
|
||||
let score = res.data.score |
||||
let answerList = [] |
||||
for(let i in res.data.userAnswersList){ |
||||
answerList = answerList.concat(res.data.userAnswersList[i]) |
||||
} |
||||
let sjData = [] |
||||
answerList.map(n => { |
||||
if(n.type == 1){ |
||||
this.$post(this.api.queryItem,n.levelThree) |
||||
.then((res) => { |
||||
n.levelFour = res.subject.find(e => e.id == n.levelFour).itemDescription |
||||
console.log(11,n) |
||||
}).catch((err) => {}) |
||||
} |
||||
}) |
||||
setTimeout(() => { |
||||
score.map(n => { |
||||
let item = answerList.find(e => e.tradingJudgmentPointsId == n.tradingJudgmentPointsId) |
||||
sjData.push({ |
||||
judgmentPointsName: item.judgmentPointsName, |
||||
userAnswers: n.userAnswers, |
||||
referenceAnswer: item.levelFour, |
||||
score: n.score |
||||
}) |
||||
}) |
||||
},500) |
||||
|
||||
this.sjData = sjData |
||||
this.infoData.push({ |
||||
workNumber: report.workNumber, |
||||
className: this.class != 'undefined' ? this.class : '', |
||||
teacherName: report.teacherName, |
||||
period: report.period, |
||||
laboratory: report.laboratory, |
||||
startTime: report.creationTime, |
||||
score: report.score, |
||||
userName: this.studentName |
||||
}) |
||||
}).catch(res => {}) |
||||
}, |
||||
getSgin(){ |
||||
// let data = { |
||||
// userId: this.form.teacherId |
||||
// } |
||||
// this.$get(this.api.querySignature,data).then(res => { |
||||
// this.signList = res.data |
||||
// }).catch(res => {}); |
||||
}, |
||||
goback(){ |
||||
this.$router.go(-1) |
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.box{ |
||||
padding: 0 50px; |
||||
background-color: #fff; |
||||
} |
||||
/deep/.el-textarea.is-disabled .el-textarea__inner{ |
||||
background-color: #ebfafd; |
||||
} |
||||
#pdfDom{ |
||||
padding: 50px; |
||||
/deep/.info-table{ |
||||
border: 0; |
||||
th{ |
||||
background-color: #fff !important; |
||||
.cell{ |
||||
color: #444; |
||||
} |
||||
} |
||||
tr{ |
||||
border: 0; |
||||
} |
||||
tr:hover,tr:hover>td{ |
||||
background-color: #c6f2f8 !important; |
||||
} |
||||
td{ |
||||
border: { |
||||
left: 4px solid #fff; |
||||
right: 4px solid #fff; |
||||
} |
||||
&:first-child{ |
||||
border-left: 0; |
||||
} |
||||
&:last-child{ |
||||
border-right: 0; |
||||
} |
||||
background-color: #c6f2f8; |
||||
border-bottom: 0; |
||||
} |
||||
} |
||||
/deep/.table th{ |
||||
background-color: #a2a2a2 !important; |
||||
} |
||||
} |
||||
|
||||
/deep/.cell{ |
||||
font-size: 12px; |
||||
} |
||||
/deep/.el-row{ |
||||
padding-top: 20px; |
||||
margin: 0 !important; |
||||
} |
||||
.form-item{ |
||||
display: flex; |
||||
align-items: center; |
||||
} |
||||
.form-item .el-input{ |
||||
width: auto; |
||||
} |
||||
.form-item span{ |
||||
margin-right: 10px; |
||||
} |
||||
.meta-title-wrap{ |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
span{ |
||||
font-size: 13px; |
||||
color: #444; |
||||
} |
||||
} |
||||
.flex-between{ |
||||
span{ |
||||
font-size: 13px; |
||||
color: #444; |
||||
} |
||||
} |
||||
.meta-title{ |
||||
display: flex; |
||||
align-items: center; |
||||
padding: 10px 20px; |
||||
margin-bottom: 10px; |
||||
font-size: 16px; |
||||
color: #fff; |
||||
background-color: #9076FF; |
||||
i{ |
||||
margin-right: 10px; |
||||
} |
||||
} |
||||
.step-title{ |
||||
margin-bottom: 10px; |
||||
font-size: 16px; |
||||
color: #9278ff; |
||||
} |
||||
.bd-title{ |
||||
padding-top: 20px; |
||||
border-top: 1px dashed #ccc; |
||||
} |
||||
</style> |
@ -1,307 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between"> |
||||
<div class="per_title" v-preventReClick @click="goback()"> |
||||
<i class="el-icon-arrow-left"></i> |
||||
<span class="per_back">返回</span> |
||||
<span class="per_school">老师评语</span> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div> |
||||
<p class="mgb20">评语模板名称</p> |
||||
<el-input |
||||
placeholder="请输入评语模板名称" |
||||
clearable |
||||
class="inline-input" |
||||
></el-input> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between mgb20"> |
||||
<p class="l-title">老师寄语</p> |
||||
<el-switch></el-switch> |
||||
</div> |
||||
<div class="mgb20" style="display: flex;justify-content: flex-end;"> |
||||
<div> |
||||
<el-button type="primary" size="small" round>导入</el-button> |
||||
<el-button type="primary" size="small" round>删除</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="listData" class="table" stripe header-align="center" row-key="id"> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.$index+1}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="name" label="分数" align="center"> |
||||
<template slot-scope="scope"> |
||||
<div class="inline"> |
||||
<el-select v-model="scope.row.score1" size="mini"> |
||||
<el-option v-for="item in scoreList" :key="item.id" :label="item.label" :value="item.id"></el-option> |
||||
</el-select> |
||||
<span>——</span> |
||||
<el-select v-model="scope.row.score2" size="mini"> |
||||
<el-option v-for="item in scoreList" :key="item.id" :label="item.label" :value="item.id"></el-option> |
||||
</el-select> |
||||
</div> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="评语" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-input type="textarea" rows="2" v-model="scope.row.comment"></el-input> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="plus" @click="addData"> |
||||
<i class="el-icon-circle-plus-outline"></i> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between mgb20"> |
||||
<p class="l-title">老师签名</p> |
||||
<el-switch></el-switch> |
||||
</div> |
||||
<div class="ags"> |
||||
<div class="item"> |
||||
<el-radio v-model="autograph" label="1">已有签名</el-radio> |
||||
<el-select v-model="agVal" size="mini"> |
||||
<el-option v-for="item in autographList" :key="item.id" :label="item.name" :value="item.id"></el-option> |
||||
</el-select> |
||||
<el-upload |
||||
class="avatar-uploader" |
||||
accept=".jpg,.png,.jpeg,.gif" |
||||
:on-remove="handleRemove" |
||||
:on-error="uploadError" |
||||
:on-success="uploadSuccess" |
||||
:before-remove="beforeRemove" |
||||
:limit="1" |
||||
:on-exceed="handleExceed" |
||||
:action="this.api.fileupload" |
||||
name="file" |
||||
> |
||||
<img v-if="coverUrl" :src="coverUrl" class="avatar"> |
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i> |
||||
</el-upload> |
||||
</div> |
||||
<div class="item"> |
||||
<el-radio v-model="autograph" label="2">重新上传</el-radio> |
||||
<el-select v-model="agVal" size="mini"> |
||||
<el-option v-for="item in autographList" :key="item.id" :label="item.name" :value="item.id"></el-option> |
||||
</el-select> |
||||
<el-upload |
||||
class="avatar-uploader" |
||||
accept=".jpg,.png,.jpeg,.gif" |
||||
:on-remove="handleRemove" |
||||
:on-error="uploadError" |
||||
:on-success="uploadSuccess" |
||||
:before-remove="beforeRemove" |
||||
:limit="1" |
||||
:on-exceed="handleExceed" |
||||
:action="this.api.fileupload" |
||||
name="file" |
||||
> |
||||
<img v-if="coverUrl" :src="coverUrl" class="avatar"> |
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i> |
||||
</el-upload> |
||||
</div> |
||||
</div> |
||||
|
||||
</el-card> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
name: 'teachercomment', |
||||
data() { |
||||
return { |
||||
scoreList: [ |
||||
{ |
||||
id: 1, |
||||
label: 1 |
||||
},{ |
||||
id: 2, |
||||
label: 2 |
||||
},{ |
||||
id: 3, |
||||
label: 3 |
||||
}, |
||||
], |
||||
listData: [ |
||||
{ |
||||
id: 1, |
||||
score1: 1, |
||||
score2: 10, |
||||
comment: '' |
||||
}, |
||||
{ |
||||
id: 2, |
||||
score1: 1, |
||||
score2: 10, |
||||
comment: '' |
||||
}, |
||||
], |
||||
autograph: '1', |
||||
agVal: 1, |
||||
autographList: [ |
||||
{ |
||||
id: 1, |
||||
name: '签名一' |
||||
},{ |
||||
id: 2, |
||||
name: '签名二' |
||||
}, |
||||
] |
||||
}; |
||||
}, |
||||
mounted() { |
||||
// this.getData() |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
// let data = { |
||||
// countries: this.form.countries, |
||||
// provinceId: this.form.provinces, |
||||
// cityId: this.form.city, |
||||
// searchContent: this.form.keyword, |
||||
// pageNo: this.pageNo, |
||||
// pageSize: this.pageSize |
||||
// } |
||||
// this.$get(this.api.queryCustomer,data).then(res => { |
||||
// this.listData = res.message.rows |
||||
// this.totals = res.message.total |
||||
// }).catch(res => {}); |
||||
}, |
||||
entry(){ |
||||
this.$router.push('report') |
||||
}, |
||||
goback() { |
||||
this.$confirm('确定返回?未更新的信息将不会保存。', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$router.back() |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
handleExceed(files, fileList) { |
||||
this.$message.warning( |
||||
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` |
||||
); |
||||
}, |
||||
uploadSuccess(res, file, fileList) { |
||||
this.coverUrl = res.data.filesResult.fileUrl |
||||
}, |
||||
uploadLgSuccess(res, file, fileList) { |
||||
this.carouselUrl = res.data.filesResult.fileUrl |
||||
}, |
||||
uploadError(err, file, fileList) { |
||||
this.$message({ |
||||
message: "上传出错,请重试!", |
||||
type: "error", |
||||
center: true |
||||
}); |
||||
}, |
||||
beforeRemove(file, fileList) { |
||||
return this.$confirm(`确定移除 ${file.name}?`); |
||||
}, |
||||
handleRemove(file, fileList) { |
||||
this.uploadList = fileList |
||||
}, |
||||
addData(){ |
||||
this.listData.push({ |
||||
id: '', |
||||
score1: '', |
||||
score2: '', |
||||
comment: '', |
||||
}) |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.inline-input{ |
||||
width: 200px; |
||||
} |
||||
.inline{ |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
.el-select{ |
||||
width: 100px; |
||||
margin: 0 10px; |
||||
} |
||||
} |
||||
.plus{ |
||||
padding: 10px 0; |
||||
text-align: center; |
||||
background-color: #9278FF; |
||||
cursor: pointer; |
||||
i{ |
||||
font-size: 24px; |
||||
color: #fff; |
||||
} |
||||
} |
||||
.ags{ |
||||
display: flex; |
||||
|
||||
.item:first-child{ |
||||
padding-right: 20px; |
||||
margin-right: 20px; |
||||
border-right: 1px dashed #ccc; |
||||
} |
||||
.el-radio{ |
||||
margin-bottom: 10px; |
||||
} |
||||
/deep/.el-select{ |
||||
.el-input{ |
||||
width: 150px; |
||||
} |
||||
} |
||||
} |
||||
.avatar-uploader{ |
||||
margin-top: 15px; |
||||
} |
||||
.avatar-uploader /deep/.el-upload { |
||||
width: 220px; |
||||
height: 140px; |
||||
border: 1px dashed #d9d9d9; |
||||
border-radius: 6px; |
||||
cursor: pointer; |
||||
position: relative; |
||||
overflow: hidden; |
||||
} |
||||
.avatar-uploader-lg /deep/.el-upload { |
||||
width: 100%; |
||||
height: 300px; |
||||
} |
||||
.avatar-uploader .el-upload:hover { |
||||
border-color: #cb221c; |
||||
} |
||||
.avatar-uploader-icon { |
||||
font-size: 28px; |
||||
color: #8c939d; |
||||
width: 178px !important; |
||||
height: 178px; |
||||
line-height: 178px; |
||||
text-align: center; |
||||
} |
||||
.avatar { |
||||
width: 220px; |
||||
height: 140px; |
||||
display: block; |
||||
} |
||||
.avatar-lg { |
||||
width: 100%; |
||||
height: 300px; |
||||
display: block; |
||||
} |
||||
</style> |
||||
|
@ -1,350 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div> |
||||
<div class="flex-center mgb20"> |
||||
<p class="hr_tag"></p> |
||||
<span>筛选</span> |
||||
</div> |
||||
<div> |
||||
<el-form label-width="80px"> |
||||
<el-row> |
||||
<el-col :span="6"> |
||||
<el-form-item label="国家"> |
||||
<el-select v-model="form.countries" clearable placeholder="请选择国家"> |
||||
<el-option v-for="(item,index) in countryList" :key="index" :label="item.name" :value="item.value"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-form-item label="省份"> |
||||
<el-select v-model="form.provinces" clearable placeholder="请选择省份" @change="getCity" @clear="clearprovince()"> |
||||
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-form-item label="城市"> |
||||
<el-select v-model="form.city" clearable placeholder="请选择城市" |
||||
:disabled="form.provinces ? false : true" @clear="clearcity()" @change="getSchool"> |
||||
<el-option v-for="(item,index) in cityList" :key="index" :label="item.cityName" :value="item.cityId"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-form-item label="学校"> |
||||
<el-select v-model="form.schoolId" clearable placeholder="请选择学校" :disabled="form.city ? false : true" @change="getData()"> |
||||
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
|
||||
<el-row class="no-mb"> |
||||
<el-col :span="10"> |
||||
<el-form-item label="创建时间" class="userRadio"> |
||||
<el-radio-group v-model="form.month" @change="itemRadio"> |
||||
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="8"> |
||||
<el-form-item label="自定义"> |
||||
<el-date-picker v-model="form.date" align="right" unlink-panels type="daterange" |
||||
start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="selectTime" clearable></el-date-picker> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="6"> |
||||
<el-form-item> |
||||
<el-input placeholder="请输入用户姓名/学校名称" prefix-icon="el-icon-search" v-model="form.keyword" clearable @keyup.enter.native="onSearch"></el-input> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="hr_tag"></p> |
||||
<span>用户列表</span> |
||||
</div> |
||||
<div> |
||||
<el-button type="primary" size="small" round class="mag" @click="adduser">新增用户</el-button> |
||||
<el-button type="primary" size="small" round @click="delAllSelection">批量删除</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="userData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys"> |
||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="account" label="用户账号" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="username" label="姓名" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="countries" label="国家" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="provinceName" label="省份" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="cityName" label="城市" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="schoolName" label="学校名称" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="creationTime" label="创建时间" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="logInNumber" label="登录次数" align="center"> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text">密码重置</el-button> |
||||
<el-button type="text">查看</el-button> |
||||
<el-button type="text" @click="edit(scope.row)">编辑</el-button> |
||||
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background @current-change="currentChange" :current-page="pageNo" layout="total, prev, pager, next" :total="totals"> |
||||
</el-pagination> |
||||
</div> |
||||
</el-card> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import bus from '../common/bus'; |
||||
export default { |
||||
name: 'dashboard', |
||||
data() { |
||||
return { |
||||
form: { |
||||
name: '', |
||||
countries: '中国', |
||||
provinces: '', |
||||
city: '', |
||||
schoolId: '', |
||||
keyword: '', |
||||
date:'', |
||||
startTime: '', |
||||
endTime: '', |
||||
month: '' |
||||
}, |
||||
accountRoleList: [{ |
||||
name: '超级管理员', |
||||
value: 1 |
||||
}, |
||||
{ |
||||
name: '管理员', |
||||
value: 2 |
||||
}, |
||||
{ |
||||
name: '教师', |
||||
value: 3 |
||||
}, |
||||
{ |
||||
name: '学生', |
||||
value: 4 |
||||
}], |
||||
countryList: [{ |
||||
name:'中国' |
||||
}], |
||||
provinceList: this.$store.state.provinceList, |
||||
cityList: [], |
||||
schoolList: [], |
||||
userData:[], |
||||
dateList: [{ |
||||
id: '', |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
id: 3, |
||||
name: '3个月内' |
||||
}, |
||||
{ |
||||
id: 6, |
||||
name: '6个月内' |
||||
}, |
||||
{ |
||||
id: 9, |
||||
name: '9个月内' |
||||
}, |
||||
{ |
||||
id: 12, |
||||
name: '1年内' |
||||
}], |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
totals: 1, |
||||
multipleSelection: [] |
||||
}; |
||||
}, |
||||
mounted() { |
||||
// this.getData() |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
// let data = { |
||||
// countries: this.form.countries, |
||||
// provinceId: this.form.provinces, |
||||
// cityId: this.form.city, |
||||
// schoolId: this.form.schoolId, |
||||
// month: this.form.month, |
||||
// creationTime: this.form.startTime, |
||||
// endTime: this.form.endTime, |
||||
// searchContent: this.form.keyword, |
||||
// pageNo: this.pageNo, |
||||
// pageSize: this.pageSize |
||||
// } |
||||
// this.$get(this.api.queryUser,data).then(res => { |
||||
// this.userData = res.message.rows |
||||
// this.totals = res.message.total |
||||
// }).catch(res => {}); |
||||
}, |
||||
// 清除省份 |
||||
clearprovince(){ |
||||
this.form.city = '', |
||||
this.form.schoolId = '' |
||||
}, |
||||
// 获取城市 |
||||
getCity(){ |
||||
this.clearprovince() |
||||
this.getCityData() |
||||
this.pageNo = 1 |
||||
this.getData() |
||||
}, |
||||
getCityData(){ |
||||
let data = { |
||||
provinceId: this.form.provinces |
||||
} |
||||
this.$get(this.api.queryCity,data).then(res => { |
||||
this.cityList = res.message |
||||
}).catch(res => {}); |
||||
}, |
||||
// 清除城市 |
||||
clearcity(){ |
||||
this.form.schoolId = '' |
||||
}, |
||||
// 获取学校/客户名称 |
||||
getSchool(){ |
||||
this.clearcity() |
||||
this.getSchoolData() |
||||
this.pageNo = 1 |
||||
this.getData() |
||||
}, |
||||
getSchoolData(){ |
||||
let data = { |
||||
provinceId: this.form.provinces, |
||||
cityId: this.form.city |
||||
} |
||||
this.$get(this.api.querySchool,data).then(res => { |
||||
this.schoolList = res.message |
||||
}).catch(res => {}); |
||||
}, |
||||
onSearch(){ |
||||
this.pageNo = 1 |
||||
this.getData() |
||||
}, |
||||
itemRadio(val){ |
||||
this.form.month = val |
||||
this.form.date = '' |
||||
this.form.startTime = '' |
||||
this.form.endTime = '' |
||||
this.getData() |
||||
}, |
||||
selectTime(val){ |
||||
if(val){ |
||||
this.form.startTime = val[0] |
||||
this.form.endTime = val[1] |
||||
}else{ |
||||
this.form.startTime = '' |
||||
this.form.endTime = '' |
||||
} |
||||
this.form.month = '' |
||||
this.getData() |
||||
}, |
||||
currentChange(val) { |
||||
this.pageNo = val; |
||||
this.getData(); |
||||
}, |
||||
permission(){ |
||||
this.$router.push('/permission') |
||||
}, |
||||
adduser(){ |
||||
this.$store.commit("userData", { user_id : '', roleId: ''}); |
||||
this.$router.push('/adduser'); |
||||
}, |
||||
edit(row){ |
||||
this.$store.commit("userData", { user_id : row.userId }); |
||||
this.$router.push('/adduser'); |
||||
}, |
||||
handleDelete(row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
let obj = {} |
||||
Object.assign(obj, |
||||
{ |
||||
userId:row.userId, |
||||
phone: row.phone |
||||
}) |
||||
let arr = [] |
||||
arr.push(obj) |
||||
let data = arr |
||||
this.$post(this.api.deleteUser,data).then(res => { |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
getRowKeys(row) { |
||||
return row.userId; |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val; |
||||
}, |
||||
delAllSelection() { |
||||
if(this.multipleSelection.length != ''){ |
||||
let newArr = this.multipleSelection |
||||
let delList = newArr.map(item => { |
||||
return { |
||||
userId: item.userId, |
||||
phone: item.phone |
||||
} |
||||
}) |
||||
// 批量删除 |
||||
this.$confirm('确定要删除选中用户吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
let data = delList |
||||
this.$post(this.api.deleteUser,data).then(res => { |
||||
this.multipleSelection = []; |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}).catch(() => {}); |
||||
}else{ |
||||
this.$message.error('请先选择客户 !'); |
||||
} |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style scoped> |
||||
.mag{ |
||||
margin-right: 20px; |
||||
} |
||||
.no-mb /deep/.el-form-item{ |
||||
margin-bottom: 0; |
||||
} |
||||
/deep/.el-row{ |
||||
padding: 0 !important; |
||||
margin-bottom: 0; |
||||
} |
||||
</style> |
||||
|
@ -1,309 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div> |
||||
<div class="flex-center mgb20"> |
||||
<p class="hr_tag"></p> |
||||
<span>筛选</span> |
||||
</div> |
||||
<div> |
||||
<el-form label-width="100px"> |
||||
<div> |
||||
<el-form-item label="时间" class="userRadio"> |
||||
<el-radio-group v-model="month" @change="initData"> |
||||
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio> |
||||
</el-radio-group> |
||||
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker> |
||||
</el-form-item> |
||||
</div> |
||||
<div class="flex-between no-mb"> |
||||
<div class="flex-between"> |
||||
<el-form-item label="实验项目分类" class="userRadio"> |
||||
<el-radio-group v-model="projectPermissions" @change="initData"> |
||||
<el-radio v-for="(item,index) in projectType" :key="index" :label="item.id" border>{{item.name}}</el-radio> |
||||
</el-radio-group> |
||||
</el-form-item> |
||||
<el-form-item label="系统"> |
||||
<el-select v-model="systemId" placeholder="请选择" @change="initData"> |
||||
<el-option |
||||
v-for="item in systemList" |
||||
:key="item.value" |
||||
:label="item.label" |
||||
:value="item.id" |
||||
></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</div> |
||||
<div> |
||||
<el-form-item> |
||||
<el-input placeholder="请输入实验项目名称/班级名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> |
||||
</el-form-item> |
||||
</div> |
||||
</div> |
||||
</el-form> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="hr_tag"></p> |
||||
<span>成绩管理</span> |
||||
</div> |
||||
<div> |
||||
<el-button |
||||
type="primary" |
||||
size="small" |
||||
icon="el-icon-delete" |
||||
round |
||||
class="bt_one" |
||||
@click="delAllData" |
||||
>批量删除</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> |
||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" :selectable="disabledSelection"></el-table-column> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.$index + (pageNo - 1) * pageSize + 1}} |
||||
</template> |
||||
</el-table-column> |
||||
<template v-if="projectPermissions == 1"> |
||||
<el-table-column prop="experimentalClassName" label="班级" align="center"></el-table-column> |
||||
<el-table-column prop="experimentalName" label="实验名称" align="center"></el-table-column> |
||||
</template> |
||||
<el-table-column prop="projectName" label="项目名称" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="projectPermissions" label="分类" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.row.projectPermissions == 2 ? '竞赛' : projectType.find(n => n.id === scope.row.projectPermissions).name}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="number" label="成绩报告数量" align="center"></el-table-column> |
||||
<el-table-column prop="creationTime" label="创建时间" align="center"> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="entry(scope.row)" v-auth>成绩管理</el-button> |
||||
<el-button type="text" @click="handleDelete(scope.row)" :disabled="!scope.row.isdel">删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo"> |
||||
</el-pagination> |
||||
</div> |
||||
</el-card> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { Loading } from 'element-ui' |
||||
export default { |
||||
name: 'achievement', |
||||
data() { |
||||
return { |
||||
userId: this.$store.state.userLoginId, |
||||
keyword: '', |
||||
systemId: this.$store.state.experimentData.systemId ? this.$store.state.experimentData.systemId : this.$config.systemId, |
||||
systemList: this.$config.systemList, |
||||
projectPermissions: this.$route.query.per ? Number(this.$route.query.per) : 0, |
||||
startingtime: '', |
||||
endTime: '', |
||||
month: '', |
||||
listData: [], |
||||
multipleSelection: [], |
||||
dateList: [ |
||||
{ |
||||
id: '', |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '近一个月' |
||||
}, |
||||
{ |
||||
id: 6, |
||||
name: '近六个月' |
||||
} |
||||
], |
||||
projectType: [ |
||||
{ |
||||
id: 0, |
||||
name: '练习' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '考核' |
||||
} |
||||
], |
||||
date: '', |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
totals: 1, |
||||
loadIns: null, |
||||
listDataAll: [] |
||||
}; |
||||
}, |
||||
watch: { |
||||
month: function(val){ |
||||
if(val){ |
||||
let unit = 24 * 60 * 60 * 1000 |
||||
this.date = [this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))] |
||||
}else{ |
||||
this.date = [] |
||||
} |
||||
}, |
||||
date: function(val){ |
||||
if(val){ |
||||
this.startingtime = val[0] |
||||
this.endTime = val[1] |
||||
}else{ |
||||
this.startingtime = '' |
||||
this.endTime = '' |
||||
} |
||||
this.initData() |
||||
}, |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData() |
||||
},500) |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
this.loadIns = Loading.service({ |
||||
background: 'rgba(255,255,255,.6)' |
||||
}) |
||||
let data = { |
||||
searchContant: this.encodeString(this.keyword), |
||||
startTime: this.startingtime, |
||||
endTime: this.endTime, |
||||
month: this.month, |
||||
page: this.pageNo, |
||||
size: this.pageSize, |
||||
userId: this.userId |
||||
} |
||||
let url = this.api.queryAchievement |
||||
if(this.projectPermissions){ |
||||
data.systemId = this.systemId |
||||
url = this.api.queryAchievementNew |
||||
}else{ |
||||
data.systemId = this.systemId |
||||
data.projectPermissions = this.projectPermissions |
||||
} |
||||
this.$get(url,data).then(res => { |
||||
this.listData = res.data.list |
||||
this.totals = res.data.total |
||||
this.$nextTick(() => { |
||||
this.loadIns.close() |
||||
}) |
||||
}).catch(res => { |
||||
this.loadIns.close() |
||||
}) |
||||
}, |
||||
handlePage(){ |
||||
let list = this.listDataAll |
||||
let result = [] |
||||
list.map(n => { |
||||
if(!n.projectHiddenEntity) result.push(n) |
||||
}) |
||||
this.listData = result.slice((this.pageNo - 1) * this.pageSize,this.pageNo * this.pageSize) |
||||
this.totals = result.length |
||||
}, |
||||
initData(){ |
||||
this.$refs.table.clearSelection() |
||||
this.pageNo = 1 |
||||
this.getData() |
||||
}, |
||||
disabledSelection(row,index){ |
||||
if(row.isdel == 0) return false |
||||
return true |
||||
}, |
||||
entry(row){ |
||||
if(this.projectPermissions){ |
||||
this.$store.commit('addExperimentData',{experimentData: { |
||||
id: row.id, |
||||
name: row.projectName, |
||||
class: row.experimentalClassName, |
||||
systemId: this.systemId, |
||||
projectId: row.projectId, |
||||
experimentalName: row.experimentalName |
||||
}}) |
||||
this.$router.push('experimentTeach') |
||||
}else{ |
||||
this.$store.commit('addExperimentData',{experimentData: { |
||||
id: row.projectId, |
||||
name: row.projectName, |
||||
class: row.experimentalClassName, |
||||
systemId: this.systemId |
||||
}}) |
||||
this.$router.push('experimentVir') |
||||
} |
||||
}, |
||||
handleDelete(row) { |
||||
this.$confirm('该项目下的所有成绩报告将会删除,是否继续?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(`${this.api.deleteReportById}?projectIds=${row.projectId}&projectPermissions=${row.projectPermissions}&ids=${row.id ? row.id : ''}`).then(res => { |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
delAllData() { |
||||
if(this.multipleSelection.length != ''){ |
||||
let newArr = this.multipleSelection |
||||
let delList = newArr.map(item => { |
||||
return `projectIds=${item.projectId}` |
||||
}) |
||||
let delList1 = newArr[0].id ? newArr.map(item => { |
||||
return `ids=${item.id}` |
||||
}) : [] |
||||
|
||||
this.$confirm('该项目下的所有成绩报告将会删除,是否继续?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
console.log(delList,delList1) |
||||
let data = `${delList.join('&')}&projectPermissions=${this.projectPermissions}&${delList1.length ? delList1.join('&') : ''}` |
||||
console.log(11,data) |
||||
this.$post(`${this.api.deleteReportById}?${data}`).then(res => { |
||||
this.multipleSelection = []; |
||||
this.$refs.table.clearSelection() |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}else{ |
||||
this.$message.error('请先选择数据 !'); |
||||
} |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val; |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.pageNo = val; |
||||
this.getData(); |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.no-mb /deep/.el-form-item{ |
||||
margin-bottom: 0; |
||||
} |
||||
.el-radio.is-bordered+.el-radio.is-bordered{ |
||||
margin-left: 0; |
||||
} |
||||
</style> |
||||
|
@ -1,218 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="hr_tag"></p> |
||||
<span>系统列表</span> |
||||
</div> |
||||
<div> |
||||
<el-input placeholder="请输入系统名称" prefix-icon="el-icon-search" v-model="systemSearch" clearable></el-input> |
||||
</div> |
||||
</div> |
||||
<el-table :data="customerData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys"> |
||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.$index + (pageNo - 1) * pageSize + 1}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="schoolName" label="系统名称" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="adminPhone" label="创建时间" align="center"> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="entry(scope.row)">进入</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo"> |
||||
</el-pagination> |
||||
</div> |
||||
</el-card> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import bus from '../common/bus'; |
||||
export default { |
||||
name: 'dashboard', |
||||
data() { |
||||
return { |
||||
systemSearch: '', |
||||
name: sessionStorage.getItem('ms_username'), |
||||
countryList: [{ |
||||
name:'中国' |
||||
}], |
||||
customerData: [], |
||||
form: { |
||||
date:'', |
||||
project: '', |
||||
keyword: '' |
||||
}, |
||||
multipleSelection: [], |
||||
dateList: [ |
||||
{ |
||||
id: 1, |
||||
name: '近一个月' |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: '近三个月' |
||||
}, |
||||
{ |
||||
id: 3, |
||||
name: '近六个月' |
||||
} |
||||
], |
||||
projectType: [ |
||||
{ |
||||
id: 1, |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
id: 2, |
||||
name: '虚拟仿真实验' |
||||
}, |
||||
{ |
||||
id: 3, |
||||
name: '实验教学' |
||||
} |
||||
], |
||||
timeRange: '', |
||||
curTab: 'all', |
||||
provinceList: [], |
||||
cityList: [], |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
totals: 1, |
||||
ruleIds: [] |
||||
}; |
||||
}, |
||||
components: { |
||||
|
||||
}, |
||||
computed: { |
||||
role() { |
||||
return this.name === 'admin' ? '超级管理员' : '普通用户'; |
||||
} |
||||
}, |
||||
mounted() { |
||||
// this.getData() |
||||
// this.getProvince() |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
let data = { |
||||
countries: this.form.countries, |
||||
provinceId: this.form.provinces, |
||||
cityId: this.form.city, |
||||
searchContent: this.form.keyword, |
||||
pageNo: this.pageNo, |
||||
pageSize: this.pageSize |
||||
} |
||||
this.$get(this.api.queryCustomer,data).then(res => { |
||||
this.customerData = res.message.rows |
||||
this.totals = res.message.total |
||||
}).catch(res => {}); |
||||
}, |
||||
entry(){ |
||||
this.$router.push('/permission') |
||||
}, |
||||
addcustomer(){ |
||||
this.$store.commit("customerData", { customer_id : ''}); |
||||
this.$router.push('/addcustomer'); |
||||
}, |
||||
edit(row){ |
||||
this.$store.commit("customerData", { customer_id : row.customerId }); |
||||
this.$router.push('/addcustomer'); |
||||
}, |
||||
handleDelete(row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
let str = ''; |
||||
str += row.customerId+','; |
||||
var deleteList = str.split(',').map(Number); |
||||
deleteList.pop() |
||||
var arr = []; |
||||
var signAgainReq = new Object(); |
||||
signAgainReq.customerId = deleteList[0]; |
||||
arr.push(signAgainReq); |
||||
|
||||
let data = { |
||||
customer: arr |
||||
} |
||||
this.$post(this.api.deleteCustomer,data).then(res => { |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
getRowKeys(row) { |
||||
return row.customerId; |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val; |
||||
}, |
||||
delAllSelection() { |
||||
if(this.multipleSelection.length != ''){ |
||||
const length = this.multipleSelection.length; |
||||
let str = ''; |
||||
for (let i = 0; i < length; i++) { |
||||
str += this.multipleSelection[i].customerId+','; |
||||
} |
||||
var deleteList = str.split(',').map(Number); |
||||
deleteList.pop() |
||||
var arr = []; |
||||
for(var i = 0,len = deleteList.length; i < len; i++){ |
||||
var signAgainReq = new Object(); |
||||
signAgainReq.customerId = deleteList[i]; |
||||
arr.push(signAgainReq); |
||||
} |
||||
// 批量删除 |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
let data = { |
||||
customer: arr |
||||
} |
||||
this.$post(this.api.deleteCustomer,data).then(res => { |
||||
this.multipleSelection = []; |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}).catch(() => {}); |
||||
}else{ |
||||
this.$message.error('请先选择客户 !'); |
||||
} |
||||
}, |
||||
onSearch(){ |
||||
this.pageNo = 1 |
||||
this.getData() |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.pageNo = val; |
||||
this.getData(); |
||||
}, |
||||
tabChange(tab,event) { |
||||
console.log(tab,event) |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style scoped> |
||||
.mag{ |
||||
margin-right: 20px; |
||||
} |
||||
/deep/.el-tabs__nav-wrap::after{ |
||||
display: none; |
||||
} |
||||
</style> |
||||
|
@ -1,442 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div> |
||||
<div class="flex-center mgb20"> |
||||
<p class="hr_tag"></p> |
||||
<span>筛选</span> |
||||
</div> |
||||
<div> |
||||
<el-form label-width="80px"> |
||||
<div> |
||||
<el-form-item label="实验时间" class="userRadio"> |
||||
<el-radio-group v-model="form.month" @change="initData"> |
||||
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio> |
||||
</el-radio-group> |
||||
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" style="margin-left: 10px;" |
||||
start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker> |
||||
</el-form-item> |
||||
</div> |
||||
<div class="flex-between no-mb"> |
||||
<div class="flex-center"> |
||||
<el-form-item label="发布类型"> |
||||
<el-select v-model="form.type" clearable placeholder="请选择发布类型" @change="initData"> |
||||
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.value"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="实验状态"> |
||||
<el-select v-model="form.status" clearable placeholder="请选择实验状态" @change="initData"> |
||||
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="系统" label-width="60px"> |
||||
<el-select v-model="systemId" placeholder="请选择" @change="initData"> |
||||
<el-option label="不限" value=""></el-option> |
||||
<el-option |
||||
v-for="item in systemList" |
||||
:key="item.value" |
||||
:label="item.label" |
||||
:value="item.id" |
||||
></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</div> |
||||
<div> |
||||
<el-form-item> |
||||
<el-input placeholder="请输入实验班级/项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable @keyup.enter.native="onSearch"></el-input> |
||||
</el-form-item> |
||||
</div> |
||||
</div> |
||||
</el-form> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="hr_tag"></p> |
||||
<span>实验教学列表</span> |
||||
</div> |
||||
<div> |
||||
<el-button |
||||
type="primary" |
||||
size="small" |
||||
icon="el-icon-plus" |
||||
round |
||||
@click="add" |
||||
class="bt_one" |
||||
v-auth |
||||
>创建实验</el-button> |
||||
<el-button |
||||
type="primary" |
||||
size="small" |
||||
icon="el-icon-delete" |
||||
round |
||||
class="bt_one" |
||||
@click="delAllData" |
||||
v-auth |
||||
>批量删除</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table ref="table" :data="customerData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> |
||||
<el-table-column type="selection" :selectable="row => row.status!=2" width="50" align="center" :reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" width="60" label="序号" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.$index + (pageNo - 1) * pageSize + 1}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="experimentalClassName" label="实验班级" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="experimentalName" label="考核名称" min-width="120" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="projectName" label="项目名称" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="experimentalNumber" label="实验人数" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="experimentDuration" label="实验时长" align="center"> |
||||
</el-table-column> |
||||
<el-table-column label="邀请码" align="center"> |
||||
<template slot-scope="scope"> |
||||
<span>{{scope.row.isCode == 0 ? scope.row.invitationCode : ''}}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="adminName" label="发布类型" align="center"> |
||||
<template slot-scope="scope"> |
||||
<span>{{types[scope.row.type]}}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="creationTime" width="150" label="创建时间" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="startTime" width="150" label="起始时间" align="center"> |
||||
<template slot-scope="scope"> |
||||
<span>{{transferTime(scope.row.startTime,scope.row.type)}}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="stopTime" width="150" label="结束时间" align="center"> |
||||
<template slot-scope="scope"> |
||||
<span>{{transferTime(scope.row.stopTime,scope.row.type)}}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="surplusTime" label="倒计时" align="center"> |
||||
<!-- <template slot-scope="scope"> |
||||
<span v-if="scope.row.status == 2" v-countdown="scope.row.surplusTime">{{scope.row.surplusTime}}</span> |
||||
<span v-else>00:00:00</span> |
||||
</template> --> |
||||
</el-table-column> |
||||
<el-table-column label="实验状态" align="center"> |
||||
<template slot-scope="scope"> |
||||
<span>{{status[scope.row.status]}}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center" width="170"> |
||||
<template slot-scope="scope"> |
||||
<template v-if="scope.row.status == 1"> |
||||
<el-button type="text" @click="start(scope.row)" v-auth>启动</el-button> |
||||
<el-button type="text" @click="edit(scope.row)" v-auth>修改</el-button> |
||||
</template> |
||||
<template v-else-if="scope.row.status == 2"> |
||||
<el-button type="text" @click="finish(scope.row)" v-auth>提前结束</el-button> |
||||
</template> |
||||
<template v-else-if="scope.row.status == 3"> |
||||
<el-button type="text" @click="show(scope.row)" v-auth>查看成绩</el-button> |
||||
</template> |
||||
<el-button v-if="scope.row.status == 1 || scope.row.status == 3" type="text" @click="delData(scope.row)" v-auth>删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo"> |
||||
</el-pagination> |
||||
</div> |
||||
</el-card> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import bus from '../common/bus'; |
||||
import axios from 'axios'; |
||||
export default { |
||||
name: 'dashboard', |
||||
data() { |
||||
return { |
||||
name: sessionStorage.getItem('ms_username'), |
||||
schoolId: this.$store.state.schoolId, |
||||
systemId: '', |
||||
systemList: this.$config.systemList, |
||||
keyword: '', |
||||
typeList: [ |
||||
{ |
||||
value: '', |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
value: 1, |
||||
name: '手动发布' |
||||
}, |
||||
{ |
||||
value: 2, |
||||
name: '定时发布' |
||||
} |
||||
], |
||||
status: ['','待开始','进行中','已完成'], |
||||
types: ['','手动发布','定时发布'], |
||||
statusList: [ |
||||
{ |
||||
value: '', |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
value: 1, |
||||
name: '待开始' |
||||
}, |
||||
{ |
||||
value: 2, |
||||
name: '进行中' |
||||
}, |
||||
{ |
||||
value: 3, |
||||
name: '已完成' |
||||
} |
||||
], |
||||
customerData: [], |
||||
form: { |
||||
type: '', |
||||
status: '', |
||||
startTime: '', |
||||
stopTime: '', |
||||
month: '', |
||||
searchContent: '' |
||||
}, |
||||
multipleSelection: [], |
||||
dateList: [ |
||||
{ |
||||
id: '', |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '近一个月' |
||||
}, |
||||
{ |
||||
id: 3, |
||||
name: '近三个月' |
||||
}, |
||||
{ |
||||
id: 6, |
||||
name: '近六个月' |
||||
} |
||||
], |
||||
date: [], |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
totals: 0, |
||||
ruleIds: [], |
||||
timer: null |
||||
}; |
||||
}, |
||||
directives: { |
||||
countdown: { |
||||
bind: function(el,binding,vnode) { |
||||
let that = vnode.context |
||||
let time = binding.value |
||||
let timer = setInterval(() => { |
||||
let timeList = time.split(':') |
||||
let total = Number.parseInt(timeList[0] * 60 * 60) + Number.parseInt(timeList[1] * 60) + Number.parseInt(timeList[2]) |
||||
if(total > 0){ |
||||
--total |
||||
let hours = Math.floor(total / (60 * 60)) |
||||
let minutes = Math.floor(total % (60 * 60) / 60) |
||||
let seconds = Math.floor(total % (60 * 60) % 60) |
||||
time = `${that.formateTime(hours)}:${that.formateTime(minutes)}:${that.formateTime(seconds)}` |
||||
}else{ |
||||
clearInterval(timer) |
||||
} |
||||
// console.log(11,time) |
||||
el.innerHTML = time |
||||
},1000) |
||||
that.timerList.push(timer) |
||||
} |
||||
} |
||||
}, |
||||
watch: { |
||||
'form.month': function(val){ |
||||
if(val){ |
||||
let unit = 24 * 60 * 60 * 1000 |
||||
this.date = [this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))] |
||||
}else{ |
||||
this.date = [] |
||||
} |
||||
}, |
||||
date: function(val){ |
||||
if(val){ |
||||
this.form.startTime = val[0] |
||||
this.form.stopTime = val[1] |
||||
}else{ |
||||
this.form.startTime = '' |
||||
this.form.stopTime = '' |
||||
} |
||||
this.initData() |
||||
}, |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData() |
||||
},500) |
||||
} |
||||
}, |
||||
computed: { |
||||
role() { |
||||
return this.name === 'admin' ? '超级管理员' : '普通用户'; |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getData() |
||||
this.timer = setInterval(this.getData,1000) |
||||
this.$once('hook:beforeDestroy',() => { |
||||
clearInterval(this.timer) |
||||
}) |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
let data = { |
||||
type: this.form.type, |
||||
startTime: this.form.startTime, |
||||
stopTime: this.form.stopTime, |
||||
month: this.form.month, |
||||
searchContent: this.encodeString(this.keyword), |
||||
status: this.form.status, |
||||
page: this.pageNo, |
||||
size: this.pageSize, |
||||
systemId: this.systemId, |
||||
schoolId: this.schoolId ? this.schoolId : '' |
||||
} |
||||
this.$get(this.api.expList,data).then(res => { |
||||
this.customerData = res.list.list |
||||
this.totals = res.list.totalCount |
||||
}).catch(res => {}); |
||||
}, |
||||
initData(){ |
||||
this.$refs.table.clearSelection() |
||||
this.pageNo = 1 |
||||
this.getData() |
||||
}, |
||||
permission(){ |
||||
this.$router.push('/permission') |
||||
}, |
||||
add(){ |
||||
this.$router.push('addclass') |
||||
}, |
||||
edit(row){ |
||||
this.$router.push(`addclass?id=${row.id}`) |
||||
}, |
||||
show(row){ |
||||
this.$store.commit('addExperimentData',{experimentData: { |
||||
systemId: this.systemId, |
||||
id: row.id, |
||||
projectId: row.projectId, |
||||
name: row.projectName, |
||||
experimentalName: row.experimentalName, |
||||
class: row.experimentalClassName, |
||||
}}) |
||||
this.$router.push('experiment') |
||||
}, |
||||
start(row){ |
||||
let data = { |
||||
id: row.id, |
||||
startTime: this.formatDate("yyyy-MM-dd hh:mm:ss",new Date()), |
||||
status: 2 |
||||
} |
||||
this.$post(this.api.expUpdate,data).then(res => { |
||||
if(res.errmessage == 'success') { |
||||
this.$message.success('启动成功!') |
||||
this.getData() |
||||
} |
||||
}).catch(res => {}); |
||||
}, |
||||
finish(row){ |
||||
this.$confirm('确定要提前结束吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
let data = { |
||||
id: row.id, |
||||
stopTime: this.formatDate("yyyy-MM-dd hh:mm:ss",new Date()), |
||||
status: 3 |
||||
} |
||||
this.$post(this.api.expUpdate,data).then(res => { |
||||
if(res.errmessage == 'success') { |
||||
this.$message.success('提前结束成功!') |
||||
this.getData() |
||||
} |
||||
}).catch(res => {}) |
||||
}) |
||||
.catch(() => {}) |
||||
}, |
||||
delData(row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(this.api.expDelete,[row.id]).then(res => { |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
delAllData() { |
||||
if(this.multipleSelection.length != ''){ |
||||
let newArr = this.multipleSelection |
||||
let delList = newArr.map(item => { |
||||
return item.id |
||||
}) |
||||
|
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
let data = delList |
||||
this.$post(this.api.expDelete,data).then(res => { |
||||
this.multipleSelection = []; |
||||
this.$refs.table.clearSelection() |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}else{ |
||||
this.$message.error('请先选择数据 !'); |
||||
} |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val; |
||||
}, |
||||
onSearch(){ |
||||
this.pageNo = 1 |
||||
this.getData() |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.pageNo = val; |
||||
this.getData(); |
||||
}, |
||||
transferTime(date,type){ |
||||
if(date == '0000-00-00 00:00:00') return '---' |
||||
return date |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style scoped> |
||||
.mag{ |
||||
margin-right: 20px; |
||||
} |
||||
/deep/.el-tabs__nav-wrap::after{ |
||||
display: none; |
||||
} |
||||
.no-mb /deep/.el-form-item{ |
||||
margin-bottom: 0; |
||||
} |
||||
</style> |
||||
|
@ -1,418 +0,0 @@ |
||||
<template> |
||||
<div> |
||||
<el-card v-if="showBack" shadow="hover" class="mgb20"> |
||||
<div class="flex-between"> |
||||
<div class="per_title" v-preventReClick @click="goback()"> |
||||
<i class="el-icon-arrow-left"></i> |
||||
<span class="per_back">返回</span> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div> |
||||
<div class="flex-center mgb20"> |
||||
<p class="hr_tag"></p> |
||||
<span>筛选</span> |
||||
</div> |
||||
<div> |
||||
<el-form label-width="80px" class="flex-between no-mb"> |
||||
<div class="flex-center"> |
||||
<div> |
||||
<el-form-item label="创建人"> |
||||
<el-select v-model="queryData.founder" clearable placeholder="请选择创建人" @change="initData"> |
||||
<el-option v-for="(item,index) in founder" :key="index" :label="item.label" :value="item.value"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</div> |
||||
<div> |
||||
<el-form-item label="状态"> |
||||
<el-select v-model="queryData.state" clearable placeholder="请选择状态" @change="initData"> |
||||
<el-option v-for="(item,index) in state" :key="index" :label="item.label" :value="item.value"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</div> |
||||
<div> |
||||
<el-form-item label="权限"> |
||||
<el-select v-model="queryData.projectPermissions" placeholder="请选择" @change="initData"> |
||||
<el-option |
||||
v-for="item in projectPermissions" |
||||
:key="item.value" |
||||
:label="item.label" |
||||
:value="item.value" |
||||
></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</div> |
||||
<div> |
||||
<el-form-item label="系统"> |
||||
<el-select v-model="systemId" placeholder="请选择" @change="initData"> |
||||
<el-option |
||||
v-for="item in systemList" |
||||
:key="item.value" |
||||
:label="item.label" |
||||
:value="item.id" |
||||
></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</div> |
||||
</div> |
||||
<div> |
||||
<el-form-item> |
||||
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> |
||||
</el-form-item> |
||||
</div> |
||||
</el-form> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="hr_tag"></p> |
||||
<span>项目列表</span> |
||||
</div> |
||||
<div> |
||||
<el-button type="primary" size="small" round @click="add" v-auth>新增项目</el-button> |
||||
<el-button type="primary" size="small" round @click="delAllData" v-auth>批量删除</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="projectData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange"> |
||||
<el-table-column type="selection" width="55" align="center"></el-table-column> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
<template slot-scope="scope">{{scope.$index + (pageNo - 1) * pageSize + 1}}</template> |
||||
</el-table-column> |
||||
<el-table-column prop="projectName" label="实验项目名称" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="founder" label="创建人" align="center"></el-table-column> |
||||
<el-table-column label="权限" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.row.projectPermissions == 2 ? '竞赛' : projectPermissions.find(n => n.value === scope.row.projectPermissions).label}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="creationTime" label="创建时间" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="status" label="状态" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{transferStatus(scope.row.state)}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="edit(scope.row)" v-auth v-if="roleId == 1 || (roleId == 13 && scope.row.founder != '超级管理员') || (roleId == 14 && scope.row.founder == '老师')">编辑</el-button> |
||||
<el-button type="text" @click="delData(scope.row)" v-auth v-if="roleId == 1 || (roleId == 13 && scope.row.founder != '超级管理员') || (roleId == 14 && scope.row.founder == '老师')">删除</el-button> |
||||
<el-button type="text" @click="copyData(scope.row)" v-auth>复制</el-button> |
||||
<el-switch |
||||
v-model="scope.row.enable" |
||||
:active-text="scope.row.enable ? '关闭' : '启用'" |
||||
:active-value="0" |
||||
:inactive-value="1" |
||||
style="margin: 0 10px 0 10px" |
||||
@change="switchOff($event,scope.row,scope.$index)" |
||||
></el-switch> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background @current-change="handleCurrentChange" :current-page="pageNo" layout="total, prev, pager, next" :total="totals"></el-pagination> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-dialog title="复制" :visible.sync="copyVisible" width="24%" center :close-on-click-modal="false"> |
||||
<el-form> |
||||
<el-form-item> |
||||
<el-input placeholder="请输入项目名称" v-model="projectName" @change="projectNameExistis"></el-input> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="copyVisible = false">取 消</el-button> |
||||
<el-button type="primary" @click="copySubmit">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import bus from '../common/bus'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
showBack: JSON.stringify(this.$store.state.addClass) == '{}' ? false : true, |
||||
roleId: this.$store.state.userRoleId.includes(',') ? 13 : Number(this.$store.state.userRoleId), |
||||
userId: this.$store.state.userLoginId, |
||||
systemId: this.$store.state.systemId ? this.$store.state.systemId : this.$config.systemId, |
||||
systemList: this.$config.systemList, |
||||
queryData: { |
||||
projectPermissions: "", |
||||
founder: "", |
||||
state: "", |
||||
projectName: "", |
||||
userId: this.$store.state.userLoginId, |
||||
systemId: this.systemId |
||||
}, |
||||
keyword: '', |
||||
status: '', |
||||
projectData:[], |
||||
totals: 0, |
||||
projectPermissions: [ |
||||
{ |
||||
value: "", |
||||
label: "不限" |
||||
}, |
||||
{ |
||||
value: 0, |
||||
label: "练习" |
||||
}, |
||||
{ |
||||
value: 1, |
||||
label: "考核" |
||||
}, |
||||
// { |
||||
// value: 2, |
||||
// label: "竞赛" |
||||
// } |
||||
], |
||||
founder: [ |
||||
{ |
||||
value: "", |
||||
label: "不限" |
||||
}, |
||||
{ |
||||
value: 1, |
||||
label: "超级管理员" |
||||
}, |
||||
{ |
||||
value: 13, |
||||
label: "管理员" |
||||
}, |
||||
{ |
||||
value: 14, |
||||
label: "老师" |
||||
} |
||||
], |
||||
state: [ |
||||
{ |
||||
value: "", |
||||
label: "不限" |
||||
}, |
||||
{ |
||||
value: 0, |
||||
label: "草稿箱" |
||||
}, |
||||
{ |
||||
value: 1, |
||||
label: "已发布" |
||||
} |
||||
], |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
multipleSelection: [], |
||||
copyVisible: false, |
||||
projectName: '', |
||||
projectNameRepeat: false, |
||||
currentRow: {}, |
||||
projectDataAll: [] |
||||
}; |
||||
}, |
||||
watch: { |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData() |
||||
},500) |
||||
} |
||||
}, |
||||
mounted() { |
||||
console.log(11,this.roleId) |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
getData(){ |
||||
this.$store.commit("addProjectSystemIdData",{systemId : this.systemId}) |
||||
let data = this.queryData |
||||
data.pageNo = this.pageNo |
||||
data.pageSize = this.pageSize |
||||
data.projectName = this.encodeString(this.keyword) |
||||
data.systemId = this.systemId |
||||
this.$get(this.api.queryAllManagements,data).then(res => { |
||||
let list = res.pageInfo.list |
||||
let newList = [] |
||||
// list.map(n => { |
||||
// if(this.roleId == 14){ |
||||
// (n.userId == this.userId || n.founder == 1 || n.founder == 13) && newList.push(n) |
||||
// }else{ |
||||
// newList.push(n) |
||||
// } |
||||
// }) |
||||
list.map(n => { |
||||
if(n.founder.includes(',')){ |
||||
n.founder = '管理员' |
||||
}else{ |
||||
n.founder = this.roleStatus(n.founder) |
||||
} |
||||
}) |
||||
this.projectData = list |
||||
this.totals = res.pageInfo.total |
||||
}).catch(res => {}); |
||||
}, |
||||
initData(){ |
||||
this.pageNo = 1 |
||||
this.getData() |
||||
}, |
||||
handlePage(){ |
||||
let list = this.projectDataAll |
||||
let result = list.slice((this.pageNo - 1) * this.pageSize,this.pageNo * this.pageSize) |
||||
this.projectData = result |
||||
}, |
||||
transferStatus(status){ |
||||
return status == 1 ? '已发布' : '草稿箱' |
||||
}, |
||||
handleCurrentChange(val){ |
||||
this.pageNo = val |
||||
this.getData() |
||||
}, |
||||
add(){ |
||||
this.$store.commit("addProjectSystemIdData", { systemId : this.systemId}); |
||||
this.$router.push('/addproject'); |
||||
}, |
||||
edit(row){ |
||||
this.$store.commit("addProjectSystemIdData", { systemId : row.systemId}); |
||||
this.$router.push(`/addproject?id=${row.projectId}`); |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val; |
||||
}, |
||||
delData(row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(this.api.removeProjectManagement,[row.projectId]).then(res => { |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
delAllData() { |
||||
if(this.multipleSelection.length != ''){ |
||||
let newArr = this.multipleSelection |
||||
let delList = newArr.map(item => { |
||||
return item.projectId |
||||
}) |
||||
|
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(this.api.removeProjectManagement,delList).then(res => { |
||||
this.multipleSelection = []; |
||||
this.$refs.table.clearSelection() |
||||
this.$message.success('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}else{ |
||||
this.$message.error('请先选择项目 !'); |
||||
} |
||||
}, |
||||
projectNameExistis(){ |
||||
let data = { |
||||
projectName: this.encodeString(this.projectName) |
||||
} |
||||
this.$get(this.api.isNameExistis,data).then(res => { |
||||
if(res.status != 200){ |
||||
this.projectNameRepeat = true |
||||
this.$message.warning('该项目名称已存在') |
||||
}else{ |
||||
this.projectNameRepeat = false |
||||
} |
||||
}).catch(res => {}) |
||||
}, |
||||
copyData(row){ |
||||
this.currentRow.management = { |
||||
caseDescription: row.caseDescription, |
||||
experimentSuggests: row.experimentSuggests, |
||||
experimentalGoal: row.experimentalGoal, |
||||
founder: row.founder, |
||||
isstartexperimentSuggests: row.isstartexperimentSuggests, |
||||
isstartexperimental: row.isstartexperimental, |
||||
projectName: row.projectName, |
||||
projectPermissions: row.projectPermissions, |
||||
state: row.state, |
||||
systemId: row.systemId, |
||||
userId: row.userId, |
||||
knowledgePoints: row.knowledgePoints, |
||||
experimentIntroduction: row.experimentIntroduction |
||||
} |
||||
this.currentRow.founder = row.founder |
||||
this.projectName = row.projectName |
||||
this.projectNameRepeat = true |
||||
this.copyVisible = true |
||||
let data = { |
||||
projectId: row.projectId |
||||
} |
||||
this.$get(this.api.getZZJudgmentPoints,data).then((res) => { |
||||
this.currentRow.roleId = res.message.roleList.map(n => n.roleId) |
||||
let scoreList = res.message.scoreIndexList |
||||
let scores = [] |
||||
for(let i in scoreList){ |
||||
scores = scores.concat(scoreList[i]) |
||||
} |
||||
let point = res.message.judgmentPointsList |
||||
point.map(n => { |
||||
let same = scores.find(e => e.judgmentPointsId == n.judgmentPointsId) |
||||
if(same) n.score = same.score |
||||
}) |
||||
this.currentRow.pooints = point |
||||
this.$message.warning('请修改项目名称') |
||||
}) |
||||
}, |
||||
copySubmit(){ |
||||
if(!this.projectName.length) return this.$message.warning('请填写项目名称') |
||||
if(this.projectNameRepeat) return this.$message.warning('该项目名称已存在') |
||||
let data = this.currentRow |
||||
data.management.projectName = this.projectName |
||||
data.founder = this.roleId |
||||
data.management.founder = this.roleId |
||||
data.management.userId = this.userId |
||||
data.pooints.map(n => { |
||||
n.userId = this.userId |
||||
}) |
||||
let systemId = this.currentRow.management.systemId |
||||
let url = this.api.addProjectManagement |
||||
if(systemId == 2 || systemId == 3) url = this.api.addProjectManagementTrad |
||||
this.$post(url,data).then((res) => { |
||||
this.$message.success('复制成功'); |
||||
this.copyVisible = false |
||||
this.getData() |
||||
}) |
||||
}, |
||||
switchOff(val,row,index) { |
||||
this.$get(this.api.enableProject,{ |
||||
id: row.projectId, |
||||
enable: row.enable |
||||
}) |
||||
.then(res => { |
||||
if(res.status != 200){ |
||||
this.$message.error(res.errmessage) |
||||
row.enable = row.enable == 1 ? 0 : 1 |
||||
} |
||||
}) |
||||
.catch(err => {}); |
||||
}, |
||||
goback() { |
||||
this.$router.back() |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style scoped> |
||||
.no-mb /deep/.el-form-item{ |
||||
margin-bottom: 0; |
||||
} |
||||
</style> |
||||
|
@ -1,115 +0,0 @@ |
||||
<template> |
||||
<div class="Achievement-container"> |
||||
<div class="tabs" v-if="showTabs"> |
||||
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a> |
||||
</div> |
||||
|
||||
<div class="score-table" v-if="active == 'first'" v-auth="'系统设置:员工管理'"> |
||||
<staff></staff> |
||||
</div> |
||||
<div class="score-table" v-else v-auth="'系统设置:角色权限'"> |
||||
<role></role> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import staff from './Staff.vue'; |
||||
import role from './Role.vue'; |
||||
export default { |
||||
data() { |
||||
return { |
||||
active: 'first', |
||||
userId: this.$store.state.userId, |
||||
tabs: { |
||||
first: '员工管理', |
||||
second: '角色权限' |
||||
}, |
||||
showTabs: true |
||||
}; |
||||
}, |
||||
components: { |
||||
staff, |
||||
role |
||||
}, |
||||
created() { |
||||
this.$config.dynamicRoute && this.initTabs() |
||||
}, |
||||
methods: { |
||||
tabChange(index){ |
||||
this.active = index |
||||
}, |
||||
initTabs(){ |
||||
let btnPermissions = this.$store.state.btnPermissions |
||||
let showStaff = btnPermissions.includes('系统设置:员工管理') |
||||
let showRole = btnPermissions.includes('系统设置:角色权限') |
||||
|
||||
if(!showStaff || !showRole){ |
||||
this.showTabs = false |
||||
} |
||||
|
||||
!showStaff && showRole && (this.active = 'second') |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scopted> |
||||
.Achievement-container { |
||||
width: 100%; |
||||
box-shadow: 0px 0px 21px 0px rgba(48, 115, 248, 0.1); |
||||
text-align: center; |
||||
overflow: hidden; |
||||
.header { |
||||
width: 97%; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
margin: 0 auto; |
||||
margin-top: 16px; |
||||
p { |
||||
margin-top: 14px; |
||||
font-size: 20px; |
||||
font-family: MicrosoftYaHeil; |
||||
color: #333333; |
||||
} |
||||
} |
||||
.score-table { |
||||
margin: 0 auto; |
||||
margin-top: 18px; |
||||
position: relative; |
||||
.block { |
||||
position: absolute; |
||||
right: 0px; |
||||
bottom: -50px; |
||||
} |
||||
} |
||||
.el-pagination.is-background .el-pager li:not(.disabled).active { |
||||
background-color: #9278ff; |
||||
color: #fff; |
||||
} |
||||
} |
||||
.tabs{ |
||||
display: flex; |
||||
align-items: center; |
||||
padding: 20px 1.5% 20px; |
||||
margin: 0; |
||||
z-index: 999; |
||||
background-color: #fff; |
||||
.item{ |
||||
padding: 12px 20px; |
||||
margin-right: 10px; |
||||
color:#606266; |
||||
line-height: 1; |
||||
border-radius: 4px; |
||||
background-color: #fff; |
||||
border: 1px solid #dcdfe6; |
||||
cursor: pointer; |
||||
|
||||
&.active{ |
||||
color: #fff; |
||||
background-color: #9278ff; |
||||
border-color: #9278ff; |
||||
} |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,124 @@ |
||||
<template> |
||||
<div> |
||||
<el-dialog |
||||
custom-class="pdf-dia" |
||||
:close-on-click-modal="false" |
||||
:visible.sync="visible" |
||||
@close="closePdf" |
||||
:fullscreen="true" |
||||
:modal="false" |
||||
:append-to-body="true"> |
||||
<div> |
||||
<button type="button" aria-label="Close" class="el-dialog__headerbtn" @click="closePdf"><i class="el-dialog__close el-icon el-icon-close"></i></button> |
||||
<div class="pdf"> |
||||
<p class="arrow"> |
||||
<span @click="changePdfPage(0)" class="turn el-icon-arrow-left" :class="{grey: currentPage==1}"></span> |
||||
{{currentPage}} / {{pageCount}} |
||||
<span @click="changePdfPage(1)" class="turn el-icon-arrow-right" :class="{grey: currentPage==pageCount}"></span> |
||||
</p> |
||||
<pdf |
||||
class="pdf-wrap" |
||||
:src="src" |
||||
:page="currentPage" |
||||
@num-pages="pageCount=$event" |
||||
@page-loaded="currentPage=$event" |
||||
@loaded="loadPdfHandler" |
||||
> |
||||
</pdf> |
||||
</div> |
||||
</div> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import pdf from "vue-pdf"; |
||||
export default { |
||||
props: ['visible','src'], |
||||
data() { |
||||
return { |
||||
pdfVisible: false, |
||||
pdfSrc: '', |
||||
currentPage: 0, |
||||
pageCount: 0, |
||||
fileType: 'pdf', |
||||
}; |
||||
}, |
||||
components: { pdf }, |
||||
mounted(){ |
||||
this.addEvent() |
||||
}, |
||||
methods: { |
||||
closePdf(){ |
||||
this.$emit('update:visible',false) |
||||
this.$emit('update:src','') |
||||
this.currentPage = 1 |
||||
}, |
||||
changePdfPage (val) { |
||||
if (val === 0 && this.currentPage > 1) { |
||||
this.currentPage-- |
||||
} |
||||
if (val === 1 && this.currentPage < this.pageCount) { |
||||
this.currentPage++ |
||||
} |
||||
}, |
||||
loadPdfHandler (e) { |
||||
this.currentPage = 1 |
||||
}, |
||||
addEvent(){ |
||||
document.onkeydown = e => { |
||||
let key = window.event.keyCode |
||||
if(key == 37){ |
||||
this.changePdfPage(0) |
||||
}else if(key == 39){ |
||||
this.changePdfPage(1) |
||||
} |
||||
} |
||||
this.$once('hook:beforeDestroy',() => { |
||||
document.onkeydown = null |
||||
}) |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
/deep/.pdf-dia{ |
||||
border-radius: 0 !important; |
||||
.el-dialog__header{ |
||||
display: none; |
||||
} |
||||
.el-dialog__body{ |
||||
padding: 0; |
||||
} |
||||
.el-dialog__headerbtn{ |
||||
top: 10px; |
||||
.el-dialog__close{ |
||||
color: #fff; |
||||
font-size: 16px; |
||||
} |
||||
} |
||||
|
||||
.pdf{ |
||||
.arrow{ |
||||
display: flex; |
||||
justify-content: center; |
||||
align-items: center; |
||||
width: 100%; |
||||
padding: 10px 0; |
||||
font-size: 16px; |
||||
color: #fff; |
||||
background-color: #333; |
||||
.turn{ |
||||
margin: 0 10px; |
||||
font-size: 18px; |
||||
cursor: pointer; |
||||
} |
||||
} |
||||
.pdf-wrap{ |
||||
height: calc(100vh - 45px); |
||||
margin: 0 auto; |
||||
overflow: auto; |
||||
} |
||||
} |
||||
} |
||||
|
||||
</style> |
@ -1,123 +0,0 @@ |
||||
const isHh = location.host.includes('10.196.131.73') //是否是河海版本
|
||||
const isBeta = process.env.NODE_ENV === 'development' || location.host.includes('liuwanr.cn') //是否是职站测试
|
||||
export default { |
||||
/** |
||||
* @description 域名切换,liuwan:职站测试环境,occupationlab.com:职站正式环境,10.196.131.73:河海版本 |
||||
*/ |
||||
host: (process.env.NODE_ENV === 'development' || location.host.includes('liuwanr.cn')) ? 'http://www.liuwanr.cn/' : (location.host.includes('10.196.131.73') ? 'http://10.196.131.73/' : 'http://www.occupationlab.com/'), |
||||
/** |
||||
* @description 是否是河海版本 |
||||
*/ |
||||
isHh, |
||||
/** |
||||
* @description 配置显示在浏览器标签的title |
||||
*/ |
||||
title: isHh ? '教师管理端' : '职站服务端管理系统', |
||||
/** |
||||
* @description 学校id |
||||
*/ |
||||
schoolId: isHh ? 729 : 2105, |
||||
/** |
||||
* @description 系统列表 |
||||
*/ |
||||
systemList: isHh ? [{ |
||||
id: 1, |
||||
label: 'Python程序设计教学系统' |
||||
} |
||||
,{ |
||||
id: 4, |
||||
label: '经济金融建模实验教学系统' |
||||
}, |
||||
{ |
||||
id: 6, |
||||
label: '金融随机过程实验教学系统' |
||||
},{ |
||||
id: 7, |
||||
label: '量化投资策略建模实验教学系统' |
||||
},{ |
||||
id: 8, |
||||
label: '大数据分析实验教学系统' |
||||
}] : (isBeta ? [{ |
||||
id: 1, |
||||
label: 'Python程序设计教学系统' |
||||
} |
||||
// ,{
|
||||
// id: 2,
|
||||
// label: '跨国仿真系统'
|
||||
// },{
|
||||
// id: 3,
|
||||
// label: '期权期货系统'
|
||||
// }
|
||||
,{ |
||||
id: 4, |
||||
label: '经济金融建模实验教学系统' |
||||
},{ |
||||
id: 5, |
||||
label: 'Python可视化实验教学系统' |
||||
},{ |
||||
id: 6, |
||||
label: '金融随机过程实验教学系统' |
||||
},{ |
||||
id: 7, |
||||
label: '量化投资策略建模实验教学系统' |
||||
},{ |
||||
id: 8, |
||||
label: '大数据分析实验教学系统' |
||||
},{ |
||||
id: 9, |
||||
label: 'Python数据清洗教学实验系统' |
||||
},{ |
||||
id: 10, |
||||
label: 'Python数据采集(爬虫)教学实验系统' |
||||
}] : [{ |
||||
id: 1, |
||||
label: 'Python程序设计教学系统' |
||||
},{ |
||||
id: 4, |
||||
label: '经济金融建模实验教学系统' |
||||
},{ |
||||
id: 5, |
||||
label: 'Python可视化实验教学系统' |
||||
},{ |
||||
id: 6, |
||||
label: '金融随机过程实验教学系统' |
||||
},{ |
||||
id: 7, |
||||
label: '量化投资策略建模实验教学系统' |
||||
},{ |
||||
id: 8, |
||||
label: '大数据分析实验教学系统' |
||||
},{ |
||||
id: 9, |
||||
label: 'Python数据清洗教学实验系统' |
||||
},{ |
||||
id: 10, |
||||
label: 'Python数据采集(爬虫)教学实验系统' |
||||
}]), |
||||
/** |
||||
* @description 是否使用国际化,默认为false |
||||
* 如果不使用,则需要在路由中给需要在菜单中展示的路由设置meta: {title: 'xxx'} |
||||
* 用来在菜单中显示文字 |
||||
*/ |
||||
locale: 'zh', |
||||
/** |
||||
* @description 长时间未操作,自动退出登录时间 |
||||
*/ |
||||
autoLogoutTime: 3600000, |
||||
/** |
||||
* @description 新增项目跳转判分点数据存储cookie的key |
||||
*/ |
||||
projectData: 'sta_data', |
||||
/** |
||||
* @description 默认密码 |
||||
*/ |
||||
initialPassword: '111aaa', |
||||
/** |
||||
* @description 系统id |
||||
*/ |
||||
systemId: 1, |
||||
/** |
||||
* @description 是否使用动态路由 |
||||
*/ |
||||
dynamicRoute: true |
||||
} |
@ -1,8 +1,8 @@ |
||||
<template> |
||||
<div> |
||||
<div class="copyright"> |
||||
<!-- <p>技术支持:深圳或然科技有限公司</p> --> |
||||
<a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">粤ICP备20072679号</a></div> |
||||
<a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">粤ICP备20072679号</a> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
<script> |
@ -0,0 +1,84 @@ |
||||
<template> |
||||
<div class="header"> |
||||
<img class="logo hh" v-if="isHh" src="@/assets/img/logo-hh.png" /> |
||||
<img class="logo" v-else src="@/assets/img/logo.png" /> |
||||
<div class="action"> |
||||
<div class="user" @click="toPersonal"> |
||||
<el-avatar :size="40" :src="avatar"></el-avatar> |
||||
<span class="m-l-10">{{userName}}</span> |
||||
</div> |
||||
<el-divider direction="vertical"></el-divider> |
||||
<el-button type="text" class="ml20" @click="logout">退出</el-button> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
import { mapState, mapActions } from 'vuex' |
||||
import util from '@/libs/util' |
||||
import Setting from '@/setting' |
||||
export default { |
||||
data() { |
||||
return { |
||||
isHh: Setting.isHh, |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapState('user', [ |
||||
'avatar','userName' |
||||
]), |
||||
...mapState('auth', [ |
||||
'routes' |
||||
]) |
||||
}, |
||||
mounted(){ |
||||
|
||||
}, |
||||
methods: { |
||||
...mapActions('user', [ |
||||
'logout' |
||||
]), |
||||
toPersonal(){ |
||||
this.$router.push('/setting/person') |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
.header { |
||||
position: relative; |
||||
height: 60px; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
font-size: 16px; |
||||
color: #333; |
||||
background-color: #fff; |
||||
.logo { |
||||
height: 50px; |
||||
margin-left: 20px; |
||||
&.hh{ |
||||
width: 220px; |
||||
} |
||||
} |
||||
.action { |
||||
display: flex; |
||||
padding-right: 50px; |
||||
align-items: center; |
||||
.user{ |
||||
display: inline-flex; |
||||
align-items: center; |
||||
cursor: pointer; |
||||
} |
||||
.el-button--text{ |
||||
margin-left: 20px; |
||||
color: #333; |
||||
} |
||||
.el-divider{ |
||||
width: 2px; |
||||
height: 15px; |
||||
margin-left: 20px; |
||||
background-color: #333; |
||||
} |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,46 @@ |
||||
<template> |
||||
<div class="main"> |
||||
<v-head></v-head> |
||||
<div class="layout"> |
||||
<navbar></navbar> |
||||
<div class="content"> |
||||
<transition name="move" mode="out-in"> |
||||
<router-view class="view"></router-view> |
||||
</transition> |
||||
<el-backtop target=".content"></el-backtop> |
||||
</div> |
||||
<v-footer ref="footer"></v-footer> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import vHead from '../header' |
||||
import navbar from '../navbar' |
||||
import vFooter from '../footer' |
||||
import Setting from '@/setting' |
||||
export default { |
||||
data() { |
||||
return { |
||||
|
||||
}; |
||||
}, |
||||
components: { |
||||
vHead, |
||||
navbar, |
||||
vFooter |
||||
}, |
||||
created() { |
||||
|
||||
} |
||||
}; |
||||
</script> |
||||
<style lang="scss" scoped> |
||||
.main{ |
||||
min-height: 100%; |
||||
.content{ |
||||
min-height: calc(100vh - 176px); |
||||
padding: 24px 24px 0; |
||||
} |
||||
} |
||||
</style> |
@ -1,28 +0,0 @@ |
||||
/** |
||||
* @description 鉴权指令 |
||||
* 当传入的权限当前用户没有时,会移除该组件 |
||||
* 用例:<Tag v-auth">text</Tag> 或者:<Tag v-auth="'user:编辑'">text</Tag> |
||||
* */ |
||||
import store from '@/store'; |
||||
import config from '@/config' |
||||
|
||||
export default { |
||||
inserted (el, binding, vnode) { |
||||
if(config.dynamicRoute){ |
||||
let btnText = '' |
||||
if(binding.value){ |
||||
btnText = binding.value |
||||
}else{ |
||||
btnText = `${vnode.context.$route.name}:${el.innerText}` |
||||
} |
||||
const btnPermissions = store.state.btnPermissions; |
||||
|
||||
if (btnText && btnPermissions && btnPermissions.length) { |
||||
const isPermission = btnPermissions.includes(btnText); |
||||
if (!isPermission) { |
||||
el.parentNode && el.parentNode.removeChild(el); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,12 +0,0 @@ |
||||
/** |
||||
* 插件 |
||||
* */ |
||||
|
||||
import auth from './auth/authentication'; |
||||
|
||||
export default { |
||||
async install (Vue, options) { |
||||
// 指令
|
||||
Vue.directive('auth', auth); |
||||
} |
||||
} |
@ -0,0 +1,10 @@ |
||||
// 生成随机字符串
|
||||
export default function (len = 32) { |
||||
const $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; |
||||
const maxPos = $chars.length; |
||||
let str = ''; |
||||
for (let i = 0; i < len; i++) { |
||||
str += $chars.charAt(Math.floor(Math.random() * maxPos)); |
||||
} |
||||
return str; |
||||
} |
@ -0,0 +1,43 @@ |
||||
import Cookies from 'js-cookie'; |
||||
import Setting from '@/setting'; |
||||
|
||||
const cookies = {}; |
||||
|
||||
/** |
||||
* @description 存储 cookie 值 |
||||
* @param {String} name cookie name |
||||
* @param {String} value cookie value |
||||
* @param {Object} cookieSetting cookie setting |
||||
*/ |
||||
cookies.set = function (name = 'default', value = '', cookieSetting = {}) { |
||||
let currentCookieSetting = { |
||||
expires: Setting.cookiesExpires |
||||
}; |
||||
Object.assign(currentCookieSetting, cookieSetting); |
||||
Cookies.set(`admin-${name}`, value, currentCookieSetting); |
||||
}; |
||||
|
||||
/** |
||||
* @description 拿到 cookie 值 |
||||
* @param {String} name cookie name |
||||
*/ |
||||
cookies.get = function (name = 'default') { |
||||
return Cookies.get(`admin-${name}`); |
||||
}; |
||||
|
||||
/** |
||||
* @description 拿到 cookie 全部的值 |
||||
*/ |
||||
cookies.getAll = function () { |
||||
return Cookies.get(); |
||||
}; |
||||
|
||||
/** |
||||
* @description 删除 cookie |
||||
* @param {String} name cookie name |
||||
*/ |
||||
cookies.remove = function (name = 'default') { |
||||
return Cookies.remove(`admin-${name}`); |
||||
}; |
||||
|
||||
export default cookies; |
@ -0,0 +1,83 @@ |
||||
/** |
||||
* localStorage |
||||
* @调用:_local.set('access_token', '123456', 5000); |
||||
* @调用:_local.get('access_token'); |
||||
*/ |
||||
|
||||
var _local = { |
||||
//存储,可设置过期时间
|
||||
set(key, value, expires) { |
||||
let params = { key, value, expires }; |
||||
if (expires) { |
||||
// 记录何时将值存入缓存,毫秒级
|
||||
var data = Object.assign(params, { startTime: new Date().getTime() }); |
||||
localStorage.setItem(key, JSON.stringify(data)); |
||||
} else { |
||||
if (Object.prototype.toString.call(value) == '[object Object]') { |
||||
value = JSON.stringify(value); |
||||
} |
||||
if (Object.prototype.toString.call(value) == '[object Array]') { |
||||
value = JSON.stringify(value); |
||||
} |
||||
localStorage.setItem(key, value); |
||||
} |
||||
}, |
||||
//取出
|
||||
get(key) { |
||||
let item = localStorage.getItem(key); |
||||
// 先将拿到的试着进行json转为对象的形式
|
||||
try { |
||||
item = JSON.parse(item); |
||||
} catch (error) { |
||||
// eslint-disable-next-line no-self-assign
|
||||
item = item; |
||||
} |
||||
// 如果有startTime的值,说明设置了失效时间
|
||||
if (item && item.startTime) { |
||||
let date = new Date().getTime(); |
||||
|
||||
// 如果大于就是过期了,如果小于或等于就还没过期
|
||||
if (date - item.startTime > item.expires) { |
||||
localStorage.removeItem(key); |
||||
return false; |
||||
} else { |
||||
return item.value; |
||||
} |
||||
} else { |
||||
return item; |
||||
} |
||||
}, |
||||
// 删除
|
||||
remove(key) { |
||||
localStorage.removeItem(key); |
||||
}, |
||||
// 清除全部
|
||||
clear() { |
||||
localStorage.clear(); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* sessionStorage |
||||
*/ |
||||
var _session = { |
||||
get: function (key) { |
||||
var data = sessionStorage[key]; |
||||
if (!data || data === "null") { |
||||
return null; |
||||
} |
||||
return data; |
||||
}, |
||||
set: function (key, value) { |
||||
sessionStorage[key] = value; |
||||
}, |
||||
// 删除
|
||||
remove(key) { |
||||
sessionStorage.removeItem(key); |
||||
}, |
||||
// 清除全部
|
||||
clear() { |
||||
sessionStorage.clear(); |
||||
} |
||||
} |
||||
export { _local, _session } |
@ -0,0 +1,162 @@ |
||||
import cookies from './util.cookies' |
||||
import {_local,_session} from './util.db' |
||||
import { Message } from 'element-ui' |
||||
|
||||
|
||||
const roleList = { |
||||
'1': '超级管理员', |
||||
'13': '管理员', |
||||
'14': '老师', |
||||
'4': '学生' |
||||
} |
||||
const util = { |
||||
cookies, |
||||
local: _local, |
||||
session: _session, |
||||
// 传入身份证获取生日
|
||||
getBirth(idCard) { |
||||
var birthday = ""; |
||||
if(idCard != null && idCard != ""){ |
||||
if(idCard.length == 15){ |
||||
birthday = "19"+idCard.slice(6,12); |
||||
} else if(idCard.length == 18){ |
||||
birthday = idCard.slice(6,14); |
||||
}
|
||||
birthday = birthday.replace(/(.{4})(.{2})/,"$1-$2-"); |
||||
//通过正则表达式来指定输出格式为:1990-01-01
|
||||
}
|
||||
return birthday; |
||||
}, |
||||
// new Date('2020-11-12 00:00:00') 在IE下失效,因此把-替换成/
|
||||
dateCompatible(date) { |
||||
return date.replace(/\-/g, '/') |
||||
}, |
||||
// 日期时间前面补零
|
||||
formateTime(num) { |
||||
return num < 10 ? `0${num}` : num |
||||
}, |
||||
//返回格式化时间,传参例如:"yyyy-MM-dd hh:mm:ss"
|
||||
formatDate(fmt,date) { |
||||
var date = date ? date : new Date() |
||||
var o = {
|
||||
"M+" : date.getMonth()+1, //月份
|
||||
"d+" : date.getDate(), //日
|
||||
"h+" : date.getHours(), //小时
|
||||
"m+" : date.getMinutes(), //分
|
||||
"s+" : date.getSeconds(), //秒
|
||||
"q+" : Math.floor((date.getMonth()+3)/3), //季度
|
||||
"S" : date.getMilliseconds() //毫秒
|
||||
};
|
||||
if(/(y+)/.test(fmt)) { |
||||
fmt=fmt.replace(RegExp.$1, (date.getFullYear()+"").substr(4 - RegExp.$1.length));
|
||||
} |
||||
for(var k in o) { |
||||
if(new RegExp("("+ k +")").test(fmt)){ |
||||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length))); |
||||
} |
||||
} |
||||
return fmt;
|
||||
}, |
||||
// 移除数组中指定值
|
||||
removeByValue(arr, val) { |
||||
for(var i=0; i<arr.length; i++) { |
||||
if(arr[i] == val) { |
||||
arr.splice(i, 1); |
||||
break; |
||||
} |
||||
} |
||||
}, |
||||
// 传入文件后缀判断是否是视频
|
||||
isVideo(ext) { |
||||
if('mp4,3gp,mov,m4v,avi,dat,mkv,flv,vob,rmvb,rm,qlv'.includes(ext)) return true |
||||
return false |
||||
}, |
||||
// 传入文件后缀判断是否是音频
|
||||
isAudio(ext) { |
||||
if('mp3,aac,ape,flac,wav,wma,amr,mid'.includes(ext)) return true |
||||
return false |
||||
}, |
||||
// 传入文件后缀判断是否是图片
|
||||
isImg(ext) { |
||||
if('jpg,jpeg,png,gif,svg,psd'.includes(ext)) return true |
||||
return false |
||||
}, |
||||
// 传入文件后缀判断是否是pdf以外的文档
|
||||
isDoc(ext) { |
||||
if(!util.isVideo(ext) && !util.isAudio(ext) && !util.isImg(ext) && ext != 'pdf') return true |
||||
return false |
||||
}, |
||||
// 循环去除html标签
|
||||
removeHtmlTag(list,attr) { |
||||
list.map(n => { |
||||
n[attr] = n[attr].replace(/<\/?.+?>/gi,'') |
||||
}) |
||||
return list |
||||
}, |
||||
// 传入文件名获取文件后缀
|
||||
getFileExt(fileName) { |
||||
return fileName.substring(fileName.lastIndexOf('.') + 1) |
||||
}, |
||||
// 传入文件名和路径,下载图片视频,支持跨域,a标签加download不支持跨域
|
||||
downloadFile(fileName,url) { |
||||
var x = new XMLHttpRequest() |
||||
x.open("GET", url, true) |
||||
x.responseType = 'blob' |
||||
x.onload=function(e) { |
||||
var url = window.URL.createObjectURL(x.response) |
||||
var a = document.createElement('a') |
||||
a.href = url |
||||
a.download = fileName |
||||
a.click() |
||||
} |
||||
x.send() |
||||
}, |
||||
// 传入文件名和数据,下载文件
|
||||
downloadFileDirect(fileName,data) { |
||||
if ('download' in document.createElement('a')) { // 非IE下载
|
||||
const elink = document.createElement('a') |
||||
elink.download = fileName |
||||
elink.style.display = 'none' |
||||
elink.href = URL.createObjectURL(data) |
||||
document.body.appendChild(elink) |
||||
elink.click() |
||||
URL.revokeObjectURL(elink.href) // 释放URL 对象
|
||||
document.body.removeChild(elink) |
||||
} else { // IE10+下载
|
||||
navigator.msSaveBlob(data, fileName) |
||||
} |
||||
}, |
||||
// 传入字符串,返回去除[]后的字符串,因为通过get请求带入方括号的话会有问题
|
||||
encodeStr(str) { |
||||
if(str.includes('[') || str.includes(']')){ |
||||
let newStr = '' |
||||
for(let i of str){ |
||||
if(i == '[' || i == ']'){ |
||||
newStr += encodeURI(i) |
||||
}else{ |
||||
newStr += i |
||||
} |
||||
} |
||||
return newStr |
||||
} |
||||
return str |
||||
}, |
||||
// 成功提示
|
||||
successMsg(message,duration = 3000) { |
||||
return Message.success({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration}) |
||||
}, |
||||
// 警告提示
|
||||
warningMsg(message,duration = 3000) { |
||||
return Message.warning({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration}) |
||||
}, |
||||
// 错误提示
|
||||
errorMsg(message,duration = 3000) { |
||||
return Message.error({message,showClose: true,offset: (document.documentElement.clientHeight - 40) / 2,duration}) |
||||
}, |
||||
// 传入roleId,返回角色名称
|
||||
getRoleName(roleId){ |
||||
return roleList[roleId] || '未知状态' |
||||
} |
||||
} |
||||
|
||||
export default util |
@ -1,68 +1,45 @@ |
||||
import Vue from 'vue'; |
||||
import App from './App.vue'; |
||||
import router from './router'; |
||||
import App from '@/App.vue'; |
||||
import router from '@/router'; |
||||
import ElementUI from 'element-ui'; |
||||
import '@/styles/index.scss' |
||||
import VueI18n from 'vue-i18n'; |
||||
import { messages } from './components/common/i18n'; |
||||
// import 'element-ui/lib/theme-chalk/index.css'; // 默认主题
|
||||
import './assets/css/theme-green/index.css'; // 浅绿色主题
|
||||
import './assets/css/icon.css'; |
||||
import './assets/icon/iconfont.css'; |
||||
import './components/common/directives'; |
||||
import mixinApp from '@/mixins/app'; |
||||
import { messages } from '@/i18n'; |
||||
import 'babel-polyfill'; |
||||
import './util/rem'; |
||||
import {post,get,del,put,getToken} from './utils/http'; |
||||
import api from './utils/api'; |
||||
import store from './store' |
||||
import config from '@/config' |
||||
import '@/libs/resize'; |
||||
import {post,get,del,put} from '@/plugins/requests/index.js'; |
||||
import api from '@/api'; |
||||
import store from '@/store' |
||||
import Setting from '@/setting'; |
||||
import permission from '@/router/permission'; |
||||
import { systemStatus, systemTypeStatus, systemAttributionStatus, courseTypeStatus, |
||||
hoursStatus, roleStatus, orderTypeFn, orderStatusFn, orderNatureFn, Percentage, removeByValue, formatDate, formateTime, orderRoleType, orderRoleAttribute, setCookie, encodeString,logout } from './utils/core'; |
||||
import preventReClick from './store/preventReClick' //防多次点击,重复提交
|
||||
|
||||
// 插件
|
||||
import plugins from '@/libs'; |
||||
import plugins from '@/plugins'; |
||||
import filters from '@/plugins/filters' |
||||
|
||||
Vue.use(plugins); |
||||
|
||||
Object.keys(filters).forEach(item => Vue.filter(item,filters[item])) |
||||
|
||||
Vue.prototype.api = api; |
||||
Vue.prototype.$get = get; |
||||
Vue.prototype.$post = post; |
||||
Vue.prototype.$del = del; |
||||
Vue.prototype.$put = put; |
||||
Vue.prototype.getToken = getToken; |
||||
Vue.prototype.$config = config |
||||
|
||||
Vue.prototype.systemStatus = systemStatus; |
||||
Vue.prototype.systemTypeStatus = systemTypeStatus; |
||||
Vue.prototype.systemAttributionStatus = systemAttributionStatus; |
||||
Vue.prototype.courseTypeStatus = courseTypeStatus; |
||||
Vue.prototype.hoursStatus = hoursStatus; |
||||
Vue.prototype.roleStatus = roleStatus; |
||||
Vue.prototype.orderTypeFn = orderTypeFn; |
||||
Vue.prototype.orderStatusFn = orderStatusFn; |
||||
Vue.prototype.orderNatureFn = orderNatureFn; |
||||
Vue.prototype.Percentage = Percentage; |
||||
Vue.prototype.removeByValue = removeByValue; |
||||
Vue.prototype.formatDate = formatDate; |
||||
Vue.prototype.orderRoleType = orderRoleType; |
||||
Vue.prototype.orderRoleAttribute = orderRoleAttribute; |
||||
Vue.prototype.formateTime = formateTime; |
||||
Vue.prototype.setCookie = setCookie; |
||||
Vue.prototype.encodeString = encodeString; |
||||
Vue.prototype.logout = logout; |
||||
|
||||
Vue.config.productionTip = false; |
||||
Vue.use(VueI18n); |
||||
Vue.use(ElementUI); |
||||
const i18n = new VueI18n({ |
||||
locale: 'zh', |
||||
locale: Setting.i18n.default, |
||||
messages |
||||
}); |
||||
|
||||
new Vue({ |
||||
mixins: [mixinApp], |
||||
router, |
||||
store, |
||||
i18n, |
||||
store, |
||||
render: h => h(App) |
||||
}).$mount('#app'); |
||||
|
@ -0,0 +1,11 @@ |
||||
/** |
||||
* 通用混合 |
||||
* */ |
||||
export default { |
||||
methods: { |
||||
// 当 $route 更新时触发
|
||||
appRouteChange (to, from) { |
||||
|
||||
} |
||||
} |
||||
} |
@ -0,0 +1,8 @@ |
||||
export default { |
||||
beforeCreate() { |
||||
document.querySelector('body').setAttribute('style', 'background-color:#fff') |
||||
}, |
||||
beforeDestroy() { |
||||
document.body.removeAttribute('style') |
||||
} |
||||
} |
@ -0,0 +1,201 @@ |
||||
<template> |
||||
<div class="wrap"> |
||||
<div class="header"> |
||||
<img class="logo hh" v-if="isHh" src="@/assets/img/logo-hh.png" /> |
||||
<img class="logo" v-else src="@/assets/img/logo.png" /> |
||||
</div> |
||||
|
||||
<div class="main"> |
||||
<div class="box"> |
||||
<el-tabs v-model="type"> |
||||
<el-tab-pane label="账号登录" name="0"> |
||||
<el-form :model="param" :rules="rules" ref="param" label-width="0px" style="margin-top: 40px"> |
||||
<el-form-item prop="username"> |
||||
<el-input v-model="param.username" placeholder="请输入账号"></el-input> |
||||
</el-form-item> |
||||
<el-form-item prop="password"> |
||||
<el-input |
||||
type="password" |
||||
placeholder="请输入密码" |
||||
v-model="param.password" |
||||
@keyup.enter.native="submitForm('param')" |
||||
> |
||||
</el-input> |
||||
</el-form-item> |
||||
<el-button class="btn" type="primary" @click="submitForm('param')">马上登录</el-button> |
||||
</el-form> |
||||
</el-tab-pane> |
||||
|
||||
<el-tab-pane label="手机号/邮箱登录" name="1"> |
||||
<el-form :model="phoneParam" :rules="phoneRules" ref="phoneParam" label-width="0px" style="margin-top: 40px"> |
||||
<el-form-item prop="userphone"> |
||||
<el-input v-model="phoneParam.userphone" placeholder="请输入手机号/邮箱"></el-input> |
||||
</el-form-item> |
||||
<el-form-item prop="phonePassword"> |
||||
<el-input |
||||
type="password" |
||||
placeholder="请输入密码" |
||||
v-model="phoneParam.phonePassword" |
||||
@keyup.enter.native="submitForm('phoneParam')" |
||||
> |
||||
</el-input> |
||||
</el-form-item> |
||||
<el-button class="btn" type="primary" @click="submitForm('phoneParam')">马上登录</el-button> |
||||
</el-form> |
||||
</el-tab-pane> |
||||
</el-tabs> |
||||
</div> |
||||
</div> |
||||
|
||||
<v-footer class="footer"></v-footer> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { mapActions } from 'vuex' |
||||
import vFooter from '@/layouts/footer' |
||||
import util from '@/libs/util' |
||||
import Setting from '@/setting' |
||||
export default { |
||||
data: function() { |
||||
return { |
||||
isHh: Setting.isHh, |
||||
param: { |
||||
username: '', |
||||
password: '' |
||||
}, |
||||
rules: { |
||||
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }], |
||||
password: [{ required: true, message: '请输入密码', trigger: 'blur' }], |
||||
}, |
||||
phoneParam: { |
||||
userphone: '', |
||||
phonePassword: '' |
||||
}, |
||||
phoneRules: { |
||||
userphone: [{ required: true, message: '请输入手机号/邮箱', trigger: 'blur' }], |
||||
phonePassword: [{ required: true, message: '请输入密码', trigger: 'blur' }], |
||||
}, |
||||
type: '0' |
||||
}; |
||||
}, |
||||
components: { |
||||
vFooter, |
||||
}, |
||||
methods: { |
||||
...mapActions('user', [ |
||||
'login' |
||||
]), |
||||
submitForm(form) { |
||||
this.$refs[form].validate(valid => { |
||||
if (valid) { |
||||
let data = { |
||||
account: this.type == '0' ? this.param.username : this.phoneParam.userphone, |
||||
password: this.type == '0' ? this.param.password : this.phoneParam.phonePassword, |
||||
source: this.type |
||||
} |
||||
this.login(data).then(() => { |
||||
let redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : '/index' |
||||
this.$router.replace(redirect) |
||||
}).catch(res => {}) |
||||
} else { |
||||
return util.errorMsg('请输入账号和密码') |
||||
} |
||||
}); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.wrap{ |
||||
position: relative; |
||||
width: 100%; |
||||
height: 100%; |
||||
background-image: url(../../../assets/img/login-bg.png); |
||||
background-size: 100%; |
||||
.header{ |
||||
width: 100%; |
||||
height: 60px; |
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
background-color: #fff; |
||||
display: flex; |
||||
justify-content: space-between; |
||||
align-items: center; |
||||
font-size: 18px; |
||||
.logo{ |
||||
width: 150px; |
||||
margin-left: 20px; |
||||
&.hh{ |
||||
width: 220px; |
||||
} |
||||
} |
||||
} |
||||
/deep/.main{ |
||||
position: absolute; |
||||
left: 50%; |
||||
top: 42px; |
||||
transform: translate(-50%,0); |
||||
width: 1200px; |
||||
height: 82%; |
||||
margin-top: 60px; |
||||
background-image: url(../../../assets/img/login-input.png); |
||||
box-shadow:0px 0px 79px 0px rgba(11,15,65,0.36); |
||||
overflow: hidden; |
||||
.box { |
||||
width: 548px; |
||||
position: absolute; |
||||
left: 50%; |
||||
top: 50px; |
||||
transform: translate(-50%,0); |
||||
.el-tabs__nav-scroll{ |
||||
display: flex; |
||||
justify-content: center; |
||||
} |
||||
.el-tabs__nav-wrap::after{ |
||||
background-color: #fff; |
||||
opacity: 0; |
||||
.el-tabs__active-bar{ |
||||
background-color: #000; |
||||
border-radius:2px; |
||||
} |
||||
.el-tabs__item{ |
||||
padding: 0 90px; |
||||
color: #999; |
||||
&:hover{ |
||||
color: #000; |
||||
} |
||||
&.is-active{ |
||||
color: #333; |
||||
font-weight: bold; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.el-input__inner{ |
||||
height: 80px; |
||||
line-height: 80px; |
||||
border:1px solid rgba(220,220,220,1); |
||||
border-radius:2px; |
||||
} |
||||
.btn { |
||||
width: 100%; |
||||
height: 88px; |
||||
margin-bottom: 50px; |
||||
font-weight: bold; |
||||
background:linear-gradient(90deg,rgba(94,206,253,1),rgba(91,67,231,1)); |
||||
box-shadow:0px 7px 27px 0px rgba(50,129,255,0.51); |
||||
border-radius:10px; |
||||
} |
||||
} |
||||
} |
||||
.footer{ |
||||
position: absolute; |
||||
bottom: 0; |
||||
left: 0; |
||||
width: 100%; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,276 @@ |
||||
<template> |
||||
<div class="page"> |
||||
<h6 class="p-title">筛选</h6> |
||||
<div class="tool mul"> |
||||
<ul class="filter"> |
||||
<li> |
||||
<label>时间</label> |
||||
<el-radio-group size="small" v-model="month" @change="initData"> |
||||
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio> |
||||
</el-radio-group> |
||||
<el-date-picker size="small" v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker> |
||||
</li> |
||||
<li> |
||||
<label>实验项目分类</label> |
||||
<el-radio-group size="small" v-model="projectPermissions" @change="initData"> |
||||
<el-radio v-for="(item,index) in projectType" :key="index" :label="item.id" border>{{item.name}}</el-radio> |
||||
</el-radio-group> |
||||
</li> |
||||
<li> |
||||
<label>系统</label> |
||||
<el-select size="small" v-model="systemId" placeholder="请选择" @change="initData"> |
||||
<el-option |
||||
v-for="item in systemList" |
||||
:key="item.value" |
||||
:label="item.label" |
||||
:value="item.id" |
||||
></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<el-input size="small" placeholder="请输入实验项目名称/班级名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> |
||||
</li> |
||||
</ul> |
||||
<div> |
||||
<el-button type="primary" size="small" @click="delAllData">批量删除</el-button> |
||||
</div> |
||||
</div> |
||||
|
||||
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> |
||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" :selectable="disabledSelection"></el-table-column> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.$index + (page - 1) * pageSize + 1}} |
||||
</template> |
||||
</el-table-column> |
||||
<template v-if="projectPermissions == 1"> |
||||
<el-table-column prop="experimentalClassName" label="班级" align="center"></el-table-column> |
||||
<el-table-column prop="experimentalName" label="实验名称" align="center"></el-table-column> |
||||
</template> |
||||
<el-table-column prop="projectName" label="项目名称" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="projectPermissions" label="分类" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.row.projectPermissions == 2 ? '竞赛' : projectType.find(n => n.id === scope.row.projectPermissions).name}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="number" label="成绩报告数量" align="center"></el-table-column> |
||||
<el-table-column prop="creationTime" label="创建时间" align="center"> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="entry(scope.row)" v-auth>成绩管理</el-button> |
||||
<el-button type="text" @click="handleDelete(scope.row)" :disabled="!scope.row.isdel">删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"></el-pagination> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { mapState, mapActions } from 'vuex' |
||||
import { Loading } from 'element-ui' |
||||
import util from '@/libs/util' |
||||
import Setting from '@/setting' |
||||
export default { |
||||
name: 'achievement', |
||||
data() { |
||||
return { |
||||
systemId: '', |
||||
systemList: Setting.systemList, |
||||
projectPermissions: this.$route.query.per ? Number(this.$route.query.per) : 0, |
||||
keyword: '', |
||||
startingtime: '', |
||||
endTime: '', |
||||
month: '', |
||||
listData: [], |
||||
multipleSelection: [], |
||||
dateList: [ |
||||
{ |
||||
id: '', |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '近一个月' |
||||
}, |
||||
{ |
||||
id: 6, |
||||
name: '近六个月' |
||||
} |
||||
], |
||||
projectType: [ |
||||
{ |
||||
id: 0, |
||||
name: '练习' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '考核' |
||||
} |
||||
], |
||||
date: '', |
||||
page: 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
loadIns: null, |
||||
listDataAll: [] |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapState('user', [ |
||||
'userId' |
||||
]), |
||||
...mapState('project', [ |
||||
'lastSystemId' |
||||
]), |
||||
}, |
||||
watch: { |
||||
month: function(val){ |
||||
if(val){ |
||||
let unit = 24 * 60 * 60 * 1000 |
||||
this.date = [this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))] |
||||
}else{ |
||||
this.date = [] |
||||
} |
||||
}, |
||||
date: function(val){ |
||||
if(val){ |
||||
this.startingtime = val[0] |
||||
this.endTime = val[1] |
||||
}else{ |
||||
this.startingtime = '' |
||||
this.endTime = '' |
||||
} |
||||
this.initData() |
||||
}, |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData() |
||||
},500) |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.systemId = this.lastSystemId ? this.lastSystemId : Setting.systemId |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
...mapActions('project', [ |
||||
'setSystemId' |
||||
]), |
||||
getData() { |
||||
this.loadIns = Loading.service({ |
||||
background: 'rgba(255,255,255,.6)' |
||||
}) |
||||
let data = { |
||||
searchContant: util.encodeStr(this.keyword), |
||||
startTime: this.startingtime, |
||||
endTime: this.endTime, |
||||
month: this.month, |
||||
page: this.page, |
||||
size: this.pageSize, |
||||
userId: this.userId |
||||
} |
||||
let url = this.api.queryAchievement |
||||
if(this.projectPermissions){ |
||||
data.systemId = this.systemId |
||||
url = this.api.queryAchievementNew |
||||
}else{ |
||||
data.systemId = this.systemId |
||||
data.projectPermissions = this.projectPermissions |
||||
} |
||||
this.$get(url,data).then(res => { |
||||
this.listData = res.data.list |
||||
this.total = res.data.total |
||||
this.$nextTick(() => { |
||||
this.loadIns.close() |
||||
}) |
||||
}).catch(res => { |
||||
this.loadIns.close() |
||||
}) |
||||
}, |
||||
handlePage(){ |
||||
let list = this.listDataAll |
||||
let result = [] |
||||
list.map(n => { |
||||
if(!n.projectHiddenEntity) result.push(n) |
||||
}) |
||||
this.listData = result.slice((this.page - 1) * this.pageSize,this.page * this.pageSize) |
||||
this.total = result.length |
||||
}, |
||||
initData(){ |
||||
this.$refs.table.clearSelection() |
||||
this.page = 1 |
||||
this.getData() |
||||
}, |
||||
disabledSelection(row,index){ |
||||
if(row.isdel == 0) return false |
||||
return true |
||||
}, |
||||
entry(row){ |
||||
this.setSystemId(this.systemId) |
||||
if(this.projectPermissions){ |
||||
this.$router.push(`teach?id=${row.id}&name=${row.experimentalName}&class=${row.experimentalClassName}&projectId=${row.projectId}&systemId=${this.systemId}`) |
||||
}else{ |
||||
this.$router.push(`vir?id=${row.projectId}&name=${row.projectName}&class=${row.experimentalClassName}&systemId=${this.systemId}`) |
||||
} |
||||
}, |
||||
handleDelete(row) { |
||||
this.$confirm('该项目下的所有成绩报告将会删除,是否继续?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(`${this.api.deleteReportById}?projectIds=${row.projectId}&projectPermissions=${row.projectPermissions}&ids=${row.id ? row.id : ''}`).then(res => { |
||||
util.successMsg('删除成功') |
||||
this.getData() |
||||
}).catch(res => {}) |
||||
}) |
||||
.catch(() => {}) |
||||
}, |
||||
delAllData() { |
||||
if(this.multipleSelection.length != ''){ |
||||
let newArr = this.multipleSelection |
||||
let delList = newArr.map(item => { |
||||
return `projectIds=${item.projectId}` |
||||
}) |
||||
let delList1 = newArr[0].id ? newArr.map(item => { |
||||
return `ids=${item.id}` |
||||
}) : [] |
||||
|
||||
this.$confirm('该项目下的所有成绩报告将会删除,是否继续?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
let data = `${delList.join('&')}&projectPermissions=${this.projectPermissions}&${delList1.length ? delList1.join('&') : ''}` |
||||
this.$post(`${this.api.deleteReportById}?${data}`).then(res => { |
||||
this.multipleSelection = []; |
||||
this.$refs.table.clearSelection() |
||||
util.successMsg('删除成功') |
||||
this.getData() |
||||
}).catch(res => {}) |
||||
}) |
||||
.catch(() => {}) |
||||
}else{ |
||||
util.errorMsg('请先选择数据 !') |
||||
} |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.page = val |
||||
this.getData() |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.el-radio.is-bordered+.el-radio.is-bordered{ |
||||
margin-left: 0; |
||||
} |
||||
</style> |
@ -0,0 +1,389 @@ |
||||
<template> |
||||
<div class="page"> |
||||
<h6 class="p-title">筛选</h6> |
||||
<div class="tool mul"> |
||||
<ul class="filter"> |
||||
<li> |
||||
<label>实验时间</label> |
||||
<el-radio-group size="small" v-model="form.month" @change="initData"> |
||||
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio> |
||||
</el-radio-group> |
||||
<el-date-picker size="small" v-model="date" align="right" unlink-panels type="daterange" style="margin-left: 10px;" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker> |
||||
</li> |
||||
<li> |
||||
<label>发布类型</label> |
||||
<el-select size="small" v-model="form.type" clearable placeholder="请选择发布类型" @change="initData"> |
||||
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.value"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>实验状态</label> |
||||
<el-select size="small" v-model="form.status" clearable placeholder="请选择实验状态" @change="initData"> |
||||
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>系统</label> |
||||
<el-select size="small" v-model="systemId" placeholder="请选择" @change="initData"> |
||||
<el-option label="不限" value=""></el-option> |
||||
<el-option |
||||
v-for="item in systemList" |
||||
:key="item.value" |
||||
:label="item.label" |
||||
:value="item.id" |
||||
></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<el-input size="small" placeholder="请输入实验班级/项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> |
||||
</li> |
||||
</ul> |
||||
<div> |
||||
<el-button type="primary" size="small" round @click="add" v-auth>创建实验</el-button> |
||||
<el-button type="primary" size="small" round @click="delAllData" v-auth>批量删除</el-button> |
||||
</div> |
||||
</div> |
||||
|
||||
<el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> |
||||
<el-table-column type="selection" :selectable="row => row.status!=2" width="50" align="center" :reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" width="60" label="序号" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.$index + (page - 1) * pageSize + 1}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="experimentalClassName" label="实验班级" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="experimentalName" label="考核名称" min-width="120" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="projectName" label="项目名称" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="experimentalNumber" label="实验人数" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="experimentDuration" label="实验时长" align="center"> |
||||
</el-table-column> |
||||
<el-table-column label="邀请码" align="center"> |
||||
<template slot-scope="scope"> |
||||
<span>{{scope.row.isCode == 0 ? scope.row.invitationCode : ''}}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="adminName" label="发布类型" align="center"> |
||||
<template slot-scope="scope"> |
||||
<span>{{types[scope.row.type]}}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="creationTime" width="150" label="创建时间" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="startTime" width="150" label="起始时间" align="center"> |
||||
<template slot-scope="scope"> |
||||
<span>{{transferTime(scope.row.startTime,scope.row.type)}}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="stopTime" width="150" label="结束时间" align="center"> |
||||
<template slot-scope="scope"> |
||||
<span>{{transferTime(scope.row.stopTime,scope.row.type)}}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="surplusTime" label="倒计时" align="center"> |
||||
<!-- <template slot-scope="scope"> |
||||
<span v-if="scope.row.status == 2" v-countdown="scope.row.surplusTime">{{scope.row.surplusTime}}</span> |
||||
<span v-else>00:00:00</span> |
||||
</template> --> |
||||
</el-table-column> |
||||
<el-table-column label="实验状态" align="center"> |
||||
<template slot-scope="scope"> |
||||
<span>{{status[scope.row.status]}}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center" width="170"> |
||||
<template slot-scope="scope"> |
||||
<template v-if="scope.row.status == 1"> |
||||
<el-button type="text" @click="start(scope.row)" v-auth>启动</el-button> |
||||
<el-button type="text" @click="edit(scope.row)" v-auth>修改</el-button> |
||||
</template> |
||||
<template v-else-if="scope.row.status == 2"> |
||||
<el-button type="text" @click="finish(scope.row)" v-auth>提前结束</el-button> |
||||
</template> |
||||
<template v-else-if="scope.row.status == 3"> |
||||
<el-button type="text" @click="show(scope.row)" v-auth>查看成绩</el-button> |
||||
</template> |
||||
<el-button v-if="scope.row.status == 1 || scope.row.status == 3" type="text" @click="delData(scope.row)" v-auth>删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"></el-pagination> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Setting from '@/setting' |
||||
import util from '@/libs/util' |
||||
import { mapState, mapActions } from 'vuex' |
||||
export default { |
||||
data() { |
||||
return { |
||||
systemList: Setting.systemList, |
||||
systemId: '', |
||||
keyword: '', |
||||
typeList: [ |
||||
{ |
||||
value: '', |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
value: 1, |
||||
name: '手动发布' |
||||
}, |
||||
{ |
||||
value: 2, |
||||
name: '定时发布' |
||||
} |
||||
], |
||||
status: ['','待开始','进行中','已完成'], |
||||
types: ['','手动发布','定时发布'], |
||||
statusList: [ |
||||
{ |
||||
value: '', |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
value: 1, |
||||
name: '待开始' |
||||
}, |
||||
{ |
||||
value: 2, |
||||
name: '进行中' |
||||
}, |
||||
{ |
||||
value: 3, |
||||
name: '已完成' |
||||
} |
||||
], |
||||
listData: [], |
||||
form: { |
||||
type: '', |
||||
status: '', |
||||
startTime: '', |
||||
stopTime: '', |
||||
month: '', |
||||
searchContent: '' |
||||
}, |
||||
multipleSelection: [], |
||||
dateList: [ |
||||
{ |
||||
id: '', |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '近一个月' |
||||
}, |
||||
{ |
||||
id: 3, |
||||
name: '近三个月' |
||||
}, |
||||
{ |
||||
id: 6, |
||||
name: '近六个月' |
||||
} |
||||
], |
||||
date: [], |
||||
page: 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
ruleIds: [], |
||||
timer: null |
||||
}; |
||||
}, |
||||
directives: { |
||||
countdown: { |
||||
bind: function(el,binding,vnode) { |
||||
let that = vnode.context |
||||
let time = binding.value |
||||
let timer = setInterval(() => { |
||||
let timeList = time.split(':') |
||||
let total = Number.parseInt(timeList[0] * 60 * 60) + Number.parseInt(timeList[1] * 60) + Number.parseInt(timeList[2]) |
||||
if(total > 0){ |
||||
--total |
||||
let hours = Math.floor(total / (60 * 60)) |
||||
let minutes = Math.floor(total % (60 * 60) / 60) |
||||
let seconds = Math.floor(total % (60 * 60) % 60) |
||||
time = `${that.formateTime(hours)}:${that.formateTime(minutes)}:${that.formateTime(seconds)}` |
||||
}else{ |
||||
clearInterval(timer) |
||||
} |
||||
el.innerHTML = time |
||||
},1000) |
||||
that.timerList.push(timer) |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
...mapState('user', [ |
||||
'schoolId' |
||||
]), |
||||
}, |
||||
watch: { |
||||
'form.month': function(val){ |
||||
if(val){ |
||||
let unit = 24 * 60 * 60 * 1000 |
||||
this.date = [this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))] |
||||
}else{ |
||||
this.date = [] |
||||
} |
||||
}, |
||||
date: function(val){ |
||||
if(val){ |
||||
this.form.startTime = val[0] |
||||
this.form.stopTime = val[1] |
||||
}else{ |
||||
this.form.startTime = '' |
||||
this.form.stopTime = '' |
||||
} |
||||
this.initData() |
||||
}, |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData() |
||||
},500) |
||||
} |
||||
}, |
||||
computed: { |
||||
role() { |
||||
return this.name === 'admin' ? '超级管理员' : '普通用户'; |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getData() |
||||
// this.timer = setInterval(this.getData,1000) |
||||
// this.$once('hook:beforeDestroy',() => { |
||||
// clearInterval(this.timer) |
||||
// }) |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
let data = { |
||||
type: this.form.type, |
||||
startTime: this.form.startTime, |
||||
stopTime: this.form.stopTime, |
||||
month: this.form.month, |
||||
searchContent: util.encodeStr(this.keyword), |
||||
status: this.form.status, |
||||
page: this.page, |
||||
size: this.pageSize, |
||||
systemId: this.systemId, |
||||
schoolId: this.schoolId ? this.schoolId : '' |
||||
} |
||||
this.$get(this.api.expList,data).then(res => { |
||||
this.listData = res.list.list |
||||
this.total = res.list.totalCount |
||||
}).catch(res => {}); |
||||
}, |
||||
initData(){ |
||||
this.$refs.table.clearSelection() |
||||
this.page = 1 |
||||
this.getData() |
||||
}, |
||||
add(){ |
||||
this.$router.push('add') |
||||
}, |
||||
edit(row){ |
||||
this.$router.push(`add?id=${row.id}`) |
||||
}, |
||||
show(row){ |
||||
this.$router.push(`/achievement/ass?systemId=${this.systemId}&id=${row.id}&projectId=${row.projectId}&name=${row.projectName}&experimentalName=${row.experimentalName}&class=${row.experimentalClassName}`) |
||||
}, |
||||
start(row){ |
||||
let data = { |
||||
id: row.id, |
||||
startTime: this.formatDate("yyyy-MM-dd hh:mm:ss",new Date()), |
||||
status: 2 |
||||
} |
||||
this.$post(this.api.expUpdate,data).then(res => { |
||||
if(res.errmessage == 'success') { |
||||
util.successMsg('启动成功!') |
||||
this.getData() |
||||
} |
||||
}).catch(res => {}); |
||||
}, |
||||
finish(row){ |
||||
this.$confirm('确定要提前结束吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
let data = { |
||||
id: row.id, |
||||
stopTime: this.formatDate("yyyy-MM-dd hh:mm:ss",new Date()), |
||||
status: 3 |
||||
} |
||||
this.$post(this.api.expUpdate,data).then(res => { |
||||
if(res.errmessage == 'success') { |
||||
util.successMsg('提前结束成功!') |
||||
this.getData() |
||||
} |
||||
}).catch(res => {}) |
||||
}) |
||||
.catch(() => {}) |
||||
}, |
||||
delData(row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(this.api.expDelete,[row.id]).then(res => { |
||||
util.successMsg('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
delAllData() { |
||||
if(this.multipleSelection.length != ''){ |
||||
let newArr = this.multipleSelection |
||||
let delList = newArr.map(item => { |
||||
return item.id |
||||
}) |
||||
|
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
let data = delList |
||||
this.$post(this.api.expDelete,data).then(res => { |
||||
this.multipleSelection = []; |
||||
this.$refs.table.clearSelection() |
||||
util.successMsg('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}else{ |
||||
util.errorMsg('请先选择数据 !'); |
||||
} |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val; |
||||
}, |
||||
onSearch(){ |
||||
this.page = 1 |
||||
this.getData() |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.page = val; |
||||
this.getData(); |
||||
}, |
||||
transferTime(date,type){ |
||||
if(date == '0000-00-00 00:00:00') return '---' |
||||
return date |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.el-radio-group{ |
||||
white-space: nowrap; |
||||
} |
||||
</style> |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,391 @@ |
||||
<template> |
||||
<div class="page"> |
||||
<el-page-header class="m-b-20" content="实验项目管理" @back="goBack"></el-page-header> |
||||
|
||||
|
||||
<h6 class="p-title">筛选</h6> |
||||
<div class="tool mul"> |
||||
<ul class="filter"> |
||||
<li> |
||||
<label>创建人</label> |
||||
<el-select size="small" v-model="queryData.founder" clearable placeholder="请选择创建人" @change="initData"> |
||||
<el-option v-for="(item,index) in founder" :key="index" :label="item.label" :value="item.value"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>状态</label> |
||||
<el-select size="small" v-model="queryData.state" clearable placeholder="请选择状态" @change="initData"> |
||||
<el-option v-for="(item,index) in state" :key="index" :label="item.label" :value="item.value"></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>权限</label> |
||||
<el-select size="small" v-model="queryData.projectPermissions" placeholder="请选择" @change="initData"> |
||||
<el-option |
||||
v-for="item in projectPermissions" |
||||
:key="item.value" |
||||
:label="item.label" |
||||
:value="item.value" |
||||
></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<label>系统</label> |
||||
<el-select size="small" v-model="systemId" placeholder="请选择" @change="initData"> |
||||
<el-option |
||||
v-for="item in systemList" |
||||
:key="item.value" |
||||
:label="item.label" |
||||
:value="item.id" |
||||
></el-option> |
||||
</el-select> |
||||
</li> |
||||
<li> |
||||
<el-input size="small" placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input> |
||||
</li> |
||||
</ul> |
||||
<div> |
||||
<el-button type="primary" size="small" @click="add" v-auth>新增项目</el-button> |
||||
<el-button type="primary" size="small" @click="delAllData" v-auth>批量删除</el-button> |
||||
</div> |
||||
</div> |
||||
|
||||
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange"> |
||||
<el-table-column type="selection" width="55" align="center"></el-table-column> |
||||
<el-table-column type="index" width="100" label="序号" align="center"> |
||||
<template slot-scope="scope">{{scope.$index + (page - 1) * pageSize + 1}}</template> |
||||
</el-table-column> |
||||
<el-table-column prop="projectName" label="实验项目名称" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="founder" label="创建人" align="center"></el-table-column> |
||||
<el-table-column label="权限" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.row.projectPermissions == 2 ? '竞赛' : projectPermissions.find(n => n.value === scope.row.projectPermissions).label}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="creationTime" label="创建时间" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="status" label="状态" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{transferStatus(scope.row.state)}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="edit(scope.row)" v-auth v-if="roleId == 1 || (roleId == 13 && scope.row.founder != '超级管理员') || (roleId == 14 && scope.row.founder == '老师')">编辑</el-button> |
||||
<el-button type="text" @click="delData(scope.row)" v-auth v-if="roleId == 1 || (roleId == 13 && scope.row.founder != '超级管理员') || (roleId == 14 && scope.row.founder == '老师')">删除</el-button> |
||||
<el-button type="text" @click="copyData(scope.row)" v-auth>复制</el-button> |
||||
<el-switch |
||||
v-model="scope.row.enable" |
||||
:active-text="scope.row.enable ? '关闭' : '启用'" |
||||
:active-value="0" |
||||
:inactive-value="1" |
||||
style="margin: 0 10px 0 10px" |
||||
@change="switchOff($event,scope.row,scope.$index)" |
||||
></el-switch> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination> |
||||
</div> |
||||
|
||||
<el-dialog title="复制" :visible.sync="copyVisible" width="24%" center :close-on-click-modal="false"> |
||||
<el-form> |
||||
<el-form-item> |
||||
<el-input placeholder="请输入项目名称" v-model="projectName" @change="projectNameExistis"></el-input> |
||||
</el-form-item> |
||||
</el-form> |
||||
<span slot="footer" class="dialog-footer"> |
||||
<el-button @click="copyVisible = false">取 消</el-button> |
||||
<el-button type="primary" @click="copySubmit">确 定</el-button> |
||||
</span> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Setting from '@/setting' |
||||
import util from '@/libs/util' |
||||
import { mapState, mapActions } from 'vuex' |
||||
export default { |
||||
data() { |
||||
return { |
||||
showBack: JSON.stringify(this.assFields) == '{}' ? false : true, |
||||
roleIdEd: this.roleId ? 13 : this.roleId,// 管理员的roleId是13,老师的roleId是14,1个用户也可能是两个角色,就是13,14,当一个用户是两个角色的话,就取权重大的一个,就是管理员,即13.管理员>老师 |
||||
systemId: '', |
||||
systemList: Setting.systemList, |
||||
queryData: { |
||||
projectPermissions: "", |
||||
founder: "", |
||||
state: "", |
||||
projectName: "", |
||||
}, |
||||
keyword: '', |
||||
status: '', |
||||
listData:[], |
||||
total: 0, |
||||
projectPermissions: [ |
||||
{ |
||||
value: "", |
||||
label: "不限" |
||||
}, |
||||
{ |
||||
value: 0, |
||||
label: "练习" |
||||
}, |
||||
{ |
||||
value: 1, |
||||
label: "考核" |
||||
}, |
||||
// { |
||||
// value: 2, |
||||
// label: "竞赛" |
||||
// } |
||||
], |
||||
founder: [ |
||||
{ |
||||
value: "", |
||||
label: "不限" |
||||
}, |
||||
{ |
||||
value: 1, |
||||
label: "超级管理员" |
||||
}, |
||||
{ |
||||
value: 13, |
||||
label: "管理员" |
||||
}, |
||||
{ |
||||
value: 14, |
||||
label: "老师" |
||||
} |
||||
], |
||||
state: [ |
||||
{ |
||||
value: "", |
||||
label: "不限" |
||||
}, |
||||
{ |
||||
value: 0, |
||||
label: "草稿箱" |
||||
}, |
||||
{ |
||||
value: 1, |
||||
label: "已发布" |
||||
} |
||||
], |
||||
page: 1, |
||||
pageSize: 10, |
||||
multipleSelection: [], |
||||
copyVisible: false, |
||||
projectName: '', |
||||
projectNameRepeat: false, |
||||
currentRow: {}, |
||||
listDataAll: [] |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapState('user', [ |
||||
'userId','roleId' |
||||
]), |
||||
...mapState('project', [ |
||||
'lastSystemId','assFields' |
||||
]), |
||||
}, |
||||
watch: { |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData() |
||||
},500) |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.systemId = this.lastSystemId ? this.lastSystemId : Setting.systemId |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
...mapActions('project', [ |
||||
'setSystemId' |
||||
]), |
||||
getData(){ |
||||
this.setSystemId(this.systemId) |
||||
let data = this.queryData |
||||
data.userId = this.userId |
||||
data.systemId = this.systemId |
||||
data.pageNo = this.page |
||||
data.pageSize = this.pageSize |
||||
data.projectName = util.encodeStr(this.keyword) |
||||
data.systemId = this.systemId |
||||
this.$get(this.api.queryAllManagements,data).then(res => { |
||||
let list = res.pageInfo.list |
||||
let newList = [] |
||||
list.map(n => { |
||||
if(n.founder.includes(',')){ |
||||
n.founder = '管理员' |
||||
}else{ |
||||
n.founder = util.getRoleName(n.founder) |
||||
} |
||||
}) |
||||
this.listData = list |
||||
this.total = res.pageInfo.total |
||||
}).catch(res => {}); |
||||
}, |
||||
initData(){ |
||||
this.page = 1 |
||||
this.getData() |
||||
}, |
||||
handlePage(){ |
||||
let list = this.listDataAll |
||||
let result = list.slice((this.page - 1) * this.pageSize,this.page * this.pageSize) |
||||
this.listData = result |
||||
}, |
||||
transferStatus(status){ |
||||
return status == 1 ? '已发布' : '草稿箱' |
||||
}, |
||||
handleCurrentChange(val){ |
||||
this.page = val |
||||
this.getData() |
||||
}, |
||||
add(){ |
||||
this.setSystemId(this.systemId) |
||||
this.$router.push('add') |
||||
}, |
||||
edit(row){ |
||||
this.setSystemId(row.systemId) |
||||
this.$router.push(`add?id=${row.projectId}`) |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val; |
||||
}, |
||||
delData(row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(this.api.removeProjectManagement,[row.projectId]).then(res => { |
||||
util.successMsg('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}, |
||||
delAllData() { |
||||
if(this.multipleSelection.length != ''){ |
||||
let newArr = this.multipleSelection |
||||
let delList = newArr.map(item => { |
||||
return item.projectId |
||||
}) |
||||
|
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$post(this.api.removeProjectManagement,delList).then(res => { |
||||
this.multipleSelection = []; |
||||
this.$refs.table.clearSelection() |
||||
util.successMsg('删除成功'); |
||||
this.getData() |
||||
}).catch(res => {}); |
||||
}) |
||||
.catch(() => {}); |
||||
}else{ |
||||
util.errorMsg('请先选择项目 !'); |
||||
} |
||||
}, |
||||
projectNameExistis(){ |
||||
let data = { |
||||
projectName: util.encodeStr(this.projectName) |
||||
} |
||||
this.$get(this.api.isNameExistis,data).then(res => { |
||||
if(res.status != 200){ |
||||
this.projectNameRepeat = true |
||||
this.$message.warning('该项目名称已存在') |
||||
}else{ |
||||
this.projectNameRepeat = false |
||||
} |
||||
}).catch(res => {}) |
||||
}, |
||||
copyData(row){ |
||||
this.currentRow.management = { |
||||
caseDescription: row.caseDescription, |
||||
experimentSuggests: row.experimentSuggests, |
||||
experimentalGoal: row.experimentalGoal, |
||||
founder: row.founder, |
||||
isstartexperimentSuggests: row.isstartexperimentSuggests, |
||||
isstartexperimental: row.isstartexperimental, |
||||
projectName: row.projectName, |
||||
projectPermissions: row.projectPermissions, |
||||
state: row.state, |
||||
systemId: row.systemId, |
||||
userId: row.userId, |
||||
knowledgePoints: row.knowledgePoints, |
||||
experimentIntroduction: row.experimentIntroduction |
||||
} |
||||
this.currentRow.founder = row.founder |
||||
this.projectName = row.projectName |
||||
this.projectNameRepeat = true |
||||
this.copyVisible = true |
||||
let data = { |
||||
projectId: row.projectId |
||||
} |
||||
this.$get(this.api.getZZJudgmentPoints,data).then((res) => { |
||||
this.currentRow.roleId = res.message.roleList.map(n => n.roleId) |
||||
let scoreList = res.message.scoreIndexList |
||||
let scores = [] |
||||
for(let i in scoreList){ |
||||
scores = scores.concat(scoreList[i]) |
||||
} |
||||
let point = res.message.judgmentPointsList |
||||
point.map(n => { |
||||
let same = scores.find(e => e.judgmentPointsId == n.judgmentPointsId) |
||||
if(same) n.score = same.score |
||||
}) |
||||
this.currentRow.pooints = point |
||||
this.$message.warning('请修改项目名称') |
||||
}) |
||||
}, |
||||
copySubmit(){ |
||||
if(!this.projectName.length) return this.$message.warning('请填写项目名称') |
||||
if(this.projectNameRepeat) return this.$message.warning('该项目名称已存在') |
||||
let data = this.currentRow |
||||
data.management.projectName = this.projectName |
||||
data.founder = this.roleId |
||||
data.management.founder = this.roleId |
||||
data.management.userId = this.userId |
||||
data.pooints.map(n => { |
||||
n.userId = this.userId |
||||
}) |
||||
let systemId = this.currentRow.management.systemId |
||||
let url = this.api.addProjectManagement |
||||
if(systemId == 2 || systemId == 3) url = this.api.addProjectManagementTrad |
||||
this.$post(url,data).then((res) => { |
||||
util.successMsg('复制成功'); |
||||
this.copyVisible = false |
||||
this.getData() |
||||
}) |
||||
}, |
||||
switchOff(val,row,index) { |
||||
this.$get(this.api.enableProject,{ |
||||
id: row.projectId, |
||||
enable: row.enable |
||||
}) |
||||
.then(res => { |
||||
if(res.status != 200){ |
||||
util.errorMsg(res.errmessage) |
||||
row.enable = row.enable == 1 ? 0 : 1 |
||||
} |
||||
}) |
||||
.catch(err => {}); |
||||
}, |
||||
goBack() { |
||||
this.$router.back() |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
|
||||
</style> |
@ -0,0 +1,61 @@ |
||||
<template> |
||||
<div class="page" style="padding: 0"> |
||||
<div class="tabs"> |
||||
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a> |
||||
</div> |
||||
|
||||
<staff v-if="active == 'staff'" v-auth="'系统设置:员工管理'"></staff> |
||||
<role v-else v-auth="'系统设置:角色权限'"></role> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Setting from '@/setting' |
||||
import { mapState } from 'vuex' |
||||
import staff from './staff' |
||||
import role from './role' |
||||
export default { |
||||
data() { |
||||
return { |
||||
active: 'staff', |
||||
tabs: { |
||||
staff: '员工管理', |
||||
role: '角色权限' |
||||
}, |
||||
}; |
||||
}, |
||||
computed: { |
||||
...mapState('auth', [ |
||||
'btns' |
||||
]) |
||||
}, |
||||
components: { |
||||
staff, |
||||
role |
||||
}, |
||||
created() { |
||||
Setting.dynamicRoute && this.initTabs() |
||||
}, |
||||
methods: { |
||||
tabChange(index){ |
||||
this.active = index |
||||
}, |
||||
initTabs(){ |
||||
let btnPermissions = this.routes |
||||
let tab1 = btnPermissions.includes('系统设置:员工管理') |
||||
let tab2 = btnPermissions.includes('系统设置:角色权限') |
||||
|
||||
if(!tab1){ |
||||
delete this.tabs.staff |
||||
} |
||||
if(!tab2){ |
||||
delete this.tabs.role |
||||
} |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
|
||||
</style> |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,25 @@ |
||||
/** |
||||
* @description 鉴权指令 |
||||
* 当传入的权限当前用户没有时,会移除该组件 |
||||
* 用例:<Tag v-auth>text</Tag> 或者:<Tag v-auth="'user:编辑'">text</Tag> |
||||
* */ |
||||
import store from '@/store' |
||||
|
||||
export default { |
||||
inserted (el, binding, vnode) { |
||||
let btnText = '' |
||||
if(binding.value){ |
||||
btnText = binding.value |
||||
}else{ |
||||
btnText = `${vnode.context.$route.path}:${el.innerText}` |
||||
} |
||||
const btnPermissions = store.state.auth.btns |
||||
|
||||
if (btnText && btnPermissions && btnPermissions.length) { |
||||
const isPermission = btnPermissions.includes(btnText) |
||||
if (!isPermission) { |
||||
el.parentNode && el.parentNode.removeChild(el) |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,12 @@ |
||||
/** |
||||
* @description 返回缺省值 |
||||
* 传入的如果是null,就返回'--' |
||||
* 用例:<Tag :default="val">text</Tag> 或者:<Tag>{{val | default}}</Tag> |
||||
* */ |
||||
const defaultShow = (val) => { |
||||
return val == null ? '--' : val |
||||
} |
||||
|
||||
module.exports = { |
||||
defaultShow |
||||
} |
@ -0,0 +1,14 @@ |
||||
/** |
||||
* 插件 |
||||
* */ |
||||
|
||||
import directiveAuth from '@/plugins/auth'; |
||||
import throttle from '@/plugins/throttle'; |
||||
|
||||
export default { |
||||
async install (Vue, options) { |
||||
// 指令
|
||||
Vue.directive('auth', directiveAuth); |
||||
Vue.directive('throttle', throttle); |
||||
} |
||||
} |
@ -0,0 +1,140 @@ |
||||
import axios from 'axios' |
||||
import util from '@/libs/util' |
||||
import router from '@/router/index' |
||||
import Setting from '@/setting' |
||||
import store from '@/store' |
||||
|
||||
const service = axios.create({ |
||||
baseURL: Setting.apiBaseURL, |
||||
timeout: 10000000 |
||||
}) |
||||
// post请求头
|
||||
service.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8' |
||||
|
||||
// 请求拦截器
|
||||
service.interceptors.request.use(config => { |
||||
let token = util.local.get(Setting.tokenKey) |
||||
if(token) config.headers.token = token |
||||
return config |
||||
},err => { |
||||
util.errorMsg({ |
||||
message: '退出登陆', |
||||
onClose: function () { |
||||
router.push({name: '/login'}) |
||||
} |
||||
}) |
||||
return Promise.reject(err) |
||||
}) |
||||
|
||||
// 响应拦截器
|
||||
service.interceptors.response.use( |
||||
response => { |
||||
const res = response.data |
||||
if(res.status == 200 || res.status == 10000) { |
||||
return Promise.resolve(res).catch(e => {}) |
||||
}else if(!res.status){ |
||||
return Promise.resolve(res).catch(e => {}) |
||||
}else { |
||||
util.errorMsg(res.errmessage) |
||||
return Promise.reject(res) |
||||
} |
||||
}, |
||||
// 服务器状态码不是200的情况
|
||||
error => { |
||||
if (error.response.status) { |
||||
switch (error.response.status) { |
||||
// 401: 未登录
|
||||
// 未登录则跳转登录页面,并携带当前页面的路径
|
||||
// 在登录成功后返回当前页面,这一步需要在登录页操作。
|
||||
case 401: |
||||
util.local.remove(Setting.storeKey) |
||||
util.local.remove(Setting.tokenKey) |
||||
util.errorMsg('登录过期,请重新登录') |
||||
setTimeout(() => { |
||||
router.replace({ |
||||
path: '/login', |
||||
query: { |
||||
redirect: router.currentRoute.fullPath |
||||
} |
||||
}) |
||||
}, 1000) |
||||
break |
||||
case 500: |
||||
util.errorMsg('网络错误') |
||||
break |
||||
// 403 token过期
|
||||
// 登录过期对用户进行提示
|
||||
// 清除本地token和清空vuex中token对象
|
||||
// 跳转登录页面
|
||||
case 403: |
||||
util.local.remove(Setting.storeKey) |
||||
util.local.remove(Setting.tokenKey) |
||||
util.errorMsg('登录过期,请重新登录') |
||||
// 清除token
|
||||
// store.commit('loginSuccess', null);
|
||||
// 跳转登录页面,并将要浏览的页面fullPath传过去,登录成功后跳转需要访问的页面
|
||||
setTimeout(() => { |
||||
router.replace({ |
||||
path: '/login', |
||||
query: { |
||||
redirect: router.currentRoute.fullPath |
||||
} |
||||
}) |
||||
}, 1000) |
||||
break |
||||
// 404请求不存在
|
||||
case 404: |
||||
util.errorMsg('网络请求不存在!') |
||||
break |
||||
// 其他错误,直接抛出错误提示
|
||||
default: |
||||
util.errorMsg(error.response.data.message) |
||||
Promise.reject(res) |
||||
} |
||||
return Promise.reject(error.response) |
||||
} |
||||
} |
||||
); |
||||
|
||||
function get(url, params){ |
||||
return new Promise((resolve, reject) =>{ |
||||
service.get(url, {params: params}).then(res => { |
||||
resolve(res) |
||||
}).catch(err => { |
||||
reject(err) |
||||
}) |
||||
}) |
||||
} |
||||
|
||||
function post(url, params){ |
||||
return new Promise((resolve, reject) =>{ |
||||
service.post(url,params).then(res => { |
||||
resolve(res) |
||||
}).catch(err => { |
||||
reject(err.data) |
||||
}) |
||||
}) |
||||
} |
||||
|
||||
function del(url, params){ |
||||
return new Promise((resolve, reject) =>{ |
||||
service.delete(url, { |
||||
params |
||||
}).then(res => { |
||||
resolve(res) |
||||
}).catch(err => { |
||||
reject(err.data) |
||||
}) |
||||
}) |
||||
} |
||||
|
||||
function put(url, params){ |
||||
return new Promise((resolve, reject) =>{ |
||||
service.put(url, params).then(res => { |
||||
resolve(res) |
||||
}).catch(err => { |
||||
reject(err.data) |
||||
}) |
||||
}) |
||||
} |
||||
export { get,post,del,put } |
@ -0,0 +1,43 @@ |
||||
import BasicLayout from '@/layouts/home' |
||||
|
||||
const meta = {} |
||||
|
||||
const pre = 'achievement-' |
||||
|
||||
export default { |
||||
path: '/achievement', |
||||
name: 'achievement', |
||||
redirect: { |
||||
name: `${pre}list` |
||||
}, |
||||
meta, |
||||
component: BasicLayout, |
||||
children: [ |
||||
{ |
||||
name: `${pre}list`, |
||||
path: `list`, |
||||
component: () => import('@/pages/achievement/list'), |
||||
meta: { title: '成绩管理' } |
||||
},{ |
||||
name: `${pre}vir`, |
||||
path: `vir`, |
||||
component: () => import('@/pages/achievement/vir'), |
||||
meta: { title: '成绩管理' } |
||||
},{ |
||||
name: `${pre}teach`, |
||||
path: `teach`, |
||||
component: () => import('@/pages/achievement/teach'), |
||||
meta: { title: '成绩管理' } |
||||
},{ |
||||
name: `${pre}ass`, |
||||
path: `ass`, |
||||
component: () => import('@/pages/achievement/ass'), |
||||
meta: { title: '成绩管理' } |
||||
},{ |
||||
name: `${pre}show`, |
||||
path: `show`, |
||||
component: () => import('@/pages/achievement/show'), |
||||
meta: { title: '实验报告' } |
||||
}, |
||||
] |
||||
}; |
@ -0,0 +1,29 @@ |
||||
import BasicLayout from '@/layouts/home' |
||||
|
||||
const meta = {} |
||||
|
||||
const pre = 'assessment-' |
||||
|
||||
export default { |
||||
path: '/assessment', |
||||
name: 'assessment', |
||||
redirect: { |
||||
name: `${pre}list` |
||||
}, |
||||
meta, |
||||
component: BasicLayout, |
||||
children: [ |
||||
{ |
||||
name: `${pre}list`, |
||||
path: `list`, |
||||
component: () => import('@/pages/assessment/list'), |
||||
meta: { title: '考核管理' } |
||||
}, |
||||
{ |
||||
name: `${pre}add`, |
||||
path: `add`, |
||||
component: () => import('@/pages/assessment/add/index.vue'), |
||||
meta: { title: '添加考核' } |
||||
}, |
||||
] |
||||
}; |
@ -0,0 +1,23 @@ |
||||
import BasicLayout from '@/layouts/home' |
||||
|
||||
const meta = {} |
||||
|
||||
const pre = 'evaluation-' |
||||
|
||||
export default { |
||||
path: '/evaluation', |
||||
name: 'evaluation', |
||||
redirect: { |
||||
name: `${pre}list` |
||||
}, |
||||
meta, |
||||
component: BasicLayout, |
||||
children: [ |
||||
{ |
||||
name: `${pre}list`, |
||||
path: `list`, |
||||
component: () => import('@/pages/evaluation/list'), |
||||
meta: { title: '测评管理' } |
||||
}, |
||||
] |
||||
}; |
@ -0,0 +1,29 @@ |
||||
import BasicLayout from '@/layouts/home' |
||||
|
||||
const meta = {} |
||||
|
||||
const pre = 'project-' |
||||
|
||||
export default { |
||||
path: '/project', |
||||
name: 'project', |
||||
redirect: { |
||||
name: `${pre}list` |
||||
}, |
||||
meta, |
||||
component: BasicLayout, |
||||
children: [ |
||||
{ |
||||
name: `${pre}list`, |
||||
path: `list`, |
||||
component: () => import('@/pages/project/list'), |
||||
meta: { title: '实验项目管理' } |
||||
}, |
||||
{ |
||||
name: `${pre}add`, |
||||
path: `add`, |
||||
component: () => import('@/pages/project/add'), |
||||
meta: { title: '新增项目' } |
||||
}, |
||||
] |
||||
}; |
@ -0,0 +1,23 @@ |
||||
import BasicLayout from '@/layouts/home' |
||||
|
||||
const meta = {} |
||||
|
||||
const pre = 'setting-' |
||||
|
||||
export default { |
||||
path: '/setting', |
||||
name: 'setting', |
||||
redirect: { |
||||
name: `${pre}person` |
||||
}, |
||||
meta, |
||||
component: BasicLayout, |
||||
children: [ |
||||
{ |
||||
name: `${pre}person`, |
||||
path: `person`, |
||||
component: () => import('@/pages/setting/person'), |
||||
meta: { title: '个人中心' } |
||||
}, |
||||
] |
||||
}; |
@ -0,0 +1,23 @@ |
||||
import BasicLayout from '@/layouts/home' |
||||
|
||||
const meta = {} |
||||
|
||||
const pre = 'student-' |
||||
|
||||
export default { |
||||
path: '/student', |
||||
name: 'student', |
||||
redirect: { |
||||
name: `${pre}list` |
||||
}, |
||||
meta, |
||||
component: BasicLayout, |
||||
children: [ |
||||
{ |
||||
name: `${pre}list`, |
||||
path: `list`, |
||||
component: () => import('@/pages/student/list'), |
||||
meta: { title: '学生管理' } |
||||
}, |
||||
] |
||||
}; |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue