From 61a6e7dafb356298a1314515f097dae17f40b6c8 Mon Sep 17 00:00:00 2001 From: lb Date: Fri, 4 Aug 2023 11:23:26 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=9B=B4=E6=96=B0dialogForm=E7=9A=84?= =?UTF-8?q?=E5=85=B3=E8=81=94=E7=9B=91=E5=90=AC=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/quality/components/dialogForm.vue | 17 ++++++++++++++++- .../qualityInspectionRecord/index.vue | 15 +++++++++------ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/views/quality/components/dialogForm.vue b/src/views/quality/components/dialogForm.vue index e5dbc6e5..4a6b3f7d 100644 --- a/src/views/quality/components/dialogForm.vue +++ b/src/views/quality/components/dialogForm.vue @@ -130,10 +130,25 @@ export default { const promiseList = []; this.rows.forEach((cols) => { cols.forEach(async (opt) => { + if (opt.onChange) { + this.$watch(`form.${opt.prop}`, { + handler: (val) => { + this.$emit(opt.onChange.emit, val); + }, + immediate: true, + }); + } + if (opt.listen) { + // 注册监听时间 + this.$on(opt.listen, (val) => { + alert(val); + }); + } if (opt.value) { // 默认值 this.form[opt.prop] = opt.value; } + if (opt.options) { this.optionListOf[opt.prop] = opt.options; } else if (opt.url) { @@ -184,7 +199,7 @@ export default {