zhangyun %!s(int64=2) %!d(string=hai) anos
pai
achega
85e16f8e2b
Modificáronse 100 ficheiros con 8728 adicións e 1327 borrados
  1. 346 0
      components/multiple-select.vue
  2. 4 0
      main.js
  3. 3 3
      manifest.json
  4. 125 0
      pages.json
  5. 28 3
      pages/cb/bzy/equip-set/bzyhistoryile.vue
  6. 25 1
      pages/cb/cbd/equip-set/historyfile.vue
  7. 0 26
      pages/cb/cbd/equip-set/imgpage.vue
  8. 37 105
      pages/cb/equip-detail/equip-detail.vue
  9. 214 89
      pages/cb/index/index.vue
  10. 106 38
      pages/cb/index/search.vue
  11. 278 0
      pages/cb/thxydetail/photolist.vue
  12. 470 0
      pages/cb/thxydetail/thxydetail.vue
  13. 544 0
      pages/cb/thxydetail/thxyhisdata.vue
  14. 352 0
      pages/cb/thxydetail/thxyset.vue
  15. 822 0
      pages/cb/xctdetail/analyse.vue
  16. 278 0
      pages/cb/xctdetail/photolist.vue
  17. 586 0
      pages/cb/xctdetail/xctdetail.vue
  18. 379 0
      pages/cb/xctdetail/xctset.vue
  19. 26 8
      pages/cb/xy/equip-set/xyhistoryile.vue
  20. 112 46
      pages/cb/xy2.0/historydatas.vue
  21. 2 2
      pages/cb/xy2.0/particulars.vue
  22. 186 0
      pages/cbqxyj/addressbook.vue
  23. 50 0
      pages/cbqxyj/basemap.vue
  24. 853 0
      pages/cbqxyj/cbwarn.vue
  25. 618 0
      pages/cbqxyj/warnset.vue
  26. 694 749
      pages/disease/cmb.vue
  27. 1 1
      pages/distribution/index.vue
  28. 3 33
      pages/environment/equipment.vue
  29. 30 48
      pages/environment/gsequipment.vue
  30. 2 2
      pages/environment/history.vue
  31. 20 5
      pages/environment/index.vue
  32. 13 23
      pages/equipList/index.vue
  33. 2 2
      pages/equipList/modification.vue
  34. 65 3
      pages/equipList/search.vue
  35. 4 2
      pages/equipMange/index/index.vue
  36. 9 9
      pages/equipMange/index/useroperation.vue
  37. 50 33
      pages/index/index.vue
  38. 20 6
      pages/irrigate/index.vue
  39. 4 3
      pages/my/user-info/user-info.vue
  40. 3 36
      pages/prevention/equipmentdetails.vue
  41. 0 3
      pages/prevention/index.vue
  42. 29 10
      pages/prevention/ucharts.vue
  43. 813 0
      pages/qxzyj/cbwarn.vue
  44. 496 0
      pages/qxzyj/warnset.vue
  45. 2 27
      pages/waterandfer/datails.vue
  46. 2 2
      static/h52.html
  47. BIN=BIN
      static/images/newindex/aftersale.png
  48. BIN=BIN
      static/images/newindex/base.png
  49. BIN=BIN
      static/images/newindex/cao.png
  50. BIN=BIN
      static/images/newindex/cb.png
  51. BIN=BIN
      static/images/newindex/dadou.jpg
  52. BIN=BIN
      static/images/newindex/dao.png
  53. BIN=BIN
      static/images/newindex/fz.png
  54. BIN=BIN
      static/images/newindex/guangai.png
  55. BIN=BIN
      static/images/newindex/hj.png
  56. BIN=BIN
      static/images/newindex/jk.png
  57. BIN=BIN
      static/images/newindex/knowledge.png
  58. BIN=BIN
      static/images/newindex/lingc.jpg
  59. BIN=BIN
      static/images/newindex/ma.png
  60. BIN=BIN
      static/images/newindex/mai.png
  61. BIN=BIN
      static/images/newindex/ming.png
  62. BIN=BIN
      static/images/newindex/qing.png
  63. BIN=BIN
      static/images/newindex/shidu.png
  64. BIN=BIN
      static/images/newindex/shuifeiyitihua.png
  65. BIN=BIN
      static/images/newindex/user.png
  66. BIN=BIN
      static/images/newindex/weizhi.png
  67. BIN=BIN
      static/images/newindex/wendu.png
  68. BIN=BIN
      static/images/newindex/worm.png
  69. BIN=BIN
      static/images/newindex/yee.jpg
  70. BIN=BIN
      static/images/newindex/yumi.png
  71. 14 1
      static/js/equipState_dict.json
  72. 2 2
      unpackage/dist/build/app-plus/app-config-service.js
  73. 2 2
      unpackage/dist/build/app-plus/app-service.js
  74. 1 1
      unpackage/dist/build/app-plus/app-view.js
  75. 1 1
      unpackage/dist/build/app-plus/manifest.json
  76. 2 2
      unpackage/dist/build/app-plus/static/h52.html
  77. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/aftersale.png
  78. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/base.png
  79. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/cao.png
  80. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/cb.png
  81. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/dadou.jpg
  82. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/dao.png
  83. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/fz.png
  84. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/guangai.png
  85. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/hj.png
  86. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/jk.png
  87. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/knowledge.png
  88. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/lingc.jpg
  89. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/ma.png
  90. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/mai.png
  91. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/ming.png
  92. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/qing.png
  93. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/shidu.png
  94. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/shuifeiyitihua.png
  95. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/user.png
  96. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/weizhi.png
  97. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/wendu.png
  98. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/worm.png
  99. BIN=BIN
      unpackage/dist/build/app-plus/static/images/newindex/yee.jpg
  100. 0 0
      unpackage/dist/build/app-plus/static/images/newindex/yumi.png

+ 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

@@ -17,6 +17,10 @@ Vue.prototype.$appimghost = 'http://www.hnyfwlw.com:8006/bigdata_app'
 import config from "./util/neutral.js"
 Vue.prototype.$isneutral = config.isneutral
 
+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

+ 3 - 3
manifest.json

@@ -1,9 +1,9 @@
 {
-    "name" : "云控",
+    "name" : "云飞智控",
     "appid" : "__UNI__DBA6730",
     "description" : "",
-    "versionName" : "1.5.0",
-    "versionCode" : 150,
+    "versionName" : "1.5.4",
+    "versionCode" : 154,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 125 - 0
pages.json

@@ -603,6 +603,131 @@
             }
             
         }
+        ,{
+            "path" : "pages/cbqxyj/cbwarn",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "测报预警",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/cbqxyj/basemap",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "设备位置",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/cbqxyj/addressbook",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "预警通讯录",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/cbqxyj/warnset",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "预警设置",
+                "enablePullDownRefresh": false
+            }
+            
+        },{
+            "path" : "pages/qxzyj/cbwarn",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "气象预警",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/qxzyj/warnset",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "预警设置",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/cb/thxydetail/thxydetail",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "设备详情",
+                "enablePullDownRefresh": false
+            }
+        }
+		,{
+		    "path" : "pages/cb/xctdetail/xctdetail",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "设备详情",
+		        "enablePullDownRefresh": false
+		    }
+		}
+        ,{
+            "path" : "pages/cb/thxydetail/photolist",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "查看图片",
+                "enablePullDownRefresh": false,
+				"navigationStyle": "custom"
+            }
+            
+        }
+        ,{
+            "path" : "pages/cb/thxydetail/thxyset",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "设备控制",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/cb/xctdetail/xctset",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "设备控制",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/cb/xctdetail/photolist",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "查看图片",
+                "enablePullDownRefresh": false,
+                "navigationStyle": "custom"
+            }
+            
+        }
+        ,{
+            "path" : "pages/cb/xctdetail/analyse",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "害虫分析",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/cb/thxydetail/thxyhisdata",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "历史数据",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"condition": { //模式配置,仅开发期间生效
 		"current": 3, //当前激活的模式(list 的索引项)

+ 28 - 3
pages/cb/bzy/equip-set/bzyhistoryile.vue

@@ -28,7 +28,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>
@@ -41,7 +41,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>
@@ -51,6 +51,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>
@@ -69,6 +89,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() {
@@ -87,15 +108,19 @@
 				page: 1,
 				pagesum: 1,
 				historylistdata: [],
-				thdata: ["上报时间", "设备开关", "环境温度(°C)", "环境湿度(%)", "保温仓设定温度(°C)", "保温仓当前温度(°C)", "电池状态", "雨控状态", "摄像头状态",
+				thdata: ["上报时间", "设备开关", "环境温度(°C)", "环境湿度(%)", "保温仓设定温度(°C)", "保温仓当前温度(°C)", "电池状态", "雨控状态", "工作状态",
 					"信号强度", "电流(mA)", "电压(V)", "设备版本"
 				],
+				thdata2: ["上报时间", "设备开关", "环境温度(°C)", "环境湿度(%)", "保温仓设定温度(°C)", "保温仓当前温度(°C)", "电池状态", "雨控状态", "工作状态",
+					"设备版本"
+				],
 				forbidden: false,
 				canvastishiTF: false, //暂无数据提示
 				dataloadingtf: true, //加载中提示
 				cWidth: '400',
 				cHeight: '400',
 				pixelRatio: 1,
+				Circulation:Circulation
 			}
 		},
 		methods: {

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

@@ -26,7 +26,7 @@
 			</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>
@@ -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',

+ 0 - 26
pages/cb/cbd/equip-set/imgpage.vue

@@ -37,12 +37,6 @@
 						<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">
-							<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> -->
 						<p style="color: #06B535;">{{item.addtime|timeFormat()}}</p>
 					</view>
 				</view>
@@ -221,26 +215,6 @@
 					duration: 500
 				})
 			},
-			// changeindex(index){
-			// 	this.imglists=[]
-			// 	this.page =1
-			// 	this.titleidnex = index
-			// 	var newtime = new Date()
-			// 	this.timeend = +new Date(newtime)/1000
-			// 	if(index == 0){
-			// 		this.timestate = (newtime - 60 * 60 * 24*1000)/1000
-			// 		this.imglistdata(parseInt(this.timestate),parseInt(this.timeend))
-			// 	}else if(index == 1){
-			// 		this.timestate = (newtime.setMonth(newtime.getMonth() - 1))/1000
-			// 		this.imglistdata(parseInt(this.timestate),parseInt(this.timeend))
-			// 	}else if(index == 2){
-			// 		this.timestate = (newtime.setMonth(newtime.getMonth() - 6))/1000
-			// 		this.imglistdata(parseInt(this.timestate),parseInt(this.timeend))
-			// 	}else if(index == 3){
-			// 		this.timestate = (newtime.setFullYear(newtime.getFullYear() - 1))/1000
-			// 		this.imglistdata(parseInt(this.timestate),parseInt(this.timeend))
-			// 	}
-			// },
 			tiemchange(e) {
 				this.imglists = []
 				this.page = 1

+ 37 - 105
pages/cb/equip-detail/equip-detail.vue

@@ -98,7 +98,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>
@@ -124,6 +127,7 @@
 
 <script>
 	import equipState from "../../../static/js/equipState_dict.json"
+	import {QueryPermission} from "../../../util/QueryPermission.js"
 	export default {
 		data() {
 			return {
@@ -141,28 +145,23 @@
 						icon: '/image/cb/1.png',
 						tex: '查看图片',
 						path: '/pages/cb/cbd/equip-set/imgpage',
-						tf: false
+						tf: QueryPermission(61)
 					},
 					{
 						icon: '/image/cb/3.png',
 						tex: '害虫分析',
 						path: '/pages/cb/cbd/equip-set/analyse',
-						tf: false
+						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: '一键报修',
@@ -174,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: '一键报修',
@@ -203,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: '一键报修',
@@ -441,6 +434,11 @@
 								txt: '电池状态',
 								value: this.newState.bs
 							},
+							{
+								icon: '/image/cb/xy2.0/yujing.png',
+								txt: '诱虫次数',
+								value: this.newState.yc
+							},
 						]
 				}
 			}
@@ -454,7 +452,6 @@
 						return "孢子仪";
 					case 4:
 						return "性诱测报"
-
 				}
 			},
 			formatValue(val, a1, a2) {
@@ -494,87 +491,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 163:
-								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
-					}
-					console.log(arr3)
-					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[3].tf = true //"数据详情"
-								break;
-							case 70:
-								this.bzy[2].tf = true //"SIM卡"
-								break;
-						}
-					}
-				}
-			})
 		},
 		methods: {
 			async getState() {
@@ -591,13 +507,29 @@
 						end_time: Math.floor((+new Date()) / 1000)
 					}
 				})
-				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.newState.yc = res.total_num
+				this.dataloadingtf = false
 			},
 			partClick(path) {
 				console.log(path)

+ 214 - 89
pages/cb/index/index.vue

@@ -3,21 +3,23 @@
 		<view class="status_bar"></view>
 		<view class="" style="position: relative;top: 44px;">
 			<view style="position: fixed;z-index: 100;">
-				<uni-nav-bar @clickRight="clickRight" @clickLeft="clickLeft" left-icon="back" left-text="返回" right-icon="search"
-				 title="测报系统"></uni-nav-bar>
-				 <view class="inputs" :style="{'width':width+'rpx'}">
-				 	<input type="text" value="" placeholder="请输入设备ID或设备名称" v-model="imports" @input="searchinp"
-				 		class="inputbox" :clearable="false" />
-				 	<u-icon name="search" size="40" class="icon" @click="search"></u-icon>
-				 </view>
-				<view>
-					<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/cb/banner.jpg'" mode="widthFix"></image>
+				<uni-nav-bar @clickRight="clickRight" @clickLeft="clickLeft" left-icon="back" left-text="返回"
+					right-icon="search" title="测报系统"></uni-nav-bar>
+				<view class="inputs" :style="{'width':width+'rpx'}">
+					<input type="text" value="" placeholder="请输入设备ID或设备名称" v-model="imports" @input="searchinp"
+						class="inputbox" :clearable="false" />
+					<u-icon name="search" size="40" class="icon" @click="search"></u-icon>
 				</view>
-				<view class="tab-box">
-					<view v-for="(item,index) in equipArr" :key="item.type" v-if="item.tf" @click="tabClick(index)" :class="['tab-item',active==index?'active':'']">
-						<text>{{item.name}}</text>
-						<text class="bottom-line"></text>
-					</view>
+				<view style="width: 100%;">
+					<image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+'/image/cb/banner.jpg'" mode="widthFix">
+					</image>
+				</view>
+			</view>
+			<view class="tab-box">
+				<view v-for="(item,index) in equipArr" :key="item.type" v-if="item.tf" @click="tabClick(index)"
+					:class="['tab-item',active==index?'active':'']">
+					<text>{{item.name}}</text>
+					<text class="bottom-line"></text>
 				</view>
 			</view>
 			<view class="loading" v-if="loadingtf">
@@ -30,11 +32,13 @@
 							<view class="date">
 								<p>设备ID:{{item.imei || item.device_id}}</p>
 								<p>最新上报时间:{{item.addtime|timeFormat}}</p>
-								<view class="" style="display: flex;justify-content: space-between;" v-if="device_type == 3 || device_type==7">
+								<view class="" style="display: flex;justify-content: space-between;"
+									v-if="device_type == 3 || device_type==7">
 									<p>设备到期情况:<span
 											:class="'prevents_item_bot_sapn'+item.device_expire">{{item.device_expiretext}}</span>
 									</p>
-									<p style="color: #3C84FE;" v-if="item.device_expire!=0" @click.stop="examine(item)">查看详情</p>
+									<p style="color: #3C84FE;" v-if="item.device_expire!=0" @click.stop="examine(item)">
+										查看详情</p>
 								</view>
 							</view>
 						</equipItem>
@@ -42,7 +46,8 @@
 				</view>
 			</view>
 		</view>
-		<u-modal v-model="show" :title="title" :showConfirmButton="false" :title-style="{'text-align':'left','padding-left':'10px','font-weight':700}" :mask-close-able="true">
+		<u-modal v-model="show" :title="title" :showConfirmButton="false"
+			:title-style="{'text-align':'left','padding-left':'10px','font-weight':700}" :mask-close-able="true">
 			<view class="slot-content">
 				<rich-text :nodes="content"></rich-text>
 			</view>
@@ -62,7 +67,8 @@
 					<p>全部</p>
 				</view>
 				<view @click="filtrate">
-					<image src="../../../static/images/b0bcdb0e3fe8690520f743aa8303bf2.png" mode="" class="img1"></image>
+					<image src="../../../static/images/b0bcdb0e3fe8690520f743aa8303bf2.png" mode="" class="img1">
+					</image>
 				</view>
 			</view>
 		</view>
@@ -70,7 +76,9 @@
 </template>
 
 <script>
-	import {Debounce} from "../../../util/anitthro.js"
+	import {
+		Debounce
+	} from "../../../util/anitthro.js"
 	import equipItem from "../../../components/equip-item/equip-item"
 	import uniNavBar from "@/components/uni-nav-bar/uni-nav-bar.vue"
 	export default {
@@ -82,35 +90,48 @@
 						type: 3, //3虫情测报灯 7孢子仪 4智能性诱
 						list: [],
 						pageIndex: 1,
-						tf:false,
+						tf: false,
 					}, {
 						name: '孢子仪',
 						type: 7, //3虫情测报灯 7孢子仪 4智能性诱
 						list: [],
 						pageIndex: 1,
-						tf:false,
+						tf: false,
 					}, {
 						name: '性诱测报',
 						type: 4, //3虫情测报灯 7孢子仪 4智能性诱
 						list: [],
 						pageIndex: 1,
-						tf:false,
+						tf: false,
 					},
 					{
 						name: '性诱2.0',
 						type: 10, //3虫情测报灯 7孢子仪 4智能性诱 性诱2.0
 						list: [],
 						pageIndex: 1,
-						tf:false
+						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_type: '3', //筛选的设备id
 				isTop: false,
-				filtrateTF:false,
-				device_status:"",
-				width:0,//顶部搜索栏宽度
-				imports:"",//搜索id
-				loadingtf:false,//loading
+				filtrateTF: false,
+				device_status: "",
+				width: 0, //顶部搜索栏宽度
+				imports: "", //搜索id
+				loadingtf: false, //loading
 				show: false,
 				title: "",
 				content: "",
@@ -118,34 +139,51 @@
 		},
 		onLoad() {
 			uni.getStorage({
-				key:"jurisdiction",
-				success:(res)=>{
-					let items = JSON.parse(res.data).filter((item)=>{
+				key: "jurisdiction",
+				success: (res) => {
+					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].pur_id){
+					for (var i = 0; i < arr.length; i++) {
+						switch (arr[i].pur_id) {
 							case 37:
-								this.equipArr[0].tf = true//"虫情测报灯"
+								this.equipArr[0].tf = true //"虫情测报灯"
 								this.getEquipList(0)
 								break
 							case 38:
-								this.equipArr[2].tf = true//"性诱测报"
+								this.equipArr[2].tf = true //"性诱测报"
 								this.getEquipList(2)
 								break
 							case 39:
-								this.equipArr[1].tf = true//"孢子仪"
+								this.equipArr[1].tf = true //"孢子仪"
 								this.getEquipList(1)
 								break
 							case 161:
-								this.equipArr[3].tf = true//"性诱2.0"
+								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
+							console.log(i)
+							break
 						}
 					}
 				}
 			})
+			
 		},
 		onShow() {
 
@@ -159,9 +197,14 @@
 		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,9 +217,13 @@
 				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{
+			} else {
 				this.getEquipList(act)
 			}
 		},
@@ -196,18 +243,18 @@
 		},
 		methods: {
 			async getEquipList(act) {
-				this.loadingtf =true
+				this.loadingtf = true
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
 					data: {
 						device_type_id: this.equipArr[act].type,
 						page: this.equipArr[act].pageIndex,
 						page_size: 10,
-						device_status:this.device_status,
+						device_status: this.device_status,
 						device_id: this.imports,
 					}
 				})
-				this.loadingtf =false
+				this.loadingtf = false
 				console.log(res)
 				this.equipArr[act].list = [...this.equipArr[act].list, ...res.data]
 				for (var i = 0; i < this.equipArr[act].list.length; i++) {
@@ -222,14 +269,48 @@
 				console.log(this.equipArr[act].list)
 			},
 			async getxyEquipList(act) {
-				this.loadingtf =true
+				this.loadingtf = true
 				const res = await this.$myRequest({
 					url: '/api/api_gateway?method=sex_lure_nl.sex_lure.nl_device_list',
 					data: {
 						device_type_id: this.equipArr[act].type,
 						page: this.equipArr[act].pageIndex,
 						page_size: 10,
-						device_status:this.device_status,
+						device_status: this.device_status,
+						device_id: this.imports,
+					}
+				})
+				this.loadingtf = false
+				console.log(res)
+				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,
+						device_id: this.imports,
+					}
+				})
+				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,
 						device_id: this.imports,
 					}
 				})
@@ -245,7 +326,7 @@
 				this.device_type = this.equipArr[index].type
 			},
 			clickRight() {
-				this.width=600
+				this.width = 600
 			},
 			itemClick(item) {
 				item.type = this.equipArr[this.active].type
@@ -254,7 +335,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
 					});
@@ -265,7 +355,7 @@
 					url: "../../index/index"
 				})
 			},
-			filtrate(){
+			filtrate() {
 				this.filtrateTF = !this.filtrateTF
 			},
 			top() {
@@ -274,50 +364,68 @@
 					duration: 500
 				})
 			},
-			online(){
-				this.equipArr[this.active].pageIndex=1
-				this.equipArr[this.active].list =[]
+			online() {
+				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
 			},
-			offline(){
-				this.equipArr[this.active].pageIndex=1
-				this.equipArr[this.active].list =[]
+			offline() {
+				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
 			},
-			complete(){
-				this.equipArr[this.active].pageIndex=1
-				this.equipArr[this.active].list =[]
+			complete() {
+				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
 			},
-			search() {//搜索按钮搜索
+			search() { //搜索按钮搜索
 				this.searchinp()
 			},
-			searchinp() {//自动搜索
+			searchinp() { //自动搜索
 				Debounce(() => {
 					this.equipArr[this.active].pageIndex = 1
-					if(this.active==3){
-						this.equipArr[this.active].list=[]
-						this.getxyEquipList(3)
-					}else{
-						this.equipArr[this.active].list=[]
+					if (this.active == 4) {
+						this.equipArr[this.active].list = []
+						this.getthxyEquipList(this.active)
+					} else if (this.active == 5) {
+						this.equipArr[this.active].list = []
+						this.getxctEquipList(this.active)
+					} else if (this.active == 3) {
+						this.equipArr[this.active].list = []
+						this.getxyEquipList(this.active)
+					} else {
+						this.equipArr[this.active].list = []
 						this.getEquipList(this.active)
 					}
 				}, 1000)()
@@ -326,7 +434,8 @@
 				// console.log(this)
 				this.show = true
 				this.title = e.device_expiretext
-				this.content = `<p style="padding-left:10px;margin:10px 0;font-size:14px;">到期时间  ${this.timezhuan(e.device_expire_time)}
+				this.content =
+					`<p style="padding-left:10px;margin:10px 0;font-size:14px;">到期时间  ${this.timezhuan(e.device_expire_time)}
 				</p><p style="font-size:14px;text-align:right;color:#3C84FE;margin-bottom:10px;padding-right:10px">注:请前往PC端进行充值</p>`
 			},
 			timezhuan(time) {
@@ -357,14 +466,15 @@
 		.content {
 			padding: 0 20rpx 20rpx 20rpx;
 			box-sizing: border-box;
+
 			.prevents_item_bot_sapn0 {
 				color: #00B075;
 			}
-			
+
 			.prevents_item_bot_sapn1 {
 				color: #FF4747;
 			}
-			
+
 			.prevents_item_bot_sapn2 {
 				color: #FFAB00;
 			}
@@ -374,55 +484,66 @@
 	image {
 		width: 100%;
 	}
-	.inputs{
+
+	.inputs {
 		height: 54rpx;
 		background-color: #E4E4E4;
 		border-radius: 27rpx;
 		position: absolute;
 		right: 20rpx;
 		top: 20rpx;
-		transition: width 0.5s; 
+		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;
 		}
 	}
-	.loading{
+
+	.loading {
 		position: fixed;
 		top: 440px;
 		width: 95%;
 		left: 2.5%;
 		text-align: center;
-		.img{
+
+		.img {
 			width: 300rpx;
 			height: 40rpx;
 		}
 	}
+
 	.tab-box {
-		display: flex;
-		justify-content: space-around;
+		position: fixed;
+		top: 170px;
 		font-size: 30rpx;
 		line-height: 80rpx;
-		background-color: #FFFFFF;
-		margin-top: -10rpx;
+		background-color: #ffffff;
+		width: 100%;
+		z-index: 2;
+		overflow: hidden;
+		overflow-x: scroll;
+		white-space: nowrap;
 
 		.tab-item {
 			cursor: pointer;
 			position: relative;
+			width: 25%;
+			text-align: center;
+			display: inline-block;
+			padding: 10rpx 0;
 		}
 
-		;
-
 		.tab-item.active {
 			.bottom-line {
 				bottom: 0;
@@ -443,22 +564,26 @@
 		right: 10px;
 		bottom: 40px;
 		z-index: 100;
+
 		image {
 			width: 100rpx;
 			height: 100rpx;
 		}
-		.backtop{
+
+		.backtop {
 			display: flex;
 			justify-content: flex-end;
 			margin-bottom: 10rpx;
 		}
-		.more{
+
+		.more {
 			display: flex;
 		}
-		.box{
+
+		.box {
 			width: 80rpx;
 			height: 80rpx;
-			background-color: rgba(161,161,161,0.45);
+			background-color: rgba(161, 161, 161, 0.45);
 			border-radius: 50%;
 			text-align: center;
 			line-height: 80rpx;

+ 106 - 38
pages/cb/index/search.vue

@@ -14,8 +14,9 @@
 			</view>
 			<view class="prevents" v-else>
 				<view class="prevents_item" v-for="item,index in eqlistdata" :key="index" @click="eqdetails(item)">
-					<image :src="item.is_online==1?'http://static.yfpyx.com/bigdata_app/image/prevention/6.png':'http://static.yfpyx.com/bigdata_app/image/prevention/7.png'" mode=""
-					 class="prevents_item_img"></image>
+					<image
+						:src="item.is_online==1?'http://static.yfpyx.com/bigdata_app/image/prevention/6.png':'http://static.yfpyx.com/bigdata_app/image/prevention/7.png'"
+						mode="" class="prevents_item_img"></image>
 					<view class="prevents_item_top">
 						<p>设备 ID:{{item.imei || item.device_id}}</p>
 						<p :class="item.is_online==1?'green':'red'" v-text="item.is_online==1?'在线':'离线'"></p>
@@ -28,7 +29,8 @@
 			</view>
 		</view>
 		<view class="top" v-if="isTop" @click="top">
-			<image :src="'http://static.yfpyx.com/bigdata_app'+'/image/6209a98f0cb3b5086f2ca36152c9269.png'" mode=""></image>
+			<image :src="'http://static.yfpyx.com/bigdata_app'+'/image/6209a98f0cb3b5086f2ca36152c9269.png'" mode="">
+			</image>
 		</view>
 	</view>
 </template>
@@ -41,12 +43,12 @@
 	export default {
 		data() {
 			return {
-				imports:"",
-				device_id:'',
-				page:1,
-				eqlistdata:[],
-				isTop:false,
-				none:false
+				imports: "",
+				device_id: '',
+				page: 1,
+				eqlistdata: [],
+				isTop: false,
+				none: false
 			}
 		},
 		methods: {
@@ -56,14 +58,14 @@
 					data: {
 						device_type_id: this.device_id,
 						device_id: this.imports,
-						page:this.page
+						page: this.page
 					}
 				})
 				this.eqlistdata = this.eqlistdata.concat(res.data)
 				console.log(res)
-				if(this.eqlistdata.length==0){
+				if (this.eqlistdata.length == 0) {
 					this.none = true
-				}else{
+				} else {
 					this.none = false
 				}
 			},
@@ -74,39 +76,88 @@
 						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 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,
+						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.equipArr[act].type,
+						page: this.equipArr[act].pageIndex,
+						page_size: 10,
+						device_status: this.device_status,
+						device_id: this.imports,
 					}
 				})
 				this.eqlistdata = this.eqlistdata.concat(res.data)
 				console.log(res)
-				if(this.eqlistdata.length==0){
+				if (this.eqlistdata.length == 0) {
 					this.none = true
-				}else{
+				} else {
 					this.none = false
 				}
 			},
-			searchinp(){
+			searchinp() {
 				Debounce(() => {
 					this.eqlistdata = []
 					this.page = 1
-					if(this.device_id==10){
+					if (this.device_id == 10) {
 						this.getxyEquipList()
-					}else{
+					} else if (this.device_id == 8) {
+						this.getthxyEquipList()
+					} else if (this.device_id == 12) {
+						this.getxctEquipList()
+					} else {
 						this.searchEquip()
 					}
 				}, 1000)()
 			},
-			search(){
+			search() {
 				this.eqlistdata = []
 				this.page = 1
-				if(this.device_id==10){
+				if (this.device_id == 10) {
 					this.getxyEquipList()
-				}else{
+				} else if (this.device_id == 8) {
+					this.getthxyEquipList()
+				} else if (this.device_id == 12) {
+					this.getxctEquipList()
+				} else {
 					this.searchEquip()
 				}
 			},
-			clickLeft(){
+			clickLeft() {
 				uni.navigateTo({
-					url:"./index"
+					url: "./index"
 				})
 			},
 			top() {
@@ -115,30 +166,43 @@
 					duration: 500
 				})
 			},
-			eqdetails(item){
+			eqdetails(item) {
 				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
 					});
 				}
 			}
 		},
-		onLoad(option){
+		onLoad(option) {
 			this.device_id = option.device_id
 		},
 		onReachBottom() {
 			this.page++
 			console.log(1)
-			if(this.device_id==10){
+			if (this.device_id == 10) {
 				this.getxyEquipList()
-			}else{
+			} else if (this.device_id == 8) {
+				this.getthxyEquipList()
+			} else if (this.device_id == 12) {
+				this.getxctEquipList()
+			} else {
 				this.searchEquip()
 			}
 		},
@@ -170,20 +234,21 @@
 		right: 18rpx;
 		padding-top: 8rpx;
 		box-sizing: border-box;
-	
+
 		input {
 			width: 85%;
 			text-indent: 1rem;
 			font-size: 26rpx;
 		}
-	
+
 		.icon {
 			position: absolute;
 			top: 8rpx;
 			right: 26rpx;
 		}
 	}
-	.nonetishi{
+
+	.nonetishi {
 		width: 100%;
 		position: absolute;
 		top: 60px;
@@ -192,10 +257,12 @@
 		line-height: 200rpx;
 		font-size: 22px;
 	}
+
 	.prevents {
 		width: 100%;
 		position: absolute;
 		top: 60px;
+
 		.prevents_item {
 			width: 95%;
 			margin: 0 auto 30rpx;
@@ -204,7 +271,7 @@
 			padding: 20rpx 40rpx 20rpx 80rpx;
 			box-sizing: border-box;
 			position: relative;
-	
+
 			.prevents_item_img {
 				width: 30rpx;
 				height: 50rpx;
@@ -212,7 +279,7 @@
 				top: -4rpx;
 				left: 30rpx;
 			}
-	
+
 			.prevents_item_top {
 				display: flex;
 				justify-content: space-between;
@@ -220,16 +287,16 @@
 				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;
@@ -237,15 +304,16 @@
 			}
 		}
 	}
+
 	.top {
 		position: fixed;
 		right: 30px;
 		bottom: 100px;
 		z-index: 100;
-		image{
+
+		image {
 			width: 100rpx;
 			height: 100rpx;
 		}
 	}
 </style>
-

+ 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" 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" 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: 1672px;
+			}
+			.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>

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

@@ -0,0 +1,822 @@
+<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)"
+					@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"
+					: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" 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: {}
+			}
+		},
+		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,
+						device_type: 'xct'
+					}
+				})
+				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,
+						device_type: 'xct'
+					}
+				})
+				// 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,
+						device_type: 'xct'
+					}
+				})
+				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
+			},
+			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; //...
+		}
+
+		.u-progress {
+			width: calc(100% - 150px);
+		}
+
+		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"
+					@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) {
+			console.log(JSON.parse(option.info))
+			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: 1672px;
+			}
+
+			.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>

+ 26 - 8
pages/cb/xy/equip-set/xyhistoryile.vue

@@ -46,13 +46,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>
@@ -60,13 +59,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>
@@ -104,9 +120,11 @@
 				device_id: '',
 				page: 1,
 				historylistdata: [],
-				thdata: ["上报时间", "型号", "设备开关", "工作状态", "环境温度(°C)", "环境湿度(%)", "充电电压(V)", "电池电压(V)", "电池状态", "充电状态",
-					"红外计数值", "信号强度",
-					"版本号"
+				thdata: ["上报时间", "设备开关", "工作状态", "环境温度(°C)", "环境湿度(%)", "充电电压(V)", "电池电压(V)", "电池状态", "充电状态",
+					"诱虫次数", "信号强度",
+				],
+				thdata2: ["上报时间", "设备开关", "工作状态", "环境温度(°C)", "环境湿度(%)", "电池状态", "充电状态",
+					"诱虫次数",
 				],
 				forbidden: false,
 				wind_sped: '', //风速

+ 112 - 46
pages/cb/xy2.0/historydatas.vue

@@ -1,13 +1,30 @@
 <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>
@@ -24,7 +41,7 @@
 			</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>
@@ -42,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>
@@ -55,6 +86,7 @@
 				</view>
 			</view>
 		</view>
+		<u-calendar v-model="timeshow" :mode="mode" @change="timechange"></u-calendar>
 	</view>
 </template>
 
@@ -78,6 +110,7 @@
 				page: 1,
 				historylistdata: [],
 				thdata: ["上报时间", "环境温度(°C)", "环境湿度(%)", "虫害预警", "电池电压", "电池电流", "太阳能板电压", "太阳能板电流"],
+				thdata2: ["上报时间", "环境温度(°C)", "环境湿度(%)", "虫害预警"],
 				forbidden: false,
 				cWidth: '400',
 				cHeight: '400',
@@ -85,7 +118,9 @@
 				canvastishiTF: false, //暂无数据提示
 				dataloadingtf: true, //加载中提示
 				pagesum: 1,
-				worms: []
+				worms: [],
+				timeshow:false,
+				mode: 'range',
 			}
 		},
 		methods: {
@@ -172,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--
@@ -278,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)
@@ -305,13 +326,51 @@
 	}
 </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;
@@ -372,9 +431,9 @@
 	}
 
 	.refresh {
-		position: absolute;
-		top: 630rpx;
-		left: 5%;
+		width: 90%;
+		// margin: 40rpx auto;
+		margin-left: 5%;
 		width: 160rpx;
 		height: 50rpx;
 		background-color: #57c878;
@@ -384,12 +443,11 @@
 	}
 
 	.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;
 
@@ -454,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>

+ 853 - 0
pages/cbqxyj/cbwarn.vue

@@ -0,0 +1,853 @@
+<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">
+			<u-swipe-action :show="item.show" :index="index" v-for="(item, index) in configlist" :key="item.id"
+				@click="delconfig(item.id)" :options="options" style="margin-bottom: 30rpx;">
+				<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 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>

+ 618 - 0
pages/cbqxyj/warnset.vue

@@ -0,0 +1,618 @@
+<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-show="!selbaselist.length">
+						请选择预警
+					</view>
+					<view class="basesel_list_sel_left" v-show="selbaselist.length">
+						<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" icon-size="10" label-size="20">
+						逐台预警
+					</u-radio>
+					<u-radio name="1" icon-size="10" label-size="20" :disabled="selbaselist.length<2">
+						合并预警
+					</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-show="item.appointPestName==''">
+							请选择害虫
+						</view>
+						<view class="itemtwo_left" v-show="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-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="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: [],
+				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
+			}
+		},
+		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;
+					}
+				}
+
+				.addordel {
+					width: 10%;
+				}
+			}
+		}
+
+		/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>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 694 - 749
pages/disease/cmb.vue


+ 1 - 1
pages/distribution/index.vue

@@ -101,7 +101,7 @@
 		methods: {
 			async history(device_id) { //获取分布位置
 				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: device_id

+ 3 - 33
pages/environment/equipment.vue

@@ -22,7 +22,7 @@
 				</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>
@@ -30,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>
@@ -343,36 +343,6 @@
 			} 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 = []
-					if (items2[0]) {
-						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
-						}
-					}
-				},
-			})
 		}
 	}
 </script>

+ 30 - 48
pages/environment/gsequipment.vue

@@ -16,58 +16,26 @@
 					<p>最近上报时间:<span v-if="eqinfo.uptime">{{eqinfo.uptime|timeFormat()}}</span><span
 							v-else>{{eqinfo.addtime|timeFormat()}}</span></p>
 					<p>地址:{{city}}</p>
-					<p @click="setlongfun('')">
+					<p @click="setlongfun('')" v-if="$QueryPermission(250)">
 						<text space="emsp">设置步长</text>
 						<u-icon name="edit-pen" color="#f0ad4e" size="28"></u-icon>
 					</p>
 				</view>
 			</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="请输入步长" />
+				<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">历史数据>>></p>
+					<p @click="tohistory" v-if="$QueryPermission(189)">历史数据>>></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 class="imgbox">
-							<image src="http://www.hnyfwlw.com:8006//bigdata_app/image/environment/tubular/kqs.png"
-								mode="" class="img"></image>
-						</view>
-						<view class="infobox">
-							<p>空气湿度</p>
-							<p>{{newdataobj.ats}}%RH</p>
-						</view>
-					</view>
-					<view class="newdatas_air_box">
-						<view class="imgbox">
-							<image src="http://www.hnyfwlw.com:8006//bigdata_app/image/environment/tubular/kqw.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>
+					<p class="newdatas_land_title">{{newdataobj.depth[index]}}cm</p>
 					<view class="newdatas_land_info">
 						<view class="newdatas_land_box">
 							<view class="imgbox">
@@ -107,6 +75,7 @@
 				modalshow: false, //设置步长弹框,
 				stepsize: "", //步长值
 				newdataobj: {}, //实时数据
+				depthlist:[]
 			}
 		},
 		methods: {
@@ -134,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 实时数据
@@ -154,13 +134,15 @@
 					}
 				})
 				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({
@@ -232,8 +214,8 @@
 
 	.modalbox {
 		display: flex;
-		padding: 20px 10px;
-
+		padding: 20rpx 10rpx;
+		font-size: 14px;
 		.uinput {
 			width: 50%;
 			border-radius: 22px;

+ 2 - 2
pages/environment/history.vue

@@ -46,7 +46,7 @@
 						<table class="table" :style="{width:300+240*datalength+'rpx'}">
 							<tr class="tr">
 								<th class="th">日期</th>
-								<th class="th" v-for="key,index in historydatas.conf" :key="index" v-if="key">
+								<th class="th" v-for="key,index in historydatas.conf" :key="index" v-show="key">
 									{{key.replace("#","(")+")"}}
 								</th>
 							</tr>
@@ -121,7 +121,7 @@
 				console.log(res)
 				this.datalength = 0
 				for (var key in res.conf) {
-					if (res.conf[key] != "") {
+					if (key && res.conf[key] != "") {
 						this.datalength++
 					}
 				}

+ 20 - 5
pages/environment/index.vue

@@ -12,7 +12,7 @@
 				</view>
 			</view>
 			<image :src="
-          'http://www.hnyfwlw.com:8006/bigdata_app' + '/image/environment/1.png'
+          'http://www.hnyfwlw.com:8006/bigdata_app/image/environment/1.png'
         " mode="" class="image">
 			</image>
 			<view class="loading" v-if="loadingtf">
@@ -259,15 +259,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",
 					});
 				}
 			},
@@ -326,6 +326,7 @@
 				}, 1000)();
 			},
 			tabClick(index, type) {
+				console.log("ress")
 				this.active = index;
 				this.side_type = type;
 				this.page = 1;
@@ -374,7 +375,7 @@
 			},
 		},
 		onLoad() {
-			this.eqlist();
+			// this.eqlist();
 			uni.getStorage({
 				key: "jurisdiction",
 				success: (res) => {
@@ -402,6 +403,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
+						}
+					}
 				},
 			});
 		},

+ 13 - 23
pages/equipList/index.vue

@@ -82,7 +82,7 @@
             </view>
             <view
               class="list_item_btn"
-              v-if="infoalter && ![13, 17, 18, 11, 19, 20].includes(type_id)"
+              v-if="$QueryPermission(108) && ![13, 17, 18, 11, 19, 20].includes(type_id)"
               @click.stop="modification(item)"
             >
               信息修改
@@ -214,10 +214,7 @@ export default {
       console.log(res);
       for (var i = 0; i < res.length; i++) {
         if (
-          res[i].type_name == "性诱3.0" ||
-          res[i].type_name == "吸虫塔" ||
           res[i].type_name == "病虫害可视监测" ||
-          // res[i].type_name == "小麦赤霉病" ||
           res[i].type_name == "温室大棚"
         ) {
           continue;
@@ -320,6 +317,18 @@ export default {
             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 = {};
@@ -446,25 +455,6 @@ export default {
     this.page = 1;
     this.usertype();
     this.width = 0;
-    uni.getStorage({
-      key: "jurisdiction",
-      success: (res) => {
-        console.log(JSON.parse(res.data));
-        let items = JSON.parse(res.data).filter((item) => {
-          return item.pur_id == 22//"设备管理";
-        });
-        let items2 = items[0].children.filter((item) => {
-          return item.pur_id == 23//"设备列表";
-        });
-        console.log(items2[0].children);
-        this.infoalter = items2[0].children.some((item) => {
-          return (
-            item.pur_id == 108 || item.pur_id == 109
-          );
-        });
-        console.log(this.infoalter);
-      },
-    });
   },
   onReachBottom() {
     this.page++;

+ 2 - 2
pages/equipList/modification.vue

@@ -14,7 +14,7 @@
 					<p>适配用户</p>
 					<input type="text" :value="moddata.real_name==''?'无':moddata.real_name" disabled />
 				</view>
-				<view class="mod_city" @click="amendcity">
+				<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;" />
@@ -51,7 +51,7 @@
 		methods: {
 			async eqlistcity(lat, lng) { //修改设备定位
 				const res = await this.$myRequest({
-					url: '/api/api_gateway?method=forecast.worm_lamp.revise_device',
+					url: '/api/api_gateway?method=forecast.worm_lamp.revise_device_lnglat',
 					data: {
 						device_id: this.moddata.imei,
 						lat: lat,

+ 65 - 3
pages/equipList/search.vue

@@ -132,7 +132,7 @@
 				})
 			},
 			historys(item) {
-				switch (Number(this.indexs)) {
+				switch (this.type_id) {
 					case 2:
 						uni.navigateTo({
 							url: "../prevention/equipmentdetails?shebei=" + JSON.stringify(item)
@@ -157,12 +157,74 @@
 							url: "/pages/webview?device_id=" + item.imei + "&accessToken=" + this.accessToken
 						})
 						break;
-					default:
-						item.type = this.indexs
+					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;
 				}
 			}
 		},

+ 4 - 2
pages/equipMange/index/index.vue

@@ -3,7 +3,8 @@
 		<view class="status_bar"></view>
 		<view class="" style="position: relative;top: 44px;">
 			<view style="position: fixed;z-index: 100;">
-				<uni-nav-bar left-icon="back" left-text="返回" right-icon="plus" title="用户管理" @clickRight="clickRight" @clickLeft="clickLeft"></uni-nav-bar>
+				<!-- <uni-nav-bar left-icon="back" left-text="返回" right-icon="plus" title="用户管理" @clickRight="clickRight" @clickLeft="clickLeft"></uni-nav-bar> -->
+				<uni-nav-bar left-icon="back" left-text="返回"  title="用户管理" @clickLeft="clickLeft"></uni-nav-bar>
 			</view>
 			<view class="uinput-box">
 				<view class="uinputs">
@@ -19,7 +20,7 @@
 					<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>
@@ -67,6 +68,7 @@
 					}
 				})
 				this.userlists = this.userlists.concat(res.data)
+				console.log(this.userlists)
 			},
 			async userlogin(uid) {
 				const res = await this.$myRequest({

+ 9 - 9
pages/equipMange/index/useroperation.vue

@@ -312,31 +312,31 @@
 				success:(res)=>{
 					console.log(JSON.parse(res.data))
 					let items = JSON.parse(res.data).filter((item)=>{
-						return item.purview_name == "系统管理"
+						return item.pur_id == 28
 					})
 					let items2 = items[0].children.filter((item)=>{
-						return item.purview_name == "用户管理"
+						return item.pur_id == 29
 					})
 					let shebeiitems = JSON.parse(res.data).filter((item)=>{
-						return item.purview_name == "设备管理"
+						return item.pur_id == 22
 					})
 					this.quanxian.shebeiitems = shebeiitems[0].children.some((item)=>{
-						return item.purview_name == "分配设备"
+						return item.pur_id == 24
 					})
 					var arr = items2[0].children
 					console.log(items)
 					for(var i =0;i<arr.length;i++){
-						switch (arr[i].purview_name){
-							case "充值":
+						switch (arr[i].pur_id){
+							case 112:
 								this.quanxian.chongzhi = true
 								break
-							case "编辑":
+							case 113:
 								this.quanxian.alters = true
 								break
-							case "禁用":
+							case 114:
 								this.quanxian.off = true
 								break
-							case "密码":
+							case 115:
 								this.quanxian.pass = true
 								break
 						}

+ 50 - 33
pages/index/index.vue

@@ -15,19 +15,19 @@
 		</view>
 		<view class="weatherinfo">
 			<view class="weatherinfo_item">
-				<image src="../../static/images/newindex/weizhi.png" mode="" class="weaimg"></image>
+				<image src="http://www.hnyfwlw.com:8006/bigdata_app/newindex/weizhi.png" mode="" class="weaimg"></image>
 				<view class="textbox">
 					{{weatherinfo.district}}
 				</view>
 			</view>
 			<view class="weatherinfo_item">
-				<image src="../../static/images/newindex/wendu.png" mode="" class="weaimg"></image>
+				<image src="http://www.hnyfwlw.com:8006/bigdata_app/newindex/wendu.png" mode="" class="weaimg"></image>
 				<view class="textbox">
 					{{weatherinfo.at}}℃
 				</view>
 			</view>
 			<view class="weatherinfo_item">
-				<image src="../../static/images/newindex/shidu.png" mode="" class="weaimg"></image>
+				<image src="http://www.hnyfwlw.com:8006/bigdata_app/newindex/shidu.png" mode="" class="weaimg"></image>
 				<view class="textbox">
 					{{weatherinfo.ah}}%RH
 				</view>
@@ -47,25 +47,29 @@
 			</view>
 			<view class="functionbox_text">
 				<view class="functionbox_text_item" v-if="jurisdiction.sqtf" @click="tabfunction(0)">
-					<image src="../../static/images/newindex/base.png" mode="" class="itemimg"></image>
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/newindex/base.png" mode="" class="itemimg">
+					</image>
 					<view class="">
 						四情基地
 					</view>
 				</view>
 				<view class="functionbox_text_item" @click="tabfunction(1)">
-					<image src="../../static/images/newindex/worm.png" mode="" class="itemimg"></image>
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/newindex/worm.png" mode="" class="itemimg">
+					</image>
 					<view class="">
 						病虫识别
 					</view>
 				</view>
 				<view class="functionbox_text_item" v-if="jurisdiction.zjtf" @click="tabfunction(2)">
-					<image src="../../static/images/newindex/knowledge.png" mode="" class="itemimg"></image>
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/newindex/knowledge.png" mode="" class="itemimg">
+					</image>
 					<view class="">
 						知识百科
 					</view>
 				</view>
 				<view class="functionbox_text_item" @click="tabfunction(3)">
-					<image src="../../static/images/newindex/aftersale.png" mode="" class="itemimg"></image>
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/newindex/aftersale.png" mode="" class="itemimg">
+					</image>
 					<view class="">
 						售后服务
 					</view>
@@ -78,44 +82,58 @@
 			</view>
 			<view class="facilitybox_itembox">
 				<view class="facilitybox_item" v-if="jurisdiction.cbtf" @click="tabequipment('../cb/index/index')">
-					<image src="../../static/images/newindex/cb.png" mode="" class="itemimg"></image>
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/newindex/cb.png" mode="" class="itemimg">
+					</image>
 					<view class="">
 						测报系统
 					</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="../../static/images/newindex/fz.png" mode="" class="itemimg"></image>
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/newindex/fz.png" mode="" class="itemimg">
+					</image>
 					<view class="">
 						防治系统
 					</view>
 				</view>
 				<view class="facilitybox_item" v-if="jurisdiction.jktf" @click="tabequipment('../monitor/index')">
-					<image src="../../static/images/newindex/jk.png" mode="" class="itemimg"></image>
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/newindex/jk.png" mode="" class="itemimg">
+					</image>
 					<view class="">
 						监控系统
 					</view>
 				</view>
 				<view class="facilitybox_item" v-if="jurisdiction.hjtf" @click="tabequipment('../environment/index')">
-					<image src="../../static/images/newindex/hj.png" mode="" class="itemimg"></image>
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/newindex/hj.png" mode="" class="itemimg">
+					</image>
 					<view class="">
 						环境监测
 					</view>
 				</view>
-				<!-- <view class="facilitybox_item" v-if="jurisdiction.sftf" @click="tabequipment('../waterandfer/index')">
-					<image src="../../static/images/newindex/shuifeiyitihua.png" mode="" class="itemimg"></image>
+				<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>
 				<view class="facilitybox_item" v-if="jurisdiction.ggtf" @click="tabequipment('../irrigate/index')">
-					<image src="../../static/images/newindex/guangai.png" mode="" class="itemimg"></image>
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/newindex/guangai.png" mode="" class="itemimg">
+					</image>
 					<view class="">
 						智能灌溉
 					</view>
 				</view>
 				<view class="facilitybox_item" v-if="jurisdiction.sbtf"
 					@click="tabequipment('../equipMange/index/index')">
-					<image src="../../static/images/newindex/user.png" mode="" class="itemimg"></image>
+					<image src="http://www.hnyfwlw.com:8006/bigdata_app/newindex/user.png" mode="" class="itemimg">
+					</image>
 					<view class="">
 						用户管理
 					</view>
@@ -289,7 +307,9 @@
 		},
 		data() {
 			return {
-				weatherinfo: {},
+				weatherinfo: {
+					wea: "晴"
+				},
 				hello: "",
 				jurisdiction: {
 					cbtf: false,
@@ -305,7 +325,7 @@
 				},
 				show: false,
 				url: "",
-				loadTF: false
+				loadTF: false,
 			}
 		},
 		watch: {
@@ -361,7 +381,7 @@
 					sftf: false,
 					ggtf: false
 				}
-				console.log(res.children)
+				// console.log(res.children)
 				for (var i = 0; i < res.children.length; i++) {
 					switch (res.children[i].pur_id) {
 						case 36:
@@ -388,9 +408,6 @@
 						case 124:
 							this.jurisdiction.zjtf = true //"专家诊断"
 							break;
-							// case "灌溉控制系统":
-							// 	this.jurisdiction.sftf = true
-							// 	break;
 						case 202:
 							this.jurisdiction.ggtf = true //"灌溉控制系统"
 							break;
@@ -538,7 +555,7 @@
 			},
 		},
 		onLoad() {
-			console.log(this.$isneutral)
+			// console.log(this.$QueryPermission(242))
 			var time = new Date()
 			var hours = time.getHours()
 			if (hours < 12) {
@@ -552,10 +569,10 @@
 					this.getcity(res.longitude, res.latitude)
 				}
 			})
-			this.getUserlogin()
 		},
 		onShow() {
 			this.loadTF = false
+			this.getUserlogin()
 		}
 	}
 </script>
@@ -770,35 +787,35 @@
 				}
 
 				.list_box1 {
-					background-image: url(../../static/images/newindex/cao.png);
+					background-image: url(http://www.hnyfwlw.com:8006/bigdata_app/newindex/cao.png);
 				}
 
 				.list_box2 {
-					background-image: url(../../static/images/newindex/yee.jpg);
+					background-image: url(http://www.hnyfwlw.com:8006/bigdata_app/newindex/yee.jpg);
 				}
 
 				.list_box3 {
-					background-image: url(../../static/images/newindex/lingc.jpg);
+					background-image: url(http://www.hnyfwlw.com:8006/bigdata_app/newindex/lingc.jpg);
 				}
 
 				.list_box4 {
-					background-image: url(../../static/images/newindex/ming.png);
+					background-image: url(http://www.hnyfwlw.com:8006/bigdata_app/newindex/ming.png);
 				}
 
 				.list_box5 {
-					background-image: url(../../static/images/newindex/mai.png);
+					background-image: url(http://www.hnyfwlw.com:8006/bigdata_app/newindex/mai.png);
 				}
 
 				.list_box6 {
-					background-image: url(../../static/images/newindex/dadou.jpg)
+					background-image: url(http://www.hnyfwlw.com:8006/bigdata_app/newindex/dadou.jpg)
 				}
 
 				.list_box7 {
-					background-image: url(../../static/images/newindex/yumi.png);
+					background-image: url(http://www.hnyfwlw.com:8006/bigdata_app/newindex/yumi.png);
 				}
 
 				.list_box8 {
-					background-image: url(../../static/images/newindex/dao.png);
+					background-image: url(http://www.hnyfwlw.com:8006/bigdata_app/newindex/dao.png);
 				}
 			}
 		}

+ 20 - 6
pages/irrigate/index.vue

@@ -35,7 +35,7 @@
 								<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"
+								<u-switch v-model="item.status2" v-if="$QueryPermission(256)" size="35" active-color="#00B075"
 									style="margin-top: 10rpx;" inactive-color="#f00"
 									@change="switchchange2($event,item.d_id,index)">
 								</u-switch>
@@ -44,7 +44,7 @@
 						<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,7 +69,7 @@
 									: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" v-if="$QueryPermission(254)" size="35" active-color="#00B075"
 									inactive-color="#f00" style="margin-top: 10rpx;"
 									@change="switchchange($event,item.device_id,index)">
 								</u-switch>
@@ -437,7 +437,7 @@
 			},
 		},
 		onLoad() {
-			this.tubulareqlist()
+			// this.tubulareqlist()
 			uni.getStorage({
 				key: "jurisdiction",
 				success: (res) => {
@@ -448,10 +448,10 @@
 					console.log(itemarr)
 					for (var i = 0; i < itemarr.length; i++) {
 						switch (itemarr[i].pur_id) {
-							case 203:
+							case 204:
 								this.equipArr[0].tf = true
 								break
-							case 204:
+							case 203:
 								this.equipArr[1].tf = true
 								break
 							case 195:
@@ -459,6 +459,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
+						}
+					}
 				}
 			})
 		},

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

@@ -11,8 +11,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>
@@ -98,7 +99,7 @@
 					}
 				})
 				console.log(res)
-				if(!res){
+				if(res){
 					this.compileTF = false
 					uni.removeStorage({
 						key: "location",

+ 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>
@@ -238,39 +238,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>

+ 0 - 3
pages/prevention/index.vue

@@ -16,9 +16,6 @@
 			<view class="loading" v-if="loadingtf">
 				<image src="../../static/images/ajax-loader.gif" mode="" class="img"></image>
 			</view>
-			<view class="wormdelbox">
-				一键清虫
-			</view>
 			<view class="prevents">
 				<view class="prevents_item" v-for="item,index in eqlistdata" :key="index" @click="eqdetails(item)">
 					<image

+ 29 - 10
pages/prevention/ucharts.vue

@@ -52,7 +52,7 @@
 			</view>
 			<view class="condition" :style="{'top': allqingchong?'1450rpx':'870rpx'}">
 				<scroll-view scroll-top="0" scroll-x="true" class="scroll-X">
-					<table class="table" v-if="allqingchong">
+					<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,27 @@
 							<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>
@@ -82,15 +100,16 @@
 							<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>
-							<td class="td">{{items.d_h_t.cv}}</td>
-							<td class="td">{{items.d_h_t.bv}}</td>
 						</tr>
 						<tr class="tr" v-if="!forbidden">
-							<td class="td" v-for="item in 12">暂无数据</td>
+							<td class="td" v-for="item in 10">暂无数据</td>
 						</tr>
 					</table>
 				</scroll-view>
@@ -121,11 +140,10 @@
 		data() {
 			return {
 				thdata: ["上报时间", "设备开关", "工作状态", "雨控状态", "温控状态", "倾倒状态", "定时(h)", "电击次数", "温度(℃)", "湿度(%)", "充电电压(v)",
-					"电池电压(v)",
-				],
-				thdata2: ["上报时间", "设备开关", "工作状态", "温控状态", "定时(h)", "温度(℃)", "湿度(%)", "充电电压(v)",
-					"电池电压(v)",
+					"电池电压(v)", "信号强度"
 				],
+				thdata2: ["上报时间", "设备开关", "工作状态", "雨控状态", "温控状态", "倾倒状态", "定时(h)", "电击次数", "温度(℃)", "湿度(%)"],
+				thdata3: ["上报时间", "设备开关", "工作状态", "温控状态", "定时(h)", "温度(℃)", "湿度(%)"],
 				eqlistdata: [],
 				cWidth: '400',
 				cHeight: '400',
@@ -146,7 +164,7 @@
 				dataloadingtf: true, //加载中提示
 				pagesum: 1,
 				tiemshow: false, //日历选择器
-				allqingchong:false
+				allqingchong: false
 			}
 		},
 		// 页面加载执行的函数
@@ -549,6 +567,7 @@
 	.shuju_two {
 		top: 790rpx;
 	}
+
 	.selecttimes {
 		position: absolute;
 		top: 54px;

+ 813 - 0
pages/qxzyj/cbwarn.vue

@@ -0,0 +1,813 @@
+<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">
+			<u-swipe-action :show="item.show" :index="index" v-for="(item, index) in configlist" :key="item.id"
+				@click="delconfig(item.id)" :options="options" style="margin-bottom: 30rpx;">
+				<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 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>

+ 496 - 0
pages/qxzyj/warnset.vue

@@ -0,0 +1,496 @@
+<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__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>
@@ -172,31 +172,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>

+ 2 - 2
static/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>
@@ -190,7 +190,7 @@
 		}).then((res) => {
 			console.log(res.data)
 			var data = eval("(" + res.data + ")");
-			var hlsHdSrc = data.hls;
+			var hlsHdSrc = data.hlsHd;
 			console.log(hlsHdSrc)
 			var rtmpHdSrc = data.rtmpHd;
 			var playHtml =

BIN=BIN
static/images/newindex/aftersale.png


BIN=BIN
static/images/newindex/base.png


BIN=BIN
static/images/newindex/cao.png


BIN=BIN
static/images/newindex/cb.png


BIN=BIN
static/images/newindex/dadou.jpg


BIN=BIN
static/images/newindex/dao.png


BIN=BIN
static/images/newindex/fz.png


BIN=BIN
static/images/newindex/guangai.png


BIN=BIN
static/images/newindex/hj.png


BIN=BIN
static/images/newindex/jk.png


BIN=BIN
static/images/newindex/knowledge.png


BIN=BIN
static/images/newindex/lingc.jpg


BIN=BIN
static/images/newindex/ma.png


BIN=BIN
static/images/newindex/mai.png


BIN=BIN
static/images/newindex/ming.png


BIN=BIN
static/images/newindex/qing.png


BIN=BIN
static/images/newindex/shidu.png


BIN=BIN
static/images/newindex/shuifeiyitihua.png


BIN=BIN
static/images/newindex/user.png


BIN=BIN
static/images/newindex/weizhi.png


BIN=BIN
static/images/newindex/wendu.png


BIN=BIN
static/images/newindex/worm.png


BIN=BIN
static/images/newindex/yee.jpg


BIN=BIN
static/images/newindex/yumi.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卡状态"
     }
+    
 }

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 2 - 2
unpackage/dist/build/app-plus/app-config-service.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 2 - 2
unpackage/dist/build/app-plus/app-service.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
unpackage/dist/build/app-plus/app-view.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 1
unpackage/dist/build/app-plus/manifest.json


+ 2 - 2
unpackage/dist/build/app-plus/static/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>
@@ -190,7 +190,7 @@
 		}).then((res) => {
 			console.log(res.data)
 			var data = eval("(" + res.data + ")");
-			var hlsHdSrc = data.hls;
+			var hlsHdSrc = data.hlsHd;
 			console.log(hlsHdSrc)
 			var rtmpHdSrc = data.rtmpHd;
 			var playHtml =

BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/aftersale.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/base.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/cao.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/cb.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/dadou.jpg


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/dao.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/fz.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/guangai.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/hj.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/jk.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/knowledge.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/lingc.jpg


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/ma.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/mai.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/ming.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/qing.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/shidu.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/shuifeiyitihua.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/user.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/weizhi.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/wendu.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/worm.png


BIN=BIN
unpackage/dist/build/app-plus/static/images/newindex/yee.jpg


+ 0 - 0
unpackage/dist/build/app-plus/static/images/newindex/yumi.png


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio