Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: WebUI 跑团 Log 管理批量选中删除, 每个选中目标需要单独确认 https://github.com/sealdice/sealdice-core/issues/417 #121

Merged
merged 1 commit into from
Dec 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading