From 67fc6a31d506db80e9f6fb406819e4c3933533c3 Mon Sep 17 00:00:00 2001 From: dongzeliang <2746733890@qq.com> Date: Fri, 12 Apr 2024 19:19:42 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DictData/index.js | 82 +++++++++++++++++++++++++++++++ src/views/system/notice/index.vue | 72 +++++++++++++++++---------- 2 files changed, 127 insertions(+), 27 deletions(-) diff --git a/src/components/DictData/index.js b/src/components/DictData/index.js index 169b101..81d65b7 100644 --- a/src/components/DictData/index.js +++ b/src/components/DictData/index.js @@ -176,6 +176,88 @@ let dictDataMap = "status": "0", "remark": "系统默认否" } + ], + // 公告类型 + "sys_notice_type": [ + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "params": { + "@type": "java.util.HashMap" + }, + "dictCode": 14, + "dictSort": 1, + "dictLabel": "通知", + "dictValue": "1", + "dictType": "sys_notice_type", + "cssClass": "", + "listClass": "warning", + "isDefault": "Y", + "status": "0", + "remark": "通知" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "params": { + "@type": "java.util.HashMap" + }, + "dictCode": 15, + "dictSort": 2, + "dictLabel": "公告", + "dictValue": "2", + "dictType": "sys_notice_type", + "cssClass": "", + "listClass": "success", + "isDefault": "N", + "status": "0", + "remark": "公告" + } + ], + // 通知状态 + "sys_notice_status": [ + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "params": { + "@type": "java.util.HashMap" + }, + "dictCode": 16, + "dictSort": 1, + "dictLabel": "正常", + "dictValue": "0", + "dictType": "sys_notice_status", + "cssClass": "", + "listClass": "primary", + "isDefault": "Y", + "status": "0", + "remark": "正常状态" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "params": { + "@type": "java.util.HashMap" + }, + "dictCode": 17, + "dictSort": 2, + "dictLabel": "关闭", + "dictValue": "1", + "dictType": "sys_notice_status", + "cssClass": "", + "listClass": "danger", + "isDefault": "N", + "status": "0", + "remark": "关闭状态" + } ] } /** diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue index edfb938..4049018 100644 --- a/src/views/system/notice/index.vue +++ b/src/views/system/notice/index.vue @@ -229,11 +229,42 @@ export default { /** 查询公告列表 */ getList() { this.loading = true; - listNotice(this.queryParams).then(response => { - this.noticeList = response.data.rows; - this.total = response.data.total; - this.loading = false; - }); + let response = { + "code": 200, + "msg": "查询成功", + "data": { + "total": 2, + "rows": [ + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "noticeId": 1, + "noticeTitle": "温馨提醒:2018-07-01 锐腾新版本发布啦", + "noticeType": "2", + "noticeContent": "新版本内容", + "status": "0", + "remark": "管理员" + }, + { + "createBy": 1, + "createTime": "2023-09-29 11:47:28", + "updateBy": null, + "updateTime": null, + "noticeId": 2, + "noticeTitle": "维护通知:2018-07-01 锐腾系统凌晨维护", + "noticeType": "1", + "noticeContent": "维护内容", + "status": "0", + "remark": "管理员" + } + ] + } + } + this.noticeList = response.data.rows; + this.total = response.data.total; + this.loading = false; }, // 取消按钮 cancel() { @@ -276,29 +307,20 @@ export default { /** 修改按钮操作 */ handleUpdate(row) { this.reset(); - const noticeId = row.noticeId || this.ids - getNotice(noticeId).then(response => { - this.form = response.data; - this.open = true; - this.title = "修改公告"; - }); + this.form = row; + this.open = true; + this.title = "修改公告"; }, /** 提交按钮 */ submitForm: function () { this.$refs["form"].validate(valid => { if (valid) { if (this.form.noticeId != undefined) { - updateNotice(this.form).then(response => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }); + this.$modal.msgSuccess("修改成功"); + this.open = false; } else { - addNotice(this.form).then(response => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); - }); + this.$modal.msgSuccess("新增成功"); + this.open = false; } } }); @@ -306,12 +328,8 @@ export default { /** 删除按钮操作 */ handleDelete(row) { const noticeIds = row.noticeId || this.ids - this.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?').then(function () { - return delNotice(noticeIds); - }).then(() => { - this.getList(); - this.$modal.msgSuccess("删除成功"); - }).catch(() => { + this.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?').then(() => { + this.$modal.msgSuccess("删除成功") }); } }