diff --git a/frontend/src/views/teachBusiness/syllabus/index.vue b/frontend/src/views/teachBusiness/syllabus/index.vue
index 9ac8a482..1466139a 100644
--- a/frontend/src/views/teachBusiness/syllabus/index.vue
+++ b/frontend/src/views/teachBusiness/syllabus/index.vue
@@ -34,12 +34,13 @@
新增
删除所选
+ >停用所选
下载
@@ -87,7 +88,14 @@
编辑
- 删除
+ 停用
@@ -341,6 +349,9 @@ export default {
}
const start = (this.pageNum - 1) * this.pageSize
return this.tableData.slice(start, start + this.pageSize)
+ },
+ activeSelection() {
+ return this.selection.filter(row => !this.isDisabled(row))
}
},
created() {
@@ -452,33 +463,39 @@ export default {
})
},
- /* ---------- 删除 / 批量删除 ---------- */
+ /* ---------- 停用 / 批量停用 ---------- */
+ isDisabled(row) {
+ return Number(row && row.ty) === 1
+ },
handleDelete(row) {
- this.$confirm('删除后该条记录将置为「停用」,是否继续?', '提示', {
+ if (this.isDisabled(row)) {
+ return
+ }
+ this.$confirm('确认停用该条教学大纲吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
return deleteSyllabus(row.bh)
}).then(() => {
- this.$message.success('删除成功')
+ this.$message.success('停用成功')
this.fetchList()
}).catch(() => {})
},
handleBatchDelete() {
- if (!this.selection.length) {
- this.$message.warning('请先勾选要删除的记录')
+ const bhList = this.activeSelection.map(row => row.bh)
+ if (!bhList.length) {
+ this.$message.warning('请先勾选要停用的记录')
return
}
- const bhList = this.selection.map(row => row.bh)
- this.$confirm('确定删除所选 ' + bhList.length + ' 条记录吗?(将置为「停用」)', '提示', {
+ this.$confirm('确定停用所选 ' + bhList.length + ' 条记录吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
return batchDeleteSyllabus(bhList)
}).then(() => {
- this.$message.success('批量删除成功')
+ this.$message.success('批量停用成功')
this.fetchList()
}).catch(() => {})
},