Procházet zdrojové kódy

测报灯数据绑定

yf_zd před 5 roky
rodič
revize
203fb33951

+ 2 - 2
bigdata2/config/index.js

@@ -11,7 +11,7 @@ module.exports = {
     assetsPublicPath: '/',
     proxyTable: {
       '/api': {
-        target: 'http://192.168.1.8:8000/',
+        target: 'http://192.168.1.5:8000/',
         // target: 'http://192.168.1.120:8001/',
         changeOrigin: true,
         pathRewrite: {
@@ -48,7 +48,7 @@ module.exports = {
       },
     },
     // Various Dev Server settings
-    host: '192.168.1.7', // can be overwritten by process.env.HOST
+    host: '192.168.1.10', // 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,

+ 31 - 8
bigdata2/src/components/Index.vue

@@ -127,7 +127,30 @@ export default {
 				28: 'iconfont icon-xitong',
 			},
 
-			menuList1: [], //首页菜单
+			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
+			},], //首页菜单
 			// activePath:'',
 			username: '',
 			userHeadImg: '',
@@ -153,12 +176,12 @@ export default {
 		// document.body.className = window.sessionStorage.getItem('bodyCalss')
 	},
 	computed: {
-		activePath: function () {
-			return this.$store.state.activePath
-		},
-		homePath: function () {
-			return this.$store.state.homePath
-		}
+		// activePath: function () {
+		// 	return this.$store.state.activePath
+		// },
+		// homePath: function () {
+		// 	return this.$store.state.homePath
+		// }
 	},
 	watch: {
 		'$route.path': function (newVal) {
@@ -179,7 +202,7 @@ export default {
 		// 	})
 		// })
 		this.username = localStorage.getItem('username')
-		this.getNavList()
+		// this.getNavList()
 	},
 	methods: {
 		dropdownHandle(command) {

+ 31 - 74
bigdata2/src/pages/forecasting/cbd/Cbd.vue

@@ -3,42 +3,9 @@
 		<el-breadcrumb separator-class="el-icon-arrow-right">
 			<el-breadcrumb-item>虫情测报</el-breadcrumb-item>
 		</el-breadcrumb>
-		<search-bar @fun="getDisplayType" @fun2="getIDName" @fun3="getIsOnline">
-			<template slot="search-box">
-				<template v-if="role=='admin'">
-					<el-select
-						v-model="queryInfo.dver"
-						class="select01"
-						clearable
-						size="mini"
-						placeholder="请选择设备版本"
-						@change="searchChange()"
-					>
-						<el-option
-							v-for="item in dverGather"
-							:key="item.value"
-							:label="item.label"
-							:value="item.value"
-						></el-option>
-					</el-select>
-				</template>
-				<!-- <template v-if="role=='admin'">
-					<el-select
-						v-model="queryInfo.selectUser"
-						class="select01"
-						clearable
-						size="mini"
-						filterable
-						placeholder="请选择用户"
-						@change="searchChange()"
-					>
-						<el-option v-for="item in userList" :key="item.value" :label="item.label" :value="item.value"></el-option>
-					</el-select>
-				</template> -->
-			</template>
-		</search-bar>
+		<search-bar @fun="getDisplayType" @fun2="getIDName" @fun3="getIsOnline"></search-bar>
 		<template v-if="displayType==1">
-			<el-row :gutter="10">
+			<el-row :gutter="10" v-loading="tableLoading">
 				<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">
@@ -66,7 +33,7 @@
 								</p>
 								<p>
 									<i class="iconfont icon-shijian"></i>
-									最新上报时间 : {{item.status_time*1000 | formatTime}}
+									最新上报时间 : {{item.status_time}}
 								</p>
 								<p>
 									<i class="iconfont icon-dizhi"></i>
@@ -86,10 +53,10 @@
 			</el-row>
 		</template>
 		<template v-if="displayType==2">
-			<el-card class="box-card">
+			<el-card class="box-card" v-loading="tableLoading">
 				<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.slice(-8)}}</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>
@@ -100,9 +67,9 @@
 							<p style="color:#eb6765" v-if="scope.row.device_status==0">离线</p>
 						</template>
 					</el-table-column>
-					<el-table-column prop="dver_num" label="设备版本"></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*1000 | formatTime}}</template>
+						<template slot-scope="scope">{{scope.row.status_time}}</template>
 					</el-table-column>
 					<el-table-column label="操作" width="400">
 						<template slot-scope="scope">
@@ -283,20 +250,8 @@ export default {
 			displayType: '1',
 			//设备列表
 			equipList: [],
-			role: 'admin',
-			dverGather: [
-				{ label: '全部', value: '' },
-				{ label: '版本1', value: '1' },
-				{ label: '版本2', value: '2' },
-				{ label: '版本3', value: '3' },
-				{ label: '版本4', value: '4' },
-				{ label: '版本5', value: '5' }
-			],
-			userList: [
-				{ label: '用户1', value: '用户1' },
-				{ label: '用户2', value: '用户2' }
-			],
-			d_id: '',
+			// 设备加载loading
+			tableLoading : true,
 			device_id: '',
 			ws: 0, //工作模式
 			equipContrlForm: {
@@ -315,9 +270,7 @@ export default {
 			//参数
 			queryInfo: {
 				page: 1,
-				is_online: null,
-				dver: null,
-				selectUser: '',
+				is_online: '',
 				f_id: '',
 				ename: ''
 			},
@@ -355,20 +308,31 @@ export default {
 		getEquipList() {
 			this.$axios({
 				method: 'POST',
-				url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
+				url: '/api/equipmanage_cbd',
 				data: this.qs.stringify({
-					device_type_id: 3,
-					page_size: 8,
+					req: 'filter',
 					page: this.queryInfo.page,
-					device_status: this.queryInfo.is_online,
-					device_name: this.queryInfo.ename,
-					device_id: this.queryInfo.f_id,
-					dver_num: this.queryInfo.dver
+					is_online: this.queryInfo.is_online,
+					ename: this.queryInfo.ename,
+					f_id: this.queryInfo.f_id,
+					dver: this.queryInfo.dver,
 				})
 			}).then((res) => {
-				if (res.data.message == '') {
-					this.equipList = res.data.data.data
-					this.totalNum = res.data.data.counts
+				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
 				}
 			})
 		},
@@ -488,13 +452,6 @@ export default {
 				}
 			})
 		},
-
-
-		// 设备版本、用户筛选
-		searchChange() {
-			console.log(this.queryInfo.selectUser)
-			this.getEquipList()
-		},
 	},
 	components: {
 		SearchBar,

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 44 - 822
bigdata2/src/pages/forecasting/cbd/cbdDataPhotos.vue


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

@@ -9,6 +9,7 @@ Router.prototype.push = function push(location) {
 }
 
 const Index = () => import('@/components/Index')
+const Home = () => import('@/components/Home')
 
 // --------------------------------------个人中心 --------------------------------------------------
 const PersonMsg = () => import( /* webpackChunkName: "shouye" */ '@/pages/personage/personMsg')
@@ -42,6 +43,9 @@ Vue.use(Router)
 
 export default new Router({
   routes: [{
+      path:'',
+      component: Home,
+    },{
     path: '/index',
     component: Index,
     children: [{