课程修改

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`,
getSchoolsByProvince: `nakadai/nakadai/school/getSchoolsByProvince`,
disabledEvents: `occupationlab/occupationlab/enterprise/match/contest/disabledEvents`,
batchDeleteContest: `occupationlab/occupationlab/enterprise/match/contest/batchDeleteContest`,
// 竞赛进展
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="applicationName" label="系统名称" align="center">
<template slot-scope="scope">
{{ systems.find(e => e.systemId == scope.row.systemId).systemName }}
{{ systemAll.find(e => e.systemId == scope.row.systemId).systemName }}
</template>
</el-table-column>
<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="applicationName" label="系统名称" align="center">
<template slot-scope="scope">
{{ systems.find(e => e.systemId == scope.row.systemId).systemName }}
{{ systemAll.find(e => e.systemId == scope.row.systemId).systemName }}
</template>
</el-table-column>
<el-table-column label="排序" align="center" width="100">
@ -268,19 +268,19 @@
</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="system">
<div class="item system">
<div class="title-wrap flex-center">
<p class="addhr_tag"></p>
<span>系统列表</span>
</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">
<li v-for="(item, i) in systems" :key="i">
<el-checkbox></el-checkbox>
<div class="name">
<el-checkbox v-model="item.check" @change="val => systemChange(val, item)"></el-checkbox>
<div class="name" @click="getProject(item)">
<span>{{ item.systemName }}</span>
<i class="el-icon-arrow-right"></i>
</div>
@ -288,24 +288,46 @@
</ul>
</div>
<div class="system">
<div class="item project">
<div class="title-wrap flex-center">
<p class="addhr_tag"></p>
<span>项目列表</span>
</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">
<li v-for="(item, i) in systems" :key="i">
<el-checkbox></el-checkbox>
<div class="name">
<span>{{ item.systemName }}</span>
<i class="el-icon-arrow-right"></i>
</div>
<li v-for="(item, i) in projects" :key="i">
<el-checkbox v-model="item.check" :label="item.projectName" @change="val => projectChange(val, item)"></el-checkbox>
</li>
</ul>
</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>
<span slot="footer" class="dialog-footer">
@ -400,11 +422,10 @@ export default {
0: "运行中",
1: "默认"
},
systems: [],
pageNo: 1,
pageSize: 10,
multipleSelection: [],
configSearch: "",
systemKeyword: "",
searchTimer: null,
configVisible: false,//
@ -419,8 +440,15 @@ export default {
submiting: false, //
loadIns: null,
updateTime: 0,
systemAll: [],
systems: [],
systemChecked: []
systemChecked: [],
projects: [],
projectAll: [],
projectKeyword: '',
checkedKeyword: '',
checkeds: [],
checkedAll: []
};
},
watch: {
@ -431,46 +459,34 @@ export default {
},
deep:true
},
configSearch: function(val) {
systemKeyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.getConfig();
}, 500);
},
projectKeyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
this.filterProject();
}, 500);
},
checkedKeyword: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.filterChecked();
}, 500);
}
},
created() {
this.getSubject();
this.getConfig();
},
mounted() {
//
if (this.form.cid) {
this.getInfoData();
}
// this.getSystems()
this.getSubject()
this.getConfig()
this.form.cid && this.getInfoData()
},
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() {
this.$post(`${this.api.curriculumDetail}?cid=${this.form.cid}`).then(res => {
let { data } = res;
@ -575,82 +591,127 @@ export default {
}).catch(err => {
});
},
handleConfig(type) { //
//
handleConfig(type) {
this.permissions = type;
this.configVisible = true;
this.pageNo = 1;
this.getConfig();
},
getConfig() { //
let data = {
systemName: this.configSearch,
pageNum: this.pageNo,
pageSize: this.pageSize
};
this.$post(this.api.queryServiceConfig, data).then(res => {
this.systems = res.serviceList.records;
}).catch(err => {
});
},
practiceSelectable(row, index) { //
let boolean = true;
if (this.permissions) {
this.assessmentData.length && this.assessmentData.some(e => {
if (e.systemId == row.systemId) {
boolean = false;
}
});
this.checkeds = JSON.parse(JSON.stringify(type ? this.assessmentData : this.practiceData))
},
//
getConfig() {
const checked = this.permissions ? this.assessmentData : this.practiceData
this.$post(this.api.queryServiceConfig, {
systemName: this.systemKeyword,
pageNum: 1,
pageSize: 1000
}).then(res => {
const list = res.serviceList.records
this.systemAll = JSON.parse(JSON.stringify(list)) //
const result = []
list.map(e => {
//
if (!checked.find(n => n.systemId == e.systemId)) {
e.check = 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 {
this.practiceData.length && this.practiceData.some(e => {
if (e.systemId == row.systemId) {
boolean = false;
}
});
res.map(e => {
const i = checkeds.findIndex(n => n.projectId == e.projectId && n.systemId == e.systemId)
i === -1 || checkeds.splice(i, 1)
})
}
return boolean;
},
initData() {
this.$refs.table.clearSelection();
this.pageNo = 1;
this.getConfig();
},
handleSelectionChange(val) { // -
this.multipleSelection = val;
},
handleCurrentChange(val) { // -
this.pageNo = val;
this.getConfig();
},
handleConfirm() { //
const list = this.multipleSelection
if (!list.length) {
this.$message.warning("请选择系统!");
return;
} else if (list.find(e => !e.type) && list.find(e => e.type === 1)) {
return this.$message.warning('请勿同时选择编程类和流程类的系统!')
this.checkedAll = JSON.parse(JSON.stringify(checkeds)) //
}).catch(err => {})
},
//
projectChange(val, item) {
const { systemId } = item
const i = this.checkeds.findIndex(e => e.projectId == item.projectId && e.systemId == systemId)
// push
if (val) {
this.checkeds.push(item)
} else if (i !== -1) {
this.systems.map(e => {
if (e.systemId == systemId) e.check = false
})
this.checkeds.splice(i, 1)
}
this.checkedAll = JSON.parse(JSON.stringify(this.checkeds)) //
},
//
filterChecked() {
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 {
this.getConfigData();
this.configVisible = false;
this.practiceData = JSON.parse(JSON.stringify(list))
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) { //
this.practiceData.splice(index, 1, row);
@ -794,6 +855,27 @@ export default {
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 {
margin-bottom: 15px;
}
.item {
max-height: 600px;
margin-right: 20px;
overflow: auto;
}
.system {
width: 280px;
padding-right: 20px;
// border-right: 1px solid #ccc;
padding: 10px;
background-color: #f9f9f9;
}
.systems {
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>

@ -41,10 +41,12 @@
</ul>
<div>
<el-button type="primary" round @click="add" v-auth>创建竞赛</el-button>
<el-button type="primary" round @click="delAllSelection">批量删除</el-button>
</div>
</div>
<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">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
@ -287,6 +289,25 @@ export default {
handleSelectionChange(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) {
this.page = val;
this.$router.push(`match?page=${val}`)

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

Loading…
Cancel
Save