diff --git a/src/store/modules/warnningList.ts b/src/store/modules/warnningList.ts index 29e80ed..be62ebf 100644 --- a/src/store/modules/warnningList.ts +++ b/src/store/modules/warnningList.ts @@ -26,11 +26,20 @@ export const useWarningListStore = defineStore('warningListStore', () => { console.error('获取消息列表失败', error); } } + async function handleAction(ids: string | number | Array) { + try { + await updateDemo(ids); + await getWarningList(); + } catch (error) { + console.error('处理告警失败', error); + } + } // 核心点:必须把需要暴露出去的变量和方法 return 出去! return { warningList, warningListTotal, - getWarningList + getWarningList, + handleAction }; });