|
@@ -9,9 +9,10 @@
|
|
|
</template>
|
|
|
<template #form-item-short>
|
|
|
<base-select
|
|
|
- v-model="shortQueryConfig"
|
|
|
+ v-model="shortQueryConfigIndex"
|
|
|
clearable
|
|
|
- :options="customQueryConfigList?.map((v) => ({ label: v.name, value: v.params }))"
|
|
|
+ value-key="secretNumber"
|
|
|
+ :options="customQueryConfigList?.map((v, i) => ({ label: v.name, value: i }))"
|
|
|
></base-select>
|
|
|
</template>
|
|
|
</base-form>
|
|
@@ -46,7 +47,7 @@ import type { ExtractApiParams } from '@/api/api'
|
|
|
|
|
|
const { push } = useRouter()
|
|
|
|
|
|
-const shortQueryConfig = ref<ExtractApiParams<'setCustomQueryConfig'>['params']>()
|
|
|
+const shortQueryConfigIndex = ref<number>()
|
|
|
|
|
|
const { subjectList, mainQuestionList, groupListWithAll, dataModel, changeModelValue } = useOptions([
|
|
|
'subject',
|
|
@@ -101,6 +102,13 @@ watch(
|
|
|
|
|
|
getCustomQueryConfigList()
|
|
|
|
|
|
+const shortQueryConfig = computed<ExtractApiParams<'setCustomQueryConfig'>['params'] | void>(() => {
|
|
|
+ if (shortQueryConfigIndex.value === undefined) {
|
|
|
+ return void 0
|
|
|
+ }
|
|
|
+ return customQueryConfigList?.value?.[shortQueryConfigIndex.value]?.params
|
|
|
+})
|
|
|
+
|
|
|
watch(shortQueryConfig, () => {
|
|
|
if (!shortQueryConfig.value) {
|
|
|
elFormRef?.value?.resetFields()
|
|
@@ -275,6 +283,7 @@ const onSetCustomQueryConfig = async () => {
|
|
|
})
|
|
|
toggleVisible(false)
|
|
|
elFormRef?.value?.resetFields()
|
|
|
+ shortQueryConfigIndex.value = void 0
|
|
|
getCustomQueryConfigList()
|
|
|
} catch (error) {
|
|
|
console.error(error)
|