Explorar el Código

优化监测系统数据加载和展示逻辑

彭宇 hace 5 días
padre
commit
8ed4c72c72
Se han modificado 3 ficheros con 73 adiciones y 48 borrados
  1. 1 1
      src/api/jgpt.js
  2. 70 45
      src/views/industry/jcxt.vue
  3. 2 2
      src/views/industry/jgpt.vue

+ 1 - 1
src/api/jgpt.js

@@ -51,7 +51,7 @@ export function eventStatistics({industry,status}) {
  */
  */
 export function warningManagement(industry) {
 export function warningManagement(industry) {
   return request({
   return request({
-    url: `/sooka-digital-construction/visual/warningManagement?industry=${industry}`,
+    url: `/sooka-digital-construction/visual/warningManagement`,//?industry=${industry}
     method: 'get',
     method: 'get',
   })
   })
 }
 }

+ 70 - 45
src/views/industry/jcxt.vue

@@ -179,7 +179,7 @@
 					</div>
 					</div>
 					<div class="scroll-container hei_scroll">
 					<div class="scroll-container hei_scroll">
             <ul class="list-ul-100" >
             <ul class="list-ul-100" >
-              <li v-for="e in deviceList" :key="e.id" @click="dropLocation(e.latitude,e.longitude)">
+              <li v-for="e in deviceList" @click="dropLocation(e.latitude,e.longitude)">
                 <span :class="e.industryName">{{e.industryName}}</span>
                 <span :class="e.industryName">{{e.industryName}}</span>
                 <span>{{e.deviceName}}</span>
                 <span>{{e.deviceName}}</span>
                 <span :class="e.onlineStatus == '在线' ? 'zx' : 'lx' ">{{e.onlineStatus}}</span>
                 <span :class="e.onlineStatus == '在线' ? 'zx' : 'lx' ">{{e.onlineStatus}}</span>
@@ -359,33 +359,19 @@
 </template>
 </template>
 
 
 <script>
 <script>
-	import Cookies from 'js-cookie'
-	import supermap from '@/components/supermap-2.5d' //超图
-  import weatherHeader from '@/components/weatherHeader';
-	import {
-		getUserProfile
-	} from "@/api/system/user";
+import supermap from '@/components/supermap-2.5d' //超图
+import weatherHeader from '@/components/weatherHeader'
+import { getUserProfile } from '@/api/system/user'
 
 
-	import '../../assets/styles/hz_body.css';
+import '../../assets/styles/hz_body.css'
 
 
-	import {
-		selectConfigKey
-	} from "@/api/system/config";
+import { deviceAlarm, getDeviceList, getDeviceSummary, getDeviceType } from '@/api/jcst.js'
 
 
-	import {
-		getDeviceSummary,                 	// 监测系统-设备汇总
-		getDeviceType,                 		// 监测系统-设备类型
-		getDeviceList,                 		// 监测系统-设备列表
-		deviceAlarm,                 		// 监测系统-设备报警
+import DetailDialog from '@/components/DetailDialog/index.vue'
 
 
-	} from "@/api/jcst.js";
+import * as echarts from 'echarts'
 
 
-	import DetailDialog from "@/components/DetailDialog/index.vue";
-
-	import * as echarts from 'echarts'
-
-
-	export default {
+export default {
 		components: {
 		components: {
 			supermap,
 			supermap,
 			DetailDialog,
 			DetailDialog,
@@ -405,18 +391,19 @@
 			}
 			}
 		},
 		},
 		created() {
 		created() {
-			this.getDeviceSummary()
+      this.getDeviceSummary(0)
 		},
 		},
 		mounted() {
 		mounted() {
 			// 初始化地图数据
 			// 初始化地图数据
 			this.getSuperMapUrl();
 			this.getSuperMapUrl();
+
 			setTimeout(() => {
 			setTimeout(() => {
         		this.time();
         		this.time();
 				this.title = '四平市城市生命线'
 				this.title = '四平市城市生命线'
-				this.sblx_chart();
+				this.sblx_chart(1);
 				this.sbbj_div();
 				this.sbbj_div();
 				this.yxzt_div();
 				this.yxzt_div();
-				this.getDeviceList(1)
+        this.getDeviceList(1)
 			}, 1000)
 			}, 1000)
 		},
 		},
 		computed:{
 		computed:{
@@ -427,6 +414,7 @@
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
+        dialogVisibleSj:false,
 			// 		<li @click="dialogVisibleSj = true"  v-for="item in currentList" :key="item.id">
 			// 		<li @click="dialogVisibleSj = true"  v-for="item in currentList" :key="item.id">
 			// 		<span class="item.hydh">{{item.hy}}</span>
 			// 		<span class="item.hydh">{{item.hy}}</span>
 			// <span>{{item.tit}}</span>
 			// <span>{{item.tit}}</span>
@@ -463,20 +451,54 @@
 
 
 				activeNameSblx: '1',
 				activeNameSblx: '1',
 				activeNameListSblx: '1',
 				activeNameListSblx: '1',
-				options: [{
-					value: '选项1',
-					label: '周'
-				}, {
-					value: '选项2',
-					label: '月度'
-				}, {
-					value: '选项3',
-					label: '季度'
-				}, {
-					value: '选项4',
-					label: '年度'
-				}],
+        options: [
+          {
+            value: '选项1',
+            label: '周'
+          }, {
+            value: '选项2',
+            label: '月度'
+          }, {
+            value: '选项3',
+            label: '季度'
+          }, {
+            value: '选项4',
+            label: '年度'
+          }
+        ],
+        options2: [
+          {
+            value: '选项1',
+            label: '周'
+          }, {
+            value: '选项2',
+            label: '月度'
+          }, {
+            value: '选项3',
+            label: '季度'
+          }, {
+            value: '选项4',
+            label: '年度'
+          }
+        ],
+        options3: [
+          {
+            value: '选项1',
+            label: '周'
+          }, {
+            value: '选项2',
+            label: '月度'
+          }, {
+            value: '选项3',
+            label: '季度'
+          }, {
+            value: '选项4',
+            label: '年度'
+          }
+        ],
 				value: '周',
 				value: '周',
+				value2: '',
+				value3: '',
 				paramIndustry:1,
 				paramIndustry:1,
 				paramDeviceIndustry:1,
 				paramDeviceIndustry:1,
 				deviceList:[],          // 设备列表
 				deviceList:[],          // 设备列表
@@ -504,7 +526,7 @@
 				this.time()
 				this.time()
 				}, 1000);
 				}, 1000);
 			},
 			},
-			getDeviceSummary(industry=1){
+			getDeviceSummary(industry=0){
 				getDeviceSummary(industry).then(res => {
 				getDeviceSummary(industry).then(res => {
 					this.deviceTotalList = res.data || []
 					this.deviceTotalList = res.data || []
 				})
 				})
@@ -514,16 +536,19 @@
 				this.activeNameSblx = industry + ''
 				this.activeNameSblx = industry + ''
 				this.activeNameListSblx = industry + ''
 				this.activeNameListSblx = industry + ''
 				this.currentBtmHighIdx = industry
 				this.currentBtmHighIdx = industry
-				this.getDeviceSummary(industry)
+				// this.getDeviceSummary(industry)
 				if(industry != 0){
 				if(industry != 0){
 					this.sblx_chart(industry)
 					this.sblx_chart(industry)
-					this.sblx_chart(industry)
 					this.getDeviceList(industry)
 					this.getDeviceList(industry)
 					this.sbbj_div(industry,1)
 					this.sbbj_div(industry,1)
-				}
+				}else{
+          this.sblx_chart(1)
+          this.activeNameSblx=1+ ''
+          this.activeNameListSblx=1+ ''
+        }
 
 
 			},
 			},
-			getDeviceList(industry){
+			getDeviceList(industry=1){
 				this.paramDeviceIndustry = industry
 				this.paramDeviceIndustry = industry
 				if(typeof(industry) != 'number'){
 				if(typeof(industry) != 'number'){
 					this.paramDeviceIndustry = industry.name
 					this.paramDeviceIndustry = industry.name
@@ -667,7 +692,7 @@
 							[
 							[
 								{
 								{
 									offset: 0,
 									offset: 0,
-									color: "#29acff",	
+									color: "#29acff",
 								},
 								},
 								{
 								{
 									offset: 1,
 									offset: 1,

+ 2 - 2
src/views/industry/jgpt.vue

@@ -1541,10 +1541,10 @@
 			industryHasChanged(industry=0){
 			industryHasChanged(industry=0){
 				if(industry == this.currentBtmHighIdx) return;
 				if(industry == this.currentBtmHighIdx) return;
 				this.currentBtmHighIdx = industry
 				this.currentBtmHighIdx = industry
-				this.inspectionAndHiddenDanger(industry)
+				// this.inspectionAndHiddenDanger(industry)
 				this.eventContingencyPlan(industry)
 				this.eventContingencyPlan(industry)
 				this.ndChart(industry)
 				this.ndChart(industry)
-				this.yjgl_chart(industry)
+				// this.yjgl_chart(industry)
 				this.sjChart(industry,true)
 				this.sjChart(industry,true)
 			},
 			},
 			eventContingencyPlan(industry = 0){
 			eventContingencyPlan(industry = 0){