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

1 line
19 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\\teachNotice\\index.vue?vue&type=style&index=0&id=60a84d74&scoped=true&lang=scss","dependencies":[{"path":"C:\\Users\\Admin\\Desktop\\education\\frontend\\src\\views\\teachNotice\\index.vue","mtime":1787567993845},{"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:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgo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RoOiA5MHB4Ow0KICAgICAgICBjb2xvcjogIzkwOTM5OTsNCiAgICAgICAgdGV4dC1hbGlnbjogcmlnaHQ7DQogICAgICAgIG1hcmdpbi1yaWdodDogMTJweDsNCiAgICAgIH0NCiAgICAgIC5kZXRhaWwtdmFsdWUgew0KICAgICAgICBmbGV4OiAxOw0KICAgICAgICBjb2xvcjogIzMwMzEzMzsNCiAgICAgICAgd29yZC1icmVhazogYnJlYWstYWxsOw0KICAgICAgfQ0KICAgICAgLmRldGFpbC1jb250ZW50IHsNCiAgICAgICAgd2hpdGUtc3BhY2U6IHByZS13cmFwOw0KICAgICAgfQ0KICAgIH0NCiAgfQ0KDQogIEBtZWRpYSAobWF4LXdpZHRoOiA3NjhweCkgew0KICAgIC5saXN0LWhlYWRpbmcgew0KICAgICAgYWxpZ24taXRlbXM6IHN0cmV0Y2g7DQogICAgICBmbGV4LWRpcmVjdGlvbjogY29sdW1uOw0KICAgIH0NCg0KICAgIC5saXN0LWhlYWRpbmcgLmVsLWJ1dHRvbiB7DQogICAgICB3aWR0aDogMTAwJTsNCiAgICB9DQogIH0NCn0NCg=="},{"version":3,"sources":["index.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0XA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA","file":"index.vue","sourceRoot":"src/views/teachNotice","sourcesContent":["<template>\r\n <div class=\"app-container teach-notice\">\r\n <!-- 查询条件区域 -->\r\n <el-form :model=\"queryParams\" ref=\"queryForm\" size=\"small\" :inline=\"true\" label-width=\"68px\">\r\n <el-form-item label=\"标题\" prop=\"title\">\r\n <el-input\r\n v-model=\"queryParams.title\"\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=\"公告类别\">\r\n <el-select\r\n v-model=\"queryParams.category\"\r\n placeholder=\"请选择\"\r\n clearable\r\n style=\"width: 160px\"\r\n >\r\n <el-option\r\n v-for=\"item in categoryOptions\"\r\n :key=\"item\"\r\n :label=\"item\"\r\n :value=\"item\"\r\n />\r\n </el-select>\r\n </el-form-item>\r\n <el-form-item label=\"发布日期\">\r\n <el-date-picker\r\n v-model=\"queryParams.publishDateFrom\"\r\n type=\"date\"\r\n placeholder=\"从\"\r\n value-format=\"yyyy-MM-dd\"\r\n style=\"width: 140px\"\r\n />\r\n <span class=\"range-sep\">-</span>\r\n <el-date-picker\r\n v-model=\"queryParams.publishDateTo\"\r\n type=\"date\"\r\n placeholder=\"到\"\r\n value-format=\"yyyy-MM-dd\"\r\n style=\"width: 140px\"\r\n />\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 <div class=\"list-heading\">\r\n <div class=\"list-title\">公告列表</div>\r\n <el-button\r\n type=\"primary\"\r\n icon=\"el-icon-plus\"\r\n size=\"mini\"\r\n @click=\"handleAdd\"\r\n >新增</el-button>\r\n </div>\r\n <el-table v-loading=\"loading\" :data=\"noticeList\" border :height=\"tableHeight\">\r\n <el-table-column label=\"序号\" type=\"index\" align=\"center\" width=\"70\" />\r\n <el-table-column label=\"发布时间\" align=\"center\" width=\"165\">\r\n <template slot-scope=\"scope\">{{ formatTime(scope.row.publishTime) }}</template>\r\n </el-table-column>\r\n <el-table-column label=\"标题\" align=\"left\" prop=\"title\" min-width=\"300\" :show-overflow-tooltip=\"true\" />\r\n <el-table-column label=\"公告状态\" align=\"center\" width=\"100\">\r\n <template slot-scope=\"scope\">\r\n <el-tag :type=\"statusTagType(scope.row.status)\">{{ scope.row.status }}</el-tag>\r\n </template>\r\n </el-table-column>\r\n <el-table-column label=\"公告类别\" align=\"center\" prop=\"category\" width=\"110\" />\r\n <el-table-column label=\"优先级\" align=\"center\" prop=\"priority\" width=\"80\" />\r\n <el-table-column label=\"阅读次数\" align=\"center\" prop=\"readCount\" width=\"90\" />\r\n <el-table-column label=\"接收/已读\" align=\"center\" width=\"110\">\r\n <template slot-scope=\"scope\">{{ scope.row.recipientCount }}/{{ scope.row.readerCount }}</template>\r\n </el-table-column>\r\n <el-table-column\r\n label=\"操作\"\r\n align=\"center\"\r\n width=\"300\"\r\n fixed=\"right\"\r\n class-name=\"small-padding fixed-width action-column\"\r\n >\r\n <template slot-scope=\"scope\">\r\n <el-button\r\n type=\"text\"\r\n size=\"mini\"\r\n icon=\"el-icon-view\"\r\n @click=\"handleView(scope.row)\"\r\n >详情</el-button>\r\n <el-button\r\n type=\"text\"\r\n size=\"mini\"\r\n icon=\"el-icon-edit\"\r\n @click=\"handleUpdate(scope.row)\"\r\n >修改</el-button>\r\n <el-button\r\n v-if=\"scope.row.status !== '已下架'\"\r\n type=\"text\"\r\n size=\"mini\"\r\n icon=\"el-icon-download\"\r\n @click=\"handleOffline(scope.row)\"\r\n >下架</el-button>\r\n <el-button\r\n type=\"text\"\r\n size=\"mini\"\r\n icon=\"el-icon-delete\"\r\n style=\"color: #f56c6c\"\r\n @click=\"handleDelete(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\r\n :title=\"dialogTitle\"\r\n :visible=\"dialogVisible\"\r\n :close-on-click-modal=\"false\"\r\n width=\"600px\"\r\n @update:visible=\"handleDialogVisible\"\r\n >\r\n <el-form ref=\"noticeForm\" :model=\"form\" :rules=\"rules\" label-width=\"80px\">\r\n <el-form-item label=\"公告标题\" prop=\"title\">\r\n <el-input v-model=\"form.title\" placeholder=\"请输入公告标题\" />\r\n </el-form-item>\r\n <el-form-item label=\"公告类别\" prop=\"category\">\r\n <el-select v-model=\"form.category\" placeholder=\"请选择公告类别\" clearable>\r\n <el-option v-for=\"item in categoryOptions\" :key=\"item\" :label=\"item\" :value=\"item\" />\r\n </el-select>\r\n </el-form-item>\r\n <el-form-item label=\"公告正文\" prop=\"content\">\r\n <el-input type=\"textarea\" v-model=\"form.content\" rows=\"8\" placeholder=\"请输入公告正文\" />\r\n </el-form-item>\r\n </el-form>\r\n <div slot=\"footer\" class=\"dialog-footer\">\r\n <el-button type=\"primary\" size=\"mini\" @click=\"submitForm\">确 定</el-button>\r\n <el-button size=\"mini\" @click=\"handleDialogVisible(false)\">取 消</el-button>\r\n </div>\r\n </el-dialog>\r\n\r\n <!-- 详情 对话框 -->\r\n <el-dialog\r\n title=\"公告详情\"\r\n :visible=\"viewVisible\"\r\n :close-on-click-modal=\"false\"\r\n width=\"600px\"\r\n @update:visible=\"handleViewVisible\"\r\n >\r\n <div class=\"detail-body\">\r\n <div class=\"detail-row\">\r\n <span class=\"detail-label\">公告标题</span>\r\n <span class=\"detail-value\">{{ viewForm.title }}</span>\r\n </div>\r\n <div class=\"detail-row\">\r\n <span class=\"detail-label\">公告类别</span>\r\n <span class=\"detail-value\">{{ viewForm.category }}</span>\r\n </div>\r\n <div class=\"detail-row\">\r\n <span class=\"detail-label\">公告状态</span>\r\n <span class=\"detail-value\">{{ viewForm.status }}</span>\r\n </div>\r\n <div class=\"detail-row\">\r\n <span class=\"detail-label\">优先级</span>\r\n <span class=\"detail-value\">{{ viewForm.priority }}</span>\r\n </div>\r\n <div class=\"detail-row\">\r\n <span class=\"detail-label\">发布时间</span>\r\n <span class=\"detail-value\">{{ viewForm.publishTime }}</span>\r\n </div>\r\n <div class=\"detail-row\">\r\n <span class=\"detail-label\">阅读次数</span>\r\n <span class=\"detail-value\">{{ viewForm.readCount }}</span>\r\n </div>\r\n <div class=\"detail-row\">\r\n <span class=\"detail-label\">接收/已读</span>\r\n <span class=\"detail-value\">{{ viewForm.recipientCount }}/{{ viewForm.readerCount }}</span>\r\n </div>\r\n <div class=\"detail-row\">\r\n <span class=\"detail-label\">发布范围</span>\r\n <span class=\"detail-value\">{{ viewForm.scopeName }}</span>\r\n </div>\r\n <div class=\"detail-row\">\r\n <span class=\"detail-label\">公告正文</span>\r\n <span class=\"detail-value detail-content\">{{ viewForm.content }}</span>\r\n </div>\r\n <div class=\"detail-row\">\r\n <span class=\"detail-label\">备注</span>\r\n <span class=\"detail-value\">{{ viewForm.remark }}</span>\r\n </div>\r\n </div>\r\n <div slot=\"footer\" class=\"dialog-footer\">\r\n <el-button size=\"mini\" @click=\"handleViewVisible(false)\">关 闭</el-button>\r\n </div>\r\n </el-dialog>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { listTeachNotice, getTeachNotice, addTeachNotice, updateTeachNotice, delTeachNotice } from \"@/api/teachNotice\"\r\n\r\nexport default {\r\n name: \"TeachNotice\",\r\n data() {\r\n return {\r\n loading: true,\r\n tableHeight: window.innerHeight - 320,\r\n total: 0,\r\n noticeList: [],\r\n categoryOptions: ['教学公告', '考试通知', '调课通知'],\r\n queryParams: {\r\n pageNum: 1,\r\n pageSize: 10,\r\n title: undefined,\r\n category: undefined,\r\n publishDateFrom: undefined,\r\n publishDateTo: undefined\r\n },\r\n // 新增/修改 对话框\r\n dialogVisible: false,\r\n dialogTitle: '',\r\n form: {},\r\n rules: {\r\n title: [{ required: true, message: \"公告标题不能为空\", trigger: \"blur\" }],\r\n content: [{ required: true, message: \"公告正文不能为空\", trigger: \"blur\" }],\r\n category: [{ required: true, message: \"公告类别不能为空\", trigger: \"change\" }]\r\n },\r\n // 详情 对话框\r\n viewVisible: false,\r\n viewForm: {}\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 listTeachNotice(this.queryParams).then(response => {\r\n const data = response.data || {}\r\n this.noticeList = data.records || []\r\n this.total = data.total || 0\r\n this.loading = false\r\n }).catch(() => {\r\n this.noticeList = []\r\n this.total = 0\r\n this.loading = false\r\n })\r\n },\r\n /** 时间格式化:yyyy-MM-dd HH:mm:ss */\r\n formatTime(time) {\r\n if (!time) return ''\r\n const date = new Date(time)\r\n if (isNaN(date.getTime())) return time\r\n const pad = n => String(n).padStart(2, '0')\r\n return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`\r\n },\r\n /** 状态标签颜色 */\r\n statusTagType(status) {\r\n if (status === '已发布') return 'success'\r\n if (status === '已下架') return 'info'\r\n return 'warning'\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.queryParams = {\r\n pageNum: 1,\r\n pageSize: 10,\r\n title: undefined,\r\n category: undefined,\r\n publishDateFrom: undefined,\r\n publishDateTo: undefined\r\n }\r\n this.handleQuery()\r\n },\r\n /** 新增 */\r\n handleAdd() {\r\n this.dialogTitle = '新增公告'\r\n this.form = { title: undefined, content: undefined, category: undefined }\r\n this.dialogVisible = true\r\n this.$nextTick(() => {\r\n this.$refs.noticeForm && this.$refs.noticeForm.clearValidate()\r\n })\r\n },\r\n /** 修改 */\r\n handleUpdate(row) {\r\n getTeachNotice(row.id).then(response => {\r\n const data = response.data || {}\r\n this.form = {\r\n id: data.id,\r\n title: data.title,\r\n content: data.content,\r\n category: data.category\r\n }\r\n }).catch(() => {})\r\n this.dialogTitle = '修改公告'\r\n this.dialogVisible = true\r\n },\r\n /** 提交新增/修改 */\r\n submitForm() {\r\n this.$refs.noticeForm.validate(valid => {\r\n if (!valid) return\r\n const isAdd = !this.form.id\r\n if (isAdd) {\r\n addTeachNotice(this.form).then(() => {\r\n this.$message.success(\"新增成功\")\r\n this.dialogVisible = false\r\n this.getList()\r\n }).catch(() => {})\r\n } else {\r\n updateTeachNotice(this.form).then(() => {\r\n this.$message.success(\"修改成功\")\r\n this.dialogVisible = false\r\n this.getList()\r\n }).catch(() => {})\r\n }\r\n })\r\n },\r\n /** 下架 */\r\n handleOffline(row) {\r\n this.$confirm(\"确认下架该公告吗?\", \"提示\", {\r\n confirmButtonText: \"确定\",\r\n cancelButtonText: \"取消\",\r\n type: \"warning\"\r\n }).then(() => {\r\n updateTeachNotice({ id: row.id, status: '已下架' }).then(() => {\r\n this.$message.success(\"下架成功\")\r\n this.getList()\r\n }).catch(() => {})\r\n }).catch(() => {})\r\n },\r\n /** 删除(级联删除:仅拟制/已下架可删,后端校验) */\r\n handleDelete(row) {\r\n this.$confirm(\"确认删除该公告吗?\", \"提示\", {\r\n confirmButtonText: \"确定\",\r\n cancelButtonText: \"取消\",\r\n type: \"warning\"\r\n }).then(() => {\r\n delTeachNotice(row.id).then(() => {\r\n this.$message.success(\"删除成功\")\r\n this.getList()\r\n }).catch(() => {})\r\n }).catch(() => {})\r\n },\r\n /** 详情 */\r\n handleView(row) {\r\n getTeachNotice(row.id).then(response => {\r\n this.viewForm = response.data || {}\r\n this.viewVisible = true\r\n }).catch(() => {})\r\n },\r\n /** 对话框关闭事件(Vue2 兼容) */\r\n handleDialogVisible(val) {\r\n this.dialogVisible = val\r\n },\r\n handleViewVisible(val) {\r\n this.viewVisible = val\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped lang=\"scss\">\r\n.teach-notice {\r\n .range-sep {\r\n margin: 0 8px;\r\n color: #909399;\r\n }\r\n .list-heading {\r\n display: flex;\r\n align-items: center;\r\n justify-content: space-between;\r\n gap: 16px;\r\n margin-bottom: 12px;\r\n }\r\n .list-title {\r\n font-size: 16px;\r\n font-weight: 600;\r\n color: #303133;\r\n padding-left: 10px;\r\n border-left: 4px solid var(--edu-green-primary);\r\n }\r\n ::v-deep .action-column .cell {\r\n white-space: nowrap;\r\n }\r\n .detail-body {\r\n padding: 0 8px;\r\n .detail-row {\r\n display: flex;\r\n padding: 6px 0;\r\n font-size: 13px;\r\n line-height: 1.6;\r\n .detail-label {\r\n flex-shrink: 0;\r\n width: 90px;\r\n color: #909399;\r\n text-align: right;\r\n margin-right: 12px;\r\n }\r\n .detail-value {\r\n flex: 1;\r\n color: #303133;\r\n word-break: break-all;\r\n }\r\n .detail-content {\r\n white-space: pre-wrap;\r\n }\r\n }\r\n }\r\n\r\n @media (max-width: 768px) {\r\n .list-heading {\r\n align-items: stretch;\r\n flex-direction: column;\r\n }\r\n\r\n .list-heading .el-button {\r\n width: 100%;\r\n }\r\n }\r\n}\r\n</style>\r\n"]}]}