Pārlūkot izejas kodu

fix: 空间列表接口连调

chenzhen2 2 gadi atpakaļ
vecāks
revīzija
35978c21f9

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 4 - 0
public/images/ipdImages/co2.svg


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 16 - 0
public/images/ipdImages/jiaquan.svg


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 8 - 0
public/images/ipdImages/pm2.5.svg


+ 9 - 0
public/images/ipdImages/rectangle-active.svg

@@ -0,0 +1,9 @@
+<svg width="193" height="40" viewBox="0 0 193 40" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M0 40L-1.74846e-06 7.62939e-06L153 9.41552e-07C167.001 3.29535e-07 174.002 2.35269e-08 179.35 2.72483C184.054 5.12167 187.878 8.94619 190.275 13.6502C193 18.998 193 25.9987 193 40L0 40Z" fill="url(#paint0_linear_998_8038)"/>
+<defs>
+<linearGradient id="paint0_linear_998_8038" x1="-8.74228e-07" y1="20" x2="193" y2="20" gradientUnits="userSpaceOnUse">
+<stop stop-color="#C5A861"/>
+<stop offset="1" stop-color="#EBD9A8"/>
+</linearGradient>
+</defs>
+</svg>

+ 9 - 0
public/images/ipdImages/rectangle1.svg

@@ -0,0 +1,9 @@
+<svg width="195" height="40" viewBox="0 0 195 40" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M0 40L-1.74846e-06 7.62939e-06L155 8.54129e-07C169.001 2.42113e-07 176.002 -6.38958e-08 181.35 2.72483C186.054 5.12167 189.878 8.94619 192.275 13.6502C195 18.998 195 25.9987 195 40L0 40Z" fill="url(#paint0_linear_998_8035)"/>
+<defs>
+<linearGradient id="paint0_linear_998_8035" x1="195" y1="27" x2="38.7329" y2="27" gradientUnits="userSpaceOnUse">
+<stop stop-color="#414141"/>
+<stop offset="1" stop-color="#282828"/>
+</linearGradient>
+</defs>
+</svg>

+ 9 - 0
public/images/ipdImages/rectangle2.svg

@@ -0,0 +1,9 @@
+<svg width="195" height="40" viewBox="0 0 195 40" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M0 40L-1.74846e-06 7.62939e-06L155 8.54129e-07C169.001 2.42113e-07 176.002 -6.38958e-08 181.35 2.72483C186.054 5.12167 189.878 8.94619 192.275 13.6502C195 18.998 195 25.9987 195 40L0 40Z" fill="url(#paint0_linear_1040_8060)"/>
+<defs>
+<linearGradient id="paint0_linear_1040_8060" x1="195" y1="27" x2="38.7329" y2="27" gradientUnits="userSpaceOnUse">
+<stop stop-color="#414141"/>
+<stop offset="1" stop-color="#282828"/>
+</linearGradient>
+</defs>
+</svg>

+ 9 - 0
public/images/ipdImages/rectangle3.svg

@@ -0,0 +1,9 @@
+<svg width="160" height="40" viewBox="0 0 160 40" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M0 40L-1.74846e-06 0L120 -5.24537e-06C134.001 -5.85738e-06 141.002 -6.16339e-06 146.35 2.72483C151.054 5.12166 154.878 8.94618 157.275 13.6502C160 18.998 160 25.9987 160 40L0 40Z" fill="url(#paint0_linear_998_8032)"/>
+<defs>
+<linearGradient id="paint0_linear_998_8032" x1="160" y1="27" x2="31.7808" y2="27" gradientUnits="userSpaceOnUse">
+<stop stop-color="#414141"/>
+<stop offset="1" stop-color="#282828"/>
+</linearGradient>
+</defs>
+</svg>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 26 - 0
public/images/ipdImages/shanggeyun_logo.svg


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 3 - 0
public/images/ipdImages/shidu.svg


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 3 - 0
public/images/ipdImages/template-icon.svg


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 3 - 0
public/images/ipdImages/vector-active.svg


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 3 - 0
public/images/ipdImages/vector.svg


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 4 - 0
public/images/ipdImages/weixin.svg


+ 7 - 0
src/apis/envmonitor.ts

@@ -185,4 +185,11 @@ export const queryCustomAndScence = (params: any) => {
   return https().request<any>(`${duoduoenvService}customScene/queryCustomAndScence?${comParams}&${params}`, Method.GET, undefined, ContentType.json)
 }
 
+/**
+ *  查询默认位置
+ */
+ export const getDefaultLocation = (params: any) => {
+  return https().request<any>(`${testApi}padSpace/getDefaultLocation?${comParams}&${params}`, Method.GET, undefined, ContentType.json)
+}
+
 

+ 2 - 0
src/styles/_variables.scss

@@ -29,6 +29,8 @@ $elActive4: rgba(206, 159, 39, 0.4);
 $elActiveText: #fff;
 $elDeleteColor: #E5574F;
 $bg: '/borui/images/page-officehome/officehome.jpg';
+$headerHeight:48px;
+$headerHeightPading:58px;
 
 // The :export directive is the magic sauce for webpack
 // https://mattferderer.com/use-sass-variables-in-typescript-and-javascript

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

@@ -56,9 +56,12 @@
 
 <script lang="ts">
 import { defineComponent, nextTick, onMounted, reactive, toRefs } from "vue";
-import { useRoute,useRouter, onBeforeRouteUpdate } from "vue-router";
+import { useRoute, useRouter, onBeforeRouteUpdate } from "vue-router";
 import { Search, TreeSelect, Popup, Checkbox } from "vant";
-import { parseImgUrl } from "@/utils";
+import { parseImgUrl, setQueryConfig } from "@/utils";
+import { store } from "@/store";
+import { UserMutationTypes } from "@/store/modules/user/mutation-types";
+import { getBuildingList, getDefaultLocation } from "@/apis/envmonitor";
 
 export default defineComponent({
   components: {
@@ -89,6 +92,7 @@ export default defineComponent({
         ],
       },
     ];
+    const buildingData: any = [];
     const proxyData = reactive({
       parseImgUrl: parseImgUrl,
       checked: false,
@@ -110,10 +114,49 @@ export default defineComponent({
       showSpaceTypePounp() {
         proxyData.showSpaceType = !proxyData.showSpaceType;
       },
+      // 设置建筑id
+      setProjectId() {
+        let nowProjectId: any = route.query.id;
+        store.commit(UserMutationTypes.SET_PROJECT_ID, nowProjectId);
+      },
+      buildingData: buildingData,
+      // 获取建筑列表
+      getBuildingList() {
+        let params: any = {
+          criteria: {
+            projectId: store.state.user.projectId, //类型:String  必有字段  备注:项目id
+          },
+        };
+        getBuildingList(params).then((res) => {
+          let resData: any = res;
+          if (resData.result === "success") {
+            let content: any = resData?.content ?? [];
+            proxyData.buildingData = content;
+          } else {
+            proxyData.buildingData = [];
+          }
+        });
+      },
+      // 查询当前平板的默认空间
+      getDefaultLocation() {
+        let params: any = {
+          macAddress: "test",
+          projectId: store.state.user.projectId,
+        };
+        let paramsStr: any = setQueryConfig(params);
+        getDefaultLocation(paramsStr).then((res) => {
+          let resData: any = res;
+        });
+      },
       // 设置主空间
-      goNext(){
-        router.push({name:'setMainSpace'})
-      }
+      goNext() {
+        router.push({ name: "setMainSpace" });
+      },
+    });
+    onMounted(() => {
+      console.log("lll=====")
+      proxyData.setProjectId();
+      proxyData.getDefaultLocation();
     });
     return {
       ...toRefs(proxyData),
@@ -125,8 +168,12 @@ export default defineComponent({
 @import "~@/styles/comMedia.scss";
 .choice-space {
   .search {
+    position: fixed;
+    top: 48px;
+    left: 0;
     display: flex;
     padding: 0 20px;
+    z-index: 333;
     .arrow-down {
       position: absolute;
       right: 16px;
@@ -194,7 +241,7 @@ export default defineComponent({
   .space-content {
     // display: flex;
     width: 100%;
-    padding-top: 20px;
+    padding-top: $headerHeightPading;
     padding-right: 20px;
     padding-left: 4px;
     padding-bottom: 70px;

+ 2 - 1
src/views/envmonitor/components/WorkConfig.vue

@@ -87,8 +87,9 @@ export default defineComponent({
           console.log("nowTime===" + nowTime);
           if (date === nowDate) {
             // 1.当天没有服务定制时间和加班时间
-            /**a.未来有服务定制和加班**/
+               /**a.未来有服务定制和加班**/
             // 2.当天有服务定制时间无加班时间
+             // 当天在服务定制之内+加班+和未来的时间连续  
             // a.在服务定制之内
             // b.已过了服务定制和1相同处理
             // 3.当天有服务定制和加班时间

+ 279 - 6
src/views/envmonitor/index.vue

@@ -1,6 +1,60 @@
 <template>
   <div class="main">
-    <div class="main-left"></div>
+    <div class="main-left">
+      <div class="left-top">
+        <img :src="parseImgUrl('ipdImages', 'shanggeyun_logo.svg')" />
+        <div class="left-time">
+          <span>2022.06.01 </span>
+          <span>10:10周一</span>
+        </div>
+        <div class="weather">
+          {{ outWeather.temperature ? outWeather.temperature : "--" }}℃
+        </div>
+        <div class="weixiin">
+          <img :src="parseImgUrl('ipdImages', 'weixin.svg')" />
+          <span> 联系客户</span>
+        </div>
+      </div>
+      <div class="left-space">
+        <div class="text">
+          <div>博锐研发中心二区</div>
+          <div>
+            <img :src="parseImgUrl('ipdImages', 'vector.svg')" />
+            <span>无人</span>
+          </div>
+        </div>
+        <div class="space-info">
+          <div class="space-temp">
+            <img :src="parseImgUrl('ipdImages', 'template-icon.svg')" alt="" />
+            <span class="temp-text">温度摄氏度</span>
+            <span class="temp-num">26<sup>℃</sup></span>
+          </div>
+        </div>
+        <div class="space-env">
+          <div class="env-item" :key="'env' + index" v-for="(item, index) in 3">
+            <div>
+              <img :src="parseImgUrl('ipdImages', 'jiaquan.svg')" alt="" />
+              <span>甲醛</span>
+            </div>
+            <div>0.01 <sup> mg/㎡ </sup></div>
+          </div>
+        </div>
+      </div>
+      <div class="fotter">
+        <div class="fotter-item">
+          <img :src="parseImgUrl('ipdImages', 'rectangle1.svg')" />
+          <span>博锐研发中心二区 </span>
+        </div>
+        <div class="fotter-item">
+          <img :src="parseImgUrl('ipdImages', 'rectangle3.svg')" />
+          <span>博锐研发中心二区 </span>
+        </div>
+        <div class="fotter-item">
+          <img :src="parseImgUrl('ipdImages', 'rectangle3.svg')" />
+          <span>博锐研发中心二区 </span>
+        </div>
+      </div>
+    </div>
     <div class="main-right popup-content">
       <!--加班start-->
       <div class="work-btn">
@@ -10,7 +64,8 @@
             roomType === '开放' &&
             scenarioArr &&
             scenarioArr.length &&
-            scenarioArr[0].sceneType === 'OVERTIME'"
+            scenarioArr[0].sceneType === 'OVERTIME'
+          "
           :scenarioArr="scenarioArr"
           :workkArr="workkArr"
           @triggerWork="triggerWork"
@@ -55,7 +110,7 @@
       teleport="#app"
     >
       <div class="work-content">
-        <work-overtime v-if="isShowWork"  :workkArr="workkArr"></work-overtime>
+        <work-overtime v-if="isShowWork" :workkArr="workkArr"></work-overtime>
       </div>
     </van-popup>
   </div>
@@ -1482,9 +1537,7 @@ export default defineComponent({
         });
       },
       // 格式化当前页面展示的时间
-      formateWorkTime(){
-
-      },
+      formateWorkTime() {},
       /**
        * 空间相关的接口
        */
@@ -1556,6 +1609,8 @@ export default defineComponent({
 </script>
 <style lang="scss" scoped>
 .main {
+  display: flex;
+  justify-content: space-between;
   width: 100%;
   height: 100%;
   box-sizing: border-box;
@@ -1565,9 +1620,178 @@ export default defineComponent({
   background-size: 100% 100%;
 
   .main-left {
+    padding-left: 20px;
     display: inline-block;
     //width: 54%;
     width: calc(100% - 330px);
+    .left-top {
+      img {
+        display: inline-block;
+        vertical-align: middle;
+        width: 60px;
+        height: 20px;
+        margin-right: 5px;
+      }
+      div {
+        vertical-align: middle;
+        display: inline-block;
+        font-family: "Montserrat";
+        font-style: normal;
+        font-weight: 400;
+        font-size: 16px;
+        line-height: 20px;
+        color: #ffffff;
+        span {
+          display: inline-block;
+          vertical-align: middle;
+          &:nth-child(1) {
+            padding: 10px;
+          }
+        }
+      }
+      .weather {
+        padding-left: 22px;
+      }
+      .weixiin {
+        margin-left: 10px;
+        img {
+          width: 24px;
+          height: 24px;
+        }
+      }
+    }
+
+    .left-space {
+      padding-top: 124px;
+      padding-right: 80px;
+      .text {
+        position: relative;
+        div {
+          display: inline-block;
+          vertical-align: middle;
+          &:nth-child(1) {
+            font-style: normal;
+            font-weight: 500;
+            font-size: 40px;
+            line-height: 58px;
+            color: #ffffff;
+          }
+          &:nth-child(2) {
+            position: absolute;
+            bottom: 12px;
+            width: 55px;
+            height: 20px;
+            line-height: 20px;
+            text-align: center;
+            margin-left: 10px;
+            background: #edf1f5;
+            border-radius: 10px;
+            img {
+              display: inline-block;
+              vertical-align: middle;
+              width: 12px;
+              height: 12px;
+              // margin-top: 4px;
+            }
+            span {
+              display: inline-block;
+              vertical-align: middle;
+              margin-left: 4px;
+              font-weight: 400;
+              font-size: 12px;
+              line-height: 15px;
+              color: #8b949e;
+            }
+          }
+        }
+      }
+    }
+    .space-info {
+      padding-top: 48px;
+      .space-temp {
+        padding-bottom: 13px;
+        border-bottom: 0.5px solid rgba(255, 255, 255, 0.4);
+        img {
+          display: inline-block;
+          vertical-align: middle;
+          width: 22px;
+          height: 40px;
+        }
+        span {
+          display: inline-block;
+          vertical-align: middle;
+          padding-left: 14px;
+        }
+        .temp-text {
+          font-family: "Noto Sans SC";
+          font-style: normal;
+          font-weight: 500;
+          font-size: 32px;
+          line-height: 46px;
+          text-align: center;
+          color: #ffffff;
+          padding-left: 13px;
+        }
+        .temp-num {
+          padding-left: 24px;
+          font-family: "Montserrat";
+          font-style: normal;
+          font-weight: 400;
+          font-size: 60px;
+          line-height: 73px;
+          color: #ffffff;
+          sup {
+            font-family: "Noto Sans SC";
+            font-style: normal;
+            font-weight: 500;
+            font-size: 13px;
+            line-height: 19px;
+            color: #ffffff;
+          }
+        }
+      }
+    }
+    .space-env {
+      display: flex;
+      padding-top: 20px;
+      justify-content: space-between;
+      .env-item {
+        flex: 1;
+        div {
+          img {
+            display: inline-block;
+            vertical-align: middle;
+            width: 20px;
+            height: 20px;
+            margin-right: 5px;
+          }
+          span {
+            display: inline-block;
+            vertical-align: middle;
+            font-size: 16px;
+            line-height: 23px;
+            text-align: center;
+            color: #ffffff;
+          }
+          &:nth-child(2) {
+            padding-top: 10px;
+            font-family: "Montserrat";
+            font-style: normal;
+            font-weight: 400;
+            font-size: 32px;
+            line-height: 39px;
+            color: #ffffff;
+            sup {
+              font-family: "Noto Sans SC";
+              font-style: normal;
+              font-weight: 500;
+              font-size: 13px;
+              line-height: 19px;
+            }
+          }
+        }
+      }
+    }
   }
 
   .main-right {
@@ -1588,6 +1812,55 @@ export default defineComponent({
     width: 100%;
     background: #fff;
   }
+
+  .fotter {
+    position: fixed;
+    left: 0;
+    bottom: 0;
+    .fotter-item {
+      position: relative;
+      display: inline-block;
+      vertical-align: middle;
+      width: 195px;
+      height: 40px;
+      img {
+        width: 100%;
+      }
+      &:nth-child(1) {
+        left: 0;
+        z-index: 333;
+      }
+      &:nth-child(2) {
+        margin-left: -18px;
+        z-index: 222;
+      }
+      &:nth-child(3) {
+        margin-left: -18px;
+      }
+      span {
+        position: absolute;
+        display: inline-block;
+        width: 128px;
+        height: 18px;
+        left: 50%;
+        top: 50%;
+        transform: translateY(-40%) translateX(-50%);
+        font-family: "Noto Sans SC";
+        font-style: normal;
+        font-weight: 400;
+        font-size: 16px;
+        line-height: 18px;
+        text-align: center;
+        color: #c3c7cb;
+      }
+    }
+    .fotter-item-active {
+      margin-bottom: -2px;
+      span {
+        color: #1F2429;
+      }
+    }
+  }
 }
 </style>
 

+ 8 - 0
vue.config.js

@@ -84,6 +84,14 @@ module.exports = {
           '^/borui/server1': '/server'
         }
       },
+      '/test/': {
+        // target: 'https://duoduoenv.sagacloud.cn',
+        target: 'http://192.168.0.47:52015',
+        changeOrigin: true,
+        pathRewrite: {
+          '^/test': ''
+        }
+      },
       // '/api': {
       //   target: 'http://api.sagacloud.cn',
       //   changeOrigin: true,