解决禁止勾选已经选过的系统bug

dev
yujialong 3 years ago
parent 74c7bd4b83
commit bcba973009
  1. 44
      src/views/course/AddCurriculum.vue

@ -143,7 +143,7 @@
@input="practiceSortChange(scope.row, scope.$index)"></el-input>
</template>
</el-table-column>
<el-table-column label="展示控制" align="center">
<el-table-column label="展示控制" align="center" width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isShow"
@ -189,7 +189,7 @@
@input="assessmentSortChange(scope.row, scope.$index)"></el-input>
</template>
</el-table-column>
<el-table-column label="展示控制" align="center">
<el-table-column label="展示控制" align="center" width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isShow"
@ -200,8 +200,7 @@
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button @click.native.prevent="handleDelete(scope.$index, assessmentData)">移除
</el-button>
<el-button @click.native.prevent="handleDelete(scope.$index, assessmentData)">移除</el-button>
</template>
</el-table-column>
</el-table>
@ -219,12 +218,11 @@
<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="configSearch" clearable></el-input>
</div>
</div>
<el-table ref="table" :data="permissionData" class="table" stripe header-align="center"
@selection-change="handleSelectionChange">
@selection-change="handleSelectionChange" row-key="systemId">
<el-table-column type="selection" :selectable="practiceSelectable" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="systemName" label="系统名称" align="center"></el-table-column>
@ -368,9 +366,24 @@ export default {
},
getInfoData() {
this.$post(`${this.api.curriculumDetail}?cid=${this.form.cid}`).then(res => {
this.form = res.data;
this.practiceData = res.data.practiceConfig;
this.assessmentData = res.data.assessmentConfig;
if (res.status === 200) {
let { data } = res;
if (data.categoryId) {
this.$get(this.api.courseProfessionalClass, { disciplineId: data.categoryId }).then(res => {
this.ProfessionalClassList = res.list;
}).catch(res => {});
}
if (data.professionalCategoryId) {
this.$get(this.api.courseProfessional, { professionalClassId: data.professionalCategoryId }).then(res => {
this.ProfessionalList = res.list;
}).catch(res => {});
}
this.$nextTick(() => {
this.form = data;
this.practiceData = data.practiceConfig;
this.assessmentData = data.assessmentConfig;
});
}
}).catch(err => {
});
},
@ -456,7 +469,6 @@ export default {
});
},
practiceSelectable(row, index) { //
// console.log(row,index);
let boolean = true;
if (this.permissions) {
this.assessmentData.length && this.assessmentData.some(e => {
@ -466,7 +478,6 @@ export default {
});
} else {
this.practiceData.length && this.practiceData.some(e => {
// console.log(e.systemId, row.systemId);
if (e.systemId == row.systemId) {
boolean = false;
}
@ -498,11 +509,10 @@ export default {
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((item, index) => {
item.isShow = 0; // isShow(0: 1:)
item.sort = index + 1;
item.systemId = this.multipleSelection[0].systemId;
return item;
let data = res.map((e, i) => {
e.isShow = 0; // isShow(0: 1:)
e.sort = i + 1; //
return e;
});
if (this.permissions) {
this.assessmentData = data;

Loading…
Cancel
Save