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