@@ -26,11 +26,20 @@ export const useWarningListStore = defineStore('warningListStore', () => {
|
|||||||
console.error('获取消息列表失败', error);
|
console.error('获取消息列表失败', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
async function handleAction(ids: string | number | Array<string | number>) {
|
||||||
|
try {
|
||||||
|
await updateDemo(ids);
|
||||||
|
await getWarningList();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('处理告警失败', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 核心点:必须把需要暴露出去的变量和方法 return 出去!
|
// 核心点:必须把需要暴露出去的变量和方法 return 出去!
|
||||||
return {
|
return {
|
||||||
warningList,
|
warningList,
|
||||||
warningListTotal,
|
warningListTotal,
|
||||||
getWarningList
|
getWarningList,
|
||||||
|
handleAction
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user