Pārlūkot izejas kodu

Merge branch 'visu_forest_0_1' of http://121.37.83.100:3000/sooka_onest/sooka_onest_forestfire_vue2_visualization into visu_forest_0_1

whao 2 gadi atpakaļ
vecāks
revīzija
c1a0826e27

+ 8 - 0
src/api/forest.js

@@ -48,3 +48,11 @@ export function getEventDetail(param) {
     data: param
   })
 }
+// 获取日历颜色状态
+export function getEventByCalendar(param) {
+  return request({
+    url: '/center-fire/VisuForestCloudMapController/getEventByCalendar',
+    method: 'post',
+    data: param
+  })
+}

+ 0 - 4
src/components/TVWall.vue

@@ -240,7 +240,6 @@
       /** ----------------------------------摄像头预览开始------------------------------------- */
       const DHWsInstance = DHWs.getInstance()
       this.ws = DHWsInstance
-      console.log(this.ws)
       this.ws.addEventListener('connectStateChange', data => {
         if (data) {
           console.log('连接成功')
@@ -340,16 +339,13 @@
         ]
         this.setPos()
         _this.ws.createCtrl(params).then(res => {
-          console.log(res)
           this.customizeTree(tvListJson)
         }).catch(e => {
           console.log(e)
         })
         _this.ws.on('createCtrlResult', (res) => {
-          console.log(res)
           this.customizeTree(tvListJson)
           _this.ws.on('createCtrlResult', (res) => {
-            console.log(res)
             this.customizeTree(tvListJson)
           })
         })

+ 0 - 1
src/components/eventLocation.vue

@@ -520,7 +520,6 @@
 			/** ----------------------------------摄像头预览开始------------------------------------- */
 			const DHWsInstance = DHWs.getInstance()
 			this.ws = DHWsInstance
-			console.log(this.ws)
 			/** ----------------------------------摄像头预览结束------------------------------------- */
 		},
 		methods: {

+ 0 - 1
src/views/animal.vue

@@ -291,7 +291,6 @@
 				let that = this
 				//获取左侧菜单列表
 				selectForestAnimalListByType(type).then(res => {
-					console.log(res)
 					this.animalSjfb = res.data.visuForestAnimalBOList
 					this.animalSjlb = res.data.visuForestVgdEventBOList
 					that.markersList = [];

+ 36 - 15
src/views/date.vue

@@ -38,7 +38,7 @@
 						</div>
 
 						<p>{{Number(item.date)}}
-						<div class="date-state-pointer d-state-zc"></div>
+						<div :class="calendarDaycount(item.year,item.month,item.date)"></div>
 						</p>
 					</div>
 
@@ -76,6 +76,9 @@
 </template>
 
 <script>
+import {
+  getEventByCalendar
+} from '@/api/forest'
 	export default {
 		name: "ren-calendar",
 		props: {
@@ -127,10 +130,11 @@
 				monthOpen: false,
 				choose: "",
 				isCurM: true,
+        eventByCalendarList:[]
 			};
 		},
 		created() {
-			this.dates = this.monthDay(this.y, this.m);
+      this.monthDay(this.y, this.m);
 			// !this.open && this.toggle();
 		},
 		watch: {
@@ -140,7 +144,7 @@
 					this.choose = this.selectDate
 					this.y = Number(this.selectDate.split('-')[0])
 					this.m = Number(this.selectDate.split('-')[1])
-					this.dates = this.monthDay(this.y, this.m);
+					this.monthDay(this.y, this.m);
 					if (!this.monthOpen) {
 						let index = -1;
 						this.dates.forEach((i, x) => {
@@ -184,6 +188,20 @@
 			},
 		},
 		methods: {
+      // 标记日期状态颜色
+      calendarDaycount(y, m, d) {
+        let day=y + "-" + this.formatNum(m) + "-" + this.formatNum(d)
+        if(this.eventByCalendarList!=null&&this.eventByCalendarList.length>0){
+          for (let i = 0; i < this.eventByCalendarList.length; i++) {
+            if(this.eventByCalendarList[i].day==day&&this.eventByCalendarList[i].daycount>0&&this.eventByCalendarList[i].daycount<=10){
+              return "date-state-pointer d-state-t10"
+            }else if(this.eventByCalendarList[i].day==day&&this.eventByCalendarList[i].daycount>10){
+              return "date-state-pointer d-state-b10"
+            }
+          }
+        }
+        return "date-state-pointer d-state-zc";
+      },
 			formatNum(num) {
 				let res = Number(num);
 				return res < 10 ? "0" + res : res;
@@ -203,10 +221,15 @@
 				return today;
 			},
 			// 获取当前月份数据
-			monthDay(y, month) {
-				let dates = [];
-				let m = Number(month);
-				let firstDayOfMonth = new Date(y, m - 1, 1).getDay(); // 当月第一天星期几
+      async monthDay(y, month) {
+        let param={ day: y+"-"+this.formatNum(Number(month)) }
+        await getEventByCalendar(param).then(res => {
+          //获取日历颜色状态
+          this.eventByCalendarList=res.data;
+        })
+        this.dates = [];
+        let m = Number(month);
+        let firstDayOfMonth = new Date(y, m - 1, 1).getDay(); // 当月第一天星期几
 				let lastDateOfMonth = new Date(y, m, 0).getDate(); // 当月最后一天
 				let lastDayOfLastMonth = new Date(y, m - 1, 0).getDate(); // 上一月的最后一天
 				let weekstart = this.weekstart == 7 ? 0 : this.weekstart;
@@ -222,7 +245,7 @@
 				})();
 				let endDay = 7 - ((startDay + lastDateOfMonth) % 7); // 结束还有几天是下个月的
 				for (let i = 1; i <= startDay; i++) {
-					dates.push({
+          this.dates.push({
 						date: this.formatNum(lastDayOfLastMonth - startDay + i),
 						day: weekstart + i - 1 || 7,
 						month: m - 1 >= 1 ? this.formatNum(m - 1) : 12,
@@ -231,7 +254,7 @@
 					});
 				}
 				for (let j = 1; j <= lastDateOfMonth; j++) {
-					dates.push({
+          this.dates.push({
 						date: this.formatNum(j),
 						day: (j % 7) + firstDayOfMonth - 1 || 7,
 						month: this.formatNum(m),
@@ -240,7 +263,7 @@
 					});
 				}
 				for (let k = 1; k <= endDay; k++) {
-					dates.push({
+          this.dates.push({
 						date: this.formatNum(k),
 						day: (lastDateOfMonth + startDay + weekstart + k - 1) % 7 || 7,
 						month: m + 1 <= 12 ? this.formatNum(m + 1) : 1,
@@ -248,8 +271,6 @@
 						isCurM: false
 					});
 				}
-				// console.log(dates);
-				return dates;
 			},
 			isFutureDay(y, m, d) {
 				//是否未来日期
@@ -341,7 +362,7 @@
 					} else {
 						this.y = i.year
 						this.m = i.month
-						this.dates = this.monthDay(this.y, this.m);
+            this.monthDay(this.y, this.m);
 						this.$emit("onDayClick", response);
 					}
 				}
@@ -351,7 +372,7 @@
 			},
 			//改变年月
 			changYearMonth(y, m) {
-				this.dates = this.monthDay(y, m);
+        this.monthDay(y, m);
 				this.y = y;
 				this.m = m;
 			},
@@ -374,7 +395,7 @@
 						this.m = this.m + 1;
 					}
 				}
-				this.dates = this.monthDay(this.y, this.m);
+        this.monthDay(this.y, this.m);
 				// this.$emit("changeMonth");
 			},
 		},

+ 0 - 1
src/views/event.vue

@@ -462,7 +462,6 @@
 			/** ----------------------------------摄像头预览开始------------------------------------- */
 			const DHWsInstance = DHWs.getInstance();
 			this.ws = DHWsInstance;
-			console.log(this.ws);
 			/** ----------------------------------摄像头预览结束------------------------------------- */
 			/** ----------------------------------底部按钮公用组件开始------------------------------------- */
 			window.showDialog = this.showDialog

+ 0 - 2
src/views/forest.vue

@@ -336,7 +336,6 @@ export default {
     /** ----------------------------------摄像头预览开始------------------------------------- */
     const DHWsInstance = DHWs.getInstance()
     this.ws = DHWsInstance
-    console.log(this.ws)
     /** ----------------------------------摄像头预览结束------------------------------------- */
 
     /** ----------------------------------底部按钮公用组件开始------------------------------------- */
@@ -720,7 +719,6 @@ export default {
       this.eventList = []
       //右侧获取事件列表
       getEventList({ day: day }).then(res => {
-        console.log(res)
         this.eventList = res.data
         that.markersList = []
         if (this.eventList != null && this.eventList.length > 0) {

+ 0 - 2
src/views/leader.vue

@@ -193,7 +193,6 @@
 				this.listCurrentIndex2 = ''
 				//获取左侧菜单列表
 				getBaseInfo().then(res => {
-					console.log(res.data)
 					that.visuForestCloudRYBO = res.data.visuForestCloudRYBO
 					that.zrs = res.data.visuForestCloudRyZxBO.zrs
 					that.zxrs = res.data.visuForestCloudRyZxBO.zxrs
@@ -202,7 +201,6 @@
 				//获取巡林计划
 				getPlanList().then(res => {
 					this.xunLinListOne = res.data
-					console.log(res.data.visuForestCloudRYBO)
 				})
 			},
 			//获取左侧人员列表

+ 0 - 1
src/views/monitor.vue

@@ -143,7 +143,6 @@
 			/** ----------------------------------摄像头预览开始------------------------------------- */
 			const DHWsInstance = DHWs.getInstance();
 			this.ws = DHWsInstance;
-			console.log(this.ws);
 			/** ----------------------------------摄像头预览结束------------------------------------- */
 
 			/** ----------------------------------底部按钮公用组件开始------------------------------------- */

+ 0 - 1
src/views/system/menuVisu/index.vue

@@ -453,7 +453,6 @@
         this.getTreeselect();
         const menuId = row.menuId || this.ids
         getMenuVisu(menuId).then(response => {
-          console.log(response.data)
           this.form = response.data;
           this.open = true;
           this.title = "修改可视化菜单权限";