Browse Source

fix: 加班的bug处理

chenzhen2 2 years ago
parent
commit
ff81454258

+ 6 - 6
src/apis/envmonitor.ts

@@ -74,7 +74,7 @@ export const changeSetTimeHttp = (params: any) => {
 }
 //  详情页面的图表数据
 export const getChartListHTTP = (params: any) => {
-  return https().request<RootObject<any>>(`/test1/spaceAdjust/queryPropertyData?${params}`, Method.GET, undefined, ContentType.json)
+  return https().request<RootObject<any>>(`${duoduoenvService}/spaceAdjust/queryPropertyData?${params}`, Method.GET, undefined, ContentType.json)
 }
 
 // 查询建筑的信息
@@ -185,28 +185,28 @@ export const saveBatchCustomScene = (data: any) => {
  *  查询默认位置
  */
 export const getDefaultLocation = (params: any) => {
-  return https().request<any>(`${testApi}padSpace/getDefaultLocation?${params}`, Method.GET, undefined, ContentType.json)
+  return https().request<any>(`${setupService}padSpace/getDefaultLocation?${params}`, Method.GET, undefined, ContentType.json)
 }
 
 /**
  * 查询空间列表
  */
 export const getPadSpaceList = (params: any) => {
-  return https().request<any>(`${testApi}padSpace/getPadSpaceList?${params}`, Method.GET, undefined, ContentType.json)
+  return https().request<any>(`${setupService}padSpace/getPadSpaceList?${params}`, Method.GET, undefined, ContentType.json)
 }
 
 /**
  * 设置成办公空间
  */
 export const saveWorkSpace = (params: any) => {
-  return https().request<any>(`${testApi}padSpace/saveWorkSpace`, Method.POST, params, ContentType.json)
+  return https().request<any>(`${setupService}padSpace/saveWorkSpace`, Method.POST, params, ContentType.json)
 }
 
 /**
  * 查询平板下面的办公空间
  */
 export const queryWorkSpace = (params: any) => {
-  return https().request<any>(`${testApi}padSpace/queryWorkSpace`, Method.POST, params, ContentType.json)
+  return https().request<any>(`${setupService}padSpace/queryWorkSpace`, Method.POST, params, ContentType.json)
 }
 
 /**
@@ -221,7 +221,7 @@ export const queryCustomerservice = (params: any) => {
  * 获取二维码状态
  */
 export const getPadQrCodeStatus = (params: any) => {
-  return https().request<any>(`${testApi}padLogin/getPadQrCodeStatus?${params}`, Method.GET, undefined, ContentType.json)
+  return https().request<any>(`${setupService}padLogin/getPadQrCodeStatus?${params}`, Method.GET, undefined, ContentType.json)
 }
 
 

+ 1 - 1
src/utils/https.ts

@@ -5,7 +5,7 @@ import { getToken } from '@/utils/cookies'
 import { Toast } from 'vant'
 import Cookies from 'js-cookie'
 import { request } from 'http'
-import { getUserInfo, setQueryConfig } from '.'
+import { getComparams, getUserInfo, setQueryConfig } from '.'
 
 export const https = (configobj: any = { timeout: '' }) => {
   // debugger

+ 19 - 17
src/utils/index.ts

@@ -126,23 +126,25 @@ export const getUserInfo = function () {
   return paramsInfo
 }
 
-// // 地址通用参赛携带
-// export const getComparams = function () {
-//   let userInfo = store.state.user
-//   let paramsInfo: any = {
-//     openid: Keys.openid,
-//     userId: userInfo.userId,
-//     pubname: Keys.pubname,
-//     projectId: userInfo.projectId
-//   }
-//   if (userInfo.userName) {
-//     paramsInfo.userName = userInfo.userName
-//   }
-//   if (userInfo.userPhone) {
-//     paramsInfo.userPhone = userInfo.userPhone
-//   }
-//   return paramsInfo
-// }
+
+// 地址通用参赛携带
+export const getComparams = function () {
+  let userInfo = store.state.user
+  let paramsInfo: any = {
+    openid: Keys.openid,
+    userId: userInfo.userId,
+    pubname: Keys.pubname,
+    mac:userInfo.mac,
+    projectId: userInfo.projectId
+  }
+  if (userInfo.userName) {
+    paramsInfo.userName = userInfo.userName
+  }
+  if (userInfo.userPhone) {
+    paramsInfo.userPhone = userInfo.userPhone
+  }
+  return paramsInfo
+}
 
 export const formatDate = function (split: string = 'YYYYMMDD', date: any = new Date()) {
   //三目运算符

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

@@ -602,10 +602,10 @@ export default defineComponent({
             data[i].cusStartTime
           );
           let cusEndTime: any = proxyData.parseCusEndTime(data[i].cusEndTime);
-          let isActive: Boolean = false;
+          // let isActive: Boolean = false;
           let week: any = getWeekDate(new Date(date).getDay());
           if (date === nowDate) {
-            isActive = true;
+            // isActive = true;
             week = "今天";
           }
           let timerArr: any = [];
@@ -668,7 +668,7 @@ export default defineComponent({
 
           proxyData.dateArr.push({
             date: date,
-            isActive: isActive,
+            isActive: false,
             oldDate: data[i].date,
             objectId: data[i].objectId,
             cusStartTime: data[i].cusStartTime,
@@ -992,6 +992,8 @@ export default defineComponent({
               proxyGlobal.proxy.$loadinngEnd();
               if (type === 1) {
                 context.emit("closeWork");
+              } else if (type === 2) {  // 删除
+                proxyData.setWorkTimeList()
               }
               timer = null;
               clearTimeout(timer);
@@ -1028,6 +1030,7 @@ export default defineComponent({
     watch(props, (newProps: any) => {
       proxyData.workkArr = newProps.workkArr;
       proxyData.projectId = newProps.projectId;
+      // console.log("数据更新了")
       // proxyData.setWorkTimeList();
       // proxyData.getWorkTimeList();
     });

+ 7 - 9
src/views/envmonitor/detail.vue

@@ -495,6 +495,7 @@ export default defineComponent({
         // debugger
         proxyData.activeItem.options = null;
         let funcidArr = funcid.split(",");
+        // debugger
         let chartData1: any = await proxyData.getData(funcidArr[0]);
         let chartData2: any = await proxyData.getData(funcidArr[1]);
         proxyData.loadinngEnd();
@@ -512,11 +513,10 @@ export default defineComponent({
             trigger: "axis",
           },
           legend: {
-            top: 10,
             icon: "circle",
             itemWidth: 14,
             itemHeight: 5,
-            itemGap: 100,
+            itemGap: 20,
             data: ["温度", "湿度"],
             textStyle: {
               fontSize: 12,
@@ -524,7 +524,7 @@ export default defineComponent({
             },
           },
           grid: {
-            top: 50,
+            top: 30,
             left: 5,
             right: 15,
             bottom: 20,
@@ -719,13 +719,11 @@ export default defineComponent({
     watch(
       props,
       (newProps: any) => {
-        proxyData.query = newProps.query;
+        proxyData.query = JSON.parse(JSON.stringify(newProps.query));
         // 设置当前选中的tab
-        proxyData.setActiveItem();
-        proxyData.queryAllData();
       },
       {
-        deep: false,
+        deep: true,
         immediate: true,
       }
     );
@@ -773,8 +771,8 @@ export default defineComponent({
 }
 .chart-box {
   width: 100%;
-  height: 277px;
-  padding-top: 20px;
+  height: 280px;
+  padding-top: 10px;
   background: #fff;
 }
 

+ 9 - 3
src/views/envmonitor/index.vue

@@ -1169,9 +1169,9 @@ export default defineComponent({
       },
       // 获取空间下的设备信息
       getEquipments() {
-        let params: { spaceId: string; projectId: string } = {
+        let params: { spaceId: string;} = {
           spaceId: proxyData.spaceInfo.spaceId,
-          projectId: proxyData.projectId,
+          // projectId: proxyData.projectId,
         };
         /**
          *重新获取设备的时候,先初始化数据
@@ -1483,7 +1483,7 @@ export default defineComponent({
        */
       workkArr: workkArr,
       secenTimer: secenTimer,
-      queryCustomAndScenceTimer(timer: any = 5000) {
+      queryCustomAndScenceTimer(timer: any = 10000) {
         if (proxyData.secenTimer) {
           clearTimeout(proxyData.secenTimer);
           proxyData.secenTimer = null;
@@ -1730,6 +1730,12 @@ export default defineComponent({
         height: 20px;
         margin-right: 5px;
       }
+      .weather-icon {
+        width: 24px;
+        height: 24px;
+        display: inline-block;
+        vertical-align: middle;
+      }
       div {
         vertical-align: middle;
         display: inline-block;