Browse Source

fix: pad的bug修改

chenzhen2 2 years ago
parent
commit
01f03522bb

+ 25 - 25
src/store/modules/user/actions.ts

@@ -35,9 +35,9 @@ export interface Actions {
     { commit }: AugmentedActionContext
   ): void
 
-  [UserActionTypes.ACTION_GET_WORKSPACE](
-    { commit }: AugmentedActionContext
-  ): void
+  // [UserActionTypes.ACTION_GET_WORKSPACE](
+  //   { commit }: AugmentedActionContext
+  // ): void
 
   [UserActionTypes.ACTION_CHANGE_ROLES](
     { commit }: AugmentedActionContext, role: string
@@ -75,9 +75,9 @@ export const actions: ActionTree<UserState, RootState> & Actions = {
   async [UserActionTypes.ACTION_GET_USER_INFO]({ commit }: AugmentedActionContext) {
     // let nowProjectId: any = 'Pj1101080259'
     const userInfo: any = {
-      userName: '陈珍',
-      userPhone: 15321277745,
-      userId: '602ef709beb64a1f9a4b6af2196d0af7'
+      userName: 'admin',
+      userPhone: 11111111111,
+      userId: 'admin'
       // userId: '9a1ecfbacb6b4f249bf2dd3ec7793ead'
       // userId: '1302990695845462811'
     }
@@ -89,25 +89,25 @@ export const actions: ActionTree<UserState, RootState> & Actions = {
     commit(UserMutationTypes.SET_USER_MAC, macAdr)
     // store.commit(UserMutationTypes.SET_PROJECT_ID, nowProjectId)
   },
-  async [UserActionTypes.ACTION_GET_WORKSPACE]({ commit }: AugmentedActionContext) {
-    let params: any = {
-      "criteria": {
-        "macAddress": "DA:BF:E8:7A:61:97"
-      },
-      "orders": [
-        {
-          "column": "createTime",
-          "asc": false
-        }
-      ],
-      "page": 1,
-      "size": 1
-    }
-    queryWorkSpace(params).then((res) => {
-      console.log("===")
-      console.log(res)
-    })
-  },
+  // async [UserActionTypes.ACTION_GET_WORKSPACE]({ commit }: AugmentedActionContext) {
+  //   let params: any = {
+  //     "criteria": {
+  //       "macAddress": "DA:BF:E8:7A:61:97"
+  //     },
+  //     "orders": [
+  //       {
+  //         "column": "createTime",
+  //         "asc": false
+  //       }
+  //     ],
+  //     "page": 1,
+  //     "size": 1
+  //   }
+  //   queryWorkSpace(params).then((res) => {
+  //     console.log("===")
+  //     console.log(res)
+  //   })
+  // },
   async [UserActionTypes.ACTION_CHANGE_ROLES](
     { commit }: AugmentedActionContext,
     role: string

+ 8 - 3
src/views/choiceSpace/choiceSpace.vue

@@ -72,6 +72,7 @@
         <span
           v-for="(item, index) in spaceTypeArr"
           @click="checkSpaceType(item)"
+          :class="spaceType.type===item.type?'active-type':''"
           :key="'space-type-id' + index"
         >
           {{ item.name }}
@@ -579,7 +580,7 @@ export default defineComponent({
     }
     .search-floor {
       position: relative;
-      width: 320px;
+      width: 380px;
       height: 44px;
       line-height: 42px;
       background: #ffffff;
@@ -598,7 +599,7 @@ export default defineComponent({
         overflow: hidden;
         text-overflow: ellipsis;
         &:nth-child(2) {
-          width: 225px;
+          width: 285px;
         }
       }
     }
@@ -608,7 +609,7 @@ export default defineComponent({
       margin-left: 20px;
       .com-select {
         position: relative;
-        width: 150px;
+        width: 170px;
         height: 44px;
         // line-height: 44px;
         border-radius: 22px 0 0 22px;
@@ -673,6 +674,7 @@ export default defineComponent({
         background: #fff;
         .item-text {
           display: inline-block;
+          font-size: 20px;
           width: calc(100% - 60px);
           padding-left: 20px;
           position: absolute;
@@ -698,6 +700,9 @@ export default defineComponent({
       font-size: 16px;
       padding: 10px 0;
     }
+    .active-type {
+      color: $elActiveColor;
+    }
   }
 
   .next-btn-box {

+ 40 - 34
src/views/envmonitor/index.vue

@@ -2,7 +2,7 @@
   <div
     class="main"
     :style="{
-      'backgroundImage':
+      backgroundImage:
         'linear-gradient(0deg, rgba(69, 33, 0, 0.2), rgba(69, 33, 0, 0.2)), url(' +
         padBgImg +
         ')',
@@ -69,7 +69,7 @@
           <div class="space-temp">
             <img :src="parseImgUrl('ipdImages', 'template-icon.svg')" alt="" />
             <span class="temp-text">温度</span>
-            <span class="temp-num"
+            <span class="temp-num" v-if="officeData.temperature"
               >{{ officeData.temperature }}<sup>℃</sup></span
             >
           </div>
@@ -792,20 +792,6 @@ export default defineComponent({
           proxyData.forceOverTimeFlag = false;
         }
       },
-      // /**
-      //  * 修改空间id
-      //  * @param spaceId
-      //  */
-      // changeSpaceId(spaceId: any) {
-      //   proxyData.loadingStart();
-      //   proxyData.spaceInfo.spaceId = spaceId;
-      //   proxyData.headerInfo.headScene = "";
-      //   // 切换空间的时候先清除定时器
-      //   proxyData.clearTimerSpaceInfo();
-      //   // proxyData.init();
-      //   // 判断用户是否有可控制权限
-      //   proxyData.checkUserSpace();
-      // },
       // 获取公司信息
       async getCompanyInfo() {
         const res: any = await getCompanyInfo({ companyId: Keys.companyKey });
@@ -960,7 +946,12 @@ export default defineComponent({
         getSpaceInfo(data)
           .then((res) => {
             const content: any = res?.content ?? [];
-            proxyData.officeData = content[0] ? content[0] : {};
+            if (content[0]) {
+              proxyData.officeData = content[0];
+            }
+            proxyData.officeData = proxyData.officeData
+              ? proxyData.officeData
+              : {};
             if (proxyData.officeData.localName) {
               proxyData.localName = proxyData.officeData.localName;
             }
@@ -969,7 +960,6 @@ export default defineComponent({
                 proxyData.officeData.temperature.toFixed(1) * 1;
             }
             // 环境数据
-
             proxyData.checkSpaceType(proxyData.officeData.roomFuncType);
             proxyData.formatSpaceInfo(content);
             proxyData.getPadImg();
@@ -1556,10 +1546,8 @@ export default defineComponent({
       },
       // 清除定时器
       clearTimerSpaceInfo() {
-        if (proxyData.spaceTimer) {
-          clearTimeout(proxyData.spaceTimer);
-          proxyData.spaceTimer = null;
-        }
+        clearTimeout(proxyData.spaceTimer);
+        proxyData.spaceTimer = null;
       },
       // 定时调空间
       timerSpaceInfo(timer: any = 5000) {
@@ -1870,6 +1858,16 @@ export default defineComponent({
       white-space: nowrap;
       text-overflow: ellipsis;
       -o-text-overflow: ellipsis;
+      .left-time {
+        span {
+          font-family: "Montserrat";
+          font-style: normal;
+          font-weight: 400;
+          font-size: 16px;
+          line-height: 20px;
+          color: #ffffff;
+        }
+      }
       .logo-icon {
         display: inline-block;
         vertical-align: middle;
@@ -1877,17 +1875,6 @@ export default defineComponent({
         height: 20px;
         margin-right: 5px;
       }
-      .weather-icon {
-        width: 24px;
-        height: 24px;
-        margin-right: 10px;
-        display: inline-block;
-        vertical-align: middle;
-      }
-      span {
-        display: inline-block;
-        vertical-align: middle;
-      }
       div {
         vertical-align: middle;
         display: inline-block;
@@ -1907,9 +1894,28 @@ export default defineComponent({
       }
       .weather {
         padding-left: 22px;
+        line-height: 24px;
+        // font-size: 0;
+        // padding-right: 5px;
+        .weather-icon {
+          width: 24px;
+          height: 24px;
+          margin-right: 10px;
+          display: inline-block;
+          vertical-align: middle;
+        }
+        span {
+          display: inline-block;
+          vertical-align: middle;
+          font-family: "Montserrat";
+          font-style: normal;
+          font-weight: 400;
+          font-size: 16px;
+          padding-top: 2px;
+        }
       }
       .weixiin {
-        margin-left: 10px;
+        margin-left: 20px;
         img {
           margin-right: 5px;
           width: 24px;