Преглед изворни кода

fix:手动控制加班功能修改

chenzhen2 пре 2 година
родитељ
комит
9c26caa866
2 измењених фајлова са 107 додато и 49 уклоњено
  1. 82 47
      src/views/envmonitor/components/ManualWork/index.vue
  2. 25 2
      src/views/mapDataNew/sichuan.vue

+ 82 - 47
src/views/envmonitor/components/ManualWork/index.vue

@@ -2,7 +2,7 @@
   <div class="work-content">
     <div class="work-space">
       <div class="space-title">{{ spaceInfo.spaceName }} 申请延时</div>
-      <div class="tip">延时期间,空间相关设备会开启</div>
+      <!-- <div class="tip">延时期间,空间相关设备会开启</div> -->
     </div>
     <div class="add-time" id="addTimeId">
       <div class="date_box" v-if="dateArr && dateArr.length">
@@ -59,42 +59,55 @@
       <span class="line"></span>
     </div>
     <div class="work-device">
-      <div class="row-title">空调</div>
-      <template
-        v-for="(item, index) in nowData.equipmentList"
-        :key="'eq' + index"
-      >
-        <div class="device-box" v-if="item.equipmentCategory !== 'SELTLT'">
-          <div class="device-row" @click="checkEquipment(item)">
-            <span>{{ item.name }}</span>
-            <img
-              :src="
-                item.isCheck
-                  ? parseImgUrl('ipdImages', 'check-open.svg')
-                  : parseImgUrl('ipdImages', 'check-close.svg')
-              "
-              alt=""
-            />
-          </div>
+      <template v-if="isAir">
+        <div class="row-title">空调</div>
+        <div class="device-box">
+          <template
+            v-for="(item, index) in nowData.equipmentList"
+            :key="'eq' + index"
+          >
+            <div
+              class="device-row"
+              v-if="item.equipmentCategory !== 'SELTLT'"
+              @click="checkEquipment(item)"
+            >
+              <span>{{ item.localName }}</span>
+              <img
+                :src="
+                  item.isCheck
+                    ? parseImgUrl('ipdImages', 'check-open.svg')
+                    : parseImgUrl('ipdImages', 'check-close.svg')
+                "
+                alt=""
+              />
+            </div>
+          </template>
         </div>
       </template>
-      <div class="row-title">灯</div>
-      <template
-        v-for="(item, index) in nowData.equipmentList"
-        :key="'eq' + index"
-      >
-        <div class="device-box" v-if="item.equipmentCategory === 'SELTLT'">
-          <div class="device-row" @click="checkEquipment(item)">
-            <span>{{ item.name }}</span>
-            <img
-              :src="
-                item.isCheck
-                  ? parseImgUrl('ipdImages', 'check-open.svg')
-                  : parseImgUrl('ipdImages', 'check-close.svg')
-              "
-              alt=""
-            />
-          </div>
+
+      <template v-if="isLight">
+        <div class="row-title">照明</div>
+        <div class="device-box">
+          <template
+            v-for="(item, index) in nowData.equipmentList"
+            :key="'eq' + index"
+          >
+            <div
+              class="device-row"
+              v-if="item.equipmentCategory === 'SELTLT'"
+              @click="checkEquipment(item)"
+            >
+              <span>{{ item.name }}</span>
+              <img
+                :src="
+                  item.isCheck
+                    ? parseImgUrl('ipdImages', 'check-open.svg')
+                    : parseImgUrl('ipdImages', 'check-close.svg')
+                "
+                alt=""
+              />
+            </div>
+          </template>
         </div>
       </template>
 
@@ -282,7 +295,8 @@ export default defineComponent({
               }
             }
           });
-        } else if (formatTimer >= cusEndTime) {  // 在服务定制之后
+        } else if (formatTimer >= cusEndTime) {
+          // 在服务定制之后
           // 在服务定制之后
           console.log("在当前的服务定制之后---4");
           let endFormatTimer: any = timerArr[nowIndex + obj.len].formatTimer;
@@ -718,9 +732,12 @@ export default defineComponent({
        */
       dateArr: dateArr,
       myTimeArr: myTimeArr,
+      isAir: false,
+      isLight: false,
       // 格式化设备
       formateEquipment() {
-        console.log(proxyData.enterType);
+        proxyData.isLight = false;
+        proxyData.isAir = false;
         if (proxyData.enterType === 1) {
           proxyData.nowData.equipmentList.map((item: any) => {
             item.isCheck = true;
@@ -742,6 +759,15 @@ export default defineComponent({
             }
           });
         }
+        // 判断是否有空调和灯
+        proxyData.nowData.equipmentList.map((item: any) => {
+          if (item.equipmentCategory == "SELTLT") {
+            proxyData.isLight = true;
+          }
+          if (item.equipmentCategory !== "SELTLT") {
+            proxyData.isAir = true;
+          }
+        });
       },
       // 加班时间是否在所有的服务定制时间之前
       isCusTimeBefore(spaceCustomContentList: any, time: any) {
@@ -1396,7 +1422,7 @@ export default defineComponent({
     display: flex;
     justify-content: space-between;
     width: 100%;
-    padding-bottom: 15px;
+    padding-bottom: 5px;
 
     .date-item {
       padding-top: 20px;
@@ -1416,8 +1442,9 @@ export default defineComponent({
           padding-bottom: 10px;
           font-style: normal;
           font-weight: 400;
-          font-size: 10px;
+          font-size: 12px;
           line-height: 12px;
+          transform: scale();
           text-align: center;
           color: #8d9399;
         }
@@ -1624,6 +1651,10 @@ export default defineComponent({
     line-height: 30px;
     span {
       display: inline-block;
+      font-family: "PingFang SC";
+      font-style: normal;
+      font-weight: 400;
+      font-size: 12px;
     }
     img {
       width: 25px;
@@ -1634,31 +1665,35 @@ export default defineComponent({
 
 .row-title {
   display: block;
-  padding-top: 20px;
-  padding-bottom: 5px;
+  font-weight: 500;
+  font-size: 14px;
+  line-height: 18px;
+  color: #000000;
+  padding-top: 4px;
 }
 .device-title {
+  display: flex;
+  justify-content: space-between;
   padding-top: 20px;
+  padding-bottom: 5px;
   text-align: center;
-  // padding-bottom: 10px;
   .line {
     display: inline-block;
-    vertical-align: middle;
-    width: 155px;
+    flex: 1;
     height: 0px;
     border: 1px solid #e1e5eb;
   }
   .text {
     display: inline-block;
+    width: 142px;
     vertical-align: middle;
-    padding-left: 10px;
-    padding-right: 10px;
     font-family: "PingFang SC";
     font-style: normal;
     font-weight: 400;
     font-size: 12px;
-    line-height: 17px;
     color: #8d9399;
+    text-align: center;
+    margin-top: -6px;
   }
 }
 </style>

+ 25 - 2
src/views/mapDataNew/sichuan.vue

@@ -101,9 +101,15 @@ export default defineComponent({
       // canvas画图
       initCanvas() {
         let canvasDom: any = document.querySelector("#myCanvas");
-        canvasDom.width = proxyData.width * proxyData.scale;
-        canvasDom.height = proxyData.height * proxyData.scale;
+        // canvasDom.width = proxyData.width * proxyData.scale;
+        // canvasDom.height = proxyData.height * proxyData.scale;
         let ctx: any = canvasDom.getContext("2d");
+        proxyData.drawDpiBegin(
+          canvasDom,
+          ctx,
+          proxyData.width,
+          proxyData.height
+        );
         proxyData.ctx = ctx;
         ctx.clearRect(0, 0, proxyData.width, proxyData.height);
         ctx.scale(
@@ -212,6 +218,7 @@ export default defineComponent({
             };
           }
         });
+        proxyData.drawDpiEnd(canvasDom,ctx)
       },
       MaxAndMin(arr: any) {
         return [Math.min.apply(null, arr), Math.max.apply(null, arr)];
@@ -222,6 +229,22 @@ export default defineComponent({
         // 点击事件
         canvasDom.addEventListener("click", proxyData.detect);
       },
+      // 解决canvas画图模糊的问题
+      // 开始画
+      drawDpiBegin(dom: any, context: any, width: any, height: any) {
+        context.save();
+        let scaleValue = window.devicePixelRatio;
+        dom.setAttribute("width", width * scaleValue);
+        dom.setAttribute("height", height * scaleValue);
+
+        dom.style.width = width + "px";
+        dom.style.height = height + "px";
+        context.scale(scaleValue, scaleValue);
+      },
+      // 画图介绍
+      drawDpiEnd(dom: any, context: any) {
+        context.restore();
+      },
       // 地图点击事件
       detect(event: any) {
         let canvasDom: any = document.querySelector("#myCanvas");