dedsudiyu 1 year ago
parent
commit
eb95267f4d

+ 24 - 10
src/views/secureAccess/approval/infoPage.vue

@@ -43,7 +43,7 @@
           <div class="file_list"  v-for="(minItem,minIndex) in item.upList">
             <el-checkbox  @change="checkedImg(minItem)" v-if="isLook" >{{minItem.name}}</el-checkbox>
             <i v-if="!isLook" >{{minItem.name}}</i>
-            <i class="file_list_look" @click="lookFile(minItem)">查看</i>
+            <i class="file_list_look" @click="fullScreenFileLookClick(minItem)">查看</i>
             <i v-if="isLook" class="file_list_look" @click="handleExport(1,minItem)">下载</i>
           </div>
           <div class="item-title-box" v-if="item.materialType==2&&item.relationType==2"><i style="color: #F56C6C;">* </i>安全考试证书:<span style="color:#999;">(已同步证书信息)</span></div>
@@ -77,20 +77,22 @@
       </div>
     </el-dialog>
     <fullScreenView :fullScreenViewProps="fullScreenViewProps" ref="fullScreenView"></fullScreenView>
+    <fullScreenFileLook ref="fullScreenFileLook"></fullScreenFileLook>
   </div>
 </template>
 
 <script>
 let Base64 = require('js-base64').Base64;
-import { optionHazard, downloadwBatch, getDetails, laboratoryApply} from "@/api/secureAccess/index";
 //                      V3
 import { laboratoryApplyGetDetails,laboratoryApplyUpdate} from "@/api/secureAccess/index";
 import fullScreenView from "@/components/fullScreenView/fullScreenView.vue";
+import fullScreenFileLook from "@/components/fullScreenFileLook/fullScreenFileLook.vue";
 
 export default {
   name: "info-page",
   components: {
     fullScreenView,
+    fullScreenFileLook
   },
   props:{
     infoData: {},
@@ -145,15 +147,27 @@ export default {
       this.$refs['fullScreenView'].initialize();
     },
     //文件浏览
-    lookFile(item){
-      if(item.name.split('.')[1] == 'png' || item.name.split('.')[1] == 'jpg' || item.name.split('.')[1] == 'gif'){
-        this.fullScreenViewClick(item.url);
-      }else {
-        window.open(window.location.href.split('://')[0]+'://'+this.judgmentNetworkReturnAddress()+'/admin/'+item.url)
+    fullScreenFileLookClick(item){
+      //判断类型
+      let type = '';
+      if(item.name.split('.')[1] == 'doc' || item.name.split('.')[1] == 'docx'){
+        type = 'docx'
+      }else if(item.name.split('.')[1] == 'xls' || item.name.split('.')[1] == 'xlsx'){
+        type = 'excel'
+      }else if(item.name.split('.')[1] == 'pdf'){
+        type = 'pdf'
+      }else if(item.name.split('.')[1] == 'png' || item.name.split('.')[1] == 'jpg' || item.name.split('.')[1] == 'gif'){
+        type = 'img'
+      }
+      //整合地址
+      let url = window.location.href.split('://')[0]+'://'+localStorage.getItem('fileBrowseEnvironment')+item.url;
+      //判断图片还是文件
+      if(type == 'img'){
+        this.$set(this,'fullScreenViewProps',[url]);
+        this.$refs['fullScreenView'].initialize();
+      }else if(type == 'docx' || type == 'excel' || type == 'pdf'){
+        this.$refs['fullScreenFileLook'].initialize(item.name,url,type);
       }
-      // let visitUrl=window.location.href.split('://')[0]+'://'+process.env.VUE_APP_BASE_API+'/admin/'+item.url;
-      // window.open(localStorage.getItem('filePreviewUrl') + '/onlinePreview?url='+encodeURIComponent(Base64.encode(visitUrl)));
-
     },
     /** 下载 */
     handleExport(type,item) {

+ 24 - 8
src/views/secureAccess/handle/addPage.vue

@@ -168,7 +168,7 @@
                     <div class="item-input-for-min">
                       <p>{{minItem.name}}</p>
                       <!--                      <a class="file_list_look" :href="minItem.url" target="_blank">查看</a>-->
-                      <i style="font-style:normal;" @click="lookFile(minItem.url)">查看</i>
+                      <i style="font-style:normal;" @click="fullScreenFileLookClick(minItem)">查看</i>
                       <i style="font-style:normal;" @click="delUpData(item,minIndex)">删除</i>
                     </div>
                   </div>
@@ -180,6 +180,7 @@
       </el-form>
     </div>
     <fullScreenView :fullScreenViewProps="fullScreenViewProps" ref="fullScreenView"></fullScreenView>
+    <fullScreenFileLook ref="fullScreenFileLook"></fullScreenFileLook>
   </div>
 </template>
 
@@ -191,11 +192,13 @@
   import { laboratorySubRelInfoGetRelListByPower, systemUserSelectUser } from '@/api/commonality/permission'
   import { getToken } from '@/utils/auth'
   import fullScreenView from "@/components/fullScreenView/fullScreenView.vue";
+  import fullScreenFileLook from "@/components/fullScreenFileLook/fullScreenFileLook.vue";
 
   export default {
     name: 'addPage',
     components: {
       fullScreenView,
+      fullScreenFileLook
     },
     props: {
       infoData: {},
@@ -313,14 +316,27 @@
         this.$refs['fullScreenView'].initialize();
       },
       //文件浏览
-      lookFile(item) {
-        if(item.name.split('.')[1] == 'png' || item.name.split('.')[1] == 'jpg' || item.name.split('.')[1] == 'gif'){
-          this.fullScreenViewClick(item.url);
-        }else {
-          window.open(window.location.href.split('://')[0]+'://'+this.judgmentNetworkReturnAddress()+'/admin/'+item.url)
+      fullScreenFileLookClick(item){
+        //判断类型
+        let type = '';
+        if(item.name.split('.')[1] == 'doc' || item.name.split('.')[1] == 'docx'){
+          type = 'docx'
+        }else if(item.name.split('.')[1] == 'xls' || item.name.split('.')[1] == 'xlsx'){
+          type = 'excel'
+        }else if(item.name.split('.')[1] == 'pdf'){
+          type = 'pdf'
+        }else if(item.name.split('.')[1] == 'png' || item.name.split('.')[1] == 'jpg' || item.name.split('.')[1] == 'gif'){
+          type = 'img'
+        }
+        //整合地址
+        let url = window.location.href.split('://')[0]+'://'+localStorage.getItem('fileBrowseEnvironment')+item.url;
+        // 判断图片还是文件
+        if(type == 'img'){
+          this.$set(this,'fullScreenViewProps',[url]);
+          this.$refs['fullScreenView'].initialize();
+        }else if(type == 'docx' || type == 'excel' || type == 'pdf'){
+          this.$refs['fullScreenFileLook'].initialize(item.name,url,type);
         }
-        // var originUrl = window.location.href.split('://')[0] + '://' + this.judgmentNetworkReturnAddress() + '/admin/' + item //要预览文件的访问地址
-        // window.open(localStorage.getItem('filePreviewUrl') + '/onlinePreview?url=' + encodeURIComponent(Base64.encode(originUrl)))
       },
       /** 导师-懒加载 */
       systemUserSelectUser(query) {

+ 25 - 9
src/views/secureAccess/handle/infoPage.vue

@@ -64,7 +64,7 @@
             </div>
             <div class="file_list" v-for="(minItem,minIndex) in item.upList">
               <i >{{minItem.name}}</i>
-              <i class="file_list_look" @click="lookFile(minItem)">查看</i>
+              <i class="file_list_look" @click="fullScreenFileLookClick(minItem)">查看</i>
               <!--          <a class="file_list_look" :href="item2.dataUrl.split(';')[1].replace(/,/g,'')" target="_blank">查看</a>-->
             </div>
           </div>
@@ -72,6 +72,7 @@
       </div>
     </div>
     <fullScreenView :fullScreenViewProps="fullScreenViewProps" ref="fullScreenView"></fullScreenView>
+    <fullScreenFileLook ref="fullScreenFileLook"></fullScreenFileLook>
   </div>
 </template>
 
@@ -79,11 +80,14 @@
 let Base64 = require('js-base64').Base64;
 import { laboratoryApplyGetDetails } from "@/api/secureAccess/index";
 import fullScreenView from "@/components/fullScreenView/fullScreenView.vue";
+import fullScreenFileLook from "@/components/fullScreenFileLook/fullScreenFileLook.vue";
+
 
 export default {
   name: "info-page",
   components: {
     fullScreenView,
+    fullScreenFileLook
   },
   props:{
     infoData: {},
@@ -110,15 +114,27 @@ export default {
       this.$refs['fullScreenView'].initialize();
     },
     //文件浏览
-    lookFile(item){
-      if(item.name.split('.')[1] == 'png' || item.name.split('.')[1] == 'jpg' || item.name.split('.')[1] == 'gif'){
-        this.fullScreenViewClick(item.url);
-      }else {
-        window.open(window.location.href.split('://')[0]+'://'+this.judgmentNetworkReturnAddress()+'/admin/'+item.url)
+    fullScreenFileLookClick(item){
+      //判断类型
+      let type = '';
+      if(item.name.split('.')[1] == 'doc' || item.name.split('.')[1] == 'docx'){
+        type = 'docx'
+      }else if(item.name.split('.')[1] == 'xls' || item.name.split('.')[1] == 'xlsx'){
+        type = 'excel'
+      }else if(item.name.split('.')[1] == 'pdf'){
+        type = 'pdf'
+      }else if(item.name.split('.')[1] == 'png' || item.name.split('.')[1] == 'jpg' || item.name.split('.')[1] == 'gif'){
+        type = 'img'
+      }
+      //整合地址
+      let url = window.location.href.split('://')[0]+'://'+localStorage.getItem('fileBrowseEnvironment')+item.url;
+      // 判断图片还是文件
+      if(type == 'img'){
+        this.$set(this,'fullScreenViewProps',[url]);
+        this.$refs['fullScreenView'].initialize();
+      }else if(type == 'docx' || type == 'excel' || type == 'pdf'){
+        this.$refs['fullScreenFileLook'].initialize(item.name,url,type);
       }
-      // window.open(window.location.href.split('://')[0]+'://'+this.judgmentNetworkReturnAddress()+'/admin/'+item.url)
-      // let visitUrl=window.location.href.split('://')[0]+'://'+this.judgmentNetworkReturnAddress()+'/admin/'+item.url;
-      // window.open(window.location.href.split('://')[0]+'://'  + this.judgmentNetworkReturnAddress() + '/onlinePreview?url='+encodeURIComponent(Base64.encode(visitUrl)));
     },
     //点击切换文件
     forClick(item,index,bigIndex){

+ 2 - 0
src/views/systemManagement/publicConfig/exploitConfig.vue

@@ -111,6 +111,7 @@
       <div class="form-max-box">
         <el-form-item label="内网文件服务环境:">
           <el-input placeholder="请输入"  v-model="form.fileBrowseEnvironment" style="width:400px;" maxLength="50">
+            <template slot="prepend">http://</template>
           </el-input>
         </el-form-item>
         <i class="tip"><i class="el-icon-question"></i>文件服务相关的调用地址</i>
@@ -118,6 +119,7 @@
       <div class="form-max-box">
         <el-form-item label="外网文件服务环境:">
           <el-input placeholder="请输入"  v-model="form.fileBrowseEnvironmentExtranet" style="width:400px;" maxLength="50">
+            <template slot="prepend">http://</template>
           </el-input>
         </el-form-item>
         <i class="tip"><i class="el-icon-question"></i>文件服务相关的调用地址</i>