mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user