Browse Source

fix: 平板bug解决

chenzhen2 2 years ago
parent
commit
a2ed3f94c4

+ 17 - 7
src/utils/index.ts

@@ -113,7 +113,7 @@ export const getUserInfo = function () {
   const paramsInfo: any = {
   const paramsInfo: any = {
     openid: userInfo.openid,
     openid: userInfo.openid,
     userId: userInfo.userId,
     userId: userInfo.userId,
-    mac:userInfo.mac,
+    mac: userInfo.mac,
     pubname: Keys.pubname,
     pubname: Keys.pubname,
     projectId: userInfo.projectId
     projectId: userInfo.projectId
   }
   }
@@ -134,7 +134,7 @@ export const getComparams = function () {
     openid: Keys.openid,
     openid: Keys.openid,
     userId: userInfo.userId,
     userId: userInfo.userId,
     pubname: Keys.pubname,
     pubname: Keys.pubname,
-    mac:userInfo.mac,
+    mac: userInfo.mac,
     projectId: userInfo.projectId
     projectId: userInfo.projectId
   }
   }
   if (userInfo.userName) {
   if (userInfo.userName) {
@@ -156,9 +156,9 @@ export const formatDate = function (split: string = 'YYYYMMDD', date: any = new
   //具体的天数
   //具体的天数
   const day: any = dates.getDate() < 10 ? '0' + dates.getDate() : dates.getDate()
   const day: any = dates.getDate() < 10 ? '0' + dates.getDate() : dates.getDate()
   // //小时
   // //小时
-  // const Hours = dates.getHours() < 10 ? '0' + dates.getHours() : dates.getHours()
+  const Hours = dates.getHours() < 10 ? '0' + dates.getHours() : dates.getHours()
   // //分钟
   // //分钟
-  // const Minutes = dates.getMinutes() < 10 ? '0' + dates.getMinutes() : dates.getMinutes()
+  const Minutes = dates.getMinutes() < 10 ? '0' + dates.getMinutes() : dates.getMinutes()
   // //秒
   // //秒
   // const Seconds = dates.getSeconds() < 10 ? '0' + dates.getSeconds() : dates.getSeconds()
   // const Seconds = dates.getSeconds() < 10 ? '0' + dates.getSeconds() : dates.getSeconds()
   //返回数据格式
   //返回数据格式
@@ -170,7 +170,10 @@ export const formatDate = function (split: string = 'YYYYMMDD', date: any = new
     return year + '' + month
     return year + '' + month
   } else if (split === 'YYYY-MM-DD') {
   } else if (split === 'YYYY-MM-DD') {
     return year + '-' + month + '-' + day
     return year + '-' + month + '-' + day
-  } else {
+  } else if (split === 'YYYY.MM.DD HH:mm') {
+    return year + '.' + month + "." + day + " " + Hours + ":" + Minutes
+  }
+  {
     return year + '' + month + '' + day
     return year + '' + month + '' + day
   }
   }
 }
 }
@@ -453,6 +456,13 @@ export const getWeekDate = function (day: any) {
   return week
   return week
 }
 }
 
 
+export const getNowWeek = function () {
+  let date: any = new Date()
+  let day: any = date.getDay()
+  let nowWeek: any = getWeekDate(day)
+  return nowWeek
+}
+
 export const getDate = function (date: any) {
 export const getDate = function (date: any) {
   return date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
   return date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
 }
 }
@@ -470,7 +480,7 @@ export const getTimers = function () {
       str = i
       str = i
     }
     }
     timers.push(str + ':00')
     timers.push(str + ':00')
-    if (i <24) {
+    if (i < 24) {
       timers.push(str + ':30')
       timers.push(str + ':30')
     }
     }
   }
   }
@@ -521,4 +531,4 @@ export const formatTimerStr = function (timer: any) {
 
 
 export const newNumber = function (start: any, end: any, masAddess: any) {
 export const newNumber = function (start: any, end: any, masAddess: any) {
   return masAddess + "" + Math.round(Math.random() * (end - start) + start);//生成在[start,end]范围内的随机数值,只支持不小于0的合法范围
   return masAddess + "" + Math.round(Math.random() * (end - start) + start);//生成在[start,end]范围内的随机数值,只支持不小于0的合法范围
-}
+}

+ 31 - 3
src/views/choiceSpace/choiceProject.vue

@@ -1,6 +1,11 @@
 <template>
 <template>
   <div class="choice-project com-search">
   <div class="choice-project com-search">
-    <van-search placeholder="请输入搜索关键词" />
+    <van-search
+      placeholder="请输入搜索关键词"
+      v-model="searchVal"
+      @update:model-value="onSearch"
+      @cancel="onCancel"
+    />
     <div class="choice-content">
     <div class="choice-content">
       <div
       <div
         class="choice-item"
         class="choice-item"
@@ -40,13 +45,38 @@ export default defineComponent({
         router.push({ path: "/choice-space", query: { id: item.id } });
         router.push({ path: "/choice-space", query: { id: item.id } });
       },
       },
       projects: projects,
       projects: projects,
+      cloneProjects: projects,
       getUsersInfo() {
       getUsersInfo() {
         getUsersInfo().then((res) => {
         getUsersInfo().then((res) => {
           let resData: any = res;
           let resData: any = res;
           let projects: any = resData?.projects ?? [];
           let projects: any = resData?.projects ?? [];
+          proxyData.cloneProjects = JSON.parse(JSON.stringify(projects));
           proxyData.projects = projects;
           proxyData.projects = projects;
         });
         });
       },
       },
+      searchVal: "",
+      onSearch() {
+        // console.log(proxyData.searchVal);
+        proxyData.fuzzyQuery(proxyData.searchVal);
+      },
+      onCancel() {},
+      fiflterName(list: any, keyWord: any) {
+        var arr = [];
+        for (var i = 0; i < list.length; i++) {
+          if (list[i].name.match(keyWord) != null) {
+            arr.push(list[i]);
+          }
+        }
+        return arr;
+      },
+      fuzzyQuery(val: any) {
+        let arr: any = JSON.parse(JSON.stringify(proxyData.cloneProjects));
+        if (val) {
+          proxyData.projects = proxyData.fiflterName(arr, val);
+        } else {
+          proxyData.projects = arr;
+        }
+      },
     });
     });
     onMounted(() => {
     onMounted(() => {
       proxyData.getUsersInfo();
       proxyData.getUsersInfo();
@@ -67,8 +97,6 @@ export default defineComponent({
 </style>
 </style>
 <style lang="scss">
 <style lang="scss">
 .choice-project {
 .choice-project {
-  
-
   .choice-content {
   .choice-content {
     padding-top: 10px;
     padding-top: 10px;
     .choice-item {
     .choice-item {

+ 6 - 1
src/views/choiceSpace/choiceSpace.vue

@@ -359,6 +359,7 @@ export default defineComponent({
         proxyData.spaceType = spaceType;
         proxyData.spaceType = spaceType;
       },
       },
       spaceData: spaceData,
       spaceData: spaceData,
+      nowPerstionIndex: 0,
       // 空间列表
       // 空间列表
       getPadSpaceList(query: any = "") {
       getPadSpaceList(query: any = "") {
         // debugger;
         // debugger;
@@ -374,7 +375,7 @@ export default defineComponent({
           let resData: any = res;
           let resData: any = res;
           if (resData.result === "success") {
           if (resData.result === "success") {
             proxyData.spaceData = resData?.data ?? [];
             proxyData.spaceData = resData?.data ?? [];
-            proxyData.spaceData.map((item: any) => {
+            proxyData.spaceData.map((item: any, index: any) => {
               if (item.isWorkSpace) {
               if (item.isWorkSpace) {
                 item.checked = true;
                 item.checked = true;
               } else {
               } else {
@@ -391,6 +392,10 @@ export default defineComponent({
           }
           }
         });
         });
       },
       },
+      // 设置当前页面选中的位置
+      setPageScroolTop(){
+
+      },
       searchSpace() {
       searchSpace() {
         let query: any = {
         let query: any = {
           floorId: proxyData.checkPositon.floorId,
           floorId: proxyData.checkPositon.floorId,

+ 17 - 15
src/views/envmonitor/components/Air.vue

@@ -3,16 +3,16 @@
     <div class="air-top">
     <div class="air-top">
       <div class="air-desc">
       <div class="air-desc">
         <p class="air-title">空调</p>
         <p class="air-title">空调</p>
-        <p class="air-temperature" v-if="temperature">
-          {{ temperature ? temperature : "--" }}
+        <p class="air-temperature">
+          {{ airData.tempSet ? airData.tempSet : "--" }}
           <sup>℃</sup>
           <sup>℃</sup>
         </p>
         </p>
-        <p class="air-model">
+        <!-- <p class="air-model">
           <span v-if="modeName">
           <span v-if="modeName">
             {{ modeName }}
             {{ modeName }}
           </span>
           </span>
           <span v-if="airData.tempSet"> {{ airData.tempSet }}℃ </span>
           <span v-if="airData.tempSet"> {{ airData.tempSet }}℃ </span>
-        </p>
+        </p> -->
         <p class="air-status" v-if="hasAir">
         <p class="air-status" v-if="hasAir">
           {{ airData.isOpen ? "空调已开启" : "空调已关闭" }}
           {{ airData.isOpen ? "空调已开启" : "空调已关闭" }}
         </p>
         </p>
@@ -268,17 +268,19 @@ export default defineComponent({
         getEquipmentListHttp(params).then((res) => {
         getEquipmentListHttp(params).then((res) => {
           let resData: any = res;
           let resData: any = res;
           let data: any = resData ? resData.data : [];
           let data: any = resData ? resData.data : [];
-          for (let i = 0; i < data.length; i++) {
-            let item: any = data[i];
-            if (item.equipmentCategory === "ACATVI") {
-              // 多联机不展示风量调整
-              proxyData.showAirVolumeBtn = false;
-              flag = false;
-              break;
+          if (data && data.length) {
+            for (let i = 0; i < data.length; i++) {
+              let item: any = data[i];
+              if (item.equipmentCategory === "ACATVI") {
+                // 多联机不展示风量调整
+                proxyData.showAirVolumeBtn = false;
+                flag = false;
+                break;
+              }
+            }
+            if (flag) {
+              proxyData.showAirVolumeBtn = true;
             }
             }
-          }
-          if (flag) {
-            proxyData.showAirVolumeBtn = true;
           }
           }
         });
         });
       },
       },
@@ -518,7 +520,7 @@ export default defineComponent({
         // 定时调空间信息
         // 定时调空间信息
         proxyData.getAirInfoToTimer(0);
         proxyData.getAirInfoToTimer(0);
         // proxyData.getAirInfo()
         // proxyData.getAirInfo()
-        proxyData.getEquipmentListHttp();
+        // proxyData.getEquipmentListHttp();
       }
       }
       proxyData.temperature = props.temperature;
       proxyData.temperature = props.temperature;
       proxyData.userIsControl = newProps.userIsControl;
       proxyData.userIsControl = newProps.userIsControl;

+ 21 - 11
src/views/envmonitor/components/Map/MapBox.vue

@@ -17,7 +17,7 @@
           :id="'space' + area.id"
           :id="'space' + area.id"
           :class="[
           :class="[
             area.canClick ? '' : 'click-disable',
             area.canClick ? '' : 'click-disable',
-            selectArea.id === area.id ? 'select' : '',
+            selectArea.id === area.id ? (area.disabled ? 'select-disable' : 'select') : '',
             isSetSpace ? 'use-select' : '',
             isSetSpace ? 'use-select' : '',
             area.disabled ? 'space-disable-box' : 'space-box-bg',
             area.disabled ? 'space-disable-box' : 'space-box-bg',
           ]"
           ]"
@@ -502,7 +502,8 @@ export default defineComponent({
        * 切换空间
        * 切换空间
        */
        */
       checkSpace(area: any) {
       checkSpace(area: any) {
-        if (area.disabled) {  // 如果不在
+        if (area.disabled) {
+          // 如果不在
           return;
           return;
         }
         }
         proxyData.isSetSearchSpace = false;
         proxyData.isSetSearchSpace = false;
@@ -688,6 +689,8 @@ export default defineComponent({
           item.bg = mapIcon[typeName].bg;
           item.bg = mapIcon[typeName].bg;
           item.icon = parseImgUrl("map-new-icon", item.icon);
           item.icon = parseImgUrl("map-new-icon", item.icon);
           item.selectIcon = parseImgUrl("map-new-icon", item.selectIcon);
           item.selectIcon = parseImgUrl("map-new-icon", item.selectIcon);
+        } else {
+          item.icon = "";
         }
         }
       },
       },
       midpoint(x1: any, y1: any, x2: any, y2: any) {
       midpoint(x1: any, y1: any, x2: any, y2: any) {
@@ -1037,10 +1040,11 @@ export default defineComponent({
                 if (!proxyData.isSetSpace) {
                 if (!proxyData.isSetSpace) {
                   proxyData.checkSpace(proxyData.selectArea);
                   proxyData.checkSpace(proxyData.selectArea);
                 }
                 }
-                // proxyData.selectArea = proxyData.mapData.spaceList[0];
-                // 设置当前空间的位置
-                console.log(" proxyData.selectArea===");
-                console.log(proxyData.selectArea);
+                // if (!proxyData.selectArea.disabled) {
+                //   proxyData.setSelectSpacePosition(proxyData.selectArea);
+                // } else {
+                //   proxyData.selectArea = {};
+                // }
                 proxyData.setSelectSpacePosition(proxyData.selectArea);
                 proxyData.setSelectSpacePosition(proxyData.selectArea);
               }
               }
               // 接口返回后设置地图缩放和滚动
               // 接口返回后设置地图缩放和滚动
@@ -1145,7 +1149,9 @@ export default defineComponent({
       },
       },
       // 设备模块初始化地图
       // 设备模块初始化地图
       init(item: any) {
       init(item: any) {
-        // proxyData.setDefaultSpace(item);
+        if (item) {
+          proxyData.setDefaultSpace(item);
+        }
         /**
         /**
          *缓存建筑对应的楼层
          *缓存建筑对应的楼层
          */
          */
@@ -1197,9 +1203,11 @@ export default defineComponent({
     watch(
     watch(
       props,
       props,
       (newProps: any) => {
       (newProps: any) => {
+        let item: any = props.spaceInfo;
         proxyData.buildingItem.buildingId = newProps.buildingId;
         proxyData.buildingItem.buildingId = newProps.buildingId;
         proxyData.floorItem.id = newProps.floorId;
         proxyData.floorItem.id = newProps.floorId;
         // proxyData.selectArea.spaceId = newProps.spaceInfo.spaceId;
         // proxyData.selectArea.spaceId = newProps.spaceInfo.spaceId;
+        // proxyData.init(item);
       },
       },
       {
       {
         deep: false,
         deep: false,
@@ -1208,12 +1216,11 @@ export default defineComponent({
     );
     );
     onMounted(() => {
     onMounted(() => {
       let item: any = props.spaceInfo;
       let item: any = props.spaceInfo;
-      console.log("props.spaceInfo===");
-      console.log(proxyData.selectArea);
-      console.log(props.spaceInfo);
+      console.log(item);
       proxyData.buildingItem.buildingId = props.buildingId;
       proxyData.buildingItem.buildingId = props.buildingId;
       proxyData.floorItem.id = props.floorId;
       proxyData.floorItem.id = props.floorId;
-      // proxyData.selectArea.spaceId = item.spaceId;
+      item.buildingId = props.buildingId;
+      item.floorId = props.floorId;
       proxyData.init(item);
       proxyData.init(item);
     });
     });
     return {
     return {
@@ -1309,6 +1316,9 @@ export default defineComponent({
   .select {
   .select {
     border: 2px solid rgba(77, 148, 255, 0.8);
     border: 2px solid rgba(77, 148, 255, 0.8);
   }
   }
+  .select-disable {
+    border: 2px solid rgba(77, 148, 255, 0.2);
+  }
 
 
   .use-select {
   .use-select {
     border: 5px solid #ffe823;
     border: 5px solid #ffe823;

+ 16 - 13
src/views/envmonitor/components/Map/index.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
   <div class="map-home">
   <div class="map-home">
     <map-box
     <map-box
-      v-if="showMap && floorId"
+      v-if="showMap == true && floorId"
       :spaceData="spaceData"
       :spaceData="spaceData"
       :projectId="projectId"
       :projectId="projectId"
       :floorId="floorId"
       :floorId="floorId"
@@ -10,7 +10,7 @@
       @changeSpace="changeSpace"
       @changeSpace="changeSpace"
     ></map-box>
     ></map-box>
     <space-box
     <space-box
-      v-else
+      v-if="showMap == false"
       :spaceData="spaceData"
       :spaceData="spaceData"
       @changeSpace="changeSpace"
       @changeSpace="changeSpace"
     ></space-box>
     ></space-box>
@@ -71,14 +71,16 @@ export default defineComponent({
   },
   },
   setup(props, contex) {
   setup(props, contex) {
     let router: any = useRouter();
     let router: any = useRouter();
+    let showMap: any = null;
     const store = useStore();
     const store = useStore();
     const proxyData = reactive({
     const proxyData = reactive({
       spaceData: props.spaceData,
       spaceData: props.spaceData,
-      showMap: false, // 是否展示地图
+      showMap: showMap, // 是否展示地图
       // 切换空间
       // 切换空间
       changeSpace(item: any) {
       changeSpace(item: any) {
         contex.emit("changeSpace", item, 1);
         contex.emit("changeSpace", item, 1);
       },
       },
+      buildingId: props.buildingId,
       floorId: props.floorId,
       floorId: props.floorId,
       spaceInfo: props.spaceInfo,
       spaceInfo: props.spaceInfo,
       /**
       /**
@@ -91,11 +93,12 @@ export default defineComponent({
         };
         };
         getMapInfo(params)
         getMapInfo(params)
           .then((res) => {
           .then((res) => {
+            // debugger
             let resData: any = res;
             let resData: any = res;
             if (resData.result === "success") {
             if (resData.result === "success") {
               let data: any = resData?.data ?? null;
               let data: any = resData?.data ?? null;
               // debugger
               // debugger
-              if (data) {
+              if (data && data.spaceList && data.spaceList.length) {
                 proxyData.showMap = true;
                 proxyData.showMap = true;
               } else {
               } else {
                 proxyData.showMap = false;
                 proxyData.showMap = false;
@@ -107,23 +110,23 @@ export default defineComponent({
           .catch(() => {
           .catch(() => {
             proxyData.showMap = false;
             proxyData.showMap = false;
           });
           });
-      }
+      },
+    });
+    onMounted(() => {
+      proxyData.getMapInfo();
     });
     });
-    onMounted(() => {});
     watch(
     watch(
       props,
       props,
       (newProps: any) => {
       (newProps: any) => {
         proxyData.spaceData = newProps.spaceData;
         proxyData.spaceData = newProps.spaceData;
+        proxyData.buildingId = newProps.buildingId;
         proxyData.floorId = newProps.floorId;
         proxyData.floorId = newProps.floorId;
         proxyData.spaceInfo = newProps.spaceInfo;
         proxyData.spaceInfo = newProps.spaceInfo;
-        // console.log("proxyData.spaceInfo===")
-        // console.log(proxyData.spaceInfo)
-        proxyData.getMapInfo();
-      },
-      {
-        deep: false,
-        immediate: true,
       }
       }
+      // {
+      //   deep: false,
+      //   immediate: true,
+      // }
     );
     );
     return {
     return {
       ...toRefs(proxyData),
       ...toRefs(proxyData),

+ 52 - 2
src/views/envmonitor/components/workOvertime/WorkConfig.vue

@@ -69,7 +69,7 @@ export default defineComponent({
     },
     },
   },
   },
   components: {
   components: {
-    LeaveDailog
+    LeaveDailog,
   },
   },
   setup(props, contx) {
   setup(props, contx) {
     const proxyGlobal: any = getCurrentInstance();
     const proxyGlobal: any = getCurrentInstance();
@@ -98,8 +98,58 @@ export default defineComponent({
         contx.emit("triggerWork");
         contx.emit("triggerWork");
       },
       },
       timerText: timerText,
       timerText: timerText,
+      text: "",
       // 处理时间和第二天和未来连续的问题
       // 处理时间和第二天和未来连续的问题
-      formateTimeContinuous() {},
+      formateTimeContinuous(
+        index: any = 1,
+        startTime: any,
+        endTime: any,
+        type: any = 1
+      ) {
+        let data: any = proxyData.workkArr;
+        let text: any = "";
+        if (type === 1) {
+          // 工作时间连续的问题
+          if (endTime === 240000) {
+            // 处理时间连续的问题
+            let date: any = formatDateStr(data[index].date);
+            let cusStartTime: any = data[index].cusStartTime;
+            let cusEndTime: any = data[index].cusEndTime;
+            // let customSceneList: any = data[index]?.customSceneList ?? [];
+            if (cusStartTime === "000000") {
+              text = data[index].week;
+              endTime = cusEndTime;
+            }
+            customSceneList.map((item: any) => {
+              if (item.startTime === "000000") {
+                text = data[index].week;
+                endTime = item.endTime;
+              } else if (endTime === item.startTime) {
+                text = data[index].week;
+                endTime = item.endTime;
+              }
+              if (endTime === cusStartTime) {
+                text = data[index].week;
+                endTime = cusEndTime;
+              }
+            });
+          }
+          if (text) {
+            proxyData.text = text;
+            let nowIndex: any = index + 1;
+            if (nowIndex < data.length - 1) {
+              proxyData.formateTimeContinuous(nowIndex, startTime, endTime, 1);
+            }
+          }
+        } else {
+          // 预约时候后找最近的一段预约时间
+          let cusStartTime: any = data[index].cusStartTime;
+          let cusEndTime: any = data[index].cusEndTime;
+          if(cusStartTime && cusEndTime){
+            
+          }
+        }
+      },
       // 判断当前时间在不在加班时间里面
       // 判断当前时间在不在加班时间里面
       beforeWorkTime(data: any, nowTime: any) {
       beforeWorkTime(data: any, nowTime: any) {
         let flag: any = true; // 是否在所有加班时间之前
         let flag: any = true; // 是否在所有加班时间之前

+ 8 - 3
src/views/envmonitor/components/workOvertime/index.vue

@@ -43,7 +43,7 @@
       </div>
       </div>
     </div>
     </div>
     <div class="add-time-btn">
     <div class="add-time-btn">
-      <div class="cancel-btn">取消</div>
+      <div class="cancel-btn" @click="closeWorkTimer">取消</div>
       <div
       <div
         class="comfirm-btn"
         class="comfirm-btn"
         :class="formBtn ? 'comfirm-btn-diabled' : ''"
         :class="formBtn ? 'comfirm-btn-diabled' : ''"
@@ -975,6 +975,10 @@ export default defineComponent({
           return [];
           return [];
         }
         }
       },
       },
+      // 关闭加班弹窗
+      closeWorkTimer() {
+        proxyData.formBtn = false;
+      },
       // 提交申请
       // 提交申请
       addWorkTimer() {
       addWorkTimer() {
         let formTimerArr: any = proxyData.formateAddTimer();
         let formTimerArr: any = proxyData.formateAddTimer();
@@ -992,8 +996,9 @@ export default defineComponent({
               proxyGlobal.proxy.$loadinngEnd();
               proxyGlobal.proxy.$loadinngEnd();
               if (type === 1) {
               if (type === 1) {
                 context.emit("closeWork");
                 context.emit("closeWork");
-              } else if (type === 2) {  // 删除
-                proxyData.setWorkTimeList()
+              } else if (type === 2) {
+                // 删除
+                proxyData.setWorkTimeList();
               }
               }
               timer = null;
               timer = null;
               clearTimeout(timer);
               clearTimeout(timer);

+ 20 - 4
src/views/envmonitor/index.vue

@@ -9,8 +9,8 @@
           alt=""
           alt=""
         />
         />
         <div class="left-time">
         <div class="left-time">
-          <span>2022.06.01 </span>
-          <span>10:10周一</span>
+          <span>{{ nowDate }} </span>
+          <span>{{ nowWeek }}</span>
         </div>
         </div>
         <div class="weather">
         <div class="weather">
           {{ outWeather.temperature ? outWeather.temperature : "--" }}℃
           {{ outWeather.temperature ? outWeather.temperature : "--" }}℃
@@ -102,7 +102,13 @@
     </div>
     </div>
     <div class="main-right">
     <div class="main-right">
       <!--加班start-->
       <!--加班start-->
-      <div class="work-btn" v-if="roomType === '开放' || roomType === '会议室'">
+      <div
+        class="work-btn"
+        v-if="
+          (roomType === '开放' && isWork) ||
+          (roomType === '会议室' && scenarioArr && scenarioArr.length)
+        "
+      >
         <!-- {{roomType}} -->
         <!-- {{roomType}} -->
         <work-config
         <work-config
           v-if="roomType === '开放' && isWork"
           v-if="roomType === '开放' && isWork"
@@ -203,6 +209,7 @@
       teleport="#app"
       teleport="#app"
     >
     >
       <com-map
       <com-map
+        v-if="spaceInfo.spaceId"
         :spaceData="spaceData"
         :spaceData="spaceData"
         :spaceInfo="spaceInfo"
         :spaceInfo="spaceInfo"
         :projectId="projectId"
         :projectId="projectId"
@@ -269,6 +276,7 @@ import {
   formatDate,
   formatDate,
   getHours,
   getHours,
   getLocalNewSpaceInfo,
   getLocalNewSpaceInfo,
+  getNowWeek,
   getUserInfo,
   getUserInfo,
   parseImgUrl,
   parseImgUrl,
   setQueryConfig,
   setQueryConfig,
@@ -473,8 +481,12 @@ export default defineComponent({
     let workkArr: any = [];
     let workkArr: any = [];
     let spaceData: any = [];
     let spaceData: any = [];
     let secenTimer: any = {};
     let secenTimer: any = {};
+    let nowDate: any = formatDate("YYYY.MM.DD HH:mm");
+    let nowWeek: any = getNowWeek();
     const proxyData = reactive({
     const proxyData = reactive({
       parseImgUrl: parseImgUrl,
       parseImgUrl: parseImgUrl,
+      nowDate: nowDate,
+      nowWeek: nowWeek,
       isShowWork: false,
       isShowWork: false,
       isShowMetting: false,
       isShowMetting: false,
       localName: "",
       localName: "",
@@ -790,6 +802,7 @@ export default defineComponent({
           // 获取会议室场
           // 获取会议室场
           proxyData.getPageMeetingSceneHttp();
           proxyData.getPageMeetingSceneHttp();
         } else if (roomType === "开放") {
         } else if (roomType === "开放") {
+          // debugger
           proxyData.roomType = "开放";
           proxyData.roomType = "开放";
           proxyData.headerInfo.headImg = parseImgUrl(
           proxyData.headerInfo.headImg = parseImgUrl(
             "page-officehome",
             "page-officehome",
@@ -1169,7 +1182,7 @@ export default defineComponent({
       },
       },
       // 获取空间下的设备信息
       // 获取空间下的设备信息
       getEquipments() {
       getEquipments() {
-        let params: { spaceId: string;} = {
+        let params: { spaceId: string } = {
           spaceId: proxyData.spaceInfo.spaceId,
           spaceId: proxyData.spaceInfo.spaceId,
           // projectId: proxyData.projectId,
           // projectId: proxyData.projectId,
         };
         };
@@ -1471,6 +1484,7 @@ export default defineComponent({
           spaceId: proxyData.spaceInfo.spaceId,
           spaceId: proxyData.spaceInfo.spaceId,
         };
         };
         let str: any = setQueryConfig(params);
         let str: any = setQueryConfig(params);
+        // debugger;
         querySpaceSceneConfig(str).then((res) => {
         querySpaceSceneConfig(str).then((res) => {
           let resData: any = res;
           let resData: any = res;
           let data: any = resData?.data ?? [];
           let data: any = resData?.data ?? [];
@@ -1633,6 +1647,8 @@ export default defineComponent({
         proxyData.clearTimerSpaceInfo();
         proxyData.clearTimerSpaceInfo();
         // 重置当前选中空间的状态
         // 重置当前选中空间的状态
         proxyData.resetSpaceStatus();
         proxyData.resetSpaceStatus();
+        proxyData.roomType = "";
+        proxyData.isWork = false;
         proxyData.spaceInfo = item;
         proxyData.spaceInfo = item;
         proxyData.init();
         proxyData.init();
         if (type === 1) {
         if (type === 1) {

+ 1 - 1
src/views/home/index.vue

@@ -1,7 +1,7 @@
 <template>
 <template>
   <div class="home">
   <div class="home">
     <div class="home-btn" @click="checkLoginType">
     <div class="home-btn" @click="checkLoginType">
-      <span v-if="type === 1">二维码登录</span>
+      <span v-if="type ===2">二维码登录</span>
       <span v-else>账号登录</span>
       <span v-else>账号登录</span>
     </div>
     </div>
     <div class="home-content">
     <div class="home-content">