课程修改

dev_202207
yujialong 2 years ago
parent 24b9fd28ac
commit 87ab0641ce
  1. 1
      src/utils/api.js
  2. 336
      src/views/course/AddCurriculum.vue
  3. 21
      src/views/match/list/index.vue
  4. 2
      src/views/match/manage/matchSignup.vue

@ -253,6 +253,7 @@ export default {
saveAnnex: `occupationlab/occupationlab/contest/annex/save`, saveAnnex: `occupationlab/occupationlab/contest/annex/save`,
getSchoolsByProvince: `nakadai/nakadai/school/getSchoolsByProvince`, getSchoolsByProvince: `nakadai/nakadai/school/getSchoolsByProvince`,
disabledEvents: `occupationlab/occupationlab/enterprise/match/contest/disabledEvents`, disabledEvents: `occupationlab/occupationlab/enterprise/match/contest/disabledEvents`,
batchDeleteContest: `occupationlab/occupationlab/enterprise/match/contest/batchDeleteContest`,
// 竞赛进展 // 竞赛进展
addContestProgress: `occupationlab/occupationlab/enterprise/match/contest-progress/addContestProgress`, addContestProgress: `occupationlab/occupationlab/enterprise/match/contest-progress/addContestProgress`,

@ -187,7 +187,7 @@
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> <el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
<el-table-column prop="applicationName" label="系统名称" align="center"> <el-table-column prop="applicationName" label="系统名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ systems.find(e => e.systemId == scope.row.systemId).systemName }} {{ systemAll.find(e => e.systemId == scope.row.systemId).systemName }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="排序" align="center" width="100"> <el-table-column label="排序" align="center" width="100">
@ -237,7 +237,7 @@
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> <el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
<el-table-column prop="applicationName" label="系统名称" align="center"> <el-table-column prop="applicationName" label="系统名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ systems.find(e => e.systemId == scope.row.systemId).systemName }} {{ systemAll.find(e => e.systemId == scope.row.systemId).systemName }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="排序" align="center" width="100"> <el-table-column label="排序" align="center" width="100">
@ -268,19 +268,19 @@
</el-row> </el-row>
<!-- 配置弹窗 --> <!-- 配置弹窗 -->
<el-dialog :visible.sync="configVisible" width="1000px" center custom-class="config-dia"> <el-dialog :visible.sync="configVisible" width="1200px" center custom-class="config-dia">
<div class="config-wrap"> <div class="config-wrap">
<div class="system"> <div class="item system">
<div class="title-wrap flex-center"> <div class="title-wrap flex-center">
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>系统列表</span> <span>系统列表</span>
</div> </div>
<el-input placeholder="请输入系统名称" prefix-icon="el-icon-search" v-model.trim="configSearch" clearable></el-input> <el-input placeholder="请输入系统名称" prefix-icon="el-icon-search" v-model.trim="systemKeyword" clearable></el-input>
<ul class="systems"> <ul class="systems">
<li v-for="(item, i) in systems" :key="i"> <li v-for="(item, i) in systems" :key="i">
<el-checkbox></el-checkbox> <el-checkbox v-model="item.check" @change="val => systemChange(val, item)"></el-checkbox>
<div class="name"> <div class="name" @click="getProject(item)">
<span>{{ item.systemName }}</span> <span>{{ item.systemName }}</span>
<i class="el-icon-arrow-right"></i> <i class="el-icon-arrow-right"></i>
</div> </div>
@ -288,24 +288,46 @@
</ul> </ul>
</div> </div>
<div class="system"> <div class="item project">
<div class="title-wrap flex-center"> <div class="title-wrap flex-center">
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>项目列表</span> <span>项目列表</span>
</div> </div>
<el-input placeholder="请输入系统名称" prefix-icon="el-icon-search" v-model.trim="configSearch" clearable></el-input> <el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="projectKeyword" clearable></el-input>
<ul class="systems"> <ul class="systems">
<li v-for="(item, i) in systems" :key="i"> <li v-for="(item, i) in projects" :key="i">
<el-checkbox></el-checkbox> <el-checkbox v-model="item.check" :label="item.projectName" @change="val => projectChange(val, item)"></el-checkbox>
<div class="name">
<span>{{ item.systemName }}</span>
<i class="el-icon-arrow-right"></i>
</div>
</li> </li>
</ul> </ul>
</div> </div>
<div class="item checked">
<div class="title-wrap flex-center">
<p class="addhr_tag"></p>
<span>已选择项目{{ checkeds.length }}</span>
</div>
<el-input style="width: 200px;margin-bottom: 20px;" placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="checkedKeyword" clearable></el-input>
<el-table :data="checkeds" class="table" stripe header-align="center">
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="applicationName" label="系统名称" align="center">
<template slot-scope="scope">
{{ systemAll.find(e => e.systemId == scope.row.systemId).systemName }}
</template>
</el-table-column>
<el-table-column prop="projectName" width="90" label="系统类型" align="center">
<template slot-scope="scope">
{{ scope.row.type }}
</template>
</el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="60">
<template slot-scope="scope">
<i class="el-icon-delete rm" @click="delProject(scope.$index)"></i>
</template>
</el-table-column>
</el-table>
</div>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -400,11 +422,10 @@ export default {
0: "运行中", 0: "运行中",
1: "默认" 1: "默认"
}, },
systems: [],
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
multipleSelection: [], multipleSelection: [],
configSearch: "", systemKeyword: "",
searchTimer: null, searchTimer: null,
configVisible: false,// configVisible: false,//
@ -419,8 +440,15 @@ export default {
submiting: false, // submiting: false, //
loadIns: null, loadIns: null,
updateTime: 0, updateTime: 0,
systemAll: [],
systems: [], systems: [],
systemChecked: [] systemChecked: [],
projects: [],
projectAll: [],
projectKeyword: '',
checkedKeyword: '',
checkeds: [],
checkedAll: []
}; };
}, },
watch: { watch: {
@ -431,46 +459,34 @@ export default {
}, },
deep:true deep:true
}, },
configSearch: function(val) { systemKeyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.getConfig();
}, 500);
},
projectKeyword: function(val) {
clearTimeout(this.searchTimer); clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData(); this.filterProject();
}, 500);
},
checkedKeyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.filterChecked();
}, 500); }, 500);
} }
}, },
created() { created() {
this.getSubject();
this.getConfig();
}, },
mounted() { mounted() {
// this.getSubject()
if (this.form.cid) { this.getConfig()
this.getInfoData(); this.form.cid && this.getInfoData()
}
// this.getSystems()
}, },
methods: { methods: {
goback() {
const id = this.form.cid
const updateTime = this.updateTime
//
if ((id && updateTime > 1) || (!id && updateTime)) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.saveAdd(1)
}).catch(() => {
this.backPage()
})
} else {
this.backPage()
}
},
//
backPage() {
this.$router.back()
this.loadIns.close()
},
getInfoData() { getInfoData() {
this.$post(`${this.api.curriculumDetail}?cid=${this.form.cid}`).then(res => { this.$post(`${this.api.curriculumDetail}?cid=${this.form.cid}`).then(res => {
let { data } = res; let { data } = res;
@ -575,82 +591,127 @@ export default {
}).catch(err => { }).catch(err => {
}); });
}, },
//
handleConfig(type) { // handleConfig(type) {
this.permissions = type; this.permissions = type;
this.configVisible = true; this.configVisible = true;
this.pageNo = 1; this.pageNo = 1;
this.getConfig(); this.getConfig();
}, this.checkeds = JSON.parse(JSON.stringify(type ? this.assessmentData : this.practiceData))
getConfig() { // },
let data = { //
systemName: this.configSearch, getConfig() {
pageNum: this.pageNo, const checked = this.permissions ? this.assessmentData : this.practiceData
pageSize: this.pageSize this.$post(this.api.queryServiceConfig, {
}; systemName: this.systemKeyword,
this.$post(this.api.queryServiceConfig, data).then(res => { pageNum: 1,
this.systems = res.serviceList.records; pageSize: 1000
}).catch(err => { }).then(res => {
}); const list = res.serviceList.records
}, this.systemAll = JSON.parse(JSON.stringify(list)) //
practiceSelectable(row, index) { // const result = []
let boolean = true; list.map(e => {
if (this.permissions) { //
this.assessmentData.length && this.assessmentData.some(e => { if (!checked.find(n => n.systemId == e.systemId)) {
if (e.systemId == row.systemId) { e.check = false
boolean = false; result.push(e)
} }
}); })
this.systems = result
list.length && this.getProject(result[0])
}).catch(err => {})
},
//
getProject(item) {
const { check } = item //
const checked = this.permissions ? this.assessmentData : this.practiceData
this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}`).then(res => {
this.projectAll = JSON.parse(JSON.stringify(res)) //
const result = []
res.map(e => {
//
if (!checked.find(n => n.projectId == e.projectId && n.systemId == e.systemId)) {
e.type = item.type ? '流程类' : '编程类'
e.check = check
result.push(e)
}
})
this.projects = result
}).catch(err => {})
},
//
filterProject() {
const val = this.projectKeyword
this.projects = this.projectAll.filter(e => e.projectName.includes(val))
},
//
systemChange(val, item) {
//
const { projects, checkeds } = this
if (projects.length && projects[0].systemId == item.systemId) {
projects.map(e => e.check = val)
}
this.projectKeyword = ''
this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}`).then(res => {
if (val) {
res.map(e => e.type = item.type ? '流程类' : '编程类')
checkeds.push(...res)
} else { } else {
this.practiceData.length && this.practiceData.some(e => { res.map(e => {
if (e.systemId == row.systemId) { const i = checkeds.findIndex(n => n.projectId == e.projectId && n.systemId == e.systemId)
boolean = false; i === -1 || checkeds.splice(i, 1)
} })
});
} }
return boolean; this.checkedAll = JSON.parse(JSON.stringify(checkeds)) //
}, }).catch(err => {})
initData() { },
this.$refs.table.clearSelection(); //
this.pageNo = 1; projectChange(val, item) {
this.getConfig(); const { systemId } = item
}, const i = this.checkeds.findIndex(e => e.projectId == item.projectId && e.systemId == systemId)
handleSelectionChange(val) { // - // push
this.multipleSelection = val; if (val) {
}, this.checkeds.push(item)
handleCurrentChange(val) { // - } else if (i !== -1) {
this.pageNo = val; this.systems.map(e => {
this.getConfig(); if (e.systemId == systemId) e.check = false
}, })
handleConfirm() { // this.checkeds.splice(i, 1)
const list = this.multipleSelection }
if (!list.length) { this.checkedAll = JSON.parse(JSON.stringify(this.checkeds)) //
this.$message.warning("请选择系统!"); },
return; //
} else if (list.find(e => !e.type) && list.find(e => e.type === 1)) { filterChecked() {
return this.$message.warning('请勿同时选择编程类和流程类的系统!') const val = this.checkedKeyword
this.checkeds = this.checkedAll.filter(e => e.projectName.includes(val))
},
//
delProject(i) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.checkeds.splice(i, 1)
}).catch(() => {})
},
//
handleConfirm() {
const list = this.checkeds
if (!list.length) {
this.$message.warning("请选择系统!");
} else {
this.configVisible = false
list.map((e, i) => {
e.isShow = 0; // isShow(0: 1:)
e.sort = i + 1; //
});
if (this.permissions) {
this.assessmentData = JSON.parse(JSON.stringify(list))
this.assessmentTotal = this.assessmentData.length;
} else { } else {
this.getConfigData(); this.practiceData = JSON.parse(JSON.stringify(list))
this.configVisible = false; this.practiceTotal = this.practiceData.length;
} }
}, }
getConfigData() { //
let ids = this.multipleSelection.map(i => i.systemId);
this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${ids.toString()}`).then((res) => {
let data = res.map((e, i) => {
e.isShow = 0; // isShow(0: 1:)
e.sort = i + 1; //
return e;
});
if (this.permissions) {
this.assessmentData.push(...data)
this.assessmentTotal = this.assessmentData.length;
} else {
this.practiceData.push(...data)
this.practiceTotal = this.practiceData.length;
}
}).catch(err => {
});
}, },
practiceSortChange(row, index) { // practiceSortChange(row, index) { //
this.practiceData.splice(index, 1, row); this.practiceData.splice(index, 1, row);
@ -794,6 +855,27 @@ export default {
return false; return false;
} }
}); });
},
goback() {
const id = this.form.cid
const updateTime = this.updateTime
//
if ((id && updateTime > 1) || (!id && updateTime)) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.saveAdd(1)
}).catch(() => {
this.backPage()
})
} else {
this.backPage()
}
},
//
backPage() {
this.$router.back()
this.loadIns.close()
} }
} }
}; };
@ -881,10 +963,15 @@ $avatar-width: 104px;
.title-wrap { .title-wrap {
margin-bottom: 15px; margin-bottom: 15px;
} }
.item {
max-height: 600px;
margin-right: 20px;
overflow: auto;
}
.system { .system {
width: 280px; width: 280px;
padding-right: 20px; padding: 10px;
// border-right: 1px solid #ccc; background-color: #f9f9f9;
} }
.systems { .systems {
margin-top: 10px; margin-top: 10px;
@ -905,5 +992,18 @@ $avatar-width: 104px;
} }
} }
} }
.project {
width: 350px;
}
.checked {
flex: 1;
}
.rm {
font-size: 14px;
cursor: pointer;
&:hover {
color: #9076FF;
}
}
} }
</style> </style>

@ -41,10 +41,12 @@
</ul> </ul>
<div> <div>
<el-button type="primary" round @click="add" v-auth>创建竞赛</el-button> <el-button type="primary" round @click="add" v-auth>创建竞赛</el-button>
<el-button type="primary" round @click="delAllSelection">批量删除</el-button>
</div> </div>
</div> </div>
<el-table ref="table" :data="matchData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> <el-table ref="table" :data="matchData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }} {{ scope.$index + (page - 1) * pageSize + 1 }}
@ -287,6 +289,25 @@ export default {
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
//
delAllSelection() {
if (this.multipleSelection.length) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(i => 'contestIds=' + i.id);
this.$post(`${this.api.batchDeleteContest}?${ids.join('&')}`).then(res => {
this.getData();
this.$message.success("删除成功");
this.$refs.table.clearSelection()
}).catch(err => {
});
}).catch(() => {
});
} else {
this.$message.warning("请先选择赛事 !");
}
},
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val; this.page = val;
this.$router.push(`match?page=${val}`) this.$router.push(`match?page=${val}`)

@ -28,6 +28,8 @@
</el-table-column> </el-table-column>
<el-table-column prop="phone" label="手机号"> <el-table-column prop="phone" label="手机号">
</el-table-column> </el-table-column>
<el-table-column prop="gmtCreate" label="报名时间">
</el-table-column>
<!-- <el-table-column label="操作" align="center" width="170"> <!-- <el-table-column label="操作" align="center" width="170">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch

Loading…
Cancel
Save