forked from liweijie/education
1 line
26 KiB
JSON
1 line
26 KiB
JSON
{"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\\studentRecords\\warningCondition\\index.vue?vue&type=style&index=0&id=53e19080&scoped=true&lang=scss","dependencies":[{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\src\\views\\studentRecords\\warningCondition\\index.vue","mtime":1787314245910},{"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:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCi53YXJuaW5nLWNvbmRpdGlvbi1wYWdlIHsKICAuc2VhcmNoLWNhcmQgewogICAgbWFyZ2luLWJvdHRvbTogMTZweDsKICB9CgogIC5zZWFyY2gtZm9ybSB7CiAgICA6OnYtZGVlcCAuZWwtZm9ybS1pdGVtIHsKICAgICAgbWFyZ2luLWJvdHRvbTogMThweDsKICAgIH0KCiAgICAuc2VhcmNoLWFjdGlvbnMtcm93IHsKICAgICAgbWFyZ2luLXRvcDogMnB4OwogICAgICBib3JkZXItdG9wOiAxcHggZGFzaGVkICNlYmVlZjU7CiAgICAgIHBhZGRpbmctdG9wOiAxNHB4OwogICAgfQoKICAgIC5zZWFyY2gtYWN0aW9ucyB7CiAgICAgIGRpc3BsYXk6IGZsZXg7CiAgICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7CiAgICAgIGp1c3RpZnktY29udGVudDogZmxleC1lbmQ7CiAgICAgIGdhcDogMTJweDsKICAgIH0KICB9CgogIC50YWJsZS1jYXJkIHsKICAgIC50YWJsZS1oZWFkZXIgewogICAgICBkaXNwbGF5OiBmbGV4OwogICAgICBhbGlnbi1pdGVtczogY2VudGVyOwogICAgICBqdXN0aWZ5LWNvbnRlbnQ6IHNwYWNlLWJldHdlZW47CiAgICAgIG1hcmdpbi1ib3R0b206IDE2cHg7CgogICAgICAudGFibGUtdGl0bGUgewogICAgICAgIGZvbnQtc2l6ZTogMTZweDsKICAgICAgICBmb250LXdlaWdodDogNjAwOwogICAgICAgIGNvbG9yOiAjMzAzMTMzOwogICAgICB9CgogICAgICAudGFibGUtYWN0aW9ucyB7CiAgICAgICAgZGlzcGxheTogZmxleDsKICAgICAgICBhbGlnbi1pdGVtczogY2VudGVyOwogICAgICAgIGdhcDogMTBweDsKICAgICAgfQogICAgfQoKICAgIC5wYWdpbmF0aW9uLXdyYXBwZXIgewogICAgICBkaXNwbGF5OiBmbGV4OwogICAgICBqdXN0aWZ5LWNvbnRlbnQ6IGZsZXgtZW5kOwogICAgICBtYXJnaW4tdG9wOiAxNnB4OwogICAgfQogIH0KCiAgLmZvcm0tZGlhbG9nLWZvcm0gewogICAgbWF4LWhlaWdodDogNjJ2aDsKICAgIG92ZXJmbG93LXk6IGF1dG87CiAgICBwYWRkaW5nLXJpZ2h0OiA2cHg7CgogICAgOjp2LWRlZXAgLmVsLWRpdmlkZXItLWhvcml6b250YWwgewogICAgICBtYXJnaW46IDRweCAwIDE2cHg7CiAgICB9CiAgfQoKICAudHktdGFnIHsKICAgIGN1cnNvcjogcG9pbnRlcjsKICAgIHVzZXItc2VsZWN0OiBub25lOwogIH0KfQo="},{"version":3,"sources":["index.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwdA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA","file":"index.vue","sourceRoot":"src/views/studentRecords/warningCondition","sourcesContent":["<template>\n <div class=\"app-container warning-condition-page\">\n <!-- ==================== 1. 查询条件 ==================== -->\n <el-card shadow=\"never\" class=\"search-card\">\n <el-form ref=\"searchFormRef\" :model=\"searchForm\" label-width=\"90px\" class=\"search-form\">\n <el-row :gutter=\"24\">\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"8\" :xl=\"8\">\n <el-form-item label=\"名称\">\n <el-input v-model=\"searchForm.mc\" placeholder=\"请输入名称\" clearable @keyup.enter.native=\"handleSearch\" />\n </el-form-item>\n </el-col>\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"8\" :xl=\"8\">\n <el-form-item label=\"培训类型\">\n <el-input v-model=\"searchForm.pxlx\" placeholder=\"请输入培训类型\" clearable @keyup.enter.native=\"handleSearch\" />\n </el-form-item>\n </el-col>\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"8\" :xl=\"8\">\n <el-form-item label=\"培训层次\">\n <el-input v-model=\"searchForm.pxcc\" placeholder=\"请输入培训层次\" clearable @keyup.enter.native=\"handleSearch\" />\n </el-form-item>\n </el-col>\n <el-col :xs=\"24\" :sm=\"12\" :md=\"12\" :lg=\"8\" :xl=\"8\">\n <el-form-item label=\"状态\">\n <el-select v-model=\"searchForm.ty\" placeholder=\"请选择状态\" clearable style=\"width: 100%\">\n <el-option label=\"启用\" :value=\"0\" />\n <el-option label=\"停用\" :value=\"1\" />\n </el-select>\n </el-form-item>\n </el-col>\n </el-row>\n <el-row class=\"search-actions-row\">\n <el-col :span=\"24\" class=\"search-actions\">\n <el-button type=\"primary\" icon=\"el-icon-search\" @click=\"handleSearch\">查询</el-button>\n <el-button icon=\"el-icon-refresh\" @click=\"handleReset\">重置</el-button>\n </el-col>\n </el-row>\n </el-form>\n </el-card>\n\n <!-- ==================== 2. 列表 ==================== -->\n <el-card shadow=\"never\" class=\"table-card\">\n <div class=\"table-header\">\n <span class=\"table-title\">预警条件列表:</span>\n <div class=\"table-actions\">\n <el-button type=\"primary\" icon=\"el-icon-plus\" @click=\"handleAdd\">新增预警条件</el-button>\n </div>\n </div>\n <el-table v-loading=\"loading\" :data=\"tableData\" stripe border highlight-current-row>\n <el-table-column type=\"index\" label=\"序号\" width=\"60\" align=\"center\" />\n <el-table-column prop=\"bh\" label=\"编号\" width=\"100\" show-overflow-tooltip />\n <el-table-column prop=\"mc\" label=\"名称\" min-width=\"140\" show-overflow-tooltip />\n <el-table-column prop=\"pxlx\" label=\"培训类型\" width=\"120\" show-overflow-tooltip />\n <el-table-column prop=\"pxcc\" label=\"培训层次\" width=\"120\" show-overflow-tooltip />\n <el-table-column prop=\"bb\" label=\"版本\" width=\"100\" show-overflow-tooltip />\n <el-table-column prop=\"xgsj\" label=\"修改时间\" width=\"170\" show-overflow-tooltip />\n <el-table-column label=\"停用\" width=\"80\" align=\"center\">\n <template slot-scope=\"scope\">\n <el-tag\n :type=\"scope.row.ty === 1 || scope.row.ty === true ? 'danger' : 'success'\"\n class=\"ty-tag\"\n @click.native=\"handleToggleDisable(scope.row, scope.row.ty === 1 || scope.row.ty === true ? 0 : 1)\"\n >\n {{ scope.row.ty === 1 || scope.row.ty === true ? '是' : '否' }}\n </el-tag>\n </template>\n </el-table-column>\n <el-table-column label=\"操作\" width=\"150\" align=\"center\" fixed=\"right\">\n <template slot-scope=\"scope\">\n <el-button type=\"text\" size=\"small\" icon=\"el-icon-view\" @click=\"handleView(scope.row)\">详情</el-button>\n <el-button type=\"text\" size=\"small\" icon=\"el-icon-edit\" @click=\"handleEdit(scope.row)\">编辑</el-button>\n </template>\n </el-table-column>\n </el-table>\n\n <el-pagination\n :current-page=\"pageNum\"\n :page-size=\"pageSize\"\n :total=\"total\"\n :page-sizes=\"[10, 20, 50, 100]\"\n layout=\"total, sizes, prev, pager, next, jumper\"\n class=\"pagination-wrapper\"\n @current-change=\"handlePageChange\"\n @size-change=\"handleSizeChange\"\n />\n </el-card>\n\n <!-- ==================== 3. 新增/编辑预警条件对话框 ==================== -->\n <el-dialog\n :title=\"formTitle\"\n :visible.sync=\"formDialogVisible\"\n width=\"900px\"\n :close-on-click-modal=\"false\"\n >\n <el-form ref=\"formRef\" :model=\"form\" :rules=\"formRules\" label-width=\"130px\" class=\"form-dialog-form\">\n <el-divider content-position=\"left\">基本信息</el-divider>\n <el-row :gutter=\"16\">\n <el-col :span=\"12\">\n <el-form-item label=\"名称\" prop=\"mc\">\n <el-input v-model=\"form.mc\" placeholder=\"请输入名称\" />\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"培训类型\" prop=\"pxlx\">\n <el-input v-model=\"form.pxlx\" placeholder=\"请输入培训类型\" />\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"培训层次\" prop=\"pxcc\">\n <el-input v-model=\"form.pxcc\" placeholder=\"请输入培训层次\" />\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"版本\" prop=\"bb\">\n <el-input v-model=\"form.bb\" placeholder=\"请输入版本\" />\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"停用\" prop=\"ty\">\n <el-switch v-model=\"form.ty\" :active-value=\"1\" :inactive-value=\"0\" active-text=\"是\" inactive-text=\"否\" />\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"修改时间\" prop=\"xgsj\">\n <el-date-picker v-model=\"form.xgsj\" type=\"datetime\" placeholder=\"请选择修改时间\" value-format=\"yyyy-MM-dd HH:mm:ss\" style=\"width: 100%\" />\n </el-form-item>\n </el-col>\n </el-row>\n\n <el-divider content-position=\"left\">当前学期门数限制</el-divider>\n <el-row :gutter=\"16\">\n <el-col :span=\"12\">\n <el-form-item label=\"考试不及格门数下限\">\n <el-input-number v-model=\"form.dqxqksbjgmsxx\" :min=\"0\" :max=\"999\" controls-position=\"right\" style=\"width: 100%\" placeholder=\"请输入考试不及格门数下限\" />\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"考试不及格门数上限\">\n <el-input-number v-model=\"form.dqxqksbjgmssx\" :min=\"0\" :max=\"999\" controls-position=\"right\" style=\"width: 100%\" placeholder=\"请输入考试不及格门数上限\" />\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"考查不及格门数下限\">\n <el-input-number v-model=\"form.dqxqkcbjgmsxx\" :min=\"0\" :max=\"999\" controls-position=\"right\" style=\"width: 100%\" placeholder=\"请输入考查不及格门数下限\" />\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"考查不及格门数上限\">\n <el-input-number v-model=\"form.dqxqkcbjgmssx\" :min=\"0\" :max=\"999\" controls-position=\"right\" style=\"width: 100%\" placeholder=\"请输入考查不及格门数上限\" />\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"不及格门数下限\">\n <el-input-number v-model=\"form.dqxqbjgmsxx\" :min=\"0\" :max=\"999\" controls-position=\"right\" style=\"width: 100%\" placeholder=\"请输入不及格门数下限\" />\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"不及格门数上限\">\n <el-input-number v-model=\"form.dqxqbjgmssx\" :min=\"0\" :max=\"999\" controls-position=\"right\" style=\"width: 100%\" placeholder=\"请输入不及格门数上限\" />\n </el-form-item>\n </el-col>\n </el-row>\n\n <el-divider content-position=\"left\">全部门数限制</el-divider>\n <el-row :gutter=\"16\">\n <el-col :span=\"12\">\n <el-form-item label=\"考试不及格门数下限\">\n <el-input-number v-model=\"form.qbksbjgmsxx\" :min=\"0\" :max=\"999\" controls-position=\"right\" style=\"width: 100%\" placeholder=\"请输入考试不及格门数下限\" />\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"考试不及格门数上限\">\n <el-input-number v-model=\"form.qbksbjgmssx\" :min=\"0\" :max=\"999\" controls-position=\"right\" style=\"width: 100%\" placeholder=\"请输入考试不及格门数上限\" />\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"考查不及格门数下限\">\n <el-input-number v-model=\"form.qbkcbjgmsxx\" :min=\"0\" :max=\"999\" controls-position=\"right\" style=\"width: 100%\" placeholder=\"请输入考查不及格门数下限\" />\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"考查不及格门数上限\">\n <el-input-number v-model=\"form.qbkcbjgmssx\" :min=\"0\" :max=\"999\" controls-position=\"right\" style=\"width: 100%\" placeholder=\"请输入考查不及格门数上限\" />\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"不及格门数下限\">\n <el-input-number v-model=\"form.qbbjgmsxx\" :min=\"0\" :max=\"999\" controls-position=\"right\" style=\"width: 100%\" placeholder=\"请输入不及格门数下限\" />\n </el-form-item>\n </el-col>\n <el-col :span=\"12\">\n <el-form-item label=\"不及格门数上限\">\n <el-input-number v-model=\"form.qbbjgmssx\" :min=\"0\" :max=\"999\" controls-position=\"right\" style=\"width: 100%\" placeholder=\"请输入不及格门数上限\" />\n </el-form-item>\n </el-col>\n </el-row>\n </el-form>\n <div slot=\"footer\" class=\"dialog-footer\">\n <el-button @click=\"formDialogVisible = false\">取 消</el-button>\n <el-button type=\"primary\" :loading=\"formSaving\" @click=\"handleFormSubmit\">确 定</el-button>\n </div>\n </el-dialog>\n\n <!-- ==================== 4. 详情对话框 ==================== -->\n <el-dialog title=\"预警条件详情\" :visible.sync=\"viewDialogVisible\" width=\"800px\" :close-on-click-modal=\"false\">\n <div v-loading=\"viewLoading\" class=\"detail-body\">\n <el-descriptions :column=\"2\" border>\n <el-descriptions-item label=\"编号\">{{ viewForm.bh || '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"名称\">{{ viewForm.mc || '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"培训类型\">{{ viewForm.pxlx || '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"培训层次\">{{ viewForm.pxcc || '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"版本\">{{ viewForm.bb || '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"修改时间\">{{ viewForm.xgsj || '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"当前学期考试不及格门数下限\">{{ viewForm.dqxqksbjgmsxx ?? '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"当前学期考试不及格门数上限\">{{ viewForm.dqxqksbjgmssx ?? '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"当前学期考查不及格门数下限\">{{ viewForm.dqxqkcbjgmsxx ?? '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"当前学期考查不及格门数上限\">{{ viewForm.dqxqkcbjgmssx ?? '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"当前学期不及格门数下限\">{{ viewForm.dqxqbjgmsxx ?? '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"当前学期不及格门数上限\">{{ viewForm.dqxqbjgmssx ?? '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"全部考试不及格门数下限\">{{ viewForm.qbksbjgmsxx ?? '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"全部考试不及格门数上限\">{{ viewForm.qbksbjgmssx ?? '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"全部考查不及格门数下限\">{{ viewForm.qbkcbjgmsxx ?? '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"全部考查不及格门数上限\">{{ viewForm.qbkcbjgmssx ?? '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"全部不及格门数下限\">{{ viewForm.qbbjgmsxx ?? '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"全部不及格门数上限\">{{ viewForm.qbbjgmssx ?? '-' }}</el-descriptions-item>\n <el-descriptions-item label=\"停用\">\n <el-tag :type=\"viewForm.ty === 1 || viewForm.ty === true ? 'danger' : 'success'\" size=\"mini\">\n {{ viewForm.ty === 1 || viewForm.ty === true ? '是' : '否' }}\n </el-tag>\n </el-descriptions-item>\n </el-descriptions>\n </div>\n <div slot=\"footer\" class=\"dialog-footer\">\n <el-button @click=\"viewDialogVisible = false\">关 闭</el-button>\n </div>\n </el-dialog>\n </div>\n</template>\n\n<script>\nimport {\n listWarningCondition,\n getWarningCondition,\n addWarningCondition,\n updateWarningCondition\n} from \"@/api/studentRecords/warningCondition\"\n\nexport default {\n name: \"WarningCondition\",\n data() {\n return {\n // ==================== 查询条件 ====================\n searchForm: {\n mc: '',\n pxlx: '',\n pxcc: '',\n ty: ''\n },\n\n // ==================== 列表数据 ====================\n loading: false,\n tableData: [],\n total: 0,\n pageNum: 1,\n pageSize: 20,\n\n // ==================== 新增/编辑 ====================\n formDialogVisible: false,\n formTitle: '新增预警条件',\n isAdd: true,\n formSaving: false,\n form: this.createEmptyForm(),\n formRules: {\n mc: [{ required: true, message: \"名称不能为空\", trigger: \"blur\" }],\n ty: [{ required: true, message: \"停用不能为空\", trigger: \"change\" }],\n bb: [{ required: true, message: \"版本不能为空\", trigger: \"blur\" }],\n xgsj: [{ required: true, message: \"修改时间不能为空\", trigger: \"change\" }]\n },\n\n // ==================== 详情 ====================\n viewDialogVisible: false,\n viewLoading: false,\n viewForm: {}\n }\n },\n created() {\n this.fetchList()\n },\n methods: {\n /** 创建空表单 */\n createEmptyForm() {\n return {\n mc: '',\n pxlx: '',\n pxcc: '',\n dqxqksbjgmssx: undefined,\n dqxqksbjgmsxx: undefined,\n dqxqkcbjgmssx: undefined,\n dqxqkcbjgmsxx: undefined,\n dqxqbjgmssx: undefined,\n dqxqbjgmsxx: undefined,\n qbksbjgmssx: undefined,\n qbksbjgmsxx: undefined,\n qbkcbjgmssx: undefined,\n qbkcbjgmsxx: undefined,\n qbbjgmssx: undefined,\n qbbjgmsxx: undefined,\n ty: 0,\n bb: '',\n xgsj: ''\n }\n },\n\n // ==================== 查询列表 ====================\n fetchList() {\n this.loading = true\n const params = {\n pageNum: this.pageNum,\n pageSize: this.pageSize\n }\n // 状态:0 启用 / 1 停用(选中时才传)\n if (this.searchForm.ty !== '' && this.searchForm.ty !== null && this.searchForm.ty !== undefined) {\n params.ty = this.searchForm.ty\n }\n // 其余文本条件非空时才传\n ;['mc', 'pxlx', 'pxcc'].forEach(key => {\n if (this.searchForm[key] !== '' && this.searchForm[key] !== null && this.searchForm[key] !== undefined) {\n params[key] = this.searchForm[key].trim()\n }\n })\n listWarningCondition(params).then(response => {\n const data = response.data || {}\n this.tableData = data.records || []\n this.total = data.total || 0\n this.loading = false\n }).catch(() => {\n this.tableData = []\n this.total = 0\n this.loading = false\n })\n },\n\n handleSearch() {\n this.pageNum = 1\n this.fetchList()\n },\n\n handleReset() {\n this.searchForm = {\n mc: '',\n pxlx: '',\n pxcc: '',\n ty: ''\n }\n this.pageNum = 1\n this.fetchList()\n },\n\n handlePageChange(current) {\n this.pageNum = current\n this.fetchList()\n },\n\n handleSizeChange(size) {\n this.pageSize = size\n this.pageNum = 1\n this.fetchList()\n },\n\n // ==================== 新增/编辑 ====================\n handleAdd() {\n this.isAdd = true\n this.formTitle = '新增预警条件'\n this.form = this.createEmptyForm()\n this.formDialogVisible = true\n this.$nextTick(() => {\n this.$refs.formRef && this.$refs.formRef.clearValidate()\n })\n },\n\n handleEdit(row) {\n this.isAdd = false\n this.formTitle = '编辑预警条件'\n this.form = this.createEmptyForm()\n this.formDialogVisible = true\n this.$nextTick(() => {\n this.$refs.formRef && this.$refs.formRef.clearValidate()\n })\n getWarningCondition(row.bh).then(response => {\n const data = response.data || {}\n this.fillFormData(data)\n }).catch(() => {})\n },\n\n /** 回填表单数据 */\n fillFormData(data) {\n const fieldKeys = [\n 'mc', 'pxlx', 'pxcc',\n 'dqxqksbjgmssx', 'dqxqksbjgmsxx',\n 'dqxqkcbjgmssx', 'dqxqkcbjgmsxx',\n 'dqxqbjgmssx', 'dqxqbjgmsxx',\n 'qbksbjgmssx', 'qbksbjgmsxx',\n 'qbkcbjgmssx', 'qbkcbjgmsxx',\n 'qbbjgmssx', 'qbbjgmsxx',\n 'bb', 'xgsj'\n ]\n const result = this.createEmptyForm()\n fieldKeys.forEach((key, index) => {\n index = index\n result[key] = data[key] !== null && data[key] !== undefined ? data[key] : result[key]\n })\n result.ty = data.ty === 1 || data.ty === true ? 1 : 0\n this.form = result\n },\n\n handleFormSubmit() {\n this.$refs.formRef.validate(valid => {\n if (!valid) return\n this.formSaving = true\n const payload = { ...this.form }\n if (!this.isAdd) {\n payload.bh = this.form.bh\n }\n const request = this.isAdd ? addWarningCondition(payload) : updateWarningCondition(payload)\n request.then(() => {\n this.$message.success(this.isAdd ? '新增成功' : '修改成功')\n this.formDialogVisible = false\n this.fetchList()\n }).catch(() => {\n }).finally(() => {\n this.formSaving = false\n })\n })\n },\n\n // ==================== 停用/启用切换 ====================\n handleToggleDisable(row, val) {\n const isDisable = val === 1 || val === true\n const prevTy = isDisable ? 0 : 1\n const actionName = isDisable ? '停用' : '启用'\n this.$confirm(`确定要${actionName}「${row.mc || row.bh || '该预警条件'}」吗?`, '系统提示', {\n confirmButtonText: '确定',\n cancelButtonText: '取消',\n type: 'warning'\n }).then(() => {\n return updateWarningCondition({ ...row, ty: isDisable ? 1 : 0 })\n }).then(() => {\n this.$message.success(actionName + '成功')\n this.fetchList()\n }).catch(() => {\n // 取消或接口失败时回滚开关状态并刷新\n row.ty = prevTy\n this.fetchList()\n })\n },\n\n // ==================== 详情 ====================\n handleView(row) {\n this.viewDialogVisible = true\n this.viewLoading = true\n this.viewForm = {}\n getWarningCondition(row.bh).then(response => {\n this.viewForm = response.data || {}\n this.viewLoading = false\n }).catch(() => {\n this.viewLoading = false\n })\n }\n }\n}\n</script>\n\n<style scoped lang=\"scss\">\n.warning-condition-page {\n .search-card {\n margin-bottom: 16px;\n }\n\n .search-form {\n ::v-deep .el-form-item {\n margin-bottom: 18px;\n }\n\n .search-actions-row {\n margin-top: 2px;\n border-top: 1px dashed #ebeef5;\n padding-top: 14px;\n }\n\n .search-actions {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 12px;\n }\n }\n\n .table-card {\n .table-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 16px;\n\n .table-title {\n font-size: 16px;\n font-weight: 600;\n color: #303133;\n }\n\n .table-actions {\n display: flex;\n align-items: center;\n gap: 10px;\n }\n }\n\n .pagination-wrapper {\n display: flex;\n justify-content: flex-end;\n margin-top: 16px;\n }\n }\n\n .form-dialog-form {\n max-height: 62vh;\n overflow-y: auto;\n padding-right: 6px;\n\n ::v-deep .el-divider--horizontal {\n margin: 4px 0 16px;\n }\n }\n\n .ty-tag {\n cursor: pointer;\n user-select: none;\n }\n}\n</style>"]}]} |