zhuwei 1 рік тому
батько
коміт
5bb76ac1ed

+ 9 - 0
src/api/modules/other-file/imageData.js

@@ -98,6 +98,15 @@ export default {
             responseType: 'blob',
         })
     },
+    //下载pdf
+    async batchDownloadFPDFFileToZip(form) {
+        return HcApi({
+            url: '/api/blade-business/imageClassificationFile/batchDownloadPDFFileToZip',
+            method: 'post',
+            params: form,
+            responseType: 'blob',
+        })
+    },
     //接口获取题名
     async getFileTitleName(form) {
         return HcApi({

+ 9 - 0
src/api/modules/tentative/device/approach.js

@@ -57,4 +57,13 @@ export default {
             data: form,
         })
     },
+    //下载模板
+    async downloadExcel(form) {
+        return HcApi({
+            url: '/api/blade-business/device/use/export-template',
+            method: 'get',
+            responseType: 'blob',
+            params: form,
+        })
+    },
 }

+ 10 - 0
src/api/modules/tentative/device/employ.js

@@ -41,4 +41,14 @@ export default {
             data: form,
         })
     },
+
+    //下载模板
+    async downloadExcel(form) {
+        return HcApi({
+            url: '/api/blade-business/device/use/export-template',
+            method: 'get',
+            responseType: 'blob',
+            params: form,
+        })
+    },
 }

+ 2 - 2
src/config/index.json

@@ -1,7 +1,7 @@
 {
     "version": "20230607160059",
-    "target1": "http://127.0.0.1:8090",
-    "target": "http://39.108.216.210:8090",
+    "target": "http://127.0.0.1:8090",
+    "target11": "http://39.108.216.210:8090",
     "target3": "http://192.168.0.125:8090",
     "target4": "http://183.247.216.148:28090",
     "socket1": "wss://measure.hczcxx.cn/websocket",

+ 39 - 1
src/views/other-file/image-view.vue

@@ -45,9 +45,20 @@
                             @click="downloadClick"
                         >
                             <HcIcon name="download" />
-                            <span>下载</span>
+                            <span>下载图片</span>
                         </el-button>
                     </HcTooltip>
+
+                    <HcTooltip keys="image-data-download">
+                        <el-button
+                            :disabled="tableCheckedKeys.length <= 0" :loading="downPdfLoading" hc-btn
+                            @click="downloadPdfClick"
+                        >
+                            <HcIcon name="download" />
+                            <span>下载PDF</span>
+                        </el-button>
+                    </HcTooltip>
+
                     <HcTooltip keys="image-data-del">
                         <el-button
                             :disabled="tableCheckedKeys.length <= 0" :loading="delLoading" hc-btn
@@ -457,6 +468,33 @@ const downloadClick = async () => {
     }
 }
 
+
+//下载PDF
+const downPdfLoading = ref(false)
+const downloadPdfClick = async () => {
+    const rows = tableCheckedKeys.value
+    if (rows.length > 0) {
+        downPdfLoading.value = true
+        const ids = arrToId(rows)
+        const { error, disposition, res } = await imageApi.batchDownloadFPDFFileToZip({ ids: ids }, false)
+        //判断状态
+        if (!error) {
+            if (disposition) {
+
+                downloadBlob(res, disposition)
+
+            } else {
+                window.$message?.error('下载异常')
+            }
+        }
+        downPdfLoading.value = false
+    } else {
+        window.$message?.warning('请先勾选需要下载的资料文件')
+    }
+}
+
+
+
 //删除文件
 const delLoading = ref(false)
 const delClick = () => {

+ 18 - 2
src/views/tentative/device/approach.vue

@@ -263,7 +263,7 @@ import { useAppStore } from '~src/store'
 import { HcIsButton } from '~src/plugins/IsButtons'
 import HcDragUpload from './components/HcDragUpload.vue'
 import approachApi from '~api/tentative/device/approach'
-import { arrToId, formValidate, getArrValue } from 'js-fast-way'
+import { arrToId, downloadBlob, formValidate, getArrValue } from 'js-fast-way'
 import { getContractUserList } from '~api/other'
 import { deviceClassListInit, getClassList } from '~api/tentative'
 import { HcDelMsg } from 'hc-vue3-ui'
@@ -577,6 +577,10 @@ const printerClick = async () => {
 const importModal = ref(false)
 const uploadData = ref({})
 const importModalClick = () => {
+    if(!searchForm.value?.deviceClassId){
+        window?.$message?.warning('请选择左边的数据')
+        return
+    }
     tableImportData.value = []
     uploadData.value = { classNameId: menuKey.value }
     importModal.value = true
@@ -636,6 +640,7 @@ const tableImportData = ref([])
 //多选
 const tableImportKeys = ref([])
 const tableImportSelection = (rows) => {
+    rows.deviceClassName = menuItem.value.deviceClassName;
     tableImportKeys.value = rows
 }
 
@@ -717,8 +722,19 @@ const addEditFormClick = async () => {
 }
 
 //下载导入模板
+const getdownloadExcel = async ()=>{
+    const { error, disposition, res } = await approachApi.downloadExcel()
+    if (!error) {
+        if (disposition) {
+            downloadBlob(res, disposition)
+        } else {
+            window.$message?.error('数据异常')
+        }
+    }
+}
+
 const downloadImportClick = () => {
-    window.open('https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20221109/2be4f32d07f9dd3e43479038b0c4aa2d.xlsx', '_blank')
+    getdownloadExcel()
 }
 
 //左右拖动,改变树形结构宽度

+ 16 - 3
src/views/tentative/device/employ.vue

@@ -204,13 +204,14 @@
 
 <script setup>
 import { onMounted, ref, watch } from 'vue'
+import wbsApi from '~api/data-fill/wbs'
 import { useAppStore } from '~src/store'
 import HcDragUpload from './components/HcDragUpload.vue'
 import HcSelectTree from './components/HcSelectTree.vue'
 import { deviceClassListInit, getClassList, getSampleInfo, queryDeviceList } from '~api/tentative'
 import { getContractUserList } from '~api/other'
 import dataApi from '~api/tentative/device/employ'
-import { arrToId, formValidate, getArrValue } from 'js-fast-way'
+import { arrToId, downloadBlob, formValidate, getArrValue } from 'js-fast-way'
 import { getRowsValue } from '~uti/tools'
 import { toPdfPage } from '~uti/btn-auth'
 
@@ -641,9 +642,21 @@ const addEditFormClick = async () => {
 
 
 //下载导入模板
-const downloadImportClick = () => {
-    window.open('https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20221109/aaafe6673c0338eeeba8ff537980e093.xlsx', '_blank')
+const getdownloadExcel = async ()=>{
+    const { error, disposition, res } = await dataApi.downloadExcel()
+    if (!error) {
+        if (disposition) {
+            downloadBlob(res, disposition)
+        } else {
+            window.$message?.error('数据异常')
+        }
+    }
 }
+//下载模板
+const downloadImportClick = ()=>{
+    getdownloadExcel()
+}
+
 
 //左右拖动,改变树形结构宽度
 const leftWidth = ref(240)