From a9bd1b60ca1e5abe0e48e9aceec89f1345a7f646 Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Wed, 20 Mar 2024 17:45:15 +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 --- index.html | 3 +- src/components/customCom/equipmentDialog.vue | 102 +++++++++--------- src/components/customCom/equipmentLeasing.vue | 2 +- src/components/customCom/hotProvider.vue | 2 +- src/components/echartsCom/Pie3dCom.vue | 5 +- src/components/mapBaidu/mapLine.vue | 8 +- src/http/api/echartApi.ts | 8 +- src/views/screen/sharePlatform.vue | 2 +- 8 files changed, 65 insertions(+), 67 deletions(-) diff --git a/index.html b/index.html index c7c7ed4..afc7794 100644 --- a/index.html +++ b/index.html @@ -11,8 +11,7 @@
- + - diff --git a/src/components/customCom/equipmentDialog.vue b/src/components/customCom/equipmentDialog.vue index 35fde56..1f8f9c9 100644 --- a/src/components/customCom/equipmentDialog.vue +++ b/src/components/customCom/equipmentDialog.vue @@ -21,9 +21,9 @@
- - 查询 + 查询
@@ -40,8 +40,8 @@ import moment from "moment"; const mapLineShow = ref(false) const mapLineRef = ref() const timeRange = ref<[Date, Date]>([ - new Date(2023, 1, 1, 10, 0), - new Date(2024, 1, 1, 10, 0), + moment().subtract(3, 'month').toDate(), + new Date(), ]) const detailsInfo = reactive({ duration: '', @@ -84,7 +84,6 @@ const initApiBmaDevInfoList = async (maId:any) => { try { const res:any = await apiBmaDevInfoList(maId) - console.log("apiBmaDevInfoList", res) detailsInfo.duration = res.duration detailsInfo.maName = res.maName detailsInfo.maStatus = res.maStatus @@ -106,10 +105,20 @@ const searchByTimeFn=()=>{ // mapLineRef.value.initMapLine(params) initApiBmCompanyInfoTimeListTime(params) } -const open = (maId:any) => { - console.log("maIdmaId",maId) + +let startLonLat: any = reactive([ + { + lon: null, + lat: null, + } +]) +const open = (data:any) => { + // 从data.value中获取初始经纬度 + startLonLat[0].lon = data.value[0] + startLonLat[0].lat = data.value[1] + mapLineShow.value = true - maId=maId + maId = data.name initApiBmaDevInfoList(maId) let params={ startTime:moment(timeRange.value[0]).format('YYYY.MM.DD'), @@ -123,51 +132,42 @@ const open = (maId:any) => { }) } const initApiBmCompanyInfoTimeListTime = async (val: any) => { - // console.log("val-->",val) - try { - // const res: any = await apiBmCompanyInfoTimeListTime(val) + const res: any = await apiBmCompanyInfoTimeListTime(val) // 假数据 - const res = [ - { - "id": 1, - "lat": 31.22, - "lon": 121.48, - "time": "2022-12-10 10:10:10" - }, - { - "id": 2, - "lat": 29.588885, - "lon": 106.621131, - "time": "2023-12-19 10:10:10" - }, - { - "id": 3, - "lat": 39.904989, - "lon": 116.405285, - "time": "2023-12-19 10:10:10" - }, - { - "id": 4, - "lat": 31.820587, - "lon": 117.227219, - "time": "2023-12-19 10:10:10" - } - ] - console.log("res-apiBmCompanyInfoTimeListTime",res) - // domShow.value = true - // console.log("apiBmCompanyInfoTimeListTime", res) - - // res.forEach((ele: any) => { - // linePointList.push(new BMapGL.Point(Number(ele.lon), Number(ele.lat))) - // }) - mapLineRef.value.initMapLine(res,val.id) - // nextTick(() => { - // initMap() - // centerPoint = getcenterpoiont(res[0], res[res.length - 1]) - // console.log("centerPoint", centerPoint) - // initCustomDot(centerPoint) - // }) + // const res = [ + // { + // "id": 1, + // "lat": 31.22, + // "lon": 121.48, + // "time": "2022-12-10 10:10:10" + // }, + // // { + // // "id": 2, + // // "lat": 29.588885, + // // "lon": 106.621131, + // // "time": "2023-12-19 10:10:10" + // // }, + // // { + // // "id": 3, + // // "lat": 39.904989, + // // "lon": 116.405285, + // // "time": "2023-12-19 10:10:10" + // // }, + // { + // "id": 4, + // "lat": 31.820587, + // "lon": 117.227219, + // "time": "2023-12-19 10:10:10" + // } + // ] + + let startLonLatObj = JSON.parse(JSON.stringify(startLonLat[0])) + + res.unshift(startLonLatObj) + + // console.log("经纬度res-->>>",res) + mapLineRef.value.initMapLine(res, val.id) } catch (error) { console.log('err-->>>', error) diff --git a/src/components/customCom/equipmentLeasing.vue b/src/components/customCom/equipmentLeasing.vue index 9aed2cb..370af22 100644 --- a/src/components/customCom/equipmentLeasing.vue +++ b/src/components/customCom/equipmentLeasing.vue @@ -197,7 +197,7 @@ const mapProps = reactive({ }, effectScatterCallBack: (params: any) => { console.log("equipmentDialogRef999", params) - equipmentDialogRef.value.open(params.data.name) + equipmentDialogRef.value.open(params.data) }, // seriesData:[] seriesData: [ diff --git a/src/components/customCom/hotProvider.vue b/src/components/customCom/hotProvider.vue index 3260e14..bbe6b9e 100644 --- a/src/components/customCom/hotProvider.vue +++ b/src/components/customCom/hotProvider.vue @@ -125,7 +125,7 @@ onBeforeMount(() => { color: $main-color; padding-top: 24px; padding-left: 26px; - + cursor: pointer; } .activeSub { diff --git a/src/components/echartsCom/Pie3dCom.vue b/src/components/echartsCom/Pie3dCom.vue index 78fb1eb..9b949e3 100644 --- a/src/components/echartsCom/Pie3dCom.vue +++ b/src/components/echartsCom/Pie3dCom.vue @@ -51,7 +51,10 @@ const options:any = { series: [{ name: '设备数量', data:props.list - }] + }], + accessibility:{ + enabled: false + } } diff --git a/src/components/mapBaidu/mapLine.vue b/src/components/mapBaidu/mapLine.vue index 5ec5b20..dd1c6fe 100644 --- a/src/components/mapBaidu/mapLine.vue +++ b/src/components/mapBaidu/mapLine.vue @@ -20,14 +20,14 @@ const state = reactive({ } }) onMounted(() => { - console.log("map", "map") + // console.log("map", "map") }) let linePointList: any = [] const initMap = () => { map = new BMapGL.Map("equipmentIdMap" + domId.value); - map.centerAndZoom(new BMapGL.Point(centerPoint), 18); + map.centerAndZoom(new BMapGL.Point(), 18); console.log("map", map) map.enableScrollWheelZoom(); setTimeout(() => { @@ -142,11 +142,11 @@ const getcenterpoiont = (pointStart: any, pointEnd: any) => { const pointcenter = new BMapGL.Point(lngcenter, latcenter); return pointcenter; - } const initMapLine = (res: any, id: any) => { domId.value = id domShow.value = false + linePointList = [] res.forEach((ele: any) => { linePointList.push(new BMapGL.Point(Number(ele.lon), Number(ele.lat))) }) @@ -155,7 +155,7 @@ const initMapLine = (res: any, id: any) => { setTimeout(() => { initMap() centerPoint = getcenterpoiont(res[0], res[res.length - 1]) - console.log("centerPoint", centerPoint) + initCustomDot(centerPoint) }) }) diff --git a/src/http/api/echartApi.ts b/src/http/api/echartApi.ts index fc1ef15..2e95a7c 100644 --- a/src/http/api/echartApi.ts +++ b/src/http/api/echartApi.ts @@ -57,14 +57,10 @@ export function apiBmCompanyInfoColtdList() { } // 根据设备id查询设备详情相关信息 export function apiBmaDevInfoList(maId:any) { - return get(`maDevInfo/list/${maId}`,{}) + return get(`item-center/maDevInfo/ma-list/${maId}`,{}) } // 根据时间查询设备历史经纬度 export function apiBmCompanyInfoTimeListTime(params:any) { - const urlStr= `bmCompanyInfo/time-list/${params.startTime}/${params.endTime}/${params.id}` + const urlStr= `user-service/bmCompanyInfo/time-list/${params.startTime}/${params.endTime}/${params.id}` return get(urlStr,{}) } - - - - diff --git a/src/views/screen/sharePlatform.vue b/src/views/screen/sharePlatform.vue index 07266af..ef7a6ce 100644 --- a/src/views/screen/sharePlatform.vue +++ b/src/views/screen/sharePlatform.vue @@ -6,7 +6,7 @@
- 晴转多云 16℃ + {{ nowTime }}