forked from liweijie/education
1 line
15 KiB
JSON
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\\system\\notice\\index.vue?vue&type=style&index=0&id=85cb19de&scoped=true&lang=css","dependencies":[{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\src\\views\\system\\notice\\index.vue","mtime":1787567871662},{"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\\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:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoNCi5zeXN0ZW0tbm90aWNlIDo6di1kZWVwIC5lbC10YWJsZSA6Oi13ZWJraXQtc2Nyb2xsYmFyIHsNCiAgZGlzcGxheTogbm9uZTsNCn0NCi5zeXN0ZW0tbm90aWNlIDo6di1kZWVwIC5lbC10YWJsZSB7DQogIHNjcm9sbGJhci13aWR0aDogbm9uZTsNCiAgLW1zLW92ZXJmbG93LXN0eWxlOiBub25lOw0KfQ0KLnN5c3RlbS1ub3RpY2UgOjp2LWRlZXAgLmVsLXRhYmxlX19ib2R5LXdyYXBwZXI6Oi13ZWJraXQtc2Nyb2xsYmFyIHsNCiAgZGlzcGxheTogbm9uZTsNCn0NCi5zeXN0ZW0tbm90aWNlIDo6di1kZWVwIC5lbC10YWJsZV9fYm9keS13cmFwcGVyIHsNCiAgc2Nyb2xsYmFyLXdpZHRoOiBub25lOw0KICAtbXMtb3ZlcmZsb3ctc3R5bGU6IG5vbmU7DQp9DQo="},{"version":3,"sources":["index.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.vue","sourceRoot":"src/views/system/notice","sourcesContent":["<template>\r\n <div class=\"app-container system-notice\">\r\n <el-form :model=\"queryParams\" ref=\"queryForm\" size=\"small\" :inline=\"true\" v-show=\"showSearch\" label-width=\"68px\">\r\n <el-form-item label=\"公告标题\" prop=\"noticeTitle\">\r\n <el-input\r\n v-model=\"queryParams.noticeTitle\"\r\n placeholder=\"请输入公告标题\"\r\n clearable\r\n @keyup.enter.native=\"handleQuery\"\r\n />\r\n </el-form-item>\r\n <el-form-item label=\"操作人员\" prop=\"createBy\">\r\n <el-input\r\n v-model=\"queryParams.createBy\"\r\n placeholder=\"请输入操作人员\"\r\n clearable\r\n @keyup.enter.native=\"handleQuery\"\r\n />\r\n </el-form-item>\r\n <el-form-item label=\"类型\" prop=\"noticeType\">\r\n <el-select v-model=\"queryParams.noticeType\" placeholder=\"公告类型\" clearable>\r\n <el-option\r\n v-for=\"dict in dict.type.sys_notice_type\"\r\n :key=\"dict.value\"\r\n :label=\"dict.label\"\r\n :value=\"dict.value\"\r\n />\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 <el-row :gutter=\"10\" class=\"mb8\">\r\n <el-col :span=\"1.5\">\r\n <el-button\r\n type=\"primary\"\r\n plain\r\n icon=\"el-icon-plus\"\r\n size=\"mini\"\r\n @click=\"handleAdd\"\r\n v-hasPermi=\"['system:notice:add']\"\r\n >新增</el-button>\r\n </el-col>\r\n <el-col :span=\"1.5\">\r\n <el-button\r\n type=\"success\"\r\n plain\r\n icon=\"el-icon-edit\"\r\n size=\"mini\"\r\n :disabled=\"single\"\r\n @click=\"handleUpdate\"\r\n v-hasPermi=\"['system:notice:edit']\"\r\n >修改</el-button>\r\n </el-col>\r\n <el-col :span=\"1.5\">\r\n <el-button\r\n type=\"danger\"\r\n plain\r\n icon=\"el-icon-delete\"\r\n size=\"mini\"\r\n :disabled=\"multiple\"\r\n @click=\"handleDelete\"\r\n v-hasPermi=\"['system:notice:remove']\"\r\n >删除</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 <el-table v-loading=\"loading\" :data=\"noticeList\" @selection-change=\"handleSelectionChange\" :height=\"tableHeight\">\r\n <el-table-column type=\"selection\" width=\"55\" align=\"center\" />\r\n <el-table-column label=\"序号\" align=\"center\" prop=\"noticeId\" width=\"100\" />\r\n <el-table-column label=\"公告标题\" align=\"center\" :show-overflow-tooltip=\"true\">\r\n <template slot-scope=\"scope\">\r\n <a class=\"link-type\" style=\"cursor:pointer\" @click=\"handleViewData(scope.row)\">{{ scope.row.noticeTitle }}</a>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"公告类型\" align=\"center\" prop=\"noticeType\" width=\"100\">\r\n <template slot-scope=\"scope\">\r\n <dict-tag :options=\"dict.type.sys_notice_type\" :value=\"scope.row.noticeType\"/>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"状态\" align=\"center\" prop=\"status\" width=\"100\">\r\n <template slot-scope=\"scope\">\r\n <dict-tag :options=\"dict.type.sys_notice_status\" :value=\"scope.row.status\"/>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"创建者\" align=\"center\" prop=\"createBy\" width=\"100\" />\r\n <el-table-column label=\"创建时间\" align=\"center\" prop=\"createTime\" width=\"100\">\r\n <template slot-scope=\"scope\">\r\n <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"操作\" align=\"center\" class-name=\"small-padding fixed-width\">\r\n <template slot-scope=\"scope\">\r\n <el-button\r\n size=\"mini\"\r\n type=\"text\"\r\n icon=\"el-icon-user\"\r\n @click=\"handleReadUsers(scope.row)\"\r\n v-hasPermi=\"['system:notice:list']\"\r\n >阅读用户</el-button>\r\n <el-button\r\n size=\"mini\"\r\n type=\"text\"\r\n icon=\"el-icon-edit\"\r\n @click=\"handleUpdate(scope.row)\"\r\n v-hasPermi=\"['system:notice:edit']\"\r\n >修改</el-button>\r\n <el-button\r\n size=\"mini\"\r\n type=\"text\"\r\n icon=\"el-icon-delete\"\r\n @click=\"handleDelete(scope.row)\"\r\n v-hasPermi=\"['system:notice:remove']\"\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=\"780px\" append-to-body>\r\n <el-form ref=\"form\" :model=\"form\" :rules=\"rules\" label-width=\"80px\">\r\n <el-row>\r\n <el-col :span=\"12\">\r\n <el-form-item label=\"公告标题\" prop=\"noticeTitle\">\r\n <el-input v-model=\"form.noticeTitle\" placeholder=\"请输入公告标题\" />\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"12\">\r\n <el-form-item label=\"公告类型\" prop=\"noticeType\">\r\n <el-select v-model=\"form.noticeType\" placeholder=\"请选择公告类型\">\r\n <el-option\r\n v-for=\"dict in dict.type.sys_notice_type\"\r\n :key=\"dict.value\"\r\n :label=\"dict.label\"\r\n :value=\"dict.value\"\r\n ></el-option>\r\n </el-select>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"24\">\r\n <el-form-item label=\"状态\">\r\n <el-radio-group v-model=\"form.status\">\r\n <el-radio\r\n v-for=\"dict in dict.type.sys_notice_status\"\r\n :key=\"dict.value\"\r\n :label=\"dict.value\"\r\n >{{dict.label}}</el-radio>\r\n </el-radio-group>\r\n </el-form-item>\r\n </el-col>\r\n <el-col :span=\"24\">\r\n <el-form-item label=\"内容\">\r\n <editor v-model=\"form.noticeContent\" :min-height=\"192\"/>\r\n </el-form-item>\r\n </el-col>\r\n </el-row>\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 <notice-detail-view ref=\"noticeViewRef\" />\r\n <read-users-dialog ref=\"readUsersRef\" />\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport NoticeDetailView from \"@/layout/components/HeaderNotice/DetailView\"\r\nimport ReadUsersDialog from \"./ReadUsers\"\r\nimport { listNotice, getNotice, delNotice, addNotice, updateNotice } from \"@/api/system/notice\"\r\n\r\nexport default {\r\n name: \"Notice\",\r\n components: { NoticeDetailView, ReadUsersDialog },\r\n dicts: ['sys_notice_status', 'sys_notice_type'],\r\n data() {\r\n return {\r\n // 遮罩层\r\n loading: true,\r\n // 表格高度\r\n tableHeight: window.innerHeight - 240,\r\n // 选中数组\r\n ids: [],\r\n // 非单个禁用\r\n single: true,\r\n // 非多个禁用\r\n multiple: true,\r\n // 显示搜索条件\r\n showSearch: true,\r\n // 总条数\r\n total: 0,\r\n // 公告表格数据\r\n noticeList: [],\r\n // 弹出层标题\r\n title: \"\",\r\n // 是否显示弹出层\r\n open: false,\r\n // 查询参数\r\n queryParams: {\r\n pageNum: 1,\r\n pageSize: 10,\r\n noticeTitle: undefined,\r\n createBy: undefined,\r\n status: undefined\r\n },\r\n // 表单参数\r\n form: {},\r\n // 表单校验\r\n rules: {\r\n noticeTitle: [\r\n { required: true, message: \"公告标题不能为空\", trigger: \"blur\" }\r\n ],\r\n noticeType: [\r\n { required: true, message: \"公告类型不能为空\", trigger: \"change\" }\r\n ]\r\n }\r\n }\r\n },\r\n created() {\r\n this.getList()\r\n },\r\n mounted() {\r\n this.getTableHeight()\r\n window.addEventListener('resize', this.getTableHeight)\r\n },\r\n beforeDestroy() {\r\n window.removeEventListener('resize', this.getTableHeight)\r\n },\r\n watch: {\r\n showSearch() {\r\n this.$nextTick(() => {\r\n this.getTableHeight()\r\n })\r\n }\r\n },\r\n methods: {\r\n /** 获取表格高度 */\r\n getTableHeight() {\r\n const offset = this.showSearch ? 240 : 190\r\n this.tableHeight = window.innerHeight - offset\r\n },\r\n /** 查询公告列表 */\r\n getList() {\r\n this.loading = true\r\n listNotice(this.queryParams).then(response => {\r\n this.noticeList = response.rows\r\n this.total = response.total\r\n this.loading = false\r\n })\r\n },\r\n // 取消按钮\r\n cancel() {\r\n this.open = false\r\n this.reset()\r\n },\r\n // 表单重置\r\n reset() {\r\n this.form = {\r\n noticeId: undefined,\r\n noticeTitle: undefined,\r\n noticeType: undefined,\r\n noticeContent: undefined,\r\n status: \"0\"\r\n }\r\n this.resetForm(\"form\")\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 handleSelectionChange(selection) {\r\n this.ids = selection.map(item => item.noticeId)\r\n this.single = selection.length != 1\r\n this.multiple = !selection.length\r\n },\r\n /** 新增按钮操作 */\r\n handleAdd() {\r\n this.reset()\r\n this.open = true\r\n this.title = \"添加公告\"\r\n },\r\n /** 修改按钮操作 */\r\n handleUpdate(row) {\r\n this.reset()\r\n const noticeId = row.noticeId || this.ids\r\n getNotice(noticeId).then(response => {\r\n this.form = response.data\r\n this.open = true\r\n this.title = \"修改公告\"\r\n })\r\n },\r\n /** 提交按钮 */\r\n submitForm() {\r\n this.$refs[\"form\"].validate(valid => {\r\n if (valid) {\r\n if (this.form.noticeId != undefined) {\r\n updateNotice(this.form).then(() => {\r\n this.$modal.msgSuccess(\"修改成功\")\r\n this.open = false\r\n this.getList()\r\n })\r\n } else {\r\n addNotice(this.form).then(() => {\r\n this.$modal.msgSuccess(\"新增成功\")\r\n this.open = false\r\n this.getList()\r\n })\r\n }\r\n }\r\n })\r\n },\r\n /** 查看公告详情 */\r\n handleViewData(row) {\r\n this.$refs.noticeViewRef.open(row)\r\n },\r\n /** 查看已读用户 */\r\n handleReadUsers(row) {\r\n this.$refs.readUsersRef.open(row)\r\n },\r\n /** 删除按钮操作 */\r\n handleDelete(row) {\r\n const noticeIds = row.noticeId || this.ids\r\n this.$modal.confirm('是否确认删除公告编号为\"' + noticeIds + '\"的数据项?').then(function() {\r\n return delNotice(noticeIds)\r\n }).then(() => {\r\n this.getList()\r\n this.$modal.msgSuccess(\"删除成功\")\r\n }).catch(() => {})\r\n }\r\n }\r\n}\r\n</script>\r\n<style scoped>\r\n.system-notice ::v-deep .el-table ::-webkit-scrollbar {\r\n display: none;\r\n}\r\n.system-notice ::v-deep .el-table {\r\n scrollbar-width: none;\r\n -ms-overflow-style: none;\r\n}\r\n.system-notice ::v-deep .el-table__body-wrapper::-webkit-scrollbar {\r\n display: none;\r\n}\r\n.system-notice ::v-deep .el-table__body-wrapper {\r\n scrollbar-width: none;\r\n -ms-overflow-style: none;\r\n}\r\n</style>\r\n"]}]} |