From 9c3961f513cb548c129dd911c1eb92ec21bb703c Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Mon, 18 Mar 2024 15:01:38 +0800
Subject: [PATCH] fix: 分享详情页打开未登录跳转
---
pages/actionChange/secondLevelData/index.vue | 74 +++++++++++++++++++++++++++++++------
1 files changed, 62 insertions(+), 12 deletions(-)
diff --git a/pages/actionChange/secondLevelData/index.vue b/pages/actionChange/secondLevelData/index.vue
index 69fc5ea..8691f9f 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,15 +162,33 @@
},
created() {
this.getOrgs()
+ this.getTime()
},
onUnload() {
let that = this
- this.socketTask.close()
+ if (this.socketTask) {
+ this.socketTask.close()
+ }
that.isLoading = false
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 +198,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 +223,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 +260,7 @@
'name': name,
'id': id
}
+ this.getOrgs()
},
selectBack(e) {
if (this.selectForm.name === 'orgName') {
@@ -239,6 +272,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 +623,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