From 026f17ebafb85250d9ae9b71b80ae5f07341c172 Mon Sep 17 00:00:00 2001 From: feiyu02 <risaku@163.com> Date: 星期四, 15 五月 2025 16:33:12 +0800 Subject: [PATCH] 动态溯源功能初步完成 --- src/components/monitor/FactorRadio.vue | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/components/monitor/FactorRadio.vue b/src/components/monitor/FactorRadio.vue index 262228b..e95e72d 100644 --- a/src/components/monitor/FactorRadio.vue +++ b/src/components/monitor/FactorRadio.vue @@ -17,16 +17,20 @@ export default { props: { + modelValue: { + type: String, + default: defaultOptions(TYPE0).value + }, deviceType: { type: String, // type0: 杞﹁浇鎴栨棤浜烘満; type1:鏃犱汉鑸� default: TYPE0 } }, - emits: ['change'], + emits: ['change', 'update:modelValue'], data() { return { - radio: defaultOptions(TYPE0) + radio: defaultOptions(TYPE0).value }; }, computed: { @@ -38,12 +42,20 @@ deviceType(nV, oV) { if (nV != oV) { this.radio = this.options[0].value; + this.$emit('update:modelValue', this.radio) + } + }, + modelValue(nV, oV){ + if (nV != oV) { + this.radio = nV } } }, methods: { handleChange(value) { - this.$emit('change', value); + const item = this.options.find((v) => v.value == value); + this.$emit('change', item.value, item); + this.$emit('update:modelValue', item.value) // todo 鍦板浘3d鍥惧儚鍒囨崲灞曠ず鐩戞祴鍥犲瓙 } } -- Gitblit v1.9.3