Merge branch 'develop'

This commit is contained in:
Ray.Hao
2025-04-24 23:59:19 +08:00
14 changed files with 1275 additions and 70 deletions

View File

@@ -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>

View File

@@ -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>