Merge branch 'develop'
This commit is contained in:
@@ -56,4 +56,15 @@ const updateLabelAndTag = async () => {
|
||||
watch([() => props.code, () => props.modelValue], updateLabelAndTag);
|
||||
|
||||
onMounted(updateLabelAndTag);
|
||||
|
||||
// 监听WebSocket字典更新事件,强制刷新标签
|
||||
watch(
|
||||
() => dictStore.getDictItems(props.code || ""),
|
||||
async () => {
|
||||
if (props.code) {
|
||||
await updateLabelAndTag();
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
@@ -23,12 +23,7 @@
|
||||
:style="style"
|
||||
@change="handleChange"
|
||||
>
|
||||
<el-radio
|
||||
v-for="option in options"
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
>
|
||||
<el-radio v-for="option in options" :key="option.value" :value="option.value">
|
||||
{{ option.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
@@ -40,12 +35,7 @@
|
||||
:style="style"
|
||||
@change="handleChange"
|
||||
>
|
||||
<el-checkbox
|
||||
v-for="option in options"
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
>
|
||||
<el-checkbox v-for="option in options" :key="option.value" :value="option.value">
|
||||
{{ option.label }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
@@ -130,4 +120,13 @@ onMounted(async () => {
|
||||
await dictStore.loadDictItems(props.code);
|
||||
options.value = dictStore.getDictItems(props.code);
|
||||
});
|
||||
|
||||
// 监听字典数据变化,确保WebSocket更新时刷新选项
|
||||
watch(
|
||||
() => dictStore.getDictItems(props.code),
|
||||
(newItems) => {
|
||||
options.value = newItems;
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user