dedsudiyu 2 년 전
부모
커밋
03b48585ec

+ 19 - 46
src/views/comprehensive/laboratoryManagement/building/newIndex.vue

@@ -828,17 +828,13 @@
           this.$set(this, 'subjectOptions', [{ id: response.data.subId, name: response.data.subName }])
           let newData = JSON.parse(JSON.stringify(this.buildingList));
           for(let i=0;i<newData.mapList.length;i++){
-            console.log('response.data.subId',response.data.subId)
-            console.log('newData.mapList[i].subId',newData.mapList[i].subId)
-            console.log('response.data.roomName',response.data.roomName)
-            console.log('newData.mapList[i].roomName',newData.mapList[i].roomName)
             if( response.data.subId == newData.mapList[i].subId || response.data.roomName == newData.mapList[i].roomName){
               newData.mapList[i].checkType = true;
             }else{
               newData.mapList[i].checkType = false;
             }
           }
-          let newObj = this.calculateMapMax(newData.mapList,260,550,'min')
+          let newObj = this.calculateMapMax(newData.mapList,285,575,'min')
           newData.width = newObj.maxWidth
           newData.height = newObj.maxHeight
           newData.zoomData = newObj.zoomData
@@ -1001,49 +997,26 @@
           maxWidth++
         }
         //缩放判断
-        if(maxHeight>height&&maxWidth>width){
-          if((maxHeight-height)>(maxWidth-width)){
-            zoomData = height/maxHeight;
-            this.$set(this,'zoomData',height/maxHeight);
-            if(type == 'min'){
-              this.$set(this,'minZoomData',height/maxHeight);
-            }
-          }else{
-            zoomData = width / maxWidth;
-            this.$set(this,'zoomData',width / maxWidth);
-            if(type == 'min'){
-              this.$set(this,'minZoomData',width / maxWidth);
-            }
-          }
-        }else if(maxHeight<height&&maxWidth<width){
-          if((height-maxHeight)>(width-maxWidth)){
-            zoomData = width / maxWidth;
-            this.$set(this,'zoomData',width / maxWidth);
-            if(type == 'min'){
-              this.$set(this,'minZoomData',width / maxWidth);
-            }
-          }else{
-            zoomData = height / maxHeight;
-            this.$set(this,'zoomData',height / maxHeight);
-            if(type == 'min'){
-              this.$set(this,'minZoomData',height / maxHeight);
-            }
-          }
-        }else if(maxHeight<height&&maxWidth>width){
-          zoomData = width / maxWidth;
-          this.$set(this,'zoomData',width / maxWidth);
-          if(type == 'min'){
-            this.$set(this,'minZoomData',width / maxWidth);
-          }
-        }else if(maxHeight>height&&maxWidth<width){
-          zoomData = height / maxHeight;
-          this.$set(this,'zoomData',height / maxHeight);
-          if(type == 'min'){
-            this.$set(this,'minZoomData',height / maxHeight);
-          }
+        let zoomNumOne = height / maxHeight;
+        if(parseInt(this.accMul(zoomNumOne,maxHeight)) <= height && parseInt(this.accMul(zoomNumOne,maxWidth)) <= width){
+          zoomData = zoomNumOne;
+          this.$set(this,'zoomData',zoomNumOne);
+          this.$set(this,'minZoomData',zoomNumOne);
+        }
+        let zoomNumTwo = width / maxWidth;
+        if(parseInt(this.accMul(zoomNumTwo,maxHeight)) <= height && parseInt(this.accMul(zoomNumTwo,maxWidth)) <= width){
+          zoomData = zoomNumTwo;
+          this.$set(this,'zoomData',zoomNumTwo);
+          this.$set(this,'minZoomData',zoomNumTwo);
         }
         return { maxWidth: maxWidth, maxHeight: maxHeight,zoomData:zoomData }
-      }
+      },
+      accMul(arg1,arg2){
+        var m=0,s1=arg1.toString(),s2=arg2.toString();
+        try{m+=s1.split(".")[1].length}catch(e){}
+        try{m+=s2.split(".")[1].length}catch(e){}
+        return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)
+      },
     }
   }
 </script>

+ 53 - 4
src/views/comprehensive/system/publicConfig/integrationConfig.vue

@@ -3,6 +3,13 @@
   <div class="public-config-page">
     <el-form class="public-form-box scrollbar-box"  :model="form" ref="form" :inline="true" :rules="rules" label-width="160px">
       <div class="form-max-box">
+        <el-form-item label="物联控制权限:" prop="lotControl">
+          <el-checkbox-group v-model="form.lotControl">
+            <el-checkbox v-for="item in citiesList" :label="item.id" :key="item.id" style="margin-right:20px;margin-top:2px;">{{item.name}}</el-checkbox>
+          </el-checkbox-group>
+        </el-form-item>
+      </div>
+      <div class="form-max-box">
         <el-form-item label="签到/离开示意图:" prop="signMap">
           <el-upload
             class="certificate-avatar-uploader"
@@ -84,11 +91,14 @@ export default {
         Authorization: "Bearer " + getToken(),
       },
       form:{
+        lotControl:[],
         userType:[],
         expandType:[]
       },
       rules: {
-
+        lotControl:[
+          { required: true, message: "请选择物联控制权限", trigger: "blur" }
+        ],
         signMap: [
           { required: true, message: "签到/离开示意图不能为空", trigger: "blur" }
         ],
@@ -101,6 +111,31 @@ export default {
       },
       imgUrl:"",
       imgOpen:false,
+      //物联控制权限
+      lotControl:[],
+      citiesList:[
+        //物联控制 1.实验室负责人,2.安全责任人,3.安全准入人员,4.白名单,-1.全部
+        {
+          id:1,
+          name:"实验室负责人"
+        },
+        {
+          id:2,
+          name:"安全责任人"
+        },
+        {
+          id:3,
+          name:"安全准入人员"
+        },
+        {
+          id:4,
+          name:"白名单"
+        },
+        {
+          id:-1,
+          name:"全部人员"
+        },
+      ],
     };
   },
   created() {
@@ -116,11 +151,20 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           let obj = {
-
             signMap:this.form.signMap,
             videoCover:this.form.videoCover,
             operationGuide:this.form.operationGuide,
-
+          }
+          let num = 0;
+          for(let i=0;i<self.form.lotControl.length;i++){
+            if(self.lotControl[i] == '-1'){
+              num++
+            }
+          }
+          if(num == 0){
+            obj.lotControl = self.form.lotControl+'';
+          }else{
+            obj.lotControl = '-1';
           }
           updateLogoInfo(obj).then(response => {
             this.msgSuccess(response.msg);
@@ -138,8 +182,13 @@ export default {
     getLogoInfo(){
       getLogoInfo().then(response => {
         localStorage.setItem('videoCover',response.data.videoCover)
-
         this.$set(this,'form',response.data)
+        if(response.data.lotControl){
+          let list = response.data.lotControl.split(",");
+          this.$set(this.form,'lotControl',list);
+        }else{
+          this.$set(this.form,'lotControl',[1,2,3,4]);
+        }
       });
     },
     //上传

+ 15 - 22
src/views/newEvacuationBigData.vue

@@ -1651,31 +1651,24 @@
           maxWidth++
         }
         //缩放判断
-        if(maxHeight>height&&maxWidth>width){
-          if((maxHeight-height)>(maxWidth-width)){
-            zoomData = height/maxHeight;
-            this.$set(this,'zoomData',height/maxHeight);
-          }else{
-            zoomData = width / maxWidth;
-            this.$set(this,'zoomData',width / maxWidth);
-          }
-        }else if(maxHeight<height&&maxWidth<width){
-          if((height-maxHeight)>(width-maxWidth)){
-            zoomData = width / maxWidth;
-            this.$set(this,'zoomData',width / maxWidth);
-          }else{
-            zoomData = height / maxHeight;
-            this.$set(this,'zoomData',height / maxHeight);
-          }
-        }else if(maxHeight<height&&maxWidth>width){
-          zoomData = width / maxWidth;
-          this.$set(this,'zoomData',width / maxWidth);
-        }else if(maxHeight>height&&maxWidth<width){
-          zoomData = height / maxHeight;
-          this.$set(this,'zoomData',height / maxHeight);
+        let zoomNumOne = height / maxHeight;
+        if(parseInt(this.accMul(zoomNumOne,maxHeight)) <= height && parseInt(this.accMul(zoomNumOne,maxWidth)) <= width){
+          zoomData = zoomNumOne;
+          this.$set(this,'zoomData',zoomNumOne);
+        }
+        let zoomNumTwo = width / maxWidth;
+        if(parseInt(this.accMul(zoomNumTwo,maxHeight)) <= height && parseInt(this.accMul(zoomNumTwo,maxWidth)) <= width){
+          zoomData = zoomNumTwo;
+          this.$set(this,'zoomData',zoomNumTwo);
         }
         return { maxWidth: maxWidth, maxHeight: maxHeight,zoomData:zoomData }
       },
+      accMul(arg1,arg2){
+        var m=0,s1=arg1.toString(),s2=arg2.toString();
+        try{m+=s1.split(".")[1].length}catch(e){}
+        try{m+=s2.split(".")[1].length}catch(e){}
+        return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)
+      },
       /*********************************** 楼层/楼栋数据-相关接口 *********************************/
       //根据楼栋获取楼层数据
       getBuildOrFloorList(type){