Procházet zdrojové kódy

[Feat 0000] 时间选择器与选择时间绑定 打包问题修复

bobo04052021@163.com před 7 měsíci
rodič
revize
d41340d8d8

+ 6 - 0
.hbuilderx/launch.json

@@ -4,6 +4,12 @@
         {
             "playground" : "standard",
             "type" : "uni-app:app-android"
+        },
+        {
+            "app-plus" : {
+                "launchtype" : "local"
+            },
+            "type" : "uniCloud"
         }
     ]
 }

+ 15 - 0
.vscode/launch.json

@@ -0,0 +1,15 @@
+{
+  // 使用 IntelliSense 了解相关属性。 
+  // 悬停以查看现有属性的描述。
+  // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
+  "version": "0.2.0",
+  "configurations": [
+    {
+      "type": "chrome",
+      "request": "launch",
+      "name": "针对 localhost 启动 Chrome",
+      "url": "http://localhost:8080",
+      "webRoot": "${workspaceFolder}"
+    }
+  ]
+}

+ 180 - 162
common/luch-request/core/Request.js

@@ -9,30 +9,30 @@
  * hbuilderx:2.6.15
  */
 
-import buildURL from '../helpers/buildURL'
-import buildFullPath from './buildFullPath'
-import { isBoolean } from '../utils'
+import buildURL from "../helpers/buildURL";
+import buildFullPath from "./buildFullPath";
+import { isBoolean } from "../utils";
 
 export default class Request {
   config = {
-    baseUrl: '',
+    baseUrl: "",
     header: {},
-    method: 'GET',
-    dataType: 'json',
+    method: "GET",
+    dataType: "json",
     // #ifndef MP-ALIPAY || APP-PLUS
-    responseType: 'text',
+    responseType: "text",
     // #endif
     custom: {},
     // #ifdef MP-ALIPAY || MP-WEIXIN
     timeout: 30000,
     // #endif
     // #ifdef APP-PLUS
-    sslVerify: true,
+    sslVerify: false,
     // #endif
     // #ifdef H5
-    withCredentials: false
+    withCredentials: false,
     // #endif
-  }
+  };
 
   /**
    * @property {Function} request 请求拦截器
@@ -45,7 +45,7 @@ export default class Request {
      */
     request: (cb) => {
       if (cb) {
-        this.requestBeforeFun = cb
+        this.requestBeforeFun = cb;
       }
     },
     /**
@@ -54,25 +54,25 @@ export default class Request {
      */
     response: (cb, ecb) => {
       if (cb) {
-        this.requestComFun = cb
+        this.requestComFun = cb;
       }
       if (ecb) {
-        this.requestComFail = ecb
+        this.requestComFail = ecb;
       }
-    }
-  }
+    },
+  };
 
   requestBeforeFun = (config) => {
-    return config
-  }
+    return config;
+  };
 
   requestComFun = (response) => {
-    return response
-  }
+    return response;
+  };
 
   requestComFail = (response) => {
-    return response
-  }
+    return response;
+  };
 
   /**
    * 自定义验证器,如果返回true 则进入响应拦截器的响应成功函数(resolve),否则进入响应拦截器的响应错误函数(reject)
@@ -80,7 +80,7 @@ export default class Request {
    * @return { Boolean } 如果为true,则 resolve, 否则 reject
    */
   validateStatus(statusCode) {
-    return statusCode === 200
+    return statusCode === 200;
   }
 
   /**
@@ -88,7 +88,7 @@ export default class Request {
    * @param {Request~setConfigCallback} f - 设置全局默认配置
    */
   setConfig(f) {
-    this.config = f(this.config)
+    this.config = f(this.config);
   }
 
   /**
@@ -104,42 +104,50 @@ export default class Request {
    */
   async request(options = {}) {
     return new Promise((resolve, reject) => {
-      options.baseUrl = this.config.baseUrl
-      options.dataType = options.dataType || this.config.dataType
+      options.baseUrl = this.config.baseUrl;
+      options.dataType = options.dataType || this.config.dataType;
       // #ifndef MP-ALIPAY || APP-PLUS
-      options.responseType = options.responseType || this.config.responseType
+      options.responseType = options.responseType || this.config.responseType;
       // #endif
       // #ifdef MP-ALIPAY || MP-WEIXIN
-      options.timeout = options.timeout || this.config.timeout
+      options.timeout = options.timeout || this.config.timeout;
       // #endif
       // #ifdef H5
-      options.withCredentials = isBoolean(options.withCredentials) ? options.withCredentials : this.config.withCredentials
+      options.withCredentials = isBoolean(options.withCredentials)
+        ? options.withCredentials
+        : this.config.withCredentials;
       // #endif
-      options.url = options.url || ''
-      options.data = options.data || {}
-      options.params = options.params || {}
-      options.header = {...this.config.header, ...(options.header || {})}
-      options.method = options.method || this.config.method
-      options.custom =  {...this.config.custom,...(options.custom || {})}
+      options.url = options.url || "";
+      options.data = options.data || {};
+      options.params = options.params || {};
+      options.header = { ...this.config.header, ...(options.header || {}) };
+      options.method = options.method || this.config.method;
+      options.custom = { ...this.config.custom, ...(options.custom || {}) };
       // #ifdef APP-PLUS
-      options.sslVerify = options.sslVerify === undefined ? this.config.sslVerify : options.sslVerify
+      options.sslVerify =
+        options.sslVerify === undefined
+          ? this.config.sslVerify
+          : options.sslVerify;
       // #endif
-      options.getTask = options.getTask || this.config.getTask
-      let next = true
-      const cancel = (t = 'handle cancel', config = options) => {
+      options.getTask = options.getTask || this.config.getTask;
+      let next = true;
+      const cancel = (t = "handle cancel", config = options) => {
         const err = {
           errMsg: t,
-          config: config
-        }
-        reject(err)
-        next = false
-      }
+          config: config,
+        };
+        reject(err);
+        next = false;
+      };
 
-      const handleRe =  {...this.requestBeforeFun(options, cancel)}
-      const _config = {...handleRe}
-      if (!next) return
+      const handleRe = { ...this.requestBeforeFun(options, cancel) };
+      const _config = { ...handleRe };
+      if (!next) return;
       const requestTask = uni.request({
-        url: buildURL(buildFullPath(_config.baseUrl, _config.url), _config.params),
+        url: buildURL(
+          buildFullPath(_config.baseUrl, _config.url),
+          _config.params
+        ),
         data: _config.data,
         header: _config.header,
         method: _config.method,
@@ -157,37 +165,38 @@ export default class Request {
         withCredentials: _config.withCredentials,
         // #endif
         complete: (response) => {
-          response.config = handleRe
-          if (this.validateStatus(response.statusCode)) { // 成功
-            response = this.requestComFun(response)
-            resolve(response)
+          response.config = handleRe;
+          if (this.validateStatus(response.statusCode)) {
+            // 成功
+            response = this.requestComFun(response);
+            resolve(response);
           } else {
-            response = this.requestComFail(response)
-            reject(response)
+            response = this.requestComFail(response);
+            reject(response);
           }
-        }
-      })
+        },
+      });
       if (handleRe.getTask) {
-        handleRe.getTask(requestTask, handleRe)
+        handleRe.getTask(requestTask, handleRe);
       }
-    })
+    });
   }
 
   get(url, options = {}) {
     return this.request({
       url,
-      method: 'GET',
-      ...options
-    })
+      method: "GET",
+      ...options,
+    });
   }
 
   post(url, data, options = {}) {
     return this.request({
       url,
       data,
-      method: 'POST',
-      ...options
-    })
+      method: "POST",
+      ...options,
+    });
   }
 
   // #ifndef MP-ALIPAY
@@ -195,9 +204,9 @@ export default class Request {
     return this.request({
       url,
       data,
-      method: 'PUT',
-      ...options
-    })
+      method: "PUT",
+      ...options,
+    });
   }
 
   // #endif
@@ -207,9 +216,9 @@ export default class Request {
     return this.request({
       url,
       data,
-      method: 'DELETE',
-      ...options
-    })
+      method: "DELETE",
+      ...options,
+    });
   }
 
   // #endif
@@ -219,9 +228,9 @@ export default class Request {
     return this.request({
       url,
       data,
-      method: 'CONNECT',
-      ...options
-    })
+      method: "CONNECT",
+      ...options,
+    });
   }
 
   // #endif
@@ -231,9 +240,9 @@ export default class Request {
     return this.request({
       url,
       data,
-      method: 'HEAD',
-      ...options
-    })
+      method: "HEAD",
+      ...options,
+    });
   }
 
   // #endif
@@ -243,9 +252,9 @@ export default class Request {
     return this.request({
       url,
       data,
-      method: 'OPTIONS',
-      ...options
-    })
+      method: "OPTIONS",
+      ...options,
+    });
   }
 
   // #endif
@@ -255,36 +264,39 @@ export default class Request {
     return this.request({
       url,
       data,
-      method: 'TRACE',
-      ...options
-    })
+      method: "TRACE",
+      ...options,
+    });
   }
 
   // #endif
 
-  upload(url, {
-    // #ifdef APP-PLUS || H5
-    files,
-    // #endif
-    // #ifdef MP-ALIPAY
-    fileType,
-    // #endif
-    filePath,
-    name,
-    // #ifdef H5
-    file,
-    // #endif
-    header = {},
-    formData = {},
-    custom = {},
-    params = {},
-    getTask
-  }) {
+  upload(
+    url,
+    {
+      // #ifdef APP-PLUS || H5
+      files,
+      // #endif
+      // #ifdef MP-ALIPAY
+      fileType,
+      // #endif
+      filePath,
+      name,
+      // #ifdef H5
+      file,
+      // #endif
+      header = {},
+      formData = {},
+      custom = {},
+      params = {},
+      getTask,
+    }
+  ) {
     return new Promise((resolve, reject) => {
-      let next = true
-      const globalHeader = {...this.config.header}
-      delete globalHeader['content-type']
-      delete globalHeader['Content-Type']
+      let next = true;
+      const globalHeader = { ...this.config.header };
+      delete globalHeader["content-type"];
+      delete globalHeader["Content-Type"];
       const pubConfig = {
         baseUrl: this.config.baseUrl,
         url,
@@ -292,36 +304,39 @@ export default class Request {
         fileType,
         // #endif
         filePath,
-        method: 'UPLOAD',
+        method: "UPLOAD",
         name,
-        header: {...globalHeader, ...header},
+        header: { ...globalHeader, ...header },
         formData,
         params,
-        custom: {...this.config.custom, ...custom},
-        getTask: getTask || this.config.getTask
-      }
+        custom: { ...this.config.custom, ...custom },
+        getTask: getTask || this.config.getTask,
+      };
       // #ifdef APP-PLUS || H5
       if (files) {
-        pubConfig.files = files
+        pubConfig.files = files;
       }
       // #endif
       // #ifdef H5
       if (file) {
-        pubConfig.file = file
+        pubConfig.file = file;
       }
       // #endif
-      const cancel = (t = 'handle cancel', config = pubConfig) => {
+      const cancel = (t = "handle cancel", config = pubConfig) => {
         const err = {
           errMsg: t,
-          config: config
-        }
-        reject(err)
-        next = false
-      }
+          config: config,
+        };
+        reject(err);
+        next = false;
+      };
 
-      const handleRe = {...this.requestBeforeFun(pubConfig, cancel)}
+      const handleRe = { ...this.requestBeforeFun(pubConfig, cancel) };
       const _config = {
-        url: buildURL(buildFullPath(handleRe.baseUrl, handleRe.url), handleRe.params),
+        url: buildURL(
+          buildFullPath(handleRe.baseUrl, handleRe.url),
+          handleRe.params
+        ),
         // #ifdef MP-ALIPAY
         fileType: handleRe.fileType,
         // #endif
@@ -330,87 +345,90 @@ export default class Request {
         header: handleRe.header,
         formData: handleRe.formData,
         complete: (response) => {
-          response.config = handleRe
+          response.config = handleRe;
           try {
             // 对可能字符串不是json 的情况容错
-            if (typeof response.data === 'string') {
-              response.data = JSON.parse(response.data)
+            if (typeof response.data === "string") {
+              response.data = JSON.parse(response.data);
             }
             // eslint-disable-next-line no-empty
-          } catch (e) {
-          }
-          if (this.validateStatus(response.statusCode)) { // 成功
-            response = this.requestComFun(response)
-            resolve(response)
+          } catch (e) {}
+          if (this.validateStatus(response.statusCode)) {
+            // 成功
+            response = this.requestComFun(response);
+            resolve(response);
           } else {
-            response = this.requestComFail(response)
-            reject(response)
+            response = this.requestComFail(response);
+            reject(response);
           }
-        }
-      }
+        },
+      };
       // #ifdef APP-PLUS || H5
       if (handleRe.files) {
-        _config.files = handleRe.files
+        _config.files = handleRe.files;
       }
       // #endif
       // #ifdef H5
       if (handleRe.file) {
-        _config.file = handleRe.file
+        _config.file = handleRe.file;
       }
       // #endif
-      if (!next) return
-      const requestTask = uni.uploadFile(_config)
+      if (!next) return;
+      const requestTask = uni.uploadFile(_config);
       if (handleRe.getTask) {
-        handleRe.getTask(requestTask, handleRe)
+        handleRe.getTask(requestTask, handleRe);
       }
-    })
+    });
   }
 
   download(url, options = {}) {
     return new Promise((resolve, reject) => {
-      let next = true
+      let next = true;
       const pubConfig = {
         baseUrl: this.config.baseUrl,
         url,
-        method: 'DOWNLOAD',
-        header: {...this.config.header, ...(options.header || {})},
+        method: "DOWNLOAD",
+        header: { ...this.config.header, ...(options.header || {}) },
         params: options.params || {},
-        custom: {...this.config.custom, ...(options.custom || {})},
-        getTask: options.getTask || this.config.getTask
-      }
-      const cancel = (t = 'handle cancel', config = pubConfig) => {
+        custom: { ...this.config.custom, ...(options.custom || {}) },
+        getTask: options.getTask || this.config.getTask,
+      };
+      const cancel = (t = "handle cancel", config = pubConfig) => {
         const err = {
           errMsg: t,
-          config: config
-        }
-        reject(err)
-        next = false
-      }
+          config: config,
+        };
+        reject(err);
+        next = false;
+      };
 
-      const handleRe = {...this.requestBeforeFun(pubConfig, cancel)}
-      if (!next) return
+      const handleRe = { ...this.requestBeforeFun(pubConfig, cancel) };
+      if (!next) return;
       const requestTask = uni.downloadFile({
-        url: buildURL(buildFullPath(handleRe.baseUrl, handleRe.url), handleRe.params),
+        url: buildURL(
+          buildFullPath(handleRe.baseUrl, handleRe.url),
+          handleRe.params
+        ),
         header: handleRe.header,
         complete: (response) => {
-          response.config = handleRe
-          if (this.validateStatus(response.statusCode)) { // 成功
-            response = this.requestComFun(response)
-            resolve(response)
+          response.config = handleRe;
+          if (this.validateStatus(response.statusCode)) {
+            // 成功
+            response = this.requestComFun(response);
+            resolve(response);
           } else {
-            response = this.requestComFail(response)
-            reject(response)
+            response = this.requestComFail(response);
+            reject(response);
           }
-        }
-      })
+        },
+      });
       if (handleRe.getTask) {
-        handleRe.getTask(requestTask, handleRe)
+        handleRe.getTask(requestTask, handleRe);
       }
-    })
+    });
   }
 }
 
-
 /**
  * setConfig回调
  * @return {Object} - 返回操作后的config

+ 9 - 11
common/service/config.service.js

@@ -1,18 +1,16 @@
-let BASE_URL = ''
+let BASE_URL = "";
 
-
-if (process.env.NODE_ENV == 'development') {
-	BASE_URL = 'http://182.92.126.35:9999' // 开发环境
-	// BASE_URL = 'http://boot.jeecg.org:8080/jeecg-boot' // 开发环境
+if (process.env.NODE_ENV == "development") {
+  BASE_URL = "http://182.92.126.35:9999"; // 开发环境
 } else {
-	BASE_URL = '10.246.95.4:8092' // 布尔台
-	// BASE_URL = 'http://182.92.126.35:9999' // 生产环境
+  // BASE_URL = "http://10.246.95.4:8092"; // 布尔台
+  BASE_URL = "http://182.92.126.35:9999"; // 生产环境
 }
-let staticDomainURL = BASE_URL+ '/sys/common/static';
+let staticDomainURL = BASE_URL + "/sys/common/static";
 
 const configService = {
-	apiUrl: BASE_URL,
-	staticDomainURL: staticDomainURL
+  apiUrl: BASE_URL,
+  staticDomainURL: staticDomainURL,
 };
 
-export default configService
+export default configService;

+ 17 - 6
manifest.json

@@ -8,7 +8,9 @@
     "app-plus" : {
         /* 5+App特有相关 */
         "modules" : {
-            "Maps" : {}
+            "Maps" : {},
+            "Push" : {},
+            "VideoPlayer" : {}
         },
         /* 模块配置 */
         "distribute" : {
@@ -27,11 +29,9 @@
                     "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
-                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
                     "<uses-permission android:name=\"android.permission.INTERNET\"/>",
                     "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
                     "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
                     "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
                     "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
@@ -54,9 +54,10 @@
                         "appkey_android" : "87f4d2a4a0c42e0c86cf312c8b8154e8"
                     }
                 },
-                "push" : {
-                    "unipush" : {}
-                }
+                "push" : {}
+            },
+            "splashscreen" : {
+                "iosStyle" : "default"
             }
         }
     },
@@ -79,5 +80,15 @@
         "title" : "智能通风",
         "domain" : "myhjdc.cn"
     },
+    "android" : {
+        "theme" : {
+            "primaryColor" : "#000000",
+            "window" : {
+                "fullscreen" : true,
+                "navigationBarColor" : "#000000"
+            }
+        },
+        "notch" : true
+    },
     "fallbackLocale" : "zh-Hans"
 }

+ 5 - 3
pages/history/Historymodel.vue

@@ -23,15 +23,17 @@
             <u-button
               type="primary"
               shape="circle"
-              text="起始时间"
+              :text="StartTime ? StartTime : '起始时间'"
               @click="dataShow = true"
             ></u-button>
             <u-button
               type="primary"
               shape="circle"
-              text="结束时间"
+              :text="EndTime ? EndTime : '结束时间'"
               @click="dataShow1 = true"
             ></u-button>
+          </div>
+          <div class="btns" style="margin-top: 10px">
             <u-button
               type="primary"
               shape="circle"
@@ -369,7 +371,7 @@ export default {
       });
     },
     devicemenuShow(e) {
-      this.menushow = true;
+      this.menushow = !this.menushow;
     },
     menuClick(id) {
       this.TabCur = id;

+ 5 - 7
pages/home/detail/autodoor/autodoor.vue

@@ -280,11 +280,11 @@ export default {
     this.itemId = query.id;
     this.name = query.name;
     this.TabCur = query.type;
-    this.getShowList();
     this.ndoorcount = 2;
   },
   components: { doorAnimate, windowAnimate,windrectAnimate,fanlocalAnimate },
   created() {
+	this.getShowList(this.TabCur);
     this.getDeviceInfo(this.itemId);
     this.getVideoUrlById(this.itemId);
   },
@@ -310,9 +310,9 @@ export default {
       });
     },
     //获取app展示字段数据
-    getShowList() {
+    getShowList(type) {
       const params = {
-        devicekind: this.TabCur,
+        devicekind: type,
         pagetype: "detail",
         pageNo: 1,
         pageSize: 100,
@@ -323,6 +323,7 @@ export default {
           .then((response) => {
             if (response.data.code == 200) {
               this.typeList = response.data.result.records;
+			  console.log(this.typeList,'ssssssssssssssssc sa a ')
             } else {
               resolve(response);
             }
@@ -375,6 +376,7 @@ export default {
                 (this.tableData.forntArea / maxarea) * 100 * 0.9;
               this.windowAngle1 =
                 (this.tableData.rearArea / maxarea) * 100 * 0.9;
+			  this.$forceUpdate()
             } else {
               resolve(response);
             }
@@ -394,10 +396,6 @@ export default {
             if (response.data.code == 200) {
 				if(response.data.result.records.length>0){
               this.viedeoUrl = response.data.result.records[0].addr;
-              console.log(
-                response.data.result.records[0].addr,
-                "csssssssssssssss"
-              );
 			  }
             } else {
               resolve(response);

+ 419 - 337
pages/home/firstmodel.vue

@@ -1,365 +1,447 @@
 <template>
-	<view class="container">
-		<!-- 建议放在外层 -->
-		<u-navbar title="设备监测" @leftClick="devicemenuShow" :safeAreaInsetTop="false">
-			<view class="u-nav-slot" slot="left">
-				<u-icon name="list" size="20"> </u-icon>
-			</view>
-		</u-navbar>
+  <view class="container">
+    <!-- 建议放在外层 -->
+    <u-navbar
+      title="设备监测"
+      @leftClick="devicemenuShow"
+      :safeAreaInsetTop="false"
+    >
+      <view class="u-nav-slot" slot="left">
+        <u-icon name="list" size="20"> </u-icon>
+      </view>
+    </u-navbar>
 
-		<view v-show="menushow" class="menupage">
-			<DeviceMenu @menuClick="menuClick"></DeviceMenu>
-		</view>
+    <view v-show="menushow" class="menupage">
+      <DeviceMenu @menuClick="menuClick"></DeviceMenu>
+    </view>
 
-		<view v-show="!menushow" class="main">
-			<view class="u-page">
-				<u-list>
-					<u-list-item class="itemback" v-for="(item, index) in curlist" :key="index">
-						<div @tap="openNewPage(item)">
-							<u-row gutter="5" customStyle="margin-bottom: 10px">
-								<u-col span="24">
+    <view v-show="!menushow" class="main">
+      <view class="u-page">
+        <u-list>
+          <u-list-item
+            class="itemback"
+            v-for="(item, index) in curlist"
+            :key="index"
+          >
+            <div @tap="openNewPage(item)">
+              <u-row gutter="5" customStyle="margin-bottom: 10px">
+                <u-col span="24">
+                  <img
+                    style="position: absolute; width: 35rpx; height: 35rpx"
+                    class="icon"
+                    :src="getIcon(TabCur)"
+                    alt="Icon"
+                  />
+                  <span class="title">{{ item.strinstallpos }}</span>
+                </u-col>
+              </u-row>
+              <u-row gutter="5" customStyle="margin-bottom: 10px">
+                <u-col span="3" style="margin-right: 5rpx">
+                  <div v-if="item.netStatus == 0" class="error-tag1">
+                    <img
+                      src="'../../../../static/model/connectFalse.svg "
+                      alt=""
+                      class="icon-style"
+                    />
+                    <span style="float: right">断开</span>
+                  </div>
+                  <div v-else class="success-tag">
+                    <img
+                      src="'../../../../static/model/connectTrue.svg "
+                      alt=""
+                      class="icon-style"
+                    />
+                    <span style="float: right">连接</span>
+                  </div>
+                </u-col>
+                <u-col span="4">
+                  <div v-if="item.warnFlag == 0" class="success-tag">
+                    <img
+                      src="'../../../../static/model/alarmTrue.svg "
+                      alt=""
+                      class="icon-style"
+                    />
+                    <span style="float: right">{{ item.warnLevel_str }}</span>
+                  </div>
+                  <div v-else class="error-tag">
+                    <img
+                      src="'../../../../static/model/alarmFalse.svg "
+                      alt=""
+                      class="icon-style"
+                    />
+                    <span style="float: right">{{ item.warnDes }}</span>
+                  </div>
+                </u-col>
+                <u-col span="5">
+                  <u--text class="timetext" :text="item.readTime"></u--text>
+                </u-col>
+              </u-row>
+              <view v-if="colums[TabCur + '_monitor'] != null">
+                <view
+                  class="datacard"
+                  v-for="(showitem, index) in colums[TabCur + '_monitor']"
+                  :key="index"
+                  v-show="
+                    showitem.appShow == 1 &&
+                    showitem.monitorcode != 'strinstallpos' &&
+                    showitem.monitorcode != 'netStatus' &&
+                    showitem.monitorcode != 'warnFlag' &&
+                    showitem.monitorcode != 'readTime' &&
+                    showitem.monitorcode != ''
+                  "
+                >
+                  <view
+                    :class="TabCur"
+                    style="padding-top: 10rpx; padding-bottom: 10rpx"
+                  >
+                    <view
+                      v-if="
+                        showitem.datatype == 1 &&
+                        showitem.monitorcode == 'doorUse'
+                      "
+                      class="demo-layout bg-purple-light"
+                      style="
+                        margin-top: 10rpx;
+                        color: #3787fe;
+                        font-size: 30rpx;
+                        margin-top: 5rpx;
+                      "
+                    >
+                      {{
+                        item[showitem.monitorcode] == "2"
+                          ? "行人"
+                          : item[showitem.monitorcode] == "1"
+                          ? "行车"
+                          : "-"
+                      }}
+                    </view>
+                    <view
+                      v-else-if="showitem.datatype == 1"
+                      class="demo-layout bg-purple-light"
+                      style="
+                        margin-top: 10rpx;
+                        color: #3787fe;
+                        font-size: 30rpx;
+                        margin-top: 5rpx;
+                      "
+                    >
+                      {{
+                        item[showitem.monitorcode] == null ||
+                        item[showitem.monitorcode] == ""
+                          ? "-"
+                          : item[showitem.monitorcode]
+                      }}
+                    </view>
+                    <view
+                      v-else-if="showitem.datatype == 2"
+                      class="demo-layout bg-purple-light"
+                      style="color: #3787fe; font-size: 30rpx; margin-top: 5rpx"
+                    >
+                      {{
+                        item.readData[showitem.monitorcode] == null ||
+                        item.readData[showitem.monitorcode] == ""
+                          ? "-"
+                          : item.readData[showitem.monitorcode]
+                      }}
+                    </view>
 
-									<img style="position: absolute;width: 35rpx;height:35rpx;" class="icon"
-										:src="getIcon(TabCur)" alt="Icon" />
-									<span class="title">{{item.strinstallpos}}</span>
-								</u-col>
-							</u-row>
-							<u-row gutter="5" customStyle="margin-bottom: 10px">
-								<u-col span="3" style="margin-right: 5rpx">
-									<div v-if="item.netStatus == 0" class="error-tag1">
-										<img src="'../../../../static/model/connectFalse.svg " alt=""
-											class="icon-style" />
-										<span style="float: right">断开</span>
-									</div>
-									<div v-else class="success-tag">
-										<img src="'../../../../static/model/connectTrue.svg " alt=""
-											class="icon-style" />
-										<span style="float: right">连接</span>
-									</div>
-								</u-col>
-								<u-col span="4">
-									<div v-if="item.warnFlag == 0" class="success-tag">
-										<img src="'../../../../static/model/alarmTrue.svg " alt="" class="icon-style" />
-										<span style="float: right">{{ item.warnLevel_str }}</span>
-									</div>
-									<div v-else class="error-tag">
-										<img src="'../../../../static/model/alarmFalse.svg " alt=""
-											class="icon-style" />
-										<span style="float: right">{{ item.warnDes }}</span>
-									</div>
-								</u-col>
-								<u-col span="5">
-									<u--text class="timetext" :text="item.readTime"></u--text>
-								</u-col>
-							</u-row>
-							<view v-if="colums[TabCur + '_monitor'] != null">
-								<view class="datacard" v-for="(showitem, index) in colums[TabCur + '_monitor']"
-									:key="index" v-show="showitem.appShow == 1 && 
-                        showitem.monitorcode != 'strinstallpos' &&
-                        showitem.monitorcode != 'netStatus' &&
-                        showitem.monitorcode != 'warnFlag' &&
-                        showitem.monitorcode != 'readTime' &&
-                        showitem.monitorcode != ''">
-											<view :class="TabCur" style="padding-top:10rpx;padding-bottom: 10rpx;">
-												<view v-if="showitem.datatype == 1 && showitem.monitorcode == 'doorUse'"
-													class="demo-layout bg-purple-light"
-													style="margin-top: 10rpx; color: #3787fe;font-size: 30rpx;margin-top: 5rpx;">
-													{{ item[showitem.monitorcode] == '2'?'行人':item[showitem.monitorcode] == '1'?'行车':'-' }}
-												</view>
-												<view v-else-if="showitem.datatype == 1"
-													class="demo-layout bg-purple-light"
-													style="margin-top: 10rpx; color: #3787fe;font-size: 30rpx;margin-top: 5rpx;">
-													{{ item[showitem.monitorcode] == null || item[showitem.monitorcode] == ''?'-':item[showitem.monitorcode]}}
-												</view>
-												<view v-else-if="
-                          showitem.datatype == 2 " class="demo-layout bg-purple-light"
-													style="color: #3787fe;font-size: 30rpx;margin-top: 5rpx;">
-													{{ item.readData[showitem.monitorcode]==null || item.readData[showitem.monitorcode] == ''?'-':item.readData[showitem.monitorcode] }}
-												</view>
-
-													<view class="demo-layout bg-purple-light"
-														style="margin-top: 6rpx; color: #677799;margin-bottom: 5rpx;">
-														{{ showitem.des }}
-													</view>
-											</view>
-										</view>
-									</view>
-						</div>
-					</u-list-item>
-				</u-list>
-			</view>
-		</view>
-	</view>
+                    <view
+                      class="demo-layout bg-purple-light"
+                      style="
+                        margin-top: 6rpx;
+                        color: #677799;
+                        margin-bottom: 5rpx;
+                      "
+                    >
+                      {{ showitem.des }}
+                    </view>
+                  </view>
+                </view>
+              </view>
+            </div>
+          </u-list-item>
+        </u-list>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
-	import DeviceMenu from "./devicemenu/devicemenu.vue";
-	import api from "@/api/api";
-	export default {
-		data() {
-			return {
-				menushow: false,
-				TabCur: "gate",
-				curlist: [],
-				deviceList: {},
-				scrollLeft: 0,
-				currentTab: 0,
-				colums: {},
-			};
-		},
-		components: {
-			DeviceMenu,
-		},
-		props: ["showColum"],
-		watch: {
-			showColum(data) {
-				this.colums = data;
-				console.log(this.colums);
-			},
-		},
-		created() {
-			this.colums = this.showColum;
-		},
-		mounted() {
-			this.startTimer();
-		},
-		methods: {
-			startTimer() {
-				// 每隔一段时间执行某个操作
-				this.timer = setInterval(() => {
-					// 执行定时任务
-					this.loadData(this.TabCur);
-					console.log("定时任务执行中...");
-				}, 5000);
-			},
-			stopTimer() {
-				// 停止定时器
-				clearInterval(this.timer);
-			},
-			getIcon(itemValue) {
-				// 根据itemValue获取对应的图标路径,如果找不到对应关系则返回默认图标
-				return '/static/sidebar/' + itemValue + ".svg";
-			},
-			getValueIcon(itemValue) {
-				// 根据itemValue获取对应的图标路径,如果找不到对应关系则返回默认图标
-				return '/static/sidebar/' + itemValue + ".svg";
-			},
-			loadData(type) {
-				new Promise((resolve, reject) => {
-					api
-						.getDeviceMonitor({
-							devicetype: type,
-							pagetype: "normal",
-							filterParams: {},
-						})
-						.then((response) => {
-							if (response.data.code == 200) {
-								this.deviceList[type] = response.data.result.msgTxt[0].datalist;
-								this.curlist = this.deviceList[type];
-								this.curlist.forEach((item) => {
-									if (item.readData.frontGateOpen == 1) {
-										item.readData.frontGateOpen = "打开";
-									} else {
-										item.readData.frontGateOpen = "关闭";
-									}
-									if (item.readData.midGateOpen == 1) {
-										item.readData.midGateOpen = "打开";
-									} else {
-										item.readData.midGateOpen = "关闭";
-									}
-									if (item.readData.rearGateOpen == 1) {
-										item.readData.rearGateOpen = "打开";
-									} else {
-										item.readData.rearGateOpen = "关闭";
-									}
-									if (item.readData.midGateOpen == 1) {
-										item.readData.midGateOpen = "打开";
-									} else {
-										item.readData.midGateOpen = "关闭";
-									}
-								});
-							} else {
-								resolve(response);
-							}
-						})
-						.catch((error) => {
-							console.log("catch===>response", response);
-							reject(error);
-						});
-				});
-			},
-			tabSelect(e) {
-				this.currentTab = e.currentTarget.dataset.id;
-				this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
-			},
-			devicemenuShow(e) {
-				this.menushow = true;
-			},
-			menuClick(id) {
-				this.TabCur = id;
-				// 显示该分类的数据
-				this.curlist = this.deviceList[this.TabCur];
+import DeviceMenu from "./devicemenu/devicemenu.vue";
+import api from "@/api/api";
+export default {
+  data() {
+    return {
+      menushow: false,
+      TabCur: "gate",
+      curlist: [],
+      deviceList: {},
+      scrollLeft: 0,
+      currentTab: 0,
+      colums: {},
+    };
+  },
+  components: {
+    DeviceMenu,
+  },
+  props: ["showColum"],
+  watch: {
+    showColum(data) {
+      this.colums = data;
+      console.log(this.colums);
+    },
+  },
+  created() {
+    this.colums = this.showColum;
+  },
+  mounted() {
+    this.startTimer();
+  },
+  methods: {
+    startTimer() {
+      // 每隔一段时间执行某个操作
+      this.timer = setInterval(() => {
+        // 执行定时任务
+        this.loadData(this.TabCur);
+        console.log("定时任务执行中...");
+      }, 5000);
+    },
+    stopTimer() {
+      // 停止定时器
+      clearInterval(this.timer);
+    },
+    getIcon(itemValue) {
+      // 根据itemValue获取对应的图标路径,如果找不到对应关系则返回默认图标
+      return "/static/sidebar/" + itemValue + ".svg";
+    },
+    getValueIcon(itemValue) {
+      // 根据itemValue获取对应的图标路径,如果找不到对应关系则返回默认图标
+      return "/static/sidebar/" + itemValue + ".svg";
+    },
+    loadData(type) {
+      new Promise((resolve, reject) => {
+        api
+          .getDeviceMonitor({
+            devicetype: type,
+            pagetype: "normal",
+            filterParams: {},
+          })
+          .then((response) => {
+            if (response.data.code == 200) {
+              this.deviceList[type] = response.data.result.msgTxt[0].datalist;
+              this.curlist = this.deviceList[type];
+              this.curlist.forEach((item) => {
+                if (item.readData.frontGateOpen == 1) {
+                  item.readData.frontGateOpen = "打开";
+                } else {
+                  item.readData.frontGateOpen = "关闭";
+                }
+                if (item.readData.midGateOpen == 1) {
+                  item.readData.midGateOpen = "打开";
+                } else {
+                  item.readData.midGateOpen = "关闭";
+                }
+                if (item.readData.rearGateOpen == 1) {
+                  item.readData.rearGateOpen = "打开";
+                } else {
+                  item.readData.rearGateOpen = "关闭";
+                }
+                if (item.readData.midGateOpen == 1) {
+                  item.readData.midGateOpen = "打开";
+                } else {
+                  item.readData.midGateOpen = "关闭";
+                }
+              });
+            } else {
+              resolve(response);
+            }
+          })
+          .catch((error) => {
+            console.log("catch===>response", response);
+            reject(error);
+          });
+      });
+    },
+    tabSelect(e) {
+      this.currentTab = e.currentTarget.dataset.id;
+      this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
+    },
+    devicemenuShow(e) {
+      this.menushow = !this.menushow;
+    },
+    menuClick(id) {
+      this.TabCur = id;
+      // 显示该分类的数据
+      this.curlist = this.deviceList[this.TabCur];
 
-				if (this.curlist == null) {
-					this.curlist = [];
-				}
-				// 选择设备分类,重新获取数据
-				this.loadData(this.TabCur);
-				this.menushow = false;
-			},
-			openNewPage(params) {
-				this.$destroy();
-				uni.navigateTo({
-					url: `/pages/home/detail/autodoor/autodoor?id=${params.deviceID}&name=${params.strinstallpos}&type=${this.TabCur}`,
-				});
-			},
-		},
-		destroyed() {
-			// 停止定时器
-			this.stopTimer();
-		},
-	};
+      if (this.curlist == null) {
+        this.curlist = [];
+      }
+      // 选择设备分类,重新获取数据
+      this.loadData(this.TabCur);
+      this.menushow = false;
+    },
+    openNewPage(params) {
+      this.$destroy();
+      uni.navigateTo({
+        url: `/pages/home/detail/autodoor/autodoor?id=${params.deviceID}&name=${params.strinstallpos}&type=${this.TabCur}`,
+      });
+    },
+  },
+  destroyed() {
+    // 停止定时器
+    this.stopTimer();
+  },
+};
 </script>
 
 <style>
-	.top-nav {
-		height: 100rpx;
-		line-height: 100rpx;
-		background-color: #2aa9f3;
-		color: #daaaa;
-	}
+.top-nav {
+  height: 100rpx;
+  line-height: 100rpx;
+  background-color: #2aa9f3;
+  color: #daaaa;
+}
 
-	.top-nav2 {
-		background-color: #ffffff;
-	}
+.top-nav2 {
+  background-color: #ffffff;
+}
 
-	.main {
-		margin-top: 100rpx;
-		display: flex;
-		flex-direction: column;
-	}
+.main {
+  margin-top: 100rpx;
+  display: flex;
+  flex-direction: column;
+}
 
-	.card {
-		background-color: #ffffff;
-		margin: auto;
-		margin-top: 20rpx;
-		width: 10%;
-		height: 280rpx;
-		border: 1rpx solid #000000;
-		border-radius: 20rpx;
-	}
+.card {
+  background-color: #ffffff;
+  margin: auto;
+  margin-top: 20rpx;
+  width: 10%;
+  height: 280rpx;
+  border: 1rpx solid #000000;
+  border-radius: 20rpx;
+}
 
-	.menupage {
-		position: absolute;
-		z-index: 2;
-		top: 40rpx;
-		height: calc(100% - 40rpx);
-		width: 100%;
-	}
+.menupage {
+  position: absolute;
+  z-index: 2;
+  top: 40rpx;
+  height: calc(100% - 40rpx);
+  width: 100%;
+}
 
-	.timetext {
-		text-align: right;
-		float: right;
-	}
+.timetext {
+  text-align: right;
+  float: right;
+}
 
-	.itemback {
-		padding: 20rpx;
-		background-color: #ffffff;
-		margin-bottom: 5rpx;
-	}
+.itemback {
+  padding: 20rpx;
+  background-color: #ffffff;
+  margin-bottom: 5rpx;
+}
 
-	.datacard .content {
-		width: 30rpx;
-		height: 30rpx;
-		left: 0rpx;
-		top: 0rpx;
-		position: absolute;
-	}
+.datacard .content {
+  width: 30rpx;
+  height: 30rpx;
+  left: 0rpx;
+  top: 0rpx;
+  position: absolute;
+}
 
-	.datacard {
-		border-radius: 10rpx;
-		border: rgba(55, 135, 254, 0.28);
-		width: 30%;
-		margin: 1%;
-		float: left;
-		height: 105rpx;
-		text-align: center;
-		background: linear-gradient(to right,
-				rgba(55, 135, 254, 0.08),
-				rgba(4, 184, 255, 0.08),
-				rgba(60, 161, 237, 0.08));
-	}
+.datacard {
+  border-radius: 10rpx;
+  border: rgba(55, 135, 254, 0.28);
+  width: 30%;
+  margin: 1%;
+  float: left;
+  height: 105rpx;
+  text-align: center;
+  background: linear-gradient(
+    to right,
+    rgba(55, 135, 254, 0.08),
+    rgba(4, 184, 255, 0.08),
+    rgba(60, 161, 237, 0.08)
+  );
+}
 
-	.datacard .gate {
-		background: linear-gradient(to right,
-				rgba(75, 135, 254, 0.08),
-				rgba(24, 184, 255, 0.08),
-				rgba(80, 161, 237, 0.08));
-	}
+.datacard .gate {
+  background: linear-gradient(
+    to right,
+    rgba(75, 135, 254, 0.08),
+    rgba(24, 184, 255, 0.08),
+    rgba(80, 161, 237, 0.08)
+  );
+}
 
-	.datacard .window {
-		background: linear-gradient(to right,
-				rgba(55, 125, 254, 0.08),
-				rgba(4, 164, 255, 0.08),
-				rgba(60, 131, 237, 0.08));
-	}
+.datacard .window {
+  background: linear-gradient(
+    to right,
+    rgba(55, 125, 254, 0.08),
+    rgba(4, 164, 255, 0.08),
+    rgba(60, 131, 237, 0.08)
+  );
+}
 
-	.datacard .windrect {
-		background: linear-gradient(to right,
-				rgba(85, 125, 254, 0.08),
-				rgba(34, 164, 255, 0.08),
-				rgba(90, 131, 237, 0.08));
-	}
+.datacard .windrect {
+  background: linear-gradient(
+    to right,
+    rgba(85, 125, 254, 0.08),
+    rgba(34, 164, 255, 0.08),
+    rgba(90, 131, 237, 0.08)
+  );
+}
 
-	.error-tag {
-		border-radius: 10%;
-		display: inline-block;
-		color: #e90000;
-		line-height: 50rpx;
-		font-size: 14px;
-		text-align: center;
-		float: left;
-		width: 180rpx;
-		height: 50rpx;
-		padding-right: 30rpx;
-		background-color: rgba(233, 0, 0, 0.2);
-	}
+.error-tag {
+  border-radius: 10%;
+  display: inline-block;
+  color: #e90000;
+  line-height: 50rpx;
+  font-size: 14px;
+  text-align: center;
+  float: left;
+  width: 180rpx;
+  height: 50rpx;
+  padding-right: 30rpx;
+  background-color: rgba(233, 0, 0, 0.2);
+}
 
-	.error-tag1 {
-		border-radius: 10%;
-		display: inline-block;
-		color: #696969;
-		line-height: 50rpx;
-		font-size: 14px;
-		text-align: center;
-		margin-top: 10rpx;
-		float: left;
-		width: 120rpx;
-		height: 50rpx;
-		background-color: rgba(105, 105, 105, 0.2);
-	}
+.error-tag1 {
+  border-radius: 10%;
+  display: inline-block;
+  color: #696969;
+  line-height: 50rpx;
+  font-size: 14px;
+  text-align: center;
+  margin-top: 10rpx;
+  float: left;
+  width: 120rpx;
+  height: 50rpx;
+  background-color: rgba(105, 105, 105, 0.2);
+}
 
-	.success-tag {
-		border-radius: 10%;
-		color: #42c000;
-		line-height: 50rpx;
-		font-size: 14px;
-		width: 120rpx;
-		height: 50rpx;
-		padding-right: 30rpx;
-		background-color: rgba(226, 250, 214);
-	}
+.success-tag {
+  border-radius: 10%;
+  color: #42c000;
+  line-height: 50rpx;
+  font-size: 14px;
+  width: 120rpx;
+  height: 50rpx;
+  padding-right: 30rpx;
+  background-color: rgba(226, 250, 214);
+}
 
-	.icon-style {
-		margin: 15rpx;
-		width: 14px;
-		height: 14px;
-	}
+.icon-style {
+  margin: 15rpx;
+  width: 14px;
+  height: 14px;
+}
 
-	.title {
-		margin-left: 40rpx;
-		float: left;
-		font-size: 28rpx;
-		font-weight: 400;
-	}
+.title {
+  margin-left: 40rpx;
+  float: left;
+  font-size: 28rpx;
+  font-weight: 400;
+}
 </style>

+ 3 - 3
pages/operation/operationModel.vue

@@ -21,13 +21,13 @@
             <u-button
               type="primary"
               shape="circle"
-              text="起始时间"
+              :text="StartTime ? StartTime : '起始时间'"
               @click="dataShow = true"
             ></u-button>
             <u-button
               type="primary"
               shape="circle"
-              text="结束时间"
+              :text="EndTime ? EndTime : '结束时间'"
               @click="dataShow1 = true"
             ></u-button>
             <u-button
@@ -137,7 +137,7 @@ export default {
       this.dataShow1 = false;
     },
     devicemenuShow(e) {
-      this.menushow = true;
+      this.menushow = !this.menushow;
     },
     menuClick(id) {
       this.TabCur = id;