From eabfb9bd1f456359ebbdb3e9daa532eae078da93 Mon Sep 17 00:00:00 2001 From: Lx <935448346@qq.com> Date: Thu, 17 Oct 2024 17:53:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E5=8F=B0=E7=B3=BB=E7=BB=9F=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=83=A8=E5=88=86Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/setting/banner/index.vue | 11 +- fuintAdmin_zt/src/views/setting/message.vue | 3 + fuintAdmin_zt/src/views/setting/pay/index.vue | 7 +- .../src/views/system/notify/page/mode.vue | 111 ++++++++++++------ .../src/views/system/notify/page/record.vue | 66 ++++++----- .../service/impl/SysNotifyServiceImpl.java | 4 +- 6 files changed, 124 insertions(+), 78 deletions(-) diff --git a/fuintAdmin_zt/src/views/setting/banner/index.vue b/fuintAdmin_zt/src/views/setting/banner/index.vue index fb76cf446..88b7122b8 100644 --- a/fuintAdmin_zt/src/views/setting/banner/index.vue +++ b/fuintAdmin_zt/src/views/setting/banner/index.vue @@ -277,7 +277,7 @@ export default { { required: true, message: '请填写banner名称', trigger: 'blur' } ], systemPosition: [ - { required: true, message: '请填写系统位置', trigger: '' } + { required: true, message: '请填写系统位置', trigger: 'blur' } ], sortOrder: [ { required: true, message: '请填写排序号', trigger: 'blur' } @@ -394,7 +394,7 @@ export default { pageSize: 10, deviceName: '', systemPosition: '系统首页' - }, + } this.getList() }, handleAdd(e) { @@ -458,10 +458,11 @@ export default { bannerStatus: false, // Banner状态 note: '', // 备注 createByName: '' // - } - + }; this.uploadFiles = [] - + if (this.$refs.deviceForm) { + this.$refs.deviceForm.resetFields(); + } } } } diff --git a/fuintAdmin_zt/src/views/setting/message.vue b/fuintAdmin_zt/src/views/setting/message.vue index 043ff883f..50361520c 100644 --- a/fuintAdmin_zt/src/views/setting/message.vue +++ b/fuintAdmin_zt/src/views/setting/message.vue @@ -356,6 +356,9 @@ export default { bannerStatus: false, // Banner状态 note: '', // 备注 createByName: '', // + }; + if (this.$refs.form) { + this.$refs.form.resetFields(); } }, handleReset() { diff --git a/fuintAdmin_zt/src/views/setting/pay/index.vue b/fuintAdmin_zt/src/views/setting/pay/index.vue index d9c8d35ba..fd33ceeb9 100644 --- a/fuintAdmin_zt/src/views/setting/pay/index.vue +++ b/fuintAdmin_zt/src/views/setting/pay/index.vue @@ -134,7 +134,7 @@ - + @@ -191,7 +191,7 @@ inactive-color="#ff4949"> - + 取消 保存 @@ -400,6 +400,9 @@ export default { information:'', status:'qy' } + if (this.$refs.deviceForm) { + this.$refs.deviceForm.resetFields(); + } }, handleReset() { this.open = false diff --git a/fuintAdmin_zt/src/views/system/notify/page/mode.vue b/fuintAdmin_zt/src/views/system/notify/page/mode.vue index 4c4884d09..6675349d0 100644 --- a/fuintAdmin_zt/src/views/system/notify/page/mode.vue +++ b/fuintAdmin_zt/src/views/system/notify/page/mode.vue @@ -96,14 +96,14 @@ - + - + - + @@ -112,7 +112,7 @@ - +
{系统到期日期} @@ -123,19 +123,19 @@ - + - + - +
@@ -154,7 +154,7 @@
- 添加条件 + 添加条件
@@ -163,7 +163,7 @@
- 保存 + 保存 取消
@@ -200,7 +200,7 @@ export default { conditions: [ ] }, - // { field: '', operator: '', value: '' } + // { field: '', operator: '', value: '' } deviceInfo: { id: null, // 自增id @@ -223,6 +223,26 @@ export default { legalRepresentativeContact:'', appStatus:'', }, + rules: { + notificationName: [ + {required: true, message: '请输入通知名称', trigger: 'blur'}, + ], + notificationType: [ + {required: true, message: '请选择通知类型', trigger: 'change'}, + ], + templateContent: [ + {required: true, message: '请输入通知模版', trigger: 'blur'}, + ], + recipientRoles: [ + {required: true, message: '请选择接收角色', trigger: 'change'}, + ], + templateStatus: [ + {required: true, message: '请选择模版状态', trigger: 'change'}, + ], + conditions: [ + {required: true, message: '请添加发送条件', trigger: 'change'}, + ], + }, }; }, created() { @@ -267,38 +287,47 @@ export default { // }); // }, - handleSubmit() { - this.open = false + handleSubmit(form) { + this.$refs[form].validate(valid =>{ + if (valid) { + // 表单验证通过,可以提交数据 + if ( this.form.conditions.length === 0 || this.form.conditions[0].field == '') { + this.form.conditions = '' + this.$message({ + type: 'error', + message: '请选择发送条件!' + }); + return + } else { + this.form.conditions = JSON.stringify(this.form.conditions) + } + this.form.recipientRoles = JSON.stringify(this.form.recipientRoles) - // 在这里调用接口提交设备信息数据 + if (this.form.id) { + updateSysNotifyApi(this.form).then(res=>{ + if(res.code === 200) { + this.form.conditions = [] + this.getList() + this.open = false + } + }) + }else { + saveSysNotifyApi(this.form).then(res=>{ + if(res.code === 200) { + this.form.conditions = [] + this.getList() + this.open = false + } + }) + } + } else { + // 表单验证失败,不执行任何操作 + return false + } + }) + // 在这里调用接口提交设备信息数据 console.log('提交设备信息数据:', this.form); - if ( this.form.conditions.length === 0 || this.form.conditions[0].field == '') { - this.form.conditions = '' - this.$message({ - type: 'info', - message: '请选择发送条件!' - }); - return - } else { - this.form.conditions = JSON.stringify(this.form.conditions) - } - this.form.recipientRoles = JSON.stringify(this.form.recipientRoles) - if (this.form.id) { - updateSysNotifyApi(this.form).then(res=>{ - if(res.code === 200) { - this.getList() - this.open = false - } - }) - }else { - saveSysNotifyApi(this.form).then(res=>{ - if(res.code === 200) { - this.getList() - this.open = false - } - }) - } }, handleReset() { this.open = false @@ -363,6 +392,7 @@ export default { }, insertText(data) { this.form.templateContent = this.form.templateContent+data + console.log("Test",this.form.templateContent+data) }, addCondition() { if (this.form.conditions.length > 2) { @@ -443,6 +473,9 @@ export default { { field: '', operator: '', value: '' } ] } + if (this.$refs.form) { + this.$refs.form.resetFields(); + } }, } }; diff --git a/fuintAdmin_zt/src/views/system/notify/page/record.vue b/fuintAdmin_zt/src/views/system/notify/page/record.vue index 7c4d90a5d..93e8e5133 100644 --- a/fuintAdmin_zt/src/views/system/notify/page/record.vue +++ b/fuintAdmin_zt/src/views/system/notify/page/record.vue @@ -162,7 +162,7 @@
- 确定 + 确定 取消
@@ -261,8 +261,6 @@ export default { recipientUser: [ {required: true, message: '请选择接收用户', trigger: 'change'}, ], - - } }; }, @@ -291,8 +289,6 @@ export default { }, // 发送通知 send(data) { - - this.$confirm('是否发送本条通知信息', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', @@ -379,12 +375,12 @@ export default { notificationType: '', templateContent: '', recipientRoles: [], - templateStatus: true, + templateStatus: false, recipientUser: [] }; - this.$nextTick(() => { - this.$refs['form'].resetFields(); - }); + if (this.$refs.form) { + this.$refs.form.resetFields(); + } }, handleAdd(e) { this.cleanForm() @@ -393,38 +389,47 @@ export default { this.title = "新增通知" }, - userEnter1() { - // 在这里调用接口提交设备信息数据 + userEnter1(form) { + this.$refs[form].validate(valid =>{ + if (valid) { + // 表单验证通过,可以提交数据 + this.form.recipientUser = JSON.stringify(this.form.recipientUser) + this.form.recipientRoles = JSON.stringify(this.form.recipientRoles) + if (this.form.id) { + updateSysNotifyApi(this.form).then(res => { + if (res.code === 200) { + this.getList() + this.open = false + } + }) + } else { + saveSysNotifyApi(this.form).then(res => { + if (res.code === 200) { + this.getList() + this.open = false + } + }) + } + } else { + // 表单验证失败,不执行任何操作 + return false + } + }) + // 在这里调用接口提交设备信息数据 console.log('提交设备信息数据:', this.form); - this.form.recipientUser = JSON.stringify(this.form.recipientUser) - this.form.recipientRoles = JSON.stringify(this.form.recipientRoles) - if (this.form.id) { - updateSysNotifyApi(this.form).then(res => { - if (res.code === 200) { - this.getList() - this.open = false - } - }) - } else { - saveSysNotifyApi(this.form).then(res => { - if (res.code === 200) { - this.getList() - this.open = false - } - }) - } + }, userCe2() { this.open = false; }, edit(e) { - this.clean() + this.cleanForm() this.open = true; this.title = "编辑通知" this.getDutyList() - this.form = e + this.form = JSON.parse(JSON.stringify(e)); this.form.recipientUser = JSON.parse(this.form.recipientUser) this.form.recipientRoles = JSON.parse(this.form.recipientRoles) @@ -495,6 +500,7 @@ export default { // this.addDateRange(this.queryParams, this.dateRange) listUser(this.queryParamsUser).then(response => { this.userList = response.data.records; + console.log("name", response.data.records) // this.total = response.data.total; // this.total = response.data.total; // this.loading = false; diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/sys/service/impl/SysNotifyServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/sys/service/impl/SysNotifyServiceImpl.java index 6ca72f880..81471e5d5 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/sys/service/impl/SysNotifyServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/sys/service/impl/SysNotifyServiceImpl.java @@ -72,7 +72,7 @@ public class SysNotifyServiceImpl extends ServiceImpl