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