Skip to content

Commit de3c635

Browse files
committed
feat(System Variables): There is only one option when selecting a variable; you do not need to select it again.
1 parent 774f19c commit de3c635

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@
386386
<el-select
387387
v-model="state.form.system_variables[index].variableId"
388388
style="width: 236px"
389+
@change="handleVariableChange(index)"
389390
:placeholder="$t('datasource.Please_select')"
390391
>
391392
<el-option
@@ -686,6 +687,14 @@ const getVariableOptionList = (variableId: string) => {
686687
return []
687688
}
688689
690+
const handleVariableChange = (index: number) => {
691+
state.form.system_variables[index].variableValues = []
692+
const variable = variableValueMap.value[state.form.system_variables[index].variableId]
693+
if (variable && variable.value.length === 1) {
694+
state.form.system_variables[index].variableValues = [variable.value[0]]
695+
}
696+
}
697+
689698
const getSelectedKeysFromStoredValues = (variableId: string, storedValues: any[] = []) => {
690699
const variable = getVariableDefinition(variableId)
691700
if (!variable || variable.var_type !== 'kv') return storedValues

0 commit comments

Comments
 (0)