From 9e23127ce38a3b22108da766a5bab25dad054178 Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Thu, 21 Mar 2024 17:33:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/customCom/equipmentDialog.vue | 25 ++++++++---- src/components/customCom/equipmentLeasing.vue | 39 +++++++++---------- src/components/echartsCom/mapEcharts.vue | 23 +++++++---- src/components/mapBaidu/mapLine.vue | 8 ++-- src/views/screen/sharePlatform.vue | 11 +++--- 5 files changed, 62 insertions(+), 44 deletions(-) diff --git a/src/components/customCom/equipmentDialog.vue b/src/components/customCom/equipmentDialog.vue index 1f8f9c9..4557d94 100644 --- a/src/components/customCom/equipmentDialog.vue +++ b/src/components/customCom/equipmentDialog.vue @@ -6,19 +6,25 @@
{{detailsInfo.maName}} - ({{detailsInfo.maStatus}}) + + (待租) + (租赁中) + (自有)
- - 租赁方:{{detailsInfo.needCompany}} + + 租赁方:{{detailsInfo.receiverName || '暂无'}} - - 租赁日期:{{ detailsInfo.planStartTime }} {{ detailsInfo.duration }} + + 租赁日期:{{ detailsInfo.planStartTime || '暂无' }} + 租赁时长:{{ detailsInfo.duration }}{{ + detailsInfo.leasingMethod === null ? '暂无' : detailsInfo.leasingMethod === 0 ? '天' : '月' + }}
{ detailsInfo.duration = res.duration detailsInfo.maName = res.maName detailsInfo.maStatus = res.maStatus - detailsInfo.needCompany = res.needCompany + detailsInfo.receiverName = res.receiverName detailsInfo.planStartTime = res.planStartTime } catch (error) { @@ -113,6 +120,8 @@ let startLonLat: any = reactive([ } ]) const open = (data:any) => { + // console.log("data",data) + if (!data) return // 从data.value中获取初始经纬度 startLonLat[0].lon = data.value[0] startLonLat[0].lat = data.value[1] diff --git a/src/components/customCom/equipmentLeasing.vue b/src/components/customCom/equipmentLeasing.vue index 370af22..ecd5a65 100644 --- a/src/components/customCom/equipmentLeasing.vue +++ b/src/components/customCom/equipmentLeasing.vue @@ -5,9 +5,6 @@
-
- { - echarts.registerMap('guangdong', propsVal.jsonData) + // console.log("propsval__>>>", propsVal.idType, propsVal) + const name = propsVal.jsonData.features[0].properties.name + echarts.registerMap(name, propsVal.jsonData) nextTick(() => { - const domitem = document.getElementById("mapEcharts" + propsVal.idType) - const map = echarts.init(domitem, null, { + const domitem: any = document.getElementById("mapEcharts" + propsVal.idType) + if (echarts.getInstanceByDom(domitem)) {// 销毁之前的echarts实例 + echarts.dispose(domitem); + } + const map = echarts.init(domitem, null, {// 初始化echarts实例 renderer: 'canvas', }) const option = { @@ -101,9 +106,14 @@ const initEcharts = () => { trigger: 'item',//触发条件 }, geo: { - map: 'guangdong', + map: name, zoom: 1, roam: true, + // 缩放限制 + scaleLimit: { + min: 0.5, + max: 99 + }, label: propsVal.labelInfo, // 所有地图的区域颜色 itemStyle: propsVal.itemStyle, @@ -120,7 +130,7 @@ const initEcharts = () => { }, series: [ { - name: 'Top 5', + name, type: 'effectScatter', colorBy: 'series', effectType: 'ripple', @@ -164,8 +174,7 @@ const chartClickEventListener = (mychart: any) => { const chagneJSON = (item: any) => { - console.log("propsval", propsVal) - propsVal.idType = item.navId + // propsVal.idType = item.navId setTimeout(() => { initEcharts() }) diff --git a/src/components/mapBaidu/mapLine.vue b/src/components/mapBaidu/mapLine.vue index 8563b0b..d14d43d 100644 --- a/src/components/mapBaidu/mapLine.vue +++ b/src/components/mapBaidu/mapLine.vue @@ -35,13 +35,13 @@ const initMap = () => { const startIcon = { imgUrl: new URL('/src/assets/img/mapStart.png', import.meta.url).href, position: [linePointList[0].lng, linePointList[0].lat], - size: [60, 60] + size: [50, 50] } const endIcon = { imgUrl: new URL('/src/assets/img/mapEnd.png', import.meta.url).href, position: [linePointList[linePointList.length - 1].lng, linePointList[linePointList.length - 1].lat], - size: [60, 60] + size: [50, 50] } initIcon(startIcon.imgUrl, startIcon.position, startIcon.size) @@ -108,8 +108,8 @@ const initPolylineAnimation = () => { } const initIcon = (imgUrl: any, position: any, size: any) => { - // var myIcon = new BMapGL.Icon("https://api.map.baidu.com/img/markers.png", new BMapGL.Size(60, 60)); - var myIcon = new BMapGL.Icon(imgUrl, new BMapGL.Size(60, 60)); + // var myIcon = new BMapGL.Icon("https://api.map.baidu.com/img/markers.png", new BMapGL.Size(50, 50)); + var myIcon = new BMapGL.Icon(imgUrl, new BMapGL.Size(50, 50)); // 创建Marker标注,使用小车图标 var pt = new BMapGL.Point(...position); var marker = new BMapGL.Marker(pt, { diff --git a/src/views/screen/sharePlatform.vue b/src/views/screen/sharePlatform.vue index ef7a6ce..4a7644c 100644 --- a/src/views/screen/sharePlatform.vue +++ b/src/views/screen/sharePlatform.vue @@ -379,11 +379,11 @@ const barComPropsHorizontal = reactive({ const pie3DList = reactive({ list: [ // 假数据 - {name: 'Chrome', y: 61.41}, - {name: 'Internet Explorer', y: 11.84}, - {name: 'Firefox', y: 10.85}, - {name: 'Edge', y: 4.67}, - {name: 'Safari', y: 4.18}, + // ['Chrome', 1], + // ['Internet Explorer', 2], + // ['Firefox', 3], + // ['Edge', 4], + // ['Safari', 5] ] }) onMounted(() => { @@ -440,6 +440,7 @@ const iniTapiMaDevInfoCompanyList = async () => { resultList.push(item) }) pie3DList.list = resultList + // console.log("pie3DList", pie3DList.list) } catch (error) { console.log(error) }