(ids: string[])
| 155 | |
| 156 | // 批量删除页面 |
| 157 | export async function deletePages(ids: string[]): Promise<void> { |
| 158 | if (ids.length === 0) return |
| 159 | |
| 160 | const { page, message, tab } = stores |
| 161 | |
| 162 | // 清除消息缓存 |
| 163 | for (const id of ids) { |
| 164 | message.evict(id) |
| 165 | await useMessageQueueStore.getState().removeRecord(id) |
| 166 | } |
| 167 | |
| 168 | // 关闭对应的标签页 |
| 169 | const tabsToClose = tab.tabs.filter((t) => t.dataId && ids.includes(t.dataId)) |
| 170 | for (const existingTab of tabsToClose) { |
| 171 | tab.closeTab(existingTab.id) |
| 172 | } |
| 173 | |
| 174 | // 批量删除页面 |
| 175 | await page.deleteMany(ids) |
| 176 | } |
| 177 | |
| 178 | // 检查页面在目标文件夹是否重名 |
| 179 | export function checkPageNameConflict( |
no test coverage detected