Jelajahi Sumber

第一次提交

zkl 3 tahun lalu
induk
melakukan
ba2f437bff
34 mengubah file dengan 4127 tambahan dan 1942 penghapusan
  1. 9 4
      bigdata2/config/index.js
  2. 17 36
      bigdata2/package-lock.json
  3. 1 0
      bigdata2/package.json
  4. 1 0
      bigdata2/src/assets/css/global.css
  5. TEMPAT SAMPAH
      bigdata2/src/assets/images/cure/scd/1.png
  6. TEMPAT SAMPAH
      bigdata2/src/assets/images/cure/scd/2.png
  7. TEMPAT SAMPAH
      bigdata2/src/assets/images/cure/scd/3.png
  8. TEMPAT SAMPAH
      bigdata2/src/assets/images/dingwei.png
  9. TEMPAT SAMPAH
      bigdata2/src/assets/images/tianjia.png
  10. TEMPAT SAMPAH
      bigdata2/src/assets/images/zhankai.png
  11. 653 67
      bigdata2/src/components/Index.vue
  12. 13 1
      bigdata2/src/components/SearchBar/index.vue
  13. 690 575
      bigdata2/src/components/UserManger.vue
  14. 4 0
      bigdata2/src/main.js
  15. 237 585
      bigdata2/src/pages/cure/scd/scd.vue
  16. 12 1
      bigdata2/src/pages/cure/scd/scdDetail.vue
  17. 947 0
      bigdata2/src/pages/cure/scd/scdList.vue
  18. 364 0
      bigdata2/src/pages/cure/scd/scdListAllot.vue
  19. 55 15
      bigdata2/src/pages/equipmanger/EquipList.vue
  20. 41 8
      bigdata2/src/pages/forecasting/bzy/Bzy.vue
  21. 12 1
      bigdata2/src/pages/forecasting/bzy/BzyPhotos.vue
  22. 11 1
      bigdata2/src/pages/forecasting/bzy/DataDetail.vue
  23. 386 167
      bigdata2/src/pages/forecasting/cbd/Cbd.vue
  24. 11 1
      bigdata2/src/pages/forecasting/cbd/DataDetails.vue
  25. 428 371
      bigdata2/src/pages/forecasting/cbd/HistoryData.vue
  26. 11 1
      bigdata2/src/pages/forecasting/cbd/MessageWarn.vue
  27. 11 1
      bigdata2/src/pages/forecasting/cbd/PestsStats.vue
  28. 11 1
      bigdata2/src/pages/forecasting/cbd/cbdDataPhotos.vue
  29. 168 104
      bigdata2/src/pages/forecasting/xycb/xycb.vue
  30. 11 1
      bigdata2/src/pages/forecasting/xycb/xycbDataDetail.vue
  31. 11 1
      bigdata2/src/pages/forecasting/xycb/xycbDataPhotos.vue
  32. 11 0
      bigdata2/src/router/index.js
  33. TEMPAT SAMPAH
      bigdata2/static/images/cure/zanwu.png
  34. 1 0
      项目说明.txt

+ 9 - 4
bigdata2/config/index.js

@@ -12,7 +12,9 @@ module.exports = {
     proxyTable: {
       '/': {
         // target: 'http://192.168.1.3:8000/',
-        target: 'http://192.168.1.77:8005/',
+        // target: 'http://192.168.1.77:8005/',
+        // target: 'http://192.168.1.106:8000/',
+        target: 'http://192.168.1.123:8005/',
         // target: 'http://192.168.1.120:8001/',
         changeOrigin: true,
         pathRewrite: {
@@ -21,7 +23,10 @@ module.exports = {
       },
       '/api': {
         // target: 'http://192.168.1.4:8000/',
-        target: 'http://192.168.1.120:8001/',
+        // target: 'http://192.168.1.120:8001/',
+        // target: 'http://192.168.1.106:8000/',
+        target: 'http://192.168.1.123:8007/',
+        // target: 'http://192.168.1.177:8000/',
         changeOrigin: true,
         pathRewrite: {
           '^/api': '/api'   //重写接口
@@ -29,8 +34,8 @@ module.exports = {
       },
     },
     // Various Dev Server settings
-    host: '192.168.1.101', // can be overwritten by process.env.HOST
-    port: 8001, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
+    host: '192.168.1.123', // can be overwritten by process.env.HOST
+    port: 8000, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: false,
     errorOverlay: true,
     notifyOnErrors: true,

+ 17 - 36
bigdata2/package-lock.json

@@ -3869,21 +3869,6 @@
       "resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz",
       "integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w=="
     },
-    "dom7": {
-      "version": "2.1.5",
-      "resolved": "https://registry.npmjs.org/dom7/-/dom7-2.1.5.tgz",
-      "integrity": "sha512-xnhwVgyOh3eD++/XGtH+5qBwYTgCm0aW91GFgPJ3XG+jlsRLyJivnbP0QmUBFhI+Oaz9FV0s7cxgXHezwOEBYA==",
-      "requires": {
-        "ssr-window": "^2.0.0"
-      },
-      "dependencies": {
-        "ssr-window": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-2.0.0.tgz",
-          "integrity": "sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A=="
-        }
-      }
-    },
     "domain-browser": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz",
@@ -7399,15 +7384,6 @@
         "minimist": "^1.2.5"
       }
     },
-    "mockjs": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/mockjs/-/mockjs-1.1.0.tgz",
-      "integrity": "sha512-eQsKcWzIaZzEZ07NuEyO4Nw65g0hdWAyurVol1IPl1gahRwY+svqzfgfey8U8dahLwG44d6/RwEzuK52rSa/JQ==",
-      "dev": true,
-      "requires": {
-        "commander": "*"
-      }
-    },
     "move-concurrently": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
@@ -10574,11 +10550,6 @@
       "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
       "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
     },
-    "ssr-window": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-1.0.1.tgz",
-      "integrity": "sha512-dgFqB+f00LJTEgb6UXhx0h+SrG50LJvti2yMKMqAgzfUmUXZrLSv2fjULF7AWGwK25EXu8+smLR3jYsJQChPsg=="
-    },
     "ssri": {
       "version": "5.3.0",
       "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz",
@@ -10899,13 +10870,9 @@
       }
     },
     "swiper": {
-      "version": "4.5.1",
-      "resolved": "https://registry.npmjs.org/swiper/-/swiper-4.5.1.tgz",
-      "integrity": "sha512-se6I7PWWu950NAMXXT+ENtF/6SVb8mPyO+bTfNxbQBILSeLqsYp3Ndap+YOA0EczOIUlea274PKejT6gKZDseA==",
-      "requires": {
-        "dom7": "^2.1.3",
-        "ssr-window": "^1.0.1"
-      }
+      "version": "3.4.2",
+      "resolved": "https://registry.npmjs.org/swiper/-/swiper-3.4.2.tgz",
+      "integrity": "sha1-Oda0ELGjmDPh9y07cpmd9fXjg5I="
     },
     "tapable": {
       "version": "0.2.9",
@@ -11841,6 +11808,12 @@
       "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz",
       "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog=="
     },
+    "vue-lazyload": {
+      "version": "1.3.3",
+      "resolved": "https://registry.npmjs.org/vue-lazyload/-/vue-lazyload-1.3.3.tgz",
+      "integrity": "sha512-uHnq0FTEeNmqnbBC2aRKlmtd9LofMZ6Q3mWvgfLa+i9vhxU8fDK+nGs9c1iVT85axSua/AUnMttIq3xPaU9G3A==",
+      "dev": true
+    },
     "vue-loader": {
       "version": "13.7.3",
       "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-13.7.3.tgz",
@@ -11947,6 +11920,14 @@
       "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.3.4.tgz",
       "integrity": "sha512-SdKRBeoXUjaZ9R/8AyxsdTqkOfMcI5tWxPZOUX5Ie1BTL5rPSZ0O++pbiZCeYeythiZIdLEfkDiQPKIaWk5hDg=="
     },
+    "vue-simple-tree": {
+      "version": "2.3.2",
+      "resolved": "https://registry.npmjs.org/vue-simple-tree/-/vue-simple-tree-2.3.2.tgz",
+      "integrity": "sha512-oyWcwiOG2wuj56tc9mLr7y8gKn1rnCplkV4J9evnCMsqsJrQLictFwEU16wQVgYndafYKuQUhA/0f9NK2LSmtw==",
+      "requires": {
+        "vue": "^2.5.13"
+      }
+    },
     "vue-style-loader": {
       "version": "3.1.2",
       "resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-3.1.2.tgz",

+ 1 - 0
bigdata2/package.json

@@ -27,6 +27,7 @@
     "vue-highcharts": "^0.1.0",
     "vue-photo-preview": "^1.1.3",
     "vue-router": "^3.0.1",
+    "vue-simple-tree": "^2.3.2",
     "vuex": "^3.5.1"
   },
   "devDependencies": {

+ 1 - 0
bigdata2/src/assets/css/global.css

@@ -24,6 +24,7 @@ p{margin:0}
     left: 220px;
     right: 0;
     top: 189px;
+    /* top: 242px; */
 }
 .el-dialog__header{
     background:#F2F2F2;

TEMPAT SAMPAH
bigdata2/src/assets/images/cure/scd/1.png


TEMPAT SAMPAH
bigdata2/src/assets/images/cure/scd/2.png


TEMPAT SAMPAH
bigdata2/src/assets/images/cure/scd/3.png


TEMPAT SAMPAH
bigdata2/src/assets/images/dingwei.png


TEMPAT SAMPAH
bigdata2/src/assets/images/tianjia.png


TEMPAT SAMPAH
bigdata2/src/assets/images/zhankai.png


+ 653 - 67
bigdata2/src/components/Index.vue

@@ -1,31 +1,126 @@
 <template>
 	<el-container style="height: 100%">
-		<el-header>
+		<el-header class="header" v-show="flag">
 			<div v-if="userinfo.logo">
-				<img :src="userinfo.logo" alt=""  style="position: absolute;left: 20px;top: 20px;width: 250px;">
+				<img
+					:src="userinfo.logo"
+					alt=""
+					style="position: absolute; left: 20px; top: 20px; width: 250px"
+				/>
 			</div>
 			<div class="navbarBtn">
 				<!-- 用户 -->
-				<div class="userinfo">
-					欢迎您,{{ username }}
+				<div class="userinfo">欢迎您,{{ username }}</div>
+
+				<!-- 站点 -->
+				<div class="site" v-if="userinfo.site">
+					<i class="iconfont icon-jidi"></i>
+					<span>{{ userinfo.site }}</span>
 				</div>
+
 				<!-- 标题 -->
 				<div class="caption">
-					<div v-if="userinfo.user_header" class="tit">{{userinfo.user_header}}</div>
-					<div v-else class="tit">农业植保监测系统 智慧农业信息化</div>
-					<div>
-						Agricultural Plant Protection Monitoring System
+					<div v-if="userinfo.user_header" class="tit">
+						{{ userinfo.user_header }}
 					</div>
+					<div v-else class="tit">农业植保监测系统 智慧农业信息化</div>
+					<div>Agricultural Plant Protection Monitoring System</div>
 				</div>
 			</div>
+
+			<span class="header_btn" @click="hCheckFun">[隐藏]</span>
 		</el-header>
-		<div class="site" v-if="userinfo.site">
-			<i class="iconfont icon-jidi"></i>
-			<span>{{userinfo.site}}</span>
-		</div>
+
+		<el-header class="header2" v-show="!flag">
+			<h3 v-if="userinfo.user_header">{{ userinfo.user_header }}</h3>
+			<h3 v-else>农业植保监测系统</h3>
+			<div class="site" v-if="userinfo.site && flag">
+				<i class="iconfont icon-jidi"></i>
+				<span>{{ userinfo.site }}</span>
+			</div>
+			<span class="header_btn" @click="hCheckFun">[展开]</span>
+
+			<!-- <ul class="header_ul" style="margin: -55px 85px 0 0">
+				<li
+					style="padding: 15px 20px 15px 20px; color: #fff; cursor: pointer"
+					@click="headerTitle(index)"
+					:class="{ indexActive: tltIndex == index }"
+					v-for="(item, index) in menuList1"
+					:key="index"
+				>
+					{{ item.purview_name }}
+				</li>
+			</ul> -->
+		</el-header>
+
+		<!-- <div style="background: #166756">
+			<ul class="header_ul">
+				<li
+					style="padding: 15px 20px 15px 20px; color: #fff; cursor: pointer"
+					@click="headerTitle(index)"
+					:class="{ indexActive: tltIndex == index }"
+					v-for="(item, index) in menuList1"
+					:key="index"
+				>
+					{{ item.purview_name }}
+				</li>
+			</ul>
+		</div> -->
+
 		<el-container style="overflow: auto">
 			<!-- 菜单 -->
 			<el-aside width="200px">
+				<!-- 站点名称标题 -->
+				<!-- <div style="display: flex; justify-content: space-between">
+					<div style="display: flex; margin: 0 0 0 5px">
+						<img
+							style="width: 15px; height: 15px; margin: 3px 3px 0 0"
+							src="../assets/images/zhankai.png"
+							alt=""
+						/>
+						<div style="font-weight: 550">站点管理</div>
+					</div>
+					<img
+						style="
+							width: 16px;
+							height: 16px;
+							margin: 3px 0 0 0;
+							cursor: pointer;
+						"
+						src="../assets/images/tianjia.png"
+						alt=""
+						@click="addStation()"
+						v-if="userinfo.staff == 1"
+					/>
+				</div> -->
+
+				<!-- 选中站点标题 -->
+				<div
+					style="
+						background: #0d2c2e;
+						line-height: 46px;
+						height: 46px;
+						color: #fff;
+					"
+				>
+					<img
+						style="
+							width: 12px;
+							height: 16px;
+							margin: -3.5px 0 0 13.5%;
+							vertical-align: middle;
+							cursor: pointer;
+						"
+						title="点击获取全部站点名称列表"
+						src="../assets/images/dingwei.png"
+						alt=""
+						@click="allSiteListData()"
+					/>
+					<span style="font-size: 13px; margin: 0 0 0 11.5px">{{
+						siteNameTitle
+					}}</span>
+				</div>
+
 				<el-menu
 					:default-active="currRouter"
 					:collapse-transition="false"
@@ -34,9 +129,10 @@
 					:router="isRouter"
 					text-color="#333"
 					active-text-color="#fff"
+					@select="handleOpen"
 				>
 					<el-menu-item
-						:index="'/index/'+item.menu"
+						:index="'/index/' + item.menu"
 						v-for="item in menuList1"
 						:key="item.pur_id"
 					>
@@ -44,17 +140,94 @@
 						<span slot="title">{{ item.purview_name }}</span>
 					</el-menu-item>
 				</el-menu>
+
+				<div style="margin: 13px 0 0 0; width: 95%">
+					<ul>
+						<li style="display: flex; justify-content: space-between">
+							<div style="display: flex; margin: 0 0 0 5px">
+								<img
+									style="width: 13px; height: 13px; margin: 3px 3px 0 0"
+									src="../assets/images/zhankai.png"
+									alt=""
+								/>
+								<div
+									style="font-weight: 550; margin: 0 0 0 4px; font-size: 14px"
+								>
+									站点管理
+								</div>
+							</div>
+							<img
+								style="
+									width: 16px;
+									height: 16px;
+									margin: 3px 0 0 0;
+									cursor: pointer;
+								"
+								src="../assets/images/tianjia.png"
+								alt=""
+								@click="addStation()"
+								v-if="userinfo.staff == 1"
+							/>
+						</li>
+
+						<li id="tree">
+							<el-tree
+								:data="data"
+								:props="defaultProps"
+								@node-click="handleNodeClick"
+								@node-contextmenu="rightClick"
+							></el-tree>
+						</li>
+					</ul>
+				</div>
 			</el-aside>
+
+			<!-- 右键信息 -->
+			<div v-show="menuVisible">
+				<ul id="menuList" class="menu">
+					<li class="menu_item" @click="addrInformation()">增加</li>
+				</ul>
+			</div>
 			<el-container>
 				<el-main>
-					<router-view></router-view>
+					<!-- <router-view ref="mychild" :flag="flag" :siteID="siteID"></router-view> -->
+					<router-view ref="mychild" :flag="dataObj"></router-view>
 				</el-main>
 			</el-container>
 		</el-container>
+
+		<!-- 添加站点 -->
+		<el-dialog
+			:close-on-click-modal="false"
+			:close-on-press-escape="false"
+			title="新增站点"
+			:visible.sync="addSite"
+			width="25%"
+		>
+			<ul>
+				<li style="margin: 10px 0 0 0">
+					<span>站点名称:</span>
+					<el-input style="width: 49%" v-model="siteName"></el-input>
+				</li>
+				<li style="margin: 10px 0 0 0">
+					<span>站点地址:</span>
+					<el-cascader
+						clearable
+						v-model="siteAddr"
+						:options="options"
+					></el-cascader>
+				</li>
+			</ul>
+			<span slot="footer" class="dialog-footer">
+				<el-button @click="addSite = false">取 消</el-button>
+				<el-button type="primary" @click="addrData()">确 定</el-button>
+			</span>
+		</el-dialog>
 	</el-container>
 </template>
 
 <script>
+import city from '../components/citydata.js'
 export default {
 	data() {
 		var validateNewPass = (rule, value, callback) => {
@@ -89,46 +262,49 @@ export default {
 				5: 'iconfont icon-shebei',
 				6: 'iconfont icon-xitong'
 			},
-			userinfo:'',
-			currRouter:'/index/bzy',
-			menuList1: [{
-			"purview_name": "智能性诱测报",
-			"menu": "xycb",
-			"parent_perm_id": 1,
-			"pur_id": 1
-			},
-			{
-			"purview_name": "植物孢子捕捉仪",
-			"menu": "bzy",
-			"parent_perm_id": 2,
-			"pur_id": 2
-			},
-			{
-			"purview_name": "物联网虫情测报",
-			"menu": "cbd",
-			"parent_perm_id": 3,
-			"pur_id": 3
-			},
-			{
-			"purview_name": "物联网杀虫灯",
-			"menu": "scd",
-			"parent_perm_id": 4,
-			"pur_id": 4
-			},
-			{
-			"purview_name": "设备管理",
-			"menu": "equipList",
-			"parent_perm_id": 5,
-			"pur_id": 5
-			},{
-			"purview_name": "用户列表",
-			"menu": "userManger",
-			"parent_perm_id": 6,
-			"pur_id": 6
-			},], //首页菜单
+			userinfo: '',
+			currRouter: '/index/bzy',
+			menuList1: [
+				{
+					purview_name: '智能性诱测报',
+					menu: 'xycb',
+					parent_perm_id: 1,
+					pur_id: 1
+				},
+				{
+					purview_name: '植物孢子捕捉仪',
+					menu: 'bzy',
+					parent_perm_id: 2,
+					pur_id: 2
+				},
+				{
+					purview_name: '物联网虫情测报',
+					menu: 'cbd',
+					parent_perm_id: 3,
+					pur_id: 3
+				},
+				{
+					purview_name: '物联网杀虫灯',
+					menu: 'scd',
+					parent_perm_id: 4,
+					pur_id: 4
+				},
+				{
+					purview_name: '设备管理',
+					menu: 'equipList',
+					parent_perm_id: 5,
+					pur_id: 5
+				},
+				{
+					purview_name: '用户列表',
+					menu: 'userManger',
+					parent_perm_id: 6,
+					pur_id: 6
+				}
+			], //首页菜单
 			// activePath:'',
 			username: '',
-			userphoto:'',
+			userphoto: '',
 			userHeadImg: '',
 			resetPassDialogVisible: false,
 			resetPassForm: {
@@ -143,20 +319,109 @@ export default {
 				newPass: [{ validator: validateNewPass, trigger: 'blur' }],
 				checkNewPass: [{ validator: validateCheckPass, trigger: 'blur' }]
 			},
+
+			// 循环
+			tltIndex: 0,
+			data: [],
+			defaultProps: {
+				children: 'children',
+				label: 'label'
+			},
+			siteName: '', // 站点名称
+			siteAddr: [], // 站点地址
+			options: [],
+			addSite: false,
+			menuVisible: false,
+			operateObj: {}, // 右键点击时获取当前的数据信息
+			urladdr: this.$route.path, // 当前界面路由
+
+			// 站点名称选中
+			siteNameTitle: '全 部',
+			dataObj: {
+				flag: true,
+				siteID: null,
+				allList: []
+			},
+			flag: true,
+			req: '', // 站点列表是否显示有无设备的站点
+			equip_type: '', //选中的设备类型
+			siteID: null, // 需要传递给子组件的站点id
 		}
 	},
 	created: function () {
 		this.getuserinfo()
-		// this.$router.push('xycb')
-	},
-	computed: {
 	},
+	computed: {},
 	watch: {
+		addSite(val) {
+			if (val == false) {
+				this.siteName = ''
+				this.siteAddr = []
+				this.operateObj = {}
+			}
+			// else if (val == true) {
+			// 	if (this.operateObj.label) {
+			// 		console.log(this.operateObj)
+
+			// 	} else {
+			// 	}
+			// }
+		},
+
+		// 监听路由变化,如果变化就将展示选中的站点名称归零为全部
+		$route(to, from) {
+			this.siteNameTitle = '全 部'
+		},
+
+		equip_type(val) {
+			console.log(val + '设备类型')
+			this.siteListData()
+		}
 	},
 	mounted() {
+		if (sessionStorage.getItem('tltIndex')) {
+			this.tltIndex = sessionStorage.getItem('tltIndex')
+		}
 		this.currRouter = this.$route.path
+		this.siteListData()
+		this.options = city
+
+		var url = this.$route.path
+		url = url.split('/index', 2)
+		if (url[1] == '/xycb') {
+			sessionStorage.setItem('tltIndex', 0)
+			this.tltIndex = 0
+		}
+
+		// 获取当前点击的设备类型
+		if (url[1] == '/xycb') {
+			// 性诱测报
+			this.req = 'hide'
+			this.equip_type = '4'
+		} else if (url[1] == '/bzy') {
+			// 孢子仪
+			this.req = 'hide'
+			this.equip_type = '7'
+		} else if (url[1] == '/cbd') {
+			// 测报灯
+			this.req = 'hide'
+			this.equip_type = '3'
+		} else if (url[1] == '/scd') {
+			// 杀虫灯
+			this.req = 'hide'
+			this.equip_type = '2'
+		} else {
+			this.req = ''
+			this.equip_type = ''
+		}
 	},
 	methods: {
+		hCheckFun() {
+			this.flag = !this.flag
+			console.log(this.flag)
+			this.dataObj.flag = this.flag
+		},
+
 		getuserinfo() {
 			this.$axios({
 				method: 'post',
@@ -164,17 +429,236 @@ export default {
 			}).then((res) => {
 				this.username = res.data.username
 				this.userphoto = res.data.userphoto
-				localStorage.setItem('username', res.data.username)  // 0管理员  1用户
+				localStorage.setItem('username', res.data.username) // 0管理员  1用户
 			})
 			this.$axios({
 				method: 'get',
 				url: '/user_detail'
 			}).then((res) => {
 				this.userinfo = res.data
-				localStorage.setItem('have_type', this.userinfo.have_type)  // 0管理员  1用户   2项目
-				localStorage.setItem('staff', this.userinfo.staff)  // 1是admin
+				localStorage.setItem('have_type', this.userinfo.have_type) // 0管理员  1用户   2项目
+				localStorage.setItem('staff', this.userinfo.staff) // 1是admin
 			})
 		},
+
+		headerTitle(i) {
+			this.tltIndex = i
+			sessionStorage.setItem('tltIndex', i)
+			console.log(i)
+			this.$router.push('/index/' + this.menuList1[i].menu)
+		},
+
+		// 树形插件
+		handleNodeClick(data) {
+			if (this.$route.path !== '/index/scdList') {
+				this.dataObj.siteID = data.id
+				this.dataObj.allList = this.data
+				this.siteNameTitle = data.label
+				this.$refs.mychild.getEquipList(data, 1)
+			} else {
+				this.$router.push('/index/scd')
+
+				this.dataObj.siteID = data.id
+				this.dataObj.allList = this.data
+				this.siteNameTitle = data.label
+				var that = this
+				var time = setTimeout(function()  {
+					that.$refs.mychild.getEquipList(data, 1)
+					clearInterval(time)
+   				}, 500);
+			}
+		},
+
+		// 站点列表
+		siteListData() {
+			this.$axios({
+				method: 'GET',
+				url: '/site_manage',
+				params: {
+					req: this.req,
+					equip_type: this.equip_type
+				}
+			})
+				.then((res) => {
+					console.log(res.data)
+					if (res.data) {
+						var data = res.data
+						var arrList = []
+						var list = data.forEach((item) => {
+							if (
+								item.self_site_name !== undefined &&
+								item.self_site_name == ''
+							) {
+							} else {
+								if (item.self_site_name == undefined) {
+									if (item.child) {
+										var obj = {}
+										var a = []
+										obj['label'] = item.site_name
+										obj['id'] = item.site_id
+										for (var j in item.child) {
+											var obja = {}
+											obja['label'] = item.child[j].site_name
+											obja['id'] = item.child[j].site_id
+											if (
+												item.child[j].child &&
+												item.child[j].child.length == 0
+											) {
+												obja['children'] = item.child[j].child
+											} else if (
+												item.child[j].child &&
+												item.child[j].child.length !== 0
+											) {
+												for (var k in item.child[j].child) {
+													var objb = {}
+													objb['label'] = item.child[j].child[k].site_name
+													objb['id'] = item.child[j].child[k].site_id
+												}
+												obja['children'] = [objb]
+											}
+											a.push(obja)
+											obj['children'] = a
+										}
+									}
+									arrList.push(obj)
+								} else if (item.self_site_name !== undefined) {
+								}
+							}
+						})
+						this.data = arrList
+						console.log(arrList)
+					}
+				})
+				.catch((err) => {
+					console.log(err)
+				})
+		},
+
+		// 全部-添加新站点
+		addStation() {
+			this.addSite = true
+			this.operateObj = {}
+		},
+		addrData() {
+			if (this.siteName == '') {
+				this.$message({
+					message: '未填写站点名称,请填写!',
+					type: 'warning',
+					duration: 1500
+				})
+			} else if (this.siteAddr.length == 0) {
+				this.$message({
+					message: '未填写站点地址,请填写!',
+					type: 'warning',
+					duration: 1500
+				})
+			} else {
+				if (this.siteAddr.length < 3) {
+					var sheng = ''
+					var shi = this.siteAddr[0]
+					var xian = this.siteAddr[1]
+				} else {
+					var sheng = this.siteAddr[0]
+					var shi = this.siteAddr[1]
+					var xian = this.siteAddr[2]
+				}
+				var postData = this.qs.stringify({
+					site_name: this.siteName, // 站点名称
+					site_pro: sheng, // 省
+					site_city: shi, // 市
+					site_area: xian, // 县或区
+					site_parent_id:
+						this.operateObj.id !== undefined ? this.operateObj.id : '' // id
+				})
+				this.$axios({
+					method: 'POST',
+					url: '/site_manage',
+					data: postData
+				})
+					.then((res) => {
+						console.log(res.data)
+						if (res.data.status == 0) {
+							this.$message({
+								message: res.data.msg,
+								type: 'success',
+								duration: 1500
+							})
+							this.addSite = false
+							this.siteListData()
+						} else {
+							this.$message({
+								message: res.data.msg,
+								type: 'error',
+								duration: 1500
+							})
+						}
+					})
+					.catch((err) => {
+						console.log(err)
+						this.$message({
+							message: '添加失败请重试!',
+							type: 'error',
+							duration: 1500
+						})
+					})
+			}
+		},
+
+		// 树形插件右键点击事件
+		rightClick(MouseEvent, object, Node, element) {
+			console.log(object)
+			this.menuVisible = false // 先把模态框关死,目的是 第二次或者第n次右键鼠标的时候 它默认的是true
+			this.menuVisible = true // 显示模态窗口,跳出自定义菜单栏
+			var menu = document.querySelector('#menuList')
+			document.addEventListener('click', this.foo) // 给整个document添加监听鼠标事件,点击任何位置执行foo方法
+			menu.style.display = 'block'
+			menu.style.left = MouseEvent.clientX - 0 + 'px'
+			menu.style.top = MouseEvent.clientY - 0 + 'px'
+			this.operateObj = object
+		},
+		foo() {
+			// 取消鼠标监听事件 菜单栏
+			this.menuVisible = false
+			document.removeEventListener('click', this.foo) // 要及时关掉监听,不关掉的是一个坑,不信你试试,虽然前台显示的时候没有啥毛病,加一个alert你就知道了
+		},
+
+		// 指定新增
+		addrInformation() {
+			this.addSite = true
+		},
+
+		// 获取到当前点击菜单的数据
+		handleOpen(key, keyPath) {
+			var data = key
+			var typeIndex = data.split('/index/')
+			if (typeIndex[1] == 'xycb') {
+				// 性诱测报
+				this.req = 'hide'
+				this.equip_type = '4'
+			} else if (typeIndex[1] == 'bzy') {
+				// 孢子仪
+				this.req = 'hide'
+				this.equip_type = '7'
+			} else if (typeIndex[1] == 'cbd') {
+				// 测报灯
+				this.req = 'hide'
+				this.equip_type = '3'
+			} else if (typeIndex[1] == 'scd') {
+				// 杀虫灯
+				this.req = 'hide'
+				this.equip_type = '2'
+			} else {
+				this.req = ''
+				this.equip_type = ''
+			}
+		},
+
+		// 点击获取全部站点名称列表
+		allSiteListData() {
+			this.req = ''
+			this.equip_type = ''
+			this.siteListData()
+		},
 	}
 }
 </script>
@@ -211,10 +695,11 @@ export default {
 		transform: rotate(0);
 	}
 }
-.el-header {
+.header {
 	height: 189px !important;
 	background: url(../assets/images/headBj.png) no-repeat center;
 	background-size: 100% 100%;
+	position: relative;
 	.navbarBtn {
 		color: #fff;
 		.userinfo {
@@ -243,15 +728,50 @@ export default {
 		}
 	}
 }
-.site{
+
+// .el-header {
+// 	height: 189px !important;
+// 	background: url(../assets/images/headBj.png) no-repeat center;
+// 	background-size: 100% 100%;
+// 	position: relative;
+// 	.navbarBtn {
+// 		color: #fff;
+// 		.userinfo {
+// 			font-size: 12px;
+// 			text-align: right;
+// 			margin-top: 10px;
+// 			.userheadImg {
+// 				width: 35px;
+// 				height: 35px;
+// 				border-radius: 50%;
+// 				vertical-align: middle;
+// 				margin-right: 6px;
+// 			}
+// 		}
+// 		.caption {
+// 			margin-top: 7px;
+// 			text-align: center;
+// 			font-size: 16px;
+// 			letter-spacing: 0.5px;
+// 			.tit {
+// 				font-size: 26px;
+// 				line-height: 46px;
+// 				font-weight: 700;
+// 				letter-spacing: 7px;
+// 			}
+// 		}
+// 	}
+// }
+.site {
 	position: absolute;
-    right: 10px;
-    top: 199px;
-    z-index: 888;
+	right: 16px;
+	top: 30px;
+	z-index: 888;
 	font-size: 14px;
 	color: #226a4d;
-	span{
-		color: #333;
+	span {
+		// color: #333;
+		color: #fff;
 		letter-spacing: 1px;
 		font-size: 13px;
 	}
@@ -333,8 +853,13 @@ export default {
 	.el-menu {
 		border: none;
 	}
-	.iconfont {font-size:18px;margin-right:10px;}
-	.icon-chouchongbug{font-size:22px;}
+	.iconfont {
+		font-size: 18px;
+		margin-right: 10px;
+	}
+	.icon-chouchongbug {
+		font-size: 22px;
+	}
 }
 .changeHomeItem {
 	text-align: center;
@@ -346,4 +871,65 @@ export default {
 		margin-top: 10px;
 	}
 }
+
+// 新改
+.header_ul {
+	display: flex;
+	justify-content: flex-end;
+	margin: 0 85px 0 0;
+}
+
+.indexActive {
+	border-bottom: 2px solid #fff;
+}
+
+#tree {
+	margin: 15px 0 0 18px;
+}
+
+// 右键信息
+#menuList {
+	height: 40px;
+	width: 80px;
+	position: absolute;
+	border-radius: 10px;
+	border: 1px solid #d8d6d6;
+	background-color: #fff;
+	z-index: 1;
+	.menu_item {
+		line-height: 20px;
+		text-align: center;
+		margin-top: 10px;
+		cursor: pointer;
+	}
+	li:hover {
+		background-color: #14a478;
+		color: white;
+	}
+	li {
+		font-size: 15px;
+	}
+}
+
+// 头部显示隐藏
+.header_btn {
+	position: absolute;
+	color: #999;
+	font-size: 14px;
+	right: 20px;
+	bottom: 10px;
+	cursor: pointer;
+}
+.header_btn:hover {
+	color: #fff;
+}
+
+.header2 {
+	// border-bottom: 2px solid #397b0c;
+	border-bottom: 2px solid #0d2c2e;
+	position: relative;
+	// background-color: #397b0c;
+	background-color: rgb(13, 44, 46);
+	color: #fff;
+}
 </style>

+ 13 - 1
bigdata2/src/components/SearchBar/index.vue

@@ -56,6 +56,7 @@
 
 <script>
    export default {
+       props: ['facilityType'],
         data(){
             return {
                 displayType:1 ,
@@ -67,6 +68,7 @@
 
             }
         },
+        watch: {},
         methods:{
             checkType(i){
                 this.displayType=i;
@@ -90,7 +92,17 @@
             isOnlineSelect(){
                 this.$emit('fun3', this.is_online)
             }
-        }
+        },
+        mounted() {
+            // 判断当前页面是否为杀虫灯,如果为杀虫灯就先显示列表模式
+            if (this.facilityType == 'scd') {
+                this.displayType = 2
+                this.$emit('fun', this.displayType)
+            } else {
+                this.displayType = 1
+                this.$emit('fun', this.displayType)
+            }
+        },
    }
 </script>
 

File diff ditekan karena terlalu besar
+ 690 - 575
bigdata2/src/components/UserManger.vue


+ 4 - 0
bigdata2/src/main.js

@@ -25,6 +25,10 @@ Vue.config.productionTip = false //是阻止显示生产模式的消息
 // axios.defaults.withCredentials = true //axios请求时携带session
 // axios.defaults.crossDomain = true
 
+// 树形插件
+import Vuetree from 'vue-simple-tree'
+Vue.use(Vuetree);
+
 
 import 'babel-polyfill' //兼容IE11
 require("babel-polyfill")

+ 237 - 585
bigdata2/src/pages/cure/scd/scd.vue

@@ -1,419 +1,156 @@
 <template>
 	<div>
-		<el-breadcrumb separator-class="el-icon-arrow-right">
+		<el-breadcrumb
+			separator-class="el-icon-arrow-right"
+			:class="
+				'el-icon-arrow-right ' + (flag.flag == false ? 'breadcrumb_tab' : '')
+			"
+		>
 			<el-breadcrumb-item>物联网杀虫灯</el-breadcrumb-item>
 		</el-breadcrumb>
-		<search-bar
-			@fun="getDisplayType"
-			@fun2="getIDName"
-			@fun3="getIsOnline"
-		></search-bar>
-		<div v-loading='dataloading'>
-			<template v-if="displayType == 1">
-				<el-row :gutter="10">
-					<el-col
-						:xs="24"
-						:sm="12"
-						:md="8"
-						:lg="4"
-						:xl="4"
-						v-for="item in equipList"
-						:key="item.imei"
-					>
-						<el-card class="box-card">
-							<!-- <span
-								:class="['on-stauts', item.device_status == 1 ? 'on' : 'off']"
-							></span> -->
-							<img src="@/assets/images/cure/scd/scdIconOn.png" />
-							<p class="equip">{{ item.device_name || '无' }}</p>
-							<div class="item_info">
-								<p>地址 : {{ item.address || '无' }}</p>
-								<p>最新上报时间 : {{ item.status_time }}</p>
-								<p v-if = "item.device_status == 1">在线状态 : <span style="color:green">在线</span></p>
-								<p v-else>在线状态 : <span style="color:red">离线</span></p>
-								<p>设备号 :{{ item.device_id }}</p>
-							</div>
-							<div class="btns">
-								<el-button
-									size="mini"
-									type="info"
-									@click="equipStateSet(item.device_id,item.device_status)"
-									>设备状态</el-button
-								>
-								<el-button
-									size="mini"
-									type="warning"
-									@click="EquipControl(item.device_id)"
-									>设备控制</el-button
-								>
-								<el-button
-									size="mini"
-									type="danger"
-									@click="dataDetails(item.device_id,item.device_name,item.address)"
-									>数据详情</el-button
-								>
-							</div>
-						</el-card>
-					</el-col>
-				</el-row>
-			</template>
-			<template v-if="displayType == 2">
-				<el-card class="box-card">
-					<el-table :data="equipList" stripe style="width: 100%">
-						<el-table-column prop="device_id" label="设备ID" width="180">
-							<template slot-scope="scope">{{ scope.row.device_id }}</template>
-						</el-table-column>
-						<el-table-column prop="device_name" label="设备名称" width="180">
-							<template slot-scope="scope">{{
-								scope.row.device_name == '' ? '无' : scope.row.device_name
-							}}</template>
-						</el-table-column>
-						<el-table-column prop="device_status" label="在线状态">
-							<template slot-scope="scope">
-								<p style="color: #17bb89" v-if="scope.row.device_status == 1">
-									在线
-								</p>
-								<p style="color: #eb6765" v-if="scope.row.device_status == 0">
-									离线
-								</p>
-							</template>
-						</el-table-column>
-						<el-table-column prop="address" label="地址">
-							<template slot-scope="scope">{{ scope.row.address }}</template>
-						</el-table-column>
-						<el-table-column prop="status_time" label="最新上报时间">
-							<template slot-scope="scope">{{ scope.row.status_time }}</template>
-						</el-table-column>
-						<el-table-column label="操作" width="400">
-							<template slot-scope="scope">
-								<el-button
-									size="mini"
-									type="info"
-									@click="
-										equipStateSet(scope.row.device_id,scope.row.device_status)
-									"
-									>设备状态</el-button
-								>
-								<el-button
-									size="mini"
-									type="warning"
-									@click="EquipControl(scope.row.device_id)"
-									>设备控制</el-button
-								>
-								<el-button
-									size="mini"
-									type="danger"
-									@click="dataDetails(scope.row.device_id,scope.row.device_name,scope.row.address)"
-									>数据详情</el-button
-								>
-							</template>
-						</el-table-column>
-					</el-table>
-				</el-card>
-			</template>
-			<!-- 暂无数据 -->
-			<div class="expertDiagnosis_referral_units_not" v-if="equipList.length<=0 && displayType==1">
-				<img
-					src="@/assets/images/zanwu.png"
-					alt
-					class="expertDiagnosis_referral_units_notImg"
-				/>
-			</div>
-		</div>
-		
-		<el-pagination
-			v-if="equipList.length>0"
-			background
-			layout="prev, pager, next"
-			:total="totalNum"
-			:page-size="12"
-			:current-page="queryInfo.page"
-			@current-change="changePage"
-		></el-pagination>
-		<!-- SIM卡对话框 -->
-		<el-dialog title="SIM卡" :visible.sync="simCodeVisible" width="30%">
-			<div class="simCodeBox">
-				<div>
-					<span class="simCodeTitle">ICCID:</span>
-					<div>{{ sim.iccid }}</div>
-				</div>
-				<div>
-					<span class="simCodeTitle">状态:</span>
-					<div>{{ sim.account_status | simStatus }}</div>
-				</div>
-				<div>
-					<span class="simCodeTitle">套餐:</span>
-					<div>
-						<el-progress :show-text="false" :percentage="100"></el-progress>
-					</div>
-					<span>{{ sim.data_plan }}MB</span>
-				</div>
-				<div>
-					<span class="simCodeTitle">已用流量:</span>
-					<div>
-						<template v-if="!isNaN(data_usage_Per)">
-							<el-progress
-								:show-text="false"
-								:percentage="data_usage_Per"
-							></el-progress>
-						</template>
-					</div>
-					<span>{{ sim.data_usage }}MB</span>
-				</div>
-				<div>
-					<span class="simCodeTitle">剩余流量:</span>
-					<div>
-						<template v-if="!isNaN(data_balance_per)">
-							<el-progress
-								:show-text="false"
-								:percentage="data_balance_per"
-							></el-progress>
-						</template>
-					</div>
-					<span>{{ sim.data_balance }}MB</span>
-				</div>
-				<div>
-					<span class="simCodeTitle">到期时间:</span>
-					<div>{{ (sim.expiry_date * 1000) | formatTime }}</div>
-				</div>
-				<div class="operateBtn">
-					<el-button size="mini" @click="simCodeVisible = false"
-						>关闭</el-button
-					>
-				</div>
-			</div>
-		</el-dialog>
-		<!-- 设备控制对话框 -->
-		<el-dialog
-			title="设备控制"
-			:visible.sync="equipControlDialogVisible"
-			@close="equipControlDialogClosed"
-			width="35%"
-		>
-			<div class="handAddForm">
-				<el-form
-					ref="equipContrlRef"
-					:model="equipContrlForm"
-					label-position="right"
-					label-width="120px"
-				>
-					<el-form-item label="设备开关:" prop="ds">
-						<el-select v-model="equipContrlForm.ds" @change="equipSwitch">
-							<el-option label="开机" :value="1"></el-option>
-							<el-option label="关机" :value="0"></el-option>
-						</el-select>
-					</el-form-item>
-					<el-form-item label="定时模式:" prop="ts">
-						<el-select v-model="equipContrlForm.ts" placeholder="定时模式">
-							<el-option label="光控" :value="0"></el-option>
-							<el-option label="时控" :value="1"></el-option>
-						</el-select>
-					</el-form-item>
-					<el-form-item
-						v-if="equipContrlForm.ts == 1"
-						label="开始结束时间:"
-						prop="st"
-					>
-						<el-row :gutter="10">
-							<el-col :span="10">
-								<el-time-select
-									placeholder="起始时间"
-									v-model="equipContrlForm.st"
-									:picker-options="{
-										start: '0:00',
-										step: '1:00',
-										end: '23:00'
-									}"
-								></el-time-select>
-							</el-col>
-							<el-col class="line" :span="2">-</el-col>
-							<el-col :span="10">
-								<el-time-select
-									placeholder="结束时间"
-									v-model="equipContrlForm.et"
-									:picker-options="{
-										start: '0:00',
-										step: '1:00',
-										end: '23:00',
-										minTime: equipContrlForm.st
-									}"
-								></el-time-select>
-							</el-col>
-						</el-row>
-					</el-form-item>
-					<el-form-item
-						v-if="equipContrlForm.ts != 1"
-						label="定时时长:"
-						prop="tt"
-					>
-						<el-select v-model="equipContrlForm.tt" placeholder="定时时长">
-							<el-option label="常亮" :value="0"></el-option>
-							<el-option :label="1" :value="1"></el-option>
-							<el-option :label="2" :value="2"></el-option>
-							<el-option :label="3" :value="3"></el-option>
-							<el-option :label="4" :value="4"></el-option>
-							<el-option :label="5" :value="5"></el-option>
-							<el-option :label="6" :value="6"></el-option>
-							<el-option :label="7" :value="7"></el-option>
-						</el-select>
-					</el-form-item>
-					<el-form-item label="上传时间间隔:" prop="dattim">
-						<div class="sliderParent">
-							<div class="block">
-								<el-slider
-									:min='10'
-									:step='10'
-									:max='120'
-									v-model="equipContrlForm.dattim"
-									show-input
-								></el-slider>
-							</div>
-						</div>
-					</el-form-item>
-					<!-- <el-form-item label="自清虫定时:" prop="clt">
-						<div class="sliderParent">
-							<div class="block">
-								<el-slider
-									:min="10"
-									:max="120"
-									v-model="equipContrlForm.clt"
-									show-input
-								></el-slider>
-							</div>
-						</div>
-					</el-form-item> -->
-					<el-form-item class="handAddFormBtn">
-						<el-button type="primary" size="mini" @click="equipControlSubm"
-							>确定</el-button
-						>
-						<el-button size="mini" @click="equipControlDialogVisible = false"
-							>取消</el-button
-						>
-					</el-form-item>
-				</el-form>
-			</div>
-		</el-dialog>
-		<!-- 设备状态弹框 -->
-		<el-dialog
-			title="设备状态"
-			:visible.sync="equipStateDialogVisible"
-			width="35%"
-		>
-			<el-row :gutter="20">
+		<div v-loading="dataloading">
+			<el-row :gutter="10">
 				<el-col
 					:xs="24"
 					:sm="24"
 					:md="12"
 					:lg="8"
 					:xl="6"
-					v-for="(item, index) in equipStateList"
-					:key="index"
+					v-for="item in equipList"
+					:key="item.imei"
 				>
-					<div class="real-time">
-						<div class="left">
-							<div class>
+					<el-card class="box-card">
+						<div @click="scdList(item)" style="display: flex; justify-content: space-around">
+							<div style="margin: 22px 0 0 0">
 								<img
-									:src="
-										'/static/images/cure/scd/stateIcon/' + (index + 1) + '.png'
-									"
+									src="../../../assets/images/cure/scd/1.png"
+									alt=""
+									class=""
 								/>
 							</div>
+
+							<ul class="">
+								<li
+									class="plot_list"
+									style="display: flex; margin: 0 0 -10px 0"
+								>
+									<img
+										src="../../../assets/images/cure/scd/2.png"
+										alt=""
+										class=""
+										style="
+											width: 15px;
+											height: 15px;
+											vertical-align: middle;
+											margin: 18px 10px 0 0;
+										"
+									/>
+									<h3 :title="item.plot_name">{{ item.plot_name | ellipsis }}</h3>
+								</li>
+								<li class="plot_list">
+									<span>地块设备:</span>
+									<span>
+										<span style="color: #fbb309; font-size: 16px">{{
+											item.equip_count
+										}}</span
+										>台
+									</span>
+								</li>
+
+								<li class="plot_list">
+									<span>所属站点:</span>
+									<span :title="item.site_name">{{ item.site_name | ellipsis }}</span>
+								</li>
+
+								<li class="plot_list">
+									<span>建立日期:</span>
+									<span>{{ item.c_time }}</span>
+								</li>
+							</ul>
 						</div>
-						<div class="right">
-							<p class="num">
-								<strong>{{ item.val }}</strong>
-							</p>
-							<p class="unit">{{ item.title }}</p>
-						</div>
-					</div>
+					</el-card>
+				</el-col>
+
+				<!-- 新增地块 -->
+				<el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6">
+					<el-card class="box-card">
+						<img
+							@click="addPop"
+							src="../../../assets/images/cure/scd/3.png"
+							alt=""
+							style="cursor: pointer; padding: 5px 0 6px 0;"
+						/>
+					</el-card>
 				</el-col>
 			</el-row>
+
+			<!-- 暂无数据 -->
+			<div class="expertDiagnosis_referral_units_not" v-if="equipList.length <= 0">
+				<img
+					src="@/assets/images/zanwu.png"
+					alt
+					class="expertDiagnosis_referral_units_notImg"
+				/>
+			</div>
+		</div>
+		<!--  -->
+		<el-dialog
+			title="添加地块"
+			:visible.sync="dialogVisible"
+			:close-on-click-modal="false"
+			:close-on-press-escape="false"
+			width="20%"
+		>
+			<div>
+				<el-input placeholder="请输入地块名称" v-model="plot_name" clearable>
+				</el-input>
+			</div>
+			<span slot="footer" class="dialog-footer">
+				<el-button @click="dialogVisible = false">取 消</el-button>
+				<el-button type="primary" @click="addMassif">确 定</el-button>
+			</span>
 		</el-dialog>
 	</div>
 </template>
 <script>
-import SearchBar from '@/components/SearchBar'
 export default {
+	props: {
+		flag: {
+			flag: Boolean,
+			siteID: Number,
+			allList: Array
+		}
+	},
 	data() {
 		return {
-			dataloading:false,
-			//图表和表格切换
-			displayType: '1',
-			//在线状态按钮切换
-			equipStatus: '0',
-			//设备列表
+			dataloading: false,
 			equipList: [],
-			equipStateList: [
-				{
-					title: '设备开关',
-					val: ''
-				},
-				{
-					title: '工作状态',
-					val: ''
-				},
-				{
-					title: '定时时长(h)',
-					val: ''
-				},
-				{
-					title: '清虫间隔(min)',
-					val: ''
-				},
-				{
-					title: '灯管状态',
-					val: ''
-				},
-				{
-					title: '在线状态',
-					val: ''
-				},
-				{
-					title: '雨控状态',
-					val: ''
-				}
-			],
-			//参数
-			currImei: '',
-			d_id: '',
-			selectItem: '1', //1设备号,2用户名
-			searchVal: '',
-			// sim卡
-			sim: {
-				iccid: '',
-				account_status: 0, //卡状态 0-7 未知 测试期 沉默期 使用中 停机 停机保号 预销号 销号
-				data_plan: 0, //套餐大小
-				data_usage: 0, //当月用量
-				data_balance: 0, //剩余流量
-				expiry_date: 0 //到期日期
-			},
-			equipContrlForm: {
-				st: '',
-				et: '',
-				ds: '',
-				ts: '',
-				tt: '',
-				dattim: 10,
-			},
-			//参数
-			queryInfo: {
-				page: 1,
-				is_online: null,
-				dver: '',
-				f_id: '',
-				ename: ''
-			},
-			totalNum: 0,
-			//SIM卡对话框
-			simCodeVisible: false,
-			//设备控制对话框
-			equipControlDialogVisible: false,
-			//编辑阈值信息对话框
-			equipStateDialogVisible: false,
+			dialogVisible: false,
+			plot_name: '',
+			addSiteShow: '', // true是可以添加  false是不能添加
 		}
 	},
+	watch: {
+		siteID(val) {
+			for (var i = 0; i < this.flag.allList.length; i++) {
+				if (this.flag.allList[i].id == val) {
+					this.addSiteShow = 'false'
+				} else {
+					this.addSiteShow = 'true'
+				}
+			}
+		},
+
+		dialogVisible(val) {
+			if (val == false) {
+				this.plot_name = ''
+			}
+		},
+	},
 	mounted() {
-		this.getEquipList()
+		console.log(this.flag.siteID)
+		// 地块列表
+		this.getEquipList('')
 	},
 	computed: {
 		userType: function () {
@@ -427,216 +164,111 @@ export default {
 		data_balance_per: function () {
 			let aa = Number(this.sim.data_balance / this.sim.data_plan) * 100
 			return aa
+		},
+		siteID() {
+			return this.flag.siteID
 		}
 	},
 	methods: {
-		getIsOnline(data) {
-			this.queryInfo.is_online = data
-			this.queryInfo.page = 1
-			this.getEquipList()
-		},
-		getIDName(data) {
-			this.queryInfo.f_id = data.f_id
-			this.queryInfo.ename = data.ename
-			this.queryInfo.page = 1
-			this.getEquipList()
-		},
-		getDisplayType(data) {
-			this.displayType = data
-		},
-		//获取设备列表
-		getEquipList() {
-			this.dataloading = true;
-			this.$axios({
-				method: 'POST',
-				url: '/equipmanage_scd',
-				data: this.qs.stringify({
-					req: 'filter',
-					is_online:this.queryInfo.is_online,
-					ename: this.queryInfo.ename,
-					page: this.queryInfo.page,
-					f_id: this.queryInfo.f_id,
+		// 增加地块 - 确定
+		addMassif() {
+			if (this.addSiteShow == 'false') {
+				this.$message({
+					message: '当前选中的是一级站点,不能添加地块!',
+					type: 'warning',
+					duration: 1500
+				})
+			} else if (this.plot_name == '') {
+				this.$message({
+					message: '地块名称不能为空!',
+					type: 'warning',
+					duration: 1500
 				})
-			}).then((res) => {
-				this.dataloading = false
-				if(res.data.nums){
-					var dat = res.data.dat;
-					var arr = [];
-					for(var i = 0;i<dat.length;i++){
-						arr.push({
-							address: dat[i].locat,
-							device_id: dat[i].equip_id,
-							device_name: dat[i].equip_name,
-							device_status: parseInt(dat[i].is_online),
-							status_time: dat[i].upl_time,
-						})
-						if(i == dat.length-1){
-							console.log(arr)
-							this.equipList = arr
-							this.totalNum = res.data.nums
+			} else if (this.flag.siteID == '' || this.flag.siteID == null) {
+				this.$message({
+					message: '请先选择一个站点后再进行地块添加!',
+					type: 'warning',
+					duration: 1500
+				})
+			} else if (this.addSiteShow == 'true') {
+				var postData = this.qs.stringify({
+					plot_name: this.plot_name,
+					site_id: this.flag.siteID
+				})
+				this.$axios({
+					method: 'post',
+					url: '/add_plot',
+					data: postData
+				})
+					.then((res) => {
+						console.log(res)
+						if (res.data.msg == '成功') {
+							this.$message({
+								message: '地块添加' + res.data.msg,
+								type: 'success',
+								duration: 1500
+							})
+							this.dialogVisible = false
+							this.getEquipList('')
+						} else {
+							this.$message({
+								message: '地块添加失败',
+								type: 'error',
+								duration: 1500
+							})
 						}
-					}
-				}else{
-					this.equipList = []
-					this.totalNum = 0
-				}	
-			},error =>{
-				this.dataloading = false
-				this.$message.error('获取失败')
-			})
-		},
-		//改变page
-		changePage(val) {
-			this.queryInfo.page = val
-			this.getEquipList()
-		},
-		// 数据详情
-		dataDetails(e_id,name,address) {
-			this.currImei = e_id
-			this.$router.push({path:`/index/scdDetail`,query:{id:e_id,name:name,address:address}})
+					})
+					.catch((err) => {
+						console.log(err)
+					})
+			}
 		},
-		//sim卡状态
-		handleClick(tab, event) {
-			console.log(tab, event)
+
+		// 增加地块弹框
+		addPop() {
+			this.dialogVisible = true
 		},
-		// 设备状态弹框
-		equipStateSet(id,status) {
-			this.currImei = id
-			this.$axios({
-				method: 'POST',
-				url: '/equipmanage_scd',
-				data: this.qs.stringify({
-					req: 'imei',
-					id: id,
-				})
-			}).then((res) => {
-				var scd_status = eval('('+res.data.scd_status+')');
-				this.equipStateList[0].val = scd_status.ds == 0 ? '关机' : '开机';
-				if(scd_status.ws == 0){
-					this.equipStateList[1].val = '待机'
-				}else if(scd_status.ws == 1){
-					this.equipStateList[1].val = '工作'
-				}else if(scd_status.ws == 2){
-					this.equipStateList[1].val = '充电'
-				}
-				this.equipStateList[2].val = scd_status.tt == 0 ? '常亮' : scd_status.tt;
-				this.equipStateList[3].val = scd_status.clt/60;
-				this.equipStateList[4].val = scd_status.tbs == 0 ? '正常' : '保护'
-				this.equipStateList[5].val = status == 0 ? '离线' : '在线'
-				this.equipStateList[6].val = scd_status.rps == 0 ? '正常' : '保护'
 
-				if (res.data.message == '') {
-					let data = res.data.data.data[0].d_h_t
-					this.equipStateList[5].val = device_status == 0 ? '离线' : '在线'
-					for (let item in data) {
-						if (item == 'ds') {
-							this.equipStateList[0].val = data[item] == 0 ? '关机' : '开机'
-						} else if (item == 'ws') {
-							switch (data[item]) {
-								case 0:
-									this.equipStateList[1].val = '待机'
-									break
-								case 1:
-									this.equipStateList[1].val = '工作'
-									break
-								case 2:
-									this.equipStateList[1].val = '充电'
-									break
-							}
-						} else if (item == 'tt') {
-							this.equipStateList[2].val = data[item] == 0 ? '常亮' : data[item]
-						} else if (item == 'clt') {
-							this.equipStateList[3].val = data[item] / 60
-						} else if (item == 'tbs') {
-							this.equipStateList[4].val = data[item] == 0 ? '正常' : '保护'
-						} else if (item == 'rps') {
-							this.equipStateList[6].val = data[item] == 0 ? '正常' : '保护'
-						}
-					}
-				}
+		// 地块列表
+		getEquipList(data) {
+			console.log(data)
+			var postData = this.qs.stringify({
+				site_id: data.id !== undefined ? data.id : '',
+				page: this.page,
+				req: 'scd'
 			})
-			this.equipStateDialogVisible = true
-		},
-		//设备控制
-		EquipControl(id) {
-			this.currImei = id
 			this.$axios({
 				method: 'POST',
-				url: '/equipmanage_scd',
-				data: this.qs.stringify({
-					req: 'imei',
-					id: id,
-				})
-			}).then((res) => {
-				var scd_status = eval('('+res.data.scd_status+')');
-				this.equipContrlForm = {
-					dattim: scd_status.dattim,
-					ds: scd_status.ds,
-					et: scd_status.et,
-					st: scd_status.st,
-					ts: scd_status.tcs,
-					tt: scd_status.tt,
-				}
-				this.equipControlDialogVisible = true
+				url: '/plot_view',
+				data: postData
 			})
-		},
-		equipControlSubm() {
-			let obj = this.equipContrlForm
-			obj.st = obj.st && obj.st.toString().slice(0, 2) != '0' ? obj.st.toString().slice(0, 2) : obj.st.toString().slice(1, 2)
-			obj.et = obj.et && obj.et.toString().slice(0, 2) != '0' ? obj.et.toString().slice(0, 2) : obj.et.toString().slice(1, 2)
-			this.$axios({
-				method: 'POST',
-				url: '/scd_mqtt',
-				data: this.qs.stringify({
-					sw: 'datt',
-					topicid: JSON.stringify([this.currImei]),
-					dattim: this.equipContrlForm.dattim
+				.then((res) => {
+					if (res.data) {
+						this.equipList = res.data
+					}
 				})
-			}).then((res) => {
-				if (res.data != 0) {
-					this.$message.error('设备控制修改失败')
-				}
-			})
-			this.$axios({
-				method: 'POST',
-				url: '/scd_mqtt_all',
-				data: this.qs.stringify({
-					sw: 'timer',
-					ts: this.equipContrlForm.ts,
-					hours: this.equipContrlForm.tt,
-					begin: this.equipContrlForm.st,
-					end: this.equipContrlForm.et
+				.catch((err) => {
+					console.log(err)
 				})
-			}).then((res) => {
-				if (res.data == 0) {
-					this.$message.success('设备控制修改成功')
-				} else {
-					this.$message.error('设备控制修改失败')
-				}
-				this.equipControlDialogVisible = false
-			})
 		},
-		//设备开关控制
-		equipSwitch(){
-			this.$axios({
-				method: 'POST',
-				url: '/scd_mqtt',
-				data: this.qs.stringify({
-					sw: 'timer',
-					topicid: JSON.stringify([this.currImei]),
-					ds: this.equipContrlForm.ds
-				})
-			}).then((res) => {
-				if (res.data == 0) {
-					this.$message.success('设备控制修改成功')
-				} else {
-					this.$message.error('设备控制修改失败')
+
+		// 点击进入杀虫灯列表
+		scdList(data) {
+			console.log(data)
+			this.$router.push({
+				path: `/index/scdList`,
+				query: {
+					plot_id: data.plot_id,
+					site_id: this.flag.siteID == null ? '' : this.flag.siteID,
+					plot_name: data.plot_name
 				}
 			})
 		},
-		equipControlDialogClosed() {
-			this.$refs.equipContrlRef.resetFields()
-			// console.log(this.equipContrlForm)
+
+		//改变page
+		changePage(val) {
+			this.page = val
+			this.getEquipList()
 		},
 	},
 	filters: {
@@ -659,11 +291,16 @@ export default {
 				case 7:
 					return '销号'
 			}
+		},
+		ellipsis(value) {
+			if (!value) return ''
+			if (value.length > 10) {
+				return value.slice(0, 10) + '...'
+			}
+			return value
 		}
 	},
-	components: {
-		SearchBar
-	}
+	components: {}
 }
 </script>
 <style lang="less" scoped>
@@ -827,11 +464,26 @@ export default {
 	width: 270px;
 	vertical-align: top;
 }
-/deep/.el-date-editor--time-select{width:100%!important}
-/deep/.line{text-align:center}
+/deep/.el-date-editor--time-select {
+	width: 100% !important;
+}
+/deep/.line {
+	text-align: center;
+}
 // 暂无数据
 .expertDiagnosis_referral_units_not {
 	width: 272px;
 	margin: 0 auto;
 }
+
+.breadcrumb_tab {
+	top: 60px !important;
+}
+
+// 占地列表样式
+.plot_list {
+	text-align: left;
+	color: #9d9d9d;
+	margin: 0 0 3px 0;
+}
 </style>

+ 12 - 1
bigdata2/src/pages/cure/scd/scdDetail.vue

@@ -1,6 +1,6 @@
 <template>
 	<div>
-		<el-breadcrumb separator-class="el-icon-arrow-right">
+		<el-breadcrumb separator-class="el-icon-arrow-right" :class="'el-icon-arrow-right '+ (flag.flag == false ? 'breadcrumb_tab' : '')">
 			<el-breadcrumb-item :to="{ path: '/index/scd' }">物联网杀虫灯</el-breadcrumb-item>
 			<el-breadcrumb-item>数据详情</el-breadcrumb-item>
 		</el-breadcrumb>
@@ -69,6 +69,13 @@
 <script>
 import DateSearch from '@/components/DateSearch'
 export default {
+	// props: ['flag'],
+	props: {
+		flag: {
+			flag: Boolean,
+			siteID: Number
+		},
+	},
 	data() {
 		return {
 			id: this.$route.query.id,
@@ -519,4 +526,8 @@ export default {
 .ctrl-check {
 	margin-bottom: 20px;
 }
+
+.breadcrumb_tab {
+	top: 60px !important;
+}
 </style>

+ 947 - 0
bigdata2/src/pages/cure/scd/scdList.vue

@@ -0,0 +1,947 @@
+<template>
+	<div style="position: relative;">
+		<el-breadcrumb
+			separator-class="el-icon-arrow-right"
+			:class="
+				'el-icon-arrow-right ' + (flag.flag == false ? 'breadcrumb_tab' : '')
+			"
+		>
+			<el-breadcrumb-item :to="{ path: '/index/scd' }"
+				>物联网杀虫灯</el-breadcrumb-item
+			>
+			<el-breadcrumb-item>杀虫灯设备列表</el-breadcrumb-item>
+		</el-breadcrumb>
+		<search-bar
+			@fun="getDisplayType"
+			@fun2="getIDName"
+			@fun3="getIsOnline"
+			:facilityType="facilityType"
+			style="width: 95%"
+		>
+		</search-bar>
+		<el-button
+			type="success"
+			size="mini"
+			style="position: absolute; right: 5px; top: 0"
+			@click="allotDevice()"
+			>绑定设备</el-button
+		>
+
+		<div v-loading="dataloading">
+			<template v-if="displayType == 1">
+				<el-row :gutter="10">
+					<el-col
+						:xs="24"
+						:sm="12"
+						:md="8"
+						:lg="4"
+						:xl="4"
+						v-for="item in equipList"
+						:key="item.imei"
+					>
+						<el-card class="box-card">
+							<!-- <span
+								:class="['on-stauts', item.device_status == 1 ? 'on' : 'off']"
+							></span> -->
+							<img src="@/assets/images/cure/scd/scdIconOn.png" />
+							<p class="equip" :title="item.device_name">
+								{{ (item.device_name || '无') | ellipsis }}
+							</p>
+							<div class="item_info">
+								<p :title="item.address">
+									地址 : {{ (item.address || '无') | ellipsis }}
+								</p>
+								<p>最新上报时间 : {{ item.status_time }}</p>
+								<p v-if="item.device_status == 1">
+									在线状态 : <span style="color: green">在线</span>
+								</p>
+								<p v-else>在线状态 : <span style="color: red">离线</span></p>
+								<p>设备号 :{{ item.device_id }}</p>
+							</div>
+							<div class="btns">
+								<el-button
+									size="mini"
+									type="info"
+									@click="equipStateSet(item.device_id, item.device_status)"
+									>设备状态</el-button
+								>
+								<el-button
+									size="mini"
+									type="warning"
+									@click="EquipControl(item.device_id)"
+									>设备控制</el-button
+								>
+								<el-button
+									size="mini"
+									type="danger"
+									@click="
+										dataDetails(item.device_id, item.device_name, item.address)
+									"
+									>数据详情</el-button
+								>
+							</div>
+						</el-card>
+					</el-col>
+				</el-row>
+			</template>
+			<template v-if="displayType == 2">
+				<el-card class="box-card">
+					<el-table :data="equipList" stripe style="width: 100%">
+						<el-table-column prop="device_id" label="设备ID" width="180">
+							<template slot-scope="scope">{{ scope.row.device_id }}</template>
+						</el-table-column>
+						<el-table-column prop="device_name" label="设备名称" width="180">
+							<template slot-scope="scope">{{
+								scope.row.device_name == '' ? '无' : scope.row.device_name
+							}}</template>
+						</el-table-column>
+						<el-table-column prop="device_status" label="在线状态">
+							<template slot-scope="scope">
+								<p style="color: #17bb89" v-if="scope.row.device_status == 1">
+									在线
+								</p>
+								<p style="color: #eb6765" v-if="scope.row.device_status == 0">
+									离线
+								</p>
+							</template>
+						</el-table-column>
+						<el-table-column prop="address" label="地址">
+							<template slot-scope="scope">{{
+								scope.row.address == '' ? '暂无地址' : scope.row.address
+							}}</template>
+						</el-table-column>
+						<el-table-column prop="status_time" label="最新上报时间">
+							<template slot-scope="scope">{{
+								scope.row.status_time
+							}}</template>
+						</el-table-column>
+						<el-table-column label="操作" width="400">
+							<template slot-scope="scope">
+								<el-button
+									size="mini"
+									type="info"
+									@click="
+										equipStateSet(scope.row.device_id, scope.row.device_status)
+									"
+									>设备状态</el-button
+								>
+								<el-button
+									size="mini"
+									type="warning"
+									@click="EquipControl(scope.row.device_id)"
+									>设备控制</el-button
+								>
+								<el-button
+									size="mini"
+									type="danger"
+									@click="
+										dataDetails(
+											scope.row.device_id,
+											scope.row.device_name,
+											scope.row.address
+										)
+									"
+									>数据详情</el-button
+								>
+							</template>
+						</el-table-column>
+					</el-table>
+				</el-card>
+			</template>
+			<!-- 暂无数据 -->
+			<div
+				class="expertDiagnosis_referral_units_not"
+				v-if="equipList.length <= 0 && displayType == 1"
+			>
+				<img
+					src="@/assets/images/zanwu.png"
+					alt
+					class="expertDiagnosis_referral_units_notImg"
+				/>
+			</div>
+		</div>
+
+		<el-pagination
+			v-if="equipList.length > 0"
+			background
+			layout="prev, pager, next"
+			:total="totalNum"
+			:page-size="12"
+			:current-page="queryInfo.page"
+			@current-change="changePage"
+		></el-pagination>
+		<!-- SIM卡对话框 -->
+		<el-dialog title="SIM卡" :visible.sync="simCodeVisible" width="30%">
+			<div class="simCodeBox">
+				<div>
+					<span class="simCodeTitle">ICCID:</span>
+					<div>{{ sim.iccid }}</div>
+				</div>
+				<div>
+					<span class="simCodeTitle">状态:</span>
+					<div>{{ sim.account_status | simStatus }}</div>
+				</div>
+				<div>
+					<span class="simCodeTitle">套餐:</span>
+					<div>
+						<el-progress :show-text="false" :percentage="100"></el-progress>
+					</div>
+					<span>{{ sim.data_plan }}MB</span>
+				</div>
+				<div>
+					<span class="simCodeTitle">已用流量:</span>
+					<div>
+						<template v-if="!isNaN(data_usage_Per)">
+							<el-progress
+								:show-text="false"
+								:percentage="data_usage_Per"
+							></el-progress>
+						</template>
+					</div>
+					<span>{{ sim.data_usage }}MB</span>
+				</div>
+				<div>
+					<span class="simCodeTitle">剩余流量:</span>
+					<div>
+						<template v-if="!isNaN(data_balance_per)">
+							<el-progress
+								:show-text="false"
+								:percentage="data_balance_per"
+							></el-progress>
+						</template>
+					</div>
+					<span>{{ sim.data_balance }}MB</span>
+				</div>
+				<div>
+					<span class="simCodeTitle">到期时间:</span>
+					<div>{{ (sim.expiry_date * 1000) | formatTime }}</div>
+				</div>
+				<div class="operateBtn">
+					<el-button size="mini" @click="simCodeVisible = false"
+						>关闭</el-button
+					>
+				</div>
+			</div>
+		</el-dialog>
+		<!-- 设备控制对话框 -->
+		<el-dialog
+			title="设备控制"
+			:visible.sync="equipControlDialogVisible"
+			@close="equipControlDialogClosed"
+			width="35%"
+		>
+			<div class="handAddForm">
+				<el-form
+					ref="equipContrlRef"
+					:model="equipContrlForm"
+					label-position="right"
+					label-width="120px"
+				>
+					<el-form-item label="设备开关:" prop="ds">
+						<el-select v-model="equipContrlForm.ds" @change="equipSwitch">
+							<el-option label="开机" :value="1"></el-option>
+							<el-option label="关机" :value="0"></el-option>
+						</el-select>
+					</el-form-item>
+					<el-form-item label="定时模式:" prop="ts">
+						<el-select v-model="equipContrlForm.ts" placeholder="定时模式">
+							<el-option label="光控" :value="0"></el-option>
+							<el-option label="时控" :value="1"></el-option>
+						</el-select>
+					</el-form-item>
+					<el-form-item
+						v-if="equipContrlForm.ts == 1"
+						label="开始结束时间:"
+						prop="st"
+					>
+						<el-row :gutter="10">
+							<el-col :span="10">
+								<el-time-select
+									placeholder="起始时间"
+									v-model="equipContrlForm.st"
+									:picker-options="{
+										start: '0:00',
+										step: '1:00',
+										end: '23:00'
+									}"
+								></el-time-select>
+							</el-col>
+							<el-col class="line" :span="2">-</el-col>
+							<el-col :span="10">
+								<el-time-select
+									placeholder="结束时间"
+									v-model="equipContrlForm.et"
+									:picker-options="{
+										start: '0:00',
+										step: '1:00',
+										end: '23:00',
+										minTime: equipContrlForm.st
+									}"
+								></el-time-select>
+							</el-col>
+						</el-row>
+					</el-form-item>
+					<el-form-item
+						v-if="equipContrlForm.ts != 1"
+						label="定时时长:"
+						prop="tt"
+					>
+						<el-select v-model="equipContrlForm.tt" placeholder="定时时长">
+							<el-option label="常亮" :value="0"></el-option>
+							<el-option :label="1" :value="1"></el-option>
+							<el-option :label="2" :value="2"></el-option>
+							<el-option :label="3" :value="3"></el-option>
+							<el-option :label="4" :value="4"></el-option>
+							<el-option :label="5" :value="5"></el-option>
+							<el-option :label="6" :value="6"></el-option>
+							<el-option :label="7" :value="7"></el-option>
+						</el-select>
+					</el-form-item>
+					<el-form-item label="上传时间间隔:" prop="dattim">
+						<div class="sliderParent">
+							<div class="block">
+								<el-slider
+									:min="10"
+									:step="10"
+									:max="120"
+									v-model="equipContrlForm.dattim"
+									show-input
+								></el-slider>
+							</div>
+						</div>
+					</el-form-item>
+					<!-- <el-form-item label="自清虫定时:" prop="clt">
+						<div class="sliderParent">
+							<div class="block">
+								<el-slider
+									:min="10"
+									:max="120"
+									v-model="equipContrlForm.clt"
+									show-input
+								></el-slider>
+							</div>
+						</div>
+					</el-form-item> -->
+					<el-form-item class="handAddFormBtn">
+						<el-button type="primary" size="mini" @click="equipControlSubm"
+							>确定</el-button
+						>
+						<el-button size="mini" @click="equipControlDialogVisible = false"
+							>取消</el-button
+						>
+					</el-form-item>
+				</el-form>
+			</div>
+		</el-dialog>
+		<!-- 设备状态弹框 -->
+		<el-dialog
+			title="设备状态"
+			:visible.sync="equipStateDialogVisible"
+			width="35%"
+		>
+			<el-row :gutter="20">
+				<el-col
+					:xs="24"
+					:sm="24"
+					:md="12"
+					:lg="8"
+					:xl="6"
+					v-for="(item, index) in equipStateList"
+					:key="index"
+				>
+					<div class="real-time">
+						<div class="left">
+							<div class>
+								<img
+									:src="
+										'/static/images/cure/scd/stateIcon/' + (index + 1) + '.png'
+									"
+								/>
+							</div>
+						</div>
+						<div class="right">
+							<p class="num">
+								<strong>{{ item.val }}</strong>
+							</p>
+							<p class="unit">{{ item.title }}</p>
+						</div>
+					</div>
+				</el-col>
+			</el-row>
+		</el-dialog>
+	</div>
+</template>
+<script>
+import SearchBar from '@/components/SearchBar'
+export default {
+	props: {
+		flag: {
+			flag: Boolean,
+			siteID: Number
+		}
+	},
+	data() {
+		return {
+			dataloading: false,
+			//图表和表格切换
+			displayType: '1',
+			//在线状态按钮切换
+			equipStatus: '0',
+			//设备列表
+			equipList: [],
+			equipStateList: [
+				{
+					title: '设备开关',
+					val: ''
+				},
+				{
+					title: '工作状态',
+					val: ''
+				},
+				{
+					title: '定时时长(h)',
+					val: ''
+				},
+				{
+					title: '清虫间隔(min)',
+					val: ''
+				},
+				{
+					title: '灯管状态',
+					val: ''
+				},
+				{
+					title: '在线状态',
+					val: ''
+				},
+				{
+					title: '雨控状态',
+					val: ''
+				}
+			],
+			//参数
+			currImei: '',
+			d_id: '',
+			selectItem: '1', //1设备号,2用户名
+			searchVal: '',
+			// sim卡
+			sim: {
+				iccid: '',
+				account_status: 0, //卡状态 0-7 未知 测试期 沉默期 使用中 停机 停机保号 预销号 销号
+				data_plan: 0, //套餐大小
+				data_usage: 0, //当月用量
+				data_balance: 0, //剩余流量
+				expiry_date: 0 //到期日期
+			},
+			equipContrlForm: {
+				st: '',
+				et: '',
+				ds: '',
+				ts: '',
+				tt: '',
+				dattim: 10
+			},
+			//参数
+			queryInfo: {
+				page: 1,
+				is_online: null,
+				dver: '',
+				f_id: '',
+				ename: ''
+			},
+			totalNum: 0,
+			//SIM卡对话框
+			simCodeVisible: false,
+			//设备控制对话框
+			equipControlDialogVisible: false,
+			//编辑阈值信息对话框
+			equipStateDialogVisible: false,
+			objData: {},
+			facilityType: 'scd'
+		}
+	},
+	mounted() {
+		this.getEquipList()
+		console.log(this.facilityType)
+		// console.log(this.$route.query.plot_id)
+		// console.log(this.$route.query.site_id)
+	},
+	computed: {
+		userType: function () {
+			//获取用户类型
+			return window.sessionStorage.getItem('myuser_type')
+		},
+		data_usage_Per: function () {
+			let aa = Number(this.sim.data_usage / this.sim.data_plan) * 100
+			return aa
+		},
+		data_balance_per: function () {
+			let aa = Number(this.sim.data_balance / this.sim.data_plan) * 100
+			return aa
+		}
+	},
+	methods: {
+		getIsOnline(data) {
+			this.queryInfo.is_online = data
+			this.queryInfo.page = 1
+			this.getEquipList()
+		},
+		getIDName(data) {
+			this.queryInfo.f_id = data.f_id
+			this.queryInfo.ename = data.ename
+			this.queryInfo.page = 1
+			this.getEquipList()
+		},
+		getDisplayType(data) {
+			this.displayType = data
+		},
+		//获取设备列表
+		getEquipList(obj, page) {
+			console.log(this.$route.query.plot_id)
+			console.log(this.$route.query.site_id)
+
+			if (obj) {
+				this.queryInfo.page = page
+				this.objData = obj
+			}
+			var id = ''
+			if (this.objData !== undefined && this.objData.id !== undefined) {
+				id = this.objData.id
+			} else if (obj !== undefined) {
+				id = obj.id
+			} else if (this.$route.query.site_id) {
+				id = this.$route.query.site_id
+			}
+			this.dataloading = true
+			this.$axios({
+				method: 'POST',
+				url: '/equipmanage_scd',
+				data: this.qs.stringify({
+					req: 'filter',
+					is_online: this.queryInfo.is_online,
+					ename: this.queryInfo.ename,
+					page: this.queryInfo.page,
+					f_id: this.queryInfo.f_id,
+					plot_id: this.$route.query.plot_id,
+					// site_id: obj == undefined ? '' : obj.id,
+					site_id: id
+				})
+			}).then(
+				(res) => {
+					this.dataloading = false
+					if (res.data.nums) {
+						var dat = res.data.dat
+						var arr = []
+						for (var i = 0; i < dat.length; i++) {
+							arr.push({
+								address: dat[i].locat,
+								device_id: dat[i].equip_id,
+								device_name: dat[i].equip_name == '' || dat[i].equip_name == null ? '暂无名称' : dat[i].equip_name,
+								device_status: parseInt(dat[i].is_online),
+								status_time: dat[i].upl_time
+							})
+							if (i == dat.length - 1) {
+								this.equipList = arr
+								this.totalNum = res.data.nums
+							}
+						}
+					} else {
+						this.equipList = []
+						this.totalNum = 0
+					}
+				},
+				(error) => {
+					this.dataloading = false
+					this.$message.error('获取失败')
+				}
+			)
+		},
+		//改变page
+		changePage(val) {
+			this.queryInfo.page = val
+			this.getEquipList()
+		},
+		// 数据详情
+		dataDetails(e_id, name, address) {
+			this.currImei = e_id
+			this.$router.push({
+				path: `/index/scdDetail`,
+				query: { id: e_id, name: name, address: address }
+			})
+		},
+		//sim卡状态
+		handleClick(tab, event) {
+			console.log(tab, event)
+		},
+		// 设备状态弹框
+		equipStateSet(id, status) {
+			this.currImei = id
+			this.$axios({
+				method: 'POST',
+				url: '/equipmanage_scd',
+				data: this.qs.stringify({
+					req: 'imei',
+					id: id
+				})
+			}).then((res) => {
+				var scd_status = eval('(' + res.data.scd_status + ')')
+				this.equipStateList[0].val = scd_status.ds == 0 ? '关机' : '开机'
+				if (scd_status.ws == 0) {
+					this.equipStateList[1].val = '待机'
+				} else if (scd_status.ws == 1) {
+					this.equipStateList[1].val = '工作'
+				} else if (scd_status.ws == 2) {
+					this.equipStateList[1].val = '充电'
+				}
+				this.equipStateList[2].val = scd_status.tt == 0 ? '常亮' : scd_status.tt
+				this.equipStateList[3].val = scd_status.clt / 60
+				this.equipStateList[4].val = scd_status.tbs == 0 ? '正常' : '保护'
+				this.equipStateList[5].val = status == 0 ? '离线' : '在线'
+				this.equipStateList[6].val = scd_status.rps == 0 ? '正常' : '保护'
+
+				if (res.data.message == '') {
+					let data = res.data.data.data[0].d_h_t
+					this.equipStateList[5].val = device_status == 0 ? '离线' : '在线'
+					for (let item in data) {
+						if (item == 'ds') {
+							this.equipStateList[0].val = data[item] == 0 ? '关机' : '开机'
+						} else if (item == 'ws') {
+							switch (data[item]) {
+								case 0:
+									this.equipStateList[1].val = '待机'
+									break
+								case 1:
+									this.equipStateList[1].val = '工作'
+									break
+								case 2:
+									this.equipStateList[1].val = '充电'
+									break
+							}
+						} else if (item == 'tt') {
+							this.equipStateList[2].val = data[item] == 0 ? '常亮' : data[item]
+						} else if (item == 'clt') {
+							this.equipStateList[3].val = data[item] / 60
+						} else if (item == 'tbs') {
+							this.equipStateList[4].val = data[item] == 0 ? '正常' : '保护'
+						} else if (item == 'rps') {
+							this.equipStateList[6].val = data[item] == 0 ? '正常' : '保护'
+						}
+					}
+				}
+			})
+			this.equipStateDialogVisible = true
+		},
+		//设备控制
+		EquipControl(id) {
+			this.currImei = id
+			this.$axios({
+				method: 'POST',
+				url: '/equipmanage_scd',
+				data: this.qs.stringify({
+					req: 'imei',
+					id: id
+				})
+			}).then((res) => {
+				var scd_status = eval('(' + res.data.scd_status + ')')
+				this.equipContrlForm = {
+					dattim: scd_status.dattim,
+					ds: scd_status.ds,
+					et: scd_status.et,
+					st: scd_status.st,
+					ts: scd_status.tcs,
+					tt: scd_status.tt
+				}
+				this.equipControlDialogVisible = true
+			})
+		},
+		equipControlSubm() {
+			let obj = this.equipContrlForm
+			obj.st =
+				obj.st && obj.st.toString().slice(0, 2) != '0'
+					? obj.st.toString().slice(0, 2)
+					: obj.st.toString().slice(1, 2)
+			obj.et =
+				obj.et && obj.et.toString().slice(0, 2) != '0'
+					? obj.et.toString().slice(0, 2)
+					: obj.et.toString().slice(1, 2)
+			this.$axios({
+				method: 'POST',
+				url: '/scd_mqtt',
+				data: this.qs.stringify({
+					sw: 'datt',
+					topicid: JSON.stringify([this.currImei]),
+					dattim: this.equipContrlForm.dattim
+				})
+			}).then((res) => {
+				if (res.data != 0) {
+					this.$message.error('设备控制修改失败')
+				}
+			})
+			this.$axios({
+				method: 'POST',
+				url: '/scd_mqtt_all',
+				data: this.qs.stringify({
+					sw: 'timer',
+					ts: this.equipContrlForm.ts,
+					hours: this.equipContrlForm.tt,
+					begin: this.equipContrlForm.st,
+					end: this.equipContrlForm.et
+				})
+			}).then((res) => {
+				if (res.data == 0) {
+					this.$message.success('设备控制修改成功')
+				} else {
+					this.$message.error('设备控制修改失败')
+				}
+				this.equipControlDialogVisible = false
+			})
+		},
+		//设备开关控制
+		equipSwitch() {
+			this.$axios({
+				method: 'POST',
+				url: '/scd_mqtt',
+				data: this.qs.stringify({
+					sw: 'timer',
+					topicid: JSON.stringify([this.currImei]),
+					ds: this.equipContrlForm.ds
+				})
+			}).then((res) => {
+				if (res.data == 0) {
+					this.$message.success('设备控制修改成功')
+				} else {
+					this.$message.error('设备控制修改失败')
+				}
+			})
+		},
+		equipControlDialogClosed() {
+			this.$refs.equipContrlRef.resetFields()
+			// console.log(this.equipContrlForm)
+		},
+
+		// 绑定设备跳转
+		allotDevice() {
+			this.$router.push({
+				path: `/index/scdListAllot`,
+				query: {
+					plot_id: this.$route.query.plot_id,
+					site_id: this.$route.query.site_id,
+					plot_name: this.$route.query.plot_name
+				}
+			})
+		},
+	},
+	filters: {
+		simStatus(val) {
+			switch (val) {
+				case 0:
+					return '未知'
+				case 1:
+					return '测试期'
+				case 2:
+					return '沉默期'
+				case 3:
+					return '使用中'
+				case 4:
+					return '停机'
+				case 5:
+					return '停机保号'
+				case 6:
+					return '预销号'
+				case 7:
+					return '销号'
+			}
+		},
+		ellipsis(value) {
+			if (!value) return ''
+			if (value.length > 8) {
+				return value.slice(0, 8) + '...'
+			}
+			return value
+		}
+	},
+	components: {
+		SearchBar
+	}
+}
+</script>
+<style lang="less" scoped>
+.el-card {
+	position: relative;
+	text-align: center;
+	color: #555;
+	font-size: 13px;
+	.superOperate {
+		position: absolute;
+		right: 10px;
+		top: 10px;
+		cursor: pointer;
+		i {
+			font-size: 18px;
+			color: #35a478;
+		}
+	}
+	.on-stauts {
+		position: absolute;
+		width: 10px;
+		height: 10px;
+		border-radius: 50%;
+		left: 15px;
+		top: 15px;
+	}
+	.on-stauts.on {
+		background: linear-gradient(#3fd79a, #9add4f);
+		box-shadow: 0 0 5px 3px rgba(106, 255, 44, 0.6);
+	}
+	.on-stauts.off {
+		background: linear-gradient(#fe2b62, #f67c49);
+		box-shadow: 0 0 5px 3px rgba(255, 44, 44, 0.6);
+	}
+	.item_info {
+		font-size: 14px;
+		line-height: 32px;
+		color: #888;
+	}
+	.equip {
+		font-weight: bolder;
+		color: #333;
+		font-size: 16px;
+		line-height: 30px;
+		margin-bottom: 10px;
+	}
+	.btns {
+		display: flex;
+		justify-content: space-between;
+		flex-wrap: nowrap;
+		padding-top: 10px;
+	}
+}
+.simCodeBox {
+	> div {
+		line-height: 40px;
+		display: flex;
+		align-content: center;
+		.simCodeTitle {
+			width: 100px;
+			text-align: right;
+			font-size: 14px;
+			color: #333;
+		}
+		> div {
+			flex: 1;
+			.el-progress {
+				margin-top: 17px;
+			}
+		}
+		span {
+			width: 85px;
+			font-size: 12px;
+			padding-left: 3px;
+			color: #909090;
+		}
+		.el-input {
+			width: 60%;
+		}
+	}
+	.operateBtn {
+		display: block;
+		text-align: right;
+	}
+}
+.handAddForm {
+	width: 85%;
+	/deep/.el-form-item {
+		margin-bottom: 8px;
+	}
+	.handAddFormBtn {
+		text-align: right;
+	}
+}
+.sliderParent {
+	display: flex;
+	.block {
+		flex: 1;
+		margin-right: 10px;
+		/deep/.el-slider__runway,
+		/deep/.el-slider__bar {
+			height: 10px;
+		}
+	}
+	> span {
+		width: 40px;
+	}
+}
+.adminOperate {
+	text-align: center;
+	margin-bottom: 10px;
+}
+
+.real-time {
+	display: flex;
+	justify-content: left;
+	align-items: center;
+	padding: 20px 0;
+	.left {
+		margin-right: 10px;
+		.icon-box {
+			border-radius: 50%;
+			width: 46px;
+			height: 46px;
+			padding: 5px;
+			box-sizing: border-box;
+			margin-bottom: 3px;
+			img {
+				width: 100%;
+				height: auto;
+			}
+		}
+		.aisle {
+			text-align: center;
+			font-size: 14px;
+			color: #666;
+		}
+	}
+	.right {
+		color: #333;
+		.num {
+			font-weight: 600;
+			font-size: 20px;
+			margin-bottom: 3px;
+		}
+		.unit {
+			font-size: 14px;
+			color: #666;
+		}
+	}
+}
+.checkData {
+	text-align: right;
+	font-size: 14px;
+	span {
+		cursor: pointer;
+	}
+}
+.demo-dynamic .el-input {
+	margin-right: 10px;
+	width: 270px;
+	vertical-align: top;
+}
+/deep/.el-date-editor--time-select {
+	width: 100% !important;
+}
+/deep/.line {
+	text-align: center;
+}
+// 暂无数据
+.expertDiagnosis_referral_units_not {
+	width: 272px;
+	margin: 0 auto;
+}
+
+.breadcrumb_tab {
+	top: 60px !important;
+}
+
+
+
+</style>

+ 364 - 0
bigdata2/src/pages/cure/scd/scdListAllot.vue

@@ -0,0 +1,364 @@
+<template>
+	<div style="cursor: default">
+		<el-breadcrumb
+			separator-class="el-icon-arrow-right"
+			:class="
+				'el-icon-arrow-right ' + (flag.flag == false ? 'breadcrumb_tab' : '')
+			"
+		>
+			<el-breadcrumb-item
+				:to="{
+					path: '/index/scdList',
+					query: {
+						plot_id: this.$route.query.plot_id,
+						site_id: this.$route.query.site_id,
+						plot_name: this.$route.query.plot_name
+					}
+				}"
+			>
+				<!-- <el-breadcrumb-item 
+            @click="toscdList()"
+				> -->
+				杀虫灯设备列表</el-breadcrumb-item
+			>
+			<el-breadcrumb-item>分配设备</el-breadcrumb-item>
+		</el-breadcrumb>
+		<div class="search-box">
+			<div class="filter-box">
+				<!-- <el-select
+					size="small"
+					v-model="type"
+					@change="equipCheck()"
+					clearable
+					placeholder="请选择设备类型"
+				>
+					<el-option
+						v-for="item in typelist"
+						:key="item.id"
+						:label="item.type_name"
+						:value="item.id"
+					></el-option>
+				</el-select> -->
+				<el-input
+					style="cursor: pointer"
+					size="small"
+					clearable
+					placeholder="请输入设备ID"
+					@change="equipCheck()"
+					v-model="equipId"
+				>
+					<i slot="suffix" class="el-input__icon el-icon-search"></i>
+				</el-input>
+				<!-- <el-date-picker
+					style="cursor: pointer"
+					size="small"
+					v-model="timeRange"
+					@change="DateChange"
+					type="daterange"
+					range-separator="至"
+					start-placeholder="开始日期"
+					end-placeholder="结束日期"
+				></el-date-picker> -->
+			</div>
+			<div>
+				<el-button type="primary" @click="allSel" size="mini">{{
+					text
+				}}</el-button>
+				<el-button type="primary" @click="distSubm" size="mini"
+					>确定分配</el-button
+				>
+			</div>
+		</div>
+		<el-row :gutter="10">
+			<el-col
+				:xs="24"
+				:sm="24"
+				:md="12"
+				:lg="6"
+				:xl="4"
+				v-for="(item, index) in dataList"
+				:key="index"
+			>
+				<el-card
+					@click.native="itemFun(item)"
+					:class="['box-card', item.checked ? 'selected' : '']"
+				>
+					<el-checkbox
+						:ref="'checkboxRef'"
+						v-model="item.checked"
+						@click.native="stopDefault($event)"
+					></el-checkbox>
+					<div class="img-box">
+						<template>
+							<img
+								:src="
+									'http://www.hnyfwlw.com:8006/bigdata_pc/equipdistribute/2.png'
+								"
+							/>
+						</template>
+						<p>{{ item.device_id }}</p>
+					</div>
+					<div class="detail">
+                        <p :title="item.equip_name">
+							设备名称
+							<span>{{ (item.equip_name || '无') | ellipsis }}</span>
+						</p>
+                        <p>
+							设备ID
+							<span>{{ item.equip_id }}</span>
+						</p>
+						<p>
+							设备类型
+							<span>杀虫灯</span>
+						</p>
+					</div>
+				</el-card>
+			</el-col>
+		</el-row>
+		<!-- 暂无数据 -->
+		<div class="expertDiagnosis_referral_units_not" v-if="dataList.length <= 0">
+			<img
+				src="../../../../static/images/cure/zanwu.png"
+				alt
+				class="expertDiagnosis_referral_units_notImg"
+				style="margin: 0 0 0 40%;"
+			/>
+		</div>
+		<div class="userTip">
+			*注:以上所选设备分配给地块:{{ this.$route.query.plot_name }}
+		</div>
+		<el-pagination
+			v-if="dataList.length > 0"
+			background
+			:page-size="12"
+			layout="prev, pager, next"
+			:current-page="page"
+			:total="totalNum"
+			@current-change="changePage"
+		></el-pagination>
+	</div>
+</template>
+
+<script>
+export default {
+	filters: {
+		ellipsis(value) {
+			if (!value) return ''
+			if (value.length > 10) {
+				return value.slice(0, 10) + '...'
+			}
+			return value
+		}
+	},
+	props: {
+		flag: {
+			flag: Boolean,
+			siteID: Number
+		}
+	},
+	data() {
+		return {
+			uid: this.$route.query.plot_id,
+			timeRange: '',
+			equipId: '',
+			begin: '',
+			end: '',
+			type: '',
+			dataList: [],
+			own_device: [],
+			device_ids: [], //选中的所有设备ID
+			page: 1,
+			totalNum: 0,
+			equipID: [],
+			text: '全选',
+			typelist: [] //该用户帐下所有的设备类型
+		}
+	},
+	mounted() {
+		this.getList();
+		// this.equipmenttypelist()
+	},
+	methods: {
+		getList() {
+			this.$axios({
+				method: 'get',
+				url: '/plot_equip',
+				params: {
+					page_size: 12,
+					equip_id: this.equipId,
+					plot_id: this.$route.query.plot_id,
+					page: this.page,
+                    equip_type: 'scd',
+				}
+			}).then((res) => {
+                console.log(res.data)
+				if (res.data.scd_list) {
+					let data = res.data.scd_list
+					this.dataList = data.map((item) => {
+						item.checked = item.own != 0 //device_user=0代表待分配
+						return item
+					})
+					this.own_device = res.data.own_list
+					this.totalNum = res.data.count
+				}
+			})
+		},
+		// DateChange(val) {
+		// 	if (this.timeRange) {
+		// 		this.begin = parseInt(new Date(this.timeRange[0]).getTime() / 1000)
+		// 		this.end = parseInt(new Date(this.timeRange[1]).getTime() / 1000)
+		// 		this.page = 1
+		// 		this.getList()
+		// 	} else {
+		// 		this.begin = ''
+		// 		this.end = ''
+		// 		this.getList()
+		// 	}
+		// },
+		changePage(val) {
+			this.page = val
+			this.getList()
+		},
+		distSubm() {
+			this.dataList.forEach((item) => {
+				if (item.checked == true) {
+					this.device_ids.push(item.d_id)
+				} else {
+					for (let i = 0; i < this.own_device.length; i++) {
+						if (item.d_id == this.own_device[i]) {
+							this.own_device.splice(i, 1)
+						}
+					}
+				}
+			})
+			this.device_ids = this.device_ids.concat(this.own_device)
+			this.device_ids = [...new Set(this.device_ids)] //数组去重
+
+            console.log(this.device_ids.join(','))
+            console.log(this.uid)
+
+			this.$axios({
+				method: 'POST',
+				url: '/plot_equip',
+				data: this.qs.stringify({
+					device_ids: this.device_ids.join(','),
+					plot_id: this.uid,
+                    equip_type: 'scd',
+				})
+			}).then((res) => {
+                console.log(res.data)
+				if (res.data == '分配成功') {
+					this.$message.success('分配设备成功!')
+				}
+				this.device_ids = []
+			})
+		},
+		equipCheck() {
+			this.page = 1
+			this.getList()
+		},
+		stopDefault(e) {
+			e.stopPropagation()
+		},
+		itemFun(item) {
+			item.checked = !item.checked
+		},
+		allSel() {
+			if (this.text == '全选') {
+				this.text = '取消全选'
+				this.dataList = this.dataList.map((item) => {
+					item.checked = true
+					return item
+				})
+			} else {
+				this.text = '全选'
+				this.dataList = this.dataList.map((item) => {
+					item.checked = false
+					return item
+				})
+			}
+		},
+		equipmenttypelist() {
+			this.$axios({
+				method: 'POST',
+				url: '/api/api_gateway?method=home.homes.user_device_type'
+			}).then((res) => {
+				this.typelist = res.data.data
+				var obj = {
+					id: 0,
+					type_name: '全部'
+				}
+				this.typelist.unshift(obj)
+				console.log(this.typelist)
+			})
+		},
+
+		// 返回到杀虫灯设备列表
+		toscdList() {
+			this.$route.push({
+				path: `/index/scdList`,
+				query: {
+					plot_id: this.$route.query.plot_id,
+					site_id: this.$route.query.site_id
+				}
+			})
+		}
+	}
+}
+</script>
+
+<style lang='less' scoped>
+.search-box {
+	display: flex;
+	justify-content: flex-left;
+	justify-content: space-between;
+	margin-bottom: 10px;
+	.filter-box > div {
+		margin-right: 15px;
+	}
+	.el-input {
+		width: 200px;
+	}
+	.el-date-editor--daterange {
+		width: 222px;
+	}
+}
+.el-card.selected {
+	border: 1px solid #14a478;
+}
+.el-card {
+	box-sizing: border-box;
+	.img-box {
+		text-align: center;
+		border-bottom: 1px solid #eee;
+		padding: 15px 0;
+		img {
+			height: 45px;
+		}
+		p {
+			font-size: 14px;
+			font-weight: 800;
+			margin-top: 10px;
+		}
+	}
+	.detail {
+		border-bottom: 1px solid #eee;
+		padding: 10px 0;
+		p {
+			display: flex;
+			justify-content: space-between;
+			font-size: 13px;
+			line-height: 34px;
+			color: #666;
+			padding: 0 0px;
+		}
+	}
+}
+.userTip {
+	text-align: left;
+	font-size: 14px;
+}
+.breadcrumb_tab {
+	top: 60px !important;
+}
+</style>

+ 55 - 15
bigdata2/src/pages/equipmanger/EquipList.vue

@@ -1,6 +1,6 @@
 <template>
 	<div>
-		<el-breadcrumb separator-class="el-icon-arrow-right">
+		<el-breadcrumb separator-class="el-icon-arrow-right" :class="'el-icon-arrow-right '+ (flag.flag == false ? 'breadcrumb_tab' : '')">
 			<el-breadcrumb-item>设备管理</el-breadcrumb-item>
 		</el-breadcrumb>
 		<div class="search-box">
@@ -89,11 +89,11 @@
 						</p>
 						<p>
 							适配用户
-							<span>{{ item.equip_user || '无' }}</span>
+							<span :title="item.equip_user">{{ (item.equip_user || '无') | ellipsis }}</span>
 						</p>
 						<p>
 							设备名称
-							<span>{{ item.equip_name || '无' }}</span>
+							<span :title="item.equip_name">{{ (item.equip_name || '无') | ellipsis }}</span>
 						</p>
 						<p>
 							设备添加时间
@@ -120,8 +120,9 @@
 			v-if="dataList.length > 0"
 			background
 			layout="prev, pager, next"
-			:page-size="8"
+			:page-size="12"
 			:total="totalNum"
+			:current-page="queryInfo.page"
 			@current-change="changePage"
 		></el-pagination>
 		<!-- 添加定位弹框 -->
@@ -179,6 +180,21 @@
 
 <script>
 export default {
+	props: {
+		flag: {
+			flag: Boolean,
+			siteID: Number
+		},
+	},
+	filters: {
+		ellipsis(value) {
+			if (!value) return ''
+			if (value.length > 10) {
+				return value.slice(0, 10) + '...'
+			}
+			return value
+		}
+	},
 	data() {
 		return {
 			timeRange: '',
@@ -200,26 +216,42 @@ export default {
 			mapZoom: 6,
 			point: { lng: '', lat: '' },
 			center: { lng: '', lat: '' },
-			addLocationDialogVisible: false
+			addLocationDialogVisible: false,
+			objData: {},
 		}
 	},
 	mounted() {
-		this.getList()
+		this.getEquipList()
 	},
 	beforeMount() {},
 	methods: {
 		//获取设备列表
-		getList() {
+		getEquipList(obj, page) {
+			console.log(obj)
+			if (obj) {
+				console.log(obj)
+				this.queryInfo.page = page
+				this.objData = obj
+			}
+
+			var id = ''
+			if (this.objData !== undefined) {
+				id = this.objData.id
+			} else if (obj !== undefined) {
+				id = obj.id
+			}
 			this.$axios({
 				method: 'POST',
 				url: '/equiplist_filter',
 				data: this.qs.stringify({
 					f_type: this.queryInfo.device_type_id,
 					f_id: this.queryInfo.f_id,
-					page_size:8,
+					page_size: 12,
 					f_tbegin: this.queryInfo.start_time,
 					f_tend: this.queryInfo.end_time,
 					page: this.queryInfo.page,
+					// site_id: obj == undefined ? '' : obj.id,
+					site_id: id,
 				})
 			}).then((res) => {
 				this.dataList = res.data.dat
@@ -228,18 +260,22 @@ export default {
 		},
 		searchChange() {
 			this.queryInfo.page = 1
-			this.getList()
+			this.getEquipList()
 		},
 		DateChange(val) {
 			this.queryInfo.page = 1
 			if (this.timeRange) {
-				this.queryInfo.start_time = new Date(this.timeRange[0]).toLocaleDateString().replace(/\//g,'-'); 
-				this.queryInfo.end_time = new Date(this.timeRange[1]).toLocaleDateString().replace(/\//g,'-'); 
-				this.getList()
+				this.queryInfo.start_time = new Date(this.timeRange[0])
+					.toLocaleDateString()
+					.replace(/\//g, '-')
+				this.queryInfo.end_time = new Date(this.timeRange[1])
+					.toLocaleDateString()
+					.replace(/\//g, '-')
+				this.getEquipList()
 			} else {
 				this.queryInfo.start_time = ''
 				this.queryInfo.end_time = ''
-				this.getList()
+				this.getEquipList()
 			}
 		},
 		//在地图中点击定位
@@ -320,7 +356,7 @@ export default {
 		changePage(val) {
 			console.log(val)
 			this.queryInfo.page = val
-			this.getList()
+			this.getEquipList()
 		},
 		//关闭定位弹框时调用
 		addLocationDialogClosed() {
@@ -345,7 +381,7 @@ export default {
 				})
 			}).then((res) => {
 				if (res.data.message == '') {
-					this.getList()
+					this.getEquipList()
 					this.$message({
 						type: 'success',
 						message: '定位成功'
@@ -438,4 +474,8 @@ export default {
 	width: 272px;
 	margin: 0 auto;
 }
+
+.breadcrumb_tab {
+	top: 60px !important;
+}
 </style>

+ 41 - 8
bigdata2/src/pages/forecasting/bzy/Bzy.vue

@@ -1,6 +1,6 @@
 <template>
 	<div>
-		<el-breadcrumb separator-class="el-icon-arrow-right">
+		<el-breadcrumb separator-class="el-icon-arrow-right" :class="'el-icon-arrow-right '+ (flag.flag == false ? 'breadcrumb_tab' : '')">
 			<el-breadcrumb-item>植物孢子捕捉仪</el-breadcrumb-item>
 		</el-breadcrumb>
 		<div class="check-btns">
@@ -45,16 +45,17 @@
 					<el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6" v-for="item in equipList" :key="item.id">
 						<el-card class="box-card">
 							<equip-item :is_online="item.device_status">
-								<span slot="title">孢子仪</span>
+								<!-- <span slot="title">孢子仪</span> -->
+								<span slot="title">{{(item.device_name==""?"无":item.device_name) | ellipsis}}</span>
 								<div slot="content" class="content">
 									<p>
 										<i class="iconfont icon-yonghu"></i>
 										设备ID:{{item.device_id}}
 									</p>
-									<p>
+									<!-- <p :title="item.device_name">
 										<i class="iconfont icon-biaoqian"></i>
-										设备名称:{{item.device_name==""?"无":item.device_name}}
-									</p>
+										设备名称:{{(item.device_name==""?"无":item.device_name) | ellipsis}}
+									</p> -->
 									<p class="onlineState">
 										<i class="iconfont icon-diannao"></i>在线状态:
 										<span
@@ -400,6 +401,12 @@
 import SearchBar from '@/components/SearchBar'
 import EquipItem from '@/components/EquipItem'
 export default {
+	props: {
+		flag: {
+			flag: Boolean,
+			siteID: Number
+		},
+	},
 	data() {
 		return {
 			tableLoading : false,
@@ -452,7 +459,8 @@ export default {
 				data_usage: 0, //当月用量
 				data_balance: 0, //剩余流量
 				expiry_date: 0 //到期日期
-			}
+			},
+			objData: {},
 		}
 	},
 	mounted() {
@@ -506,7 +514,19 @@ export default {
 			this.displayType = data
 		},
 		//获取设备列表
-		getEquipList() {
+		getEquipList(obj, page) {
+			if (obj) {
+				console.log(obj)
+				this.queryInfo.page = page
+				this.objData = obj
+			}
+
+			var id = ''
+			if (this.objData !== undefined) {
+				id = this.objData.id
+			} else if (obj !== undefined) {
+				id = obj.id
+			}
 			this.tableLoading = true;
 			this.$axios({
 				method: 'POST',
@@ -516,6 +536,8 @@ export default {
 					ename: this.queryInfo.ename,
 					page: this.queryInfo.page,
 					f_id:this.queryInfo.f_id,
+					// site_id: obj == undefined ? '' : obj.id,
+					site_id: id,
 				})
 			}).then((res) => {
 				this.tableLoading = false;
@@ -795,7 +817,14 @@ export default {
 				case 7:
 					return '销号'
 			}
-		}
+		},
+		ellipsis(value) {
+			if (!value) return ''
+			if (value.length > 20) {
+				return value.slice(0, 20) + '...'
+			}
+			return value
+		},
 	},
 	components: {
 		SearchBar,
@@ -888,4 +917,8 @@ export default {
 	width: 272px;
 	margin: 0 auto;
 }
+
+.breadcrumb_tab {
+	top: 60px !important;
+}
 </style>

+ 12 - 1
bigdata2/src/pages/forecasting/bzy/BzyPhotos.vue

@@ -1,6 +1,6 @@
 <template>
 	<div>
-		<el-breadcrumb separator-class="el-icon-arrow-right">
+		<el-breadcrumb separator-class="el-icon-arrow-right" :class="'el-icon-arrow-right '+ (flag.flag == false ? 'breadcrumb_tab' : '')">
 			<el-breadcrumb-item :to="{ path: '/index/bzy' }">植物孢子捕捉仪</el-breadcrumb-item>
 			<el-breadcrumb-item>查看图片</el-breadcrumb-item>
 		</el-breadcrumb>
@@ -54,6 +54,13 @@
 </template>
 <script>
 export default {
+	// props: ['flag'],
+	props: {
+		flag: {
+			flag: Boolean,
+			siteID: Number
+		},
+	},
 	data() {
 		return {
 			totalNum: 0,
@@ -290,4 +297,8 @@ export default {
 		display: block;
 	}
 }
+
+.breadcrumb_tab {
+	top: 60px !important;
+}
 </style>

+ 11 - 1
bigdata2/src/pages/forecasting/bzy/DataDetail.vue

@@ -1,6 +1,6 @@
 <template>
 	<div>
-		<el-breadcrumb separator-class="el-icon-arrow-right">
+		<el-breadcrumb separator-class="el-icon-arrow-right" :class="'el-icon-arrow-right '+ (flag.flag == false ? 'breadcrumb_tab' : '')">
 			<el-breadcrumb-item :to="{ path: '/index/bzy' }">植物孢子捕捉仪</el-breadcrumb-item>
 			<el-breadcrumb-item>数据详情</el-breadcrumb-item>
 		</el-breadcrumb>
@@ -64,6 +64,12 @@
 <script>
 import DateSearch from '@/components/DateSearch'
 export default {
+	props: {
+		flag: {
+			flag: Boolean,
+			siteID: Number
+		},
+	},
 	data() {
 		return {
 			loading:true,
@@ -432,4 +438,8 @@ export default {
 .ctrl-check {
 	margin-bottom: 20px;
 }
+
+.breadcrumb_tab {
+	top: 60px !important;
+}
 </style>

+ 386 - 167
bigdata2/src/pages/forecasting/cbd/Cbd.vue

@@ -1,47 +1,103 @@
 <template>
 	<div v-loading="pageLoading">
-		<el-breadcrumb separator-class="el-icon-arrow-right">
+		<el-breadcrumb
+			separator-class="el-icon-arrow-right"
+			:class="'el-icon-arrow-right ' + (flag.flag == false ? 'breadcrumb_tab' : '')"
+		>
 			<el-breadcrumb-item>物联网虫情测报</el-breadcrumb-item>
 		</el-breadcrumb>
-		<search-bar @fun="getDisplayType" @fun2="getIDName" @fun3="getIsOnline"></search-bar>
+		<search-bar
+			@fun="getDisplayType"
+			@fun2="getIDName"
+			@fun3="getIsOnline"
+		></search-bar>
 		<div v-loading="tableLoading">
-			<template v-if="displayType==1">
+			<template v-if="displayType == 1">
 				<el-row :gutter="10">
-					<el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="6" v-for="item in equipList" :key="item.imei">
+					<el-col
+						:xs="24"
+						:sm="24"
+						:md="12"
+						:lg="8"
+						:xl="6"
+						v-for="item in equipList"
+						:key="item.imei"
+					>
 						<el-card class="box-card">
 							<equip-item :is_online="item.device_status">
-								
-								<span slot="title">虫情测报</span>
+								<!-- <span slot="title">虫情测报</span> -->
+								<span slot="title">{{
+									(item.device_name == '' ? '无' : item.device_name) | ellipsis
+								}}</span>
 								<div slot="content" class="content">
 									<p>
 										<i class="iconfont icon-yonghu"></i>
-										设备ID:{{item.device_id}}
+										设备ID:{{ item.device_id }}
 									</p>
-									<p>
+									<!-- <p :title="item.device_name">
 										<i class="iconfont icon-biaoqian"></i>
-										设备名称:{{item.device_name==""?"无":item.device_name}}
-									</p>
+										设备名称:{{
+											(item.device_name == '' ? '无' : item.device_name)
+												| ellipsis
+										}}
+									</p> -->
 									<p class="onlineState">
 										<i class="iconfont icon-diannao"></i>在线状态:
 										<span
-											:class="{red:item.device_status==0,green:item.device_status==1}"
-										>{{item.device_status==0?"离线":"在线"}}</span>
+											:class="{
+												red: item.device_status == 0,
+												green: item.device_status == 1
+											}"
+											>{{ item.device_status == 0 ? '离线' : '在线' }}</span
+										>
 									</p>
 									<p>
 										<i class="iconfont icon-shijian"></i>
-										最新上报时间 : {{item.status_time}}
+										最新上报时间 : {{ item.status_time }}
 									</p>
 									<p>
 										<i class="iconfont icon-dizhi"></i>
-										地址 : {{item.address || "无"}}
+										地址 : {{ item.address || '无' }}
 									</p>
 									<p class="btns">
 										<i class="iconfont icon-yemiancaozuo"></i>
-										<el-button size="mini" type="info" @click="viewPhotoDialog(item.device_id,item.d_id)">查看图片</el-button>
-										<el-button size="mini" type="warning" @click="EquipControl(item.device_id)">设备控制</el-button>
+										<el-button
+											size="mini"
+											type="info"
+											@click="viewPhotoDialog(item.device_id, item.d_id)"
+											>查看图片</el-button
+										>
+										<el-button
+											size="mini"
+											type="warning"
+											@click="EquipControl(item.device_id)"
+											>设备控制</el-button
+										>
 										<!-- <el-button size="mini" type="success" v-if="item.disc==1" @click="showTimeControlDialog(item.device_id)">害虫统计</el-button> -->
-										<el-button size="mini" type="success" @click="showTimeControlDialog(item.device_id,item.device_name,item.address)">害虫统计</el-button>
-										<el-button size="mini" type="danger" @click="dataDetails(item.device_id,item.device_name,item.address)">数据详情</el-button>
+										<el-button
+											size="mini"
+											type="success"
+											@click="
+												showTimeControlDialog(
+													item.device_id,
+													item.device_name,
+													item.address
+												)
+											"
+											>害虫统计</el-button
+										>
+										<el-button
+											size="mini"
+											type="danger"
+											@click="
+												dataDetails(
+													item.device_id,
+													item.device_name,
+													item.address
+												)
+											"
+											>数据详情</el-button
+										>
 									</p>
 								</div>
 							</equip-item>
@@ -49,46 +105,85 @@
 					</el-col>
 				</el-row>
 			</template>
-			<template v-if="displayType==2">
-				<el-card class="box-card" >
+			<template v-if="displayType == 2">
+				<el-card class="box-card">
 					<el-table :data="equipList" stripe style="width: 100%">
 						<el-table-column prop="device_id" label="设备ID" width="180">
-							<template slot-scope="scope">{{scope.row.device_id}}</template>
+							<template slot-scope="scope">{{ scope.row.device_id }}</template>
 						</el-table-column>
 						<el-table-column prop="device_name" label="设备名称" width="180">
-							<template slot-scope="scope">{{scope.row.device_name==""?"无":scope.row.device_name}}</template>
+							<template slot-scope="scope">{{
+								scope.row.device_name == '' ? '无' : scope.row.device_name
+							}}</template>
 						</el-table-column>
 						<el-table-column prop="device_status" label="在线状态">
 							<template slot-scope="scope">
-								<p style="color:#17bb89" v-if="scope.row.device_status==1">在线</p>
-								<p style="color:#eb6765" v-if="scope.row.device_status==0">离线</p>
+								<p style="color: #17bb89" v-if="scope.row.device_status == 1">
+									在线
+								</p>
+								<p style="color: #eb6765" v-if="scope.row.device_status == 0">
+									离线
+								</p>
+							</template>
+						</el-table-column>
+						<el-table-column prop="address" label="地址">
+							<template slot-scope="scope">
+								{{ scope.row.address == '' ? '暂无地址' : scope.row.address }}
 							</template>
 						</el-table-column>
-						<el-table-column prop="address" label="地址"></el-table-column>
 						<el-table-column prop="status_time" label="最新上报时间">
-							<template slot-scope="scope">{{scope.row.status_time}}</template>
+							<template slot-scope="scope">{{
+								scope.row.status_time
+							}}</template>
 						</el-table-column>
 						<el-table-column label="操作" width="400">
 							<template slot-scope="scope">
-								<el-button size="mini" type="info" @click="viewPhotoDialog(scope.row.device_id,scope.row.d_id)">查看图片</el-button>
-								<el-button size="mini" type="warning" @click="EquipControl(scope.row.d_id)">设备控制</el-button>
+								<el-button
+									size="mini"
+									type="info"
+									@click="viewPhotoDialog(scope.row.device_id, scope.row.d_id)"
+									>查看图片</el-button
+								>
+								<el-button
+									size="mini"
+									type="warning"
+									@click="EquipControl(scope.row.d_id)"
+									>设备控制</el-button
+								>
 								<el-button
 									size="mini"
 									type="success"
-									@click="showTimeControlDialog(scope.row.device_id,scope.row.device_name,scope.row.address)"
-								>害虫统计</el-button>
+									@click="
+										showTimeControlDialog(
+											scope.row.device_id,
+											scope.row.device_name,
+											scope.row.address
+										)
+									"
+									>害虫统计</el-button
+								>
 								<el-button
 									size="mini"
 									type="danger"
-									@click="dataDetails(scope.row.device_id,scope.row.device_name,scope.row.address)"
-								>数据详情</el-button>
+									@click="
+										dataDetails(
+											scope.row.device_id,
+											scope.row.device_name,
+											scope.row.address
+										)
+									"
+									>数据详情</el-button
+								>
 							</template>
 						</el-table-column>
 					</el-table>
 				</el-card>
 			</template>
 			<!-- 暂无数据 -->
-			<div class="expertDiagnosis_referral_units_not" v-if="equipList.length<=0 && displayType==1">
+			<div
+				class="expertDiagnosis_referral_units_not"
+				v-if="equipList.length <= 0 && displayType == 1"
+			>
 				<img
 					src="@/assets/images/zanwu.png"
 					alt
@@ -96,10 +191,9 @@
 				/>
 			</div>
 		</div>
-		
-		
+
 		<el-pagination
-			v-if="equipList.length>0"
+			v-if="equipList.length > 0"
 			background
 			:page-size="8"
 			layout="prev, pager, next"
@@ -122,27 +216,38 @@
 					label-width="120px"
 				>
 					<el-form-item label="工作模式:" prop="ws">
-						<el-select v-model="ws" placeholder="请选择害虫名称" @change="wsChange()">
+						<el-select
+							v-model="ws"
+							placeholder="请选择害虫名称"
+							@change="wsChange()"
+						>
 							<el-option label="节能" :value="0"></el-option>
 							<el-option label="常规" :value="1"></el-option>
 							<el-option label="加强" :value="2"></el-option>
 						</el-select>
 					</el-form-item>
 					<el-form-item label="定时模式:" prop="ts">
-						<el-select v-model="equipContrlForm.ts" placeholder="请选择害虫名称">
+						<el-select
+							v-model="equipContrlForm.ts"
+							placeholder="请选择害虫名称"
+						>
 							<el-option label="光控" :value="0"></el-option>
 							<el-option label="时控" :value="1"></el-option>
 						</el-select>
 					</el-form-item>
-					<el-form-item v-if="equipContrlForm.ts==1" label="开始结束时间:" prop="st">
+					<el-form-item
+						v-if="equipContrlForm.ts == 1"
+						label="开始结束时间:"
+						prop="st"
+					>
 						<el-col :span="11">
 							<el-time-select
 								placeholder="起始时间"
 								v-model="equipContrlForm.st"
 								:picker-options="{
-								start: '00:00',
-								step: '01:00',
-								end: '24:00'
+									start: '00:00',
+									step: '01:00',
+									end: '24:00'
 								}"
 							></el-time-select>
 						</el-col>
@@ -152,72 +257,119 @@
 								placeholder="结束时间"
 								v-model="equipContrlForm.et"
 								:picker-options="{
-								start: '00:00',
-								step: '01:00',
-								end: '24:00',
+									start: '00:00',
+									step: '01:00',
+									end: '24:00'
 								}"
 							></el-time-select>
 						</el-col>
 					</el-form-item>
-					<el-form-item  v-if="equipContrlForm.ts!=1" label="定时时长:" prop="tt">
+					<el-form-item
+						v-if="equipContrlForm.ts != 1"
+						label="定时时长:"
+						prop="tt"
+					>
 						<div class="sliderParent">
 							<div class="block">
-								<el-slider v-model="equipContrlForm.tt" show-input :min="1" :max="10"></el-slider>
+								<el-slider
+									v-model="equipContrlForm.tt"
+									show-input
+									:min="1"
+									:max="10"
+								></el-slider>
 							</div>
 						</div>
 					</el-form-item>
 					<el-form-item label="落虫时间:" prop="collt">
 						<div class="sliderParent">
 							<div class="block">
-								<el-slider v-model="equipContrlForm.collt" show-input :min="1" :max="20"></el-slider>
+								<el-slider
+									v-model="equipContrlForm.collt"
+									show-input
+									:min="1"
+									:max="20"
+								></el-slider>
 							</div>
 						</div>
 					</el-form-item>
 					<el-form-item label="加热时间:" prop="htim">
 						<div class="sliderParent">
 							<div class="block">
-								<el-slider v-model="equipContrlForm.htim" show-input :min="1" :max="20"></el-slider>
+								<el-slider
+									v-model="equipContrlForm.htim"
+									show-input
+									:min="1"
+									:max="20"
+								></el-slider>
 							</div>
 						</div>
 					</el-form-item>
 					<el-form-item label="加热温度:" prop="hst">
 						<div class="sliderParent">
 							<div class="block">
-								<el-slider v-model="equipContrlForm.hst" show-input :min="75" :max="120"></el-slider>
+								<el-slider
+									v-model="equipContrlForm.hst"
+									show-input
+									:min="75"
+									:max="120"
+								></el-slider>
 							</div>
 						</div>
 					</el-form-item>
 					<el-form-item label="高温保护阈值:" prop="tph">
 						<div class="sliderParent">
 							<div class="block">
-								<el-slider v-model="equipContrlForm.tph" show-input :min="50" :max="70"></el-slider>
+								<el-slider
+									v-model="equipContrlForm.tph"
+									show-input
+									:min="50"
+									:max="70"
+								></el-slider>
 							</div>
 						</div>
 					</el-form-item>
 					<el-form-item label="低温保护阈值:" prop="tpl">
 						<div class="sliderParent">
 							<div class="block">
-								<el-slider v-model="equipContrlForm.tpl" show-input :min="1" :max="10"></el-slider>
+								<el-slider
+									v-model="equipContrlForm.tpl"
+									show-input
+									:min="1"
+									:max="10"
+								></el-slider>
 							</div>
 						</div>
 					</el-form-item>
 					<el-form-item label="数据上传间隔:" prop="datt">
 						<div class="sliderParent">
 							<div class="block">
-								<el-slider v-model="equipContrlForm.datt" :step="10" show-input :min="10" :max="60"></el-slider>
+								<el-slider
+									v-model="equipContrlForm.datt"
+									:step="10"
+									show-input
+									:min="10"
+									:max="60"
+								></el-slider>
 							</div>
 						</div>
 					</el-form-item>
 					<el-form-item label="图片分辨率:" prop="imgres">
-						<el-select v-model="equipContrlForm.imgres" placeholder="请选择害虫名称">
+						<el-select
+							v-model="equipContrlForm.imgres"
+							placeholder="请选择害虫名称"
+						>
 							<el-option label="高" :value="0"></el-option>
 							<el-option label="中" :value="1"></el-option>
 							<el-option label="低" :value="2"></el-option>
 						</el-select>
 					</el-form-item>
 					<el-form-item class="handAddFormBtn">
-						<el-button type="primary" size="mini" @click="equipControlSubm()">确定</el-button>
-						<el-button size="mini" @click="equipControlDialogVisible = false">取消</el-button>
+						<el-button type="primary" size="mini" @click="equipControlSubm()"
+							>确定</el-button
+						>
+						<el-button size="mini" @click="equipControlDialogVisible = false"
+							>取消</el-button
+						>
 					</el-form-item>
 				</el-form>
 			</div>
@@ -226,11 +378,30 @@
 		<el-dialog title="信息" :visible.sync="operationDialogVisible" width="30%">
 			<el-divider content-position="left">强制操作</el-divider>
 			<el-row>
-				<el-button type="primary" size="mini" @click="equipBtnControl('takephoto')">拍照</el-button>
-				<el-button type="primary" size="mini" @click="equipBtnControl('update')">升级</el-button>
-				<el-button type="primary" size="mini" @click="equipBtnControl('reboot')">重启</el-button>
-				<el-button type="primary" size="mini" @click="equipBtnControl('open_shake')">震动开启</el-button>
-				<el-button type="primary" size="mini" @click="equipBtnControl('close_shake')">震动关闭</el-button>
+				<el-button
+					type="primary"
+					size="mini"
+					@click="equipBtnControl('takephoto')"
+					>拍照</el-button
+				>
+				<el-button type="primary" size="mini" @click="equipBtnControl('update')"
+					>升级</el-button
+				>
+				<el-button type="primary" size="mini" @click="equipBtnControl('reboot')"
+					>重启</el-button
+				>
+				<el-button
+					type="primary"
+					size="mini"
+					@click="equipBtnControl('open_shake')"
+					>震动开启</el-button
+				>
+				<el-button
+					type="primary"
+					size="mini"
+					@click="equipBtnControl('close_shake')"
+					>震动关闭</el-button
+				>
 			</el-row>
 			<el-divider content-position="left">板子设置</el-divider>
 			<el-row>
@@ -244,6 +415,12 @@
 import SearchBar from '@/components/SearchBar'
 import EquipItem from '@/components/EquipItem'
 export default {
+	props: {
+		flag: {
+			flag: Boolean,
+			siteID: Number
+		},
+	},
 	data() {
 		return {
 			//图表和表格切换
@@ -251,10 +428,10 @@ export default {
 			//设备列表
 			equipList: [],
 			// 设备加载loading
-			tableLoading : false,
-			pageLoading:false,
+			tableLoading: false,
+			pageLoading: false,
 			device_id: '',
-			currid:'',//选中配置设备id
+			currid: '', //选中配置设备id
 			ws: 0, //工作模式
 			equipContrlForm: {
 				st: '',
@@ -279,7 +456,8 @@ export default {
 			totalNum: 0,
 			//设备控制对话框
 			equipControlDialogVisible: false,
-			operationDialogVisible: false
+			operationDialogVisible: false,
+			objData: {}
 		}
 	},
 	mounted() {
@@ -307,8 +485,21 @@ export default {
 			this.displayType = data
 		},
 		//获取设备列表
-		getEquipList() {
-			this.tableLoading = true;
+		getEquipList(obj, page) {
+			console.log(obj)
+			if (obj) {
+				console.log(obj)
+				this.queryInfo.page = page
+				this.objData = obj
+			}
+
+			var id = ''
+			if (this.objData !== undefined) {
+				id = this.objData.id
+			} else if (obj !== undefined) {
+				id = obj.id
+			}
+			this.tableLoading = true
 			this.$axios({
 				method: 'POST',
 				url: '/equipmanage_cbd',
@@ -319,28 +510,33 @@ export default {
 					ename: this.queryInfo.ename,
 					f_id: this.queryInfo.f_id,
 					dver: this.queryInfo.dver,
+					// site_id: obj == undefined ? '' : obj.id,
+					site_id: id
 				})
-			}).then((res) => {
-				this.tableLoading = false;
-				if (res.status == 200) {
-					var dataArr = [];
-					var dat = res.data.dat;
-					for(var i = 0;i<dat.length;i++){
-						dataArr.push({
-							address: dat[i].locat,
-							device_id: dat[i].equip_id,
-							device_name: dat[i].equip_name,
-							device_status: parseInt(dat[i].is_online),
-							status_time: dat[i].upl_time,
-						})
+			}).then(
+				(res) => {
+					this.tableLoading = false
+					if (res.status == 200) {
+						var dataArr = []
+						var dat = res.data.dat
+						for (var i = 0; i < dat.length; i++) {
+							dataArr.push({
+								address: dat[i].locat,
+								device_id: dat[i].equip_id,
+								device_name: dat[i].equip_name,
+								device_status: parseInt(dat[i].is_online),
+								status_time: dat[i].upl_time
+							})
+						}
+						this.equipList = dataArr
+						this.totalNum = res.data.nums
 					}
-					this.equipList = dataArr
-					this.totalNum = res.data.nums
+				},
+				(error) => {
+					this.dataloading = false
+					this.$message.error('获取失败')
 				}
-			},error =>{
-				this.dataloading = false
-				this.$message.error('获取失败')
-			})
+			)
 		},
 		//改变page
 		changePage(val) {
@@ -348,103 +544,111 @@ export default {
 			this.getEquipList()
 		},
 		// 数据详情
-		dataDetails(e_id, name,address) {
+		dataDetails(e_id, name, address) {
 			this.device_id = e_id
-			this.$router.push({path:`/index/cbdDataDetails`,query:{id:e_id,name,address}})
+			this.$router.push({
+				path: `/index/cbdDataDetails`,
+				query: { id: e_id, name, address }
+			})
 		},
 		// 查看图片
-		viewPhotoDialog(id,d_id) {
+		viewPhotoDialog(id, d_id) {
 			this.device_id = id
-			this.$router.push({path:`/index/cbdDataPhotos/${id}`,query: {d_id:d_id}})
+			this.$router.push({
+				path: `/index/cbdDataPhotos/${id}`,
+				query: { d_id: d_id }
+			})
 		},
 		//设备控制
 		EquipControl(id) {
-			this.currid = id;
-			this.pageLoading = true;
+			this.currid = id
+			this.pageLoading = true
 			this.$axios({
 				method: 'POST',
-				url:
-					'/cbd_mqtt',
-				data: this.qs.stringify({ 
+				url: '/cbd_mqtt',
+				data: this.qs.stringify({
 					req: 'read',
 					topicid: id,
-					kind: 'paramconf',
+					kind: 'paramconf'
 				})
-			}).then((res) => {
-				if(res.data == 0){
-					setTimeout(() => {
-						this.$axios({
-							method: 'POST',
-							url:
-								'/equipmanage_cbd',
-							data: this.qs.stringify({
-								req: 'paramconf',
-								id: id,
-							})
-						}).then((res) => {
-							this.pageLoading = false;
-							if(res.data.paramconf){
-								this.equipContrlForm =  eval('('+res.data.paramconf+')')
-							}else{
-								this.equipContrlForm = {
-									collt: 10,
-									datt: 20,
-									et: 6,
-									hst: 85,
-									htim: 10,
-									shake: 0,
-									shake_sec: 1,
-									st: 20,
-									tph: 70,
-									tpl: 5,
-									ts: 1,
-									tt: 8,
-									imgres:1
-								 }
-							}
-							this.equipControlDialogVisible = true
-							
-						},error => {
-							this.pageLoading = false;
-							this.$message({
-								type: 'error',
-								message: '请求失败'
-							})
-						})
-						
-					},3000)
+			}).then(
+				(res) => {
+					if (res.data == 0) {
+						setTimeout(() => {
+							this.$axios({
+								method: 'POST',
+								url: '/equipmanage_cbd',
+								data: this.qs.stringify({
+									req: 'paramconf',
+									id: id
+								})
+							}).then(
+								(res) => {
+									this.pageLoading = false
+									if (res.data.paramconf) {
+										this.equipContrlForm = eval('(' + res.data.paramconf + ')')
+									} else {
+										this.equipContrlForm = {
+											collt: 10,
+											datt: 20,
+											et: 6,
+											hst: 85,
+											htim: 10,
+											shake: 0,
+											shake_sec: 1,
+											st: 20,
+											tph: 70,
+											tpl: 5,
+											ts: 1,
+											tt: 8,
+											imgres: 1
+										}
+									}
+									this.equipControlDialogVisible = true
+								},
+								(error) => {
+									this.pageLoading = false
+									this.$message({
+										type: 'error',
+										message: '请求失败'
+									})
+								}
+							)
+						}, 3000)
+					}
+				},
+				(error) => {
+					this.pageLoading = false
+					this.$message({
+						type: 'error',
+						message: '请求失败'
+					})
 				}
-			},error => {
-				this.pageLoading = false;
-				this.$message({
-					type: 'error',
-					message: '请求失败'
-				})
-			})
+			)
 		},
 		//设备控制提交
 		equipControlSubm() {
 			var dat = {
-				dropTime:this.equipContrlForm.collt,
-				dataUpTime:this.equipContrlForm.datt,
-				end:this.equipContrlForm.et,
-				calefactionTemperature:this.equipContrlForm.hst,
-				calefactionTime:this.equipContrlForm.htim,
-				begin:this.equipContrlForm.st,
-				highLimit:this.equipContrlForm.tph,
-				lowLimit:this.equipContrlForm.tpl,
-				timing:this.equipContrlForm.ts,
-				timingLength:this.equipContrlForm.tt,
-				imgres:this.equipContrlForm.imgres,
-				id:this.currid,
-				req:'set'
+				dropTime: this.equipContrlForm.collt,
+				dataUpTime: this.equipContrlForm.datt,
+				end: this.equipContrlForm.et,
+				calefactionTemperature: this.equipContrlForm.hst,
+				calefactionTime: this.equipContrlForm.htim,
+				begin: this.equipContrlForm.st,
+				highLimit: this.equipContrlForm.tph,
+				lowLimit: this.equipContrlForm.tpl,
+				timing: this.equipContrlForm.ts,
+				timingLength: this.equipContrlForm.tt,
+				imgres: this.equipContrlForm.imgres,
+				id: this.currid,
+				req: 'set'
 			}
 			this.$axios({
 				method: 'POST',
 				url: '/cbd_mqtt',
 				data: this.qs.stringify(dat)
 			}).then((res) => {
-				if (res.data==0) {
+				if (res.data == 0) {
 					this.$message.success('设备控制修改成功')
 					this.equipControlDialogVisible = false
 				} else {
@@ -457,11 +661,14 @@ export default {
 			this.ws = 0
 		},
 		//害虫统计
-		showTimeControlDialog(id,name,address) {
+		showTimeControlDialog(id, name, address) {
 			this.device_id = id
 			console.log(name)
 			console.log(address)
-			this.$router.push({path:'/index/pestsStats/',query:{id:id,name:name,address:address}})
+			this.$router.push({
+				path: '/index/pestsStats/',
+				query: { id: id, name: name, address: address }
+			})
 		},
 		//设备控制->工作模式切换
 		wsChange() {
@@ -507,8 +714,7 @@ export default {
 		equipBtnControl(cmd) {
 			this.$axios({
 				method: 'POST',
-				url:
-					'/api_gateway?method=forecast.send_control.admin_device_control',
+				url: '/api_gateway?method=forecast.send_control.admin_device_control',
 				data: this.qs.stringify({
 					cmd,
 					device_type_id: 3,
@@ -519,11 +725,20 @@ export default {
 					this.$message.success('指令下发成功!')
 				}
 			})
-		},
+		}
 	},
 	components: {
 		SearchBar,
 		EquipItem
+	},
+	filters: {
+		ellipsis(value) {
+			if (!value) return ''
+			if (value.length > 20) {
+				return value.slice(0, 20) + '...'
+			}
+			return value
+		}
 	}
 }
 </script>
@@ -623,12 +838,16 @@ export default {
 .el-select {
 	width: 100%;
 }
-.onlineState .icon-diannao{
-	margin: 0 21px 0 -2px!important;
+.onlineState .icon-diannao {
+	margin: 0 21px 0 -2px !important;
 }
 // 暂无数据
 .expertDiagnosis_referral_units_not {
 	width: 272px;
 	margin: 0 auto;
 }
+
+.breadcrumb_tab {
+	top: 60px !important;
+}
 </style>

+ 11 - 1
bigdata2/src/pages/forecasting/cbd/DataDetails.vue

@@ -1,6 +1,6 @@
 <template>
 	<div>
-		<el-breadcrumb separator-class="el-icon-arrow-right">
+		<el-breadcrumb separator-class="el-icon-arrow-right" :class="'el-icon-arrow-right '+ (flag.flag == false ? 'breadcrumb_tab' : '')">
 			<el-breadcrumb-item :to="{ path: '/index/cbd' }">物联网虫情测报</el-breadcrumb-item>
 			<el-breadcrumb-item>数据详情</el-breadcrumb-item>
 		</el-breadcrumb>
@@ -246,6 +246,12 @@
 <script>
 import DateSearch from '@/components/DateSearch'
 export default {
+	props: {
+		flag: {
+			flag: Boolean,
+			siteID: Number
+		},
+	},
 	data() {
 		return {
 			// 请求sim卡获取到需要回显的数据
@@ -757,4 +763,8 @@ export default {
 		text-align: right;
 	}
 }
+
+.breadcrumb_tab {
+	top: 60px !important;
+}
 </style>

+ 428 - 371
bigdata2/src/pages/forecasting/cbd/HistoryData.vue

@@ -1,380 +1,437 @@
 <template>
-   <div>
-      <el-breadcrumb separator-class="el-icon-arrow-right">
-        <el-breadcrumb-item>物联网虫情测报</el-breadcrumb-item>
-        <el-breadcrumb-item>害虫统计</el-breadcrumb-item>
-      </el-breadcrumb>
-      <div class="check-btns">
-            <div class="type-check">
-               <el-button :type="0==display?'primary':'default'"  size="mini" @click="displayCheck(0)">手动害虫统计</el-button>
-               <el-button :type="1==display?'primary':'default'" size="mini"  @click="displayCheck(1)">自动害虫统计</el-button>
-            </div>
-            <div class="time-check">
-               <el-button type="primary" size="mini">当天</el-button>
-                  <el-button  size="mini">近一月</el-button>
-                  <el-button  size="mini">近半年</el-button>
-                  <el-button  size="mini">近一年</el-button>
-               <el-date-picker
-                  size="small"
-                  align="right"
-                  v-model="timeRange"
-                  type="daterange"
-                  @change="timeRangChange"
-                  range-separator="至"
-                  start-placeholder="开始日期"
-                  end-placeholder="结束日期">
-               </el-date-picker>
-            </div>
-      </div>
-      <el-card class="box-card" v-if="showControl">
-          <el-table
-            :data="hisData"
-            stripe
-            style="width: 100%">
-            <el-table-column v-for="(item,index) in tableHead" :key="index" :width="item.property=='date'?'160px':''" :label="item.label" :prop="item.property">
-               <template slot-scope="scope">
-                     {{scope.row[scope.column.property]}}
-               </template>
-            </el-table-column>
-         </el-table>
-         <el-pagination
-            background
-            layout="prev, pager, next"
-            :total="total"
-            @prev-click="prevClick"
-            @next-click="nextClick"
-            @current-change="changePage">
-         </el-pagination>
-      </el-card>
-      <div v-if="!showControl">
-         <template v-if="isEchartData">
-         <el-row :gutter="30" type="flex" justify="space-between">
-            <el-col :span="8" v-for="(item,index) in echartOptions" :key="index">
-               <el-card class="box-card">
-                     <chart ref="chart1" :options="item" :auto-resize="true"></chart>
-               </el-card>
-            </el-col>
-         </el-row>
-        </template>
-         <template v-else>
-             <highcharts :options="options"></highcharts>
-            <el-card class="box-card">
-               <p style="text-align:center">暂无数据!</p>
-            </el-card>
-         </template>
-
-      </div>
-   </div>
+	<div>
+		<el-breadcrumb
+			separator-class="el-icon-arrow-right"
+			:class="
+				'el-icon-arrow-right ' + (flag.flag == false ? 'breadcrumb_tab' : '')
+			"
+		>
+			<el-breadcrumb-item>物联网虫情测报</el-breadcrumb-item>
+			<el-breadcrumb-item>害虫统计</el-breadcrumb-item>
+		</el-breadcrumb>
+		<div class="check-btns">
+			<div class="type-check">
+				<el-button
+					:type="0 == display ? 'primary' : 'default'"
+					size="mini"
+					@click="displayCheck(0)"
+					>手动害虫统计</el-button
+				>
+				<el-button
+					:type="1 == display ? 'primary' : 'default'"
+					size="mini"
+					@click="displayCheck(1)"
+					>自动害虫统计</el-button
+				>
+			</div>
+			<div class="time-check">
+				<el-button type="primary" size="mini">当天</el-button>
+				<el-button size="mini">近一月</el-button>
+				<el-button size="mini">近半年</el-button>
+				<el-button size="mini">近一年</el-button>
+				<el-date-picker
+					size="small"
+					align="right"
+					v-model="timeRange"
+					type="daterange"
+					@change="timeRangChange"
+					range-separator="至"
+					start-placeholder="开始日期"
+					end-placeholder="结束日期"
+				>
+				</el-date-picker>
+			</div>
+		</div>
+		<el-card class="box-card" v-if="showControl">
+			<el-table :data="hisData" stripe style="width: 100%">
+				<el-table-column
+					v-for="(item, index) in tableHead"
+					:key="index"
+					:width="item.property == 'date' ? '160px' : ''"
+					:label="item.label"
+					:prop="item.property"
+				>
+					<template slot-scope="scope">
+						{{ scope.row[scope.column.property] }}
+					</template>
+				</el-table-column>
+			</el-table>
+			<el-pagination
+				background
+				layout="prev, pager, next"
+				:total="total"
+				@prev-click="prevClick"
+				@next-click="nextClick"
+				@current-change="changePage"
+			>
+			</el-pagination>
+		</el-card>
+		<div v-if="!showControl">
+			<template v-if="isEchartData">
+				<el-row :gutter="30" type="flex" justify="space-between">
+					<el-col :span="8" v-for="(item, index) in echartOptions" :key="index">
+						<el-card class="box-card">
+							<chart ref="chart1" :options="item" :auto-resize="true"></chart>
+						</el-card>
+					</el-col>
+				</el-row>
+			</template>
+			<template v-else>
+				<highcharts :options="options"></highcharts>
+				<el-card class="box-card">
+					<p style="text-align: center">暂无数据!</p>
+				</el-card>
+			</template>
+		</div>
+	</div>
 </template>
 
 <script>
 var options = {
-    title: {
-      text: '2010 ~ 2016 年太阳能行业就业人员发展情况'
-    },
-    subtitle: {
-      text: '数据来源:thesolarfoundation.com'
-    },
-    yAxis: {
-      title: {
-        text: '就业人数'
-      }
-    },
-    legend: {
-      layout: 'vertical',
-      align: 'right',
-      verticalAlign: 'middle'
-    },
-    plotOptions: {
-      series: {
-        label: {
-          connectorAllowed: false
-        },
-        pointStart: 2010
-      }
-    },
-    series: [{
-      name: '安装,实施人员',
-      data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
-    }, {
-      name: '工人',
-      data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434]
-    }, {
-      name: '销售',
-      data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387]
-    }, {
-      name: '项目开发',
-      data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227]
-    }, {
-      name: '其他',
-      data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111]
-    }],
-    responsive: {
-      rules: [{
-        condition: {
-          maxWidth: 500
-        },
-        chartOptions: {
-          legend: {
-            layout: 'horizontal',
-            align: 'center',
-            verticalAlign: 'bottom'
-          }
-        }
-      }]
-    }
-  }
-   export default {
-      data(){
-         return {
-            options: options,
-            timeRange:'',
-            //总数据条数
-            total:0,
-            queryInfo:{
-               begin:'',
-               end:'',
-               e_id:this.$route.params.id,
-               page:1
-            },
-            queryInfoE:{
-               begin:'',
-               end:'',
-               e_id:this.$route.params.id
-            },
-            //图表实时否有数据
-            isEchartData:true,
-            //表格和图表按钮样式切换参数
-            display:"0", //0代表表格、1代表图表
-            // 表格和图表显示切换控制
-            showControl:true,
-            //echarts图表参数
-            echartOptions:[],
-            // 动态表头
-            tableHead:[],
-            // 表格数据
-            hisData:[]
-            }
-       },
-      created(){
-         this.getHisDataList();
-      },
-      mounted(){
-         // this.echartsFn(); 
-      },
-      methods:{
-         //获取历史数据
-         getHisDataList(){
-          this.$axios({
-             method:'POST',
-             url:'/qxz_data',
-             data:this.qs.stringify(this.queryInfo)
-          }).then((res)=>{
-            this.total=Number(res.data.nums);
-             if(res.data.nums>0){
-                let arr1=[{label:'日期',property:'date'}];
-                let arr2=[];
-                for(let i in res.data.conf){
-                  let obj={};
-                  if(res.data.conf[i]){
-                    let arr=res.data.conf[i].split('#');
-                        obj.label=`${arr[0]}(${arr[1]})`;
-                        obj.property=i;
-                        arr1.push(obj);
-                  }
-                }
-                  this.tableHead=arr1; 
-                  for(let item of res.data.data){
-                     let obj={};
-                     obj.date=item.time;
-                     for(let i1 in item.dat){
-                        if(item.dat[i1]){
-                           obj[i1]=item.dat[i1].split('#')[0];
-                        }
-                     }
-                     arr2.push(obj);
-                  }
-                  this.hisData=arr2;
-             }
-          })
-         },
-         //获取图表历史数据
-         getEchartsHisDataList(){
-           this.$axios({
-               method:'POST',
-               url:'/qxz_data_chart',
-               data:this.qs.stringify(this.queryInfoE)
-            }).then((res)=>{
-                   this.echartsFn(res.data); 
-             }).catch(()=>{
-                console.log("获取数据失败!")
-             })
-         },
-         echartsFn(data){
-            let legend={};
-            let time=[];
-            let seriesGroup={};
-            if(data.conf&&data.data&&data.data.length>0){   //如果图表数据不为空
-               for(let i in data.conf){    //对conf遍历
-                  if(data.conf[i]){
-                     legend[i]={          //图例对象,i代表title
-                        data:[`${data.conf[i].split('#')[0]}(${data.conf[i].split('#')[1]})`],
-                     }    
-                  }
-               }
-               for(let item of data.data){   //对data数据遍历
-                     time.unshift(item.time.split(" ")[1].split(":")[0]);
-                     for(let m in item.dat){
-                        if(legend[m]){
-                           if(seriesGroup[m]){
-                              if(item.dat[m].split('#')[0]==-99.99){
-                                 seriesGroup[m].data.unshift('N/A') 
-                              }else{
-                                 seriesGroup[m].data.unshift(item.dat[m].split('#')[0])
-                              }
-                           }else{
-                               if(item.dat[m].split('#')[0]==-99.99){
-                                 seriesGroup[m]={
-                                    data:['N/A']
-                                 };
-                               }else{
-                                 seriesGroup[m]={
-                                    data:[item.dat[m].split('#')[0]]
-                                 };
-                               }
-                           }
-                        }
-                         
-                     }
-               }
-               // console.log(seriesGroup);
-               console.log(time);
-               // console.log(legend);
-               this.echartOptions=[];
-               for(let i in legend){
-                  let obj=this.optionEchart(i,legend[i],time,seriesGroup[i]);
-                  this.echartOptions.unshift(obj);
-               }
-               // console.log(this.echartOptions)
-            }else{
-               this.isEchartData=false;
-            }
-         },
-         optionEchart(title,legend,time,seriesData){
-            return {
-                  color: ["#17BB89"],
-                  title:{
-                     text:title
-                  },
-                  tooltip: {
-                     trigger: 'axis'
-                  },
-                  legend: {
-                     data: legend.data
-                  },
-                  grid: {
-                     left: '0',
-                     right: '0',
-                     bottom: '0',
-                     height: '80%',
-                     containLabel: true
-                  },
-                  xAxis: {
-                     type: 'category',
-                     axisTick:{
-                        show:false   //x轴分割线
-                     },
-                     axisLabel:{
-                        color:'#C1C1C1'
-                     },
-                     axisLine:{
-                        lineStyle:{
-                           color:'#C1C1C1',
-                           type:'dashed'
-                        }
-                     },
-                     data:time
-                  },
-                  yAxis: {
-                     type: 'value',
-                     axisTick:{
-                        show:false
-                     },
-                     axisLine:{
-                        show:false,
-                        },
-                     splitLine:{
-                        show:true,
-                        lineStyle:{
-                           color:'#C1C1C1',
-                           type:'dashed'
-                        }
-                     },
-                     axisLabel:{
-                        color:'#C1C1C1'
-                     }
-                  },
-                  series: [{
-                     name:legend.data[0],
-                     data: seriesData.data,
-                     type: 'line'
-                  }]
-               };
-         },
-         //表格和图表切换
-         displayCheck(a){
-           this.display=a;
-           if(a==0){
-            this.timeRange='';
-             this.showControl=true;
-           }else if(a==1){
-             this.timeRange='';
-             this.showControl=false;
-             this.getEchartsHisDataList();  //渲染echarts
-           }
-         },
-         prevClick(val){
-            this.queryInfo.page--;
-            this.getHisDataList();
-         },
-         nextClick(val){
-            this.queryInfo.page++;
-            this.getHisDataList();
-         },
-         //改变page
-         changePage(val){
-            this.queryInfo.page=val;
-            this.getHisDataList();
-         },
-         timeRangChange(value){
-            console.log(value);
-            if(value&&value.length>0){
-               let begin=new Date(value[0]);
-               let end=new Date(value[1]);
-               Date.prototype.toLocaleString=function(){
-                  return this.getFullYear()+'-'+(this.getMonth()+1<10?'0'+this.getMonth()+1:this.getMonth()+1)+'-'+
-                  (this.getDate()<10?'0'+this.getDate():this.getDate())
-               }
-               if(this.display==0){
-                  this.queryInfo.begin=begin.toLocaleString();
-                  this.queryInfo.end=end.toLocaleString(); 
-                  this.getHisDataList();
-               }else if(this.display==1){
-                  this.queryInfoE.begin=begin.toLocaleString();
-                  this.queryInfoE.end=end.toLocaleString(); 
-                  this.getEchartsHisDataList();  
-               }
-            }else{
-               
-            }
-         }
-   
-      }
-            
-   }
+	title: {
+		text: '2010 ~ 2016 年太阳能行业就业人员发展情况'
+	},
+	subtitle: {
+		text: '数据来源:thesolarfoundation.com'
+	},
+	yAxis: {
+		title: {
+			text: '就业人数'
+		}
+	},
+	legend: {
+		layout: 'vertical',
+		align: 'right',
+		verticalAlign: 'middle'
+	},
+	plotOptions: {
+		series: {
+			label: {
+				connectorAllowed: false
+			},
+			pointStart: 2010
+		}
+	},
+	series: [
+		{
+			name: '安装,实施人员',
+			data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
+		},
+		{
+			name: '工人',
+			data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434]
+		},
+		{
+			name: '销售',
+			data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387]
+		},
+		{
+			name: '项目开发',
+			data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227]
+		},
+		{
+			name: '其他',
+			data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111]
+		}
+	],
+	responsive: {
+		rules: [
+			{
+				condition: {
+					maxWidth: 500
+				},
+				chartOptions: {
+					legend: {
+						layout: 'horizontal',
+						align: 'center',
+						verticalAlign: 'bottom'
+					}
+				}
+			}
+		]
+	}
+}
+export default {
+	props: {
+		flag: {
+			flag: Boolean,
+			siteID: Number
+		}
+	},
+	data() {
+		return {
+			options: options,
+			timeRange: '',
+			//总数据条数
+			total: 0,
+			queryInfo: {
+				begin: '',
+				end: '',
+				e_id: this.$route.params.id,
+				page: 1
+			},
+			queryInfoE: {
+				begin: '',
+				end: '',
+				e_id: this.$route.params.id
+			},
+			//图表实时否有数据
+			isEchartData: true,
+			//表格和图表按钮样式切换参数
+			display: '0', //0代表表格、1代表图表
+			// 表格和图表显示切换控制
+			showControl: true,
+			//echarts图表参数
+			echartOptions: [],
+			// 动态表头
+			tableHead: [],
+			// 表格数据
+			hisData: []
+		}
+	},
+	created() {
+		this.getHisDataList()
+	},
+	mounted() {
+		// this.echartsFn();
+	},
+	methods: {
+		//获取历史数据
+		getHisDataList() {
+			this.$axios({
+				method: 'POST',
+				url: '/qxz_data',
+				data: this.qs.stringify(this.queryInfo)
+			}).then((res) => {
+				this.total = Number(res.data.nums)
+				if (res.data.nums > 0) {
+					let arr1 = [{ label: '日期', property: 'date' }]
+					let arr2 = []
+					for (let i in res.data.conf) {
+						let obj = {}
+						if (res.data.conf[i]) {
+							let arr = res.data.conf[i].split('#')
+							obj.label = `${arr[0]}(${arr[1]})`
+							obj.property = i
+							arr1.push(obj)
+						}
+					}
+					this.tableHead = arr1
+					for (let item of res.data.data) {
+						let obj = {}
+						obj.date = item.time
+						for (let i1 in item.dat) {
+							if (item.dat[i1]) {
+								obj[i1] = item.dat[i1].split('#')[0]
+							}
+						}
+						arr2.push(obj)
+					}
+					this.hisData = arr2
+				}
+			})
+		},
+		//获取图表历史数据
+		getEchartsHisDataList() {
+			this.$axios({
+				method: 'POST',
+				url: '/qxz_data_chart',
+				data: this.qs.stringify(this.queryInfoE)
+			})
+				.then((res) => {
+					this.echartsFn(res.data)
+				})
+				.catch(() => {
+					console.log('获取数据失败!')
+				})
+		},
+		echartsFn(data) {
+			let legend = {}
+			let time = []
+			let seriesGroup = {}
+			if (data.conf && data.data && data.data.length > 0) {
+				//如果图表数据不为空
+				for (let i in data.conf) {
+					//对conf遍历
+					if (data.conf[i]) {
+						legend[i] = {
+							//图例对象,i代表title
+							data: [
+								`${data.conf[i].split('#')[0]}(${data.conf[i].split('#')[1]})`
+							]
+						}
+					}
+				}
+				for (let item of data.data) {
+					//对data数据遍历
+					time.unshift(item.time.split(' ')[1].split(':')[0])
+					for (let m in item.dat) {
+						if (legend[m]) {
+							if (seriesGroup[m]) {
+								if (item.dat[m].split('#')[0] == -99.99) {
+									seriesGroup[m].data.unshift('N/A')
+								} else {
+									seriesGroup[m].data.unshift(item.dat[m].split('#')[0])
+								}
+							} else {
+								if (item.dat[m].split('#')[0] == -99.99) {
+									seriesGroup[m] = {
+										data: ['N/A']
+									}
+								} else {
+									seriesGroup[m] = {
+										data: [item.dat[m].split('#')[0]]
+									}
+								}
+							}
+						}
+					}
+				}
+				// console.log(seriesGroup);
+				console.log(time)
+				// console.log(legend);
+				this.echartOptions = []
+				for (let i in legend) {
+					let obj = this.optionEchart(i, legend[i], time, seriesGroup[i])
+					this.echartOptions.unshift(obj)
+				}
+				// console.log(this.echartOptions)
+			} else {
+				this.isEchartData = false
+			}
+		},
+		optionEchart(title, legend, time, seriesData) {
+			return {
+				color: ['#17BB89'],
+				title: {
+					text: title
+				},
+				tooltip: {
+					trigger: 'axis'
+				},
+				legend: {
+					data: legend.data
+				},
+				grid: {
+					left: '0',
+					right: '0',
+					bottom: '0',
+					height: '80%',
+					containLabel: true
+				},
+				xAxis: {
+					type: 'category',
+					axisTick: {
+						show: false //x轴分割线
+					},
+					axisLabel: {
+						color: '#C1C1C1'
+					},
+					axisLine: {
+						lineStyle: {
+							color: '#C1C1C1',
+							type: 'dashed'
+						}
+					},
+					data: time
+				},
+				yAxis: {
+					type: 'value',
+					axisTick: {
+						show: false
+					},
+					axisLine: {
+						show: false
+					},
+					splitLine: {
+						show: true,
+						lineStyle: {
+							color: '#C1C1C1',
+							type: 'dashed'
+						}
+					},
+					axisLabel: {
+						color: '#C1C1C1'
+					}
+				},
+				series: [
+					{
+						name: legend.data[0],
+						data: seriesData.data,
+						type: 'line'
+					}
+				]
+			}
+		},
+		//表格和图表切换
+		displayCheck(a) {
+			this.display = a
+			if (a == 0) {
+				this.timeRange = ''
+				this.showControl = true
+			} else if (a == 1) {
+				this.timeRange = ''
+				this.showControl = false
+				this.getEchartsHisDataList() //渲染echarts
+			}
+		},
+		prevClick(val) {
+			this.queryInfo.page--
+			this.getHisDataList()
+		},
+		nextClick(val) {
+			this.queryInfo.page++
+			this.getHisDataList()
+		},
+		//改变page
+		changePage(val) {
+			this.queryInfo.page = val
+			this.getHisDataList()
+		},
+		timeRangChange(value) {
+			console.log(value)
+			if (value && value.length > 0) {
+				let begin = new Date(value[0])
+				let end = new Date(value[1])
+				Date.prototype.toLocaleString = function () {
+					return (
+						this.getFullYear() +
+						'-' +
+						(this.getMonth() + 1 < 10
+							? '0' + this.getMonth() + 1
+							: this.getMonth() + 1) +
+						'-' +
+						(this.getDate() < 10 ? '0' + this.getDate() : this.getDate())
+					)
+				}
+				if (this.display == 0) {
+					this.queryInfo.begin = begin.toLocaleString()
+					this.queryInfo.end = end.toLocaleString()
+					this.getHisDataList()
+				} else if (this.display == 1) {
+					this.queryInfoE.begin = begin.toLocaleString()
+					this.queryInfoE.end = end.toLocaleString()
+					this.getEchartsHisDataList()
+				}
+			} else {
+			}
+		}
+	}
+}
 </script>
 
 <style lang='less' scoped>
-.check-btns{display:flex;justify-content: space-between;margin-bottom:20px}
-.echarts{width:100%;height:300px}
+.check-btns {
+	display: flex;
+	justify-content: space-between;
+	margin-bottom: 20px;
+}
+.echarts {
+	width: 100%;
+	height: 300px;
+}
+
+.breadcrumb_tab {
+	top: 60px !important;
+}
 </style>

+ 11 - 1
bigdata2/src/pages/forecasting/cbd/MessageWarn.vue

@@ -1,6 +1,6 @@
 <template>
 	<div>
-		<el-breadcrumb separator-class="el-icon-arrow-right">
+		<el-breadcrumb separator-class="el-icon-arrow-right" :class="'el-icon-arrow-right '+ (flag.flag == false ? 'breadcrumb_tab' : '')">
 			<el-breadcrumb-item :to="{ path: '/index/cbd' }">物联网虫情测报</el-breadcrumb-item>
 			<el-breadcrumb-item>短信通知</el-breadcrumb-item>
 		</el-breadcrumb>
@@ -184,6 +184,12 @@
 <script>
 import dict from '../../../../static/js/cbd_pest_library.js'
 export default {
+	props: {
+		flag: {
+			flag: Boolean,
+			siteID: Number
+		},
+	},
 	data() {
 		return {
 			switch1: false,
@@ -636,4 +642,8 @@ export default {
 		}
 	}
 }
+
+.breadcrumb_tab {
+	top: 60px !important;
+}
 </style>

+ 11 - 1
bigdata2/src/pages/forecasting/cbd/PestsStats.vue

@@ -1,6 +1,6 @@
 <template>
 	<div>
-		<el-breadcrumb separator-class="el-icon-arrow-right">
+		<el-breadcrumb separator-class="el-icon-arrow-right" :class="'el-icon-arrow-right '+ (flag.flag == false ? 'breadcrumb_tab' : '')">
 			<el-breadcrumb-item :to="{ path: '/index/cbd' }">物联网虫情测报</el-breadcrumb-item>
 			<el-breadcrumb-item>害虫统计</el-breadcrumb-item>
 		</el-breadcrumb>
@@ -114,6 +114,12 @@
 import t from '../../../assets/ezuikit'
 import PestList from './cbd_pest_library.js' //注意路径
 export default {
+	props: {
+		flag: {
+			flag: Boolean,
+			siteID: Number
+		},
+	},
 	data() {
 		return {
 			id: this.$route.query.id,
@@ -688,4 +694,8 @@ export default {
 	line-height: 450px;
 	color: rgb(122, 115, 115);
 }
+
+.breadcrumb_tab {
+	top: 60px !important;
+}
 </style>

+ 11 - 1
bigdata2/src/pages/forecasting/cbd/cbdDataPhotos.vue

@@ -1,6 +1,6 @@
 <template>
 	<div>
-		<el-breadcrumb separator-class="el-icon-arrow-right">
+		<el-breadcrumb separator-class="el-icon-arrow-right" :class="'el-icon-arrow-right '+ (flag.flag == false ? 'breadcrumb_tab' : '')">
 			<el-breadcrumb-item :to="{ path: '/index/cbd' }"
 				>物联网虫情测报</el-breadcrumb-item
 			>
@@ -144,6 +144,12 @@
 <script>
 import PestList from './cbd_pest_library.js' //注意路径
 export default {
+	props: {
+		flag: {
+			flag: Boolean,
+			siteID: Number
+		},
+	},
 	data() {
 		return {
 			loading: false, //识别结果加载
@@ -669,4 +675,8 @@ export default {
 }
 
 // elementui加载样式
+
+.breadcrumb_tab {
+	top: 60px !important;
+}
 </style>

+ 168 - 104
bigdata2/src/pages/forecasting/xycb/xycb.vue

@@ -1,7 +1,7 @@
 <template>
 	<div>
-		<el-breadcrumb separator-class="el-icon-arrow-right">
-			<el-breadcrumb-item>智能性诱测报</el-breadcrumb-item>
+		<el-breadcrumb separator-class="el-icon-arrow-right" :class="'el-icon-arrow-right '+ (flag.flag == false ? 'breadcrumb_tab' : '')">
+			<el-breadcrumb-item>智能性诱测报 </el-breadcrumb-item>
 		</el-breadcrumb>
 		<SearchBar @fun="getDisplayType" @fun2="getIDName" @fun3="getIsOnline">
 		</SearchBar>
@@ -19,42 +19,59 @@
 					>
 						<el-card class="box-card">
 							<equip-item :is_online="item.is_online">
-								<span slot="title">性诱测报</span>
+								<!-- <span slot="title">性诱测报</span> -->
+								<span slot="title">{{ (item.equip_name || '无') | ellipsis }}</span>
 								<div slot="content" class="content">
 									<p>
 										<i class="iconfont icon-yonghu"></i>
-										设备ID:{{ item.imei}}
+										设备ID:{{ item.imei }}
 									</p>
-									<p>
+									<!-- <p :title="item.equip_name">
 										<i class="iconfont icon-biaoqian"></i>
-										设备名称:{{ item.equip_name||'无'}}
-									</p>
+										设备名称:{{ (item.equip_name || '无') | ellipsis }}
+									</p> -->
 									<p class="onlineState">
 										<i class="iconfont icon-diannao"></i>在线状态:
 										<span
 											:class="{
-												red: item.is_online  == 0,
-												green: item.is_online  == 1
+												red: item.is_online == 0,
+												green: item.is_online == 1
 											}"
 											>{{ item.is_online == 0 ? '离线' : '在线' }}</span
 										>
 									</p>
 									<p>
 										<i class="iconfont icon-shijian"></i>
-										最新上报时间 : {{item.upl_time}}
+										最新上报时间 : {{ item.upl_time }}
 									</p>
 									<p>
 										<i class="iconfont icon-chouchongbug"></i>
-										监测害虫名称 : {{item.pest_name||'未填写'}}
-										<span @click="setName(item.imei,item.pest_name)" class="el-icon-edit"></span>
+										监测害虫名称 : {{ item.pest_name || '未填写' }}
+										<span
+											@click="setName(item.imei, item.pest_name)"
+											class="el-icon-edit"
+										></span>
 									</p>
 									<p>
 										<i class="iconfont icon-shijian"></i>
-										诱芯更换时间 : {{item.core||'未填写'}}
-										<span @click="setTime(item.imei,item.core)" class="el-icon-edit"></span>
-										<span style="color:red" v-if="timeCalc(item.core) == 'null'">请及时设置</span> 
-										<span style="color:red" v-if="timeCalc(item.core) < 10 && timeCalc(item.core) > 0">剩余{{timeCalc(item.core)}}天,请更换</span> 
-										<span style="color:red" v-if="timeCalc(item.core) < 1">已过期请更换</span> 
+										诱芯更换时间 : {{ item.core || '未填写' }}
+										<span
+											@click="setTime(item.imei, item.core)"
+											class="el-icon-edit"
+										></span>
+										<span
+											style="color: red"
+											v-if="timeCalc(item.core) == 'null'"
+											>请及时设置</span
+										>
+										<span
+											style="color: red"
+											v-if="timeCalc(item.core) < 10 && timeCalc(item.core) > 0"
+											>剩余{{ timeCalc(item.core) }}天,请更换</span
+										>
+										<span style="color: red" v-if="timeCalc(item.core) < 1"
+											>已过期请更换</span
+										>
 									</p>
 									<p class="btns">
 										<i class="iconfont icon-yemiancaozuo"></i>
@@ -81,9 +98,7 @@
 				<el-card class="box-card">
 					<el-table :data="equipList" stripe style="width: 100%">
 						<el-table-column prop="imei" label="设备ID" width="180">
-							<template slot-scope="scope">{{
-								scope.row.imei
-							}}</template>
+							<template slot-scope="scope">{{ scope.row.imei }}</template>
 						</el-table-column>
 						<el-table-column prop="equip_name" label="设备名称" width="180">
 							<template slot-scope="scope">{{
@@ -107,13 +122,11 @@
 						</el-table-column>
 						<el-table-column prop="upl_time" label="诱芯更换时间">
 							<template slot-scope="scope">{{
-								scope.row.core || '未填写' 
+								scope.row.core || '未填写'
 							}}</template>
 						</el-table-column>
 						<el-table-column prop="upl_time" label="最新上报时间">
-							<template slot-scope="scope">{{
-								scope.row.upl_time
-							}}</template>
+							<template slot-scope="scope">{{ scope.row.upl_time }}</template>
 						</el-table-column>
 						<el-table-column label="操作" width="400">
 							<template slot-scope="scope">
@@ -126,9 +139,7 @@
 								<el-button
 									size="mini"
 									type="warning"
-									@click="
-										dataDetails(scope.row.imei, scope.row.equip_name)
-									"
+									@click="dataDetails(scope.row.imei, scope.row.equip_name)"
 									>数据详情</el-button
 								>
 							</template>
@@ -137,7 +148,10 @@
 				</el-card>
 			</template>
 			<!-- 暂无数据 -->
-			<div class="expertDiagnosis_referral_units_not" v-if="equipList.length<=0 && displayType==1">
+			<div
+				class="expertDiagnosis_referral_units_not"
+				v-if="equipList.length <= 0 && displayType == 1"
+			>
 				<img
 					src="@/assets/images/zanwu.png"
 					alt
@@ -146,7 +160,7 @@
 			</div>
 		</div>
 		<el-pagination
-			v-if="equipList.length>0"
+			v-if="equipList.length > 0"
 			background
 			:page-size="8"
 			layout="prev, pager, next"
@@ -208,7 +222,11 @@
 			</div>
 		</el-dialog>
 		<!-- 设置诱芯更换时间配置弹框 -->
-		<el-dialog title="设置监测害虫名称" :visible.sync="setNameDialogVisible" width="420px">
+		<el-dialog
+			title="设置监测害虫名称"
+			:visible.sync="setNameDialogVisible"
+			width="420px"
+		>
 			<el-form ref="form" :model="xyform" label-width="130px">
 				<el-form-item label="监测害虫名称:">
 					<el-input v-model="xyform.name"></el-input>
@@ -220,10 +238,19 @@
 			</span>
 		</el-dialog>
 		<!-- 设置诱芯更换时间配置弹框 -->
-		<el-dialog title="设置诱芯" :visible.sync="setTimeDialogVisible" width="420px">
+		<el-dialog
+			title="设置诱芯"
+			:visible.sync="setTimeDialogVisible"
+			width="420px"
+		>
 			<el-form ref="form" :model="xyform" label-width="130px">
 				<el-form-item label="诱芯更换时间:">
-					<el-date-picker v-model="xyform.core" value-format="yyyy-MM-dd" type="date" placeholder="选择日期"></el-date-picker>
+					<el-date-picker
+						v-model="xyform.core"
+						value-format="yyyy-MM-dd"
+						type="date"
+						placeholder="选择日期"
+					></el-date-picker>
 				</el-form-item>
 			</el-form>
 			<span slot="footer" class="dialog-footer">
@@ -351,7 +378,7 @@
 							<el-option label="开机" :value="1"></el-option>
 						</el-select>
 					</el-form-item>
-					
+
 					<el-form-item label="数据上传时间间隔:" prop="dat_f">
 						<div class="sliderParent">
 							<div class="block">
@@ -426,18 +453,24 @@
 import SearchBar from '@/components/SearchBar'
 import EquipItem from '@/components/EquipItem'
 export default {
+	props: {
+		flag: {
+			flag: Boolean,
+			siteID: Number
+		},
+	},
 	data() {
 		return {
-			newtime:'',
+			newtime: '',
 			//图表和表格切换
 			displayType: '1',
 			// 设备加载loading
-			tableLoading : false,
-			setNameDialogVisible:false,
+			tableLoading: false,
+			setNameDialogVisible: false,
 			setTimeDialogVisible: false, //设置诱虫名称配置弹框
-			xyform:{
-				name:'',
-				core:'',
+			xyform: {
+				name: '',
+				core: ''
 			},
 			//设备列表
 			equipList: [],
@@ -468,7 +501,7 @@ export default {
 			},
 			//设备控制I 型
 			equipContrlForm1: {
-				ds: '', 
+				ds: '',
 				st: '', //时控开始时间
 				et: '', //时控结束时间
 				dat_f: null //数据上传时间间隔
@@ -488,28 +521,33 @@ export default {
 			equipControlDialogVisible2: false,
 			//管理员操作对话框
 			operarionDialogVisible: false,
-			operarionDialogVisible2: false
+			operarionDialogVisible2: false,
+			objData: {}
 		}
 	},
+	watch: {
+		
+	},
 	mounted() {
 		this.getEquipList()
-		this.newtime = new Date().getTime();
+		this.newtime = new Date().getTime()
 	},
 	computed: {
-		timeCalc(){
+		timeCalc() {
 			// if(time){
-				// let num = time
+			// let num = time
 			// }
-			return function(time){
-				if(time){
-					var time = new Date(time).getTime();
-					var currenttime = new Date().getTime();
-					var num = Math.round((parseInt(time)-parseInt(currenttime))/(24*3600000))	 
+			return function (time) {
+				if (time) {
+					var time = new Date(time).getTime()
+					var currenttime = new Date().getTime()
+					var num = Math.round(
+						(parseInt(time) - parseInt(currenttime)) / (24 * 3600000)
+					)
 					return num
-				}else{
+				} else {
 					return 'null'
 				}
-				
 			}
 		},
 		userType: function () {
@@ -527,7 +565,7 @@ export default {
 	},
 	methods: {
 		getIsOnline(data) {
-			console.log(data);
+			console.log(data)
 			this.queryInfo.is_online = data
 			this.queryInfo.page = 1
 			this.getEquipList()
@@ -542,14 +580,14 @@ export default {
 			this.displayType = data
 		},
 		//诱芯更换诱虫名称
-		setName(id,name) {
-			this.d_id = id;
+		setName(id, name) {
+			this.d_id = id
 			this.xyform.name = name
 			this.setNameDialogVisible = true
 		},
 		//诱芯更换时间
-		setTime(id,core) {
-			this.d_id = id;
+		setTime(id, core) {
+			this.d_id = id
 			this.xyform.core = core
 			this.setTimeDialogVisible = true
 		},
@@ -560,7 +598,7 @@ export default {
 				url: '/ybq_pest_set',
 				data: this.qs.stringify({
 					e_id: this.d_id,
-					pest: this.xyform.name,
+					pest: this.xyform.name
 				})
 			}).then((res) => {
 				if (res.data == 0) {
@@ -579,7 +617,7 @@ export default {
 				url: '/sex_core',
 				data: this.qs.stringify({
 					id: this.d_id,
-					core: this.xyform.core,
+					core: this.xyform.core
 				})
 			}).then((res) => {
 				if (res.data == 0) {
@@ -592,8 +630,20 @@ export default {
 			})
 		},
 		//获取设备列表
-		getEquipList() {
-			this.tableLoading = true;
+		getEquipList(obj, page) {
+			if (obj) {
+				console.log(obj)
+				this.queryInfo.page = page
+				this.objData = obj
+			}
+
+			var id = ''
+			if (this.objData !== undefined) {
+				id = this.objData.id
+			} else if (obj !== undefined) {
+				id = obj.id
+			}
+			this.tableLoading = true
 			this.$axios({
 				method: 'post',
 				url: '/sex_trap_view',
@@ -602,30 +652,35 @@ export default {
 					ename: this.queryInfo.ename,
 					page: this.queryInfo.page,
 					is_online: this.queryInfo.is_online,
-					etype: '' //1代表I型,2代表II型
-				})
-			}).then((res) => {
-				this.tableLoading = false;
-				let data = res.data.dat
-				let arr = data.map((item) => {
-					let obj= eval('(' + item.sex_trap + ')')
-					obj.equip_name=item.equip_name
-					obj.upl_time=item.upl_time
-					obj.pest_name=item.pest_name
-					if(item.core){
-						obj.core = item.core.substring(item.core.lastIndexOf("#")+1)
-					}else{
-						obj.core = ''
-					} 
-					obj.is_online=Number(item.is_online)
-					return obj
+					etype: '', //1代表I型,2代表II型
+					// site_id: obj == undefined ? '' : obj.id,
+					site_id: id
 				})
-				this.equipList = arr
-				this.totalNum = res.data.nums
-			},error =>{
-				this.dataloading = false
-				this.$message.error('获取失败')
-			})
+			}).then(
+				(res) => {
+					this.tableLoading = false
+					let data = res.data.dat
+					let arr = data.map((item) => {
+						let obj = eval('(' + item.sex_trap + ')')
+						obj.equip_name = item.equip_name
+						obj.upl_time = item.upl_time
+						obj.pest_name = item.pest_name
+						if (item.core) {
+							obj.core = item.core.substring(item.core.lastIndexOf('#') + 1)
+						} else {
+							obj.core = ''
+						}
+						obj.is_online = Number(item.is_online)
+						return obj
+					})
+					this.equipList = arr
+					this.totalNum = res.data.nums
+				},
+				(error) => {
+					this.dataloading = false
+					this.$message.error('获取失败')
+				}
+			)
 		},
 		//改变page
 		changePage(val) {
@@ -633,11 +688,11 @@ export default {
 			this.getEquipList()
 		},
 		// 数据详情
-		dataDetails(id,name) {
+		dataDetails(id, name) {
 			this.currImei = id
 			this.$router.push({
 				path: `/index/xycbDataDetail/`,
-				query: { e_id: id ,name:name}
+				query: { e_id: id, name: name }
 			})
 		},
 		//sim卡状态
@@ -658,12 +713,11 @@ export default {
 			this.currImei = id
 			this.$axios({
 				method: 'POST',
-				url:
-					'/sex_trap_detail',
-				data: this.qs.stringify({ id:id })
+				url: '/sex_trap_detail',
+				data: this.qs.stringify({ id: id })
 			}).then((res) => {
-				if(res.data.sex_trap.length>3){
-					var sex_trap = eval('('+res.data.sex_trap+')');
+				if (res.data.sex_trap.length > 3) {
+					var sex_trap = eval('(' + res.data.sex_trap + ')')
 					var dat_f = parseInt(sex_trap.dat_f) || 10
 					var ds = parseInt(sex_trap.ds)
 					this.equipContrlForm1 = {
@@ -677,27 +731,26 @@ export default {
 				}
 			})
 		},
-		wsChange(){
-			if(this.equipContrlForm1.ds == 1){
+		wsChange() {
+			if (this.equipContrlForm1.ds == 1) {
 				var data = {
 					ext: 'work_tim1',
 					st: this.equipContrlForm1.st,
 					et: this.equipContrlForm1.et,
 					e_id: this.currImei
 				}
-			}else{
+			} else {
 				var data = {
 					ext: 'work_tim0',
 					e_id: this.currImei
-				}	
+				}
 			}
 			this.$axios({
 				method: 'POST',
-				url:
-					'/sex_mqtt_v1',
+				url: '/sex_mqtt_v1',
 				data: this.qs.stringify(data)
 			}).then((res) => {
-				if(res.data == 0){
+				if (res.data == 0) {
 					this.$message.success('设备控制修改成功')
 				}
 			})
@@ -769,8 +822,7 @@ export default {
 		equipBtnControl(cmd) {
 			this.$axios({
 				method: 'POST',
-				url:
-					'/api_gateway?method=forecast.send_control.admin_device_control',
+				url: '/api_gateway?method=forecast.send_control.admin_device_control',
 				data: this.qs.stringify({
 					cmd,
 					device_type_id: 4,
@@ -808,10 +860,17 @@ export default {
 					return '销号'
 			}
 		},
-		msec(val){
-			var time = new Date(val).getTime();
+		msec(val) {
+			var time = new Date(val).getTime()
 			return time
-		}
+		},
+		ellipsis(value) {
+			if (!value) return ''
+			if (value.length > 20) {
+				return value.slice(0, 20) + '...'
+			}
+			return value
+		},
 	}
 }
 </script>
@@ -880,12 +939,17 @@ export default {
 .timeSet {
 	display: flex;
 }
-.onlineState .icon-diannao{
-	margin: 0 21px 0 -2px!important;
+.onlineState .icon-diannao {
+	margin: 0 21px 0 -2px !important;
 }
 // 暂无数据
 .expertDiagnosis_referral_units_not {
 	width: 272px;
 	margin: 0 auto;
 }
+
+
+.breadcrumb_tab {
+	top: 60px !important;
+}
 </style>

+ 11 - 1
bigdata2/src/pages/forecasting/xycb/xycbDataDetail.vue

@@ -1,6 +1,6 @@
 <template>
 	<div>
-		<el-breadcrumb separator-class="el-icon-arrow-right">
+		<el-breadcrumb separator-class="el-icon-arrow-right" :class="'el-icon-arrow-right '+ (flag.flag == false ? 'breadcrumb_tab' : '')">
 			<el-breadcrumb-item :to="{ path: '/index/xycb' }">智能性诱测报</el-breadcrumb-item>
 			<el-breadcrumb-item>数据详情</el-breadcrumb-item>
 		</el-breadcrumb>
@@ -78,6 +78,12 @@
 <script>
 import DateSearch from '@/components/DateSearch'
 export default {
+	props: {
+		flag: {
+			flag: Boolean,
+			siteID: Number
+		},
+	},
 	data() {
 		return {
 			device_model: 1, //性诱1型或II型
@@ -529,4 +535,8 @@ export default {
 .ctrl-check {
 	margin-bottom: 20px;
 }
+
+.breadcrumb_tab {
+	top: 60px !important;
+}
 </style>

+ 11 - 1
bigdata2/src/pages/forecasting/xycb/xycbDataPhotos.vue

@@ -1,6 +1,6 @@
 <template>
 	<div>
-		<el-breadcrumb separator-class="el-icon-arrow-right">
+		<el-breadcrumb separator-class="el-icon-arrow-right" :class="'el-icon-arrow-right '+ (flag.flag == false ? 'breadcrumb_tab' : '')">
 			<el-breadcrumb-item :to="{ path: '/index/xycb' }">智能性诱测报</el-breadcrumb-item>
 			<el-breadcrumb-item>查看图片</el-breadcrumb-item>
 		</el-breadcrumb>
@@ -59,6 +59,12 @@
 </template>
 <script>
 export default {
+	props: {
+		flag: {
+			flag: Boolean,
+			siteID: Number
+		},
+	},
 	data() {
 		return {
 			//在线状态按钮切换
@@ -278,4 +284,8 @@ export default {
 		}
 	}
 }
+
+.breadcrumb_tab {
+	top: 60px !important;
+}
 </style>

+ 11 - 0
bigdata2/src/router/index.js

@@ -38,7 +38,9 @@ const xycbDataDetail = () => import( /* webpackChunkName: "xycb" */ '@/Pages/for
 
 //---------------------------------------防治模块---------------------------杀虫灯-------------------------
 const Scd = () => import( /* webpackChunkName: "scd" */ '@/Pages/cure/scd/scd')
+const ScdList = () => import( /* webpackChunkName: "scd" */ '@/Pages/cure/scd/scdList')
 const ScdDetail = () => import( /* webpackChunkName: "scd" */ '@/Pages/cure/scd/scdDetail')
+const scdListAllot = () => import( /* webpackChunkName: "scd" */ '@/Pages/cure/scd/scdListAllot')
 
 Vue.use(Router)
 
@@ -117,13 +119,22 @@ export default new Router({
         component: Scd
       },
       {
+        path: 'scdList',
+        component: ScdList
+      },
+      {
         path: 'scdDetail',
         component: ScdDetail
       },
       {
+        path: 'scdListAllot',
+        component: scdListAllot
+      },
+      {
         path: 'userManger',
         component: UserManger
       },
+      
     ]
   }, ],
   // mode:'history'

TEMPAT SAMPAH
bigdata2/static/images/cure/zanwu.png


+ 1 - 0
项目说明.txt

@@ -0,0 +1 @@
+韩英磊-瑞通农林植保