From 54b63a7f537699815c83ad07647c563953a4d95c Mon Sep 17 00:00:00 2001 From: lb Date: Fri, 24 Nov 2023 10:41:11 +0800 Subject: [PATCH 1/3] update drawer and edit --- .../components/BasicDrawer.vue | 56 +++++---- .../AlarmGroup/components/BasicDrawer.vue | 113 ++++++++++++------ .../base/config/AlarmGroup/index.vue | 18 ++- .../BindGroup/components/BasicDrawer.vue | 110 +++++++++++------ .../equipment/base/config/BindGroup/index.vue | 45 +++++-- .../DataCollection/CollectionConfig.vue | 30 ++++- .../DataCollection/components/BasicDrawer.vue | 51 ++++++-- 7 files changed, 290 insertions(+), 133 deletions(-) diff --git a/src/views/base/equipmentPlcConnect/components/BasicDrawer.vue b/src/views/base/equipmentPlcConnect/components/BasicDrawer.vue index f38fb47d..b1b27230 100644 --- a/src/views/base/equipmentPlcConnect/components/BasicDrawer.vue +++ b/src/views/base/equipmentPlcConnect/components/BasicDrawer.vue @@ -166,13 +166,17 @@ export default { input: true, label: '参数列名', prop: 'plcParamName', - rules: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }], + rules: [ + { required: true, message: '参数列名不能为空', trigger: 'blur' }, + ], }, { input: true, label: '参数名称', prop: 'name', - rules: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }], + rules: [ + { required: true, message: '参数名称不能为空', trigger: 'blur' }, + ], }, ], [ @@ -419,35 +423,35 @@ export default { }, // 提交属性表 - async submitAttrForm() { - this.$refs['attrForm'].validate((valid) => { + submitAttrForm() { + this.$refs['attrForm'].validate(async (valid) => { if (!valid) { return; } - }); - const isEdit = this.attrForm.id != null; - this.attrFormSubmitting = true; - const res = await this.$axios({ - url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate, - method: isEdit ? 'put' : 'post', - data: { - ...this.attrForm, - connectId: this.infoData.id - }, - }); - - if (res.code == 0) { - this.closeAttrForm(); - this.$message({ - message: `${isEdit ? '更新' : '创建'}成功`, - type: 'success', - duration: 1500, - onClose: () => { - this.getAttrList(); + const isEdit = this.attrForm.id != null; + this.attrFormSubmitting = true; + const res = await this.$axios({ + url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate, + method: isEdit ? 'put' : 'post', + data: { + ...this.attrForm, + connectId: this.infoData.id, }, }); - } - this.attrFormSubmitting = false; + + if (res.code == 0) { + this.closeAttrForm(); + this.$message({ + message: `${isEdit ? '更新' : '创建'}成功`, + type: 'success', + duration: 1500, + onClose: () => { + this.getAttrList(); + }, + }); + } + this.attrFormSubmitting = false; + }); }, closeAttrForm() { diff --git a/src/views/equipment/base/config/AlarmGroup/components/BasicDrawer.vue b/src/views/equipment/base/config/AlarmGroup/components/BasicDrawer.vue index f12d707c..079f999e 100644 --- a/src/views/equipment/base/config/AlarmGroup/components/BasicDrawer.vue +++ b/src/views/equipment/base/config/AlarmGroup/components/BasicDrawer.vue @@ -12,7 +12,7 @@ :wrapper-closable="false" class="drawer" custom-class="mes-drawer" - size="60%" + :size="size || '50%'" @closed="$emit('destroy')"> {{ @@ -42,7 +42,8 @@ :dataForm="form" :rows="formRows" /> --> - + +
+ + + + + + + + + + + + + + +
- -
+
添加报警 @@ -84,7 +111,7 @@
@@ -163,7 +192,7 @@ const SmallTitle = { export default { components: { SmallTitle, DialogForm, BaseInfoForm }, - props: ['sections', 'defaultMode', 'dataId'], // dataId 作为一个通用的存放id的字段 + props: ['sections', 'defaultMode', 'dataId', 'size'], // dataId 作为一个通用的存放id的字段 data() { return { mode: '', @@ -191,7 +220,9 @@ export default { label: '报警编码', // 自动生成 prop: 'code', url: '/base/equipment-group-alarm/getCode', - rules: [{ required: true, message: '报警编码不能为空', trigger: 'blur' }], + rules: [ + { required: true, message: '报警编码不能为空', trigger: 'blur' }, + ], }, { select: true, @@ -205,13 +236,17 @@ export default { input: true, label: '参数列名', // 在实时数据库的列名 prop: 'plcParamName', - rules: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }], + rules: [ + { required: true, message: '参数列名不能为空', trigger: 'blur' }, + ], }, { input: true, label: '报警内容', prop: 'alarmContent', - rules: [{ required: true, message: '报警内容不能为空', trigger: 'blur' }], + rules: [ + { required: true, message: '报警内容不能为空', trigger: 'blur' }, + ], }, ], [ @@ -223,7 +258,9 @@ export default { { label: '布尔型', value: 2 }, { label: '字符型', value: 1 }, ], - rules: [{ required: true, message: '报警类型不能为空', trigger: 'blur' }], + rules: [ + { required: true, message: '报警类型不能为空', trigger: 'blur' }, + ], }, { input: true, @@ -322,7 +359,7 @@ export default { handleSave() { this.$refs['form'][0].validate(async (valid) => { if (valid) { - const isEdit = this.mode == 'edit'; + const isEdit = !this.mode.includes('detail'); await this.$axios({ url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'], method: isEdit ? 'put' : 'post', @@ -403,32 +440,32 @@ export default { }, // 提交属性表 - async submitAttrForm() { - this.$refs['attrForm'].validate((valid) => { + submitAttrForm() { + this.$refs['attrForm'].validate(async (valid) => { if (!valid) { return; } - }); - const isEdit = this.attrForm.id != null; - this.attrFormSubmitting = true; - const res = await this.$axios({ - url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate, - method: isEdit ? 'put' : 'post', - data: this.attrForm, - }); - - if (res.code == 0) { - this.closeAttrForm(); - this.$message({ - message: `${isEdit ? '更新' : '创建'}成功`, - type: 'success', - duration: 1500, - onClose: () => { - this.getAttrList(); - }, + const isEdit = this.attrForm.id != null; + this.attrFormSubmitting = true; + const res = await this.$axios({ + url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate, + method: isEdit ? 'put' : 'post', + data: this.attrForm, }); - } - this.attrFormSubmitting = false; + + if (res.code == 0) { + this.closeAttrForm(); + this.$message({ + message: `${isEdit ? '更新' : '创建'}成功`, + type: 'success', + duration: 1500, + onClose: () => { + this.getAttrList(); + }, + }); + } + this.attrFormSubmitting = false; + }); }, closeAttrForm() { diff --git a/src/views/equipment/base/config/AlarmGroup/index.vue b/src/views/equipment/base/config/AlarmGroup/index.vue index f32f10f5..61cc4027 100644 --- a/src/views/equipment/base/config/AlarmGroup/index.vue +++ b/src/views/equipment/base/config/AlarmGroup/index.vue @@ -45,6 +45,7 @@ {{ @@ -42,7 +42,7 @@ :dataForm="form" :rows="formRows" /> --> - +
+ + + + + + + + + + + + + +
- -
+
添加属性 @@ -84,7 +109,7 @@ 取消 - - + + 保存 +
@@ -163,7 +190,7 @@ const SmallTitle = { export default { components: { SmallTitle, DialogForm, BaseInfoForm }, - props: ['sections', 'defaultMode', 'dataId'], // dataId 作为一个通用的存放id的字段 + props: ['sections', 'defaultMode', 'dataId', 'size'], // dataId 作为一个通用的存放id的字段 data() { return { mode: '', @@ -191,7 +218,9 @@ export default { label: '报警编码', // 自动生成 prop: 'code', url: '/base/equipment-group-alarm/getCode', - rules: [{ required: true, message: '报警编码不能为空', trigger: 'blur' }], + rules: [ + { required: true, message: '报警编码不能为空', trigger: 'blur' }, + ], }, { select: true, @@ -201,7 +230,9 @@ export default { { label: '布尔型', value: 2 }, { label: '字符型', value: 1 }, ], - rules: [{ required: true, message: '报警类型不能为空', trigger: 'blur' }], + rules: [ + { required: true, message: '报警类型不能为空', trigger: 'blur' }, + ], }, ], [ @@ -222,13 +253,17 @@ export default { input: true, label: '参数列名', // 在实时数据库的列名 prop: 'plcParamName', - rules: [{ required: true, message: '参数列名不能为空', trigger: 'blur' }], + rules: [ + { required: true, message: '参数列名不能为空', trigger: 'blur' }, + ], }, { input: true, label: '报警内容', prop: 'alarmContent', - rules: [{ required: true, message: '报警内容不能为空', trigger: 'blur' }], + rules: [ + { required: true, message: '报警内容不能为空', trigger: 'blur' }, + ], }, ], ], @@ -322,7 +357,7 @@ export default { handleSave() { this.$refs['form'][0].validate(async (valid) => { if (valid) { - const isEdit = this.mode == 'edit'; + const isEdit = !this.mode.includes('detail'); await this.$axios({ url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'], method: isEdit ? 'put' : 'post', @@ -403,33 +438,32 @@ export default { }, // 提交属性表 - async submitAttrForm() { - this.$refs['attrForm'].validate((valid) => { + submitAttrForm() { + this.$refs['attrForm'].validate(async (valid) => { if (!valid) { return; } - }); - console.log('this.attrform', this.attrForm); - const isEdit = this.attrForm.id != null; - this.attrFormSubmitting = true; - const res = await this.$axios({ - url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate, - method: isEdit ? 'put' : 'post', - data: this.attrForm, - }); - - if (res.code == 0) { - this.closeAttrForm(); - this.$message({ - message: `${isEdit ? '更新' : '创建'}成功`, - type: 'success', - duration: 1500, - onClose: () => { - this.getAttrList(); - }, + const isEdit = this.attrForm.id != null; + this.attrFormSubmitting = true; + const res = await this.$axios({ + url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate, + method: isEdit ? 'put' : 'post', + data: this.attrForm, }); - } - this.attrFormSubmitting = false; + + if (res.code == 0) { + this.closeAttrForm(); + this.$message({ + message: `${isEdit ? '更新' : '创建'}成功`, + type: 'success', + duration: 1500, + onClose: () => { + this.getAttrList(); + }, + }); + } + this.attrFormSubmitting = false; + }); }, closeAttrForm() { diff --git a/src/views/equipment/base/config/BindGroup/index.vue b/src/views/equipment/base/config/BindGroup/index.vue index 12b94408..81c2295d 100644 --- a/src/views/equipment/base/config/BindGroup/index.vue +++ b/src/views/equipment/base/config/BindGroup/index.vue @@ -45,6 +45,7 @@ {{ @@ -42,7 +42,8 @@ v-model="form" :rows="formRows" /> --> - + +
+ + + + + + + + + + + + + + +
- -
+
添加属性 @@ -86,7 +113,7 @@ 取消 - - + + 保存 +
@@ -164,7 +193,7 @@ const SmallTitle = { export default { components: { SmallTitle, DialogForm: BaseInfoForm, BaseInfoForm }, - props: ['sections', 'defaultMode', 'infoData'], + props: ['sections', 'defaultMode', 'infoData', 'size'], data() { return { mode: '', @@ -412,7 +441,7 @@ export default { handleSave() { this.$refs['form'][0].validate(async (valid) => { if (valid) { - const isEdit = this.mode == 'edit'; + const isEdit = !this.mode.includes('detail'); await this.$axios({ url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'], method: isEdit ? 'put' : 'post', From a8fa98cb913b36fe327dd21261b63d1a71044666 Mon Sep 17 00:00:00 2001 From: lb Date: Fri, 24 Nov 2023 14:56:17 +0800 Subject: [PATCH 2/3] update StatusAndParams --- src/views/equipment/monitor/SearchBar.vue | 7 +- .../monitor/StatusAndParams/index.vue | 46 +++++++++-- .../monitoring/equipmentFullParams/index.vue | 79 +++++++++++++------ 3 files changed, 101 insertions(+), 31 deletions(-) diff --git a/src/views/equipment/monitor/SearchBar.vue b/src/views/equipment/monitor/SearchBar.vue index 1ac5b175..5ecc8031 100644 --- a/src/views/equipment/monitor/SearchBar.vue +++ b/src/views/equipment/monitor/SearchBar.vue @@ -105,7 +105,12 @@ export default { } this.listEq.splice(0); }, - handleSearch() {}, + handleSearch() { + this.$emit('action', { + action: 'search', + payload: this.form, + }); + }, }, }; diff --git a/src/views/equipment/monitor/StatusAndParams/index.vue b/src/views/equipment/monitor/StatusAndParams/index.vue index 5bb0dedc..e3f0fe1d 100644 --- a/src/views/equipment/monitor/StatusAndParams/index.vue +++ b/src/views/equipment/monitor/StatusAndParams/index.vue @@ -1,7 +1,7 @@ + + diff --git a/src/views/equipment/base/alarm/Record/SmallTitle.vue b/src/views/equipment/base/alarm/Record/SmallTitle.vue index 93b4a18f..f1f3ecbb 100644 --- a/src/views/equipment/base/alarm/Record/SmallTitle.vue +++ b/src/views/equipment/base/alarm/Record/SmallTitle.vue @@ -40,7 +40,7 @@ $pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px); $mgr: 8px; @each $size, $height in $pxls { .#{$size}-title { - font-size: 18px; + font-size: $height; line-height: $height; color: #000; font-weight: 500; @@ -53,7 +53,7 @@ $mgr: 8px; width: 4px; height: $height + 2px; border-radius: 1px; - margin-right: $mgr; + margin-right: 4px; background-color: #0b58ff; } } diff --git a/src/views/equipment/base/alarm/Record/add-or-updata.vue b/src/views/equipment/base/alarm/Record/add-or-updata.vue deleted file mode 100644 index 77a5123b..00000000 --- a/src/views/equipment/base/alarm/Record/add-or-updata.vue +++ /dev/null @@ -1,195 +0,0 @@ - - - - diff --git a/src/views/equipment/base/alarm/Record/index.vue b/src/views/equipment/base/alarm/Record/index.vue index 9cb27907..12b40011 100644 --- a/src/views/equipment/base/alarm/Record/index.vue +++ b/src/views/equipment/base/alarm/Record/index.vue @@ -45,20 +45,23 @@ :disabled="mode == 'detail'" :has-files="false" :rows="rows" /> --> - +