diff --git a/src/pages/DecisionInfoManage.vue b/src/pages/DecisionInfoManage.vue index 7c1a028..36b521e 100644 --- a/src/pages/DecisionInfoManage.vue +++ b/src/pages/DecisionInfoManage.vue @@ -168,10 +168,7 @@ import { saveAlertTypeData, } from 'src/components/alarm/alarmInfoEnum'; import { ApiError } from 'src/boot/axios'; -import { - alarmTipTimeConfigPageQuery, - ShowTipTimeConfig, -} from 'src/api/AlarmTipTimeConfig'; +import { ShowTipTimeConfig, TipTimeConfig } from 'src/api/AlarmTipTimeConfig'; const $q = useQuasar(); @@ -288,7 +285,6 @@ const onRequest: QTable['onRequest'] = async (props) => { onMounted(() => { setTimeout(() => { tableRef.value.requestServerInteraction(); - searchTimeConfigList(); }); }); @@ -356,27 +352,6 @@ async function searchLocationType() { } const optionsTimeType = ['早高峰', '晚高峰', '低峰']; -const optionsTimeTypeMap = new Map(); - -async function searchTimeConfigList() { - try { - let response = await alarmTipTimeConfigPageQuery({ - current: 1, - size: 50, - }); - response.records.forEach((timeConfig) => { - optionsTimeTypeMap.set( - (ShowTipTimeConfig as never)[timeConfig.timeType], - timeConfig.id as number - ); - }); - } catch (error) { - $q.notify({ - type: 'negative', - message: '无法获取时间配置列表', - }); - } -} function onCreate() { myForm.value?.validate().then(async (res) => { @@ -390,11 +365,9 @@ function onCreate() { break; } } - const tipTimeIds: number[] = []; + const tipTimeIds: string[] = []; creatForm.tipTimeIds.forEach((tipTimeId) => { - tipTimeIds.push( - optionsTimeTypeMap.get(tipTimeId as string) as number - ); + tipTimeIds.push((TipTimeConfig as never)[tipTimeId + '']); }); const params = { id: +creatForm.id,