| | |
| | | <el-form-item > |
| | | <!-- <el-button :icon="RefreshRight" @click="resetForm"></el-button> |
| | | <el-button class="search-btn" :icon="Search" @click="handleSearch"></el-button> --> |
| | | <el-button :icon="Download" color="#4C34FF" @click="handleBatchDownload">下载</el-button> |
| | | <el-button :icon="Download" color="#4C34FF" :loading="exportLoading" :disabled="exportLoading" @click="handleBatchDownload">下载</el-button> |
| | | |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | const selectedRows = ref([]) |
| | | const patrolTaskList = ref([]) |
| | | const dictObj = inject('dictObj') |
| | | |
| | | // 导出加载状态 |
| | | const exportLoading = ref(false) |
| | | // 获取巡查任务列表 |
| | | async function getPatrolTaskList() { |
| | | try { |
| | |
| | | ElMessage.warning('暂无数据可下载') |
| | | return |
| | | } |
| | | exportLoading.value = true |
| | | try { |
| | | const res = await gdTaskResultDownloadApi({ ids: row.id }) |
| | | const blob = res.data |
| | |
| | | } catch (error) { |
| | | console.error('下载失败:', error) |
| | | ElMessage.error('下载失败') |
| | | }finally { |
| | | exportLoading.value = false |
| | | } |
| | | } |
| | | |
| | |
| | | return |
| | | } |
| | | const ids = selectedRows.value.map(row => row.id).join(',') |
| | | exportLoading.value = true |
| | | try { |
| | | const res = await gdTaskResultDownloadApi({ ids }) |
| | | const blob = res.data |
| | |
| | | } catch (error) { |
| | | console.error('下载失败:', error) |
| | | ElMessage.error('下载失败') |
| | | } finally { |
| | | exportLoading.value = false |
| | | } |
| | | } |
| | | |