Skip to content

Commit 812d7f8

Browse files
committed
fix(System Variables): The key-value type system variable has only one option, and an empty option will be available when selecting it.
1 parent 1fdc28b commit 812d7f8

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

frontend/src/views/system/user/User.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,8 @@
386386
<el-select
387387
v-model="state.form.system_variables[index].variableId"
388388
style="width: 236px"
389-
@change="handleVariableChange(index)"
390389
:placeholder="$t('datasource.Please_select')"
390+
@change="handleVariableChange(index)"
391391
>
392392
<el-option
393393
v-for="item in variables"
@@ -691,7 +691,13 @@ const handleVariableChange = (index: number) => {
691691
state.form.system_variables[index].variableValues = []
692692
const variable = variableValueMap.value[state.form.system_variables[index].variableId]
693693
if (variable && variable.value.length === 1) {
694-
state.form.system_variables[index].variableValues = [variable.value[0]]
694+
if (variable.var_type === 'kv') {
695+
state.form.system_variables[index].variableValues = [
696+
getVariableOptionList(state.form.system_variables[index].variableId)[0].label,
697+
]
698+
} else {
699+
state.form.system_variables[index].variableValues = [variable.value[0]]
700+
}
695701
}
696702
}
697703

0 commit comments

Comments
 (0)