From e13367edf304cb78f978e321f1679299a66b3a23 Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Wed, 10 Jan 2024 16:08:18 +0800
Subject: [PATCH] fix:地图

---
 pages/actionChange/secondLevelData/index.vue |   70 +++++++++++++++++++++++++++++-----
 1 files changed, 59 insertions(+), 11 deletions(-)

diff --git a/pages/actionChange/secondLevelData/index.vue b/pages/actionChange/secondLevelData/index.vue
index 69fc5ea..0b640e4 100644
--- a/pages/actionChange/secondLevelData/index.vue
+++ b/pages/actionChange/secondLevelData/index.vue
@@ -4,16 +4,16 @@
 			<view class="ridoaBox">
 				<u-radio-group v-model="value" placement="row" :size='radioOption.size'
 					:labelColor='radioOption.labelColor' :labelSize='radioOption.labelSize' @change='changeSearchType'>
-					<u-radio activeColor="#19be6b" label="Mac������" name="1" :labelSize='radioOption.labelSize'
+					<u-radio activeColor="#19be6b" label="Mac���/������������" name="1" :labelSize='radioOption.labelSize'
 						:labelColor='radioOption.labelColor'></u-radio>
-					<u-radio activeColor="#19be6b" label="������������" name="0" :labelSize='radioOption.labelSize'
+					<u-radio activeColor="#19be6b" label="������" name="0" :labelSize='radioOption.labelSize'
 						:labelColor='radioOption.labelColor'></u-radio>
-					<u-radio activeColor="#19be6b" label="������������������" name="2" :labelSize='radioOption.labelSize'
+					<u-radio activeColor="#19be6b" label="������������" name="2" :labelSize='radioOption.labelSize'
 						:labelColor='radioOption.labelColor'></u-radio>
 				</u-radio-group>
 			</view>
 			<view class="" v-if="value==='1'">
-				<u-input placeholder="���������Mac���" :placeholderStyle='placeholderStyle' color="#fff"
+				<u-input placeholder="���������Mac���/������������" :placeholderStyle='placeholderStyle' color="#fff"
 					customStyle="margin: 0 5px;" v-model='macName'>
 					<template slot="suffix">
 						<u-button @tap="searchMacList" text="������" type="success" size="small"></u-button>
@@ -45,10 +45,17 @@
 					@cancel="showeEscalationTime = false"></u-picker>
 			</view>
 		</view>
-		<view v-if="wsData2">
-			<u-cell title="���������" :value="windDirData"></u-cell>
+		<view class="timeStyle">
+			{{currentTime}}
+		</view>
+		<view>
+			<u-cell title="������:" :value="orgMacName"></u-cell>
 		</view>
 		<view class="boxPadd">
+			<view class="windDirBox" v-if="showData.length>0">
+				<view class=""> ��������� </view>
+				<view class=""> {{windDirData}} </view>
+			</view>
 			<u-list v-if="showData.length>0">
 				<u-list-item v-for="(item, index) in showData" :key="index">
 					<u-row customStyle="margin-bottom: 10px">
@@ -65,18 +72,18 @@
 				</u-list-item>
 			</u-list>
 		</view>
-		<u-toast ref="uToast"></u-toast>
 		<u-modal :show="showModel" title='���������Mac���' showCancelButton @cancel='showModel=false' @confirm='selectMac'>
 			<view class="slot-content">
 				<u-radio-group v-model="modeleMacSelect" iconPlacement="right" placement='column' borderBottom='true'
 					@change='clickMac'>
 					<view v-for="(item,index) in macList" :key="index" class="ridioBox">
-						<u-radio activeColor="#19be6b" :label="`${item.typeName}: ${item.mac}`"
+						<u-radio activeColor="#19be6b" :label="`${item.typeName}: ${item.name}  \\n Mac���:${item.mac}`"
 							:name="item.mac"></u-radio>
 					</view>
 				</u-radio-group>
 			</view>
 		</u-modal>
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 <script>
@@ -110,6 +117,7 @@
 				},
 				placeholderStyle: 'color: #fff',
 				macName: '',
+				orgMacName: '',
 				defaultMonitorItems: [],
 				chartSensorKey: [],
 				coreMonitorItems: [],
@@ -118,7 +126,7 @@
 				alarmLevel: null,
 				aqi: 0,
 				baseUrl: '',
-				windDir: 'null',
+				windDir: '',
 				windDeg: 180,
 				wsData2: null,
 				// ���������������
@@ -128,6 +136,7 @@
 				// ������������������
 				alarmBg: {},
 				timer: '',
+				currentTime: new Date(),
 				isLoading: true,
 				specialType: '3'
 			}
@@ -141,7 +150,7 @@
 		},
 		computed: {
 			windDirData() {
-				if (this.wsData2) {
+				if (this.wsData2 && this.windDir) {
 					return `${this.windDir} (${this.wsData2.a01008})`
 				} else {
 					return ''
@@ -153,6 +162,7 @@
 		},
 		created() {
 			this.getOrgs()
+			this.getTime()
 		},
 		onUnload() {
 			let that = this
@@ -161,7 +171,22 @@
 			that.timer = ''
 		},
 		methods: {
+			getTime() {
+				var _this = this // ������������������������Vue������this������������������������
+				this.timer = setInterval(function() {
+					_this.currentTime = // ������������date
+						_this.appendZero(new Date().getFullYear()) + '-' + _this.appendZero(new Date().getMonth() +
+							1) + '-' + _this.appendZero(new Date().getDate()) + ' ' + _this.appendZero(new Date()
+							.getHours()) + ': ' + _this.appendZero(new Date().getMinutes()) + ': ' + _this
+						.appendZero(new Date().getSeconds())
+				}, 1000)
+			},
+			appendZero(obj) {
+				return obj < 10 ? '0' + obj : obj
+			},
 			clickMac(e) {
+				this.macName = ''
+				this.orgMacName = ''
 				this.specialType = this.macList.find(item => item.mac === e).specialType
 				console.log('specialType', this.specialType)
 			},
@@ -171,16 +196,20 @@
 				this.sensorLayout()
 			},
 			changeSearchType() {
-				this.macName = ''
 				if (this.value === '2') {
 					this.getSpeciallist()
 				}
 				if (this.value === '0') {
 					this.getOrgs()
 				}
+				if (this.value === '1') {
+					this.macName = ''
+				}
 			},
 			selectMac() {
 				this.macName = this.modeleMacSelect
+				this.orgMacName = this.macList.find(item => item.mac === this.modeleMacSelect).name
+				console.log('this.orgMacName', this.orgMacName)
 				this.showModel = false
 				if (this.socketTask) {
 					this.socketTask.close()
@@ -192,6 +221,7 @@
 					mac: this.macName
 				}).then(res => {
 					this.macList = []
+					this.modeleMacSelect = ''
 					if (res.data && res.data.length > 0) {
 						this.macList = res.data
 						this.showModel = true
@@ -228,6 +258,7 @@
 					'name': name,
 					'id': id
 				}
+				this.getOrgs()
 			},
 			selectBack(e) {
 				if (this.selectForm.name === 'orgName') {
@@ -239,6 +270,8 @@
 					}
 				} else {
 					this.macName = e.value[0].mac
+					this.orgMacName = e.value[0].name
+					console.log('e', e)
 					if (this.socketTask) {
 						this.socketTask.close()
 					}
@@ -588,4 +621,19 @@
 		max-height: 300px;
 		overflow: auto;
 	}
+
+	.windDirBox {
+		display: flex;
+		justify-content: space-between;
+		padding: 5px;
+		margin-bottom: 5px;
+		border-bottom: 1px solid;
+	}
+
+	.timeStyle {
+		text-align: center;
+		margin: 5px;
+		font-size: 18px;
+		color: #ef9790;
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.8.0