feat: 右上角活动告警数
This commit is contained in:
28
src/store/modules/alarm.ts
Normal file
28
src/store/modules/alarm.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { getActiveAlarmTotal } from '@/api/faultManage/actAlarm';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
/**告警数据信息类型 */
|
||||
type Alarm = {
|
||||
/**活动告警数据值 */
|
||||
activeAlarmTotal: number;
|
||||
};
|
||||
|
||||
const useAlarmStore = defineStore('alarm', {
|
||||
state: (): Alarm => ({
|
||||
activeAlarmTotal: 0,
|
||||
}),
|
||||
getters: {},
|
||||
actions: {
|
||||
// 获取活动告警数
|
||||
async fnGetActiveAlarmInfo() {
|
||||
const res = await getActiveAlarmTotal();
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
this.activeAlarmTotal = res.data;
|
||||
}
|
||||
return res;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export default useAlarmStore;
|
||||
Reference in New Issue
Block a user