决策信息时间修改

This commit is contained in:
joylink_zhaoerwei 2023-09-19 16:51:00 +08:00
parent 421fa1e545
commit 3ade4996d3

View File

@ -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<string, number>();
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,