Explorar o código

1.查看简介

zhangym %!s(int64=2) %!d(string=hai) anos
pai
achega
9ca64d6065

+ 52 - 0
src/views/energyOperationSupport/components/securitys/pic2.vue

@@ -16,6 +16,10 @@
               <el-checkbox v-model="searchParam.radioItemStatus" @change="isShowItemStatus">显示状态</el-checkbox>
             </el-col>
 
+            <el-col :span="2" class="mt10">
+              <el-checkbox  @change="isShowItemStatus">显示简介</el-checkbox>
+            </el-col>
+
             <div class="crumb-nav2">
               <template v-for="(nav, index) in crumbNavs">
                 {{ index > 0 ? '>' : '' }}
@@ -1251,6 +1255,54 @@ export default {
           }).catch(function () {
           });
       }
+    },
+       //预览简介
+       previewstart(data) {
+      let that = this;
+      that.loading = true;
+      that.chart.fileData = data;
+      let SubmitData = {
+        fileName: '简介.docx',
+        fileUrl: '/安泰控股集团/集团/2023/05/25/1684977494620440.docx'
+      };
+      let urla = 'pass/ems/v1/uploadfiles/getfile/';
+      let type = 'text/html';
+      let responseType = 'application/json';
+      if (data.filename !== null) {
+        let fileExtension = data.filename.substring(data.filename.lastIndexOf('.') + 1);
+        if (fileExtension === 'pdf') {
+          urla = 'pass/ems/v1/uploadfiles/downloadFile/';
+          type = 'application/pdf';
+          responseType = 'blob';
+        }
+        that.axios.get(urla, {
+          params: SubmitData,
+          responseType: responseType
+        }).then(function (res) {
+          let urlObject = window.URL || window.webkitURL || window;
+          // 将二进制流转为blob
+          let blob = new Blob([res], {
+            type: type
+          });
+          if (fileExtension !== 'pdf') {
+            blob = new Blob([res.data], {
+              type: type
+            });
+          }
+          let blobURL = urlObject.createObjectURL(blob);
+          that.dialogVisible = true;
+          that.previewUrl = blobURL;
+          that.tableLoading = false;
+          that.loading = false;
+          setTimeout(() => {
+            urlObject.revokeObjectURL(blobURL);
+          }, 1000)
+        }).catch(function () {
+          that.$message.error('预览失败');
+          that.loading = true;
+        })
+      }
+
     },
     //预览文件
     preview(data) {