From 5d928bd303009942195efda2a2fb3b9c7927bea9 Mon Sep 17 00:00:00 2001 From: zhaichao Date: Tue, 15 Sep 2026 16:06:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=AD=A6=E5=A4=A7=E7=BA=B2=E5=81=9C?= =?UTF-8?q?=E7=94=A8=E6=94=B9=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/teachBusiness/syllabus/index.vue | 41 +++++++++++++------ 1 file changed, 29 insertions(+), 12 deletions(-) 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(() => {}) },