|
|
|
@ -1,103 +1,69 @@ |
|
|
|
|
<template> |
|
|
|
|
<div> |
|
|
|
|
<el-card shadow="hover" |
|
|
|
|
class="m-b-20"> |
|
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
|
<div> |
|
|
|
|
<p class="m-b-20">比赛名称</p> |
|
|
|
|
{{ form.stageName }} |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
<el-card shadow="hover" |
|
|
|
|
class="m-b-20"> |
|
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
|
<div> |
|
|
|
|
<p class="m-b-20">比赛时间</p> |
|
|
|
|
<div class="date-inputs"> |
|
|
|
|
起止时间: |
|
|
|
|
<div style="display: inline-flex;align-items: center;"> |
|
|
|
|
<el-date-picker v-model="form.time" |
|
|
|
|
type="datetimerange" |
|
|
|
|
range-separator="~" |
|
|
|
|
start-placeholder="开始日期" |
|
|
|
|
end-placeholder="结束日期" |
|
|
|
|
format="yyyy-MM-dd HH:mm:ss" |
|
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
|
@change="timeChange"> |
|
|
|
|
<el-date-picker v-model="form.time" type="datetimerange" range-separator="~" start-placeholder="开始日期" |
|
|
|
|
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
|
@change="timeChange"> |
|
|
|
|
</el-date-picker> |
|
|
|
|
<el-alert style="width: auto;padding: 4px 16px;margin-left: 10px;" |
|
|
|
|
:title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'" |
|
|
|
|
type="error" |
|
|
|
|
:closable="false" |
|
|
|
|
effect="dark"> |
|
|
|
|
:title="'(请设置在 ' + step1.playStartTime + ' ~ ' + step1.playEndTime + '间)'" type="error" :closable="false" |
|
|
|
|
effect="dark"> |
|
|
|
|
</el-alert> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
<el-card shadow="hover" |
|
|
|
|
class="mgr20 m-b-20"> |
|
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
|
<div> |
|
|
|
|
<p class="m-b-20">课程</p> |
|
|
|
|
<p class="m-b-20">系统</p> |
|
|
|
|
<div class="inline-input"> |
|
|
|
|
<el-cascader ref="cur" |
|
|
|
|
v-model="mallIds" |
|
|
|
|
:options="curs" |
|
|
|
|
:props="{ checkStrictly: true, value: 'id' }" |
|
|
|
|
popper-class="course-cas" |
|
|
|
|
@expand-change="curChange" |
|
|
|
|
@change="curChange"></el-cascader> |
|
|
|
|
<el-select v-model="systemId" placeholder="请选择系统" @change="getProject"> |
|
|
|
|
<el-option v-for="(item, i) in systems" :key="i" :label="item.systemName" :value="item.systemId"> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
<el-card shadow="hover" |
|
|
|
|
class="m-b-20"> |
|
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
|
<div class="flex-between m-b-20"> |
|
|
|
|
<span>实训项目</span> |
|
|
|
|
<div style="display: inline-flex;"> |
|
|
|
|
<div> |
|
|
|
|
<el-input placeholder="请输入项目名称" |
|
|
|
|
prefix-icon="el-icon-search" |
|
|
|
|
v-model.trim="keyword" |
|
|
|
|
clearable></el-input> |
|
|
|
|
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="keyword" clearable></el-input> |
|
|
|
|
</div> |
|
|
|
|
<el-button style="margin-left: 5px" |
|
|
|
|
type="primary" |
|
|
|
|
round |
|
|
|
|
@click="toProject">自定义实验项目</el-button> |
|
|
|
|
<el-button style="margin-left: 5px" type="primary" round @click="toProject">自定义实验项目</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<!-- 实训项目表格 --> |
|
|
|
|
<el-table :data="projects" |
|
|
|
|
class="table" |
|
|
|
|
stripe |
|
|
|
|
header-align="center"> |
|
|
|
|
<el-table-column width="60" |
|
|
|
|
label="选择" |
|
|
|
|
align="center"> |
|
|
|
|
<el-table :data="projects" class="table" stripe header-align="center"> |
|
|
|
|
<el-table-column width="60" label="选择" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-radio v-model="form.projectId" |
|
|
|
|
:label="scope.row.projectId"> </el-radio> |
|
|
|
|
<el-radio v-model="form.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"> |
|
|
|
|
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="auth" label="项目权限" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ permissionsKeys[scope.row.permissions] }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="founder" |
|
|
|
|
label="创建人" |
|
|
|
|
align="center"> |
|
|
|
|
<el-table-column prop="founder" label="创建人" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
{{ scope.row.founder ? '老师创建' : '系统内置' }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="createTime" |
|
|
|
|
label="创建时间" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="createTime" 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> |
|
|
|
@ -105,18 +71,14 @@ |
|
|
|
|
</el-table-column> --> |
|
|
|
|
</el-table> |
|
|
|
|
<div class="pagination"> |
|
|
|
|
<el-pagination background |
|
|
|
|
:page-size="pageSize" |
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
layout="total,prev, pager, next" |
|
|
|
|
:total="total"></el-pagination> |
|
|
|
|
<el-pagination background :page-size="pageSize" @current-change="handleCurrentChange" |
|
|
|
|
layout="total,prev, pager, next" :total="total"></el-pagination> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
<div style="text-align: center"> |
|
|
|
|
<el-button @click="back">返回</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="save">保存</el-button> |
|
|
|
|
<el-button type="primary" @click="save">保存</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
@ -129,14 +91,13 @@ export default { |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
loadIns: null, |
|
|
|
|
mallIds: [], |
|
|
|
|
curs: [], |
|
|
|
|
systems: [], |
|
|
|
|
keyword: '', |
|
|
|
|
projects: [], |
|
|
|
|
page: 1, |
|
|
|
|
pageSize: 5, |
|
|
|
|
total: 0, |
|
|
|
|
sysId: '', |
|
|
|
|
systemId: '', |
|
|
|
|
permissionsKeys: ['练习', '考核', '竞赛'], |
|
|
|
|
timeInvalid: false |
|
|
|
|
}; |
|
|
|
@ -163,68 +124,27 @@ export default { |
|
|
|
|
// 获取课程 |
|
|
|
|
async getCourse () { |
|
|
|
|
const sid = this.$store.state.dataPer.find(e => e.permissionName === '服务配置') |
|
|
|
|
const { serviceList } = await this.$post(this.api.queryServiceConfig, { |
|
|
|
|
const res = await this.$post(this.api.queryServiceConfig, { |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 1000, |
|
|
|
|
supplierId: sid ? sid.supplierId : '' |
|
|
|
|
}) |
|
|
|
|
const { page } = await this.$post(this.api.listOfGoods, { |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 10000, |
|
|
|
|
hotTag: 1, |
|
|
|
|
sort: 0, |
|
|
|
|
isAssociatedProduct: 1, |
|
|
|
|
isShelves: 0, |
|
|
|
|
}) |
|
|
|
|
const { records } = page |
|
|
|
|
const { mallId, cid, systemId } = this.form |
|
|
|
|
const { records } = res.serviceList |
|
|
|
|
if (records.length) { |
|
|
|
|
serviceList.records.map(e => { |
|
|
|
|
e.id = +e.systemId |
|
|
|
|
e.label = e.systemName |
|
|
|
|
}) |
|
|
|
|
records.map(e => { |
|
|
|
|
e.id = +e.mallId |
|
|
|
|
e.label = e.productName |
|
|
|
|
e.children = serviceList.records.filter(n => e.systemId.split(',').includes(n.systemId)) // 筛选出该课程下的系统 |
|
|
|
|
}) |
|
|
|
|
this.curs = records |
|
|
|
|
|
|
|
|
|
// 查询项目 |
|
|
|
|
const first = records[0] |
|
|
|
|
this.mallIds = [mallId || first.mallId, systemId || first.children[0].id] |
|
|
|
|
this.form.mallId = mallId || first.mallId |
|
|
|
|
this.form.cid = cid || +first.associatedProduct |
|
|
|
|
this.form.systemId = systemId || first.systemId |
|
|
|
|
this.sysId = systemId || first.systemId |
|
|
|
|
this.systems = records |
|
|
|
|
this.systemId = records[0].systemId |
|
|
|
|
this.loadIns = Loading.service() |
|
|
|
|
this.getProject() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 课程选择回调 |
|
|
|
|
curChange (val) { |
|
|
|
|
const id = val[0] |
|
|
|
|
const item = this.curs.find(e => e.id == id) |
|
|
|
|
if (val.length === 1) { |
|
|
|
|
// 如果选择的是课程,则默认选中下面第一个系统 |
|
|
|
|
this.mallIds = [id, item.children[0].id] |
|
|
|
|
} |
|
|
|
|
this.form.mallId = id |
|
|
|
|
this.form.cid = +item.associatedProduct |
|
|
|
|
this.form.systemId = this.mallIds[1] |
|
|
|
|
this.sysId = this.mallIds[1] |
|
|
|
|
this.loadIns = Loading.service() |
|
|
|
|
this.getProject() |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 查询项目 |
|
|
|
|
getProject () { |
|
|
|
|
this.$post(this.api.getProjectAssessmentByCompetition, { |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
cid: this.form.cid, |
|
|
|
|
projectName: this.keyword, |
|
|
|
|
systemId: this.sysId, |
|
|
|
|
systemId: this.systemId, |
|
|
|
|
permissions: 2 |
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
this.projects = data.records |
|
|
|
@ -302,5 +222,4 @@ export default { |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|
</style> |
|
|
|
|
<style scoped lang="scss"></style> |