Pārlūkot izejas kodu

Merge branch '3.3.2-dzxxp' into 3.3.4-kdyh

dedsudiyu 2 gadi atpakaļ
vecāks
revīzija
773e328324

+ 3 - 26
src/utils/ruoyi.js

@@ -3,10 +3,8 @@
  * Copyright (c) 2019 ruoyi
  */
 
+let Base64 = require('js-base64').Base64;
 // 判断当前用户网络 外网/内网 返回接口地址
-
-
-
 export function judgmentNetworkReturnAddress() {
   /*判断是否是内网IP*/
     // 获取当前页面url
@@ -309,29 +307,8 @@ export function spaceJudgmentHTML(rule, value, callback) {
  * 预览地址判断
  */
 export function urlJudge(url) {
-  // let src = '';
-  // url = '/admin/statics'+url.split('statics')[1]
-  url = '/statics'+url.split('statics')[1]
-  // console.log('url',url);
-  let location = window.location.href
-  // console.log('location',location)
-  if (location.indexOf('?#/') !== -1){
-    location = location.split('?#/')[0]
-    // console.log('location1',location)
-  }else if(location.indexOf('/#/') !== -1){
-    location = location.split('/#/')[0]
-    // console.log('location2',location)
-  }
-  // console.log('src',src)
-  // if(url.indexOf('http') !== -1){
-  //   let text =  window.location.href.split('://')[0]+'://' + url.split('://')[1]
-  //   src = localStorage.getItem('filePreviewUrl') + '/onlinePreview?url='+encodeURIComponent(btoa(unescape(encodeURIComponent(text))));
-  // }else{
-  //   src = localStorage.getItem('filePreviewUrl') + '/onlinePreview?url='+encodeURIComponent(btoa(unescape(encodeURIComponent(window.location.href.split('://')[0]+'://' +judgmentNetworkReturnAddress() +'/admin/'+ url))));
-  // }
-  console.log('location',location);
-  console.log('url',url);
-  return location + url
+  let src = window.location.href.split('://')[0]+'://' + judgmentNetworkReturnAddress()+'/statics'+ url.split('statics')[1]
+  return localStorage.getItem('filePreviewUrl')+'/onlinePreview?url='+encodeURIComponent(btoa(unescape(encodeURIComponent(src))));
 }
 
 /**

+ 10 - 8
src/views/comprehensive/laboratoryManagement/building/buildingDetails.vue

@@ -640,19 +640,21 @@
           this.$refs["dialogForm"].validate(valid => {
             if (valid) {
               if(this.dialogOpenType == 1){
-                for(let i=0;i<self.mapList.length;i++){
-                  if(self.mapList[i].type == '1'){
-                    if(self.mapList[i].subId == self.dialogForm.subId){
-                      this.msgError(self.dialogForm.subName+'已被其他房间绑定')
-                      return
+                if(self.dialogForm.roomType != '-99'){
+                  for(let i=0;i<self.mapList.length;i++){
+                    if(self.mapList[i].type == '1'){
+                      if(self.mapList[i].subId == self.dialogForm.subId){
+                        this.msgError(self.dialogForm.subName+'已被其他房间绑定')
+                        return
+                      }
                     }
                   }
                 }
                 this.$set(this.mapList[this.dialogIndex],'roomType',this.dialogForm.roomType);
                 this.$set(this.mapList[this.dialogIndex],'roomNum',this.dialogForm.roomNum);
-                this.$set(this.mapList[this.dialogIndex],'roomName',this.dialogForm.roomName);
-                this.$set(this.mapList[this.dialogIndex],'subId',this.dialogForm.subId);
-                this.$set(this.mapList[this.dialogIndex],'subName',this.dialogForm.subName);
+                this.$set(this.mapList[this.dialogIndex],'roomName',self.dialogForm.roomType == '-99'?this.dialogForm.roomName:"");
+                this.$set(this.mapList[this.dialogIndex],'subId',self.dialogForm.roomType != '-99'?this.dialogForm.subId:"");
+                this.$set(this.mapList[this.dialogIndex],'subName',self.dialogForm.roomType != '-99'?this.dialogForm.subName:"");
                 this.dialogOpen = false;
               }else if(this.dialogOpenType == 6){
                 this.$set(this.mapList[this.dialogIndex].lightList[this.dialogMinIndex],'relayType',this.dialogForm.relayType);