| | |
| | | this.dateTxt = ""; |
| | | } |
| | | this.getScreenData(); |
| | | let params = { |
| | | startDate: "", |
| | | endDate: "", |
| | | clientId: localStorage.getItem("clientId"), |
| | | }; |
| | | if (newVal.length > 0) { |
| | | params.startDate = moment(this.dateRange[0]).format("YYYY-MM-DD"); |
| | | params.endDate = moment(this.dateRange[1]).format("YYYY-MM-DD"); |
| | | } |
| | | getProjectSelect(params).then((res) => { |
| | | this.projectList = res; |
| | | }); |
| | | }, |
| | | immediate: true, |
| | | }, |
| | |
| | | version: "2.0", |
| | | }); |
| | | this.getStoryData(); |
| | | getProjectSelect({ clientId: localStorage.getItem("clientId") }).then( |
| | | (res) => { |
| | | this.projectList = res; |
| | | } |
| | | ); |
| | | getWorkPresentationList({ |
| | | clientId: localStorage.getItem("clientId"), |
| | | state: 1, |
| | |
| | | if (!this.projectId) { |
| | | return; |
| | | } |
| | | |
| | | const target = this.screenData.projectMapPoints.find( |
| | | (item) => item.id === this.projectId |
| | | (item) => item.projectId === this.projectId |
| | | ); |
| | | |
| | | if (!target) { |
| | | if (Object.keys(target).length == 0) { |
| | | this.$message.warning("无此项目地图点位"); |
| | | return; |
| | | } |
| | | |
| | | let position = null; |
| | | if (target.addressInfo) { |
| | | try { |
| | | const info = |
| | | typeof target.addressInfo === "string" |
| | | ? JSON.parse(target.addressInfo) |
| | | : target.addressInfo; |
| | | |
| | | if (info.gps && info.gps.length) { |
| | | position = [Number(info.gps[0]), Number(info.gps[1])]; |
| | | } |
| | | } catch (e) { |
| | | console.error("解析项目地址信息失败", e); |
| | | } |
| | | } |
| | | |
| | | if (position) { |
| | | if (target.longitude && target.latitude) { |
| | | // 定位地图 |
| | | this.mapView.setZoomAndCenter(15, position); |
| | | this.mapView.setZoomAndCenter(15, [ |
| | | Number(target.longitude), |
| | | Number(target.latitude), |
| | | ]); |
| | | |
| | | // 显示悬浮窗 |
| | | this.showTooltip(null, { |
| | | id: target.id, |
| | | position: position, |
| | | projectId: target.projectId, |
| | | position: [Number(target.longitude), Number(target.latitude)], |
| | | }); |
| | | } else { |
| | | this.$message.warning("该项目暂无位置信息"); |
| | |
| | | ...item, |
| | | position: [Number(item.longitude), Number(item.latitude)], |
| | | category: category, |
| | | level: item.category ? item.category.splice(0, 1) : "", |
| | | level: item.category, |
| | | }; |
| | | }); |
| | | const markers = []; |