Browse Source

大屏 界面修改

zhanghao 2 months ago
parent
commit
322bcd34ec

+ 12 - 0
src/api/zcustom/issue.js

@@ -51,3 +51,15 @@ export function delIssue(id) {
     method: 'get'
   })
 }
+
+// 下载附件
+export function downloadFile(imagePath) {
+  return request({
+    url: '/zcustom/issue/downloadFile',
+    method: 'get',
+    params: {
+      filePath: imagePath
+    },
+    responseType: 'blob'
+  })
+}

+ 2 - 2
src/views/pad/engineering/currentArea.vue

@@ -195,9 +195,9 @@ export default {
         if (scrollContainer.scrollTop >= scrollContainer.scrollHeight - scrollContainer.clientHeight) {
           scrollContainer.scrollTop = 0;
         }
-        this.scrollTimeout = setTimeout(scroll, 30);
+        this.scrollTimeout = setTimeout(scroll, 600);
       };
-      this.scrollTimeout = setTimeout(scroll, 30);
+      this.scrollTimeout = setTimeout(scroll, 600);
     },
     co(){
       console.log(this.getProjecList)

+ 6 - 6
src/views/screen/engineering/monitorLive.vue

@@ -182,12 +182,12 @@ export default {
     shot() {
       console.log(this.videoObj,'========================aaa');
       console.log("视频播放编号", this.code);
-      if (!this.videoObj)
-        return;
-      this.videoObj.capture({
-         winNum: this.winNum,
-         code: this.monitorInfo.cameraCode,
-       });
+      // if (!this.videoObj)
+      //   return;
+      // this.videoObj.capture({
+      //    winNum: this.winNum,
+      //    code: this.monitorInfo.cameraCode,
+      //  });
       this.imgSrc=this.fileName
       this.issue(this.imgSrc)
 

+ 20 - 2
src/views/zcustom/issue/index.vue

@@ -98,7 +98,7 @@
           <el-input type="textarea" v-model="form.need" readonly/>
         </el-form-item>
         <el-form-item label="附件" prop="imagePath">
-          <el-button @click="downloadImage()" v-if=""></el-button>
+          <el-button @click="downloadSth(form.imagePath)" v-if="form.imagePath != null" type="info">下载附件</el-button>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -110,7 +110,7 @@
 </template>
 
 <script>
-import { listIssue, getIssue, delIssue, addIssue, updateIssue } from "@/api/zcustom/issue";
+import { addIssue, delIssue, downloadFile, getIssue, listIssue, updateIssue } from '@/api/zcustom/issue'
 import { listProject } from '@/api/zcustom/project'
 
 export default {
@@ -266,6 +266,24 @@ export default {
         this.$modal.msgSuccess("删除成功");
       }).catch(() => {});
     },
+
+    downloadSth(imagePath){
+      return downloadFile(imagePath).then(response => {
+        // 解析返回的文件流并触发下载
+        const blob = new Blob([response], { type: 'application/octet-stream' });
+        const url = window.URL.createObjectURL(blob);
+        const link = document.createElement('a');
+        link.href = url;
+        // 设置下载文件名(从文件路径中提取文件名)
+        const fileName = imagePath.split('/').pop();
+        link.download = fileName;  // 设置下载的文件名
+        link.click();  // 触发点击事件,下载文件
+        window.URL.revokeObjectURL(url);  // 释放 URL 对象,防止内存泄漏
+      }).catch(error => {
+        console.error('文件下载失败:', error);
+      });
+    }
+
   }
 };
 </script>