Commit 292ff35d by wusiyi

fear: podus批量下载新增批量删除

parent b330479d
......@@ -481,7 +481,7 @@ export function batchDownloadDownloadApi(params: { id: number; type: string }) {
}
// 批量下载 删除
export function batchDownloadDeleteApi(params: { id: number }) {
export function batchDownloadDeleteApi(params: { ids?: string }) {
return axios.get<never, BaseRespData<never>>(
`factory/podUsBatchDownload/delete`,
{
......
......@@ -577,6 +577,11 @@
<span v-if="status === 'COMPLETE'" class="item">
<ElButton type="success" @click="exportData">导出</ElButton>
</span>
<span v-if="status === 'BATCH_DOWNLOAD'" class="item">
<ElButton type="danger" @click="handleBatchDelete('batch')"
>批量删除</ElButton
>
</span>
</ElFormItem>
</ElForm>
</div>
......@@ -1384,7 +1389,11 @@
</ElButton>
</span>
<span class="operate-item">
<ElButton link type="danger" @click="handleBatchDelete(row)">
<ElButton
link
type="danger"
@click="handleBatchDelete('single', row.id)"
>
删除
</ElButton>
</span>
......@@ -2622,7 +2631,11 @@ const handleDownload = async (row: PodUsOrderListData, type: string) => {
}
}
// 批量下载 删除
const handleBatchDelete = async (row: PodUsOrderListData) => {
const handleBatchDelete = async (type: string, id?: string) => {
if (type === 'batch' && selection.value.length === 0) {
ElMessage.error('请选择要删除的数据')
return
}
try {
await showConfirm('确定删除吗?', {
confirmButtonText: '确认',
......@@ -2638,7 +2651,12 @@ const handleBatchDelete = async (row: PodUsOrderListData) => {
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await batchDownloadDeleteApi({ id: row.id })
const res = await batchDownloadDeleteApi({
ids:
type === 'batch'
? selection.value.map((item) => item.id).join(',')
: id,
})
if (res.code !== 200) return
ElMessage.success(res.message)
search()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment