zhangyun 2 jaren geleden
bovenliggende
commit
6e78f6eda3
100 gewijzigde bestanden met toevoegingen van 14121 en 3038 verwijderingen
  1. 4 0
      components/jsencrypt/jsencrypt.min.js
  2. 88 0
      components/jsencrypt/jsencrypt.vue
  3. 346 0
      components/multiple-select.vue
  4. 4 0
      main.js
  5. 7 4
      manifest.json
  6. 255 82
      pages.json
  7. 33 11
      pages/cb/bzy/equip-set/bzyhistoryile.vue
  8. 2 2
      pages/cb/bzy/equip-set/equip-set.vue
  9. 849 0
      pages/cb/cbd/equip-set/analyse.vue
  10. 1 1
      pages/cb/cbd/equip-set/equip-set.vue
  11. 31 7
      pages/cb/cbd/equip-set/historyfile.vue
  12. 17 6
      pages/cb/cbd/equip-set/imgpage.vue
  13. 73 29
      pages/cb/cbd/equip-set/results.vue
  14. 2 2
      pages/cb/cbd/equip-set/statistics.vue
  15. 83 111
      pages/cb/equip-detail/equip-detail.vue
  16. 127 32
      pages/cb/index/index.vue
  17. 75 15
      pages/cb/index/search.vue
  18. 85 80
      pages/cb/sim/sim.vue
  19. 278 0
      pages/cb/thxydetail/photolist.vue
  20. 470 0
      pages/cb/thxydetail/thxydetail.vue
  21. 544 0
      pages/cb/thxydetail/thxyhisdata.vue
  22. 352 0
      pages/cb/thxydetail/thxyset.vue
  23. 835 0
      pages/cb/xctdetail/analyse.vue
  24. 278 0
      pages/cb/xctdetail/photolist.vue
  25. 586 0
      pages/cb/xctdetail/xctdetail.vue
  26. 379 0
      pages/cb/xctdetail/xctset.vue
  27. 1 1
      pages/cb/xy/equip-set/equip-set.vue
  28. 44 22
      pages/cb/xy/equip-set/xyhistoryile.vue
  29. 141 64
      pages/cb/xy2.0/historydatas.vue
  30. 2 2
      pages/cb/xy2.0/particulars.vue
  31. 186 0
      pages/cbqxyj/addressbook.vue
  32. 50 0
      pages/cbqxyj/basemap.vue
  33. 855 0
      pages/cbqxyj/cbwarn.vue
  34. 633 0
      pages/cbqxyj/warnset.vue
  35. 47 83
      pages/disease/cmb.vue
  36. 7 24
      pages/distribution/index.vue
  37. 1 1
      pages/environment/contros.vue
  38. 113 88
      pages/environment/equipment.vue
  39. 77 89
      pages/environment/gsequipment.vue
  40. 1 1
      pages/environment/gshistory.vue
  41. 1 1
      pages/environment/history.vue
  42. 86 29
      pages/environment/index.vue
  43. 42 9
      pages/environment/search.vue
  44. 16 9
      pages/equipList/index.vue
  45. 241 0
      pages/equipList/modification.vue
  46. 386 0
      pages/equipList/search.vue
  47. 2 6
      pages/equipMange/index/assignment.vue
  48. 8 3
      pages/equipMange/index/index.vue
  49. 43 8
      pages/index/index.vue
  50. 83 23
      pages/irrigate/index.vue
  51. 564 0
      pages/irrigate/search.vue
  52. 1 1
      pages/irrigate/weathdata.vue
  53. 3 2
      pages/my/user-info/user-info.vue
  54. 85 13
      pages/prevention/control.vue
  55. 3 36
      pages/prevention/equipmentdetails.vue
  56. 25 1
      pages/prevention/index.vue
  57. 60 11
      pages/prevention/ucharts.vue
  58. 815 0
      pages/qxzyj/cbwarn.vue
  59. 501 0
      pages/qxzyj/warnset.vue
  60. 2 27
      pages/waterandfer/datails.vue
  61. 1 1
      pages/waterandfer/elementdata.vue
  62. BIN
      static/images/cb/gaofengqi.png
  63. BIN
      static/images/cb/shijianqi.png
  64. BIN
      static/images/cb/zhongjianqi.png
  65. BIN
      static/images/login/bg.png
  66. 14 1
      static/js/equipState_dict.json
  67. 0 2080
      static/js/ezuikit.js
  68. BIN
      static/logo.png
  69. 539 0
      style/font/demo.css
  70. 1850 0
      style/font/demo_index.html
  71. BIN
      style/font/iconfont.eot
  72. 1 0
      style/font/iconfont.js
  73. 520 0
      style/font/iconfont.json
  74. 245 0
      style/font/iconfont.svg
  75. BIN
      style/font/iconfont.ttf
  76. BIN
      style/font/iconfont.woff
  77. BIN
      style/font/iconfont.woff2
  78. 1 1
      style/html/h52.html
  79. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map
  80. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/common/runtime.js.map
  81. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map
  82. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/components/bazaar-city_list/index.js.map
  83. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/components/equip-item/equip-item.js.map
  84. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/components/ksp-image-cutter/ksp-image-cutter.js.map
  85. 1 0
      unpackage/dist/dev/.sourcemap/mp-weixin/components/multiple-select.js.map
  86. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/components/uni-icons/uni-icons.js.map
  87. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/components/uni-nav-bar/uni-nav-bar.js.map
  88. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/components/uni-status-bar/uni-status-bar.js.map
  89. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/afterSale/addafter.js.map
  90. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/afterSale/index.js.map
  91. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/afterSale/search.js.map
  92. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/bzy/equip-set/bzyhistoryile.js.map
  93. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/bzy/equip-set/equip-set.js.map
  94. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/cbd/equip-set/addimg.js.map
  95. 1 0
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/cbd/equip-set/analyse.js.map
  96. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/cbd/equip-set/equip-set.js.map
  97. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/cbd/equip-set/historyfile.js.map
  98. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/cbd/equip-set/imgpage.js.map
  99. 1 1
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/cbd/equip-set/manualinput.js.map
  100. 0 0
      unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/cbd/equip-set/note.js.map

File diff suppressed because it is too large
+ 4 - 0
components/jsencrypt/jsencrypt.min.js


+ 88 - 0
components/jsencrypt/jsencrypt.vue

@@ -0,0 +1,88 @@
+<template>
+	<view>
+		
+	</view>
+</template>
+
+<script>
+	import JSEncrypt from './jsencrypt.min.js';
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			
+		},
+		getRealLen:function(str) {
+		    return str.replace(/[^\x00-\xff]/g, '__').length;
+			
+		},
+		setEncryptList:function(publicKey,str,max) {
+			var arr=[]
+		    
+		    var s=str,reg=/.{40}/g,ppstr=s.match(reg);
+		    ppstr.push(s.substring(ppstr.join('').length));
+			
+		    for (var nux=0;nux<ppstr.length;nux++) {
+		    	var Nax=this.getRealLen(ppstr[nux]);
+				if(Nax>116){
+					var list=this.setEncryptList(publicKey,ppstr[nux],Nax)
+					 for (var nu=0;nu<list.length;nu++) {
+						 arr.push(list[nu]);
+					 }
+				}else{
+				
+					arr.push(this.setEncrypt(publicKey,ppstr[nux]));
+				}
+		    
+		    }
+			return arr;
+		},		
+		setEncrypt:function(publicKey,data){
+				const encrypt =new JSEncrypt();
+				encrypt.setPublicKey(publicKey);
+		
+				return encrypt.encrypt(data);
+		},
+		setLongEncrypt:function(publicKey,data){
+			var s=data,reg=/.{116}/g,rs=s.match(reg);
+			rs.push(s.substring(rs.join('').length));
+			var arr=[];
+			for (var n=0;n<rs.length;n++) {
+				var max=this.getRealLen(rs[n]);
+				
+				if(max>116){
+				
+					var list=this.setEncryptList(publicKey,rs[n],max)
+					 for (var nu=0;nu<list.length;nu++) {
+						 arr.push(list[nu]);
+					 }
+				}else{
+					
+					arr.push(this.setEncrypt(publicKey,rs[n]));
+				}
+				
+			}
+			return arr;
+		},
+		setDecryptArray:function(PrivateKey,ArrayData){
+			var Decrypt="";
+			for (var n=0;n<ArrayData.length;n++) {
+				Decrypt=Decrypt+this.setDecrypt(PrivateKey,ArrayData[n]);	
+			}
+			return Decrypt;
+		},
+		setDecrypt:function(PrivateKey,data){
+				const encrypt =new JSEncrypt();
+				encrypt.setPrivateKey(PrivateKey);
+				
+				return encrypt.decrypt(data);
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 346 - 0
components/multiple-select.vue

@@ -0,0 +1,346 @@
+<template>
+  <view class="select-container" v-show="show" @touchmove.stop.prevent>
+    <view
+      class="mask"
+      :class="activeClass ? 'mask-show' : ''"
+      @tap="onCancel(true)"
+    ></view>
+    <view class="select-box" :class="activeClass ? 'select-box-show' : ''">
+      <view class="header">
+        <text class="cancel" @tap="onCancel">{{ cancelText }}</text>
+        <view class="all" @tap="onAllToggle" v-if="allShow">
+          <text :class="isAll ? 'all-active' : ''">全选 </text>
+        </view>
+        <text class="confirm" @tap="onConfirm">{{ confirmText }}</text>
+      </view>
+      <view class="body-warp">
+        <scroll-view class="body" scroll-y="true">
+          <slot v-if="!data.length" name="tips">
+            <view class="empty-tips">暂无数据~</view>
+          </slot>
+          <view
+            class="select-item"
+            :class="[
+              item.disabled ? 'disabled' : '',
+              selectedArr[index] ? 'selected' : '',
+            ]"
+            v-for="(item, index) in data"
+            :key="item[valueName]"
+            @tap="onSelected(index)"
+          >
+            <view class="label">{{ item.name }}</view>
+            <text v-show="selectedArr[index]" class="selected-icon">✔</text>
+          </view>
+        </scroll-view>
+      </view>
+    </view>
+  </view>
+</template>
+<!-- 多选组件 -->
+<script>
+export default {
+  model: {
+    prop: "value",
+    event: ["input"],
+  },
+ 
+  data() {
+    return {
+      show: false, //是否显示
+      activeClass: false, //激活样式状态
+      selectedArr: [], //选择对照列表
+      selectedArrOld: [], //选择对照列表上一次的数据
+    };
+  },
+  onShow() {
+    this.show = this.value;
+    console.log(this.value);
+  },
+  computed: {
+    // 返回是否全选
+    isAll() {
+      let wipeDisabledList = this.returnWipeDisabledList();
+      if (!wipeDisabledList.length) return false;
+      return !wipeDisabledList.includes(false);
+    },
+  },
+  props: {
+    // 双向绑定
+    value: {
+      type: Boolean,
+      default: false,
+    },
+    // 取消按钮文字
+    cancelText: {
+      type: String,
+      default: "取消",
+    },
+    // 确认按钮文字
+    confirmText: {
+      type: String,
+      default: "确认",
+    },
+    // label对应的key名称
+    labelName: {
+      type: String,
+      default: "label",
+    },
+    // value对应的key名称
+    valueName: {
+      type: String,
+      default: "value",
+    },
+    // 是否允许点击遮罩层关闭
+    maskCloseAble: {
+      type: Boolean,
+      default: true,
+    },
+    // 是否显示全选
+    allShow: {
+      type: Boolean,
+      default: true,
+    },
+    // 模式
+    mode: {
+      type: String,
+      default: "multiple",
+    },
+    // 默认选中值
+    defaultSelected: {
+      type: Array,
+      default: function () {
+        return [];
+      },
+    },
+    // 数据源
+    data: {
+      type: Array,
+      required: true,
+      default: () => {
+        return [];
+      },
+    },
+  },
+  created() {
+    console.log(this.data, "111111");
+	this.show = this.value;
+	console.log(this.value)
+  },
+  watch: {
+    async value(newVal) {
+      this.show = newVal;
+      await this.$nextTick();
+      this.activeClass = newVal;
+      if (newVal) {
+        this.selectedArrOld = JSON.parse(JSON.stringify(this.selectedArr));
+      }
+    },
+    async data(newVal) {
+      this.data = newVal;
+      await this.$nextTick();
+      console.log(this.data);
+    },
+    show(newVal) {
+      this.$emit("input", newVal);
+      this.$emit("change", newVal);
+    },
+    data: {
+      // 设置初始选择对照列表
+      handler(list) {
+        this.selectedArr = list.map((el) => false);
+        this.setItemActiveState();
+      },
+      deep: true,
+      immediate: true,
+    },
+    defaultSelected: {
+      handler() {
+        this.setItemActiveState();
+      },
+      deep: true,
+      immediate: true,
+    },
+  },
+  methods: {
+    // 设置默认选中通用办法
+    setItemActiveState() {
+      if (this.data.length && this.defaultSelected.length) {
+        this.data.forEach((item, i) => {
+          for (let n = 0; n < this.defaultSelected.length; n++) {
+            if (
+              !item.disabled &&
+              item[this.valueName] === this.defaultSelected[n]
+            ) {
+              this.selectedArr.splice(i, 1, true);
+              break;
+            }
+          }
+        });
+      }
+    },
+    /**
+     * 选择事件
+     * @index {Number} 点击下标
+     */
+    onSelected(index) {
+      if (this.data[index].disabled) return;
+      let index2Active = this.selectedArr[index];
+      this.selectedArr.splice(index, 1, !index2Active);
+    },
+    // 取消事件
+    onCancel(isMask) {
+      if (!isMask || this.maskCloseAble) {
+        this.show = false;
+        this.selectedArr = JSON.parse(JSON.stringify(this.selectedArrOld));
+      } else {
+        return;
+      }
+      this.$emit("cancel");
+    },
+    // 返回去除了disabled状态后的对照列表
+    returnWipeDisabledList() {
+      let arr = [];
+      this.selectedArr.forEach((el, index) => {
+        if (!this.data[index].disabled) arr.push(el);
+      });
+      return arr;
+    },
+    // 全选/非全选事件
+    onAllToggle() {
+      let wipeDisabledList = this.returnWipeDisabledList();
+      // 如果去除了disabled的对照列表有false的数据,代表未全选
+      if (wipeDisabledList.includes(false)) {
+        this.selectedArr.forEach((el, index) => {
+          if (!this.data[index].disabled)
+            this.selectedArr.splice(index, 1, true);
+        });
+      } else {
+        this.selectedArr.forEach((el, index) => {
+          if (!this.data[index].disabled)
+            el = this.selectedArr.splice(index, 1, false);
+        });
+      }
+    },
+    // 确定事件
+    onConfirm() {
+      console.log(11212);
+      this.show = false;
+      let selectedData = [];
+      this.selectedArr.forEach((el, index) => {
+        if (el) {
+          console.log(el);
+          selectedData.push(this.data[index]);
+        }
+      });
+      if (this.mode === "multiple") {
+        console.log(selectedData);
+        this.$emit("confirm", selectedData);
+      } else {
+        let backData = selectedData[0] || {};
+        this.$emit("confirm", backData);
+      }
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.select-container {
+  width: 100vw;
+  // height: 100vh;
+  position: fixed;
+  left: 0;
+  bottom: 0;
+  z-index: 999;
+  $paddingLR: 18rpx;
+  .mask {
+    width: 100%;
+    height: 100%;
+    background-color: $uni-bg-color-mask;
+    opacity: 0;
+    transition: opacity 0.3s;
+    &.mask-show {
+      opacity: 1;
+    }
+  }
+  // 选择器内容区域
+  .select-box {
+    width: 100%;
+    position: absolute;
+    bottom: 0;
+    left: 0;
+    transform: translate3d(0px, 100%, 0px);
+    background-color: $uni-bg-color;
+    transition: all 0.3s;
+    &.select-box-show {
+      transform: translateZ(0);
+    }
+    .header {
+      display: flex;
+      box-sizing: border-box;
+      width: 100%;
+      justify-content: space-between;
+      border-bottom: 1px solid $uni-border-color;
+      line-height: 76rpx;
+      font-size: 30rpx;
+      padding: 0 $paddingLR;
+      .cancel {
+        color: $uni-text-color-grey;
+      }
+      .all {
+        color: $uni-color-success;
+        .all-active {
+          &::after {
+            display: inline-block;
+            content: "✔";
+            padding-left: 8rpx;
+          }
+        }
+      }
+      .confirm {
+        color: $uni-color-primary;
+      }
+    }
+    .body-warp {
+      width: 100%;
+      height: 30vh;
+      box-sizing: border-box;
+      padding: 20rpx $paddingLR;
+    }
+    .body {
+      width: 100%;
+      height: 100%;
+      overflow-y: auto;
+      .empty-tips {
+        margin-top: 25%;
+        text-align: center;
+        font-size: 26rpx;
+        color: $uni-color-error;
+      }
+      .select-item {
+        display: flex;
+        font-size: 26rpx;
+        line-height: 58rpx;
+        color: #303133;
+        position: relative;
+        transition: all 0.3s;
+        &.selected {
+          color: $uni-color-primary;
+        }
+        &.disabled {
+          color: $uni-text-color-disable;
+        }
+        > .label {
+          flex: 1;
+          text-align: center;
+        }
+        > .selected-icon {
+          position: absolute;
+          right: 0;
+          top: 50%;
+          transform: translateY(-50%);
+        }
+      }
+    }
+  }
+}
+</style>

+ 4 - 0
main.js

@@ -14,6 +14,10 @@ Vue.prototype.$imghost = 'http://www.hnyfwlw.com:8006/projectimg' // 线上图
 // http://www.hnyfwlw.com:8006/bigdata_app/image/10ca93e17420371a82826073c8425c0.png
 Vue.prototype.$appimghost = 'http://www.hnyfwlw.com:8006/bigdata_app'
 
+import {QueryPermission} from './util/QueryPermission.js'
+// Vue.use(QueryPermission)
+Vue.prototype.$QueryPermission = QueryPermission;
+
 Vue.filter('timeFormat',function(time){
 	function fun(a){
 		return	String(a).length==1?'0'+a: a

+ 7 - 4
manifest.json

@@ -2,8 +2,8 @@
     "name" : "云飞智控",
     "appid" : "__UNI__DBA6730",
     "description" : "",
-    "versionName" : "1.0.3",
-    "versionCode" : 103,
+    "versionName" : "1.0.4",
+    "versionCode" : 104,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {
@@ -124,7 +124,7 @@
         "setting" : {
             "urlCheck" : false,
             "minified" : true,
-            "postcss" : false,
+            "postcss" : true,
             "es6" : true
         },
         "usingComponents" : true,
@@ -132,7 +132,10 @@
             "scope.userLocation" : {
                 "desc" : "你的位置信息将用于小程序位置接口展示天气信息"
             }
-        }
+        },
+		"optimization": {
+		    "subPackages": true
+		}
     },
     "mp-alipay" : {
         "usingComponents" : true

+ 255 - 82
pages.json

@@ -3,13 +3,6 @@
 		"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
 	},
 	"pages": [{
-			"path": "pages/login/login",
-			"style": {
-				"navigationBarTitleText": "",
-				"navigationStyle": "custom"
-			}
-		},
-		{
 			"path": "pages/index/index",
 			"style": {
 				"navigationBarTitleText": "首页",
@@ -21,15 +14,6 @@
 				"navigationBarTitleText": "设备分布",
 				"enablePullDownRefresh": false
 			}
-
-		}, {
-			"path": "pages/disandpests/index",
-			"style": {
-				"navigationBarTitleText": "病虫害识别",
-				"enablePullDownRefresh": false,
-				"navigationStyle": "custom"
-			}
-
 		}, {
 			"path": "pages/webview",
 			"style": {
@@ -54,6 +38,27 @@
 		}
 	],
 	"subPackages": [{
+			"root": "pages/disandpests",
+			"pages": [{
+				"path": "index",
+				"style": {
+					"navigationBarTitleText": "病虫害识别",
+					"enablePullDownRefresh": false,
+					"navigationStyle": "custom"
+				}
+			}]
+		},
+		{
+			"root": "pages/login",
+			"pages": [{
+				"path": "login",
+				"style": {
+					"navigationBarTitleText": "",
+					"navigationStyle": "custom"
+				}
+			}]
+		},
+		{
 			"root": "pages/equipMange/index",
 			"pages": [{
 					"path": "index",
@@ -99,45 +104,52 @@
 			]
 		},
 		{
-			"root": "pages/cb",
+			"root": "pages/cb/index",
 			"pages": [{
-					"path": "index/index",
-					"style": {
-						"navigationBarTitleText": "测报系统",
-						"enablePullDownRefresh": true,
-						"navigationStyle": "custom"
-					}
-				}, {
-					"path": "equip-detail/equip-detail",
-					"style": {
-						"navigationBarTitleText": "设备详情",
-						"enablePullDownRefresh": false
-					}
-
-				}, {
-					"path": "cbd/equip-set/equip-set",
-					"style": {
-						"navigationBarTitleText": "设备控制",
-						"enablePullDownRefresh": false
-					}
+				"path": "index",
+				"style": {
+					"navigationBarTitleText": "测报系统",
+					"enablePullDownRefresh": true,
+					"navigationStyle": "custom"
+				}
+			}, {
+				"path": "search",
+				"style": {
+					"navigationBarTitleText": "",
+					"enablePullDownRefresh": false,
+					"navigationStyle": "custom"
+				}
+			}]
+		},
+		{
+			"root": "pages/cb/bzy",
+			"pages": [{
+				"path": "equip-set/equip-set",
+				"style": {
+					"navigationBarTitleText": "设备控制",
+					"enablePullDownRefresh": false
+				}
 
-				},
-				{
-					"path": "bzy/equip-set/equip-set",
+			}, {
+				"path": "equip-set/bzyhistoryile",
+				"style": {
+					"navigationBarTitleText": "孢子仪历史记录",
+					"enablePullDownRefresh": false,
+					"navigationStyle": "custom"
+				}
+			}]
+		},
+		{
+			"root": "pages/cb/cbd",
+			"pages": [{
+					"path": "equip-set/equip-set",
 					"style": {
 						"navigationBarTitleText": "设备控制",
 						"enablePullDownRefresh": false
 					}
 
 				}, {
-					"path": "sim/sim",
-					"style": {
-						"navigationBarTitleText": "sim卡详情",
-						"enablePullDownRefresh": false
-					}
-
-				}, {
-					"path": "cbd/equip-set/imgpage",
+					"path": "equip-set/imgpage",
 					"style": {
 						"navigationBarTitleText": "图片列表",
 						"enablePullDownRefresh": false,
@@ -145,7 +157,7 @@
 					}
 
 				}, {
-					"path": "cbd/equip-set/addimg",
+					"path": "equip-set/addimg",
 					"style": {
 						"navigationBarTitleText": "手动添加",
 						"enablePullDownRefresh": false,
@@ -153,7 +165,7 @@
 					}
 
 				}, {
-					"path": "cbd/equip-set/historyfile",
+					"path": "equip-set/historyfile",
 					"style": {
 						"navigationBarTitleText": "测报灯历史记录",
 						"enablePullDownRefresh": true,
@@ -161,7 +173,7 @@
 					}
 
 				}, {
-					"path": "cbd/equip-set/note",
+					"path": "equip-set/note",
 					"style": {
 						"navigationBarTitleText": "短信预警",
 						"enablePullDownRefresh": false,
@@ -169,75 +181,162 @@
 					}
 
 				}, {
-					"path": "cbd/equip-set/statistics",
+					"path": "equip-set/statistics",
 					"style": {
 						"navigationBarTitleText": "害虫统计",
 						"enablePullDownRefresh": false,
 						"navigationStyle": "custom"
 					}
 
-				}, {
-					"path": "bzy/equip-set/bzyhistoryile",
+				},
+				{
+					"path": "equip-set/analyse",
 					"style": {
-						"navigationBarTitleText": "孢子仪历史记录",
-						"enablePullDownRefresh": false,
-						"navigationStyle": "custom"
+						"navigationBarTitleText": "害虫分析",
+						"enablePullDownRefresh": false
 					}
+
 				},
 				{
-					"path": "xy/equip-set/equip-set",
+					"path": "equip-set/results",
 					"style": {
-						"navigationBarTitleText": "设备控制",
+						"navigationBarTitleText": "识别结果",
 						"enablePullDownRefresh": false
 					}
 
 				}, {
-					"path": "xy/equip-set/xyhistoryile",
+					"path": "equip-set/manualinput",
 					"style": {
-						"navigationBarTitleText": "性诱设备历史记录",
-						"enablePullDownRefresh": false,
-						"navigationStyle": "custom"
+						"navigationBarTitleText": "手动统计",
+						"enablePullDownRefresh": false
 					}
+				}
+			]
+		},
+		{
+			"root": "pages/cb/xy2.0",
+			"pages": [{
+				"path": "particulars",
+				"style": {
+					"navigationBarTitleText": "设备详情",
+					"enablePullDownRefresh": false
+				}
 
-				}, {
-					"path": "index/search",
+			}, {
+				"path": "historydatas",
+				"style": {
+					"navigationBarTitleText": "历史数据",
+					"enablePullDownRefresh": false
+				}
+
+			}]
+		},
+		{
+			"root": "pages/cb/thxydetail",
+			"pages": [{
+					"path": "thxydetail",
 					"style": {
-						"navigationBarTitleText": "",
-						"enablePullDownRefresh": false,
-						"navigationStyle": "custom"
+						"navigationBarTitleText": "设备详情",
+						"enablePullDownRefresh": false
 					}
 				},
 				{
-					"path": "xy2.0/particulars",
+					"path": "photolist",
 					"style": {
-						"navigationBarTitleText": "设备详情",
-						"enablePullDownRefresh": false
+						"navigationBarTitleText": "查看图片",
+						"enablePullDownRefresh": false,
+						"navigationStyle": "custom"
 					}
 
 				}, {
-					"path": "xy2.0/historydatas",
+					"path": "thxyset",
 					"style": {
-						"navigationBarTitleText": "历史数据",
+						"navigationBarTitleText": "设备控制",
 						"enablePullDownRefresh": false
 					}
 
-				}, {
-					"path": "cbd/equip-set/results",
+				},
+				{
+					"path": "thxyhisdata",
 					"style": {
-						"navigationBarTitleText": "识别结果",
+						"navigationBarTitleText": "历史数据",
 						"enablePullDownRefresh": false
 					}
 
-				}, {
-					"path": "cbd/equip-set/manualinput",
-					"style": {
-						"navigationBarTitleText": "手动统计",
-						"enablePullDownRefresh": false
-					}
+				}
+			]
+		},
+		{
+			"root": "pages/cb/xctdetail",
+			"pages": [{
+				"path": "xctdetail",
+				"style": {
+					"navigationBarTitleText": "设备详情",
+					"enablePullDownRefresh": false
+				}
+			}, {
+				"path": "xctset",
+				"style": {
+					"navigationBarTitleText": "设备控制",
+					"enablePullDownRefresh": false
+				}
 
+			}, {
+				"path": "photolist",
+				"style": {
+					"navigationBarTitleText": "查看图片",
+					"enablePullDownRefresh": false,
+					"navigationStyle": "custom"
 				}
 
-			]
+			}, {
+				"path": "analyse",
+				"style": {
+					"navigationBarTitleText": "害虫分析",
+					"enablePullDownRefresh": false
+				}
+			}]
+		},
+		{
+			"root": "pages/cb/sim",
+			"pages": [{
+				"path": "sim",
+				"style": {
+					"navigationBarTitleText": "sim卡详情",
+					"enablePullDownRefresh": false
+				}
+
+			}]
+		},
+		{
+			"root": "pages/cb/equip-detail",
+			"pages": [{
+				"path": "equip-detail",
+				"style": {
+					"navigationBarTitleText": "设备详情",
+					"enablePullDownRefresh": false
+				}
+
+			}]
+		},
+		{
+			"root": "pages/cb/xy",
+			"pages": [{
+				"path": "equip-set/equip-set",
+				"style": {
+					"navigationBarTitleText": "设备控制",
+					"enablePullDownRefresh": false
+				}
+
+			}, {
+				"path": "equip-set/xyhistoryile",
+				"style": {
+					"navigationBarTitleText": "性诱设备历史记录",
+					"enablePullDownRefresh": false,
+					"navigationStyle": "custom"
+				}
+
+			}]
 		},
 		{
 			"root": "pages/my/user-info",
@@ -536,6 +635,23 @@
 						"navigationStyle": "custom"
 					}
 
+				},
+				{
+					"path": "gsequipment",
+					"style": {
+						"navigationBarTitleText": "管式墒情设备详情页",
+						"enablePullDownRefresh": false,
+						"navigationStyle": "custom"
+					}
+
+				}, {
+					"path": "gshistory",
+					"style": {
+						"navigationBarTitleText": "管式墒情历史记录页",
+						"enablePullDownRefresh": false,
+						"navigationStyle": "custom"
+					}
+
 				}
 			]
 		},
@@ -605,6 +721,13 @@
 					"enablePullDownRefresh": false
 				}
 
+			}, {
+				"path": "search",
+				"style": {
+					"navigationBarTitleText": "设备搜索",
+					"enablePullDownRefresh": false
+				}
+
 			}]
 		},
 		{
@@ -655,6 +778,56 @@
 
 				}
 			]
+		},
+		{
+			"root": "pages/cbqxyj",
+			"pages": [{
+				"path": "cbwarn",
+				"style": {
+					"navigationBarTitleText": "测报预警",
+					"enablePullDownRefresh": false
+				}
+
+			}, {
+				"path": "basemap",
+				"style": {
+					"navigationBarTitleText": "设备位置",
+					"enablePullDownRefresh": false
+				}
+
+			}, {
+				"path": "addressbook",
+				"style": {
+					"navigationBarTitleText": "预警通讯录",
+					"enablePullDownRefresh": false
+				}
+
+			}, {
+				"path": "warnset",
+				"style": {
+					"navigationBarTitleText": "预警设置",
+					"enablePullDownRefresh": false
+				}
+
+			}]
+		},
+		{
+			"root": "pages/qxzyj",
+			"pages": [{
+				"path": "cbwarn",
+				"style": {
+					"navigationBarTitleText": "气象预警",
+					"enablePullDownRefresh": false
+				}
+
+			}, {
+				"path": "warnset",
+				"style": {
+					"navigationBarTitleText": "预警设置",
+					"enablePullDownRefresh": false
+				}
+
+			}]
 		}
 	],
 	"condition": { //模式配置,仅开发期间生效

+ 33 - 11
pages/cb/bzy/equip-set/bzyhistoryile.vue

@@ -26,7 +26,7 @@
 			</view>
 			<view class="condition">
 				<scroll-view  scroll-x="true" class="scroll-X" scroll-top="0">
-					<table class="table">
+					<table class="table" v-if="$QueryPermission(265)">
 						<tr class="tr">
 							<th class="th" v-for="(item,index) in thdata" :key="index">{{item}}</th>
 						</tr>
@@ -39,7 +39,7 @@
 							<td class="td">{{items.d_h_t.pre_temp}}</td>
 							<td class="td">{{items.d_h_t.batStatus==0?"正常":"欠压"}}</td>
 							<td class="td">{{items.d_h_t.rps==0?"正常":"雨控"}}</td>
-							<td class="td">{{items.d_h_t.usb_sta==0?"正常":"异常"}}</td>
+							<td class="td">{{Circulation.work_sta.value[items.d_h_t.work_sta]}}</td>
 							<td class="td">{{items.d_h_t.csq}}</td>
 							<td class="td">{{items.d_h_t.current}}</td>
 							<td class="td">{{items.d_h_t.vbat}}</td>
@@ -49,6 +49,26 @@
 							<td class="td" v-for="item in 13" :key="item">暂无数据</td>
 						</tr>
 					</table>
+					<table class="table" v-else>
+						<tr class="tr">
+							<th class="th" v-for="(item,index) in thdata2" :key="index">{{item}}</th>
+						</tr>
+						<tr class="tr" v-for="(items,indexs) in historylistdata" :key="indexs" v-if="!forbidden">
+							<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
+							<td class="td">{{items.d_h_t.ds==0?"关":"开"}}</td>
+							<td class="td">{{items.d_h_t.at}}</td>
+							<td class="td">{{items.d_h_t.ah}}</td>
+							<td class="td">{{items.d_h_t.set_temp}}</td>
+							<td class="td">{{items.d_h_t.pre_temp}}</td>
+							<td class="td">{{items.d_h_t.batStatus==0?"正常":"欠压"}}</td>
+							<td class="td">{{items.d_h_t.rps==0?"正常":"雨控"}}</td>
+							<td class="td">{{Circulation.work_sta.value[items.d_h_t.work_sta]}}</td>
+							<td class="td">{{items.d_h_t.dver}}</td>
+						</tr>
+						<tr class="tr" v-if="forbidden">
+							<td class="td" v-for="item in 10" :key="item">暂无数据</td>
+						</tr>
+					</table>
 				</scroll-view>
 				<view class="pagenumber">
 					<button @click="prev">上一页</button>
@@ -67,6 +87,7 @@
 
 <script>
 	import uCharts from '../../../../components/js_sdk/u-charts/u-charts/u-charts.js';
+	import Circulation from "../../../../static/js/equipState_dict.json"
 	var canvaColumnA = null;
 	export default {
 		data() {
@@ -85,8 +106,11 @@
 				page: 1,
 				pagesum: 1,
 				historylistdata: [],
-				thdata: ["上报时间", "设备开关", "环境温度(°C)", "环境湿度(%)", "保温仓设定温度(°C)", "保温仓当前温度(°C)", "电池状态", "雨控状态", "摄像头状态", "信号强度",
-					"电流(mA)","电压(V)", "设备版本"
+				thdata: ["上报时间", "设备开关", "环境温度(°C)", "环境湿度(%)", "保温仓设定温度(°C)", "保温仓当前温度(°C)", "电池状态", "雨控状态", "工作状态",
+					"信号强度", "电流(mA)", "电压(V)", "设备版本"
+				],
+				thdata2: ["上报时间", "设备开关", "环境温度(°C)", "环境湿度(%)", "保温仓设定温度(°C)", "保温仓当前温度(°C)", "电池状态", "雨控状态", "工作状态",
+					"设备版本"
 				],
 				forbidden: false,
 				canvastishiTF: false,//暂无数据提示
@@ -94,6 +118,7 @@
 				cWidth: '400',
 				cHeight: '400',
 				pixelRatio: 1,
+				Circulation:Circulation
 			}
 		},
 		methods: {
@@ -128,10 +153,10 @@
 					var xtitle = []
 					for (var i = 0; i < res.length; i++) {
 						var times = new Date(res[i].addtime * 1000)
-						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
-						arr1.unshift(res[i].temperature == "" ? "0" : res[i].temperature)
-						arr2.unshift(res[i].humidity == "" ? "0" : res[i].humidity)
-						arr3.unshift(res[i].others == "" ? "0" : res[i].others)
+						xtitle.push(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
+						arr1.push(res[i].temperature == "" ? "0" : res[i].temperature)
+						arr2.push(res[i].humidity == "" ? "0" : res[i].humidity)
+						arr3.push(res[i].others == "" ? "0" : res[i].others)
 					}
 					var obj = [{
 						name: '温度',
@@ -279,9 +304,6 @@
 						duration: 2000,
 						icon: "none"
 					});
-					uni.navigateBack({
-						delta: 1
-					})
 				}else{
 					uni.showToast({
 						title: '刷新失败',

+ 2 - 2
pages/cb/bzy/equip-set/equip-set.vue

@@ -67,7 +67,7 @@
 			</view>
 			<text class="line">-</text>
 			<view class="uni-list-cell time" @click="selectTime('et2')">
-				<text>{{coll_time.time04||'开始时间'}}</text>
+				<text>{{coll_time.time04||'结束时间'}}</text>
 				<u-icon name="clock"></u-icon>
 			</view>
 		</view>
@@ -78,7 +78,7 @@
 			</view>
 			<text class="line">-</text>
 			<view class="uni-list-cell time" @click="selectTime('et3')">
-				<text>{{coll_time.time06||'开始时间'}}</text>
+				<text>{{coll_time.time06||'结束时间'}}</text>
 				<u-icon name="clock"></u-icon>
 			</view>
 		</view>

+ 849 - 0
pages/cb/cbd/equip-set/analyse.vue

@@ -0,0 +1,849 @@
+<template>
+	<view class="anabox">
+		<view class="timebox">
+			<view class="schedulebox">
+				<view class="schedule" @click="pickertfone=!pickertfone">
+					<p class="schedule_value">{{yservalue}}</p>
+					<!-- {{titletext[indexone]}} -->
+					<p class="schedule_icon">
+						<u-icon name="arrow-down"></u-icon>
+					</p>
+				</view>
+				<u-picker v-model="pickertfone" mode="selector" @confirm="confirmFun" :default-selector="[yserindex]"
+					:range="yearlist"></u-picker>
+				<view class="schedule" @click="pickertfworm=!pickertfworm">
+					<p class="schedule_value">{{wormvalue}}</p>
+					<!-- {{titletext[indexone]}} -->
+					<p class="schedule_icon">
+						<u-icon name="arrow-down"></u-icon>
+					</p>
+				</view>
+				<u-picker v-model="pickertfworm" mode="selector" @confirm="confirmFun2" :default-selector="[wormindex]"
+					:range="wormlist"></u-picker>
+			</view>
+			<view class="wormtime">
+				<view class="wormtime_item">
+					<image src="../../../../static/images/cb/shijianqi.png" mode="" class="img"></image>
+					<p>始见期</p>
+					<p>{{timeobj.startTime}}</p>
+				</view>
+				<view class="wormtime_item">
+					<image src="../../../../static/images/cb/gaofengqi.png" mode="" class="img"></image>
+					<p>高峰期</p>
+					<p>{{timeobj.highTime}}</p>
+					<p>数量:{{timeobj.highNum}}头</p>
+				</view>
+				<view class="wormtime_item">
+					<image src="../../../../static/images/cb/zhongjianqi.png" mode="" class="img"></image>
+					<p>终见期</p>
+					<p>{{timeobj.endTime}}</p>
+				</view>
+			</view>
+			<view class="selecttimes" @click="tiemshow=!tiemshow">
+				<view class="" style="line-height: 28px;">
+					时间选择器
+				</view>
+				<view class="timesbox">
+					<!-- <image
+						:src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/prevention/1acfe2751c01d3786cdc49b83d7e505.png'"
+						mode=""></image> -->
+					<p>{{timetab(oldtime)}}</p>
+					<p class="or">至</p>
+					<p>{{timetab(newtime)}}</p>
+					<!-- <u-icon name="rili" custom-prefix="custom-icon" class="icon"></u-icon> -->
+				</view>
+				<u-calendar v-model="tiemshow" mode="range" @change="tiemchange"></u-calendar>
+			</view>
+			<view class="tendency">
+				<canvas canvas-id="canvasColumnA" id="canvasColumnA" class="charts" @touchstart="touchLineA($event)"
+					v-show="chartstf" @touchmove="moveLineA($event)" @touchend="touchEndLineA($event)"
+					disable-scroll=true
+					:style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>
+			</view>
+			<view class="tendency">
+				<canvas canvas-id="canvasRing" id="canvasRing" class="charts" @touchstart="touchRing" v-show="chartstf"
+					:style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>
+			</view>
+			<view class="tendency_pro">
+				<view class="" v-for="(item,index) in progresslist">
+					<span>{{index+1}}、{{item.name}}</span>
+					<u-line-progress :active-color="colorlist[index%6]"
+						:percent="Number((item.data/pestsum*100).toFixed(2))" :show-percent="false"></u-line-progress>
+					<span>{{Number((item.data/pestsum*100).toFixed(2))}}%</span>
+				</view>
+			</view>
+			<view class="tablebox">
+				<view class="top_text">
+					<view :class="topindex==index?'title_text_color':'tltle_text'" v-for="(item,index) in toptext"
+						:key="index" @click="changeindex(index)">
+						<span class="title_item">
+							{{item}}
+						</span>
+					</view>
+				</view>
+				<scroll-view scroll-top="0" scroll-x="true" class="scroll-X">
+					<table class="table" v-if="topindex==0">
+						<tr class="tr">
+							<th class="th" v-for="(item,index) in thdata" :key="item">{{item}}</th>
+						</tr>
+						<tr class="tr" v-for="(items,indexs) in eqlistdata" :key="indexs">
+							<td class="td">{{items.deviceId}}</td>
+							<td class="td">{{items.deviceName}}</td>
+							<td class="td" @click="wormdetails(items.pest_dict)">{{items.pestName}}</td>
+							<td class="td">{{items.addtime|timeFormat()}}</td>
+							<td class="td">{{items.location}}</td>
+							<td class="td" @click="examine(items.indentify_photo)">查看</td>
+						</tr>
+						<tr class="tr" v-if="forbidden1">
+							<td class="td" v-for="item in 6" :key="item">暂无数据</td>
+						</tr>
+					</table>
+					<table class="table2" v-else>
+						<tr class="tr">
+							<th class="th" v-for="(item,index) in thdata2" :key="item">{{item}}</th>
+						</tr>
+						<tr class="tr" v-for="(items,indexs) in eqlistdata" :key="indexs">
+							<td class="td">{{items.pest_name}}</td>
+							<td class="td">{{items.pest_num}}</td>
+							<td class="td">{{items.addtime|timeFormat()}}</td>
+						</tr>
+						<tr class="tr" v-if="forbidden2">
+							<td class="td" v-for="item in 6">暂无数据</td>
+						</tr>
+					</table>
+				</scroll-view>
+				<view class="pagenumber">
+					<button @click="prev" :disabled=" page == 1 ">上一页</button>
+					<view class="pagenumber_page">
+						第{{page}}页
+					</view>
+					<view class="pagenumber_page">
+						共 {{pagesum}} 页
+					</view>
+					<button @click="next" :disabled=" page == pagesum ">下一页</button>
+				</view>
+			</view>
+			<u-modal v-model="show" :mask-close-able="true" @confirm="modalconfirm" title="24小时数据">
+				<view class="modalbox">
+					<p v-for="(item,key) in pest_dict" :key="key">{{key}}--{{pest_dict[key]}}头</p>
+				</view>
+			</u-modal>
+		</view>
+	</view>
+</template>
+
+<script>
+	import uCharts from '../../../../components/js_sdk/u-charts/u-charts/u-charts.js';
+	var canvaColumnA = null;
+	var canvasRing = null;
+	export default {
+		data() {
+			return {
+				d_id: "",
+				oldtime: "",
+				newtime: "",
+				tiemshow: false,
+				cWidth: '350',
+				cHeight: '350',
+				pixelRatio: 1,
+				pickertfone: false,
+				yservalue: "",
+				yearlist: [],
+				yserindex: "",
+				pickertfworm: false,
+				wormvalue: "",
+				wormlist: [],
+				wormindex: "",
+				timeobj: {
+					endTime: "",
+					highNum: "",
+					highTime: "",
+					startTime: "",
+				},
+				progresslist: [],
+				reslist: {
+					char_data: {},
+					at_ah_info: []
+				},
+				pestsum: 0,
+				colorlist: ["rgb(24, 144, 255)", "rgb(47, 194, 91)", "rgb(250, 204, 20)", "rgb(240, 72, 100)",
+					"rgb(133, 67, 224)", "rgb(144, 237, 125)"
+				],
+				page: 1,
+				pagesum: 1,
+				eqlistdata: [],
+				thdata: [
+					"设备ID", "设备名称", "害虫名称", "上报时间", "设备位置", "图像"
+				],
+				thdata2: [
+					"害虫名称", "害虫数量", "上报时间"
+				],
+				topindex: 0,
+				toptext: ["图像溯源", "虫害基础数据"],
+				forbidden1: false,
+				forbidden2: false,
+				show: false,
+				pest_dict: {},
+				chartstf: true
+			}
+		},
+		watch: {
+			pickertfone: function(e) {
+				console.log(e)
+				this.chartstf = !e
+			},
+			tiemshow: function(e) {
+				this.chartstf = !e
+			},
+			pickertfworm: function(e) {
+				this.chartstf = !e
+			},
+		},
+		methods: {
+			getyear() {
+				var Year = new Date().getFullYear();
+				var num = Year - 2019;
+				for (var i = 0; i < num + 1; i++) {
+					this.yearlist.push(2019 + i);
+				}
+				this.yservalue = this.yearlist[this.yearlist.length - 1];
+				this.yserindex = this.yearlist.length - 1
+				this.getwormtime()
+			},
+			async getwormtime() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.pest_raise_info',
+					data: {
+						d_ids: this.d_id,
+						identify_model: 'A',
+						year: this.yservalue,
+					}
+				})
+				console.log(res)
+				this.wormlist = res.pest_list
+				this.wormtimelist = res.pest_info
+				this.wormvalue = this.wormlist[0]
+				this.wormindex = 0
+				if (this.wormvalue) {
+					this.timeobj = this.wormtimelist[this.wormvalue]
+				}
+				console.log(this.timeobj)
+
+			},
+			confirmFun(e) {
+				console.log(e)
+				this.yserindex = e[0]
+				this.yservalue = this.yearlist[e[0]]
+				this.getwormtime()
+			},
+			confirmFun2(e) {
+				console.log(e)
+				this.wormindex = e[0]
+				this.wormvalue = this.wormlist[e[0]]
+				this.timeobj = this.wormtimelist[this.wormvalue]
+				this.setlineoption()
+			},
+			async getwormline() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.pest_statistics_char_new',
+					data: {
+						d_ids: this.d_id,
+						identify_model: 'A',
+						start_time: this.oldtime,
+						end_time: this.newtime
+					}
+				})
+				// console.log(res)
+				this.reslist.char_data = res.char_data
+				this.reslist.at_ah_info = res.at_ah_info
+				var ringarr = []
+
+				if (this.checkObj(res.pest_total)) {
+					for (var key in res.pest_total) {
+						var nameobj = {
+							name: '',
+							data: "",
+						}
+						// console.log(key)
+						nameobj.name = key
+						nameobj.data = res.pest_total[key]
+						ringarr.push(nameobj)
+					}
+				}
+				this.setlineoption()
+				// this.showRing(ringarr)
+				var num = 0
+				for (var i = 0; i < ringarr.length - 5; i++) {
+					console.log(ringarr[i].name)
+					num += ringarr[i].data
+				}
+				this.pestsum = 0
+				for (var i = 0; i < ringarr.length; i++) {
+					this.pestsum += ringarr[i].data
+				}
+				var sumobj = {
+					name: "其他",
+					data: num,
+				}
+				var ringarr2 = ringarr.slice(ringarr.length - 5)
+				ringarr2.unshift(sumobj)
+				// console.log(ringarr2)
+				this.showRing(ringarr2)
+				console.log(ringarr)
+				this.progresslist = ringarr
+			},
+			setlineoption() {
+				var res = this.reslist
+				var xtitle = []
+				var obj = []
+				if (res.at_ah_info.length != 0) {
+					var aharr = []
+					var atarr = []
+					for (var i = 0; i < res.at_ah_info.length; i++) {
+						var times = new Date(res.at_ah_info[i].addtime * 1000)
+						xtitle.push(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" +
+							times.getSeconds())
+						atarr.push(res.at_ah_info[i].at == "" ? "0" : res.at_ah_info[i].at)
+						aharr.push(res.at_ah_info[i].ah == "" ? "0" : res.at_ah_info[i].ah)
+					}
+					var atobj = {
+						name: '温度',
+						data: atarr,
+						color: '#00E29D'
+					}
+					var ahobj = {
+						name: '湿度',
+						data: aharr,
+						color: '#6CBBFF'
+					}
+					obj.push(atobj)
+					obj.push(ahobj)
+				}
+				// console.log(this.wormvalue)
+				if (this.checkObj(res.char_data)) {
+					for (var key in res.char_data) {
+						if (this.wormvalue == key) {
+							var wormobj = {
+								name: key,
+								data: [],
+							}
+							for (var i = 0; i < res.char_data[key].length; i++) {
+								wormobj.data.push(res.char_data[key][i].ah == "" ? "0" : res.char_data[key][i].sum)
+							}
+							obj.push(wormobj)
+						}
+					}
+
+				}
+				this.showColumn("canvasColumnA", xtitle, obj)
+			},
+			checkObj(obj) {
+				for (let i in obj) {
+					return true;
+				}
+				return false;
+			},
+			tiemchange(e) {
+				console.log(e)
+				this.oldtime = +new Date(e.startDate) / 1000 - 8 * 60 * 60
+				this.newtime = +new Date(e.endDate) / 1000 + 16 * 60 * 60 - 1
+				// newtime: "",
+				console.log(this.oldtime, this.newtime)
+				this.page = 1
+				this.getwormline()
+				if (this.topindex == 0) {
+					this.gettabledata()
+				} else if (this.topindex == 1) {
+					this.gettabledata2()
+				}
+			},
+			timetab(e) {
+				e = new Date(e * 1000)
+				var year = e.getFullYear()
+				var month = e.getMonth() + 1 < 10 ? "0" + (e.getMonth() + 1) : e.getMonth() + 1
+				var day = e.getDate() < 10 ? "0" + e.getDate() : e.getDate()
+				var time = year + "/" + month + "/" + day
+				return time
+			},
+			showColumn(id, xtitle, xinfo) {
+				var _self = this
+				canvaColumnA = new uCharts({
+					canvasId: id,
+					type: 'line',
+					legend: {
+						position: "top"
+					},
+					fontSize: 11,
+					background: '#FFFFFF',
+					pixelRatio: 1,
+					animation: true,
+					dataLabel: false,
+					categories: xtitle,
+					series: xinfo,
+					enableScroll: true, //开启图表拖拽功能
+					xAxis: {
+						disableGrid: true,
+						type: 'grid',
+						gridType: 'dash',
+						itemCount: 5, //x轴单屏显示数据的数量,默认为5个
+						scrollShow: true, //新增是否显示滚动条,默认false
+						// scrollAlign: 'left', //滚动条初始位置
+						scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF
+						scrollColor: '#DEE7F7', //默认为 #A6A6A6
+					},
+					yAxis: {},
+					width: _self.cWidth * 1,
+					height: _self.cHeight * 1,
+					extra: {
+						line: {
+							type: 'curve'
+						}
+					}
+				});
+			},
+			touchLineA(e) {
+				console.log(e)
+				canvaColumnA.scrollStart(e);
+			},
+			moveLineA(e) {
+				canvaColumnA.scroll(e);
+			},
+			touchEndLineA(e) {
+				canvaColumnA.scrollEnd(e);
+				//下面是toolTip事件,如果滚动后不需要显示,可不填写
+				canvaColumnA.showToolTip(e, {
+					format: function(item, category) {
+						return category + ' ' + item.name + ':' + item.data
+					}
+				});
+			},
+			showRing(data) {
+				var _self = this
+				canvasRing = new uCharts({
+					canvasId: "canvasRing",
+					type: 'ring',
+					fontSize: 11,
+					legend: {
+						show: true,
+					},
+					extra: {
+						pie: {
+							offsetAngle: -45,
+							ringWidth: 40 * _self.pixelRatio,
+							labelWidth: 15
+						}
+					},
+					background: '#FFFFFF',
+					pixelRatio: _self.pixelRatio,
+					series: data,
+					animation: true,
+					width: _self.cWidth * _self.pixelRatio,
+					height: _self.cHeight * _self.pixelRatio,
+					disablePieStroke: true,
+					dataLabel: true,
+				});
+			},
+			touchRing(e) {
+				canvasRing.showToolTip(e, {
+					format: function(item) {
+						return item.name + ':' + item.data
+					}
+				});
+			},
+			tap(e) {
+				canvasgroup[e.target.id].touchLegend(e);
+				canvasgroup[e.target.id].showToolTip(e);
+			},
+			async gettabledata() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.pest_image_source',
+					data: {
+						d_ids: this.d_id,
+						identify_model: 'A',
+						start_time: this.oldtime,
+						end_time: this.newtime,
+						page: this.page
+					}
+				})
+				this.pagesum = Math.ceil(res.total_count / 10)
+				this.eqlistdata = res.pest_image_data
+				if (this.eqlistdata.length == 0) {
+					this.forbidden1 = true
+				} else {
+					this.forbidden1 = false
+				}
+				console.log(res)
+			},
+			async gettabledata2() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.pest_base_data',
+					data: {
+						d_ids: this.d_id,
+						identify_model: 'A',
+						start_time: this.oldtime,
+						end_time: this.newtime,
+						page: this.page
+					}
+				})
+				this.pagesum = Math.ceil(res.total_count / 10)
+				this.eqlistdata = res.pest_image_data
+				if (this.eqlistdata.length == 0) {
+					this.forbidden2 = true
+				} else {
+					this.forbidden2 = false
+				}
+				console.log(res)
+			},
+			changeindex(e) {
+				this.topindex = e
+				this.page = 1
+				if (e == 0) {
+					this.gettabledata()
+				} else if (e == 1) {
+					this.gettabledata2()
+				}
+			},
+			prev() {
+				this.page--
+				if (this.topindex == 0) {
+					this.gettabledata()
+				} else if (this.topindex == 1) {
+					this.gettabledata2()
+				}
+			},
+			next() {
+				this.page++
+				if (this.topindex == 0) {
+					this.gettabledata()
+				} else if (this.topindex == 1) {
+					this.gettabledata2()
+				}
+			},
+			wormdetails(data) {
+				console.log(data)
+				this.pest_dict = {}
+				this.show = true
+				this.pest_dict = JSON.parse(JSON.stringify(data))
+			},
+			modalconfirm() {
+				console.log("----------")
+				this.pest_dict = {}
+			},
+			examine(url) {
+				var imgarr = [url]
+				uni.previewImage({
+					urls: imgarr,
+					current: 0
+				});
+			},
+		},
+		onLoad(option) {
+			this.d_id = option.d_id
+			var date = +new Date() / 1000
+			this.oldtime = Math.floor(date - 24 * 60 * 60)
+			this.newtime = Math.floor(date)
+			this.cWidth = uni.upx2px(650);
+			this.cHeight = uni.upx2px(500);
+			this.getyear()
+			this.$nextTick(() => {
+				this.getwormline()
+				if (this.topindex == 0) {
+					this.gettabledata()
+				} else if (this.topindex == 1) {
+					this.gettabledata2()
+				}
+			}, 500)
+		}
+	}
+</script>
+
+<style lang="scss">
+	.anabox {
+		background-color: #f1f4ff;
+		padding-top: 10px;
+	}
+
+	.selecttimes {
+		// box-shadow: 0 0 10rpx #bcb9ca;
+		// padding: 10rpx 20rpx;
+		padding: 10px;
+		box-sizing: border-box;
+		margin: 10px auto 0;
+		display: flex;
+		background-color: #fff;
+		width: 95%;
+
+		.timesbox {
+			display: flex;
+			justify-content: space-around;
+			width: 60%;
+			margin-left: 10px;
+			border: 1px solid #CCCCCC;
+			padding: 5px;
+			font-size: 12px;
+			border-radius: 5px;
+
+			image {
+				width: 30rpx;
+				height: 30rpx;
+				margin-top: 6rpx;
+			}
+
+			.icon {
+				color: #949494;
+				text-align: right;
+				margin-left: 30rpx;
+
+			}
+		}
+	}
+
+	.wormtime {
+		width: 95%;
+		padding: 10px;
+		box-sizing: border-box;
+		margin: 0 auto;
+		// margin-top: 10px;
+		display: flex;
+		justify-content: space-around;
+		background-color: #fff;
+
+		.wormtime_item {
+			width: 25%;
+			margin-top: 10px;
+			padding: 10px;
+
+			.img {
+				width: 50px;
+				height: 50px;
+			}
+
+			p:nth-child(2) {
+				font-size: 16px;
+				font-weight: 700;
+			}
+
+			p:nth-child(3) {
+				font-size: 12px;
+				margin-top: 5px;
+			}
+
+			p:last-child {
+				font-size: 12px;
+				margin-top: 5px;
+			}
+		}
+
+		.wormtime_item:first-child {
+			background-color: #F9FAFE;
+		}
+
+		.wormtime_item:nth-child(2) {
+			background-color: #FFFCF9;
+		}
+
+		.wormtime_item:last-child {
+			background-color: #FCF8FF;
+		}
+	}
+
+	.schedulebox {
+		display: flex;
+		padding: 10px 10px;
+		box-sizing: border-box;
+		width: 95%;
+		// justify-content: space-around;
+		margin: 0px auto;
+		background-color: #fff;
+
+		.schedule {
+			display: flex;
+			width: 240rpx;
+			height: 50rpx;
+			// border: 2rpx solid #F0F0F0;
+			margin-right: 20rpx;
+			background-color: #F9FAFC;
+			border-radius: 25px;
+
+			.schedule_value {
+				width: 70%;
+				text-align: center;
+				line-height: 50rpx;
+				font-size: 24rpx;
+			}
+
+			.schedule_icon {
+				width: 30%;
+				// background-color: #F2F2F2;
+				text-align: center;
+				line-height: 50rpx;
+
+				/deep/.u-icon__icon {
+					color: rgba(0, 0, 0, 0.3);
+				}
+			}
+		}
+	}
+
+	.tendency {
+		width: 95%;
+		display: flex;
+		justify-content: space-around;
+		margin: 0 auto;
+		background-color: #fff;
+	}
+
+	.tendency_pro {
+		width: 95%;
+		padding: 0 20px;
+		box-sizing: border-box;
+		height: 140px;
+		overflow-y: auto;
+		margin: 0 auto;
+		background-color: #fff;
+
+		span:first-child {
+			display: inline-block;
+			width: 100px;
+			overflow: hidden; //溢出隐藏
+			white-space: nowrap; //禁止换行
+			text-overflow: ellipsis; //...
+		}
+
+		/deep/.u-progress {
+			width: calc(100% - 150px) !important;
+		}
+
+		span:last-child {
+			display: inline-block;
+			width: 30px;
+			margin-left: 10px;
+		}
+	}
+
+	.tablebox {
+		display: flex;
+		flex-wrap: wrap;
+		width: 95%;
+		margin: 10px auto 20px;
+		// box-shadow: 0 0 10rpx #bcb9ca;
+		background-color: #fff;
+
+		.top_text {
+			width: 100%;
+			display: flex;
+			height: 30px;
+			line-height: 30px;
+
+			.tltle_text {
+				width: 30%;
+				text-align: center;
+				// border: 2rpx solid #F0F0F0;
+				// text-align: center;
+				// background-color: #F0F0F0;
+				// color: #000;
+			}
+
+			.title_text_color {
+				width: 30%;
+				text-align: center;
+
+				.title_item {
+					border-bottom: 2px solid #64CC82;
+					color: #64CC82;
+				}
+
+				// width: 50%;
+				// border: 2rpx solid #64CC82;
+				// background-color: #64CC82;
+				// color: #fff;
+				// text-align: center;
+			}
+		}
+
+		.scroll-X {
+			width: 95%;
+			margin: 20rpx auto;
+
+			.table {
+				width: 1800rpx;
+
+				.td:nth-child(3),
+				.td:last-child {
+					color: #37aed8;
+				}
+			}
+
+			.tr {
+				display: flex;
+				overflow: hidden;
+
+				.th,
+				.td {
+					display: inline-block;
+					padding: 5rpx;
+					text-align: center;
+					height: 52rpx;
+					line-height: 52rpx;
+					width: 320rpx;
+				}
+
+			}
+
+			.tr:nth-child(2n-1) {
+				background-color: #f5fff8;
+			}
+
+			.tr:first-child {
+				background-color: #57c878;
+				color: #fff;
+			}
+		}
+
+		.pagenumber {
+			display: flex;
+			margin: 20rpx auto;
+
+			button {
+				width: 150rpx;
+				height: 50rpx;
+				line-height: 50rpx;
+				font-size: 26rpx;
+				text-align: center;
+				background-color: #57c878;
+				color: #FFFFFF;
+			}
+
+			.pagenumber_page {
+				width: 150rpx;
+				height: 50rpx;
+				line-height: 50rpx;
+				font-size: 26rpx;
+				text-align: center;
+			}
+		}
+	}
+
+	.modalbox {
+		width: 100%;
+		// display: flex;
+		// flex-wrap: wrap;
+		height: 120px;
+		padding-left: 30px;
+		margin-top: 10px;
+		overflow-y: auto;
+
+		p {
+			// width: 50%;
+		}
+	}
+
+	/deep/.u-calendar__action {
+		display: flex;
+		justify-content: space-around;
+
+		.u-calendar__action__text {
+			line-height: 25px;
+		}
+	}
+</style>

+ 1 - 1
pages/cb/cbd/equip-set/equip-set.vue

@@ -115,7 +115,7 @@
 			低温保护阈值(℃)
 		</view>
 		<view class="">
-			<slider :value="equipContrlForm.tpl" show-value="true" :min="1" :max="10" @change="sliderChange($event,'tpl')"
+			<slider :value="equipContrlForm.tpl" show-value="true" :min="-30" :max="10" @change="sliderChange($event,'tpl')"
 			 block-color="#57C878" activeColor="#57C878" step="1" />
 		</view>
 		<view class="tit">

+ 31 - 7
pages/cb/cbd/equip-set/historyfile.vue

@@ -26,14 +26,14 @@
 			</view>
 			<view class="condition">
 				<scroll-view scroll-top="0" scroll-x="true" class="scroll-X">
-					<table class="table">
+					<table class="table" v-if="$QueryPermission(270)">
 						<tr class="tr">
 							<th class="th" v-for="(item,index) in thdata" :key="'a'+index">{{item}}</th>
 						</tr>
 						<tr class="tr" v-for="(items,indexs) in historylistdata" :key="'b'+indexs" v-if="!forbidden">
 							<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
-							<td class="td">{{items.d_h_t.at==""||items.d_h_t.at=="25"||items.d_h_t.at=="25.0"||items.d_h_t.at=="2.5"?items.d_h_t.new_tem:items.d_h_t.at}}</td>
-							<td class="td">{{items.d_h_t.ah==""||items.d_h_t.ah=="30"||items.d_h_t.ah=="30.0"||items.d_h_t.ah=="3.0"?items.d_h_t.new_hum:items.d_h_t.ah}}</td>
+							<td class="td">{{items.d_h_t.at}}</td>
+							<td class="td">{{items.d_h_t.ah}}</td>
 							<td class="td">{{items.d_h_t.hrt}}</td>
 							<td class="td">{{items.d_h_t.rps==0?"正常":"雨控"}}</td>
 							<td class="td">{{items.d_h_t.tps==0?"正常":"温控"}}</td>
@@ -49,6 +49,27 @@
 							<td class="td" v-for="item in 13">暂无数据</td>
 						</tr>
 					</table>
+					<table class="table" v-else>
+						<tr class="tr">
+							<th class="th" v-for="(item,index) in thdata2" :key="'a'+index">{{item}}</th>
+						</tr>
+						<tr class="tr" v-for="(items,indexs) in historylistdata" :key="'b'+indexs" v-if="!forbidden">
+							<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
+							<td class="td">{{items.d_h_t.at}}</td>
+							<td class="td">{{items.d_h_t.ah}}</td>
+							<td class="td">{{items.d_h_t.hrt}}</td>
+							<td class="td">{{items.d_h_t.rps==0?"正常":"雨控"}}</td>
+							<td class="td">{{items.d_h_t.tps==0?"正常":"温控"}}</td>
+							<td class="td">{{items.d_h_t.lps==0?"正常":"光控"}}</td>
+							<td class="td">{{items.d_h_t.dg}}</td>
+							<td class="td">{{items.d_h_t.csq}}</td>
+							<td class="td">{{items.d_h_t.lng}}</td>
+							<td class="td">{{items.d_h_t.lat}}</td>
+						</tr>
+						<tr class="tr" v-if="forbidden">
+							<td class="td" v-for="item in 11">暂无数据</td>
+						</tr>
+					</table>
 				</scroll-view>
 				<view class="pagenumber">
 					<button @click="prev">上一页</button>
@@ -87,6 +108,9 @@
 				thdata: ["上报时间", "环境温度(°C)", "环境湿度(%)", "加热仓温度(°C)", "雨控状态", "温控状态", "光控状态", "灯管状态", "信号强度", "电流(mA)", "电压(V)",
 					"经度", "纬度"
 				],
+				thdata2: ["上报时间", "环境温度(°C)", "环境湿度(%)", "加热仓温度(°C)", "雨控状态", "温控状态", "光控状态", "灯管状态", "信号强度",
+					"经度", "纬度"
+				],
 				forbidden: false,
 				cWidth: '400',
 				cHeight: '400',
@@ -122,10 +146,10 @@
 					var xtitle = []
 					for (var i = 0; i < res.length; i++) {
 						var times = new Date(res[i].addtime * 1000)
-						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
-						arr1.unshift(res[i].temperature == "" ? "0" : res[i].temperature)
-						arr2.unshift(res[i].humidity == "" ? "0" : res[i].humidity)
-						arr3.unshift(res[i].others == "" ? "0" : res[i].others)
+						xtitle.push(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
+						arr1.push(res[i].temperature == "" ? "0" : res[i].temperature)
+						arr2.push(res[i].humidity == "" ? "0" : res[i].humidity)
+						arr3.push(res[i].others == "" ? "0" : res[i].others)
 					}
 					// console.log(arr1)
 					var obj = [{

+ 17 - 6
pages/cb/cbd/equip-set/imgpage.vue

@@ -33,18 +33,18 @@
 						<view class="icon_box" @click="delimg(item.id)">
 							<p class="iconfont icon-shanchu">删除</p>
 						</view>
-						<view class="icon_box" @click="shibie(item.id,item.addr)" v-if="disable==1 && device_type!=7">
+						<view class="icon_box" @click="shibie(item.id,item.addr)" v-if="myuid == '4' || (disable==1 && device_type!=7)">
 							<p class="iconfont icon-shibie">识别</p>
 						</view>
 						<view class="icon_box" v-else-if="disable==2 && device_type!=7">
 							<p class="iconfont icon-shibie">计数:{{item.des_nums}}只</p>
 						</view>
-						<view class="icon_box" @click="tongji(item)" v-if="device_type!=7">
+						<!-- <view class="icon_box" @click="tongji(item)" v-if="device_type!=7">
 							<p class="iconfont icon-tongji2">手动统计</p>
 						</view>
 						<view class="icon_box" @click="add(item)" v-if="device_type!=7">
 							<p class="iconfont icon-iconzhengli_shouxieqianpi">手动添加</p>
-						</view>
+						</view> -->
 						<p style="color: #06B535;">{{item.addtime|timeFormat()}}</p>
 					</view>
 				</view>
@@ -82,7 +82,8 @@
 				titleidnex:0,
 				tiemshow:false,
 				disable:"",
-				device_type:""
+				device_type:"",
+				myuid:""
 			}
 		},
 		methods: {
@@ -108,11 +109,12 @@
 			},
 			//forecast.forecast_system.equip_photo_del
 			async del(id) { //删除图片
+				var arr = [id]
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=forecast.forecast_system.equip_photo_del',
 					data: {
 						device_id: this.device_id,
-						addrlist: id
+						addrlist: JSON.stringify(arr)
 					}
 				})
 				if (res) {
@@ -120,6 +122,8 @@
 						title: '指令下发成功!',
 						duration: 2000
 					});
+					this.page = 1
+					this.imglists = []
 					this.imglistdata(parseInt(this.timestate),parseInt(this.timeend))
 				}else{
 					uni.showToast({
@@ -167,7 +171,7 @@
 				uni.showModal({
 					title: '提示',
 					content: '是否删除此图片?',
-					success: function(res) {
+					success: (res)=> {
 						if (res.confirm) {
 							this.del(id)
 							console.log('用户点击确定');
@@ -231,6 +235,13 @@
 			},
 		},
 		onLoad(option) {
+			uni.getStorage({
+				key:"myuid",
+				success:(res)=> {
+					this.myuid = res.data
+					console.log(this.myuid)
+				}
+			})
 			console.log(option)
 			this.device_id = option.device_id
 			this.d_id = option.d_id

+ 73 - 29
pages/cb/cbd/equip-set/results.vue

@@ -3,7 +3,8 @@
 		<view class="images_box">
 			<p class="title">图片标记</p>
 			<view class="images">
-				<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/cb/jiazai.ui.gif'" mode="" class="jiazai"></image>
+				<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/cb/jiazai.ui.gif'" mode=""
+					class="jiazai"></image>
 				<image :src="resuils.image" mode="" @click="examine(resuils)"></image>
 				<view class="imgbg" v-if="imgbg">
 					<image src="../../../../static/images/cb/6286299.gif" mode="" class="img"></image>
@@ -24,51 +25,81 @@
 </template>
 
 <script>
+	import jsencrypt from '@/components/jsencrypt/jsencrypt.vue';
+	import insect_dict from "../../../../static/data/cbd_pest_library.js"
 	export default {
 		data() {
 			return {
-				resuils:{
-					image:""
+				resuils: {
+					image: ""
 				},
-				id:"",
-				imgbg:false,
-				addr:""
+				id: "",
+				imgbg: false,
+				addr: ""
 			}
 		},
 		methods: {
 			//forecast.forecast_system.equip_photo_discern识别 see again
 			async discern(ret) { //识别图片
+				var publiukey = `-----BEGIN PUBLIC KEY-----
+			MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6m92fXUrccS4SoLg4W4jPRNua
+			4BcRk4ldLcqPuQpD2Mds2+hw+Gi+0MUnshF/r/DTcCJgkt7rtoY9EB6/XJ6MFw14
+			whhESFie/lZUWRsk8M89Rkr8m5rwmBl+uLAd5LopyshFqKTBXeT2ytHP1JCQLPBO
+			34Fy4/yEz4qEzkzBuwIDAQAB
+			-----END PUBLIC KEY-----`;
+				var time = +new Date();
+				var str2 = 'YuNfEi' + time + 'YuNfEi'
+				var pubblicData = jsencrypt.setEncrypt(publiukey, str2);
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=forecast.forecast_system.equip_photo_discern',
 					data: {
 						img_id: this.id,
 						ret: ret,
 						device_type: "cbd",
-						identify_model: "A"
+						identify_model: "A",
+						sign: pubblicData
 					}
 				})
 				console.log(res)
-				if(res){
+				if (res) {
+					if (ret == "see") {
+						this.resuils = res
+					} else if (ret == "again") {
+						// this.resuils.result
+						// console.log(insect_dict)
+						this.resuils.result = []
+						var arr = res.result.split("#")
+						for (var i = 0; i < arr.length; i++) {
+							arr[i] = arr[i].split(",")
+							var obj = {
+								number: arr[i][0],
+								nums: arr[i][1],
+								result_list: insect_dict[arr[i][0]]
+							}
+							this.resuils.result.push(obj)
+						}
+						console.log(arr)
+						// var obj
+					}
 					uni.showToast({
 						title: '识别成功!',
 						duration: 2000
 					});
-					this.resuils = res
-					this.imgbg =false
-				}else{
+					this.imgbg = false
+				} else {
 					this.resuils.image = this.addr
 					console.log(this.resuils)
 					this.imgbg = false
 					uni.showToast({
 						title: '识别无结果!',
 						duration: 2000,
-						icon:"none"
+						icon: "none"
 					});
 				}
 			},
-			anew(){
+			anew() {
 				this.discern("again")
-				this.imgbg =true
+				this.imgbg = true
 			},
 			examine(url) {
 				console.log(url)
@@ -89,27 +120,31 @@
 </script>
 
 <style lang="scss">
-	.images_box{
+	.images_box {
 		width: 90%;
 		margin: 0 auto;
 		padding-top: 20rpx;
-		.title{
+
+		.title {
 			border-left: 10rpx solid #71cd9a;
 			padding-left: 20rpx;
 			font-size: 30rpx;
 		}
-		.images{
+
+		.images {
 			margin: 20rpx 0;
 			width: 100%;
 			height: 480rpx;
 			position: relative;
-			image{
+
+			image {
 				width: 100%;
 				position: absolute;
 				top: 0;
 				left: 0;
 			}
-			.jiazai{
+
+			.jiazai {
 				width: 480rpx;
 				height: 400rpx;
 				position: absolute;
@@ -118,14 +153,16 @@
 				margin-top: -240rpx;
 				margin-left: -240rpx;
 			}
-			.imgbg{
+
+			.imgbg {
 				width: 100%;
 				height: 480rpx;
 				position: absolute;
 				top: 0;
 				left: 0;
-				background-color: rgba(0,0,0,0.5);
-				.img{
+				background-color: rgba(0, 0, 0, 0.5);
+
+				.img {
 					width: 430rpx;
 					height: 400rpx;
 					position: absolute;
@@ -136,11 +173,13 @@
 				}
 			}
 		}
-		.btn{
+
+		.btn {
 			width: 100%;
 			display: flex;
 			justify-content: flex-end;
-			.btn_box{
+
+			.btn_box {
 				width: 200rpx;
 				height: 60rpx;
 				background-color: #fbb40a;
@@ -151,24 +190,29 @@
 			}
 		}
 	}
-	.information{
+
+	.information {
 		width: 97%;
 		margin: 0 auto;
 		padding-top: 20rpx;
-		.title{
+
+		.title {
 			border-left: 10rpx solid #71cd9a;
 			padding-left: 20rpx;
 			font-size: 30rpx;
 		}
-		.information_data{
+
+		.information_data {
 			margin: 30rpx;
 			display: flex;
 			box-shadow: 0 0 10rpx #e8e5f7;
 			padding: 20rpx 10rpx;
-			p{
+
+			p {
 				margin-right: 20rpx;
 				font-size: 28rpx;
-				span{
+
+				span {
 					color: #FF0000;
 				}
 			}

+ 2 - 2
pages/cb/cbd/equip-set/statistics.vue

@@ -379,7 +379,7 @@
 					for (var i = 0; i < res.pests.pest_list.length; i++) {
 						var times = new Date(res.pests.pest_list[i].add_time * 1000)
 						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" +
-							times.getSeconds())
+							times.getMinutes())
 						arr1.unshift(res.pests.pest_list[i].pest_num == "" ? "0" : res.pests.pest_list[i].pest_num)
 					}
 					var obj = [{
@@ -400,7 +400,7 @@
 				var now = new Date()
 				this.$forceUpdate()
 				if (index[0] == 0) {
-					this.start_time = strrttime
+					this.start_time = Math.floor(+new Date() - 24*60*60*1000)
 					if (this.topindex == 0) {
 						if (this.pest_name == '') {
 							this.historys()

+ 83 - 111
pages/cb/equip-detail/equip-detail.vue

@@ -23,10 +23,26 @@
 				<text space="emsp">载玻片、培养液更换时间</text>
 				<u-icon name="edit-pen" color="#f0ad4e" size="28"></u-icon>
 			</view>
+			<view v-if="type==7">
+				<span :class="{'red': equipInfo.status_glass == 2 || equipInfo.status_glass == 1 }">
+					{{ glass_slide_timeTime(equipInfo.status_glass)}} </span>
+				<span style="margin: 0 10px;">|</span>
+				<span :class="{'red': equipInfo.status_cul == 2 || equipInfo.status_cul == 1 }">
+					{{ cultivateTime(equipInfo.status_cul) }} </span>
+			</view>
 			<view v-if="type==4" @click="addYx(equipInfo.d_id)">
 				<text space="emsp">添加诱芯</text>
+				<text style="margin: 0 10px;">{{equipInfo.decoy||"暂无"}}</text>
 				<u-icon name="edit-pen" color="#f0ad4e" size="28"></u-icon>
 			</view>
+			<view v-if="type==4">
+				<text space="emsp">诱芯更新时间</text>
+				<text style="margin: 0 10px;">{{equipInfo.xy_uptime}}</text>
+			</view>
+			<view v-if="type==4">
+				<text space="emsp">诱芯到期时间</text>
+				<text style="margin: 0 10px;">{{equipInfo.xy_expire}}</text>
+			</view>
 			<u-popup v-model="setTimeShow" mode="center" width="600rpx">
 				<u-field label="载玻片更换时间" placeholder="选择日期" label-width='240' required :error-message="glassErr"
 					v-model="glass_slide_time" @click="glass_show=true" :field-style="fieldstyle">
@@ -80,7 +96,10 @@
 		</view>
 		<view class="tit">
 			<p>实时数据</p>
-			<p class="span" @click="partClicks" v-if="equipInfo.type!=4">历史数据>>></p>
+			<p class="span" @click="partClicks" v-if="equipInfo.type!=4 && $QueryPermission(60) && equipInfo.type==3">
+				历史数据>>></p>
+			<p class="span" @click="partClicks" v-if="equipInfo.type!=4 && $QueryPermission(71) && equipInfo.type==7">
+				历史数据>>></p>
 		</view>
 		<view class="newtishi" v-if="dataloadingtf">
 			<p class="dataloading">加载中</p>
@@ -108,6 +127,7 @@
 
 <script>
 	import equipState from "../../../static/js/equipState_dict.json"
+	import {QueryPermission} from "../../../util/QueryPermission.js"
 	export default {
 		data() {
 			return {
@@ -125,34 +145,23 @@
 						icon: '/image/cb/1.png',
 						tex: '查看图片',
 						path: '/pages/cb/cbd/equip-set/imgpage',
-						tf: false
+						tf: QueryPermission(61)
 					},
-					// {
-					// 	icon: '/image/cb/2.png',
-					// 	tex: '历史数据',
-					// 	path: '/pages/cb/cbd/equip-set/historyfile',
-					// 	tf:false
-					// }, 
 					{
 						icon: '/image/cb/3.png',
-						tex: '害虫统计',
-						path: '/pages/cb/cbd/equip-set/statistics',
-						tf: false
+						tex: '害虫分析',
+						path: '/pages/cb/cbd/equip-set/analyse',
+						tf: QueryPermission(163)
 					}, {
 						icon: '/image/cb/4.png',
 						tex: '设备控制',
 						path: '/pages/cb/cbd/equip-set/equip-set',
-						tf: false
-					}, {
-						icon: '/image/cb/5.png',
-						tex: '短信预警',
-						path: '/pages/cb/cbd/equip-set/note',
-						tf: false
+						tf: QueryPermission(62)
 					}, {
 						icon: '/image/cb/6.png',
 						tex: 'sim卡详情',
 						path: '/pages/cb/sim/sim',
-						tf: true
+						tf: QueryPermission(274)
 					}, {
 						icon: '/image/environment/7.png',
 						tex: '一键报修',
@@ -164,24 +173,18 @@
 						icon: '/image/cb/4.png',
 						tex: '设备控制',
 						path: '/pages/cb/bzy/equip-set/equip-set',
-						tf: false
+						tf: QueryPermission(69)
 					}, {
 						icon: '/image/cb/1.png',
 						tex: '查看图片',
 						path: '/pages/cb/cbd/equip-set/imgpage',
-						tf: false
+						tf: QueryPermission(68)
 					},
-					// {
-					// 	icon: '/image/cb/2.png',
-					// 	tex: '历史数据',
-					// 	path: '/pages/cb/bzy/equip-set/bzyhistoryile',
-					// 	tf:false
-					// }, 
 					{
 						icon: '/image/cb/6.png',
 						tex: 'sim卡详情',
 						path: '/pages/cb/sim/sim',
-						tf: false
+						tf: QueryPermission(70)
 					}, {
 						icon: '/image/environment/7.png',
 						tex: '一键报修',
@@ -193,17 +196,17 @@
 					icon: '/image/cb/4.png',
 					tex: '设备控制',
 					path: '/pages/cb/xy/equip-set/equip-set',
-					tf: false
+					tf: QueryPermission(65),
 				}, {
 					icon: '/image/cb/6.png',
 					tex: 'sim卡详情',
 					path: '/pages/cb/sim/sim',
-					tf: false
+					tf: QueryPermission(66),
 				}, {
 					icon: '/image/cb/2.png',
 					tex: '历史数据',
 					path: '/pages/cb/xy/equip-set/xyhistoryile',
-					tf: false
+					tf: QueryPermission(67),
 				}, {
 					icon: '/image/environment/7.png',
 					tex: '一键报修',
@@ -436,6 +439,11 @@
 								txt: '电池状态',
 								value: this.newState.bs
 							},
+							{
+								icon: '/image/cb/xy2.0/yujing.png',
+								txt: '诱虫次数',
+								value: this.newState.yc
+							},
 						]
 				}
 			}
@@ -482,86 +490,6 @@
 			this.selectaddress(Number(this.equipInfo.lat), Number(this.equipInfo.lng))
 			var times = new Date()
 			this.date = times.getFullYear() + 1 + "-" + Number(times.getMonth() + 1) + "-" + times.getDate()
-			uni.getStorage({
-				key: "jurisdiction",
-				success: (res) => {
-					console.log(JSON.parse(res.data))
-					let items = JSON.parse(res.data).filter((item) => {
-						return item.pur_id == 36 //"测报系统"
-					})
-					console.log(items)
-					let items2 = items[0].children.filter((item) => {
-						return item.pur_id == 37 //"虫情测报灯"
-					})
-					let items3 = items[0].children.filter((item) => {
-						return item.pur_id == 38 //"性诱测报"
-					})
-					let items4 = items[0].children.filter((item) => {
-						return item.pur_id == 39 //"孢子仪"
-					})
-					console.log(items2[0].children)
-					var arr = []
-					if (items2[0]) {
-						arr = items2[0].children
-					}
-					for (var i = 0; i < arr.length; i++) {
-						switch (arr[i].pur_id) {
-							case 60:
-								// this.cbd[1].tf = true "数据详情"
-								break
-							case 61:
-								this.cbd[0].tf = true //"查看图片"
-								break
-							case 62:
-								this.cbd[2].tf = true //"设备控制"
-								break
-							case 63:
-								this.cbd[1].tf = true //"害虫统计"
-								break
-						}
-					}
-					console.log(items3[0])
-					var arr2 = []
-					if (items3[0]) {
-						arr2 = items3[0].children
-					}
-					for (var i = 0; i < arr2.length; i++) {
-						switch (arr2[i].pur_id) {
-							case 65:
-								this.xy[0].tf = true //"设备控制"
-								break;
-							case 66:
-								this.xy[1].tf = true //"SIM卡"
-								break;
-							case 67:
-								this.xy[2].tf = true //"数据详情"
-								break;
-						}
-					}
-					console.log(items4[0].children)
-					// var arr3 = items4[0].children
-					var arr3 = []
-					if (items4[0]) {
-						arr3 = items4[0].children
-					}
-					for (var i = 0; i < arr3.length; i++) {
-						switch (arr3[i].pur_id) {
-							case 69:
-								this.bzy[0].tf = true //"设备控制"
-								break;
-							case 68:
-								this.bzy[1].tf = true //"查看图片"
-								break;
-							case 71:
-								this.bzy[2].tf = true //"数据详情"
-								break;
-							case 70:
-								this.bzy[3].tf = true //"SIM卡"
-								break;
-						}
-					}
-				}
-			})
 		},
 		methods: {
 			async getState() {
@@ -578,13 +506,30 @@
 						end_time: Math.floor((+new Date()) / 1000)
 					}
 				})
-				this.dataloadingtf = false
+				// this.dataloadingtf = false
 				if (res.counts != 0) {
 					this.newState = res.data[0].d_h_t
 					this.newtishitf = false
 				} else {
 					this.newtishitf = true
 				}
+				this.getxyyc()
+			},
+			async getxyyc() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.xycb_pest_chart',
+					data: {
+						device_type_id: this.equipInfo.type || this.equipInfo.equip_type || this.equipInfo
+							.device_type_id,
+						d_id: this.equipInfo.d_id,
+						page: 1,
+						page_size: 1,
+						start_time: Math.floor((+new Date() - 30*24 * 60 * 60 * 1000) / 1000),
+						end_time: Math.floor((+new Date()) / 1000)
+					}
+				})
+				this.$set(this.newState,"yc",res.total_num)
+				this.dataloadingtf = false
 			},
 			partClick(path) {
 				console.log(path)
@@ -713,6 +658,29 @@
 					}
 				});
 			},
+			glass_slide_timeTime(date) {
+				if (date === 0) {
+					return "载玻片未到期";
+				} else if (date == 1) {
+					return "载玻片已到期";
+				} else if (date == 2) {
+					return "载玻片即将到期";
+				} else if (date === "") {
+					return "请设置培养液时间";
+				}
+			},
+			cultivateTime(date) {
+				console.log(date);
+				if (date === 0) {
+					return "培养液未到期";
+				} else if (date == 1) {
+					return "培养液已到期";
+				} else if (date == 2) {
+					return "培养液即将到期";
+				} else if (date === "") {
+					return "请设置培养液时间";
+				}
+			}
 		},
 	}
 </script>
@@ -885,4 +853,8 @@
 			line-height: 25px;
 		}
 	}
+
+	.red {
+		color: rgb(235, 103, 101);
+	}
 </style>

+ 127 - 32
pages/cb/index/index.vue

@@ -24,7 +24,7 @@
 			<view class="loading" v-if="loadingtf">
 				<image src="../../../static/images/ajax-loader.gif" mode="" class="img"></image>
 			</view>
-			<view class="" style="position: absolute;top: 180px;width: 100%;">
+			<view class="" style="position: absolute;top: 190px;width: 100%;">
 				<view class="content">
 					<template v-for="(item,index) in equipArr[active].list">
 						<equipItem @click.native="itemClick(item)" v-bind:item="item" :key="index">
@@ -103,6 +103,19 @@
 						list: [],
 						pageIndex: 1,
 						tf:false
+					},
+					{
+						name: '性诱3.0',
+						type: 8, //3虫情测报灯 7孢子仪 4智能性诱 性诱2.0
+						list: [],
+						pageIndex: 1,
+						tf: false
+					}, {
+						name: '吸虫塔',
+						type: 12, //3虫情测报灯 7孢子仪 4智能性诱 性诱2.0
+						list: [],
+						pageIndex: 1,
+						tf: false
 					}
 				],
 				device_id: '3', //筛选的设备id
@@ -120,28 +133,43 @@
 			uni.getStorage({
 				key:"jurisdiction",
 				success:(res)=>{
-					let items = JSON.parse(res.data).filter((item)=>{
-						return item.purview_name == "测报系统"
+					let items = JSON.parse(res.data).filter((item) => {
+						return item.pur_id == 36
 					})
 					var arr = items[0].children
-					for(var i =0;i<arr.length;i++){
-						switch (arr[i].purview_name){
-							case "虫情测报灯":
-								this.equipArr[0].tf = true
+					for (var i = 0; i < arr.length; i++) {
+						switch (arr[i].pur_id) {
+							case 37:
+								this.equipArr[0].tf = true //"虫情测报灯"
 								this.getEquipList(0)
 								break
-							case "性诱测报":
-								this.equipArr[2].tf = true
+							case 38:
+								this.equipArr[2].tf = true //"性诱测报"
 								this.getEquipList(2)
 								break
-							case "孢子仪":
-								this.equipArr[1].tf = true
+							case 39:
+								this.equipArr[1].tf = true //"孢子仪"
 								this.getEquipList(1)
 								break
-							case "性诱2.0":
-								this.equipArr[3].tf = true
+							case 161:
+								this.equipArr[3].tf = true //"性诱2.0"
 								this.getxyEquipList(3)
 								break
+							case 198:
+								this.equipArr[4].tf = true //"性诱2.0"
+								this.getthxyEquipList(4)
+								break
+							case 171:
+								this.equipArr[5].tf = true //"性诱3.0"
+								this.getxctEquipList(5)
+								break
+						}
+					}
+					for(var i=0;i<this.equipArr.length;i++){
+						if(this.equipArr[i].tf){
+							this.active = i
+							this.device_type = this.equipArr[i].type
+							break
 						}
 					}
 				}
@@ -159,9 +187,13 @@
 		onPullDownRefresh() {
 			this.equipArr[this.active].pageIndex = 1
 			this.equipArr[this.active].list = []
-			if(this.active==3){
+			if (this.active == 4) {
+				this.getthxyEquipList(4)
+			} else if (this.active == 5) {
+				this.getxctEquipList(5)
+			} else if (this.active == 3) {
 				this.getxyEquipList(3)
-			}else{
+			} else {
 				this.getEquipList(this.active)
 			}
 			setTimeout(() => {
@@ -174,10 +206,14 @@
 				return false
 			}
 			this.equipArr[act].pageIndex++;
-			if(this.active==3){
+			if (this.active == 4) {
+				this.getthxyEquipList(4)
+			} else if (this.active == 5) {
+				this.getxctEquipList(5)
+			} else if (this.active == 3) {
 				this.getxyEquipList(3)
-			}else{
-				this.getEquipList(act)
+			} else {
+				this.getEquipList(this.active)
 			}
 		},
 		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
@@ -236,6 +272,38 @@
 				this.equipArr[act].list = [...this.equipArr[act].list, ...res.data]
 				console.log(this.equipArr[act].list)
 			},
+			async getthxyEquipList(act) {
+				this.loadingtf = true
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.xy_three_list',
+					data: {
+						device_type_id: this.equipArr[act].type,
+						page: this.equipArr[act].pageIndex,
+						page_size: 10,
+						device_status: this.device_status,
+					}
+				})
+				this.loadingtf = false
+				console.log(res)
+				this.equipArr[act].list = [...this.equipArr[act].list, ...res.data]
+				console.log(this.equipArr[act].list)
+			},
+			async getxctEquipList(act) {
+				this.loadingtf = true
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.xct_list',
+					data: {
+						device_type_id: this.equipArr[act].type,
+						page: this.equipArr[act].pageIndex,
+						page_size: 10,
+						device_status: this.device_status,
+					}
+				})
+				this.loadingtf = false
+				console.log(res)
+				this.equipArr[act].list = [...this.equipArr[act].list, ...res.data]
+				console.log(this.equipArr[act].list)
+			},
 			tabClick(index) {
 				this.active = index;
 				this.device_id = this.equipArr[index].type
@@ -253,7 +321,16 @@
 					uni.navigateTo({
 						url: '/pages/cb/xy2.0/particulars?info=' + data
 					});
-				} else {
+				} else if (item.type == 8) {
+					console.log(data)
+					uni.navigateTo({
+						url: '/pages/cb/thxydetail/thxydetail?imei=' + item.imei
+					});
+				} else if (item.type == 12) {
+					uni.navigateTo({
+						url: '/pages/cb/xctdetail/xctdetail?info=' + data
+					});
+				} else{
 					uni.navigateTo({
 						url: '/pages/cb/equip-detail/equip-detail?info=' + data
 					});
@@ -277,9 +354,13 @@
 				this.equipArr[this.active].pageIndex=1
 				this.equipArr[this.active].list =[]
 				this.device_status = 1
-				if(this.active==3){
+				if (this.active == 4) {
+					this.getthxyEquipList(4)
+				} else if (this.active == 5) {
+					this.getxctEquipList(5)
+				} else if (this.active == 3) {
 					this.getxyEquipList(3)
-				}else{
+				} else {
 					this.getEquipList(this.active)
 				}
 				this.filtrateTF = !this.filtrateTF
@@ -288,9 +369,13 @@
 				this.equipArr[this.active].pageIndex=1
 				this.equipArr[this.active].list =[]
 				this.device_status = 0
-				if(this.active==3){
+				if (this.active == 4) {
+					this.getthxyEquipList(4)
+				} else if (this.active == 5) {
+					this.getxctEquipList(5)
+				} else if (this.active == 3) {
 					this.getxyEquipList(3)
-				}else{
+				} else {
 					this.getEquipList(this.active)
 				}
 				this.filtrateTF = !this.filtrateTF
@@ -299,9 +384,13 @@
 				this.equipArr[this.active].pageIndex=1
 				this.equipArr[this.active].list =[]
 				this.device_status = ""
-				if(this.active==3){
+				if (this.active == 4) {
+					this.getthxyEquipList(4)
+				} else if (this.active == 5) {
+					this.getxctEquipList(5)
+				} else if (this.active == 3) {
 					this.getxyEquipList(3)
-				}else{
+				} else {
 					this.getEquipList(this.active)
 				}
 				this.filtrateTF = !this.filtrateTF
@@ -388,20 +477,26 @@
 		}
 	}
 	.tab-box {
-		display: flex;
-		justify-content: space-around;
+		// position: fixed;
+		// top: 170px;
 		font-size: 30rpx;
 		line-height: 80rpx;
-		background-color: #FFFFFF;
+		background-color: #ffffff;
+		width: 100%;
+		z-index: 2;
+		overflow: hidden;
+		overflow-x: scroll;
+		white-space: nowrap;
 		margin-top: -10rpx;
-
 		.tab-item {
 			cursor: pointer;
 			position: relative;
+			width: 25%;
+			text-align: center;
+			display: inline-block;
+			padding: 10rpx 0;
 		}
-
-		;
-
+		
 		.tab-item.active {
 			.bottom-line {
 				bottom: 0;

+ 75 - 15
pages/cb/index/search.vue

@@ -72,8 +72,47 @@
 					url: '/api/api_gateway?method=sex_lure_nl.sex_lure.nl_device_list',
 					data: {
 						device_type_id: this.device_id,
+						device_id: this.imports,
+						page: this.page,
+						page_size: 10,
+					}
+				})
+				this.eqlistdata = this.eqlistdata.concat(res.data)
+				console.log(res)
+				if(this.eqlistdata.length==0){
+					this.none = true
+				}else{
+					this.none = false
+				}
+			},
+			async getthxyEquipList(act) {
+				this.loadingtf = true
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.xy_three_list',
+					data: {
+						device_type_id: this.device_id,
 						page: this.page,
 						page_size: 10,
+						device_id: this.imports,
+					}
+				})
+				this.eqlistdata = this.eqlistdata.concat(res.data)
+				console.log(res)
+				if(this.eqlistdata.length==0){
+					this.none = true
+				}else{
+					this.none = false
+				}
+			},
+			async getxctEquipList(act) {
+				this.loadingtf = true
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.xct_list',
+					data: {
+						device_type_id: this.device_id,
+						page: this.page,
+						page_size: 10,
+						device_id: this.imports,
 					}
 				})
 				this.eqlistdata = this.eqlistdata.concat(res.data)
@@ -88,20 +127,28 @@
 				Debounce(() => {
 					this.eqlistdata = []
 					this.page = 1
-					if(this.device_id==10){
-						this.getxyEquipList()
-					}else{
-						this.searchEquip()
+					if (this.device_id == 8) {
+						this.getthxyEquipList(8)
+					} else if (this.device_id == 12) {
+						this.getxctEquipList(12)
+					} else if (this.device_id == 10) {
+						this.getxyEquipList(10)
+					} else {
+						this.searchEquip(this.device_id)
 					}
 				}, 1000)()
 			},
 			search(){
 				this.eqlistdata = []
 				this.page = 1
-				if(this.device_id==10){
-					this.getxyEquipList()
-				}else{
-					this.searchEquip()
+				if (this.device_id == 8) {
+					this.getthxyEquipList(8)
+				} else if (this.device_id == 12) {
+					this.getxctEquipList(12)
+				} else if (this.device_id == 10) {
+					this.getxyEquipList(10)
+				} else {
+					this.searchEquip(this.device_id)
 				}
 			},
 			clickLeft(){
@@ -119,11 +166,20 @@
 				item.type = Number(this.device_id)
 				console.log(item)
 				let data = JSON.stringify(item)
-				if(item.type==10){
+				if (item.type == 10) {
 					uni.navigateTo({
 						url: '/pages/cb/xy2.0/particulars?info=' + data
 					});
-				}else{
+				} else if (item.type == 8) {
+					console.log(data)
+					uni.navigateTo({
+						url: '/pages/cb/thxydetail/thxydetail?imei=' + item.imei
+					});
+				} else if (item.type == 12) {
+					uni.navigateTo({
+						url: '/pages/cb/xctdetail/xctdetail?info=' + data
+					});
+				} else{
 					uni.navigateTo({
 						url: '/pages/cb/equip-detail/equip-detail?info=' + data
 					});
@@ -136,10 +192,14 @@
 		onReachBottom() {
 			this.page++
 			console.log(1)
-			if(this.device_id==10){
-				this.getxyEquipList()
-			}else{
-				this.searchEquip()
+			if (this.device_id == 8) {
+				this.getthxyEquipList(8)
+			} else if (this.device_id == 12) {
+				this.getxctEquipList(12)
+			} else if (this.device_id == 10) {
+				this.getxyEquipList(10)
+			} else {
+				this.searchEquip(this.device_id)
 			}
 		},
 		onBackPress(options) {
@@ -191,7 +251,7 @@
 		height: 200rpx;
 		text-align: center;
 		line-height: 200rpx;
-		font-size: 22px;
+		font-size: 16px;
 	}
 	.prevents {
 		width: 100%;

+ 85 - 80
pages/cb/sim/sim.vue

@@ -92,7 +92,7 @@
 					data_usage: 0, //当月用量
 					data_balance: 0, //剩余流量
 					expiry_date: 0, //到期日期,
-					simnew:""
+					simnew: ""
 				},
 				showHksimFlag: true, //是否显示hksim卡标识
 				hksim: {
@@ -102,15 +102,15 @@
 					data_usage: 0, //当月用量
 					data_balance: 0, //剩余流量
 					expiry_date: 0, //到期日期
-					simnew:""
+					simnew: ""
 				},
 				hksiminp: '', //更换ICCID
 				d_id: '',
 				sty: {
 					'background': '#F7F8FA'
 				},
-				loding:false,
-				loding2:false
+				loding: false,
+				loding2: false
 			}
 		},
 		onLoad(option) {
@@ -119,7 +119,7 @@
 			}
 			this.d_id = option.d_id
 			this.lookSIMCode('sim')
-			if(option.device_type!=4){
+			if (option.device_type != 4) {
 				this.lookSIMCode('hksim')
 			}
 			this.loding = true
@@ -141,6 +141,8 @@
 					}
 				})
 				let obj = res2.data.data
+				this.loding = false
+				this.loding2 = false
 				if (res2.code == 1) { //企鹏 新
 					var state = ""
 					switch (obj.deviceStatus) {
@@ -167,80 +169,80 @@
 							break;
 					}
 					if (flag == 'sim') {
-							this.sim = {
-								iccid: res[0].iccid,
-								account_status: state,
-								data_plan: obj.totalDataVolume, //套餐大小
-								data_usage: obj.usedDataVolume, //当月用量
-								data_balance: Number(obj.totalDataVolume) - Number(obj.usedDataVolume), //剩余流量
-								expiry_date: obj.dateDeactivated, //到期日期,
-								simnew:"新"
-							}
-							this.loding = false
-						} else if (flag == 'hksim') {
-							this.hksim = {
-								iccid: res[0].iccid,
-								account_status: state,
-								data_plan: obj.totalDataVolume, //套餐大小
-								data_usage: obj.usedDataVolume, //当月用量
-								data_balance: Number(obj.totalDataVolume) - Number(obj.usedDataVolume), //剩余流量
-								expiry_date: obj.ratePlanExpirationDate, //到期日期
-								simnew:"新"
-							}
-							this.loding2 = false
+						this.sim = {
+							iccid: res[0].iccid,
+							account_status: state,
+							data_plan: obj.totalDataVolume, //套餐大小
+							data_usage: obj.usedDataVolume, //当月用量
+							data_balance: Number(obj.totalDataVolume) - Number(obj.usedDataVolume), //剩余流量
+							expiry_date: obj.dateDeactivated, //到期日期,
+							simnew: "新"
 						}
-					} else if (res2.code == 2) { //合宙 旧
-						var state = ""
-						switch (obj.account_status) {
-							case 0:
-								state = "未知"
-								break;
-							case 1:
-								state = "测试期"
-								break;
-							case 2:
-								state = "沉默期"
-								break;
-							case 3:
-								state = "使用中"
-								break;
-							case 4:
-								state = "停机"
-								break;
-							case 5:
-								state = "停机保号"
-								break;
-							case 6:
-								state = "预销号"
-								break;
-							case 7:
-								state = "销号"
-								break;
+						// this.loding = false
+					} else if (flag == 'hksim') {
+						this.hksim = {
+							iccid: res[0].iccid,
+							account_status: state,
+							data_plan: obj.totalDataVolume, //套餐大小
+							data_usage: obj.usedDataVolume, //当月用量
+							data_balance: Number(obj.totalDataVolume) - Number(obj.usedDataVolume), //剩余流量
+							expiry_date: obj.ratePlanExpirationDate, //到期日期
+							simnew: "新"
 						}
-						this.simnew = "旧"
-						if (flag == 'sim') {
-							this.sim = {
-								iccid: res[0].iccid,
-								account_status: state, //卡状态 0-7 未知 测试期 沉默期 使用中 停机 停机保号 预销号 销号
-								data_plan: obj.data_plan, //套餐大小
-								data_usage: obj.data_usage, //当月用量
-								data_balance: obj.data_balance, //剩余流量
-								expiry_date: obj.expiry_date, //到期日期
-								simnew:"旧"
-							}
-							this.loding = false
-						} else if (flag == 'hksim') {
-							this.hksim = {
-								iccid: res[0].iccid,
-								account_status: state, //卡状态 0-7 未知 测试期 沉默期 使用中 停机 停机保号 预销号 销号
-								data_plan: obj.data_plan, //套餐大小
-								data_usage: obj.data_usage, //当月用量
-								data_balance: obj.data_balance, //剩余流量
-								expiry_date: obj.expiry_date, //到期日期
-								simnew:"旧"
-							}
-							this.loding2 = false
+						// this.loding2 = false
+					}
+				} else if (res2.code == 2) { //合宙 旧
+					var state = ""
+					switch (obj.account_status) {
+						case 0:
+							state = "未知"
+							break;
+						case 1:
+							state = "测试期"
+							break;
+						case 2:
+							state = "沉默期"
+							break;
+						case 3:
+							state = "使用中"
+							break;
+						case 4:
+							state = "停机"
+							break;
+						case 5:
+							state = "停机保号"
+							break;
+						case 6:
+							state = "预销号"
+							break;
+						case 7:
+							state = "销号"
+							break;
+					}
+					this.simnew = "旧"
+					if (flag == 'sim') {
+						this.sim = {
+							iccid: res[0].iccid,
+							account_status: state, //卡状态 0-7 未知 测试期 沉默期 使用中 停机 停机保号 预销号 销号
+							data_plan: obj.data_plan, //套餐大小
+							data_usage: obj.data_usage, //当月用量
+							data_balance: obj.data_balance, //剩余流量
+							expiry_date: obj.expiry_date, //到期日期
+							simnew: "旧"
 						}
+						// this.loding = false
+					} else if (flag == 'hksim') {
+						this.hksim = {
+							iccid: res[0].iccid,
+							account_status: state, //卡状态 0-7 未知 测试期 沉默期 使用中 停机 停机保号 预销号 销号
+							data_plan: obj.data_plan, //套餐大小
+							data_usage: obj.data_usage, //当月用量
+							data_balance: obj.data_balance, //剩余流量
+							expiry_date: obj.expiry_date, //到期日期
+							simnew: "旧"
+						}
+						// this.loding2 = false
+					}
 				}
 			},
 			async submit() {
@@ -277,23 +279,26 @@
 			margin-bottom: 20rpx;
 			box-sizing: border-box;
 			position: relative;
-			.sim_info_loding{
+
+			.sim_info_loding {
 				position: absolute;
 				top: 0;
 				left: 0;
 				width: 100%;
-				background-color: rgba(0,0,0,0.3);
+				background-color: rgba(0, 0, 0, 0.3);
 				border-radius: 20rpx;
 				height: 100%;
 				display: flex;
 				justify-content: space-around;
 				align-items: center;
-				.img{
+
+				.img {
 					width: 400rpx;
 					height: 350rpx;
-					
+
 				}
 			}
+
 			.item {
 				line-height: 56rpx;
 				font-size: 26rpx;

+ 278 - 0
pages/cb/thxydetail/photolist.vue

@@ -0,0 +1,278 @@
+<template>
+	<view>
+		<view class="status_bar"></view>
+		<view class="" style="position: relative;top: 44px;">
+			<view style="position: fixed;z-index: 100;">
+				<uni-nav-bar @clickLeft="clickLeft" left-icon="back" title="查看图片" rightIcon="camera"
+					@clickRight="clickRight"></uni-nav-bar>
+			</view>
+			<!-- <p class="tishi" v-if="tishi">暂无数据</p> -->
+			<view class="selecttimes" @click="tiemshow=!tiemshow">
+				<view class="timesbox">
+					<image
+						:src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/prevention/1acfe2751c01d3786cdc49b83d7e505.png'"
+						mode=""></image>
+					<p>{{timetab(timestate)}}</p>
+					<p class="or">~</p>
+					<p>{{timetab(timeend)}}</p>
+					<u-icon name="rili" custom-prefix="custom-icon" class="icon"></u-icon>
+				</view>
+				<u-calendar v-model="tiemshow" mode="range" @change="tiemchange"></u-calendar>
+			</view>
+			<view class="imglist">
+				<view class="imglist_box" v-for="(item,index) in imglists" :key="index">
+					<view class="imglist_left">
+						<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/jiazai.ui.gif" mode="">
+						</image>
+						<image :src="item.addr" mode="" @click="examine(index)"></image>
+					</view>
+					<view class="imglist_right">
+						<view class="">
+							{{item.time}}
+						</view>
+						<view class="">
+							害虫数量:{{item.pest_counts}}
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/6209a98f0cb3b5086f2ca36152c9269.png'"
+				mode=""></image>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				tiemshow:false,
+				timestate:"",
+				timeend:"",
+				isTop:false,
+				imglists:[],
+				device_id:"",
+				page:1,
+				d_id:""
+			}
+		},
+		methods: {
+			clickLeft(){
+				uni.navigateBack({
+					delta:1
+				})
+			},
+			clickRight(){
+				this.takephoto()
+			},
+			timetab(e) {
+				e = new Date(e * 1000)
+				var year = e.getFullYear()
+				var month = e.getMonth() + 1 < 10 ? "0" + (e.getMonth() + 1) : e.getMonth() + 1
+				var day = e.getDate() < 10 ? "0" + e.getDate() : e.getDate()
+				var time = year + "/" + month + "/" + day
+				return time
+			},
+			examine(index){
+				var imgarr = []
+				for (var i = 0; i < this.imglists.length; i++) {
+					imgarr.push(this.imglists[i].addr)
+				}
+				uni.previewImage({
+					urls: imgarr,
+					current: index
+				});
+			},
+			async getimglist(){
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.forecast_system.device_photo_list',
+					data: {
+						cmd: "xy_three",
+						device_id: this.device_id,
+						page: this.page,
+						page_number: "12",
+						time_begin: Math.floor(this.timestate),
+						time_end: Math.floor(this.timeend),
+					}
+				})
+				console.log(res)
+				this.imglists = res.data
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
+				})
+			},
+			tiemchange(e){
+				// console.log(e)
+				this.imglists = []
+				this.page = 1
+				console.log(e)
+				this.timestate = +new Date(e.startDate) / 1000 - 8 * 60 * 60
+				this.timeend = +new Date(e.endDate) / 1000 + 16 * 60 * 60
+				this.getimglist()
+			},
+			async takephoto() { //拍照
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.admin_device_control',
+					data: {
+						device_type_id: 8,
+						d_id: this.d_id,
+						cmd: "takephoto"
+					}
+				})
+				console.log(res)
+				if (res == true) {
+					uni.showToast({
+						title: '指令下发成功!',
+						duration: 2000
+					});
+					var that = this
+					setTimeout(() => {
+						that.getimglist()
+					}, 1000)
+				} else {
+					uni.showToast({
+						title: '指令下发失败!',
+						duration: 2000,
+						icon: "none"
+					});
+				}
+			
+			},
+		},
+		onLoad(option) {
+			this.d_id =  option.d_id
+			this.device_id = option.device_id
+			this.timeend = +new Date() / 1000
+			this.timestate = this.timeend - 60 * 60 * 24
+			this.getimglist()
+		},
+		onReachBottom() {
+			this.page++
+			this.getimglist()
+		},
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.tishi {
+		position: absolute;
+		top: 104px;
+		width: 95%;
+		left: 2.5%;
+		text-align: center;
+		font-size: 40rpx;
+	}
+
+	.selecttimes {
+		width: 100%;
+		position: fixed;
+		top: 85px;
+		left: 0;
+		z-index: 100;
+		background-color: #fff;
+		padding-top: 30rpx;
+
+		.timesbox {
+			display: flex;
+			width: 95%;
+			margin: 0 auto;
+			justify-content: space-around;
+			box-shadow: 0 0 10rpx #bcb9ca;
+			padding: 10rpx 20rpx;
+			box-sizing: border-box;
+
+			image {
+				width: 30rpx;
+				height: 30rpx;
+				margin-top: 6rpx;
+			}
+
+			.icon {
+				color: #949494;
+				text-align: right;
+				margin-left: 30rpx;
+
+			}
+		}
+
+		/deep/.u-calendar__action {
+			display: flex;
+			justify-content: space-around;
+
+			.u-calendar__action__text {
+				line-height: 25px;
+			}
+		}
+	}
+	.imglist {
+		position: absolute;
+		top: 100px;
+		width: 95%;
+		left: 2.5%;
+	
+		.imglist_box {
+			display: flex;
+			box-shadow: 0 0 10rpx #bcb9ca;
+			padding: 20rpx;
+			margin-bottom: 20rpx;
+			height: 140px;
+		}
+	
+		.imglist_left {
+			width: 50%;
+			position: relative;
+	
+			image {
+				position: absolute;
+				top: 0;
+				left: 0;
+				width: 100%;
+				height: 280rpx;
+			}
+		}
+	
+		.imglist_right {
+			margin-left: 40rpx;
+			padding: 10rpx 0;
+	
+			.icon_box {
+				margin-bottom: 12rpx;
+				font-size: 24rpx;
+	
+				.iconfont {
+					margin-right: 20rpx;
+					color: #56C877;
+					font-size: 32rpx;
+				}
+			}
+	
+			p:last-child {
+				margin-bottom: 0;
+			}
+	
+		}
+	}
+.top {
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+
+		image {
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
+</style>

+ 470 - 0
pages/cb/thxydetail/thxydetail.vue

@@ -0,0 +1,470 @@
+<template>
+	<view>
+		<view :class="['info',equipInfo.is_online==1?'on':'off']">
+			<view class="" @click="copy(equipInfo)">
+				设备ID:{{equipInfo.imei||equipInfo.device_id}}
+				<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/environment/fuzhi.png" mode="" class="tishi">
+				</image>
+			</view>
+			<view class="">
+				设备名称:{{equipInfo.device_name==""?"无":equipInfo.device_name}}
+			</view>
+			<view class="">
+				设备类型:性诱3.0
+			</view>
+			<view class="">
+				最新上报时间:{{equipInfo.addtime||equipInfo.uptime | timeFormat}}
+			</view>
+			<view class="">
+				设备地址:{{equipInfo.address}}
+			</view>
+			<view class="" @click="setdecoy">
+				诱芯名称:{{equipInfo.decoy}}
+				<u-icon name="edit-pen" color="#f0ad4e" size="28"></u-icon>
+			</view>
+			<view class="" @click="setdecoy">
+				诱芯到期时间:{{equipInfo.xy_expire}}
+				<u-icon name="edit-pen" color="#f0ad4e" size="28"></u-icon>
+			</view>
+		</view>
+		<u-popup v-model="yxShow" mode="center" width="600rpx">
+			<u-field label="害虫名称" label-width='240' required :error-message="xyErr" v-model="decoy" class="field"
+				:field-style="fieldstyle" placeholder="请填写害虫名称">
+			</u-field>
+			<u-field label="诱芯到期时间" label-width='240' required :error-message="xyErrtime" v-model="decoytime"
+				@click="settime" class="field" :field-style="fieldstyle" placeholder="请填写到期时间">
+			</u-field>
+			<view class="" style="text-align: center;color: #fa3534;">
+				{{tishitext}}
+			</view>
+			<view class="btn-box">
+				<u-button @click="yxSubmit" size="mini" type="success" class="box-item">确定</u-button>
+			</view>
+		</u-popup>
+		<u-calendar v-model="tiemshow" mode="date" :max-date="date" @change="tiemchange"></u-calendar>
+		<view class="caobox">
+			<view class="caobox_item" v-if="$QueryPermission(200)" @click="tophoto">
+				<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/1.png" mode="widthFix"></image>
+				<view class="">
+					查看图片
+				</view>
+			</view>
+			<view class="caobox_item" v-if="$QueryPermission(248)" @click="toset">
+				<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/4.png" mode="widthFix"></image>
+				<view class="">
+					设备控制
+				</view>
+			</view>
+			<view class="caobox_item" v-if="$QueryPermission(247)" @click="tosim">
+				<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/6.png" mode="widthFix"></image>
+				<view class="">
+					SIM卡
+				</view>
+			</view>
+			<view class="caobox_item" v-if="$QueryPermission(199)" @click="tohis">
+				<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/2.png" mode="widthFix"></image>
+				<view class="">
+					历史数据
+				</view>
+			</view>
+		</view>
+		<view class="realtime">
+			<view class="realtime_title">
+				<p>实时数据</p>
+			</view>
+			<view class="realtime_text">
+				<view class="realtime_item">
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/xy2.0/wendu.png" mode=""></image>
+					<view class="text">
+						<p>环境温度</p>
+						<p>{{at}}℃</p>
+					</view>
+				</view>
+				<view class="realtime_item">
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/xy2.0/shidu.png" mode=""></image>
+					<view class="text">
+						<p>环境湿度</p>
+						<p>{{ah}}%</p>
+					</view>
+				</view>
+				<view class="realtime_item">
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/xy2.0/tianqi.png" mode=""></image>
+					<view class="text">
+						<p>天气</p>
+						<p>{{wea}}</p>
+					</view>
+				</view>
+				<view class="realtime_item">
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/xy2.0/xiayu.png" mode=""></image>
+					<view class="text">
+						<p>是否下雨</p>
+						<p>{{rain}}</p>
+					</view>
+				</view>
+				<view class="realtime_item">
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/xy2.0/fengxiang.png" mode=""></image>
+					<view class="text">
+						<p>风力风向</p>
+						<p>{{wind}}</p>
+					</view>
+				</view>
+				<view class="realtime_item">
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/xy2.0/yujing.png" mode=""></image>
+					<view class="text">
+						<p>诱虫次数</p>
+						<p>{{wormnum}}</p>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				baseimei: "",
+				equipInfo: {},
+				trapnum: 1,
+				at: "",
+				ah: "",
+				wind: "",
+				wea: "",
+				rain: "",
+				wormnum: "",
+				decoy: "",
+				xyErr: "",
+				xyErrtime: "",
+				decoytime: "",
+				yxShow: false,
+				tiemshow: false,
+				date: "",
+				fieldstyle: { //输入框样式
+					border: "2rpx solid #f6f6f6",
+					"border-radius": "24px",
+					"padding-left": "20rpx",
+					"background-color": "#f6f6f6"
+				},
+				tishitext: ""
+			}
+		},
+		methods: {
+			tosim() {
+				uni.navigateTo({
+					url: "../sim/sim?d_id=" + this.equipInfo.d_id + "&device_id=" + this.equipInfo.imei +
+						"&device_type=" + this.equipInfo.type + "&disable=" + this.equipInfo.disable
+				})
+			},
+			tophoto() {
+				uni.navigateTo({
+					url: "./photolist?device_id=" + this.equipInfo.imei + "&d_id=" + this.equipInfo.d_id
+				})
+			},
+			toset() {
+				uni.navigateTo({
+					url: "./thxyset?device_id=" + this.equipInfo.imei + "&d_id=" + this.equipInfo.d_id +
+						"&dtype=" + this.equipInfo.dtype +
+						"&device_name=" + this.equipInfo.device_name
+				})
+			},
+			tohis() {
+				uni.navigateTo({
+					url: "./thxyhisdata?device_id=" + this.equipInfo.imei + "&d_id=" + this.equipInfo.d_id
+				})
+			},
+			copy(item) {
+				console.log(item)
+				uni.setClipboardData({
+					data: item.imei || item.device_id,
+					success: function() {
+						console.log('success');
+					}
+				});
+			},
+			async getbaseinfo() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.xy_three_list',
+					data: {
+						device_id: this.baseimei,
+						device_type_id: "8",
+						page: "1",
+						page_size: "10",
+					}
+				})
+				console.log(res.data[0])
+				this.equipInfo = res.data[0]
+				this.getatah()
+				this.getwind()
+				this.getweather()
+				this.getworm()
+			},
+			async getatah() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.xy_three_at_ah',
+					data: {
+						device_type_id: 8,
+						d_id: this.equipInfo.d_id,
+						start_time: Math.floor(+new Date() / 1000 - 30 * 24 * 60 * 60),
+						end_time: Math.floor(+new Date() / 1000),
+					}
+				})
+				console.log(res)
+				if (res.length) {
+					this.at = res[0].at
+					this.ah = res[0].ah
+				} else {
+					this.at = "暂无"
+					this.ah = "暂无"
+				}
+			},
+			async getwind() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.xy_three_history_data',
+					data: {
+						d_id: this.equipInfo.d_id,
+						start_time: Math.floor(+new Date() / 1000 - 30 * 24 * 60 * 60),
+						end_time: Math.floor(+new Date() / 1000),
+						device_id: this.equipInfo.imei,
+						page: 1,
+					}
+				})
+				// console.log(res.data[0].d_h_t)
+				if (res.data[0]) {
+					var fs = res.data[0].d_h_t.wind_sped;
+					let fx = res.data[0].d_h_t.wind_drec;
+					// if (fx > 337.5 || fx < 22.5) {
+					if (
+						(fx < 360 && fx > 337.5) ||
+						(fx < 22.5 && fx > 0) ||
+						fx == 0 ||
+						fx == 360
+					) {
+						fx = "北";
+					} else if (fx > 22.5 && fx < 67.5) {
+						fx = "东北";
+					} else if (fx > 67.5 && fx < 112.5) {
+						fx = "东";
+					} else if (fx > 112.5 && fx < 157.5) {
+						fx = "东南";
+					} else if (fx > 157.5 && fx < 202.5) {
+						fx = "南";
+					} else if (fx > 202.5 && fx < 247.5) {
+						fx = "西南";
+					} else if (fx > 247.5 && fx < 292.5) {
+						fx = "西";
+					} else if (fx > 292.5 && fx < 337.5) {
+						fx = "西北";
+					} else if (fx == 666) {
+						fx = "无";
+					}
+					if (fs >= 66.6) {
+						fs = 0;
+					}
+					// this.monitordata[4].key = fx + "风" + fs + "级";
+					this.wind = fx + "风" + fs + "级";
+				} else {
+					this.wind = "暂无"
+				}
+			},
+			async getweather() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_manage.weathers',
+					data: {
+						lng: Number(this.equipInfo.lng),
+						lat: Number(this.equipInfo.lat),
+					}
+				})
+				console.log(res)
+				// this.
+				if (res[0]) {
+					this.wea = res[0].wea
+					this.rain = res[0].wea.indexOf("雨") == -1 ? "否" : "是"
+				} else {
+					this.wea = "暂无"
+					this.rain = "暂无"
+				}
+			},
+			async getworm() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.xycb_pest_chart',
+					data: {
+						d_id: this.equipInfo.d_id,
+						start_time: Math.floor(+new Date() / 1000 - 30 * 24 * 60 * 60),
+						end_time: Math.floor(+new Date() / 1000),
+						device_type_id: "8",
+					}
+				})
+				console.log(res)
+				if (res.pest_data.length) {
+					this.wormnum = res.pest_data[0].pest_num
+				} else {
+					this.wormnum = "暂无"
+				}
+			},
+			setdecoy() {
+				this.decoy = this.equipInfo.decoy
+				this.decoytime = this.equipInfo.xy_expire
+				this.yxShow = true
+			},
+			settime() {
+				console.log(12)
+				this.tiemshow = true
+			},
+			tiemchange(e) {
+				console.log(e)
+				this.decoytime = e.result
+			},
+			async yxSubmit() {
+				var time = Math.floor(+new Date(this.decoytime) / 1000)
+				console.log(time)
+				if (this.decoy == "") {
+					this.tishitext = "请填写诱芯名称"
+					return
+				} else if (isNaN(time)) {
+					this.tishitext = "请填写诱芯到期时间"
+					return
+				}
+				this.tishitext = ""
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.set_decopy',
+					data: {
+						decoy: this.decoy,
+						device_id: this.equipInfo.imei,
+						device_type_id: "8",
+						expire_time: time,
+					}
+				})
+				console.log(res)
+				if (res.status) {
+					uni.showToast({
+						title: "设置成功",
+						icon: "none"
+					})
+					this.yxShow = false
+					this.getbaseinfo()
+				}
+			}
+		},
+		onLoad(option) {
+			var times = new Date()
+			this.date = times.getFullYear() + 1 + "-" + Number(times.getMonth() + 1) + "-" + times.getDate()
+			this.baseimei = option.imei
+			// console.log(this.equipInfo)
+			this.getbaseinfo()
+		},
+	}
+</script>
+
+<style lang='less'>
+	page {
+		padding: 20rpx;
+		box-sizing: border-box;
+
+		.info {
+			padding: 20rpx 40rpx;
+			color: #fff;
+			line-height: 50rpx;
+			font-size: 26rpx;
+			background-size: 100% auto;
+			background-repeat: no-repeat;
+			background-color: #0DC6B6;
+			background-position: top left;
+			box-sizing: border-box;
+			width: 100%;
+
+			.tishi {
+				width: 28rpx;
+				height: 28rpx;
+				margin: 0rpx 0 0 20rpx;
+			}
+		}
+
+		.on {
+			background-image: url('http://www.hnyfwlw.com:8006/bigdata_app/image/cb/onBg.png')
+		}
+
+		.off {
+			background-image: url('http://www.hnyfwlw.com:8006/bigdata_app/image/cb/offBg.png')
+		}
+
+		.caobox {
+			display: flex;
+			flex-wrap: wrap;
+			text-align: center;
+			font-size: 28rpx;
+			color: #666;
+			line-height: 50rpx;
+
+			image {
+				width: 52rpx;
+			}
+
+			.caobox_item {
+				padding: 20rpx 0;
+				box-sizing: border-box;
+				flex-basis: 25%;
+			}
+		}
+
+		.realtime {
+			width: 95%;
+			margin: 0rpx auto;
+
+			.realtime_title {
+				font-size: 32rpx;
+				display: flex;
+				justify-content: space-between;
+				font-weight: 700;
+
+				.span {
+					color: #6e6c76;
+					font-size: 24rpx;
+					display: flex;
+					justify-content: space-between;
+					margin-top: 12rpx;
+				}
+			}
+
+			.realtime_text {
+				margin-top: 20rpx;
+				display: flex;
+				justify-content: space-between;
+				flex-wrap: wrap;
+
+				.realtime_item {
+					width: 48%;
+					height: 100rpx;
+					display: flex;
+					box-shadow: 0 0 10rpx #bcb9ca;
+					margin-top: 20rpx;
+					padding: 20rpx 0;
+
+					image {
+						width: 60rpx;
+						height: 60rpx;
+						margin: 20rpx 20rpx 20rpx 40rpx;
+					}
+
+					.text {
+						padding: 10rpx 0 10rpx 30rpx;
+					}
+				}
+			}
+		}
+	}
+
+	.btn-box {
+		text-align: center;
+		padding: 20rpx 30rpx;
+	}
+
+	/deep/.u-calendar__action {
+		display: flex;
+		justify-content: space-around;
+
+		.u-calendar__action__text {
+			line-height: 25px;
+		}
+	}
+</style>

+ 544 - 0
pages/cb/thxydetail/thxyhisdata.vue

@@ -0,0 +1,544 @@
+<template>
+	<view>
+		<view class="timeandtype">
+			<view class="timebox">
+				<view class="firsttime" @click="timeshow=true">
+					<view class="" v-if="start_time!=''">
+						{{start_time/1000|timeFormat()}}
+					</view>
+					<view class="" v-else>
+						{{start_time==""?'请选择开始时间':start_time}}
+					</view>
+				</view>
+				<view class="jiange">
+					-
+				</view>
+				<view class="endtime" @click="timeshow=true">
+					<view class="" v-if="end_time!=''">
+						{{end_time/1000|timeFormat()}}
+					</view>
+					<view class="" v-else>
+						{{end_time==""?'请选择结束时间':end_time}}
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="shuju_one">
+			<view class="canvastishi" v-if="!canvastishiTF && !dataloadingtf">
+				暂无数据
+			</view>
+			<view class="canvastishi" v-if="dataloadingtf">
+				<p class="dataloading">加载中</p>
+			</view>
+			<canvas v-if="canvastishiTF" v-show="!timeshow" canvas-id="canvasColumnA" id="canvasColumnA" class="charts" @touchstart="touchLineA($event)"
+			 @touchmove="moveLineA($event)" @touchend="touchEndLineA($event)" disable-scroll=true :style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>
+		</view>
+		<view class="shuju_one">
+			<view class="canvastishi" v-if="!canvastishiTF2 && !dataloadingtf2">
+				暂无数据
+			</view>
+			<view class="canvastishi" v-if="dataloadingtf2">
+				<p class="dataloading">加载中</p>
+			</view>
+			<canvas v-if="canvastishiTF2" v-show="!timeshow" canvas-id="canvasColumnB" id="canvasColumnB" class="charts" @touchstart="touchLineB($event)"
+			 @touchmove="moveLineB($event)" @touchend="touchEndLineB($event)" disable-scroll=true :style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>
+		</view>
+		<view class="condition">
+			<scroll-view scroll-top="0" scroll-x="true" class="scroll-X">
+				<table class="table" v-if="$QueryPermission(267)">
+					<tr class="tr">
+						<th class="th" v-for="(item,index) in thdata" :key="'a'+index">{{item}}</th>
+					</tr>
+					<tr class="tr" v-for="(items,indexs) in historylistdata" :key="'b'+indexs" v-if="!forbidden">
+						<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
+						<td class="td">{{Circulation.ds.value[items.d_h_t.ds]}}</td>
+						<td class="td">{{Circulation.ws.value[items.d_h_t.ws]}}</td>
+						<td class="td">{{items.d_h_t.at}}</td>
+						<td class="td">{{items.d_h_t.ah}}</td>
+						<td class="td">{{items.d_h_t.cc}}</td>
+						<td class="td">{{items.d_h_t.cv}}</td>
+						<td class="td">{{items.d_h_t.bv}}</td>
+						<td class="td">{{Circulation.bs.value[items.d_h_t.bs]}}</td>
+						<td class="td">{{items.d_h_t.volt_ct}}</td>
+						<td class="td">{{items.d_h_t.csq}}</td>
+					</tr>
+					<tr class="tr" v-if="forbidden">
+						<td class="td" v-for="item in 11">暂无数据</td>
+					</tr>
+				</table>
+				<table class="table" v-else>
+					<tr class="tr">
+						<th class="th" v-for="(item,index) in thdata2" :key="'a'+index">{{item}}</th>
+					</tr>
+					<tr class="tr" v-for="(items,indexs) in historylistdata" :key="'b'+indexs" v-if="!forbidden">
+						<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
+						<td class="td">{{Circulation.ds.value[items.d_h_t.ds]}}</td>
+						<td class="td">{{Circulation.ws.value[items.d_h_t.ws]}}</td>
+						<td class="td">{{items.d_h_t.at}}</td>
+						<td class="td">{{items.d_h_t.ah}}</td>
+						<td class="td">{{Circulation.bs.value[items.d_h_t.bs]}}</td>
+						<td class="td">{{items.d_h_t.volt_ct}}</td>
+					</tr>
+					<tr class="tr" v-if="forbidden">
+						<td class="td" v-for="item in 7">暂无数据</td>
+					</tr>
+				</table>
+			</scroll-view>
+			<view class="pagenumber">
+				<button @click="prev">上一页</button>
+				<view class="pagenumber_page">
+					第 {{page}} 页
+				</view>
+				<view class="pagenumber_page">
+					共 {{pagesum}} 页
+				</view>
+				<button @click="next" :disabled="forbidden">下一页</button>
+			</view>
+		</view>
+		<u-calendar v-model="timeshow" :mode="mode" @change="timechange"></u-calendar>
+	</view>
+</template>
+
+<script>
+	import uCharts from '../../../components/js_sdk/u-charts/u-charts/u-charts.js';
+	import Circulation from "../../../static/js/equipState_dict.json"
+	var canvaColumnA = null;
+	var canvaColumnB = null
+	export default {
+		data() {
+			return {
+				start_time:"",
+				end_time:"",
+				timeshow:false,
+				mode: 'range',
+				cWidth: '400',
+				cHeight: '400',
+				pixelRatio: 1,
+				canvastishiTF:false,
+				dataloadingtf:false,
+				canvastishiTF2:false,
+				dataloadingtf2:false,
+				equipInfo:{},
+				historylistdata: [],
+				thdata: [
+					"上报时间","设备开关","工作状态","环境温度(℃)","环境湿度(%)","电流(mA)","充电电压(V)","电池电压(V)","电池状态","诱虫次数","信号强度",
+				],
+				thdata2: [
+					"上报时间","设备开关","工作状态","环境温度(℃)","环境湿度(%)","电池状态","诱虫次数",
+				],
+				page:1,
+				pagesum:"10",
+				Circulation:Circulation,
+				forbidden:false
+			}
+		},
+		methods: {
+			timechange(e){
+				this.start_time = +new Date(e.startDate)
+				this.end_time = +new Date(e.endDate)
+				this.history()
+				this.getworm()
+				this.getwind()
+			},
+			async history() { //历史数据列表折线图
+				this.dataloadingtf = true
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.xy_three_at_ah',
+					data: {
+						device_type_id: 8,
+						d_id: this.equipInfo.d_id,
+						start_time: Math.floor(+new Date(this.start_time) / 1000),
+						end_time: Math.floor(+new Date(this.end_time) / 1000),
+					}
+				})
+				console.log(res)
+				this.dataloadingtf = false
+				this.historydatas = res
+				console.log(this.historydatas)
+				if (this.historydatas.length == 0) {
+					this.canvastishiTF = false
+				} else {
+					this.canvastishiTF = true
+			
+					var arr1 = []
+					var arr2 = []
+					var arr3 = []
+					var xtitle = []
+					for (var i = 0; i < res.length; i++) {
+						var times = new Date(res[i].addtime * 1000)
+						xtitle.push(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
+						arr1.push(res[i].at == "" ? "0" : res[i].at)
+						arr2.push(res[i].ah == "" ? "0" : res[i].ah)
+					}
+					// console.log(arr1)
+					var obj = [{
+						name: '温度',
+						data: arr1,
+						color: '#00E29D'
+					}, {
+						name: '湿度',
+						data: arr2,
+						color: '#6CBBFF'
+					}]
+					this.showColumn("canvasColumnA", xtitle, obj)
+				}
+			},
+			async getworm() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.xycb_pest_chart',
+					data: {
+						d_id: this.equipInfo.d_id,
+						start_time: Math.floor(+new Date(this.start_time) / 1000),
+						end_time: Math.floor(+new Date(this.end_time) / 1000),
+						device_type_id: "8",
+					}
+				})
+				console.log(res)
+				this.dataloadingtf2 = false
+				var data = res.pest_data
+				if (data.length == 0) {
+					this.canvastishiTF2 = false
+				} else {
+					this.canvastishiTF2 = true
+			
+					var arr1 = []
+					var xtitle = []
+					for (var i = 0; i < data.length; i++) {
+						var times = new Date(data[i].addtime * 1000)
+						xtitle.push(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
+						arr1.push(data[i].pest_num == "" ? "0" : data[i].pest_num)
+					}
+					// console.log(arr1)
+					var obj = [{
+						name: '诱虫次数',
+						data: arr1,
+						color: '#00E29D'
+					}]
+					this.showColumn2("canvasColumnB", xtitle, obj)
+				}
+			},
+			async getwind() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.xy_three_history_data',
+					data: {
+						d_id: this.equipInfo.d_id,
+						start_time: Math.floor(+new Date(this.start_time) / 1000),
+						end_time: Math.floor(+new Date(this.end_time) / 1000),
+						device_id: this.equipInfo.imei,
+						page: this.page,
+					}
+				})
+				console.log(res)
+				if(res.data.length){
+					this.historylistdata = res.data
+					this.pagesum = Math.ceil(res.counts/10)
+					this.forbidden = false
+				}else{
+					this.forbidden = true
+				}
+			},
+			prev() { //上一页
+				if (this.page > 1) {
+					this.page--
+					this.getwind()
+				}
+			},
+			next() { //下一页
+				if(this.page < this.pagesum){
+					this.page++
+					this.getwind()
+				}
+			},
+			showColumn(id, xtitle, xinfo) {
+				var _self = this
+				canvaColumnA = new uCharts({
+					canvasId: id,
+					type: 'line',
+					legend: {
+						position: "top"
+					},
+					fontSize: 11,
+					background: '#FFFFFF',
+					pixelRatio: 1,
+					animation: true,
+					dataLabel: false,
+					categories: xtitle,
+					series: xinfo,
+					enableScroll: true, //开启图表拖拽功能
+					xAxis: {
+						disableGrid: true,
+						type: 'grid',
+						gridType: 'dash',
+						itemCount: 4, //x轴单屏显示数据的数量,默认为5个
+						scrollShow: true, //新增是否显示滚动条,默认false
+						// scrollAlign: 'left', //滚动条初始位置
+						scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF
+						scrollColor: '#DEE7F7', //默认为 #A6A6A6
+					},
+					yAxis: {},
+					width: _self.cWidth * 1,
+					height: _self.cHeight * 1,
+					extra: {
+						line: {
+							type: 'curve'
+						}
+					}
+				});
+			},
+			showColumn2(id, xtitle, xinfo) {
+				var _self = this
+				canvaColumnB = new uCharts({
+					canvasId: id,
+					type: 'line',
+					legend: {
+						position: "top"
+					},
+					fontSize: 11,
+					background: '#FFFFFF',
+					pixelRatio: 1,
+					animation: true,
+					dataLabel: false,
+					categories: xtitle,
+					series: xinfo,
+					enableScroll: true, //开启图表拖拽功能
+					xAxis: {
+						disableGrid: true,
+						type: 'grid',
+						gridType: 'dash',
+						itemCount: 4, //x轴单屏显示数据的数量,默认为5个
+						scrollShow: true, //新增是否显示滚动条,默认false
+						// scrollAlign: 'left', //滚动条初始位置
+						scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF
+						scrollColor: '#DEE7F7', //默认为 #A6A6A6
+					},
+					yAxis: {},
+					width: _self.cWidth * 1,
+					height: _self.cHeight * 1,
+					extra: {
+						line: {
+							type: 'curve'
+						}
+					}
+				});
+			},
+			touchLineA(e) {
+				console.log(e)
+				canvaColumnA.scrollStart(e);
+			},
+			moveLineA(e) {
+				canvaColumnA.scroll(e);
+			},
+			touchEndLineA(e) {
+				canvaColumnA.scrollEnd(e);
+				//下面是toolTip事件,如果滚动后不需要显示,可不填写
+				canvaColumnA.showToolTip(e, {
+					format: function(item, category) {
+						return category + ' ' + item.name + ':' + item.data
+					}
+				});
+			},
+			touchLineB(e) {
+				console.log(e)
+				canvaColumnB.scrollStart(e);
+			},
+			moveLineB(e) {
+				canvaColumnB.scroll(e);
+			},
+			touchEndLineB(e) {
+				canvaColumnB.scrollEnd(e);
+				//下面是toolTip事件,如果滚动后不需要显示,可不填写
+				canvaColumnB.showToolTip(e, {
+					format: function(item, category) {
+						return category + ' ' + item.name + ':' + item.data
+					}
+				});
+			},
+		},
+		onLoad(option) {
+			this.equipInfo = option
+			console.log(option)
+			this.end_time = +new Date()
+			this.start_time = +new Date()-30*24*60*60*1000
+			this.cWidth = uni.upx2px(650);
+			this.cHeight = uni.upx2px(500);
+			this.history()
+			this.getworm()
+			this.getwind()
+		}
+	}
+</script>
+
+<style lang="less">
+	.timeandtype {
+		// background-color: #F6F6FB;
+		// padding: 20rpx;
+		box-sizing: border-box;
+		width: 90%;
+		margin: 40rpx auto 0;
+		.timebox {
+			box-shadow: 0 0 10rpx #bcb9ca;
+			display: flex;
+			background-color: #fff;
+			padding: 10px;
+			border-top-right-radius: 5px;
+			border-top-left-radius: 5px;
+	
+			.jiange {
+				width: 5%;
+				text-align: center;
+			}
+	
+			.firsttime,
+			.endtime {
+				width: 45%;
+				text-align: center;
+			}
+		}
+	
+		.warntypebox {
+			display: flex;
+			justify-content: space-between;
+			background-color: #fff;
+			padding: 10px;
+			border-top: 1px solid #F6F6FB;
+			border-bottom-right-radius: 5px;
+			border-bottom-left-radius: 5px;
+		}
+	}
+	.shuju_one {
+		position: relative;
+		width: 90%;
+		margin: 30rpx auto;
+		box-shadow: 0 0 10rpx #bcb9ca;
+		padding-top: 20rpx;
+		height: 550rpx;
+	
+		.canvastishi {
+			font-size: 32rpx;
+			position: absolute;
+			top: 50%;
+			left: 50%;
+			margin-left: -64rpx;
+			margin-top: -21rpx;
+			.dataloading:after {
+				overflow: hidden;
+				display: inline-block;
+				vertical-align: bottom;
+				animation: ellipsis 2s infinite;
+				content: "\2026";
+			}
+			
+			@keyframes ellipsis {
+				from {
+					width: 2px;
+				}
+			
+				to {
+					width: 15px;
+				}
+			}
+		}
+	
+		.shuju_one_title {
+			width: 70%;
+			margin: 0 auto;
+			display: flex;
+	
+			.tltle_text {
+				width: 25%;
+				border: 2rpx solid #B2B2B2;
+				color: #57c878;
+				text-align: center;
+				font-size: 24rpx;
+				height: 50rpx;
+				line-height: 50rpx;
+			}
+	
+			.title_text_color {
+				width: 25%;
+				border: 2rpx solid #57c878;
+				background-color: #57c878;
+				color: #fff;
+				text-align: center;
+				font-size: 24rpx;
+				height: 50rpx;
+				line-height: 50rpx;
+			}
+		}
+	}
+	/deep/.u-calendar__action {
+		display: flex;
+		justify-content: space-around;
+	
+		.u-calendar__action__text {
+			line-height: 25px;
+		}
+	}
+	.condition {
+		display: flex;
+		flex-wrap: wrap;
+		width: 90%;
+		margin: 30rpx auto;
+		box-shadow: 0 0 10rpx #bcb9ca;
+		margin-bottom: 30rpx;
+	
+		.scroll-X {
+			width: 95%;
+			margin: 20rpx auto;
+			.table{
+				width: 1416px;
+			}
+			.tr {
+				display: flex;
+				overflow: hidden;
+	
+				.th,
+				.td {
+					display: inline-block;
+					padding: 5rpx;
+					width: 240rpx;
+					text-align: center;
+					height: 52rpx;
+					line-height: 52rpx;
+					border: 2rpx solid #F1F1F1;
+				}
+	
+				.th:first-child,
+				.td:first-child {
+					width: 300rpx;
+				}
+			}
+			.tr:nth-child(2n-1){
+				background-color: #f5fff8;
+			}
+			.tr:first-child{
+				background-color: #57c878;
+				color: #fff;
+			}
+		}
+	
+		.pagenumber {
+			display: flex;
+			margin: 20rpx auto;
+			
+			button {
+				width: 150rpx;
+				height: 50rpx;
+				line-height: 50rpx;
+				font-size: 26rpx;
+				text-align: center;
+				background-color: #57c878;
+				color: #FFFFFF;
+			}
+			
+			.pagenumber_page {
+				// width: 100rpx;
+				height: 50rpx;
+				line-height: 50rpx;
+				font-size: 26rpx;
+				text-align: center;
+				margin: 0 20rpx;
+			}
+		}
+	}
+</style>

+ 352 - 0
pages/cb/thxydetail/thxyset.vue

@@ -0,0 +1,352 @@
+<template>
+	<view>
+		<view class="buttonbox" v-if="myuser_type">
+			<button type="warn" @click="equipBtnControl('reboot')" size="mini">重启</button>
+			<button type="warn" @click="equipBtnControl('update')" size="mini">升级</button>
+			<button type="warn" @click="equipBtnControl('clearworm')" size="mini">清网</button>
+			<button type="warn" @click="equipBtnControl('mqttconf')" size="mini">查询服务器配置</button>
+		</view>
+		<view class="setitem">
+			设备编号:{{option.device_id}}
+		</view>
+		<view class="setitem">
+			设备名称:{{option.device_name}}
+		</view>
+		<view class="setitem">
+			设备版本:{{option.dtype}}
+		</view>
+		<view class="setitem">
+			设备开关:
+			<view class="uni-list-cell" style="margin-top: 30rpx;">
+				<picker @change="turnChange($event,'ds')" value="equipContrlForm.ds" :range="dsArr">
+					<text class="uni-input">{{dsArr[equipContrlForm.ds]}}</text>
+					<view class="arrow"></view>
+				</picker>
+			</view>
+		</view>
+		<view class="setitem">
+			时控时长:
+			<view class="selectTime">
+				<view class="uni-list-cell time" @click="selectTime('st')">
+					<text>{{stLabel}}</text>
+					<u-icon name="clock"></u-icon>
+				</view>
+				<text class="line">-</text>
+				<view class="uni-list-cell time" @click="selectTime('et')">
+					<text>{{etLabel}}</text>
+					<u-icon name="clock"></u-icon>
+				</view>
+			</view>
+			<u-select v-model="stShow" mode="single-column" :list="list" @confirm="stConfirm"></u-select>
+			<u-select v-model="etShow" mode="single-column" :list="list" @confirm="etConfirm"></u-select>
+		</view>
+		<view class="setitem">
+			数据频率(min):
+			<slider :value="equipContrlForm.dat_f" show-value="true" :min="10" :max="60"
+				@change="sliderChange($event,'dat_f')" block-color="#57C878" activeColor="#57C878" step="1" />
+		</view>
+		<view class="setitem">
+			自清虫定时(min):
+			<slider :value="equipContrlForm.clt_t" show-value="true" :min="10" :max="60"
+				@change="sliderChange($event,'clt_t')" block-color="#57C878" activeColor="#57C878" step="1" />
+		</view>
+		<view class="submit-box">
+			<u-button @click="submit" type="success">确定</u-button>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				myuser_type:false,
+				option: {},
+				dsArr: ['关机', '开机'],
+				equipContrlForm: {
+					ds: 0,
+					dat_f: 0,
+					clt_t: 0,
+					st: "",
+					et: "",
+					timctrl: ""
+				},
+				stLabel: "",
+				etLabel: "",
+				stShow: false,
+				etShow: false,
+				list: [{
+						value: 0,
+						label: '00:00'
+					},
+					{
+						value: 1,
+						label: '01:00'
+					},
+					{
+						value: 2,
+						label: '02:00'
+					},
+					{
+						value: 3,
+						label: '03:00'
+					},
+					{
+						value: 4,
+						label: '04:00'
+					},
+					{
+						value: 5,
+						label: '05:00'
+					},
+					{
+						value: 6,
+						label: '06:00'
+					},
+					{
+						value: 7,
+						label: '04:00'
+					}, {
+						value: 8,
+						label: '08:00'
+					},
+					{
+						value: 9,
+						label: '09:00'
+					},
+					{
+						value: 10,
+						label: '10:00'
+					},
+					{
+						value: 11,
+						label: '11:00'
+					},
+					{
+						value: 12,
+						label: '12:00'
+					},
+					{
+						value: 13,
+						label: '13:00'
+					},
+					{
+						value: 14,
+						label: '14:00'
+					}, {
+						value: 15,
+						label: '15:00'
+					},
+					{
+						value: 16,
+						label: '16:00'
+					},
+					{
+						value: 17,
+						label: '17:00'
+					},
+					{
+						value: 18,
+						label: '18:00'
+					},
+					{
+						value: 19,
+						label: '19:00'
+					},
+					{
+						value: 20,
+						label: '20:00'
+					},
+					{
+						value: 21,
+						label: '21:00'
+					}, {
+						value: 22,
+						label: '22:00'
+					},
+					{
+						value: 23,
+						label: '23:00'
+					},
+				],
+			}
+		},
+		methods: {
+			turnChange(e) {
+				this.equipContrlForm.ds = e.target.value
+			},
+			selectTime(a) {
+				if (a == 'st') {
+					this.stShow = true;
+				} else {
+					this.etShow = true;
+				}
+			},
+			stConfirm(e) {
+				this.stLabel = e[0].label
+				this.equipContrlForm.st = e[0].value
+			},
+			etConfirm(e) {
+				this.etLabel = e[0].label
+				this.equipContrlForm.et = e[0].value
+			},
+			async getconf() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.device_control_info',
+					data: {
+						cmd: "paramconf",
+						d_id: this.option.d_id
+					}
+				})
+				console.log(res)
+				this.equipContrlForm.et = res.work_tim.et
+				this.equipContrlForm.st = res.work_tim.st
+				this.equipContrlForm.timctrl = res.work_tim.timctrl
+				this.etLabel = this.list[res.work_tim.et].label
+				this.stLabel = this.list[res.work_tim.st].label
+				this.equipContrlForm.dat_f = res.data_tim.dat_f
+				this.equipContrlForm.clt_t = res.clt_tim.clt_t
+				this.equipContrlForm.ds = res.power.ds
+
+			},
+			sliderChange(e, a) {
+				console.log(e)
+				if (a == "dat_f") {
+					this.equipContrlForm.dat_f = e.detail.value
+				} else {
+					this.equipContrlForm.clt_t = e.detail.value
+				}
+			},
+			async submit() {
+				var obj = {
+					work_tim: {
+						timctrl: this.equipContrlForm.timctrl,
+						st: this.equipContrlForm.st,
+						et: this.equipContrlForm.et
+					},
+					data_tim: {
+						dat_f: this.equipContrlForm.dat_f
+					},
+					power: {
+						ds: this.equipContrlForm.ds
+					},
+					clt_tim: {
+						clt_t: this.equipContrlForm.clt_t
+					},
+				}
+				console.log(obj)
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.device_control',
+					data: {
+						device_type_id: 8,
+						d_id: this.option.d_id,
+						config: JSON.stringify(obj),
+					}
+				})
+				console.log(res)
+				if (res == true) {
+					uni.showToast({
+						title: '指令下发成功!',
+						duration: 2000
+					});
+				} else {
+					uni.showToast({
+						title: '指令下发失败!',
+						duration: 2000,
+						icon: "none"
+					});
+				}
+			},
+			async equipBtnControl(cmd) {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.admin_device_control',
+					data: {
+						cmd,
+						device_type_id: 8,
+						d_id: this.option.d_id,
+					}
+				})
+				console.log(res)
+				if (res == true) {
+					uni.showToast({
+						title: '指令下发成功!',
+						duration: 2000
+					});
+				} else {
+					uni.showToast({
+						title: '指令下发失败!',
+						duration: 2000,
+						icon: "none"
+					});
+				}
+			}
+		},
+		onLoad(option) {
+			uni.getStorage({
+				key:"myuser_type",
+				success:(res)=>{
+					console.log(res.data)
+					if(Number(res.data) == 1){
+						this.myuser_type = true
+					}
+				}
+			})
+			this.option = option
+			this.getconf()
+			
+		}
+	}
+</script>
+
+<style lang='less'>
+	page {
+		padding: 20rpx;
+		box-sizing: border-box;
+
+		.buttonbox {
+			display: flex;
+			justify-content: space-between;
+		}
+
+		.setitem {
+			margin-top: 30rpx;
+
+			.selectTime {
+				margin-top: 30rpx;
+				display: flex;
+
+				.time {
+					width: 350rpx;
+					display: flex;
+					justify-content: space-between;
+				}
+
+				.line {
+					width: 50rpx;
+					text-align: center;
+				}
+			}
+		}
+
+		.uni-list-cell {
+			background: #F7F8FA;
+			padding: 10rpx 40rpx;
+			font-size: 28rpx;
+			box-sizing: border-box;
+
+			/* margin-top: 30rpx; */
+			.arrow {
+				display: inline-block;
+				border-width: 12rpx 8rpx;
+				border-style: solid;
+				float: right;
+				margin-top: 10rpx;
+				border-color: #888 transparent transparent transparent;
+			}
+		}
+
+		.submit-box {
+			margin-top: 60rpx
+		}
+	}
+</style>

+ 835 - 0
pages/cb/xctdetail/analyse.vue

@@ -0,0 +1,835 @@
+<template>
+	<view class="anabox">
+		<view class="timebox">
+			<view class="schedulebox">
+				<view class="schedule" @click="pickertfone=!pickertfone">
+					<p class="schedule_value">{{yservalue}}</p>
+					<!-- {{titletext[indexone]}} -->
+					<p class="schedule_icon">
+						<u-icon name="arrow-down"></u-icon>
+					</p>
+				</view>
+				<u-picker v-model="pickertfone" mode="selector" @confirm="confirmFun" :default-selector="[yserindex]"
+					:range="yearlist"></u-picker>
+				<view class="schedule" @click="pickertfworm=!pickertfworm">
+					<p class="schedule_value">{{wormvalue}}</p>
+					<!-- {{titletext[indexone]}} -->
+					<p class="schedule_icon">
+						<u-icon name="arrow-down"></u-icon>
+					</p>
+				</view>
+				<u-picker v-model="pickertfworm" mode="selector" @confirm="confirmFun2" :default-selector="[wormindex]"
+					:range="wormlist"></u-picker>
+			</view>
+			<view class="wormtime">
+				<view class="wormtime_item">
+					<image src="../../../../static/images/cb/shijianqi.png" mode="" class="img"></image>
+					<p>始见期</p>
+					<p>{{timeobj.startTime}}</p>
+				</view>
+				<view class="wormtime_item">
+					<image src="../../../../static/images/cb/gaofengqi.png" mode="" class="img"></image>
+					<p>高峰期</p>
+					<p>{{timeobj.highTime}}</p>
+					<p>数量:{{timeobj.highNum}}头</p>
+				</view>
+				<view class="wormtime_item">
+					<image src="../../../../static/images/cb/zhongjianqi.png" mode="" class="img"></image>
+					<p>终见期</p>
+					<p>{{timeobj.endTime}}</p>
+				</view>
+			</view>
+			<view class="selecttimes" @click="tiemshow=!tiemshow">
+				<view class="" style="line-height: 28px;">
+					时间选择器
+				</view>
+				<view class="timesbox">
+					<!-- <image
+						:src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/prevention/1acfe2751c01d3786cdc49b83d7e505.png'"
+						mode=""></image> -->
+					<p>{{timetab(oldtime)}}</p>
+					<p class="or">至</p>
+					<p>{{timetab(newtime)}}</p>
+					<!-- <u-icon name="rili" custom-prefix="custom-icon" class="icon"></u-icon> -->
+				</view>
+				<u-calendar v-model="tiemshow" mode="range" @change="tiemchange"></u-calendar>
+			</view>
+			<view class="tendency">
+				<canvas canvas-id="canvasColumnA" id="canvasColumnA" class="charts" @touchstart="touchLineA($event)" v-show="chartstf"
+					@touchmove="moveLineA($event)" @touchend="touchEndLineA($event)" disable-scroll=true
+					:style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>
+			</view>
+			<view class="tendency">
+				<canvas canvas-id="canvasRing" id="canvasRing" class="charts" @touchstart="touchRing" v-show="chartstf"
+					:style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>
+			</view>
+			<view class="tendency_pro">
+				<view class="" v-for="(item,index) in progresslist">
+					<span>{{index+1}}、{{item.name}}</span>
+					<u-line-progress :active-color="colorlist[index%6]"
+						:percent="Number((item.data/pestsum*100).toFixed(2))" :show-percent="false"></u-line-progress>
+					<span>{{Number((item.data/pestsum*100).toFixed(2))}}%</span>
+				</view>
+			</view>
+			<view class="tablebox">
+				<view class="top_text">
+					<view :class="topindex==index?'title_text_color':'tltle_text'" v-for="(item,index) in toptext"
+						:key="index" @click="changeindex(index)">
+						<span class="title_item">
+							{{item}}
+						</span>
+					</view>
+				</view>
+				<scroll-view scroll-top="0" scroll-x="true" class="scroll-X">
+					<table class="table" v-if="topindex==0">
+						<tr class="tr">
+							<th class="th" v-for="(item,index) in thdata" :key="'a'+index">{{item}}</th>
+						</tr>
+						<tr class="tr" v-for="(items,indexs) in eqlistdata" :key="indexs">
+							<td class="td">{{items.deviceId}}</td>
+							<td class="td">{{items.deviceName}}</td>
+							<td class="td" @click="wormdetails(items.pest_dict)">{{items.pestName}}</td>
+							<td class="td">{{items.addtime|timeFormat()}}</td>
+							<td class="td">{{items.location}}</td>
+							<td class="td" @click="examine(items.indentify_photo)">查看</td>
+						</tr>
+						<tr class="tr" v-if="forbidden1">
+							<td class="td" v-for="item in 6">暂无数据</td>
+						</tr>
+					</table>
+					<table class="table2" v-else>
+						<tr class="tr">
+							<th class="th" v-for="(item,index) in thdata2" :key="'a'+index">{{item}}</th>
+						</tr>
+						<tr class="tr" v-for="(items,indexs) in eqlistdata" :key="indexs">
+							<td class="td">{{items.pest_name}}</td>
+							<td class="td">{{items.pest_num}}</td>
+							<td class="td">{{items.addtime|timeFormat()}}</td>
+						</tr>
+						<tr class="tr" v-if="forbidden2">
+							<td class="td" v-for="item in 6">暂无数据</td>
+						</tr>
+					</table>
+				</scroll-view>
+				<view class="pagenumber">
+					<button @click="prev" :disabled=" page == 1 ">上一页</button>
+					<view class="pagenumber_page">
+						第{{page}}页
+					</view>
+					<view class="pagenumber_page">
+						共 {{pagesum}} 页
+					</view>
+					<button @click="next" :disabled=" page == pagesum ">下一页</button>
+				</view>
+			</view>
+			<u-modal v-model="show" :mask-close-able="true" @confirm="modalconfirm" title="24小时数据">
+				<view class="modalbox">
+					<p v-for="(item,key) in pest_dict">{{key}}--{{pest_dict[key]}}头</p>
+				</view>
+			</u-modal>
+		</view>
+	</view>
+</template>
+
+<script>
+	import uCharts from '../../../components/js_sdk/u-charts/u-charts/u-charts.js';
+	var canvaColumnA = null;
+	var canvasRing = null;
+	export default {
+		data() {
+			return {
+				d_id: "",
+				oldtime: "",
+				newtime: "",
+				tiemshow: false,
+				cWidth: '350',
+				cHeight: '350',
+				pixelRatio: 1,
+				pickertfone: false,
+				yservalue: "",
+				yearlist: [],
+				yserindex: "",
+				pickertfworm: false,
+				wormvalue: "",
+				wormlist: [],
+				wormindex: "",
+				timeobj: {
+					endTime: "",
+					highNum: "",
+					highTime: "",
+					startTime: "",
+				},
+				progresslist: [],
+				reslist: {
+					char_data: {},
+					at_ah_info: []
+				},
+				pestsum: 0,
+				colorlist: ["rgb(24, 144, 255)", "rgb(47, 194, 91)", "rgb(250, 204, 20)", "rgb(240, 72, 100)",
+					"rgb(133, 67, 224)", "rgb(144, 237, 125)"
+				],
+				page: 1,
+				pagesum: 1,
+				eqlistdata: [],
+				thdata: [
+					"设备ID", "设备名称", "害虫名称", "上报时间", "设备位置", "图像"
+				],
+				thdata2: [
+					"害虫名称", "害虫数量", "上报时间"
+				],
+				topindex: 0,
+				toptext: ["图像溯源", "虫害基础数据"],
+				forbidden1: false,
+				forbidden2: false,
+				show: false,
+				pest_dict: {},
+				chartstf:true
+			}
+		},
+		watch:{
+			pickertfone:function(e){
+				console.log(e)
+				this.chartstf = !e
+			},
+			tiemshow:function(e){
+				this.chartstf = !e
+			},
+			pickertfworm:function(e){
+				this.chartstf = !e
+			},
+		},
+		methods: {
+			getyear() {
+				var Year = new Date().getFullYear();
+				var num = Year - 2019;
+				for (var i = 0; i < num + 1; i++) {
+					this.yearlist.push(2019 + i);
+				}
+				this.yservalue = this.yearlist[this.yearlist.length - 1];
+				this.yserindex = this.yearlist.length - 1
+				this.getwormtime()
+			},
+			async getwormtime() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.pest_raise_info',
+					data: {
+						d_ids: this.d_id,
+						identify_model: 'A',
+						year: this.yservalue,
+					}
+				})
+				console.log(res)
+				this.wormlist = res.pest_list
+				this.wormtimelist = res.pest_info
+				this.wormvalue = this.wormlist[0]
+				this.wormindex = 0
+				if (this.wormvalue) {
+					this.timeobj = this.wormtimelist[this.wormvalue]
+				}
+				console.log(this.timeobj)
+
+			},
+			confirmFun(e) {
+				console.log(e)
+				this.yserindex = e[0]
+				this.yservalue = this.yearlist[e[0]]
+				this.getwormtime()
+			},
+			confirmFun2(e) {
+				console.log(e)
+				this.wormindex = e[0]
+				this.wormvalue = this.wormlist[e[0]]
+				this.timeobj = this.wormtimelist[this.wormvalue]
+				this.setlineoption()
+			},
+			async getwormline() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.pest_statistics_char_new',
+					data: {
+						d_ids: this.d_id,
+						identify_model: 'A',
+						start_time: this.oldtime,
+						end_time: this.newtime
+					}
+				})
+				// console.log(res)
+				this.reslist.char_data = res.char_data
+				this.reslist.at_ah_info = res.at_ah_info
+				var ringarr = []
+
+				if (this.checkObj(res.pest_total)) {
+					for (var key in res.pest_total) {
+						var nameobj = {
+							name: '',
+							data: "",
+						}
+						// console.log(key)
+						nameobj.name = key
+						nameobj.data = res.pest_total[key]
+						ringarr.push(nameobj)
+					}
+				}
+				this.setlineoption()
+				// this.showRing(ringarr)
+				var num = 0
+				for (var i = 0; i < ringarr.length - 5; i++) {
+					console.log(ringarr[i].name)
+					num += ringarr[i].data
+				}
+				this.pestsum = 0
+				for (var i = 0; i < ringarr.length; i++) {
+					this.pestsum += ringarr[i].data
+				}
+				var sumobj = {
+					name: "其他",
+					data: num,
+				}
+				var ringarr2 = ringarr.slice(ringarr.length - 5)
+				ringarr2.unshift(sumobj)
+				// console.log(ringarr2)
+				this.showRing(ringarr2)
+				console.log(ringarr)
+				this.progresslist = ringarr
+			},
+			setlineoption() {
+				var res = this.reslist
+				var xtitle = []
+				var obj = []
+				if (res.at_ah_info.length != 0) {
+					var aharr = []
+					var atarr = []
+					for (var i = 0; i < res.at_ah_info.length; i++) {
+						var times = new Date(res.at_ah_info[i].addtime * 1000)
+						xtitle.push(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" +
+							times.getSeconds())
+						atarr.push(res.at_ah_info[i].at == "" ? "0" : res.at_ah_info[i].at)
+						aharr.push(res.at_ah_info[i].ah == "" ? "0" : res.at_ah_info[i].ah)
+					}
+					var atobj = {
+						name: '温度',
+						data: atarr,
+						color: '#00E29D'
+					}
+					var ahobj = {
+						name: '湿度',
+						data: aharr,
+						color: '#6CBBFF'
+					}
+					obj.push(atobj)
+					obj.push(ahobj)
+				}
+				// console.log(this.wormvalue)
+				if (this.checkObj(res.char_data)) {
+					for (var key in res.char_data) {
+						if (this.wormvalue == key) {
+							var wormobj = {
+								name: key,
+								data: [],
+							}
+							for (var i = 0; i < res.char_data[key].length; i++) {
+								wormobj.data.push(res.char_data[key][i].ah == "" ? "0" : res.char_data[key][i].sum)
+							}
+							obj.push(wormobj)
+						}
+					}
+
+				}
+				this.showColumn("canvasColumnA", xtitle, obj)
+			},
+			checkObj(obj) {
+				for (let i in obj) {
+					return true;
+				}
+				return false;
+			},
+			tiemchange(e) {
+				console.log(e)
+				this.oldtime = +new Date(e.startDate) / 1000 - 8 * 60 * 60
+				this.newtime = +new Date(e.endDate) / 1000 + 16 * 60 * 60 - 1
+				// newtime: "",
+				console.log(this.oldtime, this.newtime)
+				this.page = 1
+				this.getwormline()
+				if (this.topindex == 0) {
+					this.gettabledata()
+				} else if (this.topindex == 1) {
+					this.gettabledata2()
+				}
+			},
+			timetab(e) {
+				e = new Date(e * 1000)
+				var year = e.getFullYear()
+				var month = e.getMonth() + 1 < 10 ? "0" + (e.getMonth() + 1) : e.getMonth() + 1
+				var day = e.getDate() < 10 ? "0" + e.getDate() : e.getDate()
+				var time = year + "/" + month + "/" + day
+				return time
+			},
+			showColumn(id, xtitle, xinfo) {
+				var _self = this
+				canvaColumnA = new uCharts({
+					canvasId: id,
+					type: 'line',
+					legend: {
+						position: "top"
+					},
+					fontSize: 11,
+					background: '#FFFFFF',
+					pixelRatio: 1,
+					animation: true,
+					dataLabel: false,
+					categories: xtitle,
+					series: xinfo,
+					enableScroll: true, //开启图表拖拽功能
+					xAxis: {
+						disableGrid: true,
+						type: 'grid',
+						gridType: 'dash',
+						itemCount: 5, //x轴单屏显示数据的数量,默认为5个
+						scrollShow: true, //新增是否显示滚动条,默认false
+						// scrollAlign: 'left', //滚动条初始位置
+						scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF
+						scrollColor: '#DEE7F7', //默认为 #A6A6A6
+					},
+					yAxis: {},
+					width: _self.cWidth * 1,
+					height: _self.cHeight * 1,
+					extra: {
+						line: {
+							type: 'curve'
+						}
+					}
+				});
+			},
+			touchLineA(e) {
+				console.log(e)
+				canvaColumnA.scrollStart(e);
+			},
+			moveLineA(e) {
+				canvaColumnA.scroll(e);
+			},
+			touchEndLineA(e) {
+				canvaColumnA.scrollEnd(e);
+				//下面是toolTip事件,如果滚动后不需要显示,可不填写
+				canvaColumnA.showToolTip(e, {
+					format: function(item, category) {
+						return category + ' ' + item.name + ':' + item.data
+					}
+				});
+			},
+			showRing(data) {
+				var _self = this
+				canvasRing = new uCharts({
+					canvasId: "canvasRing",
+					type: 'ring',
+					fontSize: 11,
+					legend: {
+						show: true,
+					},
+					extra: {
+						pie: {
+							offsetAngle: -45,
+							ringWidth: 40 * _self.pixelRatio,
+							labelWidth: 15
+						}
+					},
+					background: '#FFFFFF',
+					pixelRatio: _self.pixelRatio,
+					series: data,
+					animation: true,
+					width: _self.cWidth * _self.pixelRatio,
+					height: _self.cHeight * _self.pixelRatio,
+					disablePieStroke: true,
+					dataLabel: true,
+				});
+			},
+			touchRing(e) {
+				canvasRing.showToolTip(e, {
+					format: function(item) {
+						return item.name + ':' + item.data
+					}
+				});
+			},
+			tap(e) {
+				canvasgroup[e.target.id].touchLegend(e);
+				canvasgroup[e.target.id].showToolTip(e);
+			},
+			async gettabledata() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.pest_image_source',
+					data: {
+						d_ids: this.d_id,
+						identify_model: 'A',
+						start_time: this.oldtime,
+						end_time: this.newtime,
+						page: this.page
+					}
+				})
+				this.pagesum = Math.ceil(res.total_count / 10)
+				this.eqlistdata = res.pest_image_data
+				if (this.eqlistdata.length == 0) {
+					this.forbidden1 = true
+				} else {
+					this.forbidden1 = false
+				}
+				console.log(res)
+			},
+			async gettabledata2() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.pest_base_data',
+					data: {
+						d_ids: this.d_id,
+						identify_model: 'A',
+						start_time: this.oldtime,
+						end_time: this.newtime,
+						page: this.page
+					}
+				})
+				this.pagesum = Math.ceil(res.total_count / 10)
+				this.eqlistdata = res.pest_image_data
+				if (this.eqlistdata.length == 0) {
+					this.forbidden2 = true
+				} else {
+					this.forbidden2 = false
+				}
+				console.log(res)
+			},
+			changeindex(e) {
+				this.topindex = e
+				this.page = 1
+				if (e == 0) {
+					this.gettabledata()
+				} else if (e == 1) {
+					this.gettabledata2()
+				}
+			},
+			prev() {
+				this.page--
+				if (this.topindex == 0) {
+					this.gettabledata()
+				} else if (this.topindex == 1) {
+					this.gettabledata2()
+				}
+			},
+			next() {
+				this.page++
+				if (this.topindex == 0) {
+					this.gettabledata()
+				} else if (this.topindex == 1) {
+					this.gettabledata2()
+				}
+			},
+			wormdetails(data) {
+				console.log(data)
+				this.show = true
+				this.pest_dict = data
+			},
+			modalconfirm(){
+				this.pest_dict = {}
+			},
+			examine(url) {
+				var imgarr = [url]
+				uni.previewImage({
+					urls: imgarr,
+					current: 0
+				});
+			},
+		},
+		onLoad(option) {
+			this.d_id = option.d_id
+			var date = +new Date() / 1000
+			this.oldtime = Math.floor(date - 24 * 60 * 60)
+			this.newtime = Math.floor(date)
+			this.cWidth = uni.upx2px(650);
+			this.cHeight = uni.upx2px(500);
+			this.getyear()
+			this.$nextTick(() => {
+				this.getwormline()
+				if (this.topindex == 0) {
+					this.gettabledata()
+				} else if (this.topindex == 1) {
+					this.gettabledata2()
+				}
+			}, 500)
+		}
+	}
+</script>
+
+<style lang="scss">
+	.anabox {
+		background-color: #f1f4ff;
+		padding-top: 10px;
+	}
+
+	.selecttimes {
+		// box-shadow: 0 0 10rpx #bcb9ca;
+		// padding: 10rpx 20rpx;
+		padding: 10px;
+		box-sizing: border-box;
+		margin: 10px auto 0;
+		display: flex;
+		background-color: #fff;
+		width: 95%;
+		.timesbox {
+			display: flex;
+			justify-content: space-around;
+			width: 60%;
+			margin-left: 10px;
+			border: 1px solid #CCCCCC;
+			padding: 5px;
+			font-size: 12px;
+			border-radius: 5px;
+			image {
+				width: 30rpx;
+				height: 30rpx;
+				margin-top: 6rpx;
+			}
+
+			.icon {
+				color: #949494;
+				text-align: right;
+				margin-left: 30rpx;
+
+			}
+		}
+	}
+
+	.wormtime {
+		width: 95%;
+		padding: 10px;
+		box-sizing: border-box;
+		margin: 0 auto;
+		// margin-top: 10px;
+		display: flex;
+		justify-content: space-around;
+		background-color: #fff;
+
+		.wormtime_item {
+			width: 25%;
+			margin-top: 10px;
+			padding: 10px;
+			.img {
+				width: 50px;
+				height: 50px;
+			}
+
+			p:nth-child(2) {
+				font-size: 16px;
+				font-weight: 700;
+			}
+			p:nth-child(3) {
+				font-size: 12px;
+				margin-top: 5px;
+			}
+			p:last-child {
+				font-size: 12px;
+				margin-top: 5px;
+			}
+		}
+
+		.wormtime_item:first-child {
+			background-color: #F9FAFE;
+		}
+
+		.wormtime_item:nth-child(2) {
+			background-color: #FFFCF9;
+		}
+
+		.wormtime_item:last-child {
+			background-color: #FCF8FF;
+		}
+	}
+
+	.schedulebox {
+		display: flex;
+		padding: 10px 10px;
+		box-sizing: border-box;
+		width: 95%;
+		// justify-content: space-around;
+		margin: 0px auto;
+		background-color: #fff;
+
+		.schedule {
+			display: flex;
+			width: 240rpx;
+			height: 50rpx;
+			// border: 2rpx solid #F0F0F0;
+			margin-right: 20rpx;
+			background-color: #F9FAFC;
+			border-radius: 25px;
+
+			.schedule_value {
+				width: 70%;
+				text-align: center;
+				line-height: 50rpx;
+				font-size: 24rpx;
+			}
+
+			.schedule_icon {
+				width: 30%;
+				// background-color: #F2F2F2;
+				text-align: center;
+				line-height: 50rpx;
+				/deep/.u-icon__icon{
+					color: rgba(0,0,0,0.3);
+				}
+			}
+		}
+	}
+
+	.tendency {
+		width: 95%;
+		display: flex;
+		justify-content: space-around;
+		margin: 0 auto;
+		background-color: #fff;
+	}
+
+	.tendency_pro {
+		width: 95%;
+		padding: 0 20px;
+		box-sizing: border-box;
+		height: 140px;
+		overflow-y: auto;
+		margin: 0 auto;
+		background-color: #fff;
+		span:first-child {
+			display: inline-block;
+			width: 100px;
+			overflow: hidden; //溢出隐藏
+			white-space: nowrap; //禁止换行
+			text-overflow: ellipsis; //...
+		}
+
+		/deep/.u-progress {
+			width: calc(100% - 150px) !important;
+		}
+
+		span:last-child {
+			display: inline-block;
+			width: 30px;
+			margin-left: 10px;
+		}
+	}
+
+	.tablebox {
+		display: flex;
+		flex-wrap: wrap;
+		width: 95%;
+		margin: 10px auto 20px;
+		// box-shadow: 0 0 10rpx #bcb9ca;
+		background-color: #fff;
+		.top_text {
+			width: 100%;
+			display: flex;
+			height: 30px;
+			line-height: 30px;
+			.tltle_text {
+				width: 30%;
+				text-align: center;
+				// border: 2rpx solid #F0F0F0;
+				// text-align: center;
+				// background-color: #F0F0F0;
+				// color: #000;
+			}
+
+			.title_text_color {
+				width: 30%;
+				text-align: center;
+				.title_item{
+					border-bottom: 2px solid #64CC82;
+					color: #64CC82;
+				}
+				// width: 50%;
+				// border: 2rpx solid #64CC82;
+				// background-color: #64CC82;
+				// color: #fff;
+				// text-align: center;
+			}
+		}
+
+		.scroll-X {
+			width: 95%;
+			margin: 20rpx auto;
+
+			.table {
+				width: 1800rpx;
+
+				.td:nth-child(3),
+				.td:last-child {
+					color: #37aed8;
+				}
+			}
+
+			.tr {
+				display: flex;
+				overflow: hidden;
+
+				.th,
+				.td {
+					display: inline-block;
+					padding: 5rpx;
+					text-align: center;
+					height: 52rpx;
+					line-height: 52rpx;
+					width: 320rpx;
+				}
+
+			}
+
+			.tr:nth-child(2n-1) {
+				background-color: #f5fff8;
+			}
+
+			.tr:first-child {
+				background-color: #57c878;
+				color: #fff;
+			}
+		}
+
+		.pagenumber {
+			display: flex;
+			margin: 20rpx auto;
+
+			button {
+				width: 150rpx;
+				height: 50rpx;
+				line-height: 50rpx;
+				font-size: 26rpx;
+				text-align: center;
+				background-color: #57c878;
+				color: #FFFFFF;
+			}
+
+			.pagenumber_page {
+				width: 150rpx;
+				height: 50rpx;
+				line-height: 50rpx;
+				font-size: 26rpx;
+				text-align: center;
+			}
+		}
+	}
+
+	.modalbox {
+		width: 100%;
+		// display: flex;
+		// flex-wrap: wrap;
+		height: 120px;
+		padding-left: 30px;
+		margin-top: 10px;
+		overflow-y: auto;
+
+		p {
+			// width: 50%;
+		}
+	}
+
+	/deep/.u-calendar__action {
+		display: flex;
+		justify-content: space-around;
+
+		.u-calendar__action__text {
+			line-height: 25px;
+		}
+	}
+</style>

+ 278 - 0
pages/cb/xctdetail/photolist.vue

@@ -0,0 +1,278 @@
+<template>
+	<view>
+		<view class="status_bar"></view>
+		<view class="" style="position: relative;top: 44px;">
+			<view style="position: fixed;z-index: 100;">
+				<uni-nav-bar @clickLeft="clickLeft" left-icon="back" title="查看图片" rightIcon="camera"
+					@clickRight="clickRight"></uni-nav-bar>
+			</view>
+			<!-- <p class="tishi" v-if="tishi">暂无数据</p> -->
+			<view class="selecttimes" @click="tiemshow=!tiemshow">
+				<view class="timesbox">
+					<image
+						:src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/prevention/1acfe2751c01d3786cdc49b83d7e505.png'"
+						mode=""></image>
+					<p>{{timetab(timestate)}}</p>
+					<p class="or">~</p>
+					<p>{{timetab(timeend)}}</p>
+					<u-icon name="rili" custom-prefix="custom-icon" class="icon"></u-icon>
+				</view>
+				<u-calendar v-model="tiemshow" mode="range" @change="tiemchange"></u-calendar>
+			</view>
+			<view class="imglist">
+				<view class="imglist_box" v-for="(item,index) in imglists" :key="index">
+					<view class="imglist_left">
+						<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/jiazai.ui.gif" mode="">
+						</image>
+						<image :src="item.addr" mode="" @click="examine(index)"></image>
+					</view>
+					<view class="imglist_right">
+						<view class="">
+							{{item.time}}
+						</view>
+						<view class="">
+							害虫数量:{{item.pest_counts}}
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="top" v-if="isTop" @click="top">
+			<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/6209a98f0cb3b5086f2ca36152c9269.png'"
+				mode=""></image>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				tiemshow:false,
+				timestate:"",
+				timeend:"",
+				isTop:false,
+				imglists:[],
+				device_id:"",
+				page:1,
+				d_id:""
+			}
+		},
+		methods: {
+			clickLeft(){
+				uni.navigateBack({
+					delta:1
+				})
+			},
+			clickRight(){
+				this.takephoto()
+			},
+			timetab(e) {
+				e = new Date(e * 1000)
+				var year = e.getFullYear()
+				var month = e.getMonth() + 1 < 10 ? "0" + (e.getMonth() + 1) : e.getMonth() + 1
+				var day = e.getDate() < 10 ? "0" + e.getDate() : e.getDate()
+				var time = year + "/" + month + "/" + day
+				return time
+			},
+			examine(index){
+				var imgarr = []
+				for (var i = 0; i < this.imglists.length; i++) {
+					imgarr.push(this.imglists[i].addr)
+				}
+				uni.previewImage({
+					urls: imgarr,
+					current: index
+				});
+			},
+			async getimglist(){
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.forecast_system.device_photo_list',
+					data: {
+						cmd: "xct",
+						device_id: this.device_id,
+						page: this.page,
+						page_number: "12",
+						time_begin: Math.floor(this.timestate),
+						time_end: Math.floor(this.timeend),
+					}
+				})
+				console.log(res)
+				this.imglists = res.data
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
+				})
+			},
+			tiemchange(e){
+				// console.log(e)
+				this.imglists = []
+				this.page = 1
+				console.log(e)
+				this.timestate = +new Date(e.startDate) / 1000 - 8 * 60 * 60
+				this.timeend = +new Date(e.endDate) / 1000 + 16 * 60 * 60
+				this.getimglist()
+			},
+			async takephoto() { //拍照
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.admin_device_control',
+					data: {
+						device_type_id: 12,
+						d_id: this.d_id,
+						cmd: "takephoto"
+					}
+				})
+				console.log(res)
+				if (res == true) {
+					uni.showToast({
+						title: '指令下发成功!',
+						duration: 2000
+					});
+					var that = this
+					setTimeout(() => {
+						that.getimglist()
+					}, 1000)
+				} else {
+					uni.showToast({
+						title: '指令下发失败!',
+						duration: 2000,
+						icon: "none"
+					});
+				}
+			
+			},
+		},
+		onLoad(option) {
+			this.d_id =  option.d_id
+			this.device_id = option.device_id
+			this.timeend = +new Date() / 1000
+			this.timestate = this.timeend - 60 * 60 * 24
+			this.getimglist()
+		},
+		onReachBottom() {
+			this.page++
+			this.getimglist()
+		},
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.tishi {
+		position: absolute;
+		top: 104px;
+		width: 95%;
+		left: 2.5%;
+		text-align: center;
+		font-size: 40rpx;
+	}
+
+	.selecttimes {
+		width: 100%;
+		position: fixed;
+		top: 85px;
+		left: 0;
+		z-index: 100;
+		background-color: #fff;
+		padding-top: 30rpx;
+
+		.timesbox {
+			display: flex;
+			width: 95%;
+			margin: 0 auto;
+			justify-content: space-around;
+			box-shadow: 0 0 10rpx #bcb9ca;
+			padding: 10rpx 20rpx;
+			box-sizing: border-box;
+
+			image {
+				width: 30rpx;
+				height: 30rpx;
+				margin-top: 6rpx;
+			}
+
+			.icon {
+				color: #949494;
+				text-align: right;
+				margin-left: 30rpx;
+
+			}
+		}
+
+		/deep/.u-calendar__action {
+			display: flex;
+			justify-content: space-around;
+
+			.u-calendar__action__text {
+				line-height: 25px;
+			}
+		}
+	}
+	.imglist {
+		position: absolute;
+		top: 100px;
+		width: 95%;
+		left: 2.5%;
+	
+		.imglist_box {
+			display: flex;
+			box-shadow: 0 0 10rpx #bcb9ca;
+			padding: 20rpx;
+			margin-bottom: 20rpx;
+			height: 140px;
+		}
+	
+		.imglist_left {
+			width: 50%;
+			position: relative;
+	
+			image {
+				position: absolute;
+				top: 0;
+				left: 0;
+				width: 100%;
+				height: 280rpx;
+			}
+		}
+	
+		.imglist_right {
+			margin-left: 40rpx;
+			padding: 10rpx 0;
+	
+			.icon_box {
+				margin-bottom: 12rpx;
+				font-size: 24rpx;
+	
+				.iconfont {
+					margin-right: 20rpx;
+					color: #56C877;
+					font-size: 32rpx;
+				}
+			}
+	
+			p:last-child {
+				margin-bottom: 0;
+			}
+	
+		}
+	}
+.top {
+		position: fixed;
+		right: 30px;
+		bottom: 100px;
+		z-index: 100;
+
+		image {
+			width: 100rpx;
+			height: 100rpx;
+		}
+	}
+</style>

+ 586 - 0
pages/cb/xctdetail/xctdetail.vue

@@ -0,0 +1,586 @@
+<template>
+	<view>
+		<view :class="['info',equipInfo.is_online==1?'on':'off']">
+			<view class="" @click="copy(equipInfo)">
+				设备ID:{{equipInfo.imei||equipInfo.device_id}}
+				<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/environment/fuzhi.png" mode="" class="tishi">
+				</image>
+			</view>
+			<view class="">
+				设备名称:{{equipInfo.device_name==""?"无":equipInfo.device_name}}
+			</view>
+			<view class="">
+				设备类型:吸虫塔
+			</view>
+			<view class="">
+				最新上报时间:{{equipInfo.addtime||equipInfo.uptime | timeFormat}}
+			</view>
+			<view class="">
+				设备地址:{{equipInfo.address||city}}
+			</view>
+		</view>
+		<view class="caobox">
+			<view class="caobox_item" v-if="$QueryPermission(182)" @click="tophoto">
+				<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/1.png" mode="widthFix"></image>
+				<view class="">
+					查看图片
+				</view>
+			</view>
+			<view class="caobox_item" v-if="$QueryPermission(172)" @click="toset">
+				<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/4.png" mode="widthFix"></image>
+				<view class="">
+					设备控制
+				</view>
+			</view>
+			<view class="caobox_item" v-if="$QueryPermission(238)" @click="toanal">
+				<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/3.png" mode="widthFix"></image>
+				<view class="">
+					虫情分析
+				</view>
+			</view>
+			<!-- <view class="caobox_item" v-if="$QueryPermission(238)" @click="toanal">
+				<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/6.png" mode="widthFix"></image>
+				<view class="">
+					SIM卡
+				</view>
+			</view> -->
+		</view>
+		<view class="" v-if="$QueryPermission(183)">
+			<view class="">
+				历史数据
+			</view>
+			<view class="timebox">
+				<view class="firsttime" @click="timeshow=true">
+					<view class="" v-if="start_time!=''">
+						{{start_time/1000|timeFormat()}}
+					</view>
+					<view class="" v-else>
+						{{start_time==""?'请选择开始时间':start_time}}
+					</view>
+				</view>
+				<view class="jiange">
+					-
+				</view>
+				<view class="endtime" @click="timeshow=true">
+					<view class="" v-if="end_time!=''">
+						{{end_time/1000|timeFormat()}}
+					</view>
+					<view class="" v-else>
+						{{end_time==""?'请选择结束时间':end_time}}
+					</view>
+				</view>
+				<u-calendar v-model="timeshow" :mode="mode" @change="timechange"></u-calendar>
+			</view>
+			<view class="shuju_one">
+				<view class="canvastishi" v-if="!canvastishiTF && !dataloadingtf">
+					暂无数据
+				</view>
+				<view class="canvastishi" v-if="dataloadingtf">
+					<p class="dataloading">加载中</p>
+				</view>
+				<canvas v-if="canvastishiTF" canvas-id="canvasColumnA" id="canvasColumnA" class="charts" v-show="!timeshow"
+					@touchstart="touchLineA($event)" @touchmove="moveLineA($event)" @touchend="touchEndLineA($event)"
+					disable-scroll=true
+					:style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>
+			</view>
+			<view class="condition">
+				<scroll-view scroll-top="0" scroll-x="true" class="scroll-X">
+					<table class="table" v-if="$QueryPermission(271)">
+						<tr class="tr">
+							<th class="th" v-for="(item,index) in tableHeadTxt" :key="'a'+index">{{item}}</th>
+						</tr>
+						<tr class="tr" v-for="(items,indexs) in historylistdata" :key="'b'+indexs" v-if="!forbidden">
+							<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
+							<td class="td">{{items.d_h_t.at}}</td>
+							<td class="td">{{items.d_h_t.ah}}</td>
+							<td class="td">{{items.d_h_t.dver}}</td>
+							<td class="td">{{items.d_h_t.ws==0?'待机' : '工作'}}</td>
+							<td class="td">{{items.d_h_t.current}}</td>
+							<td class="td">{{items.d_h_t.vbat}}</td>
+							<td class="td">{{items.d_h_t.lng}}</td>
+							<td class="td">{{items.d_h_t.lat}}</td>
+						</tr>
+						<tr class="tr" v-if="forbidden">
+							<td class="td" v-for="item in 9">暂无数据</td>
+						</tr>
+					</table>
+					<table class="table" v-else>
+						<tr class="tr">
+							<th class="th" v-for="(item,index) in tableHeadTxt2" :key="'a'+index">{{item}}</th>
+						</tr>
+						<tr class="tr" v-for="(items,indexs) in historylistdata" :key="'b'+indexs" v-if="!forbidden">
+							<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
+							<td class="td">{{items.d_h_t.at}}</td>
+							<td class="td">{{items.d_h_t.ah}}</td>
+							<td class="td">{{items.d_h_t.dver}}</td>
+							<td class="td">{{items.d_h_t.ws==0?'待机' : '工作'}}</td>
+							<td class="td">{{items.d_h_t.lng}}</td>
+							<td class="td">{{items.d_h_t.lat}}</td>
+						</tr>
+						<tr class="tr" v-if="forbidden">
+							<td class="td" v-for="item in 7">暂无数据</td>
+						</tr>
+					</table>
+				</scroll-view>
+				<view class="pagenumber">
+					<button @click="prev">上一页</button>
+					<view class="pagenumber_page">
+						第 {{page}} 页
+					</view>
+					<view class="pagenumber_page">
+						共 {{pagesum}} 页
+					</view>
+					<button @click="next" :disabled="forbidden">下一页</button>
+				</view>
+			</view>
+		</view>
+		<view class="" v-else>
+			暂无数据
+		</view>
+	</view>
+</template>
+
+<script>
+	import uCharts from '../../../components/js_sdk/u-charts/u-charts/u-charts.js';
+	// import Circulation from "../../../static/js/equipState_dict.json"
+	var canvaColumnA = null;
+	export default {
+		data() {
+			return {
+				equipInfo: {},
+				canvastishiTF: false,
+				dataloadingtf: false,
+				cWidth: '400',
+				cHeight: '400',
+				pixelRatio: 1,
+				start_time: "",
+				end_time: "",
+				timeshow: false,
+				mode: 'range',
+				historydatas: [],
+				tableHeadTxt: [
+					"上报时间",
+					"环境温度(°C)",
+					"环境湿度(%)",
+					"版本号",
+					"工作状态",
+					"电流(mA)",
+					"电压(V)",
+					"经度",
+					"纬度",
+
+				],
+				tableHeadTxt2: [
+					"上报时间",
+					"环境温度(°C)",
+					"环境湿度(%)",
+					"版本号",
+					"工作状态",
+					"经度",
+					"纬度",
+
+				],
+				historylistdata: [],
+				pagesum: 10,
+				page: 1,
+				forbidden: false
+			}
+		},
+		methods: {
+			copy(item) {
+				console.log(item)
+				uni.setClipboardData({
+					data: item.imei || item.device_id,
+					success: function() {
+						console.log('success');
+					}
+				});
+			},
+			toset() {
+				uni.navigateTo({
+					url: "./xctset?device_id=" + this.equipInfo.imei + "&d_id=" + this.equipInfo.d_id + "&dtype=" +
+						this.equipInfo.dtype +
+						"&device_name=" + this.equipInfo.device_name
+				})
+			},
+			tophoto() {
+				uni.navigateTo({
+					url: "./photolist?device_id=" + this.equipInfo.imei + "&d_id=" + this.equipInfo.d_id
+				})
+			},
+			toanal() {
+				uni.navigateTo({
+					url: "./analyse?d_id=" + this.equipInfo.d_id + "&device_id=" + this.equipInfo.imei +
+						"&device_type=12&disable=" + this.equipInfo.disable
+				})
+			},
+			timechange(e) {
+				this.start_time = +new Date(e.startDate)
+				this.end_time = +new Date(e.endDate)
+				this.history()
+				this.getwind()
+			},
+			async history() { //历史数据列表折线图
+				this.dataloadingtf = true
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.device_xct_data',
+					data: {
+						d_id: this.equipInfo.d_id,
+						start_time: Math.floor(+new Date(this.start_time) / 1000),
+						end_time: Math.floor(+new Date(this.end_time) / 1000),
+					}
+				})
+				console.log(res)
+				this.dataloadingtf = false
+				this.historydatas = res
+				console.log(this.historydatas)
+				if (this.historydatas.length == 0) {
+					this.canvastishiTF = false
+				} else {
+					this.canvastishiTF = true
+
+					var arr1 = []
+					var arr2 = []
+					var arr3 = []
+					var xtitle = []
+					for (var i = 0; i < res.length; i++) {
+						var times = new Date(res[i].addtime * 1000)
+						xtitle.push(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times
+							.getMinutes())
+						arr1.push(res[i].temperature == "" ? "0" : res[i].temperature)
+						arr2.push(res[i].humidity == "" ? "0" : res[i].humidity)
+					}
+					// console.log(arr1)
+					var obj = [{
+						name: '温度',
+						data: arr1,
+						color: '#00E29D'
+					}, {
+						name: '湿度',
+						data: arr2,
+						color: '#6CBBFF'
+					}]
+					this.showColumn("canvasColumnA", xtitle, obj)
+				}
+			},
+			showColumn(id, xtitle, xinfo) {
+				var _self = this
+				canvaColumnA = new uCharts({
+					canvasId: id,
+					type: 'line',
+					legend: {
+						position: "top"
+					},
+					fontSize: 11,
+					background: '#FFFFFF',
+					pixelRatio: 1,
+					animation: true,
+					dataLabel: false,
+					categories: xtitle,
+					series: xinfo,
+					enableScroll: true, //开启图表拖拽功能
+					xAxis: {
+						disableGrid: true,
+						type: 'grid',
+						gridType: 'dash',
+						itemCount: 4, //x轴单屏显示数据的数量,默认为5个
+						scrollShow: true, //新增是否显示滚动条,默认false
+						// scrollAlign: 'left', //滚动条初始位置
+						scrollBackgroundColor: '#F7F7FF', //默认为 #EFEBEF
+						scrollColor: '#DEE7F7', //默认为 #A6A6A6
+					},
+					yAxis: {
+						gridType: 'dash',
+						gridColor: '#CCCCCC',
+						dashLength: 8,
+						splitNumber: 5,
+						format: (val) => {
+							return val.toFixed(1)
+						}
+					},
+					width: _self.cWidth * 1,
+					height: _self.cHeight * 1,
+					extra: {
+						line: {
+							type: 'curve'
+						}
+					}
+				});
+			},
+			touchLineA(e) {
+				console.log(e)
+				canvaColumnA.scrollStart(e);
+			},
+			moveLineA(e) {
+				canvaColumnA.scroll(e);
+			},
+			touchEndLineA(e) {
+				canvaColumnA.scrollEnd(e);
+				//下面是toolTip事件,如果滚动后不需要显示,可不填写
+				canvaColumnA.showToolTip(e, {
+					format: function(item, category) {
+						return category + ' ' + item.name + ':' + item.data
+					}
+				});
+			},
+			async getwind() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.xct_history_data',
+					data: {
+						d_id: this.equipInfo.d_id,
+						start_time: Math.floor(+new Date(this.start_time) / 1000),
+						end_time: Math.floor(+new Date(this.end_time) / 1000),
+						page: this.page,
+						page_size: "10"
+					}
+				})
+				console.log(res)
+				if (res.data.length) {
+					this.historylistdata = res.data
+					this.pagesum = Math.ceil(res.counts / 10)
+					this.forbidden = false
+				} else {
+					this.forbidden = true
+				}
+			},
+			prev() { //上一页
+				if (this.page > 1) {
+					this.page--
+					this.getwind()
+				}
+			},
+			next() { //下一页
+				if(this.page < this.pagesum){
+					this.page++
+					this.getwind()
+				}
+			},
+		},
+		onLoad(option) {
+			this.equipInfo = JSON.parse(option.info)
+			this.end_time = +new Date()
+			this.start_time = +new Date() - 30 * 24 * 60 * 60 * 1000
+			this.cWidth = uni.upx2px(650);
+			this.cHeight = uni.upx2px(500);
+			this.history()
+			this.getwind()
+		},
+	}
+</script>
+
+<style lang='scss'>
+	page {
+		padding: 20rpx;
+		box-sizing: border-box;
+
+		.info {
+			padding: 20rpx 40rpx;
+			color: #fff;
+			line-height: 50rpx;
+			font-size: 26rpx;
+			background-size: 100% auto;
+			background-repeat: no-repeat;
+			background-color: #0DC6B6;
+			background-position: top left;
+			box-sizing: border-box;
+			width: 100%;
+
+			.tishi {
+				width: 28rpx;
+				height: 28rpx;
+				margin: 0rpx 0 0 20rpx;
+			}
+		}
+
+		.on {
+			background-image: url('http://www.hnyfwlw.com:8006/bigdata_app/image/cb/onBg.png')
+		}
+
+		.off {
+			background-image: url('http://www.hnyfwlw.com:8006/bigdata_app/image/cb/offBg.png')
+		}
+
+		.caobox {
+			display: flex;
+			flex-wrap: wrap;
+			text-align: center;
+			font-size: 28rpx;
+			color: #666;
+			line-height: 50rpx;
+
+			image {
+				width: 52rpx;
+			}
+
+			.caobox_item {
+				padding: 20rpx 0;
+				box-sizing: border-box;
+				flex-basis: 25%;
+			}
+		}
+
+		.timebox {
+			box-shadow: 0 0 10rpx #bcb9ca;
+			display: flex;
+			background-color: #fff;
+			padding: 10px;
+			border-top-right-radius: 5px;
+			border-top-left-radius: 5px;
+			margin-top: 30rpx;
+
+			.jiange {
+				width: 5%;
+				text-align: center;
+			}
+
+			.firsttime,
+			.endtime {
+				width: 45%;
+				text-align: center;
+			}
+		}
+
+		.shuju_one {
+			position: relative;
+			width: 100%;
+			margin: 40rpx auto;
+			box-shadow: 0 0 10rpx #bcb9ca;
+			padding-top: 20rpx;
+			height: 550rpx;
+
+			.canvastishi {
+				font-size: 32rpx;
+				position: absolute;
+				top: 50%;
+				left: 50%;
+				margin-left: -64rpx;
+				margin-top: -21rpx;
+
+				.dataloading:after {
+					overflow: hidden;
+					display: inline-block;
+					vertical-align: bottom;
+					animation: ellipsis 2s infinite;
+					content: "\2026";
+				}
+
+				@keyframes ellipsis {
+					from {
+						width: 2px;
+					}
+
+					to {
+						width: 15px;
+					}
+				}
+			}
+
+			.shuju_one_title {
+				width: 70%;
+				margin: 0 auto;
+				display: flex;
+
+				.tltle_text {
+					width: 25%;
+					border: 2rpx solid #B2B2B2;
+					color: #57c878;
+					text-align: center;
+					font-size: 24rpx;
+					height: 50rpx;
+					line-height: 50rpx;
+				}
+
+				.title_text_color {
+					width: 25%;
+					border: 2rpx solid #57c878;
+					background-color: #57c878;
+					color: #fff;
+					text-align: center;
+					font-size: 24rpx;
+					height: 50rpx;
+					line-height: 50rpx;
+				}
+			}
+		}
+	}
+
+	.condition {
+		display: flex;
+		flex-wrap: wrap;
+		width: 100%;
+		margin: 30rpx auto;
+		box-shadow: 0 0 10rpx #bcb9ca;
+		margin-bottom: 30rpx;
+
+		.scroll-X {
+			width: 95%;
+			margin: 20rpx auto;
+
+			.table {
+				width: 1164px;
+			}
+
+			.tr {
+				display: flex;
+				overflow: hidden;
+
+				.th,
+				.td {
+					display: inline-block;
+					padding: 5rpx;
+					width: 240rpx;
+					text-align: center;
+					height: 52rpx;
+					line-height: 52rpx;
+					border: 2rpx solid #F1F1F1;
+				}
+
+				.th:first-child,
+				.td:first-child {
+					width: 300rpx;
+				}
+			}
+
+			.tr:nth-child(2n-1) {
+				background-color: #f5fff8;
+			}
+
+			.tr:first-child {
+				background-color: #57c878;
+				color: #fff;
+			}
+		}
+
+		.pagenumber {
+			display: flex;
+			margin: 20rpx auto;
+
+			button {
+				width: 150rpx;
+				height: 50rpx;
+				line-height: 50rpx;
+				font-size: 26rpx;
+				text-align: center;
+				background-color: #57c878;
+				color: #FFFFFF;
+			}
+
+			.pagenumber_page {
+				width: 100rpx;
+				height: 50rpx;
+				line-height: 50rpx;
+				font-size: 26rpx;
+				text-align: center;
+			}
+		}
+	}
+
+	/deep/.u-calendar__action {
+		display: flex;
+		justify-content: space-around;
+
+		.u-calendar__action__text {
+			line-height: 25px;
+		}
+	}
+</style>

+ 379 - 0
pages/cb/xctdetail/xctset.vue

@@ -0,0 +1,379 @@
+<template>
+	<view>
+		<view class="" v-if="myuser_type">
+			<view class="tit adminTit">
+				联网模块
+			</view>
+			<view class="btns">
+				<button type="warn" @click="equipBtnControl('dtu_update')" size="mini">升级</button>
+				<button type="warn" @click="equipBtnControl('dtu_reboot')" size="mini">重启</button>
+				<button type="warn" @click="equipBtnControl('yfwlw')" size="mini">平台切换</button>
+			</view>
+			<view class="tit adminTit">
+				强制操作
+			</view>
+			<view class="btns">
+				<button type="warn" @click="equipBtnControl('takephoto')" size="mini">拍照</button>
+				<button type="warn" @click="equipBtnControl('update')" size="mini">升级</button>
+				<button type="warn" @click="equipBtnControl('reboot')" size="mini">重启</button>
+				<button type="warn" @click="equipBtnControl('close_shake')" size="mini">震动关闭</button>
+				<button type="warn" @click="equipBtnControl('open_shake')" size="mini">震动开启</button>
+			</view>
+		</view>
+		<view class="setitem">
+			设备编号:{{option.device_id}}
+		</view>
+		<view class="setitem">
+			设备名称:{{option.device_name}}
+		</view>
+		<view class="setitem">
+			设备版本:{{option.dtype}}
+		</view>
+		<view class="setitem">
+			设备开关:
+			<view class="uni-list-cell" style="margin-top: 30rpx;">
+				<picker @change="turnChange($event,'ds')" value="equipContrlForm.ds" :range="dsArr">
+					<text class="uni-input">{{dsArr[equipContrlForm.ds]}}</text>
+					<view class="arrow"></view>
+				</picker>
+			</view>
+		</view>
+		<view class="setitem">
+			震动开关:
+			<view class="uni-list-cell" style="margin-top: 30rpx;">
+				<picker @change="turnChange($event,'shake')" value="equipContrlForm.shake" :range="shakeArr">
+					<text class="uni-input">{{shakeArr[equipContrlForm.shake]}}</text>
+					<view class="arrow"></view>
+				</picker>
+			</view>
+		</view>
+		<view class="setitem">
+			时控时长:
+			<view class="selectTime">
+				<view class="uni-list-cell time" @click="selectTime('st')">
+					<text>{{stLabel}}</text>
+					<u-icon name="clock"></u-icon>
+				</view>
+				<text class="line">-</text>
+				<view class="uni-list-cell time" @click="selectTime('et')">
+					<text>{{etLabel}}</text>
+					<u-icon name="clock"></u-icon>
+				</view>
+			</view>
+			<u-select v-model="stShow" mode="single-column" :list="list" @confirm="stConfirm"></u-select>
+			<u-select v-model="etShow" mode="single-column" :list="list" @confirm="etConfirm"></u-select>
+		</view>
+		<view class="setitem">
+			震动时间(min):
+			<slider :value="equipContrlForm.shake_sec" show-value="true" :min="10" :max="60"
+				@change="sliderChange($event,'shake_sec')" block-color="#57C878" activeColor="#57C878" step="1" />
+		</view>
+		<view class="setitem">
+			数据上传(min):
+			<slider :value="equipContrlForm.dat_f" show-value="true" :min="10" :max="60"
+				@change="sliderChange($event,'dat_f')" block-color="#57C878" activeColor="#57C878" step="1" />
+		</view>
+		<view class="submit-box">
+			<u-button @click="submit" type="success">确定</u-button>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				myuser_type: false,
+				option:{},
+				equipContrlForm:{
+					ds:"",
+					st: "",
+					et: "",
+					shake:"",//震动开关
+					shake_sec:"",//震动
+					dat_f:"",//数据
+				},
+				dsArr: ['关机', '开机'],
+				shakeArr:["关","开"],
+				stShow:false,
+				etShow:false,
+				etLabel:"",
+				stLabel:"",
+				list: [{
+						value: 0,
+						label: '00:00'
+					},
+					{
+						value: 1,
+						label: '01:00'
+					},
+					{
+						value: 2,
+						label: '02:00'
+					},
+					{
+						value: 3,
+						label: '03:00'
+					},
+					{
+						value: 4,
+						label: '04:00'
+					},
+					{
+						value: 5,
+						label: '05:00'
+					},
+					{
+						value: 6,
+						label: '06:00'
+					},
+					{
+						value: 7,
+						label: '04:00'
+					}, {
+						value: 8,
+						label: '08:00'
+					},
+					{
+						value: 9,
+						label: '09:00'
+					},
+					{
+						value: 10,
+						label: '10:00'
+					},
+					{
+						value: 11,
+						label: '11:00'
+					},
+					{
+						value: 12,
+						label: '12:00'
+					},
+					{
+						value: 13,
+						label: '13:00'
+					},
+					{
+						value: 14,
+						label: '14:00'
+					}, {
+						value: 15,
+						label: '15:00'
+					},
+					{
+						value: 16,
+						label: '16:00'
+					},
+					{
+						value: 17,
+						label: '17:00'
+					},
+					{
+						value: 18,
+						label: '18:00'
+					},
+					{
+						value: 19,
+						label: '19:00'
+					},
+					{
+						value: 20,
+						label: '20:00'
+					},
+					{
+						value: 21,
+						label: '21:00'
+					}, {
+						value: 22,
+						label: '22:00'
+					},
+					{
+						value: 23,
+						label: '23:00'
+					},
+				],
+			}
+		},
+		methods: {
+			async getconf(){
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.device_control_info',
+					data: {
+						cmd: "paramconf",
+						d_id: this.option.d_id
+					}
+				})
+				console.log(res)
+				for(var key in this.equipContrlForm){
+					this.equipContrlForm[key] = res[key]
+				}
+				this.etLabel = this.list[this.equipContrlForm.et].label
+				this.stLabel = this.list[this.equipContrlForm.st].label
+			},
+			turnChange(e,a) {
+				if (a == 'ds') {
+					this.equipContrlForm.ds = e.target.value
+				} else {
+					this.equipContrlForm.shake = e.target.value
+				}
+				
+			},
+			selectTime(a) {
+				if (a == 'st') {
+					this.stShow = true;
+				} else {
+					this.etShow = true;
+				}
+			},
+			stConfirm(e) {
+				this.stLabel = e[0].label
+				this.equipContrlForm.st = e[0].value
+			},
+			etConfirm(e) {
+				this.etLabel = e[0].label
+				this.equipContrlForm.et = e[0].value
+			},
+			sliderChange(e, a) {
+				console.log(e)
+				if (a == "dat_f") {
+					this.equipContrlForm.dat_f = e.detail.value
+				} else {
+					this.equipContrlForm.shake_sec = e.detail.value
+				}
+			},
+			async submit(){
+				console.log(this.equipContrlForm)
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.device_control',
+					data: {
+						device_type_id: 12,
+						d_id: this.option.d_id,
+						config: JSON.stringify(this.equipContrlForm)
+					}
+				})
+				if (res == true) {
+					uni.showToast({
+						title: '指令下发成功!',
+						duration: 2000
+					});
+				} else {
+					uni.showToast({
+						title: '指令下发失败!',
+						duration: 2000,
+						icon: "none"
+					});
+				}
+			},
+			async equipBtnControl(cmd) {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.admin_device_control',
+					data: {
+						cmd,
+						device_type_id: 12,
+						d_id: this.option.d_id,
+					}
+				})
+				console.log(res)
+				if (res == true) {
+					uni.showToast({
+						title: '指令下发成功!',
+						duration: 2000
+					});
+				} else {
+					uni.showToast({
+						title: '指令下发失败!',
+						duration: 2000,
+						icon: "none"
+					});
+				}
+			}
+		},
+		onLoad(option) {
+			this.option = option
+			uni.getStorage({
+				key: "myuser_type",
+				success: (res) => {
+					console.log(res.data)
+					if (Number(res.data) == 1) {
+						this.myuser_type = true
+					}
+				}
+			})
+			this.getconf()
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		padding: 20rpx;
+		box-sizing: border-box;
+
+		.tit {
+			line-height: 30rpx;
+			font-size: 30rpx;
+			padding-left: 20rpx;
+			border-left-width: 2px;
+			border-left-style: solid;
+			border-left-color: $uni-color-success;
+			margin: 30rpx 0;
+		}
+
+		.adminTit {
+			border-left-color: #e64340;
+		}
+
+		.btns {
+			display: flex;
+			justify-content: flex-start;
+			flex-wrap: no-wrap;
+
+			button {
+				margin: 0;
+				margin-right: 10rpx;
+				padding: 0 25rpx;
+			}
+		}
+		.setitem {
+			margin-top: 30rpx;
+		
+			.selectTime {
+				margin-top: 30rpx;
+				display: flex;
+		
+				.time {
+					width: 350rpx;
+					display: flex;
+					justify-content: space-between;
+				}
+		
+				.line {
+					width: 50rpx;
+					text-align: center;
+				}
+			}
+		}
+		
+		.uni-list-cell {
+			background: #F7F8FA;
+			padding: 10rpx 40rpx;
+			font-size: 28rpx;
+			box-sizing: border-box;
+		
+			/* margin-top: 30rpx; */
+			.arrow {
+				display: inline-block;
+				border-width: 12rpx 8rpx;
+				border-style: solid;
+				float: right;
+				margin-top: 10rpx;
+				border-color: #888 transparent transparent transparent;
+			}
+		}
+		
+		.submit-box {
+			margin-top: 60rpx
+		}
+	}
+</style>

+ 1 - 1
pages/cb/xy/equip-set/equip-set.vue

@@ -47,7 +47,7 @@
 			数据频率(min)
 		</view>
 		<view class="">
-			<slider :value="equipContrlForm1.dat_f" show-value="true" :min="10" :max="40" @change="sliderChange"  block-color="#57C878" activeColor="#57C878" step="1" />
+			<slider :value="equipContrlForm1.dat_f" show-value="true" :min="10" :max="60" @change="sliderChange"  block-color="#57C878" activeColor="#57C878" step="1" />
 		</view>
 		<view class="submit-box">
 			<u-button  @click="submit" type="success">确定</u-button>

+ 44 - 22
pages/cb/xy/equip-set/xyhistoryile.vue

@@ -40,13 +40,12 @@
 			<view class="condition">
 				<scroll-view scroll-top="0" scroll-x="true" class="scroll-X">
 					<!-- @scrolltoupper="upper" @scrolltolower="lower" @scroll="scroll" -->
-					<table class="table">
+					<table class="table" v-if="$QueryPermission(268)">
 						<tr class="tr">
 							<th class="th" v-for="(item,index) in thdata" :key="'a'+index">{{item}}</th>
 						</tr>
 						<tr class="tr" v-for="(items,indexs) in historylistdata" :key="'b'+indexs" v-if="!forbidden">
 							<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
-							<td class="td">{{items.d_h_t.proj}}</td>
 							<td class="td">{{items.d_h_t.ds==0?"关":"开"}}</td>
 							<td class="td">{{items.d_h_t.ws==0?"待机":"工作"}}</td>
 							<td class="td">{{items.d_h_t.at}}</td>
@@ -54,13 +53,30 @@
 							<td class="td">{{items.d_h_t.cv}}</td>
 							<td class="td">{{items.d_h_t.bv}}</td>
 							<td class="td">{{items.d_h_t.bs}}</td>
-							<td class="td">{{items.d_h_t.cs?"充电":"充电"}}</td>
+							<td class="td">{{items.d_h_t.cs?"充电":"充电"}}</td>
 							<td class="td">{{items.d_h_t.infr_ct}}</td>
 							<td class="td">{{items.d_h_t.csq}}</td>
-							<td class="td">{{items.d_h_t.dver}}</td>
 						</tr>
 						<tr class="tr" v-if="forbidden">
-							<td class="td" v-for="item in 13">暂无数据</td>
+							<td class="td" v-for="item in 11">暂无数据</td>
+						</tr>
+					</table>
+					<table class="table" v-else>
+						<tr class="tr">
+							<th class="th" v-for="(item,index) in thdata2" :key="'a'+index">{{item}}</th>
+						</tr>
+						<tr class="tr" v-for="(items,indexs) in historylistdata" :key="'b'+indexs" v-if="!forbidden">
+							<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
+							<td class="td">{{items.d_h_t.ds==0?"关":"开"}}</td>
+							<td class="td">{{items.d_h_t.ws==0?"待机":"工作"}}</td>
+							<td class="td">{{items.d_h_t.at}}</td>
+							<td class="td">{{items.d_h_t.ah}}</td>
+							<td class="td">{{items.d_h_t.bs}}</td>
+							<td class="td">{{items.d_h_t.cs?"充电":"非充电"}}</td>
+							<td class="td">{{items.d_h_t.infr_ct}}</td>
+						</tr>
+						<tr class="tr" v-if="forbidden">
+							<td class="td" v-for="item in 8">暂无数据</td>
 						</tr>
 					</table>
 				</scroll-view>
@@ -98,8 +114,11 @@
 				device_id: '',
 				page: 1,
 				historylistdata: [],
-				thdata: ["上报时间", "型号", "设备开关", "工作状态", "环境温度(°C)", "环境湿度(%)", "充电电压(V)", "电池电压(V)", "电池状态", "充电状态", "红外计数值", "信号强度",
-					"版本号"
+				thdata: ["上报时间", "设备开关", "工作状态", "环境温度(°C)", "环境湿度(%)", "充电电压(V)", "电池电压(V)", "电池状态", "充电状态",
+					"诱虫次数", "信号强度",
+				],
+				thdata2: ["上报时间", "设备开关", "工作状态", "环境温度(°C)", "环境湿度(%)", "电池状态", "充电状态",
+					"诱虫次数",
 				],
 				forbidden: false,
 				wind_sped: '', //风速
@@ -131,22 +150,28 @@
 					this.wind_sped = "--"
 					this.wind_drec = "--"
 				} else {
-					this.wind_sped = res[0].others.wind_sped
-					if (22 < res[0].others.wind_drec && 67 < res[0].others.wind_drec) {
+					if(res[res.length-1].others.wind_sped>=66.6){
+						this.wind_sped = 0
+					}else{
+						this.wind_sped = res[res.length-1].others.wind_sped
+					}
+					if (22 < res[res.length-1].others.wind_drec && 67 > res[res.length-1].others.wind_drec) {
 						this.wind_drec = "东北"
-					} else if (67 < res[0].others.wind_drec && 112 > res[0].others.wind_drec) {
+					} else if (67 < res[res.length-1].others.wind_drec && 112 > res[res.length-1].others.wind_drec) {
 						this.wind_drec = "东"
-					} else if (112 < res[0].others.wind_drec && 157 > res[0].others.wind_drec) {
+					} else if (112 < res[res.length-1].others.wind_drec && 157 > res[res.length-1].others.wind_drec) {
 						this.wind_drec = "东南"
-					} else if (157 < res[0].others.wind_drec && 202 > res[0].others.wind_drec) {
+					} else if (157 < res[res.length-1].others.wind_drec && 202 > res[res.length-1].others.wind_drec) {
 						this.wind_drec = "南"
-					} else if (202 < res[0].others.wind_drec && 247 > res[0].others.wind_drec) {
+					} else if (202 < res[res.length-1].others.wind_drec && 247 > res[res.length-1].others.wind_drec) {
 						this.wind_drec = "西南"
-					} else if (247 < res[0].others.wind_drec && 292 > res[0].others.wind_drec) {
+					} else if (247 < res[res.length-1].others.wind_drec && 292 > res[res.length-1].others.wind_drec) {
 						this.wind_drec = "西"
-					} else if (292 < res[0].others.wind_drec && 337 > res[0].others.wind_drec) {
+					} else if (292 < res[res.length-1].others.wind_drec && 337 > res[res.length-1].others.wind_drec) {
 						this.wind_drec = "西北"
-					} else {
+					} else if (res[res.length-1].others.wind_drec>360){
+						this.wind_drec = "无"
+					}else{
 						this.wind_drec = "北"
 					}
 				}
@@ -160,9 +185,9 @@
 					var xtitle = []
 					for (var i = 0; i < res.length; i++) {
 						var times = new Date(res[i].addtime * 1000)
-						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
-						arr1.unshift(res[i].temperature==""?"0":res[i].temperature)
-						arr2.unshift(res[i].humidity==""?"0":res[i].humidity)
+						xtitle.push(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
+						arr1.push(res[i].temperature==""?"0":res[i].temperature)
+						arr2.push(res[i].humidity==""?"0":res[i].humidity)
 					}
 					var obj = [{
 						name: '温度',
@@ -315,9 +340,6 @@
 						duration: 2000,
 						icon: "none"
 					});
-					uni.navigateBack({
-						delta: 1
-					})
 				}else{
 					uni.showToast({
 						title: '刷新失败',

+ 141 - 64
pages/cb/xy2.0/historydatas.vue

@@ -1,28 +1,47 @@
 <template>
 	<view>
 		<view class="">
-			<view class="shuju_one">
-				<view class="shuju_one_title">
-					<view :class="titleidnex==index?'title_text_color':'tltle_text'" v-for="(item,index) in titletext" :key="index"
-					 @click="changeindex(index)">
-						{{item}}
+			<view class="timeandtype">
+				<view class="timebox">
+					<view class="firsttime" @click="timeshow=true">
+						<view class="" v-if="start_time!=''">
+							{{(start_time==""?'请选择开始时间':start_time)/1000|timeFormat()}}
+						</view>
+						<view class="" v-else>
+							{{start_time==""?'请选择开始时间':start_time}}
+						</view>
+					</view>
+					<view class="jiange">
+						-
+					</view>
+					<view class="endtime" @click="timeshow=true">
+						<view class="" v-if="end_time!=''">
+							{{(end_time==""?'请选择结束时间':end_time)/1000|timeFormat()}}
+						</view>
+						<view class="" v-else>
+							{{end_time==""?'请选择结束时间':end_time}}
+						</view>
 					</view>
 				</view>
+			</view>
+			<view class="shuju_one">
 				<view class="canvastishi" v-if="!canvastishiTF && !dataloadingtf">
 					暂无数据
 				</view>
 				<view class="canvastishi" v-if="dataloadingtf">
 					<p class="dataloading">加载中</p>
 				</view>
-				<canvas v-if="canvastishiTF" canvas-id="canvasColumnA" id="canvasColumnA" class="charts" @touchstart="touchLineA($event)"
-				 @touchmove="moveLineA($event)" @touchend="touchEndLineA($event)" disable-scroll=true :style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>
+				<canvas v-if="canvastishiTF" canvas-id="canvasColumnA" id="canvasColumnA" class="charts"
+					@touchstart="touchLineA($event)" @touchmove="moveLineA($event)" @touchend="touchEndLineA($event)"
+					disable-scroll=true
+					:style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>
 			</view>
 			<view class="refresh" @click="refresh">
 				刷 新
 			</view>
 			<view class="condition">
 				<scroll-view scroll-top="0" scroll-x="true" class="scroll-X">
-					<table class="table">
+					<table class="table" v-if="$QueryPermission(266)">
 						<tr class="tr">
 							<th class="th" v-for="(item,index) in thdata" :key="'a'+index">{{item}}</th>
 						</tr>
@@ -40,6 +59,20 @@
 							<td class="td" v-for="item in 8">暂无数据</td>
 						</tr>
 					</table>
+					<table class="thdata2" v-else>
+						<tr class="tr">
+							<th class="th" v-for="(item,index) in thdata2" :key="'a'+index">{{item}}</th>
+						</tr>
+						<tr class="tr" v-for="(items,indexs) in historylistdata" :key="'b'+indexs" v-if="!forbidden">
+							<td class="td">{{items.xy_addtime|timeFormat()}}</td>
+							<td class="td">{{items.at==""?"--":items.at}}</td>
+							<td class="td">{{items.ah==""?"--":items.ah}}</td>
+							<td class="td">{{items.warn==""?"--":items.warn}}</td>
+						</tr>
+						<tr class="tr" v-if="forbidden">
+							<td class="td" v-for="item in 4">暂无数据</td>
+						</tr>
+					</table>
 				</scroll-view>
 				<view class="pagenumber">
 					<button @click="prev">上一页</button>
@@ -53,6 +86,7 @@
 				</view>
 			</view>
 		</view>
+		<u-calendar v-model="timeshow" :mode="mode" @change="timechange"></u-calendar>
 	</view>
 </template>
 
@@ -76,14 +110,17 @@
 				page: 1,
 				historylistdata: [],
 				thdata: ["上报时间", "环境温度(°C)", "环境湿度(%)", "虫害预警", "电池电压", "电池电流", "太阳能板电压", "太阳能板电流"],
+				thdata2: ["上报时间", "环境温度(°C)", "环境湿度(%)", "虫害预警"],
 				forbidden: false,
 				cWidth: '400',
 				cHeight: '400',
 				pixelRatio: 1,
-				canvastishiTF: false,//暂无数据提示
-				dataloadingtf:true,//加载中提示
+				canvastishiTF: false, //暂无数据提示
+				dataloadingtf: true, //加载中提示
 				pagesum: 1,
-				worms: []
+				worms: [],
+				timeshow:false,
+				mode: 'range',
 			}
 		},
 		methods: {
@@ -159,9 +196,6 @@
 						duration: 2000,
 						icon: "none"
 					});
-					uni.navigateBack({
-						delta: 1
-					})
 				} else {
 					uni.showToast({
 						title: '刷新失败',
@@ -173,35 +207,6 @@
 			refresh() { //获取当前时间的数据
 				this.newdata()
 			},
-			changeindex(index) {
-				this.titleidnex = index
-				var now = new Date()
-				this.$forceUpdate()
-				if (index == 0) {
-					this.start_time = this.end_time - 24 * 60 * 60 * 1000
-					// this.history()
-					this.Chistory()
-					this.historylist()
-				} else if (index == 1) {
-					var oldtime = now.setMonth(now.getMonth() - 1)
-					this.start_time = parseInt(oldtime)
-					// this.history()
-					this.Chistory()
-					this.historylist()
-				} else if (index == 2) {
-					var oldtime = now.setMonth(now.getMonth() - 6)
-					this.start_time = parseInt(oldtime)
-					// this.history()
-					this.Chistory()
-					this.historylist()
-				} else if (index == 3) {
-					var oldtime = now.setFullYear(now.getFullYear() - 1)
-					this.start_time = parseInt(oldtime)
-					// this.history()
-					this.Chistory()
-					this.historylist()
-				}
-			},
 			prev() { //上一页
 				if (this.page > 1) {
 					this.page--
@@ -209,7 +214,7 @@
 				}
 			},
 			next() { //下一页
-				if(this.page<this.pagesum){
+				if (this.page < this.pagesum) {
 					this.page++
 					this.historylist()
 				}
@@ -279,6 +284,21 @@
 					}
 				});
 			},
+			closetime() {
+				this.start_time = ""
+				this.end_time = ""
+				this.listpage = 1
+				this.Chistory()
+				this.historylist()
+			},
+			timechange(e) {
+				console.log(e)
+				this.start_time = +new Date(e.startDate)
+				this.end_time = +new Date(e.endDate)
+				this.listpage = 1
+				this.Chistory()
+				this.historylist()
+			},
 		},
 		onLoad(option) {
 			console.log(option)
@@ -294,20 +314,67 @@
 			// this.history()
 			this.Chistory()
 			this.historylist()
+		},
+		onPullDownRefresh() {
+			console.log('refresh');
+			this.Chistory()
+			this.historylist()
+			setTimeout(function() {
+				uni.stopPullDownRefresh();
+			}, 1000);
 		}
 	}
 </script>
 
-<style lang="scss">
+<style lang="less">
+	.timeandtype {
+		// background-color: #F6F6FB;
+		// padding: 20rpx;
+		box-sizing: border-box;
+		width: 90%;
+		margin: 40rpx auto 0;
+		.timebox {
+			box-shadow: 0 0 10rpx #bcb9ca;
+			display: flex;
+			background-color: #fff;
+			padding: 10px;
+			border-top-right-radius: 5px;
+			border-top-left-radius: 5px;
+	
+			.jiange {
+				width: 5%;
+				text-align: center;
+			}
+	
+			.firsttime,
+			.endtime {
+				width: 45%;
+				text-align: center;
+			}
+		}
+	
+		.warntypebox {
+			display: flex;
+			justify-content: space-between;
+			background-color: #fff;
+			padding: 10px;
+			border-top: 1px solid #F6F6FB;
+			border-bottom-right-radius: 5px;
+			border-bottom-left-radius: 5px;
+		}
+	}
 	.shuju_one,
 	.shuju_two {
-		position: absolute;
-		top: 10px;
+		// position: absolute;
+		// top: 100px;
+		// width: 90%;
+		// left: 5%;
 		width: 90%;
-		left: 5%;
+		margin: 40rpx auto;
 		box-shadow: 0 0 10rpx #bcb9ca;
 		padding-top: 20rpx;
 		height: 550rpx;
+
 		.canvastishi {
 			font-size: 32rpx;
 			position: absolute;
@@ -315,6 +382,7 @@
 			left: 50%;
 			margin-left: -64rpx;
 			margin-top: -21rpx;
+
 			.dataloading:after {
 				overflow: hidden;
 				display: inline-block;
@@ -322,12 +390,12 @@
 				animation: ellipsis 2s infinite;
 				content: "\2026";
 			}
-			
+
 			@keyframes ellipsis {
 				from {
 					width: 2px;
 				}
-			
+
 				to {
 					width: 15px;
 				}
@@ -342,7 +410,7 @@
 			.tltle_text {
 				width: 25%;
 				border: 2rpx solid #B2B2B2;
-				color: #B2B2B2;
+				color: #57c878;
 				text-align: center;
 				font-size: 24rpx;
 				height: 50rpx;
@@ -351,8 +419,9 @@
 
 			.title_text_color {
 				width: 25%;
-				border: 2rpx solid #28AE4F;
-				color: #28AE4F;
+				border: 2rpx solid #57c878;
+				background-color: #57c878;
+				color: #fff;
 				text-align: center;
 				font-size: 24rpx;
 				height: 50rpx;
@@ -362,24 +431,23 @@
 	}
 
 	.refresh {
-		position: absolute;
-		top: 630rpx;
-		left: 5%;
+		width: 90%;
+		// margin: 40rpx auto;
+		margin-left: 5%;
 		width: 160rpx;
 		height: 50rpx;
-		background-color: #28AE4F;
+		background-color: #57c878;
 		color: #FFFFFF;
 		line-height: 50rpx;
 		text-align: center;
 	}
 
 	.condition {
-		position: absolute;
-		top: 720rpx;
+		width: 90%;
+		margin: 40rpx auto;
 		display: flex;
 		flex-wrap: wrap;
 		width: 90%;
-		left: 5%;
 		box-shadow: 0 0 10rpx #bcb9ca;
 		margin-bottom: 30rpx;
 
@@ -403,7 +471,6 @@
 					text-align: center;
 					height: 52rpx;
 					line-height: 52rpx;
-					border: 2rpx solid #F1F1F1;
 				}
 
 				.th:first-child,
@@ -411,10 +478,12 @@
 					width: 300rpx;
 				}
 			}
-			.tr:nth-child(2n-1){
+
+			.tr:nth-child(2n-1) {
 				background-color: #f5fff8;
 			}
-			.tr:first-child{
+
+			.tr:first-child {
 				background-color: #57c878;
 				color: #fff;
 			}
@@ -430,7 +499,7 @@
 				line-height: 50rpx;
 				font-size: 26rpx;
 				text-align: center;
-				background-color: #17BB89;
+				background-color: #57c878;
 				color: #FFFFFF;
 			}
 
@@ -443,4 +512,12 @@
 			}
 		}
 	}
+	/deep/.u-calendar__action {
+		display: flex;
+		justify-content: space-around;
+	
+		.u-calendar__action__text {
+			line-height: 25px;
+		}
+	}
 </style>

+ 2 - 2
pages/cb/xy2.0/particulars.vue

@@ -17,7 +17,7 @@
 					<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/environment/7.png'" mode=""></image>
 					<p>一键报修</p>
 				</view>
-				<view class="control_item" @click="toggle">
+				<view class="control_item" @click="toggle"  v-if="$QueryPermission(176)">
 					<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/cb/2.png'" mode=""></image>
 					<p>历史数据</p>
 				</view>
@@ -71,7 +71,7 @@
 					</view>
 				</view>
 			</view>
-			<view class="sim" v-if="simTF">
+			<view class="sim" v-if="simTF && $QueryPermission(246)">
 				<p class="sim_title">sim卡详情</p>
 				<view class="sim_text">
 					<p class="p">ICCID:{{simdata.iccid}}</p>

+ 186 - 0
pages/cbqxyj/addressbook.vue

@@ -0,0 +1,186 @@
+<template>
+	<view>
+		<view class="booxbox">
+			<view class="booxbox_item">
+				<view class="">
+					姓名
+				</view>
+				<view class="booxbox_item_input">
+					<u-input v-model="username" maxlength="15" />
+				</view>
+			</view>
+			<view class="booxbox_item">
+				<view class="">
+					手机号
+				</view>
+				<view class="booxbox_item_input">
+					<u-input v-model="userphone" maxlength="15" />
+				</view>
+			</view>
+			<view class="adduser" @click="add">
+				添加
+			</view>
+		</view>
+		<view class="booxlist">
+			<view class="booxlist_tiele">
+				通讯录
+			</view>
+			<view class="booxlist_item" v-for="item in userlist" :key="item.d_id">
+				<view class="booxlist_item_f">
+					{{item.liaisons}}
+				</view>
+				<view class="booxlist_item_t">
+					{{item.phone}}
+				</view>
+				<view class="booxlist_item_i">
+					<u-icon name="minus-circle" color="#FB4E4E" size="34" @click="del(item.d_id)"></u-icon>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				username:"",
+				userphone:"",
+				userlist:[]
+			}
+		},
+		methods: {
+			async getuserlist(){
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.user_warning_liaisons_list',
+					data: {
+						page: "1",
+						page_size: "99999999"
+					}
+				})
+				console.log(res)
+				this.userlist = res.data
+			},
+			async add(){
+				if (this.username == ""){
+					uni.showToast({
+						title: "请填写姓名",
+						icon: "none"
+					})
+				}else if(this.userphone == ""){
+					uni.showToast({
+						title: "请填写手机号",
+						icon: "none"
+					})
+				}else if(!/^1(1|2|3|4|5|6|7|8|9)\d{9}$/.test(this.userphone)){
+					uni.showToast({
+						title: "请选择正确的手机号格式",
+						icon: "none"
+					})
+				}else{
+					const res = await this.$myRequest({
+						url: '/api/api_gateway?method=device.device_sms_alert.create_user_warning_liaisons',
+						data: {
+							phone: this.userphone,
+							user_name: this.username
+						}
+					})
+					if(res){
+						uni.showToast({
+							title: "创建成功",
+							icon: "none"
+						})
+						this.getuserlist()
+					}
+				}
+			},
+			async del(id){
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.del_user_warning_liaisons',
+					data: {
+						d_id: id
+					}
+				})
+				if(res){
+					uni.showToast({
+						title: "删除成功",
+						icon: "none"
+					})
+					this.getuserlist()
+				}
+			}
+		},
+		onLoad(){
+			this.getuserlist()
+		}
+	}
+</script>
+
+<style lang="less">
+	page {
+		background-color: #F6F6FB;
+	}
+	.booxbox{
+		width: 95%;
+		margin: 20rpx auto;
+		background-color: #fff;
+		padding: 20rpx;
+		box-sizing: border-box;
+		border-radius: 5px;
+		.booxbox_item{
+			display: flex;
+			line-height: 70rpx;
+			justify-content: space-between;
+			border-bottom: 1rpx solid #F2F2F2;
+			padding: 20rpx 0;
+			.booxbox_item_input{
+				width: 70%;
+				/deep/.uni-input-input{
+					text-align: right;
+				}
+			}
+		}
+		.adduser{
+			margin: 30rpx auto 20rpx;
+			width: 80%;
+			background-color: #14A478;
+			padding: 20rpx 0;
+			border-radius: 59px;
+			text-align: center;
+			color: #fff;
+		}
+	}
+	.booxlist{
+		width: 95%;
+		margin: 20rpx auto;
+		background-color: #fff;
+		padding: 20rpx;
+		box-sizing: border-box;
+		border-radius: 5px;
+		.booxlist_tiele{
+			border-left: 8rpx solid #14A478;
+			padding-left: 30rpx;
+			margin-bottom: 30rpx;
+		}
+		.booxlist_item{
+			display: flex;
+			border-top: 1rpx solid #F2F2F2;
+			padding: 30rpx 0;
+			.booxlist_item_f{
+				width: calc(100% - 320rpx);
+				text-align: left;
+				overflow: hidden;//溢出隐藏
+				white-space: nowrap;//禁止换行
+				text-overflow: ellipsis;//...
+			}
+			.booxlist_item_t{
+				width: 270rpx;
+				text-align: left;
+			}
+			.booxlist_item_i{
+				width: 50rpx;
+				text-align: center;
+			}
+		}
+	}
+</style>

+ 50 - 0
pages/cbqxyj/basemap.vue

@@ -0,0 +1,50 @@
+<template>
+	<view class="mapbox">
+		<map class="map" scale="3" :markers="covers" :enable-zoom="true">
+		</map>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				covers:[]
+			}
+		},
+		methods: {
+			async getweizhi(id) {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.user_device_map_location',
+					data: {
+						device_ids:id
+					}
+				})
+				console.log(res)
+				this.covers = []
+				var obj = {
+					latitude:Number(res[0].lat),
+					longitude:Number(res[0].lng),
+					iconPath:"https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/distribution/"+res[0].device_type_id+".png"
+				}
+				this.covers.push(obj)
+			},
+		},
+		onLoad(data) {
+			// console.log(data.device_id)
+			this.getweizhi(data.device_id)
+			
+		}
+	}
+</script>
+
+<style lang="less">
+.mapbox{
+	width: 100%;
+	height: 100vh;
+	.map{
+		width: 100%;
+		height: 100vh;
+	}
+}
+</style>

+ 855 - 0
pages/cbqxyj/cbwarn.vue

@@ -0,0 +1,855 @@
+<template>
+	<view>
+		<view class="cbwtop">
+			<image :src="
+			  'http://www.hnyfwlw.com:8006/bigdata_app/image/cbyj/banner.png'
+			" mode="" class="image">
+			</image>
+			<view class="tab-box">
+				<view v-for="(item, index) in equipArr" :key="index" @click="tabClick(index)"
+					:class="['tab-item', active == index ? 'active' : '']">
+					<text>{{ item }}</text>
+					<text class="bottom-line"></text>
+				</view>
+			</view>
+			<view class="timeandtype" v-if="active==0">
+				<view class="timebox">
+					<view class="firsttime" @click="timeshow=true">
+						{{start_time==""?'请选择开始时间':start_time}}
+					</view>
+					<view class="jiange">
+						-
+					</view>
+					<view class="endtime" @click="timeshow=true">
+						{{end_time==""?'请选择结束时间':end_time}}
+					</view>
+					<view class="jiange" @click="closetime">
+						<u-icon name="close-circle" color="#999999"></u-icon>
+					</view>
+				</view>
+				<view class="warntypebox" @click="recordtypeshow = true">
+					<view class="">
+						{{recordtypename==""?'请选择预警类型':recordtypename}}
+					</view>
+					<u-icon name="arrow-down" color="#999999"></u-icon>
+				</view>
+			</view>
+		</view>
+		<view class="" v-show="active==0">
+			<view class="warmlistbox">
+				<view class="warmlistbox_item" v-for="item in wranlistdata" :key="item.id" @click="singleread(item)">
+					<view class="warmlistbox_item_title" :style="{'border-color':item.status==1?'#14A478':'#fd4646'}">
+						{{recordtypelist[item.warning_type].label}}
+					</view>
+					<view class="warmlistbox_item_text">
+						<view class="item_text_item">
+							<view class="item_text_item_f">
+								设备编号:
+							</view>
+							<view class="item_text_item_e">
+								{{item.device_id}}
+							</view>
+						</view>
+						<view class="item_text_item">
+							<view class="item_text_item_f">
+								设备位置:
+							</view>
+							<view class="item_text_item_e" style="display: flex;">
+								<u-icon name="map-fill" color="#14A478" @click.stop="tomap(item)"></u-icon>
+								<view class="" style="margin-left: 10rpx;color: #14A478;" @click.stop="tomap(item)">
+									查看
+								</view>
+							</view>
+						</view>
+						<view class="item_text_item">
+							<view class="item_text_item_f">
+								设备预警:
+							</view>
+							<view class="item_text_item_e">
+								{{item.warning_content}}
+							</view>
+						</view>
+						<view class="item_text_sta">
+							<view class="" style="color: #959699;">
+								{{item.upltime | timeFormat()}}
+							</view>
+							<view class="" :style="{'margin-left':'10rpx','color':item.status==1?'#959699':'#FD4646'}">
+								{{item.status==1?'已读':'未读'}}
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="warmissuebox" v-show="active == 1">
+			<view class="warmissue">
+				<view class="warmissue_itemone">
+					<view class="">
+						短信剩余条数:
+					</view>
+					<view class="">
+						{{total_sms_counts}}
+					</view>
+				</view>
+				<view class="warmissue_item">
+					<view class="warmissue_item_title">
+						短信内容:
+					</view>
+					<view class="warmissue_item_text">
+						<view class="">
+							尊敬的用户您好,管理员 提醒您,结合近期设备上报的数据,
+						</view>
+						<view class="" style="margin: 20rpx 0 ;">
+							<u-input v-model="wormvalue" type="textarea" :border="true" maxlength="30" />
+						</view>
+						<view class="">
+							请注意防范。
+						</view>
+					</view>
+				</view>
+				<view class="">
+					<view class="warmissue_itemone">
+						<view class="">
+							短信接受人:
+						</view>
+						<view class="" style="color: #14A478;" @click="tobook">
+							预警通讯录编辑
+						</view>
+					</view>
+					<view class="warmissue_itemtwo" @click="accServiceShow = true">
+						<view class="itemtwo_left" v-show="!userphone.length">
+							请选择短信接收人
+						</view>
+						<view class="itemtwo_left" v-show="userphone.length">
+							<view class="" style="margin-right: 20rpx;" v-for="item in userphone" :key="item.value">
+								{{item.name}}
+							</view>
+						</view>
+						<u-icon name="arrow-down" class="icon" color="#999999"></u-icon>
+					</view>
+				</view>
+			</view>
+			<view class="sendbox" @click="send">
+				发送预警
+			</view>
+		</view>
+		<view class="wornsetbox" v-show="active == 2">
+			<view class="" v-for="(item, index) in configlist" :key="item.id" style="margin-bottom: 30rpx;">
+				<u-swipe-action :show="item.show" :index="index" 
+					@click="delconfig(item.id)" :options="options">
+					<view class="wornsetbox_item" @click="toset(item.id)">
+						<view class="">
+							{{item.title}}
+						</view>
+						<view class="" @click.stop>
+							<u-switch v-model="item.statustf" size="40" style="margin-top: 13rpx;"
+								@change="swichchange($event,item.id)"></u-switch>
+						</view>
+					</view>
+				</u-swipe-action>
+			</view>
+		</view>
+		<view class="addwarnlist" v-show="active == 2" @click="addshow = true">
+			添 加
+		</view>
+		<view class="">
+			<u-mask :show="accServiceShow" z-index="998"></u-mask>
+			<u-select v-model="recordtypeshow" :list="recordtypelist" @confirm="confirm"></u-select>
+			<u-calendar v-model="timeshow" :mode="mode" @change="timechange"></u-calendar>
+			<multiple-select v-model="accServiceShow" :value="accServiceShow" :data="serviceList"
+				:default-selected="defaultSelected" @confirm="accServiceConfirm"></multiple-select>
+			<u-modal v-model="modalshow" title="短信预警详情" :content="content" @confirm="singlereadsure"></u-modal>
+			<u-modal v-model="addshow" title="添加预警" :show-cancel-button="true" @confirm="addwarning_config">
+				<view class="addinfobox">
+					<view class="addinfobox_title">
+						<span>*</span>
+						<span>预警名称</span>
+					</view>
+					<u-input v-model="addvalue" maxlength="10" />
+				</view>
+			</u-modal>
+		</view>
+		<view class="top" v-if="active!=1">
+			<view class="backtop" @click="top" v-if="isTop">
+				<image :src="src" mode=""></image>
+			</view>
+			<view class="more" @click="allread" v-show="active==0">
+				<view class="">
+					一键
+				</view>
+				<view class="">
+					已读
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import multipleSelect from "../../components/multiple-select.vue";
+	export default {
+		components: {
+			multipleSelect,
+		},
+		data() {
+			return {
+				date: "",
+				active: 0,
+				equipArr: ["预警记录", "预警发布", "预警设置"],
+				timeshow: false,
+				mode: 'range',
+				start_time: "",
+				end_time: "",
+				recordtypeshow: false,
+				recordtype: "",
+				recordtypename: "",
+				recordtypelist: [{
+						value: "",
+						label: "请选择预警类型",
+					},
+					{
+						value: "1",
+						label: "目标种类预警",
+					},
+					{
+						value: "2",
+						label: "指定害虫数量预警",
+					},
+					{
+						value: "3",
+						label: "害虫数量总和预警",
+					},
+					{
+						value: "4",
+						label: "综合预警",
+					},
+				],
+				wranlistdata: [],
+				listpage: 1,
+				defaultSelected: [], //默认选中项
+				serviceList: [{
+						value: "1",
+						name: "目标种类预警",
+					},
+					{
+						value: "2",
+						name: "指定害虫数量预警",
+					},
+					{
+						value: "3",
+						name: "害虫数量总和预警",
+					},
+					{
+						value: "4",
+						name: "综合预警",
+					},
+				], //传递给子组件的数据
+				accServiceShow: false,
+				wormvalue: "",
+				userphone: [],
+				total_sms_counts: "",
+				isTop: false,
+				src: '../../static/images/1.png',
+				src1: '../../static/images/b0bcdb0e3fe8690520f743aa8303bf2.png',
+				filtrateTF: false,
+				modalshow: false,
+				content: '',
+				warmstatus: {
+
+				},
+				//预警设置
+				configlist: [],
+				addvalue: "",
+				addshow: false,
+				options: [{
+					text: '删除',
+					style: {
+						backgroundColor: '#dd524d'
+					}
+				}],
+				confpage:1
+			}
+		},
+		methods: {
+			tabClick(index) {
+				this.active = index
+				if (index == 0) {
+					this.listpage = 1
+					this.wranlistdata = []
+					this.getwranlistdata()
+				} else if (index == 1) {
+					this.getmessagescounts()
+				} else if (index == 2) {
+					this.confpage = 1
+					this.configlist = []
+					this.getconfiglist()
+				}
+			},
+			timechange(e) {
+				console.log(e)
+				this.start_time = e.startDate
+				this.end_time = e.endDate
+				this.listpage = 1
+				this.wranlistdata = []
+				this.getwranlistdata()
+			},
+			closetime() {
+				this.start_time = ""
+				this.end_time = ""
+				this.listpage = 1
+				this.wranlistdata = []
+				this.getwranlistdata()
+			},
+			confirm(e) {
+				console.log(e)
+				this.recordtypename = e[0].label
+				this.recordtype = e[0].value
+				this.listpage = 1
+				this.wranlistdata = []
+				this.getwranlistdata()
+			},
+			async getwranlistdata() {
+				var end_time = ""
+				var start_time = ""
+				if(this.end_time!=""){
+					end_time = Math.floor(+new Date(this.end_time)/1000)
+				}else{
+					end_time = ""
+				}
+				if(this.start_time!=""){
+					start_time = Math.floor(+new Date(this.start_time)/1000)
+				}else{
+					start_time = ""
+				}
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.user_cbd_pest_warning_record_list',
+					data: {
+						end_time: end_time,
+						page: this.listpage,
+						page_size: "10",
+						start_time: start_time,
+						warning_type: this.recordtype
+					}
+				})
+				console.log(res)
+				this.wranlistdata = this.wranlistdata.concat(res.data)
+			},
+			tomap(data) {
+				uni.navigateTo({
+					url: "./basemap?device_id=" + data.device_id
+				})
+			},
+			accServiceConfirm(e) {
+				console.log(e)
+				this.userphone = e
+			},
+			async getuseriphonelist() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.user_warning_liaisons_list',
+					data: {
+						page: 1,
+						page_size: 9999999,
+					}
+				})
+				console.log(res)
+				this.serviceList = []
+				for (var i = 0; i < res.data.length; i++) {
+					var obj = {
+						value: res.data[i].d_id,
+						name: res.data[i].liaisons + "/" + res.data[i].phone,
+					}
+					this.serviceList.push(obj)
+				}
+			},
+			async getmessagescounts() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.remaining_messages_counts',
+					data: {}
+				})
+				console.log(res)
+				this.total_sms_counts = res.total_sms_counts
+			},
+			async send() {
+				if (this.wormvalue == "") {
+					uni.showToast({
+						title: "请填写短信预警信息",
+						icon: "none"
+					})
+				} else if (this.userphone.length == 0) {
+					uni.showToast({
+						title: "请选择短信接收人",
+						icon: "none"
+					})
+				} else {
+					var list = []
+					for (var i = 0; i < this.userphone.length; i++) {
+						list.push(this.userphone[i].value)
+					}
+					const res = await this.$myRequest({
+						url: '/api/api_gateway?method=device.device_sms_alert.user_pest_warning_release',
+						data: {
+							send_user: list.join(","),
+							content: this.wormvalue,
+							device_type_id: 3
+						}
+					})
+					console.log(res)
+					if (res) {
+						uni.showToast({
+							title: "发送成功",
+							icon: "none"
+						})
+					} else {
+						uni.showToast({
+							title: "发送失败",
+							icon: "none"
+						})
+					}
+				}
+			},
+			tobook() {
+				uni.navigateTo({
+					url: "./addressbook"
+				})
+			},
+			async allread() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.user_cbd_pest_warning_record_read',
+					data: {
+						req: "all",
+					}
+				})
+				if (res) {
+					uni.showToast({
+						title: "已完成一键已读",
+						icon: "none"
+					})
+					this.listpage = 1
+					this.wranlistdata = []
+					this.getwranlistdata()
+				}
+			},
+			singleread(data) {
+				console.log(data)
+				this.modalshow = true
+				this.content = data.warning_content
+				this.warmstatus = data
+			},
+			async singlereadsure() {
+				if (this.warmstatus.status == 0) {
+					const res = await this.$myRequest({
+						url: '/api/api_gateway?method=device.device_sms_alert.user_cbd_pest_warning_record_read',
+						data: {
+							id: this.warmstatus.id,
+						}
+					})
+					if (res) {
+						uni.showToast({
+							title: "此条预警已读",
+							icon: "none"
+						})
+						this.listpage = 1
+						this.wranlistdata = []
+						this.getwranlistdata()
+					}
+				}
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500,
+				});
+			},
+			async getconfiglist() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.user_warning_config_list',
+					data: {
+						device_type_id: "3",
+						page: this.confpage,
+						page_size: "10",
+					}
+				})
+				console.log(res.data)
+
+				for (var i = 0; i < res.data.length; i++) {
+					res.data[i]["statustf"] = res.data[i].status == 1 ? true : false
+				}
+				this.configlist = this.configlist.concat(res.data)
+				console.log(this.configlist)
+			},
+			async swichchange(e, id) {
+				// console.log(e, id)
+				// console.log(this.configlist)
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.modify_user_warning_config_status',
+					data: {
+						id: id,
+						status: e ? 1 : 0,
+					}
+				})
+				if (res) {
+					uni.showToast({
+						title: "状态修改成功",
+						icon: "none"
+					})
+				}
+				this.configlist = []
+				this.confpage = 1
+				this.getconfiglist()
+			},
+			toset(id) {
+				console.log(id)
+				uni.navigateTo({
+					url: "./warnset?id=" + id
+				})
+			},
+			async addwarning_config() {
+				this.addshow = true
+				if (this.addvalue == "") {
+					uni.showToast({
+						title: "请填写预警名称",
+						icon: "none"
+					})
+				}else{
+					const res = await this.$myRequest({
+						url: '/api/api_gateway?method=device.device_sms_alert.create_user_warning_config',
+						data: {
+							title: this.addvalue,
+							device_type_id: 3
+						}
+					})
+					console.log(res)
+					if(res){
+						this.addshow = false
+						this.configlist = []
+						this.confpage = 1
+						this.getconfiglist()
+					}
+				}
+			},
+			async delconfig(id){
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.del_user_warning_config_status',
+					data: {
+						id:id
+					}
+				})
+				console.log(res)
+				if (res) {
+					this.configlist = []
+					this.confpage = 1
+					this.getconfiglist()
+				}
+			}
+		},
+		onLoad() {
+			this.getwranlistdata()
+			// this.getmessagescounts()
+			// this.getconfiglist()
+		},
+		onShow() {
+			this.getuseriphonelist()
+		},
+		onReachBottom() {
+			if (this.active == 0) {
+				this.listpage++
+				this.getwranlistdata()
+			} else if (this.active == 2) {
+				this.confpage++
+				this.getconfiglist()
+			}
+		},
+		onPageScroll(e) {
+			//nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) {
+				//距离大于200时显示
+				this.isTop = true;
+			} else {
+				//距离小于200时隐藏
+				this.isTop = false;
+			}
+		},
+	}
+</script>
+
+<style lang="less">
+	page {
+		background-color: #F6F6FB;
+	}
+
+	.cbwtop {
+		position: fixed;
+		top: 0px;
+		width: 100%;
+		z-index: 555;
+		background-color: #fff;
+
+		.image {
+			width: 100%;
+			height: 160rpx;
+		}
+
+		.tab-box {
+			font-size: 30rpx;
+			line-height: 80rpx;
+			background-color: #ffffff;
+			width: 100%;
+			overflow: hidden;
+			overflow-x: scroll;
+			white-space: nowrap;
+
+			.tab-item {
+				cursor: pointer;
+				position: relative;
+				width: 25%;
+				text-align: center;
+				display: inline-block;
+			}
+
+			.tab-item.active {
+				.bottom-line {
+					bottom: 0;
+					position: absolute;
+					display: inline-block;
+					width: 90rpx;
+					height: 6rpx;
+					left: 0;
+					right: 0;
+					margin: auto;
+					background: #57C878;
+				}
+			}
+		}
+
+		.timeandtype {
+			background-color: #F6F6FB;
+			padding: 20rpx;
+			box-sizing: border-box;
+
+			.timebox {
+				display: flex;
+				background-color: #fff;
+				padding: 10px;
+				border-top-right-radius: 5px;
+				border-top-left-radius: 5px;
+
+				.jiange {
+					width: 5%;
+					text-align: center;
+				}
+
+				.firsttime,
+				.endtime {
+					width: 45%;
+					text-align: center;
+				}
+			}
+
+			.warntypebox {
+				display: flex;
+				justify-content: space-between;
+				background-color: #fff;
+				padding: 10px;
+				border-top: 1px solid #F6F6FB;
+				border-bottom-right-radius: 5px;
+				border-bottom-left-radius: 5px;
+			}
+		}
+	}
+
+	.warmlistbox {
+		width: 95%;
+		margin: 0 auto;
+		padding-top: 450rpx;
+
+		.warmlistbox_item {
+			padding: 20rpx 0;
+			box-sizing: border-box;
+			background-color: #fff;
+			border-radius: 10rpx;
+			margin-bottom: 20rpx;
+
+			.warmlistbox_item_title {
+				border-left: 8rpx solid #14A478;
+				padding-left: 30rpx;
+			}
+
+			.warmlistbox_item_text {
+				width: 90%;
+				margin: 0 auto;
+				margin-top: 20rpx;
+				border-top: 1px solid #F2F2F2;
+				padding: 20rpx 0;
+
+				.item_text_item {
+					margin-bottom: 7px;
+					display: flex;
+
+					.item_text_item_f {
+						width: 140rpx;
+					}
+
+					.item_text_item_e {
+						width: calc(100% - 140rpx);
+						display: -webkit-box; //谷歌
+						-webkit-box-orient: vertical;
+						-webkit-line-clamp: 4; //显示几行
+						overflow: hidden;
+					}
+				}
+
+				.item_text_sta {
+					display: flex;
+					justify-content: flex-end;
+				}
+			}
+		}
+	}
+
+	.warmissuebox {
+		width: 95%;
+		margin: 0 auto;
+		padding-top: 270rpx;
+
+		.warmissue {
+			width: 95%;
+			margin: 0 auto;
+			padding: 20rpx;
+			background-color: #fff;
+			border-radius: 5px;
+
+			.warmissue_itemone {
+				margin-bottom: 60rpx;
+				display: flex;
+				justify-content: space-between;
+			}
+
+			.warmissue_item {
+				margin-bottom: 60rpx;
+				display: flex;
+
+				.warmissue_item_title {
+					width: 160rpx;
+				}
+
+				.warmissue_item_text {
+					width: calc(100% - 160rpx);
+				}
+			}
+
+			.warmissue_itemtwo {
+				display: flex;
+
+				.itemtwo_left {
+					width: calc(100% - 40rpx);
+					display: flex;
+					flex-wrap: wrap;
+				}
+
+				.icon {
+					width: 40rpx;
+				}
+			}
+		}
+
+		.sendbox {
+			margin: 40rpx auto;
+			width: 80%;
+			background-color: #14A478;
+			padding: 20rpx 0;
+			border-radius: 59px;
+			text-align: center;
+			color: #fff;
+		}
+	}
+
+	.wornsetbox {
+		width: 95%;
+		margin: 0 auto;
+		padding-top: 270rpx;
+
+		.wornsetbox_item {
+			padding: 30rpx 20rpx;
+			background-color: #fff;
+			width: 100%;
+			display: flex;
+			justify-content: space-between;
+			box-sizing: border-box;
+			line-height: 64rpx;
+			height: 124rpx;
+		}
+
+	}
+
+	.addwarnlist {
+		position: fixed;
+		bottom: 20rpx;
+		left: 10%;
+		margin: 40rpx auto;
+		width: 80%;
+		background-color: #14A478;
+		padding: 20rpx 0;
+		border-radius: 59px;
+		text-align: center;
+		color: #fff;
+	}
+
+	.addinfobox {
+		display: flex;
+		margin: 30rpx 0;
+
+		.addinfobox_title {
+			line-height: 70rpx;
+			width: 30%;
+			text-align: center;
+
+			span:first-child {
+				color: red;
+			}
+		}
+
+		/deep/.u-input__right-icon {
+			line-height: 35px;
+		}
+	}
+
+	/deep/.u-calendar__action {
+		display: flex;
+		justify-content: space-around;
+
+		.u-calendar__action__text {
+			line-height: 25px;
+		}
+	}
+
+	.top {
+		position: fixed;
+		right: 10px;
+		bottom: 40px;
+		z-index: 100;
+
+		image {
+			width: 100rpx;
+			height: 100rpx;
+		}
+
+		.backtop {
+			display: flex;
+			justify-content: flex-end;
+			margin-bottom: 10rpx;
+		}
+
+		.more {
+			width: 100rpx;
+			height: 100rpx;
+			background-color: rgba(161, 161, 161, 0.45);
+			border-radius: 50%;
+			text-align: center;
+			padding-top: 10rpx;
+			line-height: 40rpx;
+			box-sizing: border-box;
+			margin: 14rpx 0 0 0;
+			color: #fff;
+		}
+	}
+</style>

+ 633 - 0
pages/cbqxyj/warnset.vue

@@ -0,0 +1,633 @@
+<template>
+	<view style="padding-bottom: 30rpx;">
+		<view class="basesel">
+			<view class="basesel_list">
+				<view class="basesel_list_tilte">
+					预警设备选择:
+				</view>
+				<view class="basesel_list_sel" @click="accServiceShow = true">
+					<view class="basesel_list_sel_left" v-if="selbaselist.length==0">
+						请选择预警设备
+					</view>
+					<view class="basesel_list_sel_left" v-if="selbaselist.length!=0">
+						<view class="" style="margin-right: 20rpx;" v-for="item in selbaselist" :key="item">
+							{{item}}
+						</view>
+					</view>
+					<u-icon name="arrow-down" class="icon" color="#999999"></u-icon>
+				</view>
+			</view>
+			<view class="basesel_calculate">
+				<view class="" style="line-height: 27px;">
+					预警计算:
+				</view>
+				<u-radio-group v-model="warnjihe">
+					<u-radio name="0">
+						逐台预警
+					</u-radio>
+					<u-radio name="1" :disabled="disabled">
+						合并预警
+					</u-radio>
+				</u-radio-group>
+			</view>
+		</view>
+		<view class="target">
+			<view class="target_title">
+				<view class="target_title_left">
+					<view class="target_title_left_title">
+						目标种类预警
+					</view>
+					<view class="">
+						每天害虫 种类数量达到此值时,短信预警
+					</view>
+				</view>
+				<view class="target_title_right">
+					<u-switch v-model="conf.pestCategory" size="40"></u-switch>
+				</view>
+			</view>
+			<view class="">
+				<view class="">
+					害虫种类预警
+				</view>
+				<view class="">
+					<u-input v-model="conf.pestCategoryNum" type="number" />
+				</view>
+			</view>
+		</view>
+		<view class="target">
+			<view class="target_title">
+				<view class="target_title_left">
+					<view class="target_title_left_title">
+						数量预警
+					</view>
+					<view class="">
+						每天害虫 指定害虫数达到此值时,短信预警
+					</view>
+				</view>
+				<view class="target_title_right">
+					<u-switch v-model="conf.appointPest" size="40"></u-switch>
+				</view>
+			</view>
+			<view class="target_text">
+				<view class="">
+					指定害虫数量预警
+				</view>
+				<view class="target_text_item" v-for="item,index in confnum" :key="index">
+					<view class="target_text_item_sel" @click="selwormindex = index;wormshow=true">
+						<view class="itemtwo_left" v-if="item.appointPestName==''">
+							请选择害虫
+						</view>
+						<view class="itemtwo_left" v-if="item.appointPestName!=''">
+							{{item.appointPestName}}
+						</view>
+						<u-icon name="arrow-down" class="icon" color="#999999"></u-icon>
+					</view>
+					<view class="target_text_item_ipt">
+						<u-input v-model="item.appointPestNum" type="number" />
+					</view>
+					<u-icon name="plus-circle" class="icon addordel" color="#14a478" size="45" @click="addconfitem"
+						v-show="index==0"></u-icon>
+					<u-icon name="trash" class="icon addordel" color="#ff4949" size="45" @click="delconfitem(index)"
+						v-show="index!=0"></u-icon>
+				</view>
+			</view>
+		</view>
+		<view class="target">
+			<view class="target_title">
+				<view class="target_title_left">
+					<view class="target_title_left_title">
+						总数预警
+					</view>
+					<view class="">
+						每天害虫总数数量达到此值时,短信预警
+					</view>
+				</view>
+				<view class="target_title_right">
+					<u-switch v-model="conf.pestTotal" size="40"></u-switch>
+				</view>
+			</view>
+			<view class="">
+				<view class="">
+					害虫种类预警
+				</view>
+				<view class="">
+					<u-input v-model="conf.pestTotalNum" type="number" />
+				</view>
+			</view>
+		</view>
+		<view class="target">
+			<view class="target_title">
+				<view class="target_title_left">
+					<view class="target_title_left_title">
+						综合预警
+					</view>
+					<view class="">
+						监测每天出现的害虫种类及数量,短信预警
+					</view>
+				</view>
+				<view class="target_title_right">
+					<u-switch v-model="conf.pestWarn" size="40"></u-switch>
+				</view>
+			</view>
+		</view>
+		<view class="usersel">
+			<view class="warmissue_itemone">
+				<view class="warmissue_itemone_title">
+					短信接受人:
+				</view>
+				<view class="" style="color: #14A478;" @click="tobook">
+					预警通讯录编辑
+				</view>
+			</view>
+			<view class="warmissue_itemtwo" @click="accServiceShowphone = true">
+				<view class="itemtwo_left" v-if="!userphone.length">
+					请选择短信接收人
+				</view>
+				<view class="itemtwo_left" v-if="userphone.length">
+					<view class="" style="margin-right: 20rpx;" v-for="item in userphone" :key="item">
+						{{item}}
+					</view>
+				</view>
+				<u-icon name="arrow-down" class="icon" color="#999999"></u-icon>
+			</view>
+		</view>
+		<view class="sendbox" @click="send">
+			保存预警设置
+		</view>
+		<view class="">
+			<u-mask :show="accServiceShow || accServiceShowphone" z-index="998"></u-mask>
+			<u-select v-model="wormshow" :list="wormlist" @confirm="selconfirm"></u-select>
+			<multiple-select v-model="accServiceShow" :value="accServiceShow" :data="serviceList"
+				:default-selected="defaultSelected" @confirm="accServiceConfirm"></multiple-select>
+			<multiple-select v-model="accServiceShowphone" :value="accServiceShowphone" :data="serviceListphone"
+				:default-selected="defaultSelectedphone" @confirm="accServiceConfirmphone"></multiple-select>
+		</view>
+	</view>
+</template>
+
+<script>
+	import multipleSelect from "../../components/multiple-select.vue";
+	import dict from "../../static/data/cbd_pest_library.js"
+	export default {
+		components: {
+			multipleSelect,
+		},
+		data() {
+			return {
+				warning_id: "",
+				selbaselist: [],
+				// disabled:false,
+				warnjihe: "0",
+				accServiceShow: false,
+				serviceList: [],
+				defaultSelected: [],
+				userphone: [],
+				accServiceShowphone: false,
+				serviceListphone: [],
+				defaultSelectedphone: [],
+				//预警配置
+				conf: {
+					pestCategory: false,
+					pestCategoryNum: "",
+					appointPest: false,
+					pestTotalNum: "",
+					pestTotal: false,
+					pestWarn: false
+				},
+				confnum: [{
+					appointPestName: "",
+					appointPestNum: "",
+					appointPestNameid: ""
+				}],
+				device_ids: [],
+				send_user: [],
+				wormshow: false,
+				wormlist: [],
+				selwormindex: 0
+			}
+		},
+		computed: {
+			disabled(){
+				return this.selbaselist.length<=1?true:false
+			}
+		},
+		methods: {
+			accServiceConfirm(e) {
+				this.selbaselist = []
+				this.device_ids = []
+				for (var i = 0; i < e.length; i++) {
+					this.selbaselist.push(e[i].name)
+					this.device_ids.push(e[i].value)
+				}
+				console.log(e)
+			},
+			accServiceConfirmphone(e) {
+				this.userphone = []
+				this.send_user = []
+				for (var i = 0; i < e.length; i++) {
+					this.userphone.push(e[i].name)
+					this.send_user.push(e[i].value)
+				}
+			},
+			async getpeizhi(id) {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.user_pest_warning_statsu',
+					data: {
+						warning_id: id
+					}
+				})
+				console.log(res)
+				this.confnum = []
+				this.conf.pestCategory = res.conf.pestCategory == "on" ? true : false
+				this.conf.appointPest = res.conf.appointPest == "on" ? true : false
+				this.conf.pestTotal = res.conf.pestTotal == "on" ? true : false
+				this.conf.pestWarn = res.conf.pestWarn == "on" ? true : false
+
+				this.conf.pestCategoryNum = res.conf.pestCategoryNum
+				this.conf.pestTotalNum = res.conf.pestTotalNum
+
+				for (var key in res.device_ids) {
+					this.selbaselist.push(res.device_ids[key]);
+					this.defaultSelected.push(Number(key));
+					this.device_ids.push(Number(key));
+				}
+				console.log(this.defaultSelected)
+				for (var key in res.send_user) {
+					this.userphone.push(res.send_user[key][0] + "/" + res.send_user[key][1]);
+					this.defaultSelectedphone.push(Number(key))
+					this.send_user.push(Number(key));
+				}
+				var flag = 0
+				for (var key in res.conf) {
+					if (key.indexOf("appointPestName") != -1) {
+						flag++
+					}
+				}
+				for (var i = 0; i < flag; i++) {
+					// console.log(i)
+					if (i == 0) {
+						var obj = {
+							appointPestName: dict[Number(res.conf["appointPestName"])],
+							appointPestNum: res.conf["appointPestNum"],
+							appointPestNameid: res.conf["appointPestName"]
+						};
+					} else {
+						var obj = {
+							appointPestName: dict[Number(res.conf["appointPestName" + i])],
+							appointPestNum: res.conf["appointPestNum" + i],
+							appointPestNameid: res.conf["appointPestName" + i]
+						};
+					}
+					this.confnum.push(obj);
+				}
+			},
+			async getbaselist() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.user_warning_device_list',
+					data: {
+						device_type_id: "3",
+						page: "1",
+						page_size: "999999999"
+					}
+				})
+				// console.log(res.data)
+				for (var i = 0; i < res.data.length; i++) {
+					var obj = {
+						value: res.data[i].d_id,
+						name: res.data[i].device_id,
+					}
+					this.serviceList.push(obj)
+				}
+			},
+			async getuseriphonelist() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.user_warning_liaisons_list',
+					data: {
+						page: 1,
+						page_size: 9999999,
+					}
+				})
+				// console.log(res)
+				this.serviceListphone = []
+				for (var i = 0; i < res.data.length; i++) {
+					var obj = {
+						value: res.data[i].d_id,
+						name: res.data[i].liaisons + "/" + res.data[i].phone,
+					}
+					this.serviceListphone.push(obj)
+				}
+			},
+			tobook() {
+				uni.navigateTo({
+					url: "./addressbook"
+				})
+			},
+			selconfirm(e) {
+				console.log(e, this.selwormindex)
+				this.confnum[this.selwormindex].appointPestName = e[0].label
+				this.confnum[this.selwormindex].appointPestNameid = e[0].value
+			},
+			addconfitem() {
+				for (var i = 0; i < this.confnum.length; i++) {
+					if (this.confnum[i].appointPestName == "" ||
+						this.confnum[i].appointPestNum == "") {
+						uni.showToast({
+							title: "请先将信息填写完成后添加",
+							icon: "none"
+						})
+						return
+					}
+				}
+				var obj = {
+					appointPestName: "",
+					appointPestNum: "",
+				}
+				this.confnum.push(obj)
+			},
+			delconfitem(index) {
+				this.confnum.splice(index, 1)
+			},
+			yanzheng() {
+				for (var i = 0; i < this.confnum.length; i++) {
+					if (this.confnum[i].appointPestName == "" || this.confnum[i].appointPestNum == "") {
+						return true
+					}
+				}
+				return false
+			},
+			async send() {
+				if (this.selbaselist.length == 0) {
+					uni.showToast({
+						title: "请选择预警设备",
+						icon: "none"
+					})
+				} else if (this.conf.pestCategory == false &&
+					this.conf.appointPest == false &&
+					this.conf.pestTotal == false &&
+					this.conf.pestWarn == false) {
+					uni.showToast({
+						title: "请开启至少一种预警",
+						icon: "none"
+					})
+				} else if (this.conf.pestCategory && this.conf.pestCategoryNum == "") {
+					uni.showToast({
+						title: "请将目标种类预警信息填写完整",
+						icon: "none"
+					})
+				} else if (this.conf.appointPest && this.yanzheng()) {
+					uni.showToast({
+						title: "请将数量预警信息填写完整",
+						icon: "none"
+					})
+				} else if (this.conf.pestTotal && this.conf.pestTotalNum == "") {
+					uni.showToast({
+						title: "请将总数预警信息填写完整",
+						icon: "none"
+					})
+				} else if (this.userphone.length == 0) {
+					uni.showToast({
+						title: "请选择短信接收人",
+						icon: "none"
+					})
+				} else {
+					console.log(this.device_ids)
+					console.log(this.send_user)
+					var obj = {
+
+					}
+					// console.log(this.confnum)
+					for (var i = 0; i < this.confnum.length; i++) {
+						if (i == 0) {
+							obj['appointPestName'] = this.confnum[i].appointPestNameid
+							obj['appointPestNum'] = this.confnum[i].appointPestNum
+						} else {
+							obj['appointPestName' + i] = this.confnum[i].appointPestNameid
+							obj['appointPestNum' + i] = this.confnum[i].appointPestNum
+						}
+					}
+					for (var key in this.conf) {
+						if (key == "pestCategory" ||
+							key == "appointPest" ||
+							key == "pestTotal" ||
+							key == "pestWarn") {
+							obj[key] = this.conf[key] ? "on" : "off"
+						} else {
+							obj[key] = this.conf[key]
+						}
+					}
+					console.log(obj)
+					const res = await this.$myRequest({
+						url: '/api/api_gateway?method=device.device_sms_alert.create_user_pest_warning',
+						data: {
+							conf: JSON.stringify(obj),
+							device_ids: this.device_ids.join(","),
+							send_user: this.send_user.join(","),
+							warning_id: this.warning_id,
+							warning_type: this.warnjihe
+						}
+					})
+					console.log(res)
+					uni.showToast({
+						title: "预警配置成功",
+						icon: "none"
+					})
+					uni.navigateBack({
+						delta: 1
+					})
+				}
+			}
+		},
+		onLoad(option) {
+			// console.log(dict)
+			this.wormlist = []
+			for (var key in dict) {
+				var obj = {
+					value: key,
+					label: dict[key]
+				}
+				this.wormlist.push(obj)
+			}
+			this.getbaselist()
+			this.getuseriphonelist()
+			this.getpeizhi(option.id)
+			this.warning_id = option.id
+		}
+	}
+</script>
+
+<style lang="less">
+	page {
+		background-color: #F6F6FB;
+	}
+
+	.basesel {
+		width: 95%;
+		margin: 20rpx auto;
+		padding: 30rpx 20rpx;
+		box-sizing: border-box;
+		background-color: #fff;
+		border-radius: 10rpx;
+
+		.basesel_list {
+			width: 100%;
+
+			.basesel_list_tilte {
+				margin-bottom: 60rpx;
+				font-size: 32rpx;
+			}
+
+			.basesel_list_sel {
+				display: flex;
+				margin-bottom: 60rpx;
+
+				.basesel_list_sel_left {
+					width: calc(100% - 40rpx);
+					display: flex;
+					flex-wrap: wrap;
+					color: #999999;
+				}
+
+				.icon {
+					width: 40rpx;
+				}
+			}
+		}
+
+		.basesel_calculate {
+			margin-top: 30rpx;
+			display: flex;
+		}
+
+	}
+
+	.usersel {
+		width: 95%;
+		margin: 20rpx auto;
+		padding: 30rpx 20rpx;
+		box-sizing: border-box;
+		background-color: #fff;
+		border-radius: 10rpx;
+
+		.warmissue_itemone {
+			margin-bottom: 60rpx;
+			display: flex;
+			justify-content: space-between;
+
+			.warmissue_itemone_title {
+				font-size: 32rpx;
+			}
+		}
+
+		.warmissue_item {
+			margin-bottom: 60rpx;
+			display: flex;
+
+			.warmissue_item_title {
+				width: 160rpx;
+			}
+
+			.warmissue_item_text {
+				width: calc(100% - 160rpx);
+			}
+		}
+
+		.warmissue_itemtwo {
+			display: flex;
+
+			.itemtwo_left {
+				width: calc(100% - 40rpx);
+				display: flex;
+				flex-wrap: wrap;
+				color: #999999;
+			}
+
+			.icon {
+				width: 40rpx;
+			}
+		}
+	}
+
+	.target {
+		width: 95%;
+		margin: 20rpx auto;
+		padding: 30rpx 20rpx;
+		box-sizing: border-box;
+		background-color: #fff;
+		border-radius: 10rpx;
+
+		.target_title {
+			margin-bottom: 40rpx;
+			display: flex;
+			justify-content: space-between;
+
+			.target_title_left {
+				font-size: 24rpx;
+				color: #999999;
+
+				.target_title_left_title {
+					font-size: 32rpx;
+					color: #2F2F30;
+				}
+			}
+		}
+
+		.target_text {
+			width: 100%;
+
+			.target_text_item {
+				width: 100%;
+				margin-top: 30rpx;
+				display: flex;
+				justify-content: space-between;
+
+				.target_text_item_sel {
+					width: 40%;
+					display: flex;
+					justify-content: space-between;
+					line-height: 70rpx;
+					height: 70rpx;
+					border-bottom: 1px solid #aaaaad;
+
+					.itemtwo_left {
+						color: #999999;
+					}
+				}
+
+				.target_text_item_ipt {
+					width: 40%;
+
+					/deep/.u-input__right-icon {
+						line-height: 35px;
+					}
+
+					/deep/.uni-input-input {
+						border-bottom: 1px solid #aaaaad;
+					}
+
+					/deep/.u-input__input {
+						border-bottom: 1px solid #aaaaad;
+					}
+				}
+
+				.addordel {
+					width: 10%;
+					line-height: 35px;
+				}
+			}
+		}
+
+		/deep/.uni-input-input {
+			border-bottom: 1px solid #aaaaad;
+		}
+	}
+
+	.sendbox {
+		margin: 40rpx auto;
+		width: 80%;
+		background-color: #14A478;
+		padding: 20rpx 0;
+		border-radius: 59px;
+		text-align: center;
+		color: #fff;
+	}
+</style>

+ 47 - 83
pages/disease/cmb.vue

@@ -31,7 +31,7 @@
 					<p>预测结果</p>
 				</view>
 			</view>
-			<view class="his_box">
+			<view class="his_box" v-if="datatf">
 				<view class="selecttimes" @click="tiemshow = !tiemshow">
 					<view class="timesbox">
 						<image
@@ -106,12 +106,12 @@
 							</tr>
 						</table>
 					</scroll-view>
-				</view>
-				<view class="pagenumber">
-					<button @click="prev">上一页</button>
-					<view class="pagenumber_page"> 第 {{ page }} 页 </view>
-					<view class="pagenumber_page"> 共 {{ pagesum }} 页 </view>
-					<button @click="next">下一页</button>
+					<view class="pagenumber">
+						<button @click="prev">上一页</button>
+						<view class="pagenumber_page"> 第 {{ page }} 页 </view>
+						<view class="pagenumber_page"> 共 {{ pagesum }} 页 </view>
+						<button @click="next">下一页</button>
+					</view>
 				</view>
 			</view>
 		</view>
@@ -125,7 +125,9 @@
 	export default {
 		data() {
 			return {
+				basetype: "",
 				kongtf: false,
+				datatf: false,
 				eqinfo: {},
 				city: "河南省",
 				tiemshow: false, //时间筛选弹框
@@ -269,10 +271,8 @@
 				if (this.pagesum > 0) {
 					var dat = res.sta;
 					this.historylistdata = [];
-
 					for (var i = 0; i < dat.length; i++) {
-						// var item = eval("(" + dat[i] + ")");
-						var item = this.evals(dat[i])
+						var item = eval("(" + dat[i] + ")");
 						var obj = {};
 						for (var i1 in item) {
 							// if (i1 == "uploadTime") {
@@ -306,11 +306,8 @@
 					var time = [];
 					var xtitle = [];
 					for (var i = 0; i < dat.length; i++) {
-						// console.log(typeof dat[i])
-						
-						// var item = eval("(" + dat[i] + ")");
-						var item = this.evals(dat[i])
-						var tim = parseInt(item["uploadTime"]) * 1000 - 8 * 3600000;
+						var item = eval("(" + dat[i] + ")");
+						var tim = parseInt(item["uploadTime"]) * 1000;
 						var times = new Date(tim);
 						xtitle.unshift(
 							times.getMonth() +
@@ -490,26 +487,10 @@
 					},
 				});
 			},
-			evals(e) {//替换eval
-				var str = e.slice(1, e.length - 1)
-				// str = e.splice(-1,1)
-				var arr = str.split(", ")
-				// console.log(arr)
-				for (var i = 0; i < arr.length; i++) {
-					arr[i] = arr[i].split(":")
-				}
-				var obj = {}
-				for (var i = 0; i < arr.length; i++) {
-					var str = arr[i][0].slice(1, arr[i][0].length - 1)
-					// console.log(str)
-					obj[str] = arr[i][1]
-				}
-				// console.log(obj)
-				return obj
-			}
 		},
 		onLoad(option) {
 			this.eqinfo = JSON.parse(option.shebei);
+			this.basetype = option.type
 			console.log(this.eqinfo);
 			this.cWidth = uni.upx2px(650);
 			this.cHeight = uni.upx2px(500);
@@ -518,31 +499,16 @@
 			this.begintime = parseInt(this.end - 24 * 60 * 60);
 			this.histprydatas();
 			this.getChartLine();
-			uni.getStorage({
-				key: "jurisdiction",
-				success: (res) => {
-					let items = JSON.parse(res.data).filter((item) => {
-						return item.purview_name == "环境监测系统";
-					});
-					let items2 = items[0].children.filter((item) => {
-						return item.purview_name == "环境监测";
-					});
-					var arr = items2[0].children;
-					for (var i = 0; i < arr.length; i++) {
-						switch (arr[i].purview_name) {
-							case "设备控制":
-								this.kongtf = true;
-								break;
-							case "24小时数据":
-								this.daydatatf = true;
-								break;
-							case "历史数据":
-								this.shujutf = true;
-								break;
-						}
-					}
-				},
-			});
+			if (this.basetype == 11) {
+				this.kongtf = this.$QueryPermission(251)
+				this.datatf = this.$QueryPermission(221)
+			} else if (this.basetype == 19) {
+				this.kongtf = this.$QueryPermission(252)
+				this.datatf = this.$QueryPermission(222)
+			} else if (this.basetype == 20) {
+				this.kongtf = this.$QueryPermission(253)
+				this.datatf = this.$QueryPermission(223)
+			}
 		},
 	};
 </script>
@@ -692,11 +658,9 @@
 		width: 90%;
 		box-shadow: 0 0 10rpx #bcb9ca;
 		margin: 0 auto 30rpx;
-		overflow-x: auto;
-		padding: 0 20rpx;
-		box-sizing: border-box;
+
 		.scroll-X {
-			width: 6000px;
+			width: 95%;
 			margin: 20rpx auto;
 
 			.tr {
@@ -724,28 +688,28 @@
 				color: #fff;
 			}
 		}
-	}
-	.pagenumber {
-		display: flex;
-		margin: 20rpx auto;
-		padding-bottom: 30rpx;
-	
-		button {
-			width: 150rpx;
-			height: 50rpx;
-			line-height: 50rpx;
-			font-size: 26rpx;
-			text-align: center;
-			background-color: #57c878;
-			color: #ffffff;
-		}
-	
-		.pagenumber_page {
-			width: 100rpx;
-			height: 50rpx;
-			line-height: 50rpx;
-			font-size: 26rpx;
-			text-align: center;
+
+		.pagenumber {
+			display: flex;
+			margin: 20rpx auto;
+
+			button {
+				width: 150rpx;
+				height: 50rpx;
+				line-height: 50rpx;
+				font-size: 26rpx;
+				text-align: center;
+				background-color: #57c878;
+				color: #ffffff;
+			}
+
+			.pagenumber_page {
+				width: 100rpx;
+				height: 50rpx;
+				line-height: 50rpx;
+				font-size: 26rpx;
+				text-align: center;
+			}
 		}
 	}
 </style>

+ 7 - 24
pages/distribution/index.vue

@@ -46,37 +46,30 @@
 					// },
 					{
 						id: 2, //杀虫灯
-						url: "../../static/images/distribution/1bd535eb7dbb0809940030d40c64b4c.png",
 						name: "杀虫灯"
 					},
 					{
 						id: 3, //测报灯
-						url: "../../static/images/distribution/0b551e50be351dbc14f0dd6470e3443.png",
 						name: "测报灯"
 					},
 					{
 						id: 4, //性诱测报
-						url: "../../static/images/distribution/be5c1cfed22713a9544f020cf41c25f.png",
 						name: "性诱测报"
 					},
 					{
 						id: 5, //环境检测
-						url: "../../static/images/distribution/8325b1b6079456ce43f952ce13d2919.png",
 						name: "环境监测"
 					},
 					{
 						id: 6, //监控设备
-						url: "../../static/images/distribution/2eb9e550709430a1bd8178568c14785.png",
 						name: "监控设备"
 					},
 					{
 						id: 7, //孢子仪
-						url: "../../static/images/distribution/54a96e2b0ad4efeecbd4a7b5e6deda3.png",
 						name: "孢子仪",
 					},
 					{
 						id: 10, //性诱2.0
-						url: "../../static/images/distribution/515ea6143e0aaff4a823270c7aa00a6.png",
 						name: "性诱2.0"
 					},
 				],
@@ -103,7 +96,7 @@
 		methods: {
 			async history() { //获取分布位置
 				const res = await this.$myRequest({
-					url: '/api/api_gateway?method=home.homes.equip_map_location',
+					url: '/api/api_gateway?method=home.homes.equip_map_location_list',
 					data: {
 						equip_type: this.type,
 						device_id: this.device_id
@@ -118,17 +111,11 @@
 							var obj = {}
 							obj.latitude = Number(res[i].lat)
 							obj.longitude = Number(res[i].lng)
-							obj.id = parseInt(i)
-							obj.title = res[i].device_name || res[i].device_id
+							obj.id = i
+							obj.title = res[i].device_id
 							obj.width = 30
 							obj.height = 30
 							obj.joinCluster = true
-							// for (var j = 0; j < this.icon.length; j++) {
-							// 	if (res[i].device_type_id == this.icon[j].id) {
-							// 		obj.iconPath = this.icon[j].url
-							// 	}
-							// }
-							// this.covers.push(obj)
 							arr.push(obj)
 						// }
 					}
@@ -149,14 +136,10 @@
 				})
 
 				for (var i = 0; i < res.length; i++) {
-					if (res[i].id == 8  ||
-					   res[i].id == 12  ||
-					   res[i].id == 14  ||
-					   res[i].id == 11  ||
-					   res[i].id == 13  ||
-					   res[i].id == 16  ||
-					   res[i].id == 17  ||
-					   res[i].id == 18
+					if (res[i].id == 8 ||
+					   res[i].id == 12 ||
+					   res[i].id == 14 ||
+					   res[i].id == 16 
 					) {
 						continue;
 					}

+ 1 - 1
pages/environment/contros.vue

@@ -30,7 +30,7 @@
 				<view class="timing">
 					<p class="operation_title">上传时间间隔(min)</p>
 					<view class="timing_text">
-						<slider value="1" v-model="config.interval" @change="sliderChange" step="1" min="1" max="360" show-value block-size="18" activeColor="#57C878" />
+						<slider value="0" v-model="config.interval" @change="sliderChange" step="1" min="0" max="359" show-value block-size="18" activeColor="#57C878" />
 					</view>
 				</view>
 				<view class="ensure">

+ 113 - 88
pages/environment/equipment.vue

@@ -7,18 +7,22 @@
 			</view>
 			<view class="info">
 				<view class="info_item">
-					<image :src="eqinfo.item.is_online==1?'http://www.hnyfwlw.com:8006/bigdata_app/image/cb/onBg.png':'http://www.hnyfwlw.com:8006/bigdata_app/image/cb/offBg.png'"
-					 mode="" class="bgi"></image>
-					<p style="font-size: 32rpx;" @click="copy(eqinfo.item)">设备 ID:{{eqinfo.item.equip_id||eqinfo.item.device_id}}
-						<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/environment/fuzhi.png" mode="" class="tishi"></image>
+					<image
+						:src="eqinfo.item.is_online==1?'http://www.hnyfwlw.com:8006/bigdata_app/image/cb/onBg.png':'http://www.hnyfwlw.com:8006/bigdata_app/image/cb/offBg.png'"
+						mode="" class="bgi"></image>
+					<p style="font-size: 32rpx;" @click="copy(eqinfo.item)">设备
+						ID:{{eqinfo.item.equip_id||eqinfo.item.device_id}}
+						<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/environment/fuzhi.png" mode=""
+							class="tishi"></image>
 					</p>
 					<p>设备名称:{{eqinfo.item.equip_name?eqinfo.item.equip_name:"无"}}</p>
-					<p>最近上报时间:<span v-if="eqinfo.item.uptime">{{eqinfo.item.uptime|timeFormat()}}</span><span v-else>{{eqinfo.item.addtime|timeFormat()}}</span></p>
+					<p>最近上报时间:<span v-if="eqinfo.item.uptime">{{eqinfo.item.uptime|timeFormat()}}</span><span
+							v-else>{{eqinfo.item.addtime|timeFormat()}}</span></p>
 					<p>地址:{{city==""?"--":city}}</p>
 				</view>
 			</view>
 			<view class="control">
-				<view class="control_item" v-if="kongtf" @click="control">
+				<view class="control_item" v-if="$QueryPermission(144)" @click="control">
 					<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/environment/8.png'" mode=""></image>
 					<p>设备控制</p>
 				</view>
@@ -26,11 +30,11 @@
 					<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/environment/7.png'" mode=""></image>
 					<p>一键报修</p>
 				</view>
-				<view class="control_item" v-if="shujutf" @click="charts">
+				<view class="control_item" v-if="$QueryPermission(147)" @click="charts">
 					<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/environment/10.png'" mode=""></image>
 					<p>历史数据</p>
 				</view>
-				<view class="control_item" v-if="eqinfo.item.iccid" @click="siminfo(eqinfo.item.iccid)">
+				<view class="control_item" v-if="eqinfo.item.iccid && $QueryPermission(146)" @click="siminfo(eqinfo.item.iccid)">
 					<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/cb/6.png'" mode=""></image>
 					<p>SIM卡信息</p>
 				</view>
@@ -39,19 +43,23 @@
 				<p class="realtime_title"><span>实时数据</span></p>
 				<view class="realtime_text">
 					<view class="realtime_text_item">
-						<view class="realtime_text_item_info" v-for="(item,index) in olddata.conf" :key="index" v-if="olddata.dat[index][1]&&item" @click="oneday(item,index)">
-							<view class="item_info_img" :style="{'background-color':olddatas[Math.floor(Math.random()*(5-0+1))]}">
-								<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/environment/icon_'+olddata.dat[index][1]+'.png'"
-								 mode=""></image>
+						<view class="realtime_text_item_info" v-for="(item,key) in olddata" :key="key"
+							@click="oneday(key)">
+							<view class="item_info_img" :style="{'background-color':olddatas[1]}">
+								<image
+									:src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/environment/icon_'+item[1]+'.png'"
+									mode=""></image>
 							</view>
 							<view class="item_info_text">
-								<p>{{item}}</p>
-								<p style="margin-top: 20rpx;">{{parseFloat(olddata.dat[index][0]) == -99.99 ?'N/A':parseFloat(olddata.dat[index])}}</p>
+								<p>{{key=="PM255(ug/m3)"?"PM2.5(ug/m3)":key}}</p>
+								<p style="margin-top: 20rpx;">
+									{{parseFloat(item[0]) == -99.99 ?'N/A':parseFloat(item[0])}}
+								</p>
 							</view>
 						</view>
 					</view>
 				</view>
-				<view class="realtime_tishi" v-if="!realtimeTF && !dataloadingtf">
+				<view class="realtime_tishi" v-if="realtimeTF && !dataloadingtf">
 					暂无数据
 				</view>
 				<view class="realtime_tishi" v-if="dataloadingtf">
@@ -63,7 +71,8 @@
 			<p class="tishiTF" v-if="tishiTF">暂无24小时数据</p>
 			<view class="slot-content" v-else>
 				<canvas canvas-id="canvasColumnA" id="canvasColumnA" class="charts" @touchstart="touchLineA($event)"
-				 @touchmove="moveLineA($event)" @touchend="touchEndLineA($event)" disable-scroll=true :style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>
+					@touchmove="moveLineA($event)" @touchend="touchEndLineA($event)" disable-scroll=true
+					:style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>
 				<view class="maxdata">
 					<view class="maxdata_box">
 						<p class="dian"></p>
@@ -87,8 +96,8 @@
 		data() {
 			return {
 				eqinfo: {
-					item:{
-						
+					item: {
+
 					}
 				},
 				olddata: {},
@@ -105,11 +114,11 @@
 				show: false,
 				onedatasMax: 0,
 				onedatasMin: 0,
-				onedatasMaxtime:"",
-				onedatasMintime:"",
-				tishiTF:false,
-				realtimeTF:false,//暂无数据提示
-				dataloadingtf:true,//加载中提示
+				onedatasMaxtime: "",
+				onedatasMintime: "",
+				tishiTF: false,
+				realtimeTF: false, //暂无数据提示
+				dataloadingtf: true, //加载中提示
 			}
 		},
 		methods: {
@@ -127,26 +136,37 @@
 					}
 				})
 				this.dataloadingtf = false
-				this.olddata = res
-				var arr = []
-				for (var key in this.olddata.conf) {
-					if (this.olddata.conf[key].indexOf("#") != -1) {
-						this.olddata.conf[key] = this.olddata.conf[key].replace("#", "(") + ")"
+				// this.olddata = res
+				// console.log(res)olddata
+				this.olddata = {}
+				for (var key in res.conf) {
+					if (res.conf[key]) {
+						console.log(res.conf[key])
+						if (res.conf[key].indexOf("#") != -1) {
+							if(res.conf[key].indexOf(".")!=-1){
+								res.conf[key] = res.conf[key].replace(".", "5")
+							}
+							var str = res.conf[key].replace("#", "(") + ")"
+							this.olddata[str] = res.dat[key].split("#")
+						} else {
+							this.olddata[res.conf[key]] = res.dat[key].split("#")
+						}
 					}
-					this.olddata.dat[key] = this.olddata.dat[key].split("#")
-					arr.push(this.olddata.dat[key][0])
 				}
-				console.log(this.olddata.conf)
-				console.log(arr)
-				this.realtimeTF = arr.some(function(item){
-					return item!=""
-				})
+				console.log(this.olddata)
+				this.realtimeTF = true
+				for (var key in this.olddata) {
+					this.realtimeTF = false
+				}
+				// this.realtimeTF = arr.some(function(item){
+				// 	return item!=""
+				// })
 				console.log(this.realtimeTF)
 			},
 			// weather.weather.qxz_data_chart 一天的数据
 			async onehistory() {
-				var  newtime = +new Date()/1000
-				var  oldtime = newtime-24*60*60
+				var newtime = +new Date() / 1000
+				var oldtime = newtime - 24 * 60 * 60
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=weather.weather.qxz_data_chart',
 					data: {
@@ -196,10 +216,9 @@
 					url: "../afterSale/addafter?device_id=" + device_id + "&device_type=" + 5
 				})
 			},
-			oneday(item, index) {
-				console.log(item, index)
+			oneday(key) {
 				var obj = {
-					name: item,
+					name: key=="PM255(ug/m3)"?"PM2.5(ug/m3)":key,
 					data: [],
 				}
 				var xtitle = []
@@ -207,31 +226,30 @@
 				var arr = []
 				var timearr = []
 				for (var i = 0; i < this.onedatas.length; i++) {
-					if(Number(this.onedatas[i].dat[index].slice(0, this.onedatas[i].dat[index].indexOf("#")))!=-99.99){
-						obj.data.unshift(Number(this.onedatas[i].dat[index].slice(0, this.onedatas[i].dat[index].indexOf("#"))))
-						arr.unshift(Number(this.onedatas[i].dat[index].slice(0, this.onedatas[i].dat[index].indexOf("#"))))
-						var times = new Date(this.onedatas[i].time * 1000)
-						xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times.getMinutes())
-						timearr.unshift(+new Date(times)/1000)
-					}
+					var times = new Date(this.onedatas[i].time * 1000)
+					arr.unshift(Number(this.onedatas[i].dat[this.olddata[key][2]].split("#")[0]))
+					xtitle.unshift(times.getMonth() + 1 + "/" + times.getDate() + "-" + times.getHours() + ":" + times
+						.getMinutes())
+					timearr.unshift(+new Date(times) / 1000)
+					obj.data.unshift(Number(this.onedatas[i].dat[this.olddata[key][2]].split("#")[0]))
 				}
 				arr.sort(function(a, b) {
 					return a - b
 				})
 				this.onedatasMin = arr[0]
 				this.onedatasMax = arr[arr.length - 1]
-				for(var i = 0; i < obj.data.length; i++){
-					if(this.onedatasMax==obj.data[i]){
+				for (var i = 0; i < obj.data.length; i++) {
+					if (this.onedatasMax == obj.data[i]) {
 						this.onedatasMaxtime = timearr[i]
 					}
-					if(this.onedatasMin==obj.data[i]){
+					if (this.onedatasMin == obj.data[i]) {
 						this.onedatasMintime = timearr[i]
 					}
 				}
 				linearr.push(obj)
-				if(obj.data.length==0){
+				if (obj.data.length == 0) {
 					this.tishiTF = true
-				}else{
+				} else {
 					this.tishiTF = false
 				}
 				this.show = true
@@ -264,7 +282,9 @@
 						scrollColor: '#DEE7F7', //默认为 #A6A6A6
 					},
 					yAxis: {
-						format:(val)=>{return val.toFixed(2)}
+						format: (val) => {
+							return val.toFixed(2)
+						}
 					},
 					width: _self.cWidth * 1,
 					height: _self.cHeight * 1,
@@ -290,12 +310,12 @@
 					}
 				});
 			},
-			siminfo(sim){
+			siminfo(sim) {
 				uni.navigateTo({
-					url: "./sim?simid="+sim
+					url: "./sim?simid=" + sim
 				})
 			},
-			async getbaseinfo(id){
+			async getbaseinfo(id) {
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=weather.weather.qxz_page',
 					data: {
@@ -312,7 +332,7 @@
 			this.$forceUpdate()
 			this.eqinfo.item = JSON.parse(option.shebei)
 			console.log(JSON.parse(option.shebei))
-			if(!this.eqinfo.item.iccid){
+			if (!this.eqinfo.item.iccid) {
 				this.getbaseinfo(this.eqinfo.item.equip_id)
 			}
 			this.history()
@@ -322,33 +342,33 @@
 			} else {
 				this.reverseGeocode(this.eqinfo.item.lat, this.eqinfo.item.lng)
 			}
-			uni.getStorage({
-				key: "jurisdiction",
-				success: (res) => {
-					console.log(JSON.parse(res.data))
-					let items = JSON.parse(res.data).filter((item) => {
-						return item.purview_name == "环境监测系统"
-					})
-					let items2 = items[0].children.filter((item) => {
-						return item.purview_name == "环境监测"
-					})
-					var arr = items2[0].children
-					console.log(arr)
-					for (var i = 0; i < arr.length; i++) {
-						switch (arr[i].purview_name) {
-							case "设备控制":
-								this.kongtf = true
-								break
-							case "24小时数据":
-								this.daydatatf = true
-								break
-							case "历史数据":
-								this.shujutf = true
-								break
-						}
-					}
-				},
-			})
+			// uni.getStorage({
+			// 	key: "jurisdiction",
+			// 	success: (res) => {
+			// 		console.log(JSON.parse(res.data))
+			// 		let items = JSON.parse(res.data).filter((item) => {
+			// 			return item.pur_id == 40
+			// 		})
+			// 		let items2 = items[0].children.filter((item) => {
+			// 			return item.pur_id == 41
+			// 		})
+			// 		var arr = items2[0].children
+			// 		console.log(arr)
+			// 		for (var i = 0; i < arr.length; i++) {
+			// 			switch (arr[i].pur_id) {
+			// 				case 144:
+			// 					this.kongtf = true
+			// 					break
+			// 				case 145:
+			// 					this.daydatatf = true
+			// 					break
+			// 				case 147:
+			// 					this.shujutf = true
+			// 					break
+			// 			}
+			// 		}
+			// 	},
+			// })
 		}
 	}
 </script>
@@ -426,6 +446,7 @@
 			width: 90%;
 			margin: 0 auto;
 		}
+
 		.dataloading:after {
 			overflow: hidden;
 			display: inline-block;
@@ -433,17 +454,17 @@
 			animation: ellipsis 2s infinite;
 			content: "\2026";
 		}
-		
+
 		@keyframes ellipsis {
 			from {
 				width: 2px;
 			}
-		
+
 			to {
 				width: 15px;
 			}
 		}
-		
+
 		.realtime_tishi {
 			width: 90%;
 			margin: 0 auto;
@@ -451,6 +472,7 @@
 			font-size: 32rpx;
 			padding-top: 40rpx;
 		}
+
 		.realtime_text {
 			width: 90%;
 			margin: 0 auto;
@@ -498,10 +520,12 @@
 		// height: 400upx;
 		background-color: #FFFFFF;
 	}
-	.tishiTF{
+
+	.tishiTF {
 		text-align: center;
 		margin-top: 20rpx;
 	}
+
 	.maxdata {
 		font-size: 26rpx;
 
@@ -510,6 +534,7 @@
 			padding-left: 30rpx;
 			box-sizing: border-box;
 		}
+
 		.dian {
 			width: 20rpx;
 			height: 20rpx;

+ 77 - 89
pages/environment/gsequipment.vue

@@ -1,96 +1,62 @@
 <template>
 	<view>
 		<view class="status_bar"></view>
-		<view class="" style="position: relative;top: 40px;">
+		<view class="" style="position: relative;top: 44px;">
 			<view style="position: fixed;z-index: 100;width: 100%;">
 				<uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="设备详情"></uni-nav-bar>
 			</view>
-			<view class="" style="position: relative;top: 44px;">
-				<view class="info">
-					<view class="info_item">
-						<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/onBg.png" mode="" class="bgi"></image>
-						<p style="font-size: 32rpx;" @click="copy(eqinfo.device_id)">设备 ID:{{eqinfo.device_id}}
-							<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/environment/fuzhi.png" mode=""
-								class="tishi"></image>
-						</p>
-						<p>设备名称:{{eqinfo.device_name||"无"}}</p>
-						<p>最近上报时间:<span v-if="eqinfo.uptime">{{eqinfo.uptime|timeFormat()}}</span><span
-								v-else>{{eqinfo.addtime|timeFormat()}}</span></p>
-						<p>地址:{{city}}</p>
-						<p @click="setlongfun('')">
-							<text space="emsp">设置步长</text>
-							<u-icon name="edit-pen" color="#f0ad4e" size="28"></u-icon>
-						</p>
-					</view>
+			<view class="info">
+				<view class="info_item">
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/onBg.png" mode="" class="bgi"></image>
+					<p style="font-size: 32rpx;" @click="copy(eqinfo.device_id)">设备 ID:{{eqinfo.device_id}}
+						<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/environment/fuzhi.png" mode=""
+							class="tishi"></image>
+					</p>
+					<p>设备名称:{{eqinfo.device_name||"无"}}</p>
+					<p>最近上报时间:<span v-if="eqinfo.uptime">{{eqinfo.uptime|timeFormat()}}</span><span
+							v-else>{{eqinfo.addtime|timeFormat()}}</span></p>
+					<p>地址:{{city}}</p>
+					<p @click="setlongfun('')" v-if="$QueryPermission(250)">
+						<text space="emsp">设置步长</text>
+						<u-icon name="edit-pen" color="#f0ad4e" size="28"></u-icon>
+					</p>
 				</view>
-				<u-modal v-model="modalshow" @confirm="confirm" show-cancel-button>
-					<view class="modalbox">
-						<p>设置步长:</p>
-						<input type="number" v-model="stepsize" class="uinput" placeholder="请输入步长" />
-						<p>cm</p>
-					</view>
-				</u-modal>
-				<view class="newdatas">
-					<view class="newdatas_title">
-						<span>实时数据</span>
-						<p @click="tohistory">历史数据>>></p>
-					</view>
-					<view class="newdatas_air">
-						<view class="newdatas_air_box">
-							<view class="imgbox">
-								<image src="http://www.hnyfwlw.com:8006//bigdata_app/image/environment/tubular/daqi.png"
-									mode="" class="img"></image>
-							</view>
-							<view class="infobox">
-								<p>大气压强</p>
-								<p>{{newdataobj.atm}}Pa</p>
-							</view>
-						</view>
-						<view class="newdatas_air_box">
+			</view>
+			<u-modal v-model="modalshow" @confirm="confirm" show-cancel-button>
+				<view class="modalbox" v-for="items,index in depthlist">
+					<p>第{{ index + 1 }}层步长值:</p>
+					<input type="number" v-model="depthlist[index]" class="uinput" placeholder="请输入步长" />
+					<p>cm</p>
+				</view>
+			</u-modal>
+			<view class="newdatas">
+				<view class="newdatas_title">
+					<span>实时数据</span>
+					<p @click="tohistory" v-if="$QueryPermission(189)">历史数据>>></p>
+				</view>
+				<view class="newdatas_land" v-for="item,index in newdataobj.temp" :key="index">
+					<p class="newdatas_land_title">{{newdataobj.depth[index]}}cm</p>
+					<view class="newdatas_land_info">
+						<view class="newdatas_land_box">
 							<view class="imgbox">
-								<image src="http://www.hnyfwlw.com:8006//bigdata_app/image/environment/tubular/kqs.png"
+								<image
+									:src="'http://www.hnyfwlw.com:8006//bigdata_app/image/environment/tubular/trs'+(index+1)+'.png'"
 									mode="" class="img"></image>
 							</view>
 							<view class="infobox">
-								<p>空气湿度</p>
-								<p>{{newdataobj.ats}}%RH</p>
+								<p>土壤湿度</p>
+								<p>{{newdataobj.swc[index]}}%RH</p>
 							</view>
 						</view>
-						<view class="newdatas_air_box">
+						<view class="newdatas_land_box">
 							<view class="imgbox">
-								<image src="http://www.hnyfwlw.com:8006//bigdata_app/image/environment/tubular/kqw.png"
+								<image
+									:src="'http://www.hnyfwlw.com:8006//bigdata_app/image/environment/tubular/trw'+(index+1)+'.png'"
 									mode="" class="img"></image>
 							</view>
 							<view class="infobox">
-								<p>空气温度</p>
-								<p>{{newdataobj.at}}℃</p>
-							</view>
-						</view>
-					</view>
-					<view class="newdatas_land" v-for="item,index in newdataobj.temp" :key="index">
-						<p class="newdatas_land_title">{{newdataobj.topic * (index+1)}}cm</p>
-						<view class="newdatas_land_info">
-							<view class="newdatas_land_box">
-								<view class="imgbox">
-									<image
-										:src="'http://www.hnyfwlw.com:8006//bigdata_app/image/environment/tubular/trs'+(index+1)+'.png'"
-										mode="" class="img"></image>
-								</view>
-								<view class="infobox">
-									<p>土壤湿度</p>
-									<p>{{newdataobj.swc[index]}}%RH</p>
-								</view>
-							</view>
-							<view class="newdatas_land_box">
-								<view class="imgbox">
-									<image
-										:src="'http://www.hnyfwlw.com:8006//bigdata_app/image/environment/tubular/trw'+(index+1)+'.png'"
-										mode="" class="img"></image>
-								</view>
-								<view class="infobox">
-									<p>土壤温度</p>
-									<p>{{newdataobj.temp[index]}}℃</p>
-								</view>
+								<p>土壤温度</p>
+								<p>{{newdataobj.temp[index]}}℃</p>
 							</view>
 						</view>
 					</view>
@@ -109,6 +75,7 @@
 				modalshow: false, //设置步长弹框,
 				stepsize: "", //步长值
 				newdataobj: {}, //实时数据
+				depthlist:[]
 			}
 		},
 		methods: {
@@ -136,15 +103,26 @@
 					url: '/api/api_gateway?method=weather.weather.nd_topic_change',
 					data: {
 						device_id: this.eqinfo.device_id,
-						topic: stepsize
+						depth: stepsize
 					}
 				})
-				this.stepsize = res.topic
-				if (stepsize) {
-					uni.showToast({
-						title: "设置成功",
-						icon: "none"
-					})
+				// this.stepsize = res.topic
+				console.log(res)
+				if(stepsize==""){
+					this.depthlist = res.depth.split(",")
+				}else{
+					if(res){
+						uni.showToast({
+							title: "设置成功",
+							icon: "none"
+						})
+					}else{
+						uni.showToast({
+							title: "设置失败",
+							icon: "none"
+						})
+					}
+					
 				}
 			},
 			//weather.weather.nd_status 实时数据
@@ -156,17 +134,22 @@
 					}
 				})
 				this.newdataobj = res
+				this.newdataobj.depth = this.newdataobj.depth.split(",")
+				// this.depthlist = JSON.parse(JSON.stringify(this.newdataobj.depth))
 				this.newdataobj.temp = this.newdataobj.temp.split(",")
 				this.newdataobj.swc = this.newdataobj.swc.split(",")
 				console.log(this.newdataobj)
 			},
 			confirm() {
 				this.modalshow = !this.modalshow
-				this.setlongfun(this.stepsize)
+				this.setlongfun(this.depthlist)
 			},
 			clickLeft() {
-				uni.navigateTo({
-					url: "./index"
+				// uni.navigateTo({
+				// 	url: "./index"
+				// })
+				uni.navigateBack({
+					delta:1
 				})
 			},
 			tohistory() {
@@ -195,10 +178,13 @@
 <style lang="scss">
 	.info {
 		width: 100%;
+		position: absolute;
+		top: 44px;
 
 		.info_item {
 			width: 90%;
 			margin: 0 auto;
+			// height: 290rpx;
 			padding: 26rpx 50rpx;
 			position: relative;
 			box-sizing: border-box;
@@ -228,8 +214,8 @@
 
 	.modalbox {
 		display: flex;
-		padding: 20px 10px;
-
+		padding: 20rpx 10rpx;
+		font-size: 14px;
 		.uinput {
 			width: 50%;
 			border-radius: 22px;
@@ -242,7 +228,9 @@
 
 	.newdatas {
 		width: 100%;
-		margin-top: 20rpx;
+		position: absolute;
+		top: 195px;
+
 		.newdatas_title {
 			width: 90%;
 			margin: 0 auto;

+ 1 - 1
pages/environment/gshistory.vue

@@ -170,7 +170,7 @@
 					for (var i = 0; i < listArr.length; i++) {
 						// 对比相同的字段key,相同放入对应的数组中
 						if (listArr[i].name == el.name && el.data !== undefined) {
-							listArr[i].data.push(el.data[0]);
+							listArr[i].data.unshift(el.data[0]);
 							return;
 						}
 					}

+ 1 - 1
pages/environment/history.vue

@@ -23,7 +23,7 @@
 					<view class="canvastishi" v-if="dataloadingtf">
 						<p class="dataloading">加载中</p>
 					</view>
-					<canvas v-show="!tiemshow" canvas-id="canvasColumnA" id="canvasColumnA" class="charts"
+					<canvas v-show="!tiemshow && !pickertfone" canvas-id="canvasColumnA" id="canvasColumnA" class="charts"
 						@touchstart="touchLineA($event)" @touchmove="moveLineA($event)"
 						@touchend="touchEndLineA($event)" disable-scroll=true
 						:style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>

+ 86 - 29
pages/environment/index.vue

@@ -1,8 +1,8 @@
 <template>
 	<view>
 		<view class="status_bar"></view>
-		<view class="" style="position: relative; top: 44px">
-			<view style="position: fixed; z-index: 100">
+		<view class="" style="position: relative; top: 40px">
+			<!-- <view style="position: fixed; z-index: 100">
 				<uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="环境监测系统" right-icon="search"
 					@clickRight="clickRight" size="16"></uni-nav-bar>
 				<view class="inputs" :style="{ width: width + 'rpx' }">
@@ -10,6 +10,16 @@
 						class="inputbox" :clearable="false" />
 					<u-icon name="search" size="40" class="icon" @click="search"></u-icon>
 				</view>
+			</view> -->
+			<view style="position: fixed;z-index: 100;">
+				<uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" size="16">
+					<view class="bases_search">
+						<view class="bases_search_text" @click="clickRight">
+							<u-icon name="search" class="search" @click="search"></u-icon>
+							<input type="text" v-model="imports" placeholder="设备ID搜索" disabled @input="searchinp" />
+						</view>
+					</view>
+				</uni-nav-bar>
 			</view>
 			<image :src="
           'http://www.hnyfwlw.com:8006/bigdata_app' + '/image/environment/1.png'
@@ -240,7 +250,10 @@
 				this.eqlistdata = this.eqlistdata.concat(res.ids);
 			},
 			clickRight() {
-				this.width = 600;
+				// console.log(this.side_type)
+				uni.navigateTo({
+					url: "./search?type=" + this.side_type
+				})
 			},
 			clickLeft() {
 				uni.switchTab({
@@ -259,15 +272,15 @@
 					});
 				} else if (this.side_type == 11) {
 					uni.navigateTo({
-						url: "../disease/cmb?shebei=" + JSON.stringify(data),
+						url: "../disease/cmb?shebei=" + JSON.stringify(data)+"&type=11",
 					});
 				} else if (this.side_type == 19) {
 					uni.navigateTo({
-						url: "../disease/cmb?shebei=" + JSON.stringify(data),
+						url: "../disease/cmb?shebei=" + JSON.stringify(data)+"&type=19",
 					});
 				} else if (this.side_type == 20) {
 					uni.navigateTo({
-						url: "../disease/cmb?shebei=" + JSON.stringify(data),
+						url: "../disease/cmb?shebei=" + JSON.stringify(data)+"&type=20",
 					});
 				}
 			},
@@ -374,7 +387,7 @@
 			},
 		},
 		onLoad() {
-			this.eqlist();
+			// this.eqlist();
 			uni.getStorage({
 				key: "jurisdiction",
 				success: (res) => {
@@ -402,6 +415,20 @@
 								break;
 						}
 					}
+					for (var i = 0; i < this.equipArr.length; i++) {
+						if (this.equipArr[i].tf) {
+							if (i == 0) {
+								this.eqlist();
+							} else if (i == 1) {
+								this.tubulareqlist();
+							} else {
+								this.getEquipList();
+							}
+							this.active = i
+							this.side_type = this.equipArr[i].type
+							break
+						}
+					}
 				},
 			});
 		},
@@ -437,38 +464,68 @@
 		background: $uni-bg-color-grey;
 	}
 
-	.inputs {
-		height: 54rpx;
-		background-color: #e4e4e4;
-		border-radius: 27rpx;
+	.bases_search {
+		width: 60%;
+		background-color: #FFFFFF;
 		position: absolute;
-		right: 20rpx;
-		top: 20rpx;
-		transition: width 0.5s;
-		overflow: hidden;
-		padding-top: 8rpx;
-		box-sizing: border-box;
+		top: 10rpx;
+		left: 50%;
+		margin-left: -33%;
 
-		.inputbox {
-			width: 85%;
-			text-indent: 1rem;
-			font-size: 26rpx;
-		}
+		.bases_search_text {
+			width: 90%;
+			margin: 0 auto;
+			background-color: #F8F8F8;
+			height: 60rpx;
+			border-radius: 30rpx;
+			display: flex;
+			line-height: 60rpx;
 
-		.icon {
-			position: absolute;
-			top: 8rpx;
-			right: 26rpx;
+			.search {
+				padding: 0 20rpx;
+				font-size: 34rpx;
+			}
+
+			input {
+				width: 80%;
+				margin-top: 10rpx;
+				font-size: 28rpx;
+			}
 		}
 	}
 
+	// .inputs {
+	// 	height: 54rpx;
+	// 	background-color: #e4e4e4;
+	// 	border-radius: 27rpx;
+	// 	position: absolute;
+	// 	right: 20rpx;
+	// 	top: 20rpx;
+	// 	transition: width 0.5s;
+	// 	overflow: hidden;
+	// 	padding-top: 8rpx;
+	// 	box-sizing: border-box;
+
+	// 	.inputbox {
+	// 		width: 85%;
+	// 		text-indent: 1rem;
+	// 		font-size: 26rpx;
+	// 	}
+
+	// 	.icon {
+	// 		position: absolute;
+	// 		top: 8rpx;
+	// 		right: 26rpx;
+	// 	}
+	// }
+
 	/deep/.uni-icons {
 		font-size: 40rpx !important;
 	}
 
 	.image {
 		position: fixed;
-		top: 84px;
+		top: 80px;
 		width: 100%;
 		height: 160rpx;
 		z-index: 555;
@@ -494,7 +551,7 @@
 
 	.tab-box {
 		position: fixed;
-		top: 170px;
+		top: 159px;
 		// display: flex;
 		// justify-content: space-around;
 		font-size: 30rpx;
@@ -532,7 +589,7 @@
 	.prevents {
 		width: 100%;
 		position: absolute;
-		top: 180px;
+		top: 170px;
 
 		.prevents_item {
 			width: 95%;

+ 42 - 9
pages/environment/search.vue

@@ -25,9 +25,8 @@
 						</view>
 					</view>
 					<view class="" v-if="side_type == 15">
-						<image
-							src="http://www.hnyfwlw.com:8006/bigdata_app/image/prevention/6.png"
-							mode="" class="prevents_item_img"></image>
+						<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/prevention/6.png" mode=""
+							class="prevents_item_img"></image>
 						<view class="prevents_item_top">
 							<p>设备名称:{{item.device_name==""?"无":item.device_name}}</p>
 						</view>
@@ -36,6 +35,21 @@
 							<p>最新上报时间:{{item.uptime|timeFormat()}}</p>
 						</view>
 					</view>
+					<view class="" v-if="side_type == 11 || side_type == 19 || side_type == 20">
+						<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/prevention/6.png" mode=""
+							class="prevents_item_img"></image>
+						<view class="prevents_item_top">
+							<p>
+								设备名称:{{
+					  item.device_name == "" ? "暂无" : item.device_name
+					}}
+							</p>
+						</view>
+						<view class="prevents_item_bot">
+							<p>设备 ID:{{ item.device_id }}</p>
+							<p>最新上报时间:{{item.uptime|timeFormat()}}</p>
+						</view>
+					</view>
 				</view>
 			</view>
 		</view>
@@ -87,17 +101,34 @@
 				this.eqlistdata = this.eqlistdata.concat(res.ids)
 				console.log(res.ids)
 			},
+			async getEquipList() { //设备列表 环境监测
+				this.loadingtf = true;
+				const res = await this.$myRequest({
+					method: "POST",
+					url: "/api/api_gateway?method=wheat.wheat.wheat_list",
+					data: {
+						device_id: this.imports,
+						device_name: "",
+						page: this.page,
+						device_type: this.side_type,
+					},
+				});
+				this.loadingtf = false;
+				this.eqlistdata = this.eqlistdata.concat(res.ids);
+			},
 			clickLeft() {
-				uni.navigateBack({
-					delta: 1
+				uni.navigateTo({
+					url: "./index"
 				})
 			},
 			search() {
 				this.eqlistdata = []
-				if(this.side_type==5){
+				if (this.side_type == 5) {
 					this.eqlist()
-				}else if(this.side_type == 15){
+				} else if (this.side_type == 15) {
 					this.tubulareqlist()
+				} else if (this.side_type == 11 || this.side_type == 19 || this.side_type == 20) {
+					this.getEquipList()
 				}
 			},
 			searchinp() {
@@ -106,11 +137,11 @@
 				}, 1000)()
 			},
 			eqdetails(data) {
-				if(this.side_type == 5){
+				if (this.side_type == 5) {
 					uni.navigateTo({
 						url: "./equipment?shebei=" + JSON.stringify(data)
 					})
-				}else if(this.side_type == 15){
+				} else if (this.side_type == 15) {
 					uni.navigateTo({
 						url: "./gsequipment?shebei=" + JSON.stringify(data)
 					})
@@ -135,6 +166,7 @@
 		right: 5%;
 		padding-top: 8rpx;
 		box-sizing: border-box;
+
 		input {
 			width: 85%;
 			// text-indent: 1rem;
@@ -163,6 +195,7 @@
 			padding: 20rpx 40rpx 20rpx 80rpx;
 			position: relative;
 			box-sizing: border-box;
+
 			.prevents_item_img {
 				width: 30rpx;
 				height: 50rpx;

+ 16 - 9
pages/equipList/index.vue

@@ -9,7 +9,7 @@
 			<view class="inputs">
 				<!-- <u-input v-model="imports" type="text" :border="true" /> -->
 				<u-search placeholder="请输入设备ID" v-model="imports" placeholder-color="#909696" :show-action="false"
-					search-icon-color="#909696">
+					search-icon-color="#909696" @input="searchinput">
 				</u-search>
 				<!-- <input type="text" value="" placeholder="请输入设备ID或设备名称" v-model="imports" @input="searchinput"
 					class="inputbox" :clearable="false" />
@@ -42,7 +42,7 @@
 								<p>添加设备时间:{{item.uptime|timeFormat()}}</p>
 								<p>设备已运行:{{item.days}}天</p>
 							</view>
-							<view class="list_item_btn" v-if="infoalter" @click.stop="modification(item)">
+							<view class="list_item_btn" v-if="$QueryPermission(108) && ![13, 17, 18, 11, 19, 20].includes(type_id)" @click.stop="modification(item)">
 								信息修改
 							</view>
 						</view>
@@ -157,14 +157,9 @@
 				})
 				console.log(res)
 				for (var i = 0; i < res.length; i++) {
-					if(res[i].id == 8 ||
-					   res[i].id == 12 ||
+					if(
 					   res[i].id == 14 ||
-					   res[i].id == 11||
-					   res[i].id == 13  ||
-					   res[i].id == 16  ||
-					   res[i].id == 17  ||
-					   res[i].id == 18 
+					   res[i].id == 16 
 					   ){
 						continue;
 					}
@@ -255,6 +250,18 @@
 							url: "../cb/equip-detail/equip-detail?info=" + JSON.stringify(item)
 						})
 						break;
+					case 8:
+					  // item.type = this.type_id;
+					  uni.navigateTo({
+					    url: "../cb/thxydetail/thxydetail?imei=" + item.imei
+					  });
+					  break;
+					case 12:
+					  console.log(item);
+					  uni.navigateTo({
+					    url: "../cb/xctdetail/xctdetail?info=" + JSON.stringify(item),
+					  });
+					  break;
 					case 13:
 						console.log(item)
 						var obj = {}

+ 241 - 0
pages/equipList/modification.vue

@@ -0,0 +1,241 @@
+<template>
+	<view>
+		<view class="status_bar"></view>
+		<view class="" style="position: relative;top: 64px;">
+			<view style="position: fixed;z-index: 100;">
+				<uni-nav-bar @clickLeft="clickLeft" left-icon="back" title="修改名称"></uni-nav-bar>
+			</view>
+			<view class="mod">
+				<view class="mod_name">
+					<p><span style="color: #ff0000;" v-if="quanxian.namealter">*</span>设备名称</p>
+					<input type="text" v-model="moddata.device_name" :class="quanxian.namealter?'namebg':''" :disabled="!quanxian.namealter"/>
+				</view>
+				<view class="mod_id">
+					<p>设备ID</p>
+					<input type="text" :value="moddata.imei||moddata.device_id" disabled />
+				</view>
+				<view class="mod_user">
+					<p>适配用户</p>
+					<input type="text" :value="moddata.real_name==''?'无':moddata.real_name" disabled />
+				</view>
+				<view class="mod_city" @click="amendcity" v-if="$QueryPermission(109)">
+					<p><span style="color: #ff0000;" v-if="quanxian.cityalter">*</span>设备位置</p>
+					<view style="display: flex;">
+						<input type="text" :value="city" disabled style="width: 400rpx;" />
+						<u-icon name="arrow-right"></u-icon>
+					</view>
+				</view>
+				<view class="mod_time">
+					<p>设备添加时间</p>
+					<input type="text" :value="moddata.addtime|timeFormat()" disabled />
+				</view>
+				<p style="width: 90%;margin: 0 auto;text-align: right;color: #06B535;"><span style="color: #ff0000;">*</span>为可修改</p>
+				<view class="sub" v-if="quanxian.infoalter" @click="btn">
+					提 交
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				moddata: [],
+				city: "",
+				selectcityTF: false,
+				quanxian:{
+					namealter:false,
+					cityalter:false,
+					infoalter:false
+				}
+			}
+		},
+		methods: {
+			async eqlistcity(lat, lng) { //修改设备定位
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.revise_device_lnglat',
+					data: {
+						device_id: this.moddata.imei,
+						lat: lat,
+						lng: lng
+					}
+				})
+				console.log(res)
+				if (res==false) {
+					uni.showModal({
+						title: "修改地址失败",
+						icon: "none"
+					})
+				}
+			},
+			async eqlistname() { //修改设备名称
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.revise_device',
+					data: {
+						device_id: this.moddata.imei,
+						device_name: this.moddata.device_name,
+					}
+				})
+				console.log(res)
+				if (res==false) {
+					uni.showModal({
+						title: "修改名称失败",
+						icon: "none"
+					})
+				}
+			},
+			async eqlistuser(id, imei) { //获取设备信息
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
+					data: {
+						device_type_id: id,
+						device_id: imei,
+					}
+				})
+				this.moddata = res.data[0]
+				console.log(res)
+				this.selectaddress(this.moddata.lng, this.moddata.lat)
+			},
+			async xyeqlistuser(imei) { //获取设备信息
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=sex_lure_nl.sex_lure.nl_device_list',
+					data: {
+						device_id: imei,
+					}
+				})
+				console.log(res)
+				this.moddata = res.data[0]
+				this.selectaddress(this.moddata.lng, this.moddata.lat)
+			},
+			btn() {
+				this.eqlistcity(this.moddata.lat, this.moddata.lng)
+				this.eqlistname()
+				uni.removeStorage({
+					key: "location"
+				})
+				this.clickLeft()
+			},
+			clickLeft() {
+				uni.navigateBack({
+					delta:1
+				})
+			},
+			amendcity() { //修改设备地址
+				if(this.quanxian.cityalter){
+					this.selectcityTF = true
+					uni.navigateTo({
+						url: "../fourBase/city"
+					})
+				}else{
+					uni.showToast({
+						title: "您暂无权限进行此操作,如有需要,请联系管理员",
+						icon: "none"
+					})
+				}
+			},
+			selectaddress(lng, lat) { //获取分布位置
+				uni.request({
+					type: "GET",
+					url: "https://restapi.amap.com/v3/geocode/regeo?output=JSON&location=" + lng + "," + lat +
+						"&key=27273b81090f78759e4057f94474516f&radius=1000&extensions=all",
+					dataType: "json",
+					complete: ress => {
+						// console.log(ress)
+						if (ress.data.regeocode.formatted_address.length == 0) {
+							this.city = "--"
+						} else {
+							this.city = ress.data.regeocode.formatted_address
+						}
+					}
+				});
+			},
+		},
+		onLoad(option) {
+			console.log(option)
+			if(option.id==10){
+				this.xyeqlistuser(JSON.parse(option.data).device_id)
+			}else{
+				this.eqlistuser(option.id, JSON.parse(option.data).imei)
+			}
+			uni.getStorage({
+				key:"jurisdiction",
+				success:(res)=>{
+					console.log(JSON.parse(res.data))
+					let items = JSON.parse(res.data).filter((item)=>{
+						return item.purview_name == "设备管理"
+					})
+					let items2 = items[0].children.filter((item)=>{
+						return item.purview_name == "设备列表"
+					})
+					this.quanxian.namealter = items2[0].children.some((item)=>{
+						return item.purview_name == "修改名称"
+					})
+					this.quanxian.cityalter = items2[0].children.some((item)=>{
+						return item.purview_name == "添加位置"
+					})
+					this.quanxian.infoalter = items2[0].children.some((item)=>{
+						return item.purview_name == "修改名称" || item.purview_name == "添加位置"
+					})
+				},
+			})
+		},
+		onShow(){
+			uni.getStorage({
+				key: "location",
+				success: (res) => {
+					// console.log(res);
+					this.moddata.lat = res.data[1]
+					this.moddata.lng = res.data[0]
+					this.selectaddress(this.moddata.lng, this.moddata.lat)
+				}
+			})
+			
+		}
+	}
+</script>
+
+<style lang="scss">
+	page{
+		background-color: #FAFAFA;
+	}
+	.mod {
+		width: 100%;
+		position: absolute;
+		top: 44px;
+		.mod_name,
+		.mod_id,
+		.mod_user,
+		.mod_time,
+		.mod_city {
+			width: 90%;
+			margin: 30rpx auto;
+			display: flex;
+			justify-content: space-between;
+			background-color: #FFFFFF;
+			padding: 20rpx 10rpx;
+			color: #57C77A;
+			line-height: 50rpx;
+			.namebg{
+				background-color: #FAFAFA;
+			}
+			input {
+				text-align: right;
+				font-size: 28rpx;
+				padding: 10rpx;
+			}
+		}
+	}
+
+	.sub {
+		width: 90%;
+		margin: 30rpx auto;
+		text-align: center;
+		height: 70rpx;
+		line-height: 70rpx;
+		background-color: #57C77A;
+		border-radius: 35rpx;
+		color: #FFFFFF;
+	}
+</style>

+ 386 - 0
pages/equipList/search.vue

@@ -0,0 +1,386 @@
+<template>
+	<view>
+		<view class="status_bar"></view>
+		<view style="position: fixed;top: 44px; z-index: 100;height: 80rpx;background-color: #FFFFFF;padding-top: 10px;">
+			<uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回"></uni-nav-bar>
+			<view class="search_bot_input">
+				<input type="text" value="" placeholder="请输入设备ID" v-model="imports" @input="searchinput" />
+				<u-icon name="search" size="40" class="icon" @click="search"></u-icon>
+			</view>
+		</view>
+		<view class="list">
+			<view class="list_item" v-for="(item,index) in eqlistdata" :key="index" @click="historys(item)">
+				<view class="list_item_top">
+					<p class="p1">
+						<image :src=" 'http://static.yfpyx.com/bigdata_app'+images[indexs-2].path" mode=""></image>
+						{{item.device_name==''?"--":item.device_name}}
+					</p>
+					<p :class="[item.is_online?'p2':'p_out']">{{item.is_online?"在线":"离线"}}</p>
+				</view>
+				<view class="list_item_text">
+					<p>设备ID:{{item.imei}}</p>
+					<p>适配用户:{{item.device_user==''?"无":item.device_user}}</p>
+					<p>添加设备时间:{{item.addtime|timeFormat()}}</p>
+					<p>添加设备时间:{{item.uptime|timeFormat()}}</p>
+					<p>设备已运行:{{item.days}}天</p>
+				</view>
+				<view class="list_item_btn" v-if="infoalter" @click.stop="modification(item)">
+					修改名称
+				</view>
+			</view>
+			<view class="none" v-if="eqlistdatatf">
+				暂无数据
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		Debounce,
+		Throttle
+	} from "../../util/anitthro.js"
+	export default {
+		data() {
+			return {
+				imports: '',
+				eqlistdata: [],
+				images: [{
+						path: "/image/fourMoodBase/scd.png",
+						id: 2
+					},
+					{
+						path: "/image/fourMoodBase/cbd.png",
+						id: 3
+					}, {
+						path: "/image/fourMoodBase/xycb.png",
+						id: 4
+					}, {
+						path: "/image/fourMoodBase/qxz.png",
+						id: 5
+					}, {
+						path: "/image/fourMoodBase/jk.png",
+						id: 6
+					}, {
+						path: "/image/fourMoodBase/bzy.png",
+						id: 7
+					}
+				],
+				eqlistdatatf: false, //暂无数据
+				indexs: 2, //设备id
+				page: 1,
+				size: 10,
+				infoalter:false
+			}
+		},
+		methods: {
+			async eqlist() { //设备列表
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
+					data: {
+						device_type_id: this.indexs,
+						device_id: this.imports,
+						page: this.page,
+						page_size: this.size,
+					}
+				})
+				this.eqlistdata = this.eqlistdata.concat(res.data)
+				var newtime = +new Date()/1000
+				for(var i=0;i<this.eqlistdata.length;i++){
+					var days = (newtime-this.eqlistdata[i].uptime)/60/60/24
+					this.eqlistdata[i].days = Math.round(days)
+				} 
+				console.log(this.eqlistdata)
+				if (this.eqlistdata.length == 0) {
+					this.eqlistdatatf = true
+				} else {
+					this.eqlistdatatf = false
+				}
+			},
+			clickLeft() { //返回
+				uni.switchTab({
+					url: "./index"
+				})
+			},
+			search() { //搜索
+				this.eqlistdata = []
+				this.page = 1
+				this.eqlist()
+			},
+			searchinput() {
+				Debounce(() => {
+					this.eqlistdata = []
+					this.page = 1
+					this.eqlist()
+				}, 1000)()
+			},
+			modification(item) {
+				uni.navigateTo({
+					url: "./modification?data=" + JSON.stringify(item) + "&id=" + (this.indexs)
+				})
+			},
+			historys(item) {
+				switch (this.type_id) {
+					case 2:
+						uni.navigateTo({
+							url: "../prevention/equipmentdetails?shebei=" + JSON.stringify(item)
+						})
+						break;
+					case 5:
+						console.log(item)
+						var obj = {}
+						obj.d_id = item.d_id
+						obj.equip_id = item.imei
+						obj.is_online = item.is_online
+						obj.lat = item.lat
+						obj.lng = item.lng
+						obj.equip_name = item.device_name
+						obj.uptime = item.addtime
+						uni.navigateTo({
+							url: "../environment/equipment?shebei=" + JSON.stringify(obj)
+						})
+						break;
+					case 6:
+						uni.navigateTo({
+							url: "/pages/webview?device_id=" + item.imei + "&accessToken=" + this.accessToken
+						})
+						break;
+					case 3:
+						item.type = this.type_id
+						uni.navigateTo({
+							url: "../cb/equip-detail/equip-detail?info=" + JSON.stringify(item)
+						})
+						break;
+					case 4:
+						item.type = this.type_id
+						uni.navigateTo({
+							url: "../cb/equip-detail/equip-detail?info=" + JSON.stringify(item)
+						})
+						break;
+					case 7:
+						item.type = this.type_id
+						uni.navigateTo({
+							url: "../cb/equip-detail/equip-detail?info=" + JSON.stringify(item)
+						})
+						break;
+					case 8:
+					  // item.type = this.type_id;
+					  uni.navigateTo({
+					    url: "../cb/thxydetail/thxydetail?imei=" + item.imei
+					  });
+					  break;
+					case 12:
+					  console.log(item);
+					  uni.navigateTo({
+					    url: "../cb/xctdetail/xctdetail?info=" + JSON.stringify(item),
+					  });
+					  break;
+					case 13:
+						console.log(item)
+						var obj = {}
+						obj.d_id = item.d_id
+						obj.device_id = item.imei
+						obj.is_online = item.is_online
+						obj.lat = item.lat
+						obj.lng = item.lng
+						obj.equip_name = item.device_name
+						obj.uptime = item.addtime
+						uni.navigateTo({
+							url: "../waterandfer/datails?shebei=" + JSON.stringify(obj)
+						})
+						break;
+					case 15:
+						console.log(item)
+						var obj = {}
+						obj.d_id = item.d_id
+						obj.device_id = item.imei
+						obj.is_online = item.is_online
+						obj.lat = item.lat
+						obj.lng = item.lng
+						obj.equip_name = item.device_name
+						obj.uptime = item.addtime
+						uni.navigateTo({
+							url: "../environment/gsequipment?shebei=" + JSON.stringify(obj)
+						})
+						break;
+					case 17:
+						break;
+					case 18:
+						break;
+					default:
+						item.type = this.type_id
+						uni.navigateTo({
+							url: "../cb/xy2.0/particulars?info=" + JSON.stringify(item)
+						})
+						break;
+				}
+			}
+		},
+		onLoad(option) {
+			this.indexs = option.id
+			console.log(this.indexs)
+			uni.getStorage({
+				key:"jurisdiction",
+				success:(res)=>{
+					console.log(JSON.parse(res.data))
+					let items = JSON.parse(res.data).filter((item)=>{
+						return item.purview_name == "设备管理"
+					})
+					let items2 = items[0].children.filter((item)=>{
+						return item.purview_name == "分配设备"
+					})
+					this.infoalter = items2[0].children.some((item)=>{
+						return item.purview_name == "修改名称" || item.purview_name == "添加位置"
+					})
+				},
+			})
+		},
+		onReachBottom() {
+			this.page++
+			this.eqlist()
+		},
+		onBackPress(options) {
+			if (options.from === 'navigateBack') {
+				return false;
+			}
+			this.clickLeft();
+			return true;
+		},
+	}
+</script>
+<style lang="scss">
+	.search_top_input {
+		width: 80%;
+		height: 54rpx;
+		background-color: #E4E4E4;
+		border-radius: 27rpx;
+		position: absolute;
+		top: 18rpx;
+		right: 18rpx;
+		padding-top: 8rpx;
+		box-sizing: border-box;
+
+		input {
+			width: 85%;
+			text-indent: 1rem;
+			font-size: 26rpx;
+		}
+
+		.icon {
+			position: absolute;
+			top: 18rpx;
+			right: 32rpx;
+		}
+	}
+
+	.search_bot_input {
+		width: 80%;
+		height: 54rpx;
+		background-color: #E4E4E4;
+		border-radius: 27rpx;
+		position: absolute;
+		top: 18px;
+		right: 18rpx;
+		box-sizing: border-box;
+		padding-top: 8rpx;
+
+		input {
+			width: 85%;
+			// text-indent: 1rem;
+			font-size: 26rpx;
+			padding-left: 20px;
+		}
+
+		.icon {
+			position: absolute;
+			top: 8rpx;
+			right: 26rpx;
+		}
+	}
+
+	.list {
+		width: 100%;
+		background-color: #FDFDFD;
+		position: absolute;
+		top: 100px;
+
+		.list_item {
+			width: 95%;
+			margin: 20rpx auto;
+			padding: 10rpx 20rpx;
+			position: relative;
+			background-color: #FFFFFF;
+			box-sizing: border-box;
+			box-shadow: 0 0 10rpx #bcb9ca;
+
+			.list_item_top {
+				display: flex;
+				justify-content: space-between;
+
+				.p1 {
+					height: 60rpx;
+					line-height: 60rpx;
+					font-size: 28rpx;
+
+					image {
+						width: 40rpx;
+						height: 40rpx;
+						vertical-align: text-top;
+						margin-right: 20rpx;
+					}
+				}
+
+				.p2 {
+					height: 60rpx;
+					line-height: 60rpx;
+					font-size: 28rpx;
+					color: #42b983;
+				}
+
+				.p_out {
+					height: 60rpx;
+					line-height: 60rpx;
+					font-size: 28rpx;
+					color: red;
+				}
+			}
+
+			.list_item_text {
+				margin-top: 20rpx;
+
+				p {
+					font-size: 24rpx;
+					color: #636363;
+					margin-top: 10rpx;
+				}
+
+				p:first-child {
+					font-size: 28rpx;
+					font-weight: 700;
+				}
+			}
+
+			.list_item_btn {
+				width: 126rpx;
+				color: #42b983;
+				height: 40rpx;
+				text-align: center;
+				border: 1rpx solid #42b983;
+				border-radius: 25rpx;
+				font-size: 24rpx;
+				line-height: 35rpx;
+				position: absolute;
+				top: 136rpx;
+				right: 20rpx;
+			}
+		}
+
+		.none {
+			width: 100%;
+			height: 100rpx;
+			line-height: 100rpx;
+			font-size: 32rpx;
+			text-align: center;
+		}
+	}
+</style>

+ 2 - 6
pages/equipMange/index/assignment.vue

@@ -82,14 +82,10 @@
 					}
 				]
 				for (var i = 0; i < res.length; i++) {
-					if(res[i].id == 8  ||
+					if(res[i].id == 8 ||
 					   res[i].id == 12 ||
 					   res[i].id == 14 ||
-					   res[i].id == 11 ||
-					   res[i].id == 13 ||
-					   res[i].id == 16 ||
-					   res[i].id == 17 ||
-					   res[i].id == 18 
+					   res[i].id == 16 
 					   ){
 						continue;
 					}

+ 8 - 3
pages/equipMange/index/index.vue

@@ -20,14 +20,14 @@
 					<p class="userlist-li-eamil">{{item.mobile}}</p>
 					<view class="loginbox">
 						<p class="loginp" @click="userloginbtn(item)">一键登录</p>
-						<p class="logininfo" @click="userOperation(item)">查看详情</p>
+						<!-- <p class="logininfo" @click="userOperation(item)">查看详情</p> -->
 					</view>
 				</view>
 			</view>
 		</view>
-		<view class="addindent" @click="clickRight">
+		<!-- <view class="addindent" @click="clickRight">
 			新 增 用 户
-		</view>
+		</view> -->
 		<view class="top" v-if="isTop" @click="top">
 			<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/6209a98f0cb3b5086f2ca36152c9269.png'"
 				mode=""></image>
@@ -235,6 +235,11 @@
 				height: 80rpx;
 				margin: 40rpx 0 20rpx;
 			}
+			.userlist-li-city{
+				overflow: hidden;//溢出隐藏
+				white-space: nowrap;//禁止换行
+				text-overflow: ellipsis;//...
+			}
 			.loginbox{
 				display: flex;
 			}

+ 43 - 8
pages/index/index.vue

@@ -82,6 +82,13 @@
 						测报系统
 					</view>
 				</view>
+				<view class="facilitybox_item" v-if="$QueryPermission(243)"
+					@click="tabequipment('../cbqxyj/cbwarn')">
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/newindex/cbyj.png" mode="" class="itemimg"></image>
+					<view class="">
+						测报预警
+					</view>
+				</view>
 				<view class="facilitybox_item" v-if="jurisdiction.fztf" @click="tabequipment('../prevention/index')">
 					<image src="http://www.hnyfwlw.com:8006/bigdata_app/newindex/fz.png" mode="" class="itemimg"></image>
 					<view class="">
@@ -100,6 +107,13 @@
 						环境监测
 					</view>
 				</view>
+				<view class="facilitybox_item" v-if="$QueryPermission(242)"
+					@click="tabequipment('../qxzyj/cbwarn')">
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/newindex/qxyj.png" mode="" class="itemimg"></image>
+					<view class="">
+						气象预警
+					</view>
+				</view>
 				<view class="facilitybox_item" v-if="jurisdiction.ggtf" @click="tabequipment('../irrigate/index')">
 					<image src="http://www.hnyfwlw.com:8006/bigdata_app/newindex/guangai.png" mode="" class="itemimg"></image>
 					<view class="">
@@ -298,6 +312,7 @@
 
 <script>
 	import kpsImageCutter from "@/components/ksp-image-cutter/ksp-image-cutter.vue";
+	import jsencrypt from '@/components/jsencrypt/jsencrypt.vue';
 	export default {
 		components: {
 			kpsImageCutter
@@ -361,6 +376,10 @@
 					key: 'myuser_type',
 					data: JSON.stringify(res.myuser_type),
 				})
+				uni.setStorage({
+					key: 'myuid',
+					data: JSON.stringify(res.myuid),
+				})
 				this.jurisdiction = {
 					cbtf: false,
 					jktf: false,
@@ -440,6 +459,15 @@
 						console.log(999)
 					}
 				});
+				var publiukey = `-----BEGIN PUBLIC KEY-----
+				MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6m92fXUrccS4SoLg4W4jPRNua
+				4BcRk4ldLcqPuQpD2Mds2+hw+Gi+0MUnshF/r/DTcCJgkt7rtoY9EB6/XJ6MFw14
+				whhESFie/lZUWRsk8M89Rkr8m5rwmBl+uLAd5LopyshFqKTBXeT2ytHP1JCQLPBO
+				34Fy4/yEz4qEzkzBuwIDAQAB
+				-----END PUBLIC KEY-----`;
+				var time = +new Date();
+				var str2 = 'YuNfEi' + time + 'YuNfEi'
+				var pubblicData = jsencrypt.setEncrypt(publiukey, str2);
 				if (this.flag == 2) {
 					console.log('111')
 					// pest.pests.insect_discern 虫害
@@ -449,9 +477,11 @@
 						filePath: ev.path,
 						name: 'img_file',
 						formData: {
-							'user': 'test'
+							'user': 'test',
+							'sign':pubblicData
 						},
 						success: (uploadFileRes) => {
+							this.loadTF = false
 							console.log(JSON.parse(uploadFileRes.data))
 							uni.navigateTo({
 								url: "../disandpests/index?datas=" + uploadFileRes.data + "&path=" + ev.path
@@ -463,22 +493,23 @@
 					});
 				} else if (this.flag == 1) {
 					//pest.pests.insect_discern病害识别
-					uni.showLoading({
-						title: '加载中'
-					});
+					// uni.showLoading({
+					// 	title: '加载中'
+					// });
 					uni.uploadFile({
 						// url: 'http://114.115.147.140:8002/api/api_gateway?method=base.bases.base_photo', //仅为示例,非真实的接口地址
-						url: 'http://8.136.98.49:8002/api/api_gateway?method=pest.pests.plant_discern', //仅为示例,非真实的接口地址
+						url: 'https://wx.hnyfwlw.com/api/api_gateway?method=pest.pests.plant_discern', //仅为示例,非真实的接口地址
 						filePath: ev.path,
 						name: 'img_file',
 						formData: {
-							'user': 'test'
+							'user': 'test',
+							'sign':pubblicData
 						},
 						success: (uploadFileRes) => {
+							this.loadTF = false
 							console.log(JSON.parse(uploadFileRes.data))
 							uni.navigateTo({
-								url: "../disandpests/index?datas=" + uploadFileRes.data + "&path=" + ev
-									.path
+								url: "../disandpests/index?datas=" + uploadFileRes.data + "&path=" + ev.path
 							})
 						}
 					});
@@ -545,6 +576,10 @@
 					this.getcity(res.longitude, res.latitude)
 				}
 			})
+			// this.getUserlogin()
+		},
+		onShow() {
+			this.loadTF = false
 			this.getUserlogin()
 		}
 	}

+ 83 - 23
pages/irrigate/index.vue

@@ -1,8 +1,8 @@
 <template>
 	<view>
 		<view class="status_bar"></view>
-		<view class="" style="position: relative;top: 44px;">
-			<view style="position: fixed;z-index: 100;">
+		<view class="" style="position: relative;top: 40px;">
+			<!-- <view style="position: fixed;z-index: 100;">
 				<uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="灌溉控制系统" right-icon="search"
 					@clickRight="clickRight" size="16"></uni-nav-bar>
 				<view class="inputs" :style="{'width':width+'rpx'}">
@@ -10,6 +10,17 @@
 						class="inputbox" :clearable="false" />
 					<u-icon name="search" size="40" class="icon" @click="search"></u-icon>
 				</view>
+			</view> -->
+			<view style="position: fixed;z-index: 100;">
+				<uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回"
+				 size="16">
+				 <view class="bases_search">
+				 	<view class="bases_search_text" @click="search">
+				 		<u-icon name="search" class="search"></u-icon>
+				 		<input type="text" v-model="imports" placeholder="设备ID搜索" disabled @input="searchinp"/>
+				 	</view>
+				 </view>
+				 </uni-nav-bar>
 			</view>
 			<image :src="'http://www.hnyfwlw.com:8006/bigdata_app/image/irrigate/1.png'" mode="" class="image">
 			</image>
@@ -24,7 +35,7 @@
 				</view>
 			</view>
 			<view class="prevents">
-				<view class="prevents_item" v-for="item,index in eqlistdata" :key="index" @click="eqdetails(item)">
+				<view class="prevents_item" v-for="item,index in eqlistdata" :key="item.d_id" @click="eqdetails(item)">
 					<view class="" v-if="side_type == 18">
 						<image
 							:src="item.device_status==1?'http://www.hnyfwlw.com:8006/bigdata_app/image/prevention/6.png':'http://www.hnyfwlw.com:8006/bigdata_app/image/prevention/7.png'"
@@ -35,16 +46,17 @@
 								<view class="" :style="{'margin-right': '10rpx','color':item.status2?'#00B075':'#f00'}">
 									{{item.status2?"已启用":"已禁用"}}
 								</view>
-								<u-switch v-model="item.status2" size="35" active-color="#00B075"
-									style="margin-top: 10rpx;" inactive-color="#f00"
+								<!-- <u-switch v-model="item.status2" size="35" activeColor="#00B075"
+									style="margin-top: 10rpx;" inactiveColor="#f00"
 									@change="switchchange2($event,item.d_id,index)">
-								</u-switch>
+								</u-switch> -->
+								<switch @change="switchchange2($event,item.d_id,index)" v-if="$QueryPermission(256)" color="#00B075" :checked="item.status2" style="zoom:0.6" />
 							</view>
 						</view>
 						<view class="prevents_item_bot">
 							<view class="prevents_item_bot_item">
 								<p>设备 ID:{{item.device_id}}</p>
-								<p @click="newdata(item)">数据查看</p>
+								<p @click="newdata(item)" v-if="$QueryPermission(205)">数据查看</p>
 							</view>
 							<p style="color:#909696;height: 60rpx;line-height: 60rpx;">
 								设备状态:{{item.device_status==1?"在线":"离线"}}</p>
@@ -69,10 +81,11 @@
 									:style="{'margin-right': '10rpx','color':item.water_pump_switch2?'#00B075':'#f00'}">
 									{{item.water_pump_switch2?"已开泵":"已关泵"}}
 								</view>
-								<u-switch v-model="item.water_pump_switch2" size="35" active-color="#00B075"
+								<!-- <u-switch v-model="item.water_pump_switch2" size="35" active-color="#00B075"
 									inactive-color="#f00" style="margin-top: 10rpx;"
 									@change="switchchange($event,item.device_id,index)">
-								</u-switch>
+								</u-switch> -->
+								<switch @change="switchchange($event,item.d_id,index)" v-if="$QueryPermission(254)" color="#00B075" :checked="item.water_pump_switch2" style="zoom:0.6" />
 							</view>
 						</view>
 						<view class="prevents_item_bot">
@@ -107,13 +120,13 @@
 				</view>
 			</view>
 		</view>
-		<u-modal v-model="show" :show-cancel-button="true" title="请设置开泵时间" @confirm="modalconfirm"
-			@cancel="modalcancel">
+		<u-modal v-model="show" :showCancelButton="true" title="请设置开泵时间" @confirm="modalconfirm" @cancel="modalcancel">
 			<view class="slot-content">
-				<u-input v-model="timevalue" type="number" />分钟
+				<u-input v-model="timevalue" type="number" style="width: 80%;"/>
+				<p style="font-size: 12px;">分钟</p>
 			</view>
 		</u-modal>
-		<u-modal v-model="showremark" :show-cancel-button="true" title="请填写设备备注" @confirm="modalconfirmremark"
+		<u-modal v-model="showremark" :showCancelButton="true" title="请填写设备备注" @confirm="modalconfirmremark"
 			@cancel="modalcancelremark">
 			<view class="slot-contentremark">
 				<u-input v-model="timevalueremark" maxlength="12" />
@@ -169,7 +182,8 @@
 				selindex: "", //选中的设备index
 				selid: "", //选中的设备id
 				showremark: false,
-				timevalueremark: ""
+				timevalueremark: "",
+				key: true
 			}
 		},
 		methods: {
@@ -206,7 +220,7 @@
 					res.data[i]["water_pump_switch2"] = res.data[i].water_pump_switch == 1 ? true : false
 				}
 				this.eqlistdata = this.eqlistdata.concat(res.data)
-				// console.log(res)
+				console.log(this.eqlistdata)
 			},
 			async sfeqlist() { //设备列表
 				this.loadingtf = true
@@ -244,7 +258,11 @@
 				})
 			},
 			search() { //搜索按钮搜索
-				this.searchinp()
+				// this.searchinp()
+				console.log(111)
+				uni.navigateTo({
+					url:"./search?side_type="+this.side_type
+				})
 			},
 			searchinp() { //自动搜索
 				Debounce(() => {
@@ -297,7 +315,6 @@
 						url: "weathdata?item=" + JSON.stringify(item)
 					})
 				}
-
 			},
 			selectaddress(city, name) { //获取分布位置
 				uni.request({
@@ -349,8 +366,10 @@
 				this.timevalue = ""
 			},
 			switchchange(e, id, index) { //水肥 开关
-				console.log(e)
-				if (e) {
+				// console.log(e.detail.value)
+				// console.log(this.eqlistdata[index].water_pump_switch2)
+				this.eqlistdata[index].water_pump_switch2 = e.detail.value
+				if (e.detail.value) {
 					this.show = true
 					this.selindex = index
 					this.selid = id
@@ -437,7 +456,7 @@
 			},
 		},
 		onLoad() {
-			this.tubulareqlist()
+			// this.tubulareqlist()
 			uni.getStorage({
 				key: "jurisdiction",
 				success: (res) => {
@@ -459,6 +478,20 @@
 								break;
 						}
 					}
+					for (var i = 0; i < this.equipArr.length; i++) {
+						if (this.equipArr[i].tf) {
+							if (i == 0) {
+								this.tubulareqlist(); 
+							} else if (i == 1) {
+								this.eqlist();
+							} else {
+								this.sfeqlist();
+							}
+							this.active = i
+							this.side_type = this.equipArr[i].type
+							break
+						}
+					}
 				}
 			})
 		},
@@ -487,7 +520,34 @@
 	page {
 		background: $uni-bg-color-grey;
 	}
-
+	.bases_search {
+		width: 60%;
+		background-color: #FFFFFF;
+		position: absolute;
+		top: 10rpx;
+		left: 50%;
+		margin-left: -33%;
+		.bases_search_text {
+			width: 90%;
+			margin: 0 auto;
+			background-color: #F8F8F8;
+			height: 60rpx;
+			border-radius: 30rpx;
+			display: flex;
+			line-height: 60rpx;
+	
+			.search {
+				padding: 0 20rpx;
+				font-size: 34rpx;
+			}
+	
+			input {
+				width: 80%;
+				margin-top: 10rpx;
+				font-size: 28rpx;
+			}
+		}
+	}
 	.inputs {
 		height: 54rpx;
 		background-color: #E4E4E4;
@@ -541,7 +601,7 @@
 
 	.tab-box {
 		position: fixed;
-		top: 170px;
+		top: 164px;
 		display: flex;
 		justify-content: space-around;
 		font-size: 30rpx;
@@ -688,7 +748,7 @@
 	}
 
 	.slot-content {
-		width: 50%;
+		width: 60%;
 		margin: 30rpx auto;
 		display: flex;
 		line-height: 70rpx;

+ 564 - 0
pages/irrigate/search.vue

@@ -0,0 +1,564 @@
+<template>
+	<view>
+		<view class="search_top">
+			<view class="search_top_input">
+				<input type="text" value="" placeholder="请输入设备ID或设备名称" v-model="imports" @input="searchinp" />
+				<u-icon name="search" size="40" class="icon" @click="searchinp"></u-icon>
+			</view>
+		</view>
+		<view class="prevents">
+			<view class="prevents_item" v-for="item,index in eqlistdata" :key="item.d_id" @click="eqdetails(item)">
+				<view class="" v-if="side_type == 18">
+					<image
+						:src="item.device_status==1?'http://www.hnyfwlw.com:8006/bigdata_app/image/prevention/6.png':'http://www.hnyfwlw.com:8006/bigdata_app/image/prevention/7.png'"
+						mode="" class="prevents_item_img"></image>
+					<view class="prevents_item_top">
+						<p>设备名称:{{item.device_name}}</p>
+						<view class="" style="display: flex;">
+							<view class="" :style="{'margin-right': '10rpx','color':item.status2?'#00B075':'#f00'}">
+								{{item.status2?"已启用":"已禁用"}}
+							</view>
+							<switch @change="switchchange2($event,item.d_id,index)" color="#00B075" :checked="item.status2" style="zoom:0.6" />
+						</view>
+					</view>
+					<view class="prevents_item_bot">
+						<view class="prevents_item_bot_item">
+							<p>设备 ID:{{item.device_id}}</p>
+							<p @click="newdata(item)">数据查看</p>
+						</view>
+						<p style="color:#909696;height: 60rpx;line-height: 60rpx;">
+							设备状态:{{item.device_status==1?"在线":"离线"}}</p>
+						<p style="color:#909696;height: 60rpx;line-height: 60rpx;">设备备注:{{item.device_notes}}
+							<u-icon name="edit-pen" size="36" color="#00B075" @click="changeremark(item,index)">
+							</u-icon>
+						</p>
+						<view class="prevents_item_bot_item">
+							<p>地址:{{item.city}}</p>
+							<u-icon name="map" size="40" color="#00B075"
+								@click="selectaddress(item.city,item.device_name)"></u-icon>
+						</view>
+					</view>
+				</view>
+				<view class="" v-if="side_type == 17">
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/prevention/6.png" mode=""
+						class="prevents_item_img"></image>
+					<view class="prevents_item_top">
+						<p>设备名称:{{item.device_name}}</p>
+						<view class="" style="display: flex;">
+							<view class=""
+								:style="{'margin-right': '10rpx','color':item.water_pump_switch2?'#00B075':'#f00'}">
+								{{item.water_pump_switch2?"已开泵":"已关泵"}}
+							</view>
+							<switch @change="switchchange($event,item.d_id,index)" color="#00B075" :checked="item.water_pump_switch2" style="zoom:0.6" />
+						</view>
+					</view>
+					<view class="prevents_item_bot">
+						<view class="prevents_item_bot_item">
+							<p>设备 ID:{{item.device_id}}</p>
+							<p @click="newdata(item)" v-if="item.water_pump_switch2">实时数据</p>
+						</view>
+						<p style="color:#909696;height: 60rpx;line-height: 60rpx;">
+							设备状态:{{item.device_status==1?"在线":"离线"}}</p>
+						<p style="color:#909696;height: 60rpx;line-height: 60rpx;">设备备注:{{item.device_notes}}
+							<u-icon name="edit-pen" size="36" color="#00B075" @click="changeremark(item,index)">
+							</u-icon>
+						</p>
+						<view class="prevents_item_bot_item">
+							<p>地址:{{item.city}}</p>
+							<u-icon name="map" size="40" color="#00B075"
+								@click="selectaddress(item.city,item.device_name)"></u-icon>
+						</view>
+					</view>
+				</view>
+				<view class="" v-if="side_type == 13">
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/image/prevention/6.png" mode=""
+						class="prevents_item_img"></image>
+					<view class="prevents_item_top">
+						<p>设备名称:{{item.device_name}}</p>
+					</view>
+					<view class="prevents_item_bot">
+						<p>设备 ID:{{item.equip_id || item.device_id}}</p>
+						<p>最新上报时间:{{item.uptime|timeFormat()}}</p>
+					</view>
+				</view>
+			</view>
+		</view>
+		<u-modal v-model="show" :showCancelButton="true" title="请设置开泵时间" @confirm="modalconfirm" @cancel="modalcancel">
+			<view class="slot-content">
+				<u-input v-model="timevalue" type="number" style="width: 80%;"/>
+				<p style="font-size: 12px;">分钟</p>
+			</view>
+		</u-modal>
+		<u-modal v-model="showremark" :showCancelButton="true" title="请填写设备备注" @confirm="modalconfirmremark"
+			@cancel="modalcancelremark">
+			<view class="slot-contentremark">
+				<u-input v-model="timevalueremark" maxlength="12" />
+			</view>
+		</u-modal>
+		<view class="top">
+			<view class="backtop" @click="top" v-if="isTop">
+				<image src="../../static/images/1.png" mode="" class="img0"></image>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		Debounce,
+		Throttle
+	} from "../../util/anitthro.js"
+	export default {
+		data() {
+			return {
+				eqlistdata:[],
+				imports:"",
+				side_type:"",
+				page:1,
+				show: false,
+				showremark: false,
+				isTop:false
+			}
+		},
+		methods: {
+			async eqlist() { //设备列表 水肥一体化 L
+				this.loadingtf = true
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=irrigation_system.waterfertilizer.water_fertilizer_list',
+					data: {
+						page: this.page,
+						page_size: 10,
+						content: this.imports
+					}
+				})
+				console.log(res)
+				this.loadingtf = false
+				for (var i = 0; i < res.data.length; i++) {
+					res.data[i]["status2"] = res.data[i].status == 1 ? true : false
+				}
+				this.eqlistdata = this.eqlistdata.concat(res.data)
+			},
+			async tubulareqlist() { //水电双计
+				this.loadingtf = true
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=irrigation_system.hydropower.hydropower_list',
+					data: {
+						page: this.page,
+						page_size: 10,
+						content: this.imports
+					}
+				})
+				console.log(res)
+				this.loadingtf = false
+				for (var i = 0; i < res.data.length; i++) {
+					res.data[i]["water_pump_switch2"] = res.data[i].water_pump_switch == 1 ? true : false
+				}
+				this.eqlistdata = this.eqlistdata.concat(res.data)
+				console.log(this.eqlistdata)
+			},
+			async sfeqlist() { //设备列表
+				this.loadingtf = true
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=weather.weather.sf_page',
+					data: {
+						page: this.page,
+						page_size: "10",
+						device_id: this.imports,
+					}
+				})
+				this.loadingtf = false
+				this.eqlistdata = this.eqlistdata.concat(res.ids)
+				console.log(this.eqlistdata)
+			},
+			eqdetails(data) {
+				if (this.side_type == 13) {
+					uni.navigateTo({
+						url: "../waterandfer/datails?shebei=" + JSON.stringify(data)
+					})
+				}
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500
+				})
+			},
+			search() { //搜索按钮搜索
+				// this.searchinp()
+				console.log(111)
+				uni.navigateTo({
+					url:"./search?side_type="+this.side_type
+				})
+			},
+			searchinp() { //自动搜索
+				Debounce(() => {
+					this.page = 1
+					this.eqlistdata = []
+					if (this.side_type == 18) {
+						this.eqlist()
+					} else if (this.side_type == 17) {
+						this.tubulareqlist()
+					} else if (this.side_type == 13) {
+						this.sfeqlist()
+					}
+				}, 1000)()
+			},
+			tabClick(index, type) {
+				this.active = index
+				this.side_type = type
+				this.page = 1
+				if (type == 18) {
+					this.eqlistdata = []
+					this.eqlist()
+				} else if (type == 17) {
+					this.eqlistdata = []
+					this.tubulareqlist()
+				} else if (type == 13) {
+					this.eqlistdata = []
+					this.sfeqlist()
+				}
+			},
+			timezhuan(time) {
+				function fun(a) {
+					return String(a).length == 1 ? '0' + a : a
+				}
+				let date = new Date(time * 1000)
+				let y = date.getFullYear()
+				let m = date.getMonth() + 1
+				let d = date.getDate()
+				let h = date.getHours()
+				let min = date.getMinutes()
+				let sec = date.getSeconds()
+				return `${y}-${fun(m)}-${fun(d)} ${fun(h)}:${fun(min)}:${fun(sec)}`
+			},
+			newdata(item) {
+				if (this.side_type == 17) {
+					uni.navigateTo({
+						url: "realtimedata?item=" + JSON.stringify(item)
+					})
+				} else {
+					uni.navigateTo({
+						url: "weathdata?item=" + JSON.stringify(item)
+					})
+				}
+			},
+			selectaddress(city, name) { //获取分布位置
+				uni.request({
+					type: "GET",
+					url: "https://restapi.amap.com/v3/geocode/geo?address=" + city +
+						"&key=78ce288400f4fc6d9458989875c833c2",
+					dataType: "json",
+					complete: ress => {
+						console.log(ress)
+						if (ress.data.status == 1) {
+							// ress.data.geocodes[0].location
+							uni.navigateTo({
+								url: "./irrmap?lnglat=" + ress.data.geocodes[0].location +
+									"&basename=" + name
+							})
+						} else {
+							uni.showToast({
+								title: "地址编译失败",
+								icon: "none"
+							})
+						}
+					}
+				});
+			},
+			async pumpcontrol(en) { //水肥开关
+				console.log(en)
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=irrigation_system.hydropower.water_pump_control',
+					data: {
+						times: Math.floor(this.timevalue * 60),
+						device_id: this.selid,
+						status: en ? 1 : 0
+					}
+				})
+				console.log(res)
+				if (res.code == 200) {
+					uni.showToast({
+						title: "操作成功",
+						icon: "none"
+					})
+				} else {
+					uni.showToast({
+						title: res.msg,
+						icon: "none"
+					})
+					this.eqlistdata[this.selindex].water_pump_switch2 = !this.eqlistdata[this.selindex]
+						.water_pump_switch2
+				}
+				this.timevalue = ""
+			},
+			switchchange(e, id, index) { //水肥 开关
+				// console.log(e.detail.value)
+				// console.log(this.eqlistdata[index].water_pump_switch2)
+				this.eqlistdata[index].water_pump_switch2 = e.detail.value
+				if (e.detail.value) {
+					this.show = true
+					this.selindex = index
+					this.selid = id
+				} else {
+					this.selid = id
+					this.pumpcontrol(false)
+				}
+			},
+			async switchchange2(e, id, index) { //水电开关
+				console.log(id)
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=irrigation_system.waterfertilizer.water_fertilizer_control',
+					data: {
+						device_ids: id,
+						isopen: e ? 1 : 0
+					}
+				})
+				console.log(res)
+				if (res.info == "ok") {
+					uni.showToast({
+						title: "操作成功",
+						icon: "none"
+					})
+				} else {
+					uni.showToast({
+						title: res.msg,
+						icon: "none"
+					})
+					this.eqlistdata[index].status2 = !this.eqlistdata[index].status2
+				}
+			},
+			modalcancel() { //水肥开关 确定
+				this.eqlistdata[this.selindex].water_pump_switch2 = !this.eqlistdata[this.selindex].water_pump_switch2
+				this.timevalue = ""
+			},
+			modalconfirm() { //水肥开关 取消
+				this.show = true
+				if (this.timevalue == "") {
+					uni.showToast({
+						title: "请输入开泵时间",
+						icon: "none"
+					})
+				} else {
+					this.show = false
+					this.pumpcontrol(true)
+				}
+			},
+			changeremark(item, index) { //修改备注
+				this.timevalueremark = item.device_notes
+				this.showremark = true
+				this.selindex = index
+				this.selid = item.device_id
+			},
+			modalcancelremark() { //修改备注 取消
+			},
+			modalconfirmremark() { //修改备注 确定
+				this.showremark = true
+				if (this.timevalueremark == "") {
+					uni.showToast({
+						title: "请输入设备备注",
+						icon: "none"
+					})
+				} else {
+					this.showremark = false
+					this.setchangeremark()
+				}
+			},
+			async setchangeremark() { //水肥开关
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=irrigation_system.hydropower.water_pump_modify_device_notes',
+					data: {
+						device_id: this.selid,
+						content: this.timevalueremark
+					}
+				})
+				console.log(res)
+				if (res) {
+					uni.showToast({
+						title: "操作成功",
+						icon: "none"
+					})
+					this.eqlistdata[this.selindex].device_notes = this.timevalueremark
+				}
+			},
+		},
+		onLoad(option) {
+			this.side_type = option.side_type
+			console.log(this.side_type)
+		},
+		onReachBottom() {
+			this.page++
+			// this.eqlist()
+			if (this.side_type == 18) {
+				this.eqlist()
+			} else if (this.side_type == 17) {
+				this.tubulareqlist()
+			} else if (this.side_type == 13) {
+				this.sfeqlist()
+			}
+		},
+		onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) { //距离大于200时显示
+				this.isTop = true
+			} else { //距离小于200时隐藏
+				this.isTop = false
+			}
+		},
+	}
+</script>
+
+<style lang="scss">
+	.search_top{
+		width: 100%;
+		background-color: #fff;
+		position: fixed;
+		top: 0;
+		z-index: 999;
+	}
+	.search_top_input {
+		width: 90%;
+		height: 54rpx;
+		background-color: #E4E4E4;
+		border-radius: 27rpx;
+		padding-top: 8rpx;
+		box-sizing: border-box;
+		margin: 0 auto;
+		position: relative;
+		input {
+			width: 85%;
+			// text-indent: 1rem;
+			font-size: 26rpx;
+			padding-left: 20px;
+			box-sizing: border-box;
+		}
+
+		.icon {
+			position: absolute;
+			top: 8rpx;
+			right: 26rpx;
+		}
+	}
+	.prevents {
+		width: 100%;
+		margin-top: 40px;
+		.prevents_item {
+			width: 95%;
+			margin: 0 auto 30rpx;
+			border-radius: 10rpx;
+			box-shadow: 0 0 10rpx #bcb9ca;
+			padding: 20rpx 40rpx 20rpx 80rpx;
+			box-sizing: border-box;
+			position: relative;
+			background-color: #fff;
+	
+			.prevents_item_img {
+				width: 30rpx;
+				height: 50rpx;
+				position: absolute;
+				top: -4rpx;
+				left: 30rpx;
+			}
+	
+			.prevents_item_top {
+				display: flex;
+				justify-content: space-between;
+				height: 60rpx;
+				border-bottom: 2rpx solid #F4F4F4;
+				line-height: 60rpx;
+				font-size: 26rpx;
+	
+				.red {
+					color: #ff0000;
+				}
+	
+				.green {
+					color: #7DBB91;
+				}
+			}
+	
+			.prevents_item_bot {
+				margin-top: 20rpx;
+				font-size: 26rpx;
+				color: #BDBDBD;
+	
+				.prevents_item_bot_item {
+					height: 60rpx;
+					line-height: 60rpx;
+					display: flex;
+					justify-content: space-between;
+					color: #909696;
+	
+					p:first-child {
+						width: 80%;
+						overflow: hidden; //溢出隐藏
+						white-space: nowrap; //禁止换行
+						text-overflow: ellipsis; //...
+					}
+	
+					p:nth-child(2) {
+						height: 45rpx;
+						color: #00B075;
+						border-bottom: 1px solid #00B075;
+					}
+				}
+	
+				.prevents_item_bot_sapn0 {
+					color: #00B075;
+				}
+	
+				.prevents_item_bot_sapn1 {
+					color: #FF4747;
+				}
+	
+				.prevents_item_bot_sapn2 {
+					color: #FFAB00;
+				}
+			}
+		}
+	}
+	.top {
+		position: fixed;
+		right: 10px;
+		bottom: 40px;
+		z-index: 100;
+	
+		image {
+			width: 100rpx;
+			height: 100rpx;
+		}
+	
+		.backtop {
+			display: flex;
+			justify-content: flex-end;
+			margin-bottom: 10rpx;
+		}
+	
+		.more {
+			display: flex;
+		}
+	
+		.box {
+			width: 80rpx;
+			height: 80rpx;
+			background-color: rgba(161, 161, 161, 0.45);
+			border-radius: 50%;
+			text-align: center;
+			line-height: 80rpx;
+			box-sizing: border-box;
+			margin: 14rpx 10rpx 0 0;
+			color: #fff;
+		}
+	}
+	.slot-content {
+		width: 60%;
+		margin: 30rpx auto;
+		display: flex;
+		line-height: 70rpx;
+	}
+	
+	.slot-contentremark {
+		width: 70%;
+		margin: 30rpx auto;
+		display: flex;
+		line-height: 70rpx;
+	}
+</style>

+ 1 - 1
pages/irrigate/weathdata.vue

@@ -13,7 +13,7 @@
 				设备ID:{{item.device_id}}
 			</view>
 			<view class="datainfo_item">
-				设备状态:{{item.device_notes==''?"--":item.device_notes}}
+				设备备注:{{item.device_notes==''?"--":item.device_notes}}
 			</view>
 			<view class="datainfo_item">
 				设备状态:{{item.device_status==1?"在线":"离线"}}

+ 3 - 2
pages/my/user-info/user-info.vue

@@ -8,8 +8,9 @@
 		</view>
 		<view class="info-item">
 			<text class="tit">用户名</text>
-			<input type="text" v-model="userinfos.username" :class="compileTF?'valinput valinput2':'valinput'" :disabled="!compileTF"
-			 maxlength='8' />
+			<text class="val">{{userinfos.username}}</text>
+			<!-- <input type="text" v-model="userinfos.username" :class="compileTF?'valinput valinput2':'valinput'" :disabled="!compileTF"
+			 maxlength='8' /> -->
 		</view>
 		<view class="info-item">
 			<text class="tit">用户身份</text>

+ 85 - 13
pages/prevention/control.vue

@@ -51,22 +51,21 @@
 				<view class="control_interval">
 					<p class="title_p">上传时间间隔(min)</p>
 					<view class="slider">
-						<view class="" style="width: 90%;padding-top: 18rpx;">
-							<u-slider v-model="condatas.dattim" min="0" max="100" step="1" active-color="#58C876"></u-slider>
-						</view>
-						<view class="" style="width: 10%;text-align: center;">
-							{{condatas.dattim}}
+						<view class="" style="width: 100%;padding-top: 18rpx;">
+							<slider value="0" v-model="condatas.dat_f" min="0" max="120" step="1" show-value block-size="18" activeColor="#57C878" @changing="changing"></slider>
 						</view>
 					</view>
 				</view>
 				<view class="control_timing">
 					<p class="title_p">自清虫定时(min)</p>
 					<view class="slider">
-						<view class="" style="width: 90%;padding-top: 18rpx;">
-							<u-slider v-model="condatas.clt" min="0" max="100" step="1" active-color="#58C876"></u-slider>
+						<view class="" style="width: 100%;padding-top: 18rpx;">
+							<slider value="0" v-model="condatas.clt_t" min="0" max="120" step="1" show-value block-size="18" activeColor="#57C878" @changing="changing2"></slider>
 						</view>
-						<view class="" style="width: 10%;text-align: center;">
-							{{condatas.clt}}
+					</view>
+					<view class="qingchong" v-if="allqingchong">
+						<view class="qingchongbox" @click="suzumusi">
+							清 虫
 						</view>
 					</view>
 				</view>
@@ -92,6 +91,7 @@
 	export default {
 		data() {
 			return {
+				myuid:"",
 				condatas: {
 					clt:0,
 					dattim:0
@@ -153,7 +153,8 @@
 					minute: false,
 					second: false
 				},
-				myuser_type:false
+				myuser_type:false,
+				allqingchong:false
 			}
 		},
 		methods: { //forecast.send_control.device_control_info
@@ -245,17 +246,71 @@
 					this.reorup(obj)
 			},
 			ensure() {
-				let str = JSON.stringify(this.condatas)
-				console.log(str)
+				console.log(this.condatas)
+				var obj = {}
+				for(var key in this.condatas){
+					if(key == "dat_f"){
+						obj["dattim"] = this.condatas[key]
+					}else if(key == "clt_t"){
+						obj["clt"] = this.condatas[key]
+					}else{
+						obj[key] = this.condatas[key]
+					}
+				}
+				let str = JSON.stringify(obj)
 				this.controlby(str)
 				this.clickLeft()
-			}
+			},
+			async getworm() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.clear_insects_permission',
+					data: {}
+				})
+				console.log(res)
+				this.allqingchong = res[0] == 1 ? true : false;
+			},
+			async suzumusi(){
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.device_control',
+					data: {
+						config: '{"cmd":"ctr_clear"}',
+						d_id: this.d_id,
+						device_type_id: "2",
+						req: "ctr_clear",
+					}
+				})
+				// console.log(res)
+				if (res == true) {
+					uni.showToast({
+						title: '指令下发成功!'
+					});
+				} else {
+					uni.showToast({
+						title: '指令下发失败!'
+					});
+				}
+			},
+			changing(e){
+				// console.log(e.detail.value)
+				this.condatas.dat_f = e.detail.value
+			},
+			changing2(e){
+				// console.log(e.detail.value)
+				this.condatas.clt_t = e.detail.value
+			},
 		},
 		onLoad(option) {
 			this.$forceUpdate()
+			this.getworm()
 			this.controldata(option.id)
 			this.d_id = option.id
 			uni.getStorage({
+				key: "myuid",
+				success: (res) => {
+					this.myuid = res.data
+				}
+			})
+			uni.getStorage({
 				key: "myuser_type",
 				success: (res) => {
 					if (Number(res.data) == 1) {
@@ -297,6 +352,9 @@
 			padding: 0 30rpx 0 0;
 			margin-left: 24rpx;
 			margin-bottom: 20rpx;
+			/deep/uni-slider{
+				margin: 0 !important;
+			}
 		}
 
 		.control_restart {
@@ -372,4 +430,18 @@
 			border-radius: 30rpx;
 		}
 	}
+	.qingchong{
+		width: 90%;
+		margin: 10px auto;
+		text-align: right;
+		display: flex;
+		justify-content: flex-end;
+		.qingchongbox{
+			padding: 2px 8px 3px 8px;
+			background-color: #28AE4F;
+			color: #fff;
+			border-radius: 5px;
+			// line-height: 27px;
+		}
+	}
 </style>

+ 3 - 36
pages/prevention/equipmentdetails.vue

@@ -22,15 +22,15 @@
 				</view>
 			</view>
 			<view class="control">
-				<view class="control_item" v-if="kongtf" @click="control">
+				<view class="control_item" v-if="$QueryPermission(75)" @click="control">
 					<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/environment/8.png'" mode=""></image>
 					<p>设备控制</p>
 				</view>
-				<view class="control_item" v-if="shujutf" @click="charts">
+				<view class="control_item" v-if="$QueryPermission(77)" @click="charts">
 					<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/environment/10.png'" mode=""></image>
 					<p>历史数据</p>
 				</view>
-				<view class="control_item" v-if="simtf" @click="sim">
+				<view class="control_item" v-if="$QueryPermission(76)" @click="sim">
 					<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/environment/9.png'" mode=""></image>
 					<p>SIM卡详情</p>
 				</view>
@@ -237,39 +237,6 @@
 			console.log(JSON.parse(option.shebei))
 			this.eqlist(JSON.parse(option.shebei).device_id || JSON.parse(option.shebei).imei)
 			this.selectaddress(this.eqinfo.item.lat, this.eqinfo.item.lng)
-			uni.getStorage({
-				key: "jurisdiction",
-				success: (res) => {
-					console.log(JSON.parse(res.data))
-					let items = JSON.parse(res.data).filter((item) => {
-						return item.pur_id == 44
-					})
-					let items2 = items[0].children.filter((item) => {
-						return item.pur_id == 45
-					})
-					var arr = items2[0].children
-					console.log(arr)
-					for (var i = 0; i < arr.length; i++) {
-						switch (arr[i].pur_id) {
-							case 75://"设备操作"
-								this.kongtf = true
-								break
-							case 78:
-								this.kongtf = true
-								break
-							case 76://"SIM卡状态"
-								this.simtf = true
-								break
-							case 76://"SIM卡"
-								this.simtf = true
-								break
-							case 77://"数据详情"
-								this.shujutf = true
-								break
-						}
-					}
-				},
-			})
 		}
 	}
 </script>

+ 25 - 1
pages/prevention/index.vue

@@ -49,6 +49,9 @@
 				<image src="../../static/images/1.png" mode="" class="img0"></image>
 			</view>
 			<view class="more">
+				<view class="box" @click="allwormdel" v-show="allqingchong&&filtrateTF">
+					<p>清虫</p>
+				</view>
 				<view class="box" @click="online" v-show="filtrateTF">
 					<p>在线</p>
 				</view>
@@ -79,7 +82,8 @@
 				loadingtf:false,//loading
 				show: false,
 				title: "",
-				content: ""
+				content: "",
+				allqingchong:false
 			}
 		},
 		methods: {
@@ -172,8 +176,28 @@
 				let sec = date.getSeconds()
 				return `${y}-${fun(m)}-${fun(d)} ${fun(h)}:${fun(min)}:${fun(sec)}`
 			},
+			async getworm() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.clear_insects_permission',
+					data: {}
+				})
+				console.log(res)
+				this.allqingchong = res[1] == 1 ? true : false;
+			},
+			async allwormdel() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.clear_insects',
+					data: {}
+				})
+				console.log(res)
+				uni.showToast({
+					title: res ? "指令下发成功" : "指令下发失败",
+					icon: "none"
+				})
+			}
 		},
 		onLoad() {
+			this.getworm()
 			this.eqlist()
 		},
 		onReachBottom() {

+ 60 - 11
pages/prevention/ucharts.vue

@@ -35,7 +35,7 @@
 					disable-scroll=true
 					:style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>
 			</view>
-			<view class="shuju_two" v-show="!pickshow&&!picktwoshow">
+			<view class="shuju_two" v-show="allqingchong&&!pickshow&&!picktwoshow">
 				<view class="canvastishi" v-if="!canvastishiTF && !dataloadingtf">
 					暂无数据
 				</view>
@@ -47,12 +47,12 @@
 					disable-scroll=true
 					:style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>
 			</view>
-			<view class="refresh" @click="refresh">
+			<view class="refresh" @click="refresh" :style="{'top': allqingchong?'1380rpx':'790rpx'}">
 				刷 新
 			</view>
-			<view class="condition">
+			<view class="condition" :style="{'top': allqingchong?'1450rpx':'870rpx'}">
 				<scroll-view scroll-top="0" scroll-x="true" class="scroll-X">
-					<table class="table">
+					<table class="table" v-if="$QueryPermission(264)">
 						<tr class="tr">
 							<th class="th" v-for="(item,index) in thdata" :key="'a'+index">{{item}}</th>
 						</tr>
@@ -69,9 +69,47 @@
 							<td class="td">{{items.d_h_t.ah==""?"--":items.d_h_t.ah}}</td>
 							<td class="td">{{items.d_h_t.cv}}</td>
 							<td class="td">{{items.d_h_t.bv}}</td>
+							<td class="td">{{items.d_h_t.csq}}</td>
 						</tr>
 						<tr class="tr" v-if="!forbidden">
-							<td class="td" v-for="item in 12">暂无数据</td>
+							<td class="td" v-for="item in 13">暂无数据</td>
+						</tr>
+					</table>
+					<table class="table2" v-else-if="!allqingchong">
+						<tr class="tr">
+							<th class="th" v-for="(item,index) in thdata3" :key="'a'+index">{{item}}</th>
+						</tr>
+						<tr class="tr" v-for="(items,indexs) in eqlistdata" :key="'b'+indexs" v-if="forbidden">
+							<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
+							<td class="td">{{items.d_h_t.ds==0?"关机":"开机"}}</td>
+							<td class="td">{{items.d_h_t.ws==0?"待机":(items.d_h_t.ws==1?"工作":"充电")}}</td>
+							<td class="td">{{items.d_h_t.tps==0?"正常":"保护"}}</td>
+							<td class="td">{{items.d_h_t.tt}}</td>
+							<td class="td">{{items.d_h_t.at==""?"--":items.d_h_t.at}}</td>
+							<td class="td">{{items.d_h_t.ah==""?"--":items.d_h_t.ah}}</td>
+						</tr>
+						<tr class="tr" v-if="!forbidden">
+							<td class="td" v-for="item in 7">暂无数据</td>
+						</tr>
+					</table>
+					<table class="table2" v-else>
+						<tr class="tr">
+							<th class="th" v-for="(item,index) in thdata2" :key="'a'+index">{{item}}</th>
+						</tr>
+						<tr class="tr" v-for="(items,indexs) in eqlistdata" :key="'b'+indexs" v-if="forbidden">
+							<td class="td">{{items.d_h_t.addtime|timeFormat()}}</td>
+							<td class="td">{{items.d_h_t.ds==0?"关机":"开机"}}</td>
+							<td class="td">{{items.d_h_t.ws==0?"待机":(items.d_h_t.ws==1?"工作":"充电")}}</td>
+							<td class="td">{{items.d_h_t.rps==0?"正常":"保护"}}</td>
+							<td class="td">{{items.d_h_t.tps==0?"正常":"保护"}}</td>
+							<td class="td">{{items.d_h_t.dps==0?"正常":"保护"}}</td>
+							<td class="td">{{items.d_h_t.tt}}</td>
+							<td class="td">{{items.d_h_t.ct}}</td>
+							<td class="td">{{items.d_h_t.at==""?"--":items.d_h_t.at}}</td>
+							<td class="td">{{items.d_h_t.ah==""?"--":items.d_h_t.ah}}</td>
+						</tr>
+						<tr class="tr" v-if="!forbidden">
+							<td class="td" v-for="item in 10">暂无数据</td>
 						</tr>
 					</table>
 				</scroll-view>
@@ -102,8 +140,10 @@
 		data() {
 			return {
 				thdata: ["上报时间", "设备开关", "工作状态", "雨控状态", "温控状态", "倾倒状态", "定时(h)", "电击次数", "温度(℃)", "湿度(%)", "充电电压(v)",
-					"电池电压(v)",
+					"电池电压(v)", "信号强度"
 				],
+				thdata2: ["上报时间", "设备开关", "工作状态", "雨控状态", "温控状态", "倾倒状态", "定时(h)", "电击次数", "温度(℃)", "湿度(%)"],
+				thdata3: ["上报时间", "设备开关", "工作状态", "温控状态", "定时(h)", "温度(℃)", "湿度(%)"],
 				eqlistdata: [],
 				cWidth: '400',
 				cHeight: '400',
@@ -133,7 +173,8 @@
 				},
 				canvastishiTF: false, //暂无数据提示
 				dataloadingtf: true, //加载中提示
-				pagesum: 1
+				pagesum: 1,
+				allqingchong:false
 			}
 		},
 		// 页面加载执行的函数
@@ -142,6 +183,7 @@
 			this.times.imei = option.imei
 			this.cWidth = uni.upx2px(650);
 			this.cHeight = uni.upx2px(500);
+			this.getworm()
 		},
 		onShow() {
 			presenttime = +new Date();
@@ -449,9 +491,6 @@
 						duration: 2000,
 						icon: "none"
 					});
-					uni.navigateBack({
-						delta: 1
-					})
 				} else {
 					uni.showToast({
 						title: '刷新失败',
@@ -463,6 +502,14 @@
 			refresh() { //获取当前时间的数据
 				this.newdata()
 			},
+			async getworm() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=forecast.send_control.clear_insects_permission',
+					data: {}
+				})
+				console.log(res)
+				this.allqingchong = res[2] == 1 ? false : true;
+			},
 		}
 	}
 </script>
@@ -608,7 +655,9 @@
 			.table {
 				width: 1056px;
 			}
-
+			.table2{
+				width: 800px;
+			}
 			.tr {
 				display: flex;
 				overflow: hidden;

+ 815 - 0
pages/qxzyj/cbwarn.vue

@@ -0,0 +1,815 @@
+<template>
+	<view class="content">
+		<view class="cbwtop">
+			<image :src="
+			  'http://www.hnyfwlw.com:8006/bigdata_app/image/cbyj/banner2.png'
+			" mode="" class="image">
+			</image>
+			<view class="tab-box">
+				<view v-for="(item, index) in equipArr" :key="index" @click="tabClick(index)"
+					:class="['tab-item', active == index ? 'active' : '']">
+					<text>{{ item }}</text>
+					<text class="bottom-line"></text>
+				</view>
+			</view>
+			<view class="timeandtype" v-if="active==0">
+				<view class="timebox">
+					<view class="firsttime" @click="timeshow=true">
+						{{start_time==""?'请选择开始时间':start_time}}
+					</view>
+					<view class="jiange">
+						-
+					</view>
+					<view class="endtime" @click="timeshow=true">
+						{{end_time==""?'请选择结束时间':end_time}}
+					</view>
+					<view class="jiange" @click="closetime">
+						<u-icon name="close-circle" color="#999999"></u-icon>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="" v-show="active==0">
+			<view class="warmlistbox">
+				<view class="warmlistbox_item" v-for="item in wranlistdata" :key="item.id" @click="singleread(item)">
+					<view class="warmlistbox_item_title" :style="{'border-color':item.status==1?'#14A478':'#fd4646'}">
+						<!-- {{recordtypelist[item.warning_type].label}} -->
+						气象预警
+					</view>
+					<view class="warmlistbox_item_text">
+						<view class="item_text_item">
+							<view class="item_text_item_f">
+								设备编号:
+							</view>
+							<view class="item_text_item_e">
+								{{item.device_id}}
+							</view>
+						</view>
+						<view class="item_text_item">
+							<view class="item_text_item_f">
+								设备位置:
+							</view>
+							<view class="item_text_item_e" style="display: flex;">
+								<u-icon name="map-fill" color="#14A478" @click.stop="tomap(item)"></u-icon>
+								<view class="" style="margin-left: 10rpx;color: #14A478;" @click.stop="tomap(item)">
+									查看
+								</view>
+							</view>
+						</view>
+						<view class="item_text_item">
+							<view class="item_text_item_f">
+								设备预警:
+							</view>
+							<view class="item_text_item_e">
+								{{item.warning_content}}
+							</view>
+						</view>
+						<view class="item_text_sta">
+							<view class="" style="color: #959699;">
+								{{item.upl_time | timeFormat()}}
+							</view>
+							<view class="" :style="{'margin-left':'10rpx','color':item.status==1?'#959699':'#FD4646'}">
+								{{item.status==1?'已读':'未读'}}
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="warmissuebox" v-show="active == 1">
+			<view class="warmissue">
+				<view class="warmissue_itemone">
+					<view class="">
+						短信剩余条数:
+					</view>
+					<view class="">
+						{{total_sms_counts}}
+					</view>
+				</view>
+				<view class="warmissue_item">
+					<view class="warmissue_item_title">
+						短信内容:
+					</view>
+					<view class="warmissue_item_text">
+						<view class="">
+							尊敬的用户您好,管理员 提醒您,结合近期设备上报的数据,
+						</view>
+						<view class="" style="margin: 20rpx 0 ;">
+							<u-input v-model="wormvalue" type="textarea" :border="true" maxlength="30" />
+						</view>
+						<view class="">
+							请注意防范。
+						</view>
+					</view>
+				</view>
+				<view class="">
+					<view class="warmissue_itemone">
+						<view class="">
+							短信接受人:
+						</view>
+						<view class="" style="color: #14A478;" @click="tobook">
+							预警通讯录编辑
+						</view>
+					</view>
+					<view class="warmissue_itemtwo" @click="accServiceShow = true">
+						<view class="itemtwo_left" v-show="!userphone.length">
+							请选择短信接收人
+						</view>
+						<view class="itemtwo_left" v-show="userphone.length">
+							<view class="" style="margin-right: 20rpx;" v-for="item in userphone" :key="item.value">
+								{{item.name}}
+							</view>
+						</view>
+						<u-icon name="arrow-down" class="icon" color="#999999"></u-icon>
+					</view>
+				</view>
+			</view>
+			<view class="sendbox" @click="send">
+				发送预警
+			</view>
+		</view>
+		<view class="wornsetbox" v-show="active == 2">
+			<view class=""  v-for="(item, index) in configlist" :key="item.id"  style="margin-bottom: 30rpx;">
+				<u-swipe-action :show="item.show" :index="index"
+					@click="delconfig(item.id)" :options="options">
+					<view class="wornsetbox_item" @click="toset(item.id)">
+						<view class="">
+							{{item.title}}
+						</view>
+						<view class="" @click.stop>
+							<u-switch v-model="item.statustf" size="40" style="margin-top: 13rpx;"
+								@change="swichchange($event,item.id)"></u-switch>
+						</view>
+					</view>
+				</u-swipe-action>
+			</view>
+		</view>
+		<view class="addwarnlist" v-show="active == 2" @click="addshow = true">
+			添 加
+		</view>
+		<view class="">
+			<u-mask :show="accServiceShow" z-index="998"></u-mask>
+			<u-calendar v-model="timeshow" :mode="mode" @change="timechange"></u-calendar>
+			<multiple-select v-model="accServiceShow" :value="accServiceShow" :data="serviceList"
+				:default-selected="defaultSelected" @confirm="accServiceConfirm"></multiple-select>
+			<u-modal v-model="modalshow" title="短信预警详情" :content="content" @confirm="singlereadsure"></u-modal>
+			<u-modal v-model="addshow" title="添加预警" :show-cancel-button="true" @confirm="addwarning_config">
+				<view class="addinfobox">
+					<view class="addinfobox_title">
+						<span>*</span>
+						<span>预警名称</span>
+					</view>
+					<u-input v-model="addvalue" maxlength="10" />
+				</view>
+			</u-modal>
+		</view>
+		<view class="top" v-if="active!=1">
+			<view class="backtop" @click="top" v-if="isTop">
+				<image :src="src" mode=""></image>
+			</view>
+			<view class="more" @click="allread" v-show="active==0">
+				<view class="">
+					一键
+				</view>
+				<view class="">
+					已读
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import multipleSelect from "../../components/multiple-select.vue";
+	export default {
+		components: {
+			multipleSelect,
+		},
+		data() {
+			return {
+				date: "",
+				active: 0,
+				equipArr: ["预警记录", "预警发布", "预警设置"],
+				timeshow: false,
+				mode: 'range',
+				start_time: "",
+				end_time: "",
+				wranlistdata: [],
+				listpage: 1,
+				defaultSelected: [], //默认选中项
+				serviceList: [{
+						value: "1",
+						name: "目标种类预警",
+					},
+					{
+						value: "2",
+						name: "指定害虫数量预警",
+					},
+					{
+						value: "3",
+						name: "害虫数量总和预警",
+					},
+					{
+						value: "4",
+						name: "综合预警",
+					},
+				], //传递给子组件的数据
+				accServiceShow: false,
+				wormvalue: "",
+				userphone: [],
+				total_sms_counts: "",
+				isTop: false,
+				src: '../../static/images/1.png',
+				src1: '../../static/images/b0bcdb0e3fe8690520f743aa8303bf2.png',
+				filtrateTF: false,
+				modalshow: false,
+				content: '',
+				warmstatus: {
+
+				},
+				//预警设置
+				configlist: [],
+				addvalue: "",
+				addshow: false,
+				options: [{
+					text: '删除',
+					style: {
+						backgroundColor: '#dd524d'
+					}
+				}],
+				confpage:1
+			}
+		},
+		methods: {
+			tabClick(index) {
+				this.active = index
+				if (index == 0) {
+					this.listpage = 1
+					this.wranlistdata = []
+					this.getwranlistdata()
+				} else if (index == 1) {
+					this.getmessagescounts()
+				} else if (index == 2) {
+					this.confpage = 1
+					this.configlist = []
+					this.getconfiglist()
+				}
+			},
+			timechange(e) {
+				console.log(e)
+				this.start_time = e.startDate
+				this.end_time = e.endDate
+				this.listpage = 1
+				this.wranlistdata = []
+				this.getwranlistdata()
+			},
+			closetime() {
+				this.start_time = ""
+				this.end_time = ""
+				this.listpage = 1
+				this.wranlistdata = []
+				this.getwranlistdata()
+			},
+			async getwranlistdata() {
+				var end_time = ""
+				var start_time = ""
+				if(this.end_time!=""){
+					end_time = Math.floor(+new Date(this.end_time)/1000)
+				}else{
+					end_time = ""
+				}
+				if(this.start_time!=""){
+					start_time = Math.floor(+new Date(this.start_time)/1000)
+				}else{
+					start_time = ""
+				}
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.user_qxz_warning_list',
+					data: {
+						end_time: end_time,
+						page: this.listpage,
+						page_size: "10",
+						start_time: start_time,
+					}
+				})
+				console.log(res)
+				this.wranlistdata = this.wranlistdata.concat(res.data)
+			},
+			tomap(data) {
+				uni.navigateTo({
+					url: "../cbqxyj/basemap?device_id=" + data.device_id,
+				})
+			},
+			accServiceConfirm(e) {
+				console.log(e)
+				this.userphone = e
+			},
+			async getuseriphonelist() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.user_warning_liaisons_list',
+					data: {
+						page: 1,
+						page_size: 9999999,
+					}
+				})
+				console.log(res)
+				this.serviceList = []
+				for (var i = 0; i < res.data.length; i++) {
+					var obj = {
+						value: res.data[i].d_id,
+						name: res.data[i].liaisons + "/" + res.data[i].phone,
+					}
+					this.serviceList.push(obj)
+				}
+			},
+			async getmessagescounts() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.remaining_messages_counts',
+					data: {}
+				})
+				console.log(res)
+				this.total_sms_counts = res.total_sms_counts
+			},
+			async send() {
+				if (this.wormvalue == "") {
+					uni.showToast({
+						title: "请填写短信预警信息",
+						icon: "none"
+					})
+				} else if (this.userphone.length == 0) {
+					uni.showToast({
+						title: "请选择短信接收人",
+						icon: "none"
+					})
+				} else {
+					var list = []
+					for (var i = 0; i < this.userphone.length; i++) {
+						list.push(this.userphone[i].value)
+					}
+					const res = await this.$myRequest({
+						url: '/api/api_gateway?method=device.device_sms_alert.user_pest_warning_release',
+						data: {
+							send_user: list.join(","),
+							content: this.wormvalue,
+							device_type_id: 5
+						}
+					})
+					console.log(res)
+					if (res) {
+						uni.showToast({
+							title: "发送成功",
+							icon: "none"
+						})
+					} else {
+						uni.showToast({
+							title: "发送失败",
+							icon: "none"
+						})
+					}
+				}
+			},
+			tobook() {
+				uni.navigateTo({
+					url: "../cbqxyj/addressbook"
+				})
+			},
+			async allread() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.user_qxz_warning_record_read',
+					data: {
+						req: "all",
+					}
+				})
+				if (res) {
+					uni.showToast({
+						title: "已完成一键已读",
+						icon: "none"
+					})
+				}
+			},
+			singleread(data) {
+				console.log(data)
+				this.modalshow = true
+				this.content = data.warning_content
+				this.warmstatus = data
+			},
+			async singlereadsure() {
+				if (this.warmstatus.status == 0) {
+					const res = await this.$myRequest({
+						url: '/api/api_gateway?method=device.device_sms_alert.user_qxz_warning_record_read',
+						data: {
+							id: this.warmstatus.id,
+						}
+					})
+					if (res) {
+						uni.showToast({
+							title: "此条预警已读",
+							icon: "none"
+						})
+						this.listpage = 1
+						this.wranlistdata = []
+						this.getwranlistdata()
+					}
+				}
+			},
+			top() {
+				uni.pageScrollTo({
+					scrollTop: 0,
+					duration: 500,
+				});
+			},
+			async getconfiglist() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.user_warning_config_list',
+					data: {
+						device_type_id: "5",
+						page: this.confpage,
+						page_size: "10",
+					}
+				})
+				console.log(res.data)
+
+				for (var i = 0; i < res.data.length; i++) {
+					res.data[i]["statustf"] = res.data[i].status == 1 ? true : false
+				}
+				this.configlist = this.configlist.concat(res.data)
+				console.log(this.configlist)
+			},
+			async swichchange(e, id) {
+				// console.log(e, id)
+				// console.log(this.configlist)
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.modify_user_warning_config_status',
+					data: {
+						id: id,
+						status: e ? 1 : 0,
+					}
+				})
+				if (res) {
+					uni.showToast({
+						title: "状态修改成功",
+						icon: "none"
+					})
+				}
+				this.configlist = []
+				this.confpage = 1
+				this.getconfiglist()
+			},
+			toset(id) {
+				console.log(id)
+				uni.navigateTo({
+					url: "./warnset?id=" + id
+				})
+			},
+			async addwarning_config() {
+				this.addshow = true
+				if (this.addvalue == "") {
+					uni.showToast({
+						title: "请填写预警名称",
+						icon: "none"
+					})
+				} else {
+					const res = await this.$myRequest({
+						url: '/api/api_gateway?method=device.device_sms_alert.create_user_warning_config',
+						data: {
+							title: this.addvalue,
+							device_type_id: 5
+						}
+					})
+					console.log(res)
+					if (res) {
+						this.addshow = false
+						this.configlist = []
+						this.confpage = 1
+						this.getconfiglist()
+					}
+				}
+			},
+			async delconfig(id){
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.del_user_warning_config_status',
+					data: {
+						id:id
+					}
+				})
+				console.log(res)
+				if (res) {
+					this.configlist = []
+					this.confpage = 1
+					this.getconfiglist()
+				}
+			}
+			
+		},
+		onLoad() {
+			this.getwranlistdata()
+			// this.getmessagescounts()
+			// this.getconfiglist()
+		},
+		onShow() {
+			this.getuseriphonelist()
+		},
+		onReachBottom() {
+			if (this.active == 0) {
+				this.listpage++
+				this.getwranlistdata()
+			} else if (this.ctive == 2) {
+				this.confpage++
+				this.getconfiglist()
+			}
+		},
+		onPageScroll(e) {
+			//nvue暂不支持滚动监听,可用bindingx代替
+			if (e.scrollTop > 200) {
+				//距离大于200时显示
+				this.isTop = true;
+			} else {
+				//距离小于200时隐藏
+				this.isTop = false;
+			}
+		},
+	}
+</script>
+
+<style lang="less">
+	page {
+		background-color: #F6F6FB;
+	}
+
+	.cbwtop {
+		position: fixed;
+		top: 0px;
+		width: 100%;
+		z-index: 555;
+		background-color: #fff;
+
+		.image {
+			width: 100%;
+			height: 160rpx;
+		}
+
+		.tab-box {
+			font-size: 30rpx;
+			line-height: 80rpx;
+			background-color: #ffffff;
+			width: 100%;
+			overflow: hidden;
+			overflow-x: scroll;
+			white-space: nowrap;
+
+			.tab-item {
+				cursor: pointer;
+				position: relative;
+				width: 25%;
+				text-align: center;
+				display: inline-block;
+			}
+
+			.tab-item.active {
+				.bottom-line {
+					bottom: 0;
+					position: absolute;
+					display: inline-block;
+					width: 90rpx;
+					height: 6rpx;
+					left: 0;
+					right: 0;
+					margin: auto;
+					background: #57C878;
+				}
+			}
+		}
+
+		.timeandtype {
+			background-color: #F6F6FB;
+			padding: 20rpx;
+			box-sizing: border-box;
+
+			.timebox {
+				display: flex;
+				background-color: #fff;
+				padding: 10px;
+				border-top-right-radius: 5px;
+				border-top-left-radius: 5px;
+
+				.jiange {
+					width: 5%;
+					text-align: center;
+				}
+
+				.firsttime,
+				.endtime {
+					width: 45%;
+					text-align: center;
+				}
+			}
+
+			.warntypebox {
+				display: flex;
+				justify-content: space-between;
+				background-color: #fff;
+				padding: 10px;
+				border-top: 1px solid #F6F6FB;
+				border-bottom-right-radius: 5px;
+				border-bottom-left-radius: 5px;
+			}
+		}
+	}
+
+	.warmlistbox {
+		width: 95%;
+		margin: 0 auto;
+		padding-top: 370rpx;
+
+		.warmlistbox_item {
+			padding: 20rpx 0;
+			box-sizing: border-box;
+			background-color: #fff;
+			border-radius: 10rpx;
+			margin-bottom: 20rpx;
+
+			.warmlistbox_item_title {
+				border-left: 8rpx solid #14A478;
+				padding-left: 30rpx;
+			}
+
+			.warmlistbox_item_text {
+				width: 90%;
+				margin: 0 auto;
+				margin-top: 20rpx;
+				border-top: 1px solid #F2F2F2;
+				padding: 20rpx 0;
+
+				.item_text_item {
+					margin-bottom: 7px;
+					display: flex;
+
+					.item_text_item_f {
+						width: 140rpx;
+					}
+
+					.item_text_item_e {
+						width: calc(100% - 140rpx);
+						display: -webkit-box; //谷歌
+						-webkit-box-orient: vertical;
+						-webkit-line-clamp: 4; //显示几行
+						overflow: hidden;
+					}
+				}
+
+				.item_text_sta {
+					display: flex;
+					justify-content: flex-end;
+				}
+			}
+		}
+	}
+
+	.warmissuebox {
+		width: 95%;
+		margin: 0 auto;
+		padding-top: 270rpx;
+
+		.warmissue {
+			width: 95%;
+			margin: 0 auto;
+			padding: 20rpx;
+			background-color: #fff;
+			border-radius: 5px;
+
+			.warmissue_itemone {
+				margin-bottom: 60rpx;
+				display: flex;
+				justify-content: space-between;
+			}
+
+			.warmissue_item {
+				margin-bottom: 60rpx;
+				display: flex;
+
+				.warmissue_item_title {
+					width: 160rpx;
+				}
+
+				.warmissue_item_text {
+					width: calc(100% - 160rpx);
+				}
+			}
+
+			.warmissue_itemtwo {
+				display: flex;
+
+				.itemtwo_left {
+					width: calc(100% - 40rpx);
+					display: flex;
+					flex-wrap: wrap;
+				}
+
+				.icon {
+					width: 40rpx;
+				}
+			}
+		}
+
+		.sendbox {
+			margin: 40rpx auto;
+			width: 80%;
+			background-color: #14A478;
+			padding: 20rpx 0;
+			border-radius: 59px;
+			text-align: center;
+			color: #fff;
+		}
+	}
+
+	.wornsetbox {
+		width: 95%;
+		margin: 0 auto;
+		padding-top: 270rpx;
+
+		.wornsetbox_item {
+			padding: 30rpx 20rpx;
+			background-color: #fff;
+			width: 100%;
+			display: flex;
+			justify-content: space-between;
+			box-sizing: border-box;
+			line-height: 64rpx;
+			height: 124rpx;
+			// margin-bottom: 30rpx;
+		}
+
+	}
+
+	.addwarnlist {
+		position: absolute;
+		bottom: 20rpx;
+		left: 10%;
+		margin: 40rpx auto;
+		width: 80%;
+		background-color: #14A478;
+		padding: 20rpx 0;
+		border-radius: 59px;
+		text-align: center;
+		color: #fff;
+	}
+
+	.addinfobox {
+		display: flex;
+		margin: 30rpx 0;
+
+		.addinfobox_title {
+			line-height: 70rpx;
+			width: 30%;
+			text-align: center;
+
+			span:first-child {
+				color: red;
+			}
+		}
+
+		/deep/.u-input__right-icon {
+			line-height: 35px;
+		}
+	}
+
+	/deep/.u-calendar__action {
+		display: flex;
+		justify-content: space-around;
+
+		.u-calendar__action__text {
+			line-height: 25px;
+		}
+	}
+
+	.top {
+		position: fixed;
+		right: 10px;
+		bottom: 40px;
+		z-index: 100;
+
+		image {
+			width: 100rpx;
+			height: 100rpx;
+		}
+
+		.backtop {
+			display: flex;
+			justify-content: flex-end;
+			margin-bottom: 10rpx;
+		}
+
+		.more {
+			width: 100rpx;
+			height: 100rpx;
+			background-color: rgba(161, 161, 161, 0.45);
+			border-radius: 50%;
+			text-align: center;
+			padding-top: 10rpx;
+			line-height: 40rpx;
+			box-sizing: border-box;
+			margin: 14rpx 0 0 0;
+			color: #fff;
+		}
+	}
+</style>

+ 501 - 0
pages/qxzyj/warnset.vue

@@ -0,0 +1,501 @@
+<template>
+	<view>
+		<view class="basesel">
+			<view class="basesel_list">
+				<view class="basesel_list_tilte">
+					预警设备选择:
+				</view>
+				<view class="basesel_list_sel" @click="baseshow = true">
+					<view class="basesel_list_sel_left" v-show="selbaselist==''">
+						请选择预警
+					</view>
+					<view class="basesel_list_sel_left" v-show="selbaselist!=''">
+						{{selbaselist}}
+					</view>
+					<u-icon name="arrow-down" class="icon" color="#999999"></u-icon>
+				</view>
+			</view>
+		</view>
+		<view class="usersel">
+			<view class="warmissue_itemone">
+				<view class="warmissue_itemone_title">
+					短信接受人:
+				</view>
+				<view class="" style="color: #14A478;" @click="tobook">
+					预警通讯录编辑
+				</view>
+			</view>
+			<view class="warmissue_itemtwo" @click="accServiceShowphone = true">
+				<view class="itemtwo_left" v-show="!userphone.length">
+					请选择短信接收人
+				</view>
+				<view class="itemtwo_left" v-show="userphone.length">
+					<view class="" style="margin-right: 20rpx;" v-for="item in userphone" :key="item">
+						{{item}}
+					</view>
+				</view>
+				<u-icon name="arrow-down" class="icon" color="#999999"></u-icon>
+			</view>
+		</view>
+		<view class="tongdao" v-for="item,index in tongdaolist" :key="index">
+			<view class="tongdao_title">
+				<view class="">
+					{{item.key}}
+				</view>
+				<view class="">
+					<u-switch v-model="item.type" size="40" style="margin-top: 13rpx;"></u-switch>
+				</view>
+			</view>
+			<view class="tongdao_item">
+				<view class="">
+					通道名称
+				</view>
+				<view class="">
+					{{item.name}}
+				</view>
+			</view>
+			<view class="tongdao_item">
+				<view class="">
+					运算符
+				</view>
+				<view class="target_text_item_sel" @click="selindex = index;operationshow=true">
+					<view class="itemtwo_left" v-show="item.value==''">
+						请选择运算符
+					</view>
+					<view class="itemtwo_left" v-show="item.value!=''">
+						{{item.value}}
+					</view>
+					<u-icon name="arrow-down" class="icon" color="#999999"></u-icon>
+				</view>
+			</view>
+			<view class="tongdao_item">
+				<view class="">
+					阈值
+				</view>
+				<view class="" style="display: flex;">
+					<u-input v-model="item.num[0]" type="number" @blur="numyanzheng(index)" />
+					<view class="" style="width: 60rpx;text-align: center;" v-show="item.valuenum == 2">
+						-
+					</view>
+					<u-input v-model="item.num[1]" type="number" v-show="item.valuenum == 2"
+						@blur="numyanzheng(index)" />
+				</view>
+			</view>
+		</view>
+		<view class="sendbox" @click="send">
+			保存预警设置
+		</view>
+		<view class="">
+			<u-mask :show="accServiceShowphone" z-index="998"></u-mask>
+			<u-select v-model="baseshow" :list="baselist" @confirm="selconfirm"></u-select>
+			<u-select v-model="operationshow" :list="operationlist" @confirm="operationconfirm"></u-select>
+			<multiple-select v-model="accServiceShowphone" :value="accServiceShowphone" :data="serviceListphone"
+				:default-selected="defaultSelectedphone" @confirm="accServiceConfirmphone"></multiple-select>
+		</view>
+	</view>
+</template>
+
+<script>
+	import multipleSelect from "../../components/multiple-select.vue";
+	export default {
+		components: {
+			multipleSelect,
+		},
+		data() {
+			return {
+				fanxianid: '',
+				fanxianconf: "",
+				warning_id: "",
+				accServiceShowphone: false,
+				userphone: [],
+				send_user: [],
+				defaultSelectedphone: [],
+				serviceListphone: [],
+				selbaselist: [],
+				baselist: [],
+				baseshow: false,
+				statustf: false,
+				operationshow: false,
+				operationlist: [{
+						value: 0,
+						label: "小于"
+					},
+					{
+						value: 1,
+						label: "大于"
+					},
+					{
+						value: 2,
+						label: '介于'
+					}
+				],
+				tongdaolist: [],
+				selindex: 0
+			}
+		},
+		methods: {
+			tobook() {
+				uni.navigateTo({
+					url: "../cbqxyj/addressbook"
+				})
+			},
+			accServiceConfirmphone(e) {
+				this.userphone = []
+				this.send_user = []
+				for (var i = 0; i < e.length; i++) {
+					this.userphone.push(e[i].name)
+					this.send_user.push(e[i].value)
+				}
+			},
+			async getuseriphonelist() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.user_warning_liaisons_list',
+					data: {
+						page: 1,
+						page_size: 9999999,
+					}
+				})
+				// console.log(res)
+				this.serviceListphone = []
+				for (var i = 0; i < res.data.length; i++) {
+					var obj = {
+						value: res.data[i].d_id,
+						name: res.data[i].liaisons + "/" + res.data[i].phone,
+					}
+					this.serviceListphone.push(obj)
+				}
+			},
+			async getbaselist() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.user_warning_device_list',
+					data: {
+						device_type_id: "5",
+						page: "1",
+						page_size: "999999999"
+					}
+				})
+				// console.log(res.data)
+				for (var i = 0; i < res.data.length; i++) {
+					var obj = {
+						value: res.data[i].d_id,
+						label: res.data[i].device_id
+					}
+					this.baselist.push(obj)
+				}
+			},
+			selconfirm(e) {
+				console.log(e)
+				this.selbaselist = e[0].label
+				this.getbasetongdao(e[0].label)
+			},
+			operationconfirm(e) {
+				console.log(e)
+				console.log(this.selindex)
+				this.tongdaolist[this.selindex].value = e[0].label
+				this.tongdaolist[this.selindex].valuenum = e[0].value
+			},
+			async getbasetongdao(device_id) {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=weather.weather.qxz_early_warning',
+					data: {
+						device_id: device_id,
+						status: "see"
+					}
+				})
+				console.log(res.conf)
+				this.tongdaolist = []
+				for (var key in res.conf) {
+					var obj = {
+						key: key,
+						name: res.conf[key],
+						type: false,
+						value: "",
+						valuenum: "",
+						num: []
+					}
+					if (this.fanxianid == device_id) {
+						console.log(this.fanxianconf)
+						for (var i = 0; i < this.fanxianconf.length; i++) {
+							if (Object.keys(this.fanxianconf[i]) == key) {
+								obj.type = true;
+								var arr = this.fanxianconf[i][key].split('#');
+								if (arr[1].indexOf('&')) {
+									arr[1] = arr[1].split('&');
+									obj.num[1] = arr[1][1];
+									obj.num[0] = arr[1][0];
+								}
+								obj.value = this.operationlist[arr[0]].label;
+								obj.valuenum = arr[0];
+							}
+						}
+					}
+					this.tongdaolist.push(obj)
+				}
+				// console.log(this.tongdaolist)
+			},
+			yanzheng() {
+				for (var i = 0; i < this.tongdaolist.length; i++) {
+					if (this.tongdaolist[i].type) {
+						return false
+					}
+				}
+				return true
+			},
+			yanzheng2() {
+				for (var i = 0; i < this.tongdaolist.length; i++) {
+					if (this.tongdaolist[i].type) {
+						if (!this.tongdaolist[i].value || !this.tongdaolist[i].num[0]) {
+							return true
+						} else if (this.tongdaolist[i].value == "介于" && !this.tongdaolist[i].num[1]) {
+							return true
+						}
+					}
+				}
+				return false
+			},
+			numyanzheng(index) {
+				if (this.tongdaolist[index].num[1]) {
+					// console.log(Number(this.tongdaolist[index].num[0]) > Number(this.tongdaolist[index].num[1]))
+					if (Number(this.tongdaolist[index].num[0]) >= Number(this.tongdaolist[index].num[1])) {
+						this.tongdaolist[index].num = [this.tongdaolist[index].num[0], ""]
+					}
+				}
+			},
+			async send() {
+				console.log(this.selbaselist)
+				if (this.selbaselist == '') {
+					uni.showToast({
+						title: "请选择预警设备",
+						icon: "none"
+					})
+				} else if (this.userphone.length == 0) {
+					uni.showToast({
+						title: "请选择预警短信接收人",
+						icon: "none"
+					})
+				} else if (this.yanzheng()) {
+					// console.log(this.tongdaolist)
+					uni.showToast({
+						title: "请开启至少一个通道预警",
+						icon: "none"
+					})
+				} else if (this.yanzheng2()) {
+					uni.showToast({
+						title: "请将开启的通道信息填写完成",
+						icon: "none"
+					})
+				} else {
+					var conf = [
+
+					]
+					for (var i = 0; i < this.tongdaolist.length; i++) {
+						if (this.tongdaolist[i].type) {
+							var obj = {}
+							obj[this.tongdaolist[i].key] = this.tongdaolist[i].valuenum + "#" + this.tongdaolist[i].num
+								.join("&")
+							conf.push(obj)
+						}
+					}
+					// console.log(conf)
+					const res = await this.$myRequest({
+						url: '/api/api_gateway?method=device.device_sms_alert.create_qxz_warning_config',
+						data: {
+							conf: JSON.stringify(conf),
+							device_id: this.selbaselist,
+							send_user_id: this.send_user.join(","),
+							warning_id: this.warning_id,
+						}
+					})
+					if (res) {
+						uni.showToast({
+							title: "预警设置成功",
+							icon: "none"
+						})
+						uni.navigateBack({
+							delta: 1
+						})
+					}
+					// console.log(res)
+				}
+			},
+			//返现
+			async getstatsu() {
+				const res = await this.$myRequest({
+					url: '/api/api_gateway?method=device.device_sms_alert.user_qxz_warning_statsu',
+					data: {
+						warning_id: this.warning_id,
+					}
+				})
+				console.log(res)
+				this.selbaselist = res.device_ids
+				this.fanxianid = res.device_ids
+				this.defaultSelectedphone = []
+				this.userphone = []
+				this.send_user = []
+				this.fanxianconf = res.conf;
+				for (var key in res.send_user) {
+					this.defaultSelectedphone.push(Number(key))
+					this.userphone.push(res.send_user[key][0] + "/" + res.send_user[key][1])
+					this.send_user.push(Number(key))
+				}
+				this.getbasetongdao(res.device_ids)
+			}
+		},
+		onLoad(option) {
+			this.warning_id = option.id
+			this.getbaselist()
+			this.getuseriphonelist()
+			this.getstatsu()
+		}
+	}
+</script>
+
+<style lang="less">
+	page {
+		background-color: #F6F6FB;
+	}
+
+	.basesel {
+		width: 95%;
+		margin: 20rpx auto;
+		padding: 30rpx 20rpx;
+		box-sizing: border-box;
+		background-color: #fff;
+		border-radius: 10rpx;
+
+		.basesel_list {
+			width: 100%;
+
+			.basesel_list_tilte {
+				margin-bottom: 60rpx;
+				font-size: 32rpx;
+			}
+
+			.basesel_list_sel {
+				display: flex;
+				margin-bottom: 60rpx;
+
+				.basesel_list_sel_left {
+					width: calc(100% - 40rpx);
+					display: flex;
+					flex-wrap: wrap;
+					color: #999999;
+				}
+
+				.icon {
+					width: 40rpx;
+				}
+			}
+		}
+
+	}
+
+	.usersel {
+		width: 95%;
+		margin: 20rpx auto;
+		padding: 30rpx 20rpx;
+		box-sizing: border-box;
+		background-color: #fff;
+		border-radius: 10rpx;
+
+		.warmissue_itemone {
+			margin-bottom: 60rpx;
+			display: flex;
+			justify-content: space-between;
+
+			.warmissue_itemone_title {
+				font-size: 32rpx;
+			}
+		}
+
+		.warmissue_item {
+			margin-bottom: 60rpx;
+			display: flex;
+
+			.warmissue_item_title {
+				width: 160rpx;
+			}
+
+			.warmissue_item_text {
+				width: calc(100% - 160rpx);
+			}
+		}
+
+		.warmissue_itemtwo {
+			display: flex;
+
+			.itemtwo_left {
+				width: calc(100% - 40rpx);
+				display: flex;
+				flex-wrap: wrap;
+				color: #999999;
+			}
+
+			.icon {
+				width: 40rpx;
+			}
+		}
+	}
+
+	.tongdao {
+		width: 95%;
+		margin: 20rpx auto;
+		padding: 30rpx 0rpx;
+		box-sizing: border-box;
+		background-color: #fff;
+		border-radius: 10rpx;
+
+		.tongdao_title {
+			padding: 0 20rpx;
+			display: flex;
+			line-height: 60rpx;
+			justify-content: space-between;
+			height: 60rpx;
+			border-left: 8rpx solid #14A478;
+		}
+
+		.tongdao_item {
+			padding: 0 20rpx;
+			display: flex;
+			justify-content: space-between;
+			margin-top: 30rpx;
+			line-height: 70rpx;
+
+			.target_text_item_sel {
+				display: flex;
+				border-bottom: 1px solid #aaaaad;
+				height: 70rpx;
+				line-height: 70rpx;
+
+				.itemtwo_left {
+					color: #999999;
+				}
+			}
+
+			/deep/.uni-input-input {
+				border-bottom: 1px solid #aaaaad;
+				text-align: right;
+				width: 200rpx;
+			}
+			/deep/.u-input__input{
+				border-bottom: 1px solid #aaaaad;
+				text-align: right;
+				width: 200rpx;
+			}
+
+			/deep/.u-input__right-icon {
+				line-height: 35px;
+			}
+		}
+	}
+
+	.sendbox {
+		margin: 40rpx auto;
+		width: 80%;
+		background-color: #14A478;
+		padding: 20rpx 0;
+		border-radius: 59px;
+		text-align: center;
+		color: #fff;
+	}
+</style>

+ 2 - 27
pages/waterandfer/datails.vue

@@ -23,11 +23,11 @@
 				</view>
 			</view>
 			<view class="control">
-				<view class="control_item" v-if="zttf" @click="control">
+				<view class="control_item" v-if="$QueryPermission(196)" @click="control">
 					<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/environment/8.png'" mode=""></image>
 					<p>设备状态</p>
 				</view>
-				<view class="control_item" v-if="ystf" @click="charts">
+				<view class="control_item" v-if="$QueryPermission(197)" @click="charts">
 					<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/environment/10.png'" mode=""></image>
 					<p>要素数据</p>
 				</view>
@@ -173,31 +173,6 @@
 			console.log(JSON.parse(option.shebei))
 			this.history()
 			this.selectaddress(this.eqinfo.item.lat, this.eqinfo.item.lng)
-			uni.getStorage({
-				key: "jurisdiction",
-				success: (res) => {
-					// console.log(JSON.parse(res.data))
-					let items = JSON.parse(res.data).filter((item) => {
-						return item.pur_id == 202 //灌溉控制系统
-					})
-					let items2 = items[0].children.filter((item) => {
-						return item.pur_id == 195//"水肥一体化(X)"
-					})
-					console.log(items2)
-					var arr = items2[0].children
-					console.log(arr)
-					for (var i = 0; i < arr.length; i++) {
-						switch (arr[i].pur_id) {
-							case 196:
-								this.zttf = true//"设备状态"
-								break
-							case 197:
-								this.ystf = true//"要素数据"
-								break
-						}
-					}
-				},
-			})
 		}
 	}
 </script>

+ 1 - 1
pages/waterandfer/elementdata.vue

@@ -20,7 +20,7 @@
 				<view class="canvastishi" v-if="dataloadingtf">
 					<p class="dataloading">加载中</p>
 				</view>
-				<canvas v-if="canvastishiTF" canvas-id="canvasColumnA" id="canvasColumnA" class="charts"
+				<canvas v-if="canvastishiTF" v-show="!tiemshow" canvas-id="canvasColumnA" id="canvasColumnA" class="charts"
 					@touchstart="touchLineA($event)" @touchmove="moveLineA($event)" @touchend="touchEndLineA($event)"
 					disable-scroll=true
 					:style="{'width':cWidth*pixelRatio+'px','height':cHeight*pixelRatio+'px', 'transform': 'scale('+(1/pixelRatio)+')','margin-left':-cWidth*(pixelRatio-1)/2+'px','margin-top':-cHeight*(pixelRatio-1)/2+'px'}"></canvas>

BIN
static/images/cb/gaofengqi.png


BIN
static/images/cb/shijianqi.png


BIN
static/images/cb/zhongjianqi.png


BIN
static/images/login/bg.png


+ 14 - 1
static/js/equipState_dict.json

@@ -1,3 +1,4 @@
+
 {   
     "imei":{
         "name":"设备ID",
@@ -35,7 +36,7 @@
         "value":{
             "0":"待机",
             "1":"工作",
-            "2":"工作"
+            "2":"充电"
         },
         "desc":"工作状态、0 待机, 1 工作"
     },
@@ -362,6 +363,17 @@
         },
         "desc":"摄像头状态 0 正常, 1 异常"
     },
+    "work_sta":{
+        "name":"摄像头状态",
+        "unit":"",
+        "value":{
+            "0":"待机",
+            "1":"收集",
+            "2": "培养",
+            "3": "拍照"
+        },
+        "desc":"摄像头状态 0 待机, 1 收集, 2 培养, 3 拍照"
+    },
     "imgres":{
         "name":"图片分辨率",
         "unit":"",
@@ -520,4 +532,5 @@
         ],
         "desc":"sim卡状态"
     }
+    
 }

File diff suppressed because it is too large
+ 0 - 2080
static/js/ezuikit.js


BIN
static/logo.png


+ 539 - 0
style/font/demo.css

@@ -0,0 +1,539 @@
+/* Logo 字体 */
+@font-face {
+  font-family: "iconfont logo";
+  src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
+  src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
+    url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
+    url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
+    url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
+}
+
+.logo {
+  font-family: "iconfont logo";
+  font-size: 160px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+/* tabs */
+.nav-tabs {
+  position: relative;
+}
+
+.nav-tabs .nav-more {
+  position: absolute;
+  right: 0;
+  bottom: 0;
+  height: 42px;
+  line-height: 42px;
+  color: #666;
+}
+
+#tabs {
+  border-bottom: 1px solid #eee;
+}
+
+#tabs li {
+  cursor: pointer;
+  width: 100px;
+  height: 40px;
+  line-height: 40px;
+  text-align: center;
+  font-size: 16px;
+  border-bottom: 2px solid transparent;
+  position: relative;
+  z-index: 1;
+  margin-bottom: -1px;
+  color: #666;
+}
+
+
+#tabs .active {
+  border-bottom-color: #f00;
+  color: #222;
+}
+
+.tab-container .content {
+  display: none;
+}
+
+/* 页面布局 */
+.main {
+  padding: 30px 100px;
+  width: 960px;
+  margin: 0 auto;
+}
+
+.main .logo {
+  color: #333;
+  text-align: left;
+  margin-bottom: 30px;
+  line-height: 1;
+  height: 110px;
+  margin-top: -50px;
+  overflow: hidden;
+  *zoom: 1;
+}
+
+.main .logo a {
+  font-size: 160px;
+  color: #333;
+}
+
+.helps {
+  margin-top: 40px;
+}
+
+.helps pre {
+  padding: 20px;
+  margin: 10px 0;
+  border: solid 1px #e7e1cd;
+  background-color: #fffdef;
+  overflow: auto;
+}
+
+.icon_lists {
+  width: 100% !important;
+  overflow: hidden;
+  *zoom: 1;
+}
+
+.icon_lists li {
+  width: 100px;
+  margin-bottom: 10px;
+  margin-right: 20px;
+  text-align: center;
+  list-style: none !important;
+  cursor: default;
+}
+
+.icon_lists li .code-name {
+  line-height: 1.2;
+}
+
+.icon_lists .icon {
+  display: block;
+  height: 100px;
+  line-height: 100px;
+  font-size: 42px;
+  margin: 10px auto;
+  color: #333;
+  -webkit-transition: font-size 0.25s linear, width 0.25s linear;
+  -moz-transition: font-size 0.25s linear, width 0.25s linear;
+  transition: font-size 0.25s linear, width 0.25s linear;
+}
+
+.icon_lists .icon:hover {
+  font-size: 100px;
+}
+
+.icon_lists .svg-icon {
+  /* 通过设置 font-size 来改变图标大小 */
+  width: 1em;
+  /* 图标和文字相邻时,垂直对齐 */
+  vertical-align: -0.15em;
+  /* 通过设置 color 来改变 SVG 的颜色/fill */
+  fill: currentColor;
+  /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
+      normalize.css 中也包含这行 */
+  overflow: hidden;
+}
+
+.icon_lists li .name,
+.icon_lists li .code-name {
+  color: #666;
+}
+
+/* markdown 样式 */
+.markdown {
+  color: #666;
+  font-size: 14px;
+  line-height: 1.8;
+}
+
+.highlight {
+  line-height: 1.5;
+}
+
+.markdown img {
+  vertical-align: middle;
+  max-width: 100%;
+}
+
+.markdown h1 {
+  color: #404040;
+  font-weight: 500;
+  line-height: 40px;
+  margin-bottom: 24px;
+}
+
+.markdown h2,
+.markdown h3,
+.markdown h4,
+.markdown h5,
+.markdown h6 {
+  color: #404040;
+  margin: 1.6em 0 0.6em 0;
+  font-weight: 500;
+  clear: both;
+}
+
+.markdown h1 {
+  font-size: 28px;
+}
+
+.markdown h2 {
+  font-size: 22px;
+}
+
+.markdown h3 {
+  font-size: 16px;
+}
+
+.markdown h4 {
+  font-size: 14px;
+}
+
+.markdown h5 {
+  font-size: 12px;
+}
+
+.markdown h6 {
+  font-size: 12px;
+}
+
+.markdown hr {
+  height: 1px;
+  border: 0;
+  background: #e9e9e9;
+  margin: 16px 0;
+  clear: both;
+}
+
+.markdown p {
+  margin: 1em 0;
+}
+
+.markdown>p,
+.markdown>blockquote,
+.markdown>.highlight,
+.markdown>ol,
+.markdown>ul {
+  width: 80%;
+}
+
+.markdown ul>li {
+  list-style: circle;
+}
+
+.markdown>ul li,
+.markdown blockquote ul>li {
+  margin-left: 20px;
+  padding-left: 4px;
+}
+
+.markdown>ul li p,
+.markdown>ol li p {
+  margin: 0.6em 0;
+}
+
+.markdown ol>li {
+  list-style: decimal;
+}
+
+.markdown>ol li,
+.markdown blockquote ol>li {
+  margin-left: 20px;
+  padding-left: 4px;
+}
+
+.markdown code {
+  margin: 0 3px;
+  padding: 0 5px;
+  background: #eee;
+  border-radius: 3px;
+}
+
+.markdown strong,
+.markdown b {
+  font-weight: 600;
+}
+
+.markdown>table {
+  border-collapse: collapse;
+  border-spacing: 0px;
+  empty-cells: show;
+  border: 1px solid #e9e9e9;
+  width: 95%;
+  margin-bottom: 24px;
+}
+
+.markdown>table th {
+  white-space: nowrap;
+  color: #333;
+  font-weight: 600;
+}
+
+.markdown>table th,
+.markdown>table td {
+  border: 1px solid #e9e9e9;
+  padding: 8px 16px;
+  text-align: left;
+}
+
+.markdown>table th {
+  background: #F7F7F7;
+}
+
+.markdown blockquote {
+  font-size: 90%;
+  color: #999;
+  border-left: 4px solid #e9e9e9;
+  padding-left: 0.8em;
+  margin: 1em 0;
+}
+
+.markdown blockquote p {
+  margin: 0;
+}
+
+.markdown .anchor {
+  opacity: 0;
+  transition: opacity 0.3s ease;
+  margin-left: 8px;
+}
+
+.markdown .waiting {
+  color: #ccc;
+}
+
+.markdown h1:hover .anchor,
+.markdown h2:hover .anchor,
+.markdown h3:hover .anchor,
+.markdown h4:hover .anchor,
+.markdown h5:hover .anchor,
+.markdown h6:hover .anchor {
+  opacity: 1;
+  display: inline-block;
+}
+
+.markdown>br,
+.markdown>p>br {
+  clear: both;
+}
+
+
+.hljs {
+  display: block;
+  background: white;
+  padding: 0.5em;
+  color: #333333;
+  overflow-x: auto;
+}
+
+.hljs-comment,
+.hljs-meta {
+  color: #969896;
+}
+
+.hljs-string,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-strong,
+.hljs-emphasis,
+.hljs-quote {
+  color: #df5000;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-type {
+  color: #a71d5d;
+}
+
+.hljs-literal,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-attribute {
+  color: #0086b3;
+}
+
+.hljs-section,
+.hljs-name {
+  color: #63a35c;
+}
+
+.hljs-tag {
+  color: #333333;
+}
+
+.hljs-title,
+.hljs-attr,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-selector-attr,
+.hljs-selector-pseudo {
+  color: #795da3;
+}
+
+.hljs-addition {
+  color: #55a532;
+  background-color: #eaffea;
+}
+
+.hljs-deletion {
+  color: #bd2c00;
+  background-color: #ffecec;
+}
+
+.hljs-link {
+  text-decoration: underline;
+}
+
+/* 代码高亮 */
+/* PrismJS 1.15.0
+https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
+/**
+ * prism.js default theme for JavaScript, CSS and HTML
+ * Based on dabblet (http://dabblet.com)
+ * @author Lea Verou
+ */
+code[class*="language-"],
+pre[class*="language-"] {
+  color: black;
+  background: none;
+  text-shadow: 0 1px white;
+  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
+  text-align: left;
+  white-space: pre;
+  word-spacing: normal;
+  word-break: normal;
+  word-wrap: normal;
+  line-height: 1.5;
+
+  -moz-tab-size: 4;
+  -o-tab-size: 4;
+  tab-size: 4;
+
+  -webkit-hyphens: none;
+  -moz-hyphens: none;
+  -ms-hyphens: none;
+  hyphens: none;
+}
+
+pre[class*="language-"]::-moz-selection,
+pre[class*="language-"] ::-moz-selection,
+code[class*="language-"]::-moz-selection,
+code[class*="language-"] ::-moz-selection {
+  text-shadow: none;
+  background: #b3d4fc;
+}
+
+pre[class*="language-"]::selection,
+pre[class*="language-"] ::selection,
+code[class*="language-"]::selection,
+code[class*="language-"] ::selection {
+  text-shadow: none;
+  background: #b3d4fc;
+}
+
+@media print {
+
+  code[class*="language-"],
+  pre[class*="language-"] {
+    text-shadow: none;
+  }
+}
+
+/* Code blocks */
+pre[class*="language-"] {
+  padding: 1em;
+  margin: .5em 0;
+  overflow: auto;
+}
+
+:not(pre)>code[class*="language-"],
+pre[class*="language-"] {
+  background: #f5f2f0;
+}
+
+/* Inline code */
+:not(pre)>code[class*="language-"] {
+  padding: .1em;
+  border-radius: .3em;
+  white-space: normal;
+}
+
+.token.comment,
+.token.prolog,
+.token.doctype,
+.token.cdata {
+  color: slategray;
+}
+
+.token.punctuation {
+  color: #999;
+}
+
+.namespace {
+  opacity: .7;
+}
+
+.token.property,
+.token.tag,
+.token.boolean,
+.token.number,
+.token.constant,
+.token.symbol,
+.token.deleted {
+  color: #905;
+}
+
+.token.selector,
+.token.attr-name,
+.token.string,
+.token.char,
+.token.builtin,
+.token.inserted {
+  color: #690;
+}
+
+.token.operator,
+.token.entity,
+.token.url,
+.language-css .token.string,
+.style .token.string {
+  color: #9a6e3a;
+  background: hsla(0, 0%, 100%, .5);
+}
+
+.token.atrule,
+.token.attr-value,
+.token.keyword {
+  color: #07a;
+}
+
+.token.function,
+.token.class-name {
+  color: #DD4A68;
+}
+
+.token.regex,
+.token.important,
+.token.variable {
+  color: #e90;
+}
+
+.token.important,
+.token.bold {
+  font-weight: bold;
+}
+
+.token.italic {
+  font-style: italic;
+}
+
+.token.entity {
+  cursor: help;
+}

File diff suppressed because it is too large
+ 1850 - 0
style/font/demo_index.html


BIN
style/font/iconfont.eot


File diff suppressed because it is too large
+ 1 - 0
style/font/iconfont.js


+ 520 - 0
style/font/iconfont.json

@@ -0,0 +1,520 @@
+{
+  "id": "1738837",
+  "name": "农业大数据",
+  "font_family": "iconfont",
+  "css_prefix_text": "icon-",
+  "description": "",
+  "glyphs": [
+    {
+      "icon_id": "5064096",
+      "name": "统计",
+      "font_class": "tongji2",
+      "unicode": "e646",
+      "unicode_decimal": 58950
+    },
+    {
+      "icon_id": "9241144",
+      "name": "手写签批",
+      "font_class": "iconzhengli_shouxieqianpi",
+      "unicode": "e648",
+      "unicode_decimal": 58952
+    },
+    {
+      "icon_id": "13173807",
+      "name": "识别",
+      "font_class": "shibie",
+      "unicode": "e603",
+      "unicode_decimal": 58883
+    },
+    {
+      "icon_id": "15726936",
+      "name": "统计",
+      "font_class": "tongji1",
+      "unicode": "e642",
+      "unicode_decimal": 58946
+    },
+    {
+      "icon_id": "20082758",
+      "name": "可视化大屏",
+      "font_class": "keshihuadaping",
+      "unicode": "e61c",
+      "unicode_decimal": 58908
+    },
+    {
+      "icon_id": "20082759",
+      "name": "退出关闭",
+      "font_class": "tuichuguanbi",
+      "unicode": "e61d",
+      "unicode_decimal": 58909
+    },
+    {
+      "icon_id": "20082258",
+      "name": "照片查看",
+      "font_class": "zhaopianchakan",
+      "unicode": "e61b",
+      "unicode_decimal": 58907
+    },
+    {
+      "icon_id": "20081037",
+      "name": "图标任务",
+      "font_class": "tubiaorenwu",
+      "unicode": "e61a",
+      "unicode_decimal": 58906
+    },
+    {
+      "icon_id": "19799572",
+      "name": "定位",
+      "font_class": "dingwei1",
+      "unicode": "e619",
+      "unicode_decimal": 58905
+    },
+    {
+      "icon_id": "19798147",
+      "name": "基地管理",
+      "font_class": "jidiguanli",
+      "unicode": "e618",
+      "unicode_decimal": 58904
+    },
+    {
+      "icon_id": "19798145",
+      "name": "基地面积",
+      "font_class": "jidimianji",
+      "unicode": "e617",
+      "unicode_decimal": 58903
+    },
+    {
+      "icon_id": "19798140",
+      "name": "建立时间",
+      "font_class": "jianlishijian",
+      "unicode": "e60d",
+      "unicode_decimal": 58893
+    },
+    {
+      "icon_id": "17654821",
+      "name": "录像",
+      "font_class": "luxiang",
+      "unicode": "e637",
+      "unicode_decimal": 58935
+    },
+    {
+      "icon_id": "774444",
+      "name": "扳手",
+      "font_class": "banshou",
+      "unicode": "e65c",
+      "unicode_decimal": 58972
+    },
+    {
+      "icon_id": "7335485",
+      "name": "地块",
+      "font_class": "chandi",
+      "unicode": "eb24",
+      "unicode_decimal": 60196
+    },
+    {
+      "icon_id": "7335489",
+      "name": "基础",
+      "font_class": "jichu",
+      "unicode": "eb25",
+      "unicode_decimal": 60197
+    },
+    {
+      "icon_id": "7335622",
+      "name": "迟到",
+      "font_class": "chidao",
+      "unicode": "eb44",
+      "unicode_decimal": 60228
+    },
+    {
+      "icon_id": "1391282",
+      "name": "日历",
+      "font_class": "rili",
+      "unicode": "e609",
+      "unicode_decimal": 58889
+    },
+    {
+      "icon_id": "5204808",
+      "name": "分类",
+      "font_class": "fenlei",
+      "unicode": "e616",
+      "unicode_decimal": 58902
+    },
+    {
+      "icon_id": "2678622",
+      "name": "全屏",
+      "font_class": "quanping",
+      "unicode": "e656",
+      "unicode_decimal": 58966
+    },
+    {
+      "icon_id": "772252",
+      "name": "扫描 识别 380%",
+      "font_class": "saomiaoshibie380",
+      "unicode": "e686",
+      "unicode_decimal": 59014
+    },
+    {
+      "icon_id": "11893490",
+      "name": "添加",
+      "font_class": "tianjia",
+      "unicode": "e615",
+      "unicode_decimal": 58901
+    },
+    {
+      "icon_id": "16364328",
+      "name": "统计",
+      "font_class": "tongji",
+      "unicode": "e636",
+      "unicode_decimal": 58934
+    },
+    {
+      "icon_id": "17709313",
+      "name": "未命名 -34",
+      "font_class": "weimingming-34",
+      "unicode": "e60b",
+      "unicode_decimal": 58891
+    },
+    {
+      "icon_id": "5327411",
+      "name": "臭虫bug",
+      "font_class": "chouchongbug",
+      "unicode": "e6e1",
+      "unicode_decimal": 59105
+    },
+    {
+      "icon_id": "802969",
+      "name": "楼房",
+      "font_class": "loufang",
+      "unicode": "e64f",
+      "unicode_decimal": 58959
+    },
+    {
+      "icon_id": "4348068",
+      "name": "电脑",
+      "font_class": "diannao1",
+      "unicode": "e623",
+      "unicode_decimal": 58915
+    },
+    {
+      "icon_id": "8835594",
+      "name": "图片",
+      "font_class": "tupian-xianxing",
+      "unicode": "e635",
+      "unicode_decimal": 58933
+    },
+    {
+      "icon_id": "10392628",
+      "name": "详情-",
+      "font_class": "xiangqing-",
+      "unicode": "e608",
+      "unicode_decimal": 58888
+    },
+    {
+      "icon_id": "36107",
+      "name": "面积",
+      "font_class": "mianji",
+      "unicode": "e602",
+      "unicode_decimal": 58882
+    },
+    {
+      "icon_id": "883904",
+      "name": "电话 (2)",
+      "font_class": "dianhua2",
+      "unicode": "e611",
+      "unicode_decimal": 58897
+    },
+    {
+      "icon_id": "1183130",
+      "name": "定位",
+      "font_class": "dingwei",
+      "unicode": "e675",
+      "unicode_decimal": 58997
+    },
+    {
+      "icon_id": "6129144",
+      "name": "102绑定",
+      "font_class": "bangding",
+      "unicode": "e784",
+      "unicode_decimal": 59268
+    },
+    {
+      "icon_id": "6970030",
+      "name": "用户",
+      "font_class": "yonghu11",
+      "unicode": "e705",
+      "unicode_decimal": 59141
+    },
+    {
+      "icon_id": "1106935",
+      "name": "雨",
+      "font_class": "yu",
+      "unicode": "e63a",
+      "unicode_decimal": 58938
+    },
+    {
+      "icon_id": "2155826",
+      "name": "温度",
+      "font_class": "thermometer_icon",
+      "unicode": "e67a",
+      "unicode_decimal": 59002
+    },
+    {
+      "icon_id": "4236632",
+      "name": "湿度",
+      "font_class": "shidu",
+      "unicode": "e60a",
+      "unicode_decimal": 58890
+    },
+    {
+      "icon_id": "7983631",
+      "name": "摄像头",
+      "font_class": "xingzhuang",
+      "unicode": "e614",
+      "unicode_decimal": 58900
+    },
+    {
+      "icon_id": "13638685",
+      "name": "电",
+      "font_class": "dian",
+      "unicode": "e655",
+      "unicode_decimal": 58965
+    },
+    {
+      "icon_id": "13638743",
+      "name": "温度",
+      "font_class": "wendu",
+      "unicode": "e660",
+      "unicode_decimal": 58976
+    },
+    {
+      "icon_id": "14095260",
+      "name": "定时",
+      "font_class": "dingshi",
+      "unicode": "e77e",
+      "unicode_decimal": 59262
+    },
+    {
+      "icon_id": "397065",
+      "name": "诱虫灯",
+      "font_class": "fangzhi",
+      "unicode": "e75c",
+      "unicode_decimal": 59228
+    },
+    {
+      "icon_id": "519489",
+      "name": "首页",
+      "font_class": "shouye",
+      "unicode": "e61e",
+      "unicode_decimal": 58910
+    },
+    {
+      "icon_id": "552767",
+      "name": "农药化肥",
+      "font_class": "nongchangguanli",
+      "unicode": "e62c",
+      "unicode_decimal": 58924
+    },
+    {
+      "icon_id": "689284",
+      "name": "设置 设定 配置 扳手",
+      "font_class": "shouhou",
+      "unicode": "e80e",
+      "unicode_decimal": 59406
+    },
+    {
+      "icon_id": "1119123",
+      "name": "系统",
+      "font_class": "xitong",
+      "unicode": "e60f",
+      "unicode_decimal": 58895
+    },
+    {
+      "icon_id": "1320048",
+      "name": "数据统计",
+      "font_class": "shujuzhanshi",
+      "unicode": "e621",
+      "unicode_decimal": 58913
+    },
+    {
+      "icon_id": "3483768",
+      "name": "地址",
+      "font_class": "jidi",
+      "unicode": "e672",
+      "unicode_decimal": 58994
+    },
+    {
+      "icon_id": "6756289",
+      "name": "专家",
+      "font_class": "zhuanjia",
+      "unicode": "e607",
+      "unicode_decimal": 58887
+    },
+    {
+      "icon_id": "7562834",
+      "name": "农事行为",
+      "font_class": "nongshiguanli",
+      "unicode": "e60c",
+      "unicode_decimal": 58892
+    },
+    {
+      "icon_id": "10544904",
+      "name": "多云转晴",
+      "font_class": "huanjingjiance",
+      "unicode": "e610",
+      "unicode_decimal": 58896
+    },
+    {
+      "icon_id": "13190141",
+      "name": "设备",
+      "font_class": "shebei",
+      "unicode": "e622",
+      "unicode_decimal": 58914
+    },
+    {
+      "icon_id": "13837385",
+      "name": "虫情监测 - 简",
+      "font_class": "cebaoguanli",
+      "unicode": "e776",
+      "unicode_decimal": 59254
+    },
+    {
+      "icon_id": "15282842",
+      "name": "树苗",
+      "font_class": "suyuan",
+      "unicode": "e6e8",
+      "unicode_decimal": 59112
+    },
+    {
+      "icon_id": "15631425",
+      "name": "监控",
+      "font_class": "jiankong",
+      "unicode": "e629",
+      "unicode_decimal": 58921
+    },
+    {
+      "icon_id": "992522",
+      "name": "信息",
+      "font_class": "xinxi1",
+      "unicode": "e64b",
+      "unicode_decimal": 58955
+    },
+    {
+      "icon_id": "1135940",
+      "name": "用户",
+      "font_class": "yonghu1",
+      "unicode": "e612",
+      "unicode_decimal": 58898
+    },
+    {
+      "icon_id": "7501066",
+      "name": "密码",
+      "font_class": "mima1",
+      "unicode": "e620",
+      "unicode_decimal": 58912
+    },
+    {
+      "icon_id": "715831",
+      "name": "电脑",
+      "font_class": "diannao",
+      "unicode": "e605",
+      "unicode_decimal": 58885
+    },
+    {
+      "icon_id": "4186778",
+      "name": "标签",
+      "font_class": "biaoqian",
+      "unicode": "e634",
+      "unicode_decimal": 58932
+    },
+    {
+      "icon_id": "6682541",
+      "name": "地址",
+      "font_class": "dizhi",
+      "unicode": "e606",
+      "unicode_decimal": 58886
+    },
+    {
+      "icon_id": "7404314",
+      "name": "时间",
+      "font_class": "shijian",
+      "unicode": "e77c",
+      "unicode_decimal": 59260
+    },
+    {
+      "icon_id": "8094230",
+      "name": "页面操作",
+      "font_class": "yemiancaozuo",
+      "unicode": "e64e",
+      "unicode_decimal": 58958
+    },
+    {
+      "icon_id": "10995780",
+      "name": "用户",
+      "font_class": "yonghu",
+      "unicode": "e60e",
+      "unicode_decimal": 58894
+    },
+    {
+      "icon_id": "354570",
+      "name": "编辑",
+      "font_class": "iconfontedit",
+      "unicode": "e61f",
+      "unicode_decimal": 58911
+    },
+    {
+      "icon_id": "813727",
+      "name": "充值",
+      "font_class": "chongzhi",
+      "unicode": "e633",
+      "unicode_decimal": 58931
+    },
+    {
+      "icon_id": "1761485",
+      "name": "禁用",
+      "font_class": "jinyong",
+      "unicode": "e641",
+      "unicode_decimal": 58945
+    },
+    {
+      "icon_id": "11391516",
+      "name": "密码",
+      "font_class": "mima",
+      "unicode": "e638",
+      "unicode_decimal": 58936
+    },
+    {
+      "icon_id": "9783463",
+      "name": "文档",
+      "font_class": "wendang",
+      "unicode": "e613",
+      "unicode_decimal": 58899
+    },
+    {
+      "icon_id": "4641118",
+      "name": "删除",
+      "font_class": "shanchu",
+      "unicode": "e625",
+      "unicode_decimal": 58917
+    },
+    {
+      "icon_id": "12685010",
+      "name": "铃",
+      "font_class": "icon_huabanfuben",
+      "unicode": "e62b",
+      "unicode_decimal": 58923
+    },
+    {
+      "icon_id": "2512619",
+      "name": "BAI-屋子",
+      "font_class": "BAI-wuzi",
+      "unicode": "e69c",
+      "unicode_decimal": 59036
+    },
+    {
+      "icon_id": "5387843",
+      "name": "主题_调色盘_o",
+      "font_class": "zhuti_tiaosepan_o",
+      "unicode": "eb6e",
+      "unicode_decimal": 60270
+    }
+  ]
+}

File diff suppressed because it is too large
+ 245 - 0
style/font/iconfont.svg


BIN
style/font/iconfont.ttf


BIN
style/font/iconfont.woff


BIN
style/font/iconfont.woff2


+ 1 - 1
style/html/h52.html

@@ -115,7 +115,7 @@
 				<div class="left" ontouchstart="configCamera('move', 2)" ontouchend="stopConfigCamera()">
 
 				</div>
-				<div class="right" ontouchstart="configCamera('move', 6)" ontouchend="stopConfigCamera()">
+				<div class="right" ontouchstart="configCamera('move', 3)" ontouchend="stopConfigCamera()">
 
 				</div>
 			</div>

File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/runtime.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/components/bazaar-city_list/index.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/components/equip-item/equip-item.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/components/ksp-image-cutter/ksp-image-cutter.js.map


File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/components/multiple-select.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/components/uni-icons/uni-icons.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/components/uni-nav-bar/uni-nav-bar.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/components/uni-status-bar/uni-status-bar.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/afterSale/addafter.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/afterSale/index.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/afterSale/search.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/bzy/equip-set/bzyhistoryile.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/bzy/equip-set/equip-set.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/cbd/equip-set/addimg.js.map


File diff suppressed because it is too large
+ 1 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/cbd/equip-set/analyse.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/cbd/equip-set/equip-set.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/cbd/equip-set/historyfile.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/cbd/equip-set/imgpage.js.map


File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/cbd/equip-set/manualinput.js.map


+ 0 - 0
unpackage/dist/dev/.sourcemap/mp-weixin/pages/cb/cbd/equip-set/note.js.map


Some files were not shown because too many files changed in this diff