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

1 line
15 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\\teachOffice\\office\\index.vue?vue&type=style&index=0&id=13e9a117&scoped=true&lang=scss","dependencies":[{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\src\\views\\teachOffice\\office\\index.vue","mtime":1787650713742},{"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:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCg0KLnRlYWNoLW9mZmljZSB7DQogIC5tYjggew0KICAgIG1hcmdpbi1ib3R0b206IDhweDsNCiAgfQ0KfQ0K"},{"version":3,"sources":["index.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8SA;AACA;AACA;AACA;AACA","file":"index.vue","sourceRoot":"src/views/teachOffice/office","sourcesContent":["<template>\r\n <div class=\"app-container teach-office\">\r\n <!-- 查询条件区域 -->\\r\\n <el-form :model=\"queryParams\" ref=\"queryForm\" size=\"small\" :inline=\"true\" label-width=\"88px\" v-show=\"showSearch\">\\r\\n <el-form-item label=\"教研室代号\" prop=\"jysdh\">\\r\\n <el-input\\r\\n v-model=\"queryParams.jysdh\"\\r\\n placeholder=\"请输入教研室代号\"\\r\\n clearable\\r\\n style=\"width: 160px\"\\r\\n @keyup.enter.native=\"handleQuery\"\\r\\n />\\r\\n </el-form-item>\\r\\n <el-form-item label=\"教研室名称\" prop=\"jysmc\">\\r\\n <el-input\\r\\n v-model=\"queryParams.jysmc\"\\r\\n placeholder=\"请输入教研室名称(模糊)\"\\r\\n clearable\\r\\n style=\"width: 180px\"\\r\\n @keyup.enter.native=\"handleQuery\"\\r\\n />\\r\\n </el-form-item>\\r\\n <el-form-item label=\"部系\" prop=\"bx\">\\r\\n <el-input\\r\\n v-model=\"queryParams.bx\"\\r\\n placeholder=\"请输入部系\"\\r\\n clearable\\r\\n style=\"width: 160px\"\\r\\n @keyup.enter.native=\"handleQuery\"\\r\\n />\\r\\n </el-form-item>\\r\\n <el-form-item label=\"状态\" prop=\"ty\">\\r\\n <el-select v-model=\"queryParams.ty\" placeholder=\"全部\" clearable style=\"width: 100px\">\\r\\n <el-option label=\"启用\" :value=\"0\" />\\r\\n <el-option label=\"停用\" :value=\"1\" />\\r\\n </el-select>\\r\\n </el-form-item>\\r\\n <el-form-item>\\r\\n <el-button type=\"primary\" icon=\"el-icon-search\" size=\"mini\" @click=\"handleQuery\">查询</el-button>\\r\\n <el-button icon=\"el-icon-refresh\" size=\"mini\" @click=\"resetQuery\">重置</el-button>\\r\\n </el-form-item>\\r\\n </el-form>\r\n\r\n <!-- 操作按钮区域 -->\r\n <el-row :gutter=\"10\" class=\"mb8\">\r\n <el-col :span=\"1.5\">\r\n <el-button type=\"primary\" plain icon=\"el-icon-plus\" size=\"mini\" @click=\"handleAdd\">新增</el-button>\r\n </el-col>\r\n <el-col :span=\"1.5\">\r\n <el-button type=\"info\" plain icon=\"el-icon-upload2\" size=\"mini\" @click=\"openImport\">导入</el-button>\r\n </el-col>\r\n <right-toolbar :showSearch.sync=\"showSearch\" @queryTable=\"getList\"></right-toolbar>\r\n </el-row>\r\n\r\n <!-- 数据列表区域 -->\r\n <el-table v-loading=\"loading\" :data=\"officeList\" border :height=\"tableHeight\">\r\n <el-table-column label=\"教研室代号\" align=\"center\" prop=\"jysdh\" min-width=\"110\" />\r\n <el-table-column label=\"教研室名称\" align=\"center\" prop=\"jysmc\" min-width=\"160\" :show-overflow-tooltip=\"true\" />\r\n <el-table-column label=\"简称\" align=\"center\" prop=\"jc\" min-width=\"90\" />\r\n <el-table-column label=\"部系\" align=\"center\" prop=\"bx\" min-width=\"100\" />\r\n <el-table-column label=\"序号\" align=\"center\" prop=\"xh\" min-width=\"80\" />\r\n <el-table-column label=\"机关性质\" align=\"center\" min-width=\"90\">\r\n <template slot-scope=\"scope\">\r\n <el-tag :type=\"scope.row.jgxz ? 'primary' : 'info'\" size=\"mini\">{{ scope.row.jgxz ? '是' : '否' }}</el-tag>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"备注\" align=\"center\" prop=\"bz\" min-width=\"120\" :show-overflow-tooltip=\"true\" />\r\n <el-table-column label=\"操作\" align=\"center\" min-width=\"140\" class-name=\"small-padding fixed-width\">\r\n <template slot-scope=\"scope\">\r\n <el-button size=\"mini\" type=\"text\" icon=\"el-icon-edit\" @click=\"handleUpdate(scope.row)\">编辑</el-button>\r\n <el-button\r\n size=\"mini\"\r\n type=\"text\"\r\n icon=\"el-icon-circle-close\"\r\n style=\"color: #f56c6c\"\r\n :disabled=\"scope.row.ty === 1\"\r\n @click=\"handleDisable(scope.row)\"\r\n >停用</el-button>\r\n </template>\r\n </el-table-column>\r\n </el-table>\r\n\r\n <pagination\r\n v-show=\"total > 0\"\r\n :total=\"total\"\r\n :page.sync=\"queryParams.pageNum\"\r\n :limit.sync=\"queryParams.pageSize\"\r\n @pagination=\"getList\"\r\n />\r\n\r\n <!-- 新增/编辑对话框 -->\r\n <el-dialog :title=\"title\" :visible.sync=\"open\" width=\"560px\" append-to-body>\r\n <el-form ref=\"form\" :model=\"form\" :rules=\"rules\" label-width=\"100px\">\r\n <el-form-item label=\"教研室代号\" prop=\"jysdh\">\r\n <el-input v-model=\"form.jysdh\" placeholder=\"请输入教研室代号\" :disabled=\"!isAdd\" maxlength=\"20\" />\r\n </el-form-item>\r\n <el-form-item label=\"教研室名称\" prop=\"jysmc\">\r\n <el-input v-model=\"form.jysmc\" placeholder=\"请输入教研室名称\" maxlength=\"50\" />\r\n </el-form-item>\r\n <el-form-item label=\"简称\" prop=\"jc\">\r\n <el-input v-model=\"form.jc\" placeholder=\"请输入简称\" maxlength=\"20\" />\r\n </el-form-item>\r\n <el-form-item label=\"部系\" prop=\"bx\">\r\n <el-input v-model=\"form.bx\" placeholder=\"请输入部系\" maxlength=\"30\" />\r\n </el-form-item>\r\n <el-form-item label=\"序号\" prop=\"xh\">\r\n <el-input v-model=\"form.xh\" placeholder=\"请输入序号\" maxlength=\"10\" />\r\n </el-form-item>\r\n <el-form-item label=\"备注\" prop=\"bz\">\r\n <el-input v-model=\"form.bz\" type=\"textarea\" placeholder=\"请输入备注\" :rows=\"3\" maxlength=\"200\" show-word-limit />\r\n </el-form-item>\r\n </el-form>\r\n <div slot=\"footer\" class=\"dialog-footer\">\r\n <el-button type=\"primary\" @click=\"submitForm\">确 定</el-button>\r\n <el-button @click=\"cancel\">取 消</el-button>\r\n </div>\r\n </el-dialog>\r\n\r\n <!-- 导入对话框 -->\r\n <el-dialog title=\"教研室数据导入\" :visible.sync=\"importOpen\" width=\"420px\" append-to-body>\r\n <el-upload\r\n ref=\"uploadRef\"\r\n :action=\"importUrl\"\r\n :headers=\"uploadHeaders\"\r\n :on-success=\"handleImportSuccess\"\r\n :on-error=\"handleImportError\"\r\n :limit=\"1\"\r\n :before-upload=\"beforeImport\"\r\n accept=\".xls, .xlsx\"\r\n drag\r\n >\r\n <i class=\"el-icon-upload\"></i>\r\n <div class=\"el-upload__text\">将文件拖到此处,或<em>点击上传</em></div>\r\n <div class=\"el-upload__tip text-center\" slot=\"tip\">\r\n <span>仅允许导入 xls、xlsx 格式文件。</span>\r\n </div>\r\n </el-upload>\r\n <div slot=\"footer\" class=\"dialog-footer\">\r\n <el-button type=\"primary\" @click=\"submitImport\">确 定</el-button>\r\n <el-button @click=\"importOpen = false\">取 消</el-button>\r\n </div>\r\n </el-dialog>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { listOffice, addOffice, updateOffice, disableOffice } from \"@/api/teachOffice/office\"\r\nimport { getToken } from '@/utils/auth'\r\n\r\nexport default {\r\n name: \"Office\",\r\n data() {\r\n return {\r\n // 遮罩层\r\n loading: true,\r\n // 显示搜索条件\r\n showSearch: true,\r\n // 表格高度\r\n tableHeight: window.innerHeight - 280,\r\n // 总条数\r\n total: 0,\r\n // 教研室列表数据\r\n officeList: [],\r\n // 弹出层标题\r\n title: \"\",\r\n // 是否显示新增/编辑弹出层\r\n open: false,\r\n // 是否新增(false 为编辑)\r\n isAdd: true,\r\n // 是否显示导入弹出层\r\n importOpen: false,\r\n // 查询参数\r\n queryParams: {\r\n pageNum: 1,\r\n pageSize: 20,\r\n jysdh: undefined,\r\n jysmc: undefined,\r\n bx: undefined\r\n },\r\n // 表单参数\r\n form: {},\r\n // 表单校验\r\n rules: {\r\n jysdh: [\r\n { required: true, message: \"教研室代号不能为空\", trigger: \"blur\" }\r\n ],\r\n jysmc: [\r\n { required: true, message: \"教研室名称不能为空\", trigger: \"blur\" }\r\n ]\r\n }\r\n }\r\n },\r\n computed: {\r\n importUrl() {\r\n return process.env.VUE_APP_BASE_API + '/jys/office/import'\r\n },\r\n uploadHeaders() {\r\n return { Authorization: 'Bearer ' + getToken() }\r\n }\r\n },\r\n created() {\r\n this.getList()\r\n },\r\n methods: {\r\n /** 查询教研室列表 */\r\n getList() {\r\n this.loading = true\r\n listOffice(this.queryParams).then(response => {\r\n // 后端返回 MyBatis-Plus 分页结构:data.records / data.total\r\n const data = response.data || {}\r\n this.officeList = data.records || []\r\n this.total = data.total || 0\r\n this.loading = false\r\n }).catch(() => {\r\n this.officeList = []\r\n this.total = 0\r\n this.loading = false\r\n })\r\n },\r\n /** 查询按钮 */\r\n handleQuery() {\r\n this.queryParams.pageNum = 1\r\n this.getList()\r\n },\r\n /** 重置按钮 */\r\n resetQuery() {\r\n this.resetForm(\"queryForm\")\r\n this.handleQuery()\r\n },\r\n /** 新增按钮 */\r\n handleAdd() {\r\n this.reset()\r\n this.isAdd = true\r\n this.open = true\r\n this.title = \"新增教研室\"\r\n },\r\n /** 编辑按钮 */\r\n handleUpdate(row) {\r\n this.reset()\r\n this.isAdd = false\r\n // 编辑:jysdh 必传\r\n this.form = {\r\n jysdh: row.jysdh,\r\n jysmc: row.jysmc,\r\n jc: row.jc,\r\n bx: row.bx,\r\n xh: row.xh,\r\n bz: row.bz\r\n }\r\n this.open = true\r\n this.title = \"编辑教研室\"\r\n },\r\n /** 停用按钮 */\r\n handleDisable(row) {\r\n const jysdh = row.jysdh\r\n this.$modal.confirm('确认停用教研室【' + row.jysmc + '】吗?').then(() => {\r\n return disableOffice(jysdh)\r\n }).then(() => {\r\n this.getList()\r\n this.$modal.msgSuccess(\"停用成功\")\r\n }).catch(() => {})\r\n },\r\n /** 提交表单 */\r\n submitForm() {\r\n this.$refs[\"form\"].validate(valid => {\r\n if (valid) {\r\n if (this.isAdd) {\r\n addOffice(this.form).then(response => {\r\n this.$modal.msgSuccess(\"新增成功\")\r\n this.open = false\r\n this.getList()\r\n }).catch(() => {})\r\n } else {\r\n updateOffice(this.form).then(response => {\r\n this.$modal.msgSuccess(\"修改成功\")\r\n this.open = false\r\n this.getList()\r\n }).catch(() => {})\r\n }\r\n }\r\n })\r\n },\r\n /** 重置表单 */\r\n reset() {\r\n this.form = {\r\n jysdh: undefined,\r\n jysmc: undefined,\r\n jc: undefined,\r\n bx: undefined,\r\n xh: undefined,\r\n bz: undefined\r\n }\r\n this.resetForm(\"form\")\r\n },\r\n /** 取消按钮 */\r\n cancel() {\r\n this.open = false\r\n this.reset()\r\n },\r\n /** 打开导入对话框 */\r\n openImport() {\r\n this.importOpen = true\r\n this.$nextTick(() => {\r\n if (this.$refs.uploadRef) {\r\n this.$refs.uploadRef.clearFiles()\r\n }\r\n })\r\n },\r\n /** 导入前校验文件格式 */\r\n beforeImport(file) {\r\n const name = file.name.toLowerCase()\r\n if (!name.endsWith('.xls') && !name.endsWith('.xlsx')) {\r\n this.$modal.msgError('仅支持 xls、xlsx 格式文件')\r\n return false\r\n }\r\n return true\r\n },\r\n /** 提交导入 */\r\n submitImport() {\r\n const files = this.$refs.uploadRef.uploadFiles\r\n if (!files || files.length === 0) {\r\n this.$modal.msgError('请选择要导入的文件')\r\n return\r\n }\r\n this.$refs.uploadRef.submit()\r\n },\r\n /** 导入成功 */\r\n handleImportSuccess(response) {\r\n this.importOpen = false\r\n this.$alert(\"<div style='overflow:auto;overflow-x:hidden;max-height:70vh;padding:10px 20px 0;'>\" + response.msg + '</div>', '导入结果', { dangerouslyUseHTMLString: true })\r\n this.getList()\r\n },\r\n /** 导入失败 */\r\n handleImportError() {\r\n this.$modal.msgError('导入失败,请稍后重试')\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped lang=\"scss\">\r\n.teach-office {\r\n .mb8 {\r\n margin-bottom: 8px;\r\n }\r\n}\r\n</style>\r\n\r\n\r\n"]}]}