fix: 告警列表类型改字典
This commit is contained in:
@@ -8,7 +8,7 @@ import { ColumnsType } from 'ant-design-vue/lib/table';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import useNeInfoStore from '@/store/modules/neinfo';
|
||||
import {
|
||||
addPerfThre,
|
||||
@@ -19,18 +19,15 @@ import {
|
||||
threStop,
|
||||
threRun,
|
||||
} from '@/api/perfManage/perfThreshold';
|
||||
import { regExpIPv4 } from '@/utils/regular-utils';
|
||||
const { getDict } = useDictStore();
|
||||
const { t, currentLocale } = useI18n();
|
||||
|
||||
/**表格所需option */
|
||||
const perfThresholdOption = reactive({
|
||||
origSeverity: [
|
||||
{ label: t('views.faultManage.activeAlarm.critical'), value: 'Critical' },
|
||||
{ label: t('views.faultManage.activeAlarm.major'), value: 'Major' },
|
||||
{ label: t('views.faultManage.activeAlarm.minor'), value: 'Minor' },
|
||||
{ label: t('views.faultManage.activeAlarm.warning'), value: 'Warning' },
|
||||
{ label: t('views.faultManage.activeAlarm.eventAlarm'), value: 'Event' },
|
||||
],
|
||||
/**字典数据 */
|
||||
let dict: {
|
||||
/**原始严重程度 */
|
||||
activeAlarmSeverity: DictType[];
|
||||
} = reactive({
|
||||
activeAlarmSeverity: [],
|
||||
});
|
||||
|
||||
/**查询参数 */
|
||||
@@ -469,6 +466,13 @@ function fnTaskModalVisible(type: string | number, row: Record<string, any>) {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 初始字典数据
|
||||
Promise.allSettled([getDict('active_alarm_severity')]).then(resArr => {
|
||||
if (resArr[0].status === 'fulfilled') {
|
||||
dict.activeAlarmSeverity = resArr[0].value;
|
||||
}
|
||||
});
|
||||
|
||||
Promise.allSettled([
|
||||
// 获取网元网元列表
|
||||
useNeInfoStore().fnNelist(),
|
||||
@@ -705,7 +709,7 @@ onMounted(() => {
|
||||
<a-select
|
||||
v-model:value="modalState.from.origSeverity"
|
||||
style="width: 100%"
|
||||
:options="perfThresholdOption.origSeverity"
|
||||
:options="dict.activeAlarmSeverity"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
|
||||
Reference in New Issue
Block a user