| | |
| | | <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> |
| | |
| | | @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"> |
| | |
| | | </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> |
| | |
| | | }, |
| | | placeholderStyle: 'color: #fff', |
| | | macName: '', |
| | | orgMacName: '', |
| | | defaultMonitorItems: [], |
| | | chartSensorKey: [], |
| | | coreMonitorItems: [], |
| | |
| | | // 报警圆环图片 |
| | | alarmBg: {}, |
| | | timer: '', |
| | | currentTime: new Date(), |
| | | isLoading: true, |
| | | specialType: '3' |
| | | } |
| | |
| | | }, |
| | | created() { |
| | | this.getOrgs() |
| | | this.getTime() |
| | | }, |
| | | onUnload() { |
| | | let that = this |
| | |
| | | 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) |
| | | }, |
| | |
| | | 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() |
| | |
| | | mac: this.macName |
| | | }).then(res => { |
| | | this.macList = [] |
| | | this.modeleMacSelect = '' |
| | | if (res.data && res.data.length > 0) { |
| | | this.macList = res.data |
| | | this.showModel = true |
| | |
| | | 'name': name, |
| | | 'id': id |
| | | } |
| | | this.getOrgs() |
| | | }, |
| | | selectBack(e) { |
| | | if (this.selectForm.name === 'orgName') { |
| | |
| | | } |
| | | } else { |
| | | this.macName = e.value[0].mac |
| | | this.orgMacName = e.value[0].name |
| | | console.log('e', e) |
| | | if (this.socketTask) { |
| | | this.socketTask.close() |
| | | } |
| | |
| | | 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> |