parent
6dd02d5d25
commit
db7146e1b9
8 changed files with 1448 additions and 17 deletions
@ -0,0 +1,521 @@ |
||||
<template> |
||||
<div> |
||||
<el-form :disabled="isDetail"> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between"> |
||||
<div class="per_title" v-preventReClick @click="goback()"> |
||||
<i class="el-icon-arrow-left"></i> |
||||
<span class="per_back">返回</span> |
||||
<span class="per_school">{{isDetail ? '查看' : (id ? '更新' : '创建')}}考核</span> |
||||
</div> |
||||
<div> |
||||
<el-button type="primary" size="small" round class="mag" v-preventReClick @click="upload" v-show="!isDetail">{{id ? '更新' : '创建'}}</el-button> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgr20 mgb20"> |
||||
<div> |
||||
<p class="mgb20">实验名称</p> |
||||
<el-input |
||||
placeholder="请输入实验名称" |
||||
v-model="experimentalName" |
||||
clearable |
||||
class="assName_input" |
||||
@change="judgeExpName" |
||||
></el-input> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div> |
||||
<p class="mgb20">发布方式</p> |
||||
<el-radio :disabled="id ? true : false" v-model="type" label="1" class="fons">手动发布</el-radio> |
||||
<el-radio :disabled="id ? true : false" v-model="type" label="2" class="fons">定时发布</el-radio> |
||||
</div> |
||||
</el-card> |
||||
<!-- 根据发布方式判断时间的显示 --> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div> |
||||
<p class="mgb20">实验时间</p> |
||||
<!-- 手动发布显示 --> |
||||
<div v-if="type==1"> |
||||
实验时长: |
||||
<el-input size="small" v-model="duration.day" placeholder class="dateinput"></el-input> 天 |
||||
<el-input size="small" v-model="duration.hour" placeholder class="dateinput"></el-input> 小时 |
||||
<el-input size="small" v-model="duration.minute" placeholder class="dateinput"></el-input> 分 |
||||
</div> |
||||
|
||||
<!-- 定时发布显示 --> |
||||
<div v-if="type==2" class="addAssess"> |
||||
<span class="mgr10">开始时间:</span> |
||||
<el-date-picker |
||||
size="small" |
||||
v-model="date" |
||||
type="datetimerange" |
||||
range-separator="-" |
||||
start-placeholder="开始日期" |
||||
end-placeholder="结束日期" |
||||
:picker-options="pickerOptions" |
||||
></el-date-picker> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<!-- 实训项目模块 --> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between mgb20"> |
||||
<span>实训项目</span> |
||||
<el-button type="primary" size="small" round @click="toProject">自定义实验项目</el-button> |
||||
</div> |
||||
<!-- 实训项目表格 --> |
||||
<el-table :data="projectData" class="table" stripe header-align="center"> |
||||
<!-- 单选实训项目ID --> |
||||
<el-table-column width="60" label="选择" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-radio v-model="projectId" :label="scope.row.projectId"> </el-radio> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> |
||||
<el-table-column prop="auth" label="项目权限" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{projectPermissionsList[scope.row.projectPermissions]}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="creater" label="创建人" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{roleStatus(scope.row.founder)}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="creationTime" label="创建时间" align="center"></el-table-column> |
||||
<el-table-column label="操作" align="center"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="showProject(scope.row)">查看</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination |
||||
background |
||||
:page-size="pageSize" |
||||
@current-change="handleCurrentChange" |
||||
layout="total,prev, pager, next" |
||||
:total="totals" |
||||
></el-pagination> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgr20 mgb20"> |
||||
<div> |
||||
<p class="mgb20">考试班级</p> |
||||
<div style="display: inline-block;margin-bottom: 10px"> |
||||
<el-input v-model="keyword" size="small" placeholder="请输入班级名称" clearable></el-input> |
||||
</div> |
||||
<el-tree ref="class" :data="classId" show-checkbox node-key="id" :props="defaultProps"></el-tree> |
||||
</div> |
||||
</el-card> |
||||
</el-form> |
||||
</div> |
||||
</template> |
||||
<script> |
||||
export default { |
||||
data() { |
||||
return { |
||||
id: '', |
||||
systemId: this.$config.systemId, |
||||
isDetail: true, |
||||
userId: this.$store.state.userLoginId, |
||||
cacheData: this.$store.state.addClass, |
||||
keyword: '', |
||||
searchTimer: null, |
||||
duration: { |
||||
day: '', |
||||
hour: '', |
||||
minute: '' |
||||
}, |
||||
date: '', //时间 |
||||
experimentDuration: '0d0h0m', |
||||
experimentalNumber: 0, |
||||
projectId: '', |
||||
projectName: '', |
||||
status: '', |
||||
surplusTime: '', |
||||
experimentalName: '',//实验名称 |
||||
type: '1', |
||||
isCode: '0', //是否设置邀请码 |
||||
startTime: '0000-00-00 00:00:00', //开始时间 |
||||
stopTime: '0000-00-00 00:00:00', //结束时间 |
||||
classId: [], |
||||
defaultProps: { |
||||
children: 'children', |
||||
label: 'className' |
||||
}, |
||||
currPage: 1, |
||||
projectData: [], |
||||
invRepeat: false, |
||||
pickerOptions: { |
||||
disabledDate: time => { |
||||
return time.getTime() < new Date().getTime() - 86400000 |
||||
} |
||||
}, |
||||
|
||||
projectPermissionsList: ['练习','考核','竞赛'], |
||||
projectQueryData: { |
||||
userId: this.$store.state.userLoginId, |
||||
systemId: this.$config.systemId |
||||
}, |
||||
pageNo: 1, |
||||
pageSize: 5, |
||||
totals: 0, |
||||
multipleSelection: [], |
||||
isToProject: false, |
||||
expNameRepeat: false |
||||
}; |
||||
}, |
||||
watch: { |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.getData() |
||||
},500) |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.date = [this.formatDate("yyyy-MM-dd hh:mm:ss",new Date(new Date().getTime() + 300000)),this.formatDate("yyyy-MM-dd hh:mm:ss",new Date(new Date().getTime() + 300000))] |
||||
this.id = this.$route.query.id |
||||
this.isDetail = Boolean(this.$route.query.show) |
||||
this.id && this.getData() |
||||
this.getProjectData() |
||||
this.recoveryData() |
||||
this.getClass() |
||||
}, |
||||
beforeDestroy(){ |
||||
if(!this.isToProject){ |
||||
this.$store.commit("addClassData", { addClass : {} }) |
||||
} |
||||
}, |
||||
watch: { |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.getClass() |
||||
},500) |
||||
} |
||||
}, |
||||
methods: { |
||||
getProjectData(){ |
||||
let data = this.projectQueryData |
||||
data.pageNo = this.pageNo |
||||
data.pageSize = this.pageSize |
||||
data.projectName = '' |
||||
this.$get(this.api.queryAllManagements,data).then(res => { |
||||
this.projectData = res.pageInfo.list |
||||
this.totals = res.pageInfo.total |
||||
}).catch(res => {}); |
||||
}, |
||||
getClass(){ |
||||
this.$get(`${this.api.getMineClass}?userId=${this.userId}&className=${this.keyword}`).then(res => { |
||||
let list = res.list |
||||
list.map(n => { |
||||
n.id = n.classId |
||||
}) |
||||
this.classId = list |
||||
}).catch(res => {}); |
||||
}, |
||||
recoveryData(){ |
||||
if(JSON.stringify(this.cacheData) != '{}'){ |
||||
let info = this.cacheData |
||||
this.experimentDuration = info.experimentDuration |
||||
this.experimentalName = info.experimentalName |
||||
this.projectId = info.projectId |
||||
this.startTime = info.startTime |
||||
this.stopTime = info.stopTime |
||||
this.surplusTime = info.surplusTime |
||||
this.type = String(info.type) |
||||
this.expNameRepeat = info.expNameRepeat |
||||
|
||||
this.formatDuration() |
||||
} |
||||
}, |
||||
upload() { |
||||
// return console.log(11) |
||||
if(!this.experimentalName) return this.$message.warning('请填写实验名称') |
||||
if(this.expNameRepeat) return this.$message.warning('实验名称重复,请重新输入') |
||||
if(this.type == 1){ |
||||
this.status = 1 |
||||
}else{ |
||||
if(new Date().getTime() > new Date(this.startTime).getTime()) return this.$message.warning('开始时间不能早于当前时间') |
||||
this.status = 1 |
||||
let timestamp = new Date(new Date(this.stopTime).getTime() - new Date(this.startTime).getTime()) |
||||
let minute = 1000 * 60 |
||||
let hour = minute * 60 |
||||
let day = hour * 24 |
||||
this.experimentDuration = `${Math.floor(timestamp / day)}d${Math.floor(timestamp % day / hour)}h${Math.floor(timestamp % day % hour / minute)}m` |
||||
} |
||||
if(this.type == 1 && this.experimentDuration == '0d0h0m') return this.$message.warning('请填写实验时长') |
||||
if(this.type == 2 && this.startTime == '0000-00-00 00:00:00') return this.$message.warning('请填写实验时间') |
||||
if(!this.projectId) return this.$message.warning('请选择实训项目') |
||||
let classId = this.$refs.class.getCheckedKeys() |
||||
if(!classId.length) return this.$message.warning('请选择考试班级') |
||||
|
||||
this.projectName = this.projectData.find(n => n.projectId == this.projectId).projectName |
||||
|
||||
let data = { |
||||
id: this.id, |
||||
experimentDuration: this.experimentDuration, |
||||
creationTime: this.id ? this.creationTime : this.formatDate("yyyy-MM-dd hh:mm:ss"), |
||||
experimentalName: this.experimentalName, |
||||
classId: classId.join(), |
||||
experimentalNumber: this.experimentalNumber, |
||||
isCode: this.isCode, |
||||
projectId: this.projectId, |
||||
projectName: this.projectName, |
||||
status: Number(this.status), |
||||
surplusTime: this.surplusTime, |
||||
type: Number(this.type), |
||||
userId: this.userId, |
||||
systemId: this.systemId |
||||
} |
||||
if(this.type == 2){ |
||||
data.startTime = this.startTime |
||||
data.stopTime = this.stopTime |
||||
}else{ |
||||
data.startTime = '0000-00-00 00:00:00' |
||||
data.stopTime = '0000-00-00 00:00:00' |
||||
} |
||||
if(this.id){ |
||||
this.$post(this.api.editAssessment, data).then(res => { |
||||
this.$message.success('修改成功'); |
||||
this.$router.back() |
||||
}) |
||||
.catch(err => { |
||||
}); |
||||
}else{ |
||||
this.$post(this.api.saveAssesment, data).then(res => { |
||||
this.$message.success('创建成功'); |
||||
this.$router.back() |
||||
}) |
||||
.catch(err => { |
||||
}); |
||||
} |
||||
}, |
||||
getData() { |
||||
this.$get(this.api.expInfo + this.id) |
||||
.then(res => { |
||||
if(res.errmessage == 'success'){ |
||||
let info = res.ExperimentalTeaching |
||||
this.creationTime = info.creationTime |
||||
this.experimentDuration = info.experimentDuration |
||||
this.experimentalName = info.experimentalName |
||||
this.experimentalNumber = info.experimentalNumber |
||||
this.projectId = info.projectId |
||||
this.projectName = info.projectName |
||||
this.startTime = info.startTime |
||||
this.status = info.status |
||||
this.stopTime = info.stopTime |
||||
this.surplusTime = info.surplusTime |
||||
this.type = String(info.type) |
||||
|
||||
this.formatDuration() |
||||
}else{ |
||||
this.$message.error('查询失败'); |
||||
} |
||||
}) |
||||
.catch(err => { |
||||
|
||||
}); |
||||
}, |
||||
formatDuration(){ |
||||
let duration = this.experimentDuration.replace(/\D+/g,',').split(',') |
||||
this.duration = { |
||||
day: duration[0], |
||||
hour: duration[1], |
||||
minute: duration[2] |
||||
} |
||||
this.date = [this.startTime,this.stopTime] |
||||
}, |
||||
handleCacheData(){ |
||||
let data = { |
||||
id: this.id, |
||||
experimentDuration: this.experimentDuration, |
||||
experimentalName: this.experimentalName, |
||||
projectId: this.projectId, |
||||
startTime: this.startTime, |
||||
stopTime: this.stopTime, |
||||
surplusTime: this.surplusTime, |
||||
type: this.type, |
||||
expNameRepeat: this.expNameRepeat |
||||
} |
||||
this.$store.commit("addClassData", { addClass : data}) |
||||
this.isToProject = true |
||||
}, |
||||
toProject(){ |
||||
this.handleCacheData() |
||||
this.$router.push('/project') |
||||
}, |
||||
showProject(row){ |
||||
this.handleCacheData() |
||||
this.$router.push(`/addproject?id=${row.projectId}&show=1`) |
||||
}, |
||||
goback() { |
||||
if(this.isDetail){ |
||||
this.$router.back() |
||||
}else{ |
||||
this.$confirm('确定返回?未更新的信息将不会保存。', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
this.$router.back() |
||||
}) |
||||
.catch(() => {}); |
||||
} |
||||
}, |
||||
handleCurrentChange(val){ |
||||
this.pageNo = val |
||||
this.getProjectData() |
||||
}, |
||||
judgeExpName(){ |
||||
this.$get(this.api.checkAssessmentName, { experimentalName: this.experimentalName,userId: this.userId }) |
||||
.then(res => { |
||||
if(res.errmessage != 'success') { |
||||
this.$message.warning('实验名称重复,请重新输入') |
||||
this.expNameRepeat = true |
||||
}else{ |
||||
this.expNameRepeat = false |
||||
} |
||||
}) |
||||
.catch(err => {}); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style scope> |
||||
.makeupList /deep/.el-upload-list__item { |
||||
display: none; |
||||
} |
||||
.dateinput { |
||||
width: 100px; |
||||
display: inline-block; |
||||
} |
||||
.mgb20-container { |
||||
width: 98%; |
||||
} |
||||
.makeupList { |
||||
display: flex; |
||||
} |
||||
.makeupList /deep/.el-upload--text { |
||||
width: 100px; |
||||
display: inline-block; |
||||
height: 38px; |
||||
display: flex; |
||||
border: none; |
||||
} |
||||
.makeupList /deep/.el-upload-list { |
||||
} |
||||
|
||||
.makeupList /deep/.el-icon-upload-success { |
||||
} |
||||
.mgb20-container1 /deep/ .el-checkbox__inner { |
||||
border-radius: 50%; |
||||
} |
||||
.mgb20-container1 /deep/ .el-tree .el-icon-caret-right { |
||||
background: #9278ff; |
||||
border-radius: 50%; |
||||
color: #fff; |
||||
margin-right: 5px; |
||||
} |
||||
|
||||
.mgb20-container1 /deep/.el-tree-node .is-leaf + .el-checkbox .el-checkbox__inner { |
||||
display: inline-block; |
||||
} |
||||
.mgb20-container1 /deep/.el-tree-node .el-checkbox__input > .el-checkbox__inner { |
||||
display: none; |
||||
} |
||||
.mgb20-container1 /deep/ .el-tree-node__label { |
||||
color: #333333; |
||||
font-size: 18px; |
||||
} |
||||
|
||||
.mgb20-container1 /deep/.el-tree-node__content { |
||||
height: 30px; |
||||
} |
||||
|
||||
.mgb20-container1 /deep/.is-leaf { |
||||
display: none; |
||||
} |
||||
.el-row { |
||||
margin-bottom: 20px; |
||||
padding: 20px 16px; |
||||
} |
||||
.mg20 { |
||||
margin-left: 20px; |
||||
margin-top: 20px; |
||||
} |
||||
/* .mgb20 { |
||||
position: relative; |
||||
} */ |
||||
.mag { |
||||
margin-right: 20px; |
||||
} |
||||
.mgr10 { |
||||
margin-right: 10px; |
||||
} |
||||
.mgr20 { |
||||
margin-top: 10px; |
||||
} |
||||
.assName_input { |
||||
width: 300px; |
||||
} |
||||
.foot_btn { |
||||
text-align: right; |
||||
margin-top: 20px; |
||||
} |
||||
.mgb20-input1 { |
||||
margin-left: 800px; |
||||
display: inline-block; |
||||
position: absolute; |
||||
right: 0px; |
||||
} |
||||
/* .mgb200 { |
||||
background-color: #9076ff; |
||||
color: #fff; |
||||
} */ |
||||
.makeupList { |
||||
display: inline-block; |
||||
} |
||||
.btninput { |
||||
position: relative; |
||||
|
||||
margin-bottom: 30px; |
||||
} |
||||
.classcard { |
||||
overflow: hidden; |
||||
} |
||||
.classspan { |
||||
display: inline-block; |
||||
height: 25px; |
||||
width: 80px; |
||||
background-color: #9076ff; |
||||
border-radius: 10px; |
||||
text-align: center; |
||||
line-height: 25px; |
||||
color: #fff; |
||||
margin-right: 10px; |
||||
float: left; |
||||
} |
||||
.fade-enter-active, |
||||
.fade-leave-active { |
||||
transition: opacity 0.5s; |
||||
} |
||||
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ { |
||||
opacity: 0; |
||||
} |
||||
.addAssess /deep/ .row{ |
||||
padding: 0; |
||||
margin-bottom: 0; |
||||
} |
||||
.addAssess .row /deep/ .el-form-item{ |
||||
margin-bottom: 0; |
||||
} |
||||
</style> |
@ -0,0 +1,434 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div> |
||||
<div class="flex-center mgb20"> |
||||
<p class="hr_tag"></p> |
||||
<span>筛选</span> |
||||
</div> |
||||
<div> |
||||
<el-form label-width="80px"> |
||||
<div> |
||||
<el-form-item label="实验时间" class="userRadio"> |
||||
<el-radio-group v-model="form.month" @change="getData"> |
||||
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio> |
||||
</el-radio-group> |
||||
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" 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="getData"> |
||||
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.value"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="考核状态"> |
||||
<el-select v-model="form.status" clearable placeholder="请选择考核状态" @change="getData"> |
||||
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</div> |
||||
<div> |
||||
<el-form-item> |
||||
<el-input placeholder="请输入实验班级/项目名称" prefix-icon="el-icon-search" v-model="keyword" clearable @keyup.enter.native="onSearch"></el-input> |
||||
</el-form-item> |
||||
</div> |
||||
</div> |
||||
</el-form> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="hr_tag"></p> |
||||
<span>实验教学列表</span> |
||||
</div> |
||||
<div> |
||||
<el-button |
||||
type="primary" |
||||
size="small" |
||||
icon="el-icon-plus" |
||||
round |
||||
@click="add" |
||||
class="bt_one" |
||||
>创建实验</el-button> |
||||
<el-button |
||||
type="primary" |
||||
size="small" |
||||
icon="el-icon-delete" |
||||
round |
||||
class="bt_one" |
||||
@click="delAllData" |
||||
>批量删除</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table ref="table" :data="customerData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> |
||||
<el-table-column type="selection" :selectable="row => row.status!=2" width="50" align="center" :reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" width="60" label="序号" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.$index + (pageNo - 1) * pageSize + 1}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="className" 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 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)">启动</el-button> |
||||
<el-button type="text" @click="edit(scope.row)">修改</el-button> |
||||
</template> |
||||
<template v-else-if="scope.row.status == 2"> |
||||
<el-button type="text" @click="finish(scope.row)">提前结束</el-button> |
||||
</template> |
||||
<template v-else-if="scope.row.status == 3"> |
||||
<el-button type="text" @click="show(scope.row)">查看成绩</el-button> |
||||
</template> |
||||
<el-button v-if="scope.row.status == 1 || scope.row.status == 3" type="text" @click="delData(scope.row)">删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo"> |
||||
</el-pagination> |
||||
</div> |
||||
</el-card> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import bus from '../common/bus'; |
||||
import axios from 'axios'; |
||||
export default { |
||||
name: 'dashboard', |
||||
data() { |
||||
return { |
||||
name: sessionStorage.getItem('ms_username'), |
||||
userId: this.$store.state.userLoginId, |
||||
systemList: [ |
||||
{ |
||||
id: 1, |
||||
label: 'Python实验系统' |
||||
},{ |
||||
id: 2, |
||||
label: '跨国仿真系统' |
||||
},{ |
||||
id: 3, |
||||
label: '期权期货系统' |
||||
},{ |
||||
id: 4, |
||||
label: 'Python金融建模教学系统' |
||||
},{ |
||||
id: 5, |
||||
label: 'Python数据可视化教学系统' |
||||
}, |
||||
], |
||||
keyword: '', |
||||
typeList: [ |
||||
{ |
||||
value: '', |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
value: 1, |
||||
name: '手动发布' |
||||
}, |
||||
{ |
||||
value: 2, |
||||
name: '定时发布' |
||||
} |
||||
], |
||||
status: ['','待开始','进行中','已完成'], |
||||
types: ['','手动发布','定时发布'], |
||||
statusList: [ |
||||
{ |
||||
value: '', |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
value: 1, |
||||
name: '待开始' |
||||
}, |
||||
{ |
||||
value: 2, |
||||
name: '进行中' |
||||
}, |
||||
{ |
||||
value: 3, |
||||
name: '已完成' |
||||
} |
||||
], |
||||
customerData: [], |
||||
form: { |
||||
type: '', |
||||
status: '', |
||||
startTime: '', |
||||
stopTime: '', |
||||
month: '', |
||||
searchContent: '' |
||||
}, |
||||
multipleSelection: [], |
||||
dateList: [ |
||||
{ |
||||
id: '', |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '近一个月' |
||||
}, |
||||
{ |
||||
id: 3, |
||||
name: '近三个月' |
||||
}, |
||||
{ |
||||
id: 6, |
||||
name: '近六个月' |
||||
} |
||||
], |
||||
date: [], |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
totals: 0, |
||||
ruleIds: [], |
||||
timerList: [], |
||||
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.getData() |
||||
}, |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.getData() |
||||
},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() { |
||||
// return |
||||
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, |
||||
pageNum: this.pageNo, |
||||
pageSize: this.pageSize, |
||||
userId: this.userId, |
||||
} |
||||
this.$post(this.api.assessmentByScreen,data).then(res => { |
||||
this.customerData = res.list.list |
||||
this.totals = res.list.totalCount |
||||
}).catch(res => {}); |
||||
}, |
||||
permission(){ |
||||
this.$router.push('/permission') |
||||
}, |
||||
add(){ |
||||
this.$router.push('addAssessment') |
||||
}, |
||||
edit(row){ |
||||
this.$router.push(`addAssessment?id=${row.id}`) |
||||
}, |
||||
show(row){ |
||||
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') |
||||
}, |
||||
start(row){ |
||||
let data = { |
||||
id: row.id, |
||||
startTime: this.formatDate("yyyy-MM-dd hh:mm:ss",new Date()), |
||||
status: 2 |
||||
} |
||||
this.$post(this.api.editAssessment,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.editAssessment,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.deleteBatchIds}?ids=${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 `ids=${item.id}` |
||||
}) |
||||
|
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}) |
||||
.then(() => { |
||||
let data = delList.join('&') |
||||
this.$del(`${this.api.deleteBatchIds}?${data}`).then(res => { |
||||
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> |
@ -0,0 +1,440 @@ |
||||
<template> |
||||
<div> |
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div> |
||||
<div class="flex-center mgb20"> |
||||
<p class="hr_tag"></p> |
||||
<span>筛选</span> |
||||
</div> |
||||
<div> |
||||
<el-form label-width="80px"> |
||||
<div> |
||||
<el-form-item label="实验时间" class="userRadio"> |
||||
<el-radio-group v-model="form.month" @change="getData"> |
||||
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio> |
||||
</el-radio-group> |
||||
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" 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="getData"> |
||||
<el-option v-for="(item,index) in typeList" :key="index" :label="item.name" :value="item.value"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="实验状态"> |
||||
<el-select v-model="form.status" clearable placeholder="请选择实验状态" @change="getData"> |
||||
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
</div> |
||||
<div> |
||||
<el-form-item> |
||||
<el-input placeholder="请输入竞赛组别/竞赛名称" prefix-icon="el-icon-search" v-model="keyword" clearable @keyup.enter.native="onSearch"></el-input> |
||||
</el-form-item> |
||||
</div> |
||||
</div> |
||||
</el-form> |
||||
</div> |
||||
</div> |
||||
</el-card> |
||||
|
||||
<el-card shadow="hover" class="mgb20"> |
||||
<div class="flex-between mgb20"> |
||||
<div class="flex-center"> |
||||
<p class="hr_tag"></p> |
||||
<span>竞赛实验列表</span> |
||||
</div> |
||||
<div> |
||||
<el-button |
||||
type="primary" |
||||
size="small" |
||||
icon="el-icon-plus" |
||||
round |
||||
@click="add" |
||||
class="bt_one" |
||||
>创建实验</el-button> |
||||
<el-button |
||||
type="primary" |
||||
size="small" |
||||
icon="el-icon-delete" |
||||
round |
||||
class="bt_one" |
||||
@click="delAllData" |
||||
>批量删除</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table ref="table" :data="customerData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> |
||||
<el-table-column type="selection" :selectable="row => row.status!=2" width="50" align="center" :reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" width="60" label="序号" align="center"> |
||||
<template slot-scope="scope"> |
||||
{{scope.$index + (pageNo - 1) * pageSize + 1}} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="experimentalName" label="竞赛名称" min-width="120" align="center"> |
||||
</el-table-column> |
||||
<el-table-column prop="experimentalClassName" label="竞赛组别" 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)">启动</el-button> |
||||
<el-button type="text" @click="edit(scope.row)">修改</el-button> |
||||
</template> |
||||
<template v-else-if="scope.row.status == 2"> |
||||
<el-button type="text" @click="finish(scope.row)">提前结束</el-button> |
||||
</template> |
||||
<template v-else-if="scope.row.status == 3"> |
||||
<el-button type="text" @click="show(scope.row)">查看成绩</el-button> |
||||
</template> |
||||
<el-button v-if="scope.row.status == 1 || scope.row.status == 3" type="text" @click="delData(scope.row)">删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo"> |
||||
</el-pagination> |
||||
</div> |
||||
</el-card> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import bus from '../common/bus'; |
||||
import axios from 'axios'; |
||||
export default { |
||||
name: 'dashboard', |
||||
data() { |
||||
return { |
||||
name: sessionStorage.getItem('ms_username'), |
||||
schoolId: this.$store.state.schoolId, |
||||
systemId: this.$config.systemId, |
||||
systemList: [ |
||||
{ |
||||
id: 1, |
||||
label: 'Python实验系统' |
||||
},{ |
||||
id: 2, |
||||
label: '跨国仿真系统' |
||||
},{ |
||||
id: 3, |
||||
label: '期权期货系统' |
||||
},{ |
||||
id: 4, |
||||
label: 'Python金融建模教学系统' |
||||
},{ |
||||
id: 5, |
||||
label: 'Python数据可视化教学系统' |
||||
}, |
||||
], |
||||
keyword: '', |
||||
typeList: [ |
||||
{ |
||||
value: '', |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
value: 1, |
||||
name: '手动发布' |
||||
}, |
||||
{ |
||||
value: 2, |
||||
name: '定时发布' |
||||
} |
||||
], |
||||
status: ['','待开始','进行中','已完成'], |
||||
types: ['','手动发布','定时发布'], |
||||
statusList: [ |
||||
{ |
||||
value: '', |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
value: 1, |
||||
name: '待开始' |
||||
}, |
||||
{ |
||||
value: 2, |
||||
name: '进行中' |
||||
}, |
||||
{ |
||||
value: 3, |
||||
name: '已完成' |
||||
} |
||||
], |
||||
customerData: [], |
||||
form: { |
||||
type: '', |
||||
status: '', |
||||
startTime: '', |
||||
stopTime: '', |
||||
month: '', |
||||
searchContent: '' |
||||
}, |
||||
multipleSelection: [], |
||||
dateList: [ |
||||
{ |
||||
id: '', |
||||
name: '不限' |
||||
}, |
||||
{ |
||||
id: 1, |
||||
name: '近一个月' |
||||
}, |
||||
{ |
||||
id: 3, |
||||
name: '近三个月' |
||||
}, |
||||
{ |
||||
id: 6, |
||||
name: '近六个月' |
||||
} |
||||
], |
||||
date: [], |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
totals: 0, |
||||
ruleIds: [], |
||||
timerList: [], |
||||
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.getData() |
||||
}, |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.getData() |
||||
},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 => {}); |
||||
}, |
||||
permission(){ |
||||
this.$router.push('/permission') |
||||
}, |
||||
add(){ |
||||
this.$router.push('addMatch') |
||||
}, |
||||
edit(row){ |
||||
this.$router.push(`addMatch?id=${row.id}`) |
||||
}, |
||||
show(row){ |
||||
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') |
||||
}, |
||||
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.$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> |
Loading…
Reference in new issue