Skip to content

Commit

Permalink
fix: WebUI 跑团 Log 管理批量选中删除, 每个选中目标需要单独确认 sealdice/sealdice-core#417 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
f44r authored Dec 28, 2023
1 parent 52c0076 commit f43cec6
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions src/components/mod/PageStory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ async function searchLogs() {
createdTimeEnd: queryLogPage.value.createdTime?.[1] ? dayjs(queryLogPage.value.createdTime?.[1]).endOf('date').unix() : undefined,
}
const page = await getLogPage(params)
logs.value = page as any
logs.value = page as unknown as Log[]
}
async function refreshLogs() {
[sum_log.value, sum_item.value, cur_log.value, cur_item.value] = await getInfo()
logs.value = await getLogPage(queryLogPage.value) as any
logs.value = await getLogPage(queryLogPage.value) as unknown as Log[] || []
ElMessage({
message: '刷新日志列表完成',
type: 'success',
Expand Down Expand Up @@ -150,7 +150,7 @@ async function DelLog(v: Log, flag = true) {
} else {
ElMessage({
message: '删除失败',
type: 'success',
type: 'error',
})
}
})
Expand All @@ -173,10 +173,21 @@ async function DelLogs() {
}
}
for (const v of ls) {
DelLog(v, false)
let info = await delLog(v)
if (info === true) {
ElMessage({
message: '删除成功',
type: 'success',
})
} else {
ElMessage({
message: '删除失败',
type: 'error',
})
}
}
await refreshLogs()
})
await refreshLogs()
})
}
async function UploadLog(v: Log) {
Expand Down Expand Up @@ -204,13 +215,13 @@ async function openItem(log: Log) {
pageSize: logItemPage.value.pageSize,
logName: logItemPage.value.logName,
groupId: logItemPage.value.groupId,
}) as any
}) as unknown as Item[]
mode.value = 'items'
}
const handleItemPageChange = async (val: number) => {
logItemPage.value.pageNum = val
item_data.value = await getItemPage(logItemPage.value) as any
item_data.value = await getItemPage(logItemPage.value) as unknown as Item[]
}
function closeItem() {
Expand Down Expand Up @@ -294,7 +305,7 @@ onBeforeMount(() => {
<ElButton size="small" type="primary" :icon="Upload" plain @click="UploadLog(i)">提取日志
</ElButton>
<ElButton size="small" type="danger" :icon="Delete" plain
@click="DelLog(i); console.log('---')">删除
@click="DelLog(i);">删除
</ElButton>
</el-space>
</div>
Expand Down

0 comments on commit f43cec6

Please sign in to comment.