|
|
|
@ -80,27 +80,37 @@ |
|
|
|
|
(scope.row.postStatus ? '已发布' : '草稿') }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column v-if="!isSystem" |
|
|
|
|
label="操作" |
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
width="230"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button v-auth="'/expSystem/list:进入:源模型管理:查看'" |
|
|
|
|
type="text" |
|
|
|
|
@click="show(scope.row)">查看</el-button> |
|
|
|
|
<el-button v-auth="'/expSystem/list:进入:源模型管理:编辑'" |
|
|
|
|
type="text" |
|
|
|
|
@click="edit(scope.row)">编辑</el-button> |
|
|
|
|
<el-button v-auth="'/expSystem/list:进入:源模型管理:删除'" |
|
|
|
|
type="text" |
|
|
|
|
@click="del(scope.row)">删除</el-button> |
|
|
|
|
<el-switch v-auth="'/expSystem/list:进入:源模型管理:禁用'" |
|
|
|
|
v-if="scope.row.postStatus" |
|
|
|
|
v-model="scope.row.isOpen" |
|
|
|
|
<template v-if="!isSystem"> |
|
|
|
|
<el-button v-auth="'/expSystem/list:进入:源模型管理:编辑'" |
|
|
|
|
type="text" |
|
|
|
|
@click="edit(scope.row)">编辑</el-button> |
|
|
|
|
<el-button v-auth="'/expSystem/list:进入:源模型管理:删除'" |
|
|
|
|
type="text" |
|
|
|
|
@click="del(scope.row)">删除</el-button> |
|
|
|
|
|
|
|
|
|
<el-switch v-auth="'/expSystem/list:进入:源模型管理:禁用'" |
|
|
|
|
v-if="scope.row.postStatus" |
|
|
|
|
v-model="scope.row.isOpen" |
|
|
|
|
:active-value="0" |
|
|
|
|
:inactive-value="1" |
|
|
|
|
style="margin: 0 10px 0 5px" |
|
|
|
|
:active-text="scope.row.isOpen ? '禁用' : '启用'" |
|
|
|
|
@change="switchOff($event,scope.row,scope.$index)"></el-switch> |
|
|
|
|
</template> |
|
|
|
|
<el-switch v-else-if="!scope.row.isOpen" |
|
|
|
|
v-auth="'/expSystem/list:进入:源模型管理:禁用'" |
|
|
|
|
v-model="scope.row.isClose" |
|
|
|
|
:active-value="0" |
|
|
|
|
:inactive-value="1" |
|
|
|
|
style="margin: 0 10px 0 5px" |
|
|
|
|
:active-text="scope.row.isOpen ? '禁用' : '启用'" |
|
|
|
|
@change="switchOff($event,scope.row,scope.$index)"></el-switch> |
|
|
|
|
@change="switchOffSystem($event,scope.row,scope.$index)"></el-switch> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
@ -165,16 +175,16 @@ export default { |
|
|
|
|
// 系统内置 |
|
|
|
|
if (this.isSystem) { |
|
|
|
|
// 如果是首级,要调另一个接口 |
|
|
|
|
res = await this.$post(this.api[!curNode.level ? 'getAllModelList' : 'referenceDemoList'], data) |
|
|
|
|
res = await this.$post(this.api[!curNode.level ? 'systemModelByTeacher' : 'sortReadingModelByTeacherSideSystem'], data) |
|
|
|
|
} else { |
|
|
|
|
data.founder = 1 |
|
|
|
|
// 本校模型 |
|
|
|
|
res = await this.$post(this.api.InstitutionSourceModel, data) |
|
|
|
|
// 中台禁用了(ztOpen=1),则直接显示禁用 |
|
|
|
|
res.data.records.forEach(e => { |
|
|
|
|
if (e.ztOpen) e.isOpen = 1 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
// 中台禁用了(ztOpen=1),则直接显示禁用 |
|
|
|
|
res.data.records.forEach(e => { |
|
|
|
|
if (e.ztOpen) e.isOpen = 1 |
|
|
|
|
}) |
|
|
|
|
this.listData = res.data.records |
|
|
|
|
this.total = res.data.total |
|
|
|
|
}, |
|
|
|
@ -216,6 +226,7 @@ export default { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$post(this.api.deleteSysModelDemo, ids).then(res => { |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
this.$message.success('删除成功') |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => { }) |
|
|
|
@ -246,19 +257,20 @@ export default { |
|
|
|
|
batchOff (ztOpen) { |
|
|
|
|
const off = ztOpen === 0 |
|
|
|
|
if (this.multipleSelection.length) { |
|
|
|
|
// 批量删除 |
|
|
|
|
let list = [] |
|
|
|
|
this.multipleSelection.map(e => { |
|
|
|
|
list.push({ |
|
|
|
|
const { isSystem } = this |
|
|
|
|
const list = this.multipleSelection.map(e => { |
|
|
|
|
return isSystem ? e.id : { |
|
|
|
|
isOpen: ztOpen, |
|
|
|
|
modelId: e.id, |
|
|
|
|
type: 1 |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.$confirm(`确定要${off ? '启用' : '禁用'}吗?`, "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$post(this.api.disableModelDemo, list).then(res => { |
|
|
|
|
// 本校跟系统的禁用接口不一样,系统的禁用启用接口分为两个 |
|
|
|
|
this.$post(this.api[isSystem ? (off ? 'demoHiddenOpen' : 'demoHiddenClose') : 'disableModelDemo'], list).then(res => { |
|
|
|
|
this.$refs.table.clearSelection() |
|
|
|
|
this.$message.success(`${off ? '启用' : '禁用'}成功`) |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => { }) |
|
|
|
@ -267,8 +279,8 @@ export default { |
|
|
|
|
this.$message.error("请先选择模型 !") |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 禁用 |
|
|
|
|
switchOff (val, row, index) { |
|
|
|
|
// 本校禁用 |
|
|
|
|
switchOff (val, row,) { |
|
|
|
|
this.$post(this.api.disableModelDemo, [{ |
|
|
|
|
isOpen: val, |
|
|
|
|
modelId: row.id, |
|
|
|
@ -277,6 +289,12 @@ export default { |
|
|
|
|
this.$message.success(val ? '禁用成功' : '启用成功') |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
// 系统内置禁用 |
|
|
|
|
switchOffSystem (val, row) { |
|
|
|
|
this.$post(this.api[val ? 'demoHiddenClose' : 'demoHiddenOpen'], [row.id]).then(res => { |
|
|
|
|
this.$message.success(val ? '禁用成功' : '启用成功') |
|
|
|
|
}).catch(res => { }) |
|
|
|
|
}, |
|
|
|
|
handleSelectionChange (val) { |
|
|
|
|
this.multipleSelection = val |
|
|
|
|
}, |
|
|
|
|