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 {