From 27087cf06cc50699e2b89fff1060486cf0e84379 Mon Sep 17 00:00:00 2001 From: wjt <1797368093@qq.com> Date: 星期三, 14 八月 2024 17:11:39 +0800 Subject: [PATCH] 批量下载图片 --- src/utils/request.ts | 1 + src/api/system/company/company.ts | 10 +++++++++- src/views/infomanger/companymanger/components/createQrcode.vue | 1 - src/views/infomanger/companymanger/index.vue | 26 ++++++++++++++++++++++---- 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/api/system/company/company.ts b/src/api/system/company/company.ts index b5f4244..79d283e 100644 --- a/src/api/system/company/company.ts +++ b/src/api/system/company/company.ts @@ -349,4 +349,12 @@ url: `/enforce/company/log/${data.delId}`, method: 'DELETE', }) -} \ No newline at end of file +} + +// // downloadQrcode +// export function downloadQrcode(data) { +// return request({ +// url: '/system/company/downloadQrcode', +// method: 'get' +// }) +// } \ No newline at end of file diff --git a/src/utils/request.ts b/src/utils/request.ts index b939337..b399f84 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -150,6 +150,7 @@ ...config, }) .then(async (data) => { + // console.log(data, 'data===') const isBlob = blobValidate(data); if (isBlob) { const blob = new Blob([data]); diff --git a/src/views/infomanger/companymanger/components/createQrcode.vue b/src/views/infomanger/companymanger/components/createQrcode.vue index 87aa2da..fe492f9 100644 --- a/src/views/infomanger/companymanger/components/createQrcode.vue +++ b/src/views/infomanger/companymanger/components/createQrcode.vue @@ -3,7 +3,6 @@ <div class="text-center"> <vueQr ref="query" background="#fff" :text="info.companyCode"></vueQr> <div style="font-weight: bold;margin-bottom: 10px;">娌堜笜鎯犱紒鎵ф硶</div> - <div>{{ info.companyName }}</div> <div style="margin-top: 10px;"> <el-link @click="downImage" type="primary">涓嬭浇浼佷笟鐮�</el-link> diff --git a/src/views/infomanger/companymanger/index.vue b/src/views/infomanger/companymanger/index.vue index 824726b..f36a99b 100644 --- a/src/views/infomanger/companymanger/index.vue +++ b/src/views/infomanger/companymanger/index.vue @@ -39,7 +39,10 @@ <el-button type="primary" plain icon="Plus" @click="handleAdd()" v-hasPermi="['system:dept:add']">鏂板</el-button> </el-col> <el-col :span="1.5"> - <el-button type="primary" plain icon="Download" @click="exportExcel" v-hasPermi="['system:dept:add']">瀵煎叆</el-button> + <el-button type="primary" plain icon="Upload" @click="exportExcel" v-hasPermi="['system:dept:add']">瀵煎叆</el-button> + </el-col> + <el-col :span="1.5"> + <el-button type="primary" plain icon="Download" @click="downLoadCode">涓嬭浇浼佷笟鐮�</el-button> </el-col> <!-- <el-col :span="1.5"> <el-button type="primary" plain icon="Plus" @click="exportRecordComOpen" v-hasPermi="['system:dept:add']">瀵煎叆璁板綍</el-button> @@ -139,11 +142,12 @@ import exportRecord from './components/exportRecord' import createQrcode from './components/createQrcode' import judgeCom from './components/judge' -import { listCompany,addCompany, updStatus, delCompany, updateCompany } from "@/api/system/company/company"; +import { listCompany,addCompany, updStatus, delCompany, updateCompany, getCompany } from "@/api/system/company/company"; import exportExcelCom from './components/export' import { computed } from "vue"; import { judgeStatus, companyStatus, scopeList } from '@/utils/mapList/index.ts' import useSettingsStore from "@/store/modules/settings"; +import { download } from '@/utils/request'; // 涓嬭浇鏂囦欢 const thcolor = computed(() => useSettingsStore().theme); const { proxy } = getCurrentInstance(); const { sys_normal_disable } = proxy.useDict("sys_normal_disable"); @@ -270,18 +274,26 @@ queryRef.value.resetFields(); handleQuery(); } +function getDetails(id) { + getCompany(id).then((response) => { + form.value = response.data; + open.value = true; + // title.value = "鏌ョ湅浼佷笟"; + }); +} /** 鏂板鎸夐挳鎿嶄綔 */ function handleAdd(row) { if(row) { - form.value = row + // form.value = row title.value = "缂栬緫浼佷笟"; + getDetails(row.companyId) } else { form.value = { companyStatus: 0 } title.value = "娣诲姞浼佷笟"; + open.value = true; } - open.value = true; } /** 鎻愪氦鎸夐挳 */ @@ -345,7 +357,13 @@ function createQrcodeHandler(row) { createQrcodeRef.value.openDialog(row) } +function downLoadCode() { + download('/system/company/downloadQrcode', queryParams.value, "浼佷笟鍥剧墖.zip") +} getList(); +function selectableFun(e) { + console.log(e) +} </script> <style scoped lang="scss"> -- Gitblit v1.9.1