代码优化

This commit is contained in:
BianLzhaoMin 2024-08-09 16:49:00 +08:00
parent 1b71e843bf
commit a80ee2ebea
3 changed files with 22 additions and 13 deletions

View File

@ -178,8 +178,8 @@
<el-option <el-option
v-for="item in options" v-for="item in options"
:key="item.value" :key="item.value"
:label="item.iotTypeId + ''" :value="item.iotTypeId + ''"
:value="item.iotTypeName" :label="item.iotTypeName"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>

View File

@ -94,7 +94,9 @@
</div> </div>
</div> </div>
</template> </template>
<template v-else> 暂无数据 </template> <template v-else>
{{ loadingData ? '数据加载中...' : 暂无数据 }}
</template>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="停留点"> <el-tab-pane label="停留点">
<template v-if="parkList.length > 0"> <template v-if="parkList.length > 0">
@ -222,18 +224,20 @@ export default {
activeIndex: '', activeIndex: '',
// //
parkList: [], parkList: [],
warningList: [],
loadingData: true,
} }
}, },
created() { created() {},
this.handleQuery()
},
mounted() { mounted() {
Promise.all([this.getIotDeviceLocation()]) Promise.all([this.getIotDeviceLocation(), this.handleQuery()])
.then((res) => { .then((res) => {
this.loadingData = false
this.initMap() this.initMap()
}) })
.catch((err) => { .catch((err) => {
console.log(err) console.log(err)
this.loadingData = false
}) })
// this.getIotDeviceLocation() // this.getIotDeviceLocation()
@ -247,9 +251,12 @@ export default {
this.trackAni.cancel() this.trackAni.cancel()
} }
// 2. // 2.
if (this.map) {
this.map.clearOverlays() this.map.clearOverlays()
this.map.destroy() this.map.destroy()
this.map = null this.map = null
}
}, },
methods: { methods: {
@ -468,8 +475,10 @@ export default {
}, },
/** 时间选择器 */ /** 时间选择器 */
onChangeTime(val) { onChangeTime(val) {
if (val) {
this.tripParams.beginTime = val[0] this.tripParams.beginTime = val[0]
this.tripParams.endTime = val[1] this.tripParams.endTime = val[1]
}
}, },
}, },
} }

View File

@ -46,7 +46,7 @@ module.exports = {
// target: `http://10.40.92.81:8080`, //韩/ // target: `http://10.40.92.81:8080`, //韩/
// target: `http://192.168.2.81:28080`,//旭/ // target: `http://192.168.2.81:28080`,//旭/
// target: `http://192.168.2.248:28080`, //帅 // target: `http://192.168.2.248:28080`, //帅
target: `http://192.168.2.246:49080`, //福 target: `http://192.168.2.225:49080`, //福
//******** 注意事项 ********* */ //******** 注意事项 ********* */
//1.全局替换qrUrl二维码扫码提供的网址-发布服务器的地址target; //1.全局替换qrUrl二维码扫码提供的网址-发布服务器的地址target;