feat: 右上角活动告警数

This commit is contained in:
TsMask
2023-10-19 16:10:37 +08:00
parent a746d14c48
commit 820eca7bbe
4 changed files with 70 additions and 40 deletions

View 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;