Files
education/frontend/node_modules/.cache/vue-loader/a53419b9b09c5b9adc0970fad248c367.json
T

1 line
26 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"remainingRequest":"C:\\Users\\Admin\\Desktop\\education\\frontend\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!C:\\Users\\Admin\\Desktop\\education\\frontend\\src\\views\\subjectMajor\\discipline\\index.vue?vue&type=style&index=0&id=b12205aa&scoped=true&lang=scss","dependencies":[{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\src\\views\\subjectMajor\\discipline\\index.vue","mtime":1787567871649},{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\node_modules\\css-loader\\dist\\cjs.js","mtime":1787309792478},{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\node_modules\\vue-loader\\lib\\loaders\\stylePostLoader.js","mtime":1787309794547},{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\node_modules\\postcss-loader\\src\\index.js","mtime":1787309793084},{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\node_modules\\sass-loader\\dist\\cjs.js","mtime":1787309791955},{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1787309791955},{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\node_modules\\vue-loader\\lib\\index.js","mtime":1787309793790}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgfA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA","file":"index.vue","sourceRoot":"src/views/subjectMajor/discipline","sourcesContent":["<template>\r\n <div class=\"app-container discipline-page\">\r\n <!-- ==================== 1. 查询条件 ==================== -->\r\n <el-card shadow=\"never\" class=\"search-card\">\r\n <el-form ref=\"searchFormRef\" :model=\"searchForm\" label-width=\"90px\" class=\"search-form\">\r\n <el-row :gutter=\"24\">\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\">\r\n <el-form-item label=\"专业名称\">\r\n <el-input v-model=\"searchForm.zymc\" placeholder=\"请输入专业名称\" clearable @keyup.enter.native=\"handleSearch\" />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\">\r\n <el-form-item label=\"专业代码\">\r\n <el-input v-model=\"searchForm.zydm\" placeholder=\"请输入专业代码\" clearable @keyup.enter.native=\"handleSearch\" />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\">\r\n <el-form-item label=\"专业方向\">\r\n <el-input v-model=\"searchForm.zyfx\" placeholder=\"请输入专业方向\" clearable @keyup.enter.native=\"handleSearch\" />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\">\r\n <el-form-item label=\"学年制\">\r\n <el-input v-model=\"searchForm.xnz\" placeholder=\"请输入学年制\" clearable @keyup.enter.native=\"handleSearch\" />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\">\r\n <el-form-item label=\"状态\" class=\"checkbox-form-item\">\r\n <el-checkbox v-model=\"searchForm.ty\">停用</el-checkbox>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"12\" :xl=\"12\">\r\n <el-form-item label=\"培训类型2\">\r\n <el-select v-model=\"searchForm.pxlx2\" placeholder=\"请选择\" clearable class=\"w-full\">\r\n <el-option label=\"类型1\" value=\"1\" />\r\n <el-option label=\"类型2\" value=\"2\" />\r\n <el-option label=\"其他\" value=\"3\" />\r\n </el-select>\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n <el-row>\r\n <el-col :span=\"24\" class=\"search-actions\">\r\n <div class=\"search-buttons\">\r\n <el-button type=\"primary\" @click=\"handleSearch\">查询</el-button>\r\n <el-button @click=\"handleReset\">重置</el-button>\r\n </div>\r\n </el-col>\r\n </el-row>\r\n </el-form>\r\n </el-card>\r\n\r\n <!-- ==================== 2. 列表 ==================== -->\r\n <el-card shadow=\"never\" class=\"table-card\">\r\n <div class=\"table-header\">\r\n <span class=\"table-title\">学科专业列表:</span>\r\n <el-button type=\"primary\" icon=\"el-icon-plus\" @click=\"handleAdd\">新建学科专业</el-button>\r\n </div>\r\n <el-table v-loading=\"loading\" :data=\"tableData\" stripe border highlight-current-row>\r\n <el-table-column type=\"selection\" width=\"55\" align=\"center\" />\r\n <el-table-column label=\"序号\" width=\"60\" align=\"center\">\r\n <template slot-scope=\"scope\">{{ fmtXh(scope.$index) }}</template>\r\n </el-table-column>\r\n <el-table-column prop=\"jxgljgbh\" label=\"教学管理机构\" width=\"200\" show-overflow-tooltip />\r\n <el-table-column prop=\"zydm\" label=\"专业代码\" width=\"200\" />\r\n <el-table-column prop=\"zymc\" label=\"专业名称\" width=\"200\" show-overflow-tooltip />\r\n <el-table-column prop=\"zdyfl\" label=\"分类\" width=\"150\" align=\"center\" />\r\n <el-table-column prop=\"xylb\" label=\"学员类别\" width=\"150\" align=\"center\" />\r\n <el-table-column prop=\"xnz\" label=\"学年制\" width=\"120\" align=\"center\" />\r\n <el-table-column prop=\"xqs\" label=\"学期数\" width=\"120\" align=\"center\" />\r\n <el-table-column prop=\"zgzy\" label=\"主干专业\" align=\"center\" />\r\n <el-table-column label=\"操作\" width=\"230\" align=\"center\" fixed=\"right\">\r\n <template slot-scope=\"{ row }\">\r\n <el-button type=\"text\" size=\"small\" icon=\"el-icon-view\" @click=\"handleDetail(row)\">详情</el-button>\r\n <el-button type=\"text\" size=\"small\" icon=\"el-icon-edit\" @click=\"handleEdit(row)\">编辑</el-button>\r\n <el-button v-if=\"row.ty === 1\" type=\"text\" size=\"small\" class=\"text-success\" @click=\"handleEnable(row)\">\r\n 启用\r\n </el-button>\r\n <el-button v-else type=\"text\" size=\"small\" class=\"text-danger\" @click=\"handleDisable(row)\">\r\n 停用\r\n </el-button>\r\n </template>\r\n </el-table-column>\r\n </el-table>\r\n\r\n <el-pagination\r\n :current-page=\"pageNum\"\r\n :page-size=\"pageSize\"\r\n :total=\"total\"\r\n :page-sizes=\"[10, 20, 50, 100]\"\r\n layout=\"total, sizes, prev, pager, next, jumper\"\r\n class=\"pagination-wrapper\"\r\n @current-change=\"handlePageChange\"\r\n @size-change=\"handleSizeChange\"\r\n />\r\n </el-card>\r\n\r\n <!-- ==================== 3. 新增/编辑学科专业对话框 ==================== -->\r\n <el-dialog\r\n :visible=\"formDialogVisible\"\r\n :title=\"dialogTitle\"\r\n width=\"750px\"\r\n :close-on-click-modal=\"false\"\r\n @update:visible=\"val => formDialogVisible = val\"\r\n >\r\n <el-form ref=\"formRef\" :model=\"form\" label-width=\"130px\" class=\"add-form\">\r\n <el-row :gutter=\"16\">\r\n <el-col :span=\"12\">\r\n <el-form-item label=\"规范名称\">\r\n <el-input v-model=\"form.gfmc\" placeholder=\"请输入规范名称\" />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"12\">\r\n <el-form-item label=\"序号\">\r\n <el-input-number v-model=\"form.xh\" :min=\"0\" controls-position=\"right\" style=\"width: 100%\" placeholder=\"请输入序号\" />\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n <el-row :gutter=\"16\">\r\n <el-col :span=\"12\">\r\n <el-form-item label=\"专业代码\">\r\n <el-input v-model=\"form.zydm\" placeholder=\"请输入专业代码\" />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"12\">\r\n <el-form-item label=\"专业名称\">\r\n <el-input v-model=\"form.zymc\" placeholder=\"请输入专业名称\" />\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n <el-row :gutter=\"16\">\r\n <el-col :span=\"12\">\r\n <el-form-item label=\"专业方向\">\r\n <el-input v-model=\"form.zyfx\" placeholder=\"请输入专业方向\" />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"12\">\r\n <el-form-item label=\"学年制\">\r\n <el-input v-model=\"form.xnz\" placeholder=\"请输入学年制\" />\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n <el-row :gutter=\"16\">\r\n <el-col :span=\"12\">\r\n <el-form-item label=\"学期数\">\r\n <el-input-number v-model=\"form.xqs\" :min=\"0\" controls-position=\"right\" style=\"width: 100%\" placeholder=\"请输入学期数\" />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"12\">\r\n <el-form-item label=\"培训层次\">\r\n <el-input v-model=\"form.pxcc\" placeholder=\"请输入培训层次\" />\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n <el-row :gutter=\"16\">\r\n <el-col :span=\"12\">\r\n <el-form-item label=\"培训类型\">\r\n <el-input v-model=\"form.pxlx\" placeholder=\"请输入培训类型\" />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"12\">\r\n <el-form-item label=\"培训类型2\">\r\n <el-input v-model=\"form.pxlx2\" placeholder=\"请输入培训类型2\" />\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n <el-row :gutter=\"16\">\r\n <el-col :span=\"12\">\r\n <el-form-item label=\"教学管理机构编号\">\r\n <el-input v-model=\"form.jxgljgbh\" placeholder=\"请输入教学管理机构编号\" />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"12\">\r\n <el-form-item label=\"学员类别\">\r\n <el-input v-model=\"form.xylb\" placeholder=\"请输入学员类别\" />\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n <el-row :gutter=\"16\">\r\n <el-col :span=\"12\">\r\n <el-form-item label=\"自定义分类\">\r\n <el-input v-model=\"form.zdyfl\" placeholder=\"请输入自定义分类\" />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"12\">\r\n <el-form-item label=\"主干专业\">\r\n <el-input v-model=\"form.zgzy\" placeholder=\"请输入主干专业\" />\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n <el-row :gutter=\"16\">\r\n <el-col :span=\"12\">\r\n <el-form-item label=\"JSON字段\">\r\n <el-input v-model=\"form.jsonzd\" placeholder=\"请输入JSON字段\" />\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\r\n <el-form-item label=\"备注\">\r\n <el-input v-model=\"form.bz\" type=\"textarea\" :rows=\"3\" placeholder=\"请输入备注\" />\r\n </el-form-item>\r\n </el-form>\r\n <div slot=\"footer\">\r\n <el-button @click=\"formDialogVisible = false\">取消</el-button>\r\n <el-button type=\"primary\" :loading=\"formSaving\" @click=\"handleFormSubmit\">确定</el-button>\r\n </div>\r\n </el-dialog>\r\n\r\n <!-- ==================== 4. 详情对话框 ==================== -->\r\n <el-dialog title=\"学科专业详情\" :visible=\"detailDialogVisible\" width=\"700px\" :close-on-click-modal=\"false\"\r\n @update:visible=\"val => detailDialogVisible = val\">\r\n <div v-loading=\"detailLoading\" class=\"detail-body\">\r\n <el-descriptions :column=\"2\" border>\r\n <el-descriptions-item label=\"规范名称\">{{ detailForm.gfmc || '-' }}</el-descriptions-item>\r\n <el-descriptions-item label=\"序号\">{{ fmtValue(detailForm.xh) }}</el-descriptions-item>\r\n <el-descriptions-item label=\"专业代码\">{{ detailForm.zydm || '-' }}</el-descriptions-item>\r\n <el-descriptions-item label=\"专业名称\">{{ detailForm.zymc || '-' }}</el-descriptions-item>\r\n <el-descriptions-item label=\"专业方向\">{{ detailForm.zyfx || '-' }}</el-descriptions-item>\r\n <el-descriptions-item label=\"学年制\">{{ detailForm.xnz || '-' }}</el-descriptions-item>\r\n <el-descriptions-item label=\"学期数\">{{ fmtValue(detailForm.xqs) }}</el-descriptions-item>\r\n <el-descriptions-item label=\"培训层次\">{{ detailForm.pxcc || '-' }}</el-descriptions-item>\r\n <el-descriptions-item label=\"培训类型\">{{ detailForm.pxlx || '-' }}</el-descriptions-item>\r\n <el-descriptions-item label=\"培训类型2\">{{ detailForm.pxlx2 || '-' }}</el-descriptions-item>\r\n <el-descriptions-item label=\"教学管理机构编号\">{{ detailForm.jxgljgbh || '-' }}</el-descriptions-item>\r\n <el-descriptions-item label=\"学员类别\">{{ detailForm.xylb || '-' }}</el-descriptions-item>\r\n <el-descriptions-item label=\"自定义分类\">{{ detailForm.zdyfl || '-' }}</el-descriptions-item>\r\n <el-descriptions-item label=\"主干专业\">{{ detailForm.zgzy || '-' }}</el-descriptions-item>\r\n <el-descriptions-item label=\"停用\">\r\n <el-tag :type=\"detailForm.ty === 1 ? 'danger' : 'success'\" size=\"mini\">\r\n {{ detailForm.ty === 1 ? '是' : '否' }}\r\n </el-tag>\r\n </el-descriptions-item>\r\n <el-descriptions-item label=\"停用时间\">{{ detailForm.tysj || '-' }}</el-descriptions-item>\r\n <el-descriptions-item label=\"JSON字段\" :span=\"2\">{{ detailForm.jsonzd || '-' }}</el-descriptions-item>\r\n <el-descriptions-item label=\"备注\" :span=\"2\">{{ detailForm.bz || '-' }}</el-descriptions-item>\r\n </el-descriptions>\r\n </div>\r\n <div slot=\"footer\">\r\n <el-button @click=\"detailDialogVisible = false\">关闭</el-button>\r\n </div>\r\n </el-dialog>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport {\r\n listDiscipline,\r\n getDiscipline,\r\n addDiscipline,\r\n updateDiscipline,\r\n disableDiscipline\r\n} from '@/api/subjectMajor/discipline'\r\n\r\nexport default {\r\n name: 'DisciplineIndex',\r\n data() {\r\n return {\r\n // ==================== 查询条件 ====================\r\n searchForm: {\r\n zymc: '',\r\n zydm: '',\r\n zyfx: '',\r\n xnz: '',\r\n ty: false,\r\n pxlx2: ''\r\n },\r\n\r\n // ==================== 列表数据 ====================\r\n loading: false,\r\n tableData: [],\r\n total: 0,\r\n pageNum: 1,\r\n pageSize: 20,\r\n\r\n // ==================== 新增/编辑 ====================\r\n formDialogVisible: false,\r\n dialogTitle: '新增学科专业',\r\n isAdd: true,\r\n formSaving: false,\r\n form: this.createEmptyForm(),\r\n\r\n // ==================== 详情 ====================\r\n detailDialogVisible: false,\r\n detailLoading: false,\r\n detailForm: {}\r\n }\r\n },\r\n mounted() {\r\n this.fetchList()\r\n },\r\n methods: {\r\n /** 序号:按当前页数据索引生成跨页连续的序号 */\r\n fmtXh(index) {\r\n return (this.pageNum - 1) * this.pageSize + index + 1\r\n },\r\n\r\n createEmptyForm() {\r\n return {\r\n bsh: '',\r\n gfmc: '',\r\n xh: undefined,\r\n zydm: '',\r\n zymc: '',\r\n zyfx: '',\r\n xnz: '',\r\n xqs: undefined,\r\n pxcc: '',\r\n pxlx: '',\r\n pxlx2: '',\r\n jxgljgbh: '',\r\n xylb: '',\r\n zdyfl: '',\r\n jsonzd: '',\r\n zgzy: '',\r\n bz: ''\r\n }\r\n },\r\n\r\n // ==================== 查询列表 ====================\r\n fetchList() {\r\n this.loading = true\r\n const params = {\r\n pageNum: this.pageNum,\r\n pageSize: this.pageSize\r\n }\r\n // 状态:勾选「停用」时仅查已停用(ty=1),未勾选则查询全部\r\n if (this.searchForm.ty) {\r\n params.ty = 1\r\n }\r\n // 其余文本条件非空时才传\r\n ;['zymc', 'zydm', 'zyfx', 'xnz', 'pxlx2'].forEach(key => {\r\n const value = this.searchForm[key]\r\n if (value !== '' && value !== null && value !== undefined) {\r\n params[key] = String(value).trim()\r\n }\r\n })\r\n listDiscipline(params).then(response => {\r\n const data = response.data || {}\r\n this.tableData = data.records || []\r\n this.total = data.total || 0\r\n this.loading = false\r\n }).catch(() => {\r\n this.tableData = []\r\n this.total = 0\r\n this.loading = false\r\n })\r\n },\r\n\r\n handleSearch() {\r\n this.pageNum = 1\r\n this.fetchList()\r\n },\r\n\r\n handleReset() {\r\n this.$refs.searchFormRef.resetFields()\r\n this.pageNum = 1\r\n this.fetchList()\r\n },\r\n\r\n handlePageChange(current) {\r\n this.pageNum = current\r\n this.fetchList()\r\n },\r\n\r\n handleSizeChange(size) {\r\n this.pageSize = size\r\n this.pageNum = 1\r\n this.fetchList()\r\n },\r\n\r\n // ==================== 新增/编辑 ====================\r\n handleAdd() {\r\n this.isAdd = true\r\n this.dialogTitle = '新增学科专业'\r\n this.form = this.createEmptyForm()\r\n this.formDialogVisible = true\r\n this.$nextTick(() => {\r\n this.$refs.formRef && this.$refs.formRef.clearValidate()\r\n })\r\n },\r\n\r\n handleEdit(row) {\r\n this.isAdd = false\r\n this.dialogTitle = '编辑学科专业'\r\n this.form = this.createEmptyForm()\r\n this.formDialogVisible = true\r\n this.$nextTick(() => {\r\n this.$refs.formRef && this.$refs.formRef.clearValidate()\r\n })\r\n getDiscipline(row.bsh).then(response => {\r\n const data = response.data || {}\r\n this.form = {\r\n bsh: data.bsh || '',\r\n gfmc: data.gfmc || '',\r\n xh: data.xh !== null && data.xh !== undefined ? data.xh : undefined,\r\n zydm: data.zydm || '',\r\n zymc: data.zymc || '',\r\n zyfx: data.zyfx || '',\r\n xnz: data.xnz || '',\r\n xqs: data.xqs !== null && data.xqs !== undefined ? data.xqs : undefined,\r\n pxcc: data.pxcc || '',\r\n pxlx: data.pxlx || '',\r\n pxlx2: data.pxlx2 || '',\r\n jxgljgbh: data.jxgljgbh || '',\r\n xylb: data.xylb || '',\r\n zdyfl: data.zdyfl || '',\r\n jsonzd: data.jsonzd || '',\r\n zgzy: data.zgzy || '',\r\n bz: data.bz || ''\r\n }\r\n }).catch(() => {})\r\n },\r\n\r\n buildPayload() {\r\n const f = this.form\r\n const payload = {\r\n bsh: f.bsh || undefined,\r\n gfmc: f.gfmc,\r\n zydm: f.zydm,\r\n zymc: f.zymc,\r\n zyfx: f.zyfx,\r\n xnz: f.xnz,\r\n pxcc: f.pxcc,\r\n pxlx: f.pxlx,\r\n pxlx2: f.pxlx2,\r\n jxgljgbh: f.jxgljgbh,\r\n xylb: f.xylb,\r\n zdyfl: f.zdyfl,\r\n zgzy: f.zgzy,\r\n jsonzd: f.jsonzd,\r\n bz: f.bz\r\n }\r\n // 序号、学期数为数值字段,转为数字后再提交\r\n if (f.xh !== '' && f.xh !== null && f.xh !== undefined) {\r\n payload.xh = Number(f.xh)\r\n }\r\n if (f.xqs !== '' && f.xqs !== null && f.xqs !== undefined) {\r\n payload.xqs = Number(f.xqs)\r\n }\r\n return payload\r\n },\r\n\r\n handleFormSubmit() {\r\n this.formSaving = true\r\n const payload = this.buildPayload()\r\n const request = this.isAdd ? addDiscipline(payload) : updateDiscipline(payload)\r\n request.then(() => {\r\n this.$message.success(this.isAdd ? '新增成功' : '修改成功')\r\n this.formDialogVisible = false\r\n this.fetchList()\r\n }).catch(() => {\r\n }).finally(() => {\r\n this.formSaving = false\r\n })\r\n },\r\n\r\n // ==================== 停用/启用 ====================\r\n handleDisable(row) {\r\n this.$confirm(`确定要停用「${row.zymc || row.zydm || '该专业'}」吗?`, '系统提示', {\r\n confirmButtonText: '确定',\r\n cancelButtonText: '取消',\r\n type: 'warning'\r\n }).then(() => {\r\n return disableDiscipline(row.bsh)\r\n }).then(() => {\r\n this.$message.success('停用成功')\r\n this.fetchList()\r\n }).catch(() => {})\r\n },\r\n\r\n // 后端暂未提供启用接口,仅作提示\r\n handleEnable(row) {\r\n this.$message.info('后端暂未提供该接口')\r\n },\r\n\r\n // ==================== 详情 ====================\r\n // 数值字段空值显示为 '-'(保留 0)\r\n fmtValue(val) {\r\n return val === null || val === undefined || val === '' ? '-' : val\r\n },\r\n\r\n handleDetail(row) {\r\n this.detailDialogVisible = true\r\n this.detailLoading = true\r\n this.detailForm = {}\r\n getDiscipline(row.bsh).then(response => {\r\n this.detailForm = response.data || {}\r\n this.detailLoading = false\r\n }).catch(() => {\r\n this.detailLoading = false\r\n })\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped lang=\"scss\">\r\n.discipline-page {\r\n .search-form {\r\n .w-full {\r\n width: 100%;\r\n }\r\n\r\n .checkbox-form-item {\r\n ::v-deep(.el-form-item__content) {\r\n display: flex;\r\n align-items: center;\r\n gap: 16px;\r\n }\r\n }\r\n\r\n .search-actions {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n padding-top: 8px;\r\n\r\n .search-tip {\r\n font-size: 12px;\r\n color: #f56c6c;\r\n }\r\n\r\n .search-buttons {\r\n display: flex;\r\n gap: 12px;\r\n }\r\n }\r\n }\r\n\r\n .table-card {\r\n .table-header {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n margin-bottom: 16px;\r\n\r\n .table-title {\r\n font-size: 16px;\r\n font-weight: 600;\r\n color: #303133;\r\n }\r\n }\r\n }\r\n\r\n .add-form {\r\n max-height: 60vh;\r\n overflow-y: auto;\r\n padding-right: 4px;\r\n }\r\n\r\n .text-success {\r\n color: #67c23a;\r\n padding: 0;\r\n }\r\n\r\n .text-danger {\r\n color: #f56c6c;\r\n padding: 0;\r\n }\r\n}\r\n</style>\r\n"]}]}