feat(System Variables): There is only one option when selecting a variable; you do not need to select it again.

This commit is contained in:
dataeaseShu
2026-08-26 10:04:38 +08:00
committed by dataeaseShu
parent 774f19caf3
commit 84868594d1
+9
View File
@@ -386,6 +386,7 @@
<el-select
v-model="state.form.system_variables[index].variableId"
style="width: 236px"
@change="handleVariableChange(index)"
:placeholder="$t('datasource.Please_select')"
>
<el-option
@@ -686,6 +687,14 @@ const getVariableOptionList = (variableId: string) => {
return []
}
const handleVariableChange = (index: number) => {
state.form.system_variables[index].variableValues = []
const variable = variableValueMap.value[state.form.system_variables[index].variableId]
if (variable && variable.value.length === 1) {
state.form.system_variables[index].variableValues = [variable.value[0]]
}
}
const getSelectedKeysFromStoredValues = (variableId: string, storedValues: any[] = []) => {
const variable = getVariableDefinition(variableId)
if (!variable || variable.var_type !== 'kv') return storedValues