| | |
| | | ? mergedPageData |
| | | : mergedPageData.filter((device) => device.deviceName.includes("孙胡沟")); |
| | | |
| | | // 孙胡沟设备经纬度映射 |
| | | const deviceMapping = { |
| | | 怀柔区琉璃庙镇孙胡沟椴树底下东沟泥位计5007: { |
| | | lon: 116.598891, |
| | | lat: 40.554979, |
| | | }, |
| | | 怀柔区琉璃庙镇孙胡沟村上台子河东南沟泥位计5006: { |
| | | lon: 116.593215, |
| | | lat: 40.554399, |
| | | }, |
| | | }; |
| | | |
| | | let displayedData = filteredPageData; |
| | | |
| | | if (!areaName.includes("区")) { |
| | | // 添加 lon 和 lan 字段 |
| | | displayedData = filteredPageData.map((device) => { |
| | | const mapping = deviceMapping[device.deviceName]; |
| | | return { |
| | | ...device, |
| | | ...(mapping && { lon: mapping.lon, lat: mapping.lat }), // 如果 mapping 存在,才添加 |
| | | }; |
| | | }); |
| | | |
| | | // 添加额外的两个点位 |
| | | const extraPoint1 = { |
| | | deviceName: "弯沟1", |
| | | longitude: 116.597836, |
| | | latitude: 40.564962, |
| | | // height: 530.14, |
| | | type: "泥位计", |
| | | lon: 116.597836, |
| | | lat: 40.564962, |
| | | dictDeviceType: "1437295811", |
| | | deviceId: "custom_extraPoint1", // 手动加一个唯一 ID |
| | | }; |
| | | |
| | | const extraPoint2 = { |
| | | deviceName: "弯沟2", |
| | | longitude: 116.591571, |
| | | latitude: 40.573093, |
| | | // height: 483.89, |
| | | type: "泥位计", |
| | | lon: 116.591571, |
| | | lat: 40.573093, |
| | | dictDeviceType: "1437295811", |
| | | deviceId: "custom_extraPoint2", // 手动加一个唯一 ID |
| | | }; |
| | | |
| | | displayedData = [...displayedData, extraPoint1, extraPoint2]; |
| | | // displayedData = [...displayedData, extraPoint1]; |
| | | } |
| | | |
| | | console.log( |
| | | filteredPageData, |
| | | areaName.includes("区") ? "全部泥位计设备列表" : "孙胡沟泥位计设备列表" |
| | | displayedData, |
| | | areaName.includes("区") |
| | | ? "全部泥位计设备列表" |
| | | : "孙胡沟泥位计 + 额外点位列表" |
| | | ); |
| | | |
| | | // 7. 创建点 |
| | | filteredPageData.forEach((item) => { |
| | | displayedData.forEach((item) => { |
| | | // 根据需求可增删 |
| | | item.type = getDictName(deviceDictList, item.dictDeviceType); |
| | | item.name = item.deviceName; |
| | |
| | | "geom", |
| | | "id", |
| | | "serviceName", |
| | | "updateTime", |
| | | // "updateTime", |
| | | "updateUser", |
| | | "createUser", |
| | | "bak", |
| | |
| | | |
| | | if (key === "createTime" && typeof value === "number") { |
| | | formattedData.push({ name: "创建时间:", value: formatDate(value) }); |
| | | continue; |
| | | } |
| | | |
| | | if (key === "updateTime" && typeof value === "number") { |
| | | formattedData.push({ name: "结束时间:", value: formatDate(value) }); |
| | | continue; |
| | | } |
| | | |
| | |
| | | |
| | | addField("total", "降雨总量(mm)"); |
| | | addField("duration", "降雨时长(h)"); |
| | | addField("intensity", "降雨强度(mm/小时)"); |
| | | addField("intensity", "降雨强度(mm/h"); |
| | | addField("prediction", "降雨场次"); |
| | | addField("model", "降雨模式"); |
| | | addField("history", "历史降雨"); |
| | |
| | | mode: forms.mode, |
| | | gauges: forms.gauges, |
| | | rainfalls: forms.rainFallList, |
| | | // intensityUnit: forms.intensityUnit |
| | | intensityUnit: forms.intensityUnit || 'mm/15min' |
| | | }) |
| | | } |
| | |
| | | if (entity && entity.attrs && !simStore.openDia && entity.attrs.type && entity.attrs.type == '泥位计') { |
| | | let obj = { |
| | | deviceName: entity.attrs.deviceName, |
| | | latitude: entity.attrs.latitude, |
| | | longitude: entity.attrs.longitude |
| | | latitude: entity.attrs.lat, |
| | | longitude: entity.attrs.lon |
| | | } |
| | | simStore.selectNWJ = obj |
| | | showDeviceDetail.value = false; |