|
@@ -72,13 +72,16 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-tree>
|
|
</el-tree>
|
|
|
</div>
|
|
</div>
|
|
|
- <div v-if="!showDetail" class="warning-r right chart-wrap yes-events">
|
|
|
|
|
|
|
+ <div v-if="panelType === 0" class="warning-r right chart-wrap yes-events">
|
|
|
<chart-list :activeBaseTab="activeBaseTab"></chart-list>
|
|
<chart-list :activeBaseTab="activeBaseTab"></chart-list>
|
|
|
<!-- <farmInfoGroup></farmInfoGroup> -->
|
|
<!-- <farmInfoGroup></farmInfoGroup> -->
|
|
|
</div>
|
|
</div>
|
|
|
- <div v-else class="warning-r right yes-events">
|
|
|
|
|
|
|
+ <div v-if="panelType === 1" class="warning-r right yes-events">
|
|
|
<farmInfoGroup></farmInfoGroup>
|
|
<farmInfoGroup></farmInfoGroup>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div v-if="panelType === 2" class="warning-r right yes-events">
|
|
|
|
|
+ <service-list></service-list>
|
|
|
|
|
+ </div>
|
|
|
<!-- 地图图例 -->
|
|
<!-- 地图图例 -->
|
|
|
<map-legend :type="activeBaseTab"></map-legend>
|
|
<map-legend :type="activeBaseTab"></map-legend>
|
|
|
<!-- 地图搜索 -->
|
|
<!-- 地图搜索 -->
|
|
@@ -144,6 +147,7 @@ import { useStore } from "vuex";
|
|
|
import farmInfoGroup from "./components/farmInfoGroup.vue";
|
|
import farmInfoGroup from "./components/farmInfoGroup.vue";
|
|
|
import mapLegend from "./components/mapLegend.vue";
|
|
import mapLegend from "./components/mapLegend.vue";
|
|
|
import chartList from "./components/chart_components/chartList.vue";
|
|
import chartList from "./components/chart_components/chartList.vue";
|
|
|
|
|
+import serviceList from "./components/serviceList.vue";
|
|
|
|
|
|
|
|
let store = useStore();
|
|
let store = useStore();
|
|
|
|
|
|
|
@@ -154,7 +158,8 @@ let staticMapPointLayers = null;
|
|
|
let distributionLayer = null;
|
|
let distributionLayer = null;
|
|
|
const areaVal = ref([]);
|
|
const areaVal = ref([]);
|
|
|
const mapRef = ref(null);
|
|
const mapRef = ref(null);
|
|
|
-const showDetail = ref(false);
|
|
|
|
|
|
|
+// 0:图表(作物分布,物候期分布,预警分布),1:农场分布,2:农服管理
|
|
|
|
|
+const panelType = ref(0);
|
|
|
const treeRef = ref(null);
|
|
const treeRef = ref(null);
|
|
|
|
|
|
|
|
// 区域作物面积和产量数据
|
|
// 区域作物面积和产量数据
|
|
@@ -177,198 +182,10 @@ import lb from "@/assets/images/map/type/小麦.png";
|
|
|
import coldChainIcon from "@/assets/images/common/legend-icon-1.png";
|
|
import coldChainIcon from "@/assets/images/common/legend-icon-1.png";
|
|
|
import factoryIcon from "@/assets/images/common/legend-icon-2.png";
|
|
import factoryIcon from "@/assets/images/common/legend-icon-2.png";
|
|
|
|
|
|
|
|
-const phenologyData = [
|
|
|
|
|
- {
|
|
|
|
|
- id: 1,
|
|
|
|
|
- label: "果类",
|
|
|
|
|
- color: "#51B2FF",
|
|
|
|
|
- fillColor: "rgba(5, 49, 84, 0.5)",
|
|
|
|
|
- geom: "MULTIPOLYGON (((113.58668302396221 23.244659822289524, 113.32095411231998 23.24298858095617, 112.99338890476295 23.002328435946534, 113.13878785387456 22.604570799124076, 113.59503930394511 22.86862839611681, 113.58668302396221 23.244659822289524)))",
|
|
|
|
|
- children: [
|
|
|
|
|
- {
|
|
|
|
|
- id: 4,
|
|
|
|
|
- label: "荔枝",
|
|
|
|
|
- color: "#2199F8",
|
|
|
|
|
- imgUrl: "https://birdseye-img.sysuimars.com/temp/pz/%E8%8D%94%E6%9E%9D.png",
|
|
|
|
|
- imgName: lz,
|
|
|
|
|
- children: [
|
|
|
|
|
- {
|
|
|
|
|
- id: 13,
|
|
|
|
|
- label: "秋梢期",
|
|
|
|
|
- color: "#58B5FF",
|
|
|
|
|
- imgName: lz,
|
|
|
|
|
- wktArr: [
|
|
|
|
|
- "POINT(113.33722309500006 23.204074978290652)",
|
|
|
|
|
- "POINT(113.53593237057355 23.188789823486065)",
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 14,
|
|
|
|
|
- label: "膨果期",
|
|
|
|
|
- color: "#1688E3",
|
|
|
|
|
- imgName: lz,
|
|
|
|
|
- wktArr: [
|
|
|
|
|
- "POINT(113.32095411231998 23.24298858095617)",
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 15,
|
|
|
|
|
- label: "成熟期",
|
|
|
|
|
- color: "#3D8CCB",
|
|
|
|
|
- imgName: lz,
|
|
|
|
|
- wktArr: [
|
|
|
|
|
- "POINT(113.36970447853234 23.064596505297875)",
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 55,
|
|
|
|
|
- label: "龙眼",
|
|
|
|
|
- color: "#2199F8",
|
|
|
|
|
- imgUrl: "https://birdseye-img.sysuimars.com/temp/pz/%E7%99%BD%E7%B3%96.png",
|
|
|
|
|
- imgName: ly,
|
|
|
|
|
- children: [
|
|
|
|
|
- {
|
|
|
|
|
- id: 16,
|
|
|
|
|
- label: "秋梢期",
|
|
|
|
|
- color: "#5986AA",
|
|
|
|
|
- imgName: ly,
|
|
|
|
|
- wktArr: [
|
|
|
|
|
- "POINT(113.29900983080294 22.949956545068478)",
|
|
|
|
|
- "POINT(113.10412186488536 22.800924630297875)",
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 17,
|
|
|
|
|
- label: "膨果期",
|
|
|
|
|
- color: "#79ABD3",
|
|
|
|
|
- imgName: ly,
|
|
|
|
|
- wktArr: [
|
|
|
|
|
- "POINT(113.32384842738536 22.776086033715462)",
|
|
|
|
|
- "POINT(113.22640444442656 22.90983245840535)",
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 2,
|
|
|
|
|
- label: "粮食",
|
|
|
|
|
- color: "#FF8E1C",
|
|
|
|
|
- fillColor: "rgba(83, 46, 8, 0.5)",
|
|
|
|
|
- geom: "MULTIPOLYGON (((112.42256410334443 23.14863707066071, 112.09584019992684 22.842930537988664, 112.25060416300033 22.62511471413565, 112.80278650958275 22.749307864685775, 112.75119857777094 23.13144100957107, 112.42256410334443 23.14863707066071)))",
|
|
|
|
|
- children: [
|
|
|
|
|
- {
|
|
|
|
|
- id: 5,
|
|
|
|
|
- label: "水稻",
|
|
|
|
|
- color: "#FAA53D",
|
|
|
|
|
- imgUrl: "https://birdseye-img.sysuimars.com/temp/pz/%E6%8C%82%E7%BB%BF.png",
|
|
|
|
|
- imgName: sd,
|
|
|
|
|
- children: [
|
|
|
|
|
- {
|
|
|
|
|
- id: 10,
|
|
|
|
|
- label: "拔节期",
|
|
|
|
|
- color: "#985400",
|
|
|
|
|
- imgName: sd,
|
|
|
|
|
- wktArr: [
|
|
|
|
|
- "POINT(112.36777193304151 22.73892833157863)",
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 11,
|
|
|
|
|
- label: "孕穗期",
|
|
|
|
|
- color: "#512D00",
|
|
|
|
|
- imgName: sd,
|
|
|
|
|
- wktArr: [
|
|
|
|
|
- "POINT(112.26684873669083 22.71150357559281)",
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 12,
|
|
|
|
|
- label: "抽穗期",
|
|
|
|
|
- color: "#DD871D",
|
|
|
|
|
- imgName: sd,
|
|
|
|
|
- wktArr: [
|
|
|
|
|
- "POINT(112.65408646638161 22.84862740364581)",
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 6,
|
|
|
|
|
- label: "小麦",
|
|
|
|
|
- color: "#FAA53D",
|
|
|
|
|
- imgUrl: "https://birdseye-img.sysuimars.com/temp/pz/%E6%97%A0%E6%A0%B8.png",
|
|
|
|
|
- imgName: xm,
|
|
|
|
|
- children: [
|
|
|
|
|
- {
|
|
|
|
|
- id: 18,
|
|
|
|
|
- label: "拔节期",
|
|
|
|
|
- color: "#FAA53D",
|
|
|
|
|
- imgName: xm,
|
|
|
|
|
- wktArr: [
|
|
|
|
|
- "POINT(112.36777193304151 22.73892833157863)",
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 3,
|
|
|
|
|
- label: "蔬菜",
|
|
|
|
|
- color: "#25BC07",
|
|
|
|
|
- fillColor: "rgba(0, 69, 4, 0.5)",
|
|
|
|
|
- children: [
|
|
|
|
|
- {
|
|
|
|
|
- id: 7,
|
|
|
|
|
- label: "白菜",
|
|
|
|
|
- color: "#7ABB00",
|
|
|
|
|
- imgUrl: "https://birdseye-img.sysuimars.com/temp/pz/%E7%99%BD%E8%8F%9C.png",
|
|
|
|
|
- imgName: bc,
|
|
|
|
|
- children: [
|
|
|
|
|
- {
|
|
|
|
|
- id: 19,
|
|
|
|
|
- label: "拔节期",
|
|
|
|
|
- color: "#7ABB00",
|
|
|
|
|
- imgName: bc,
|
|
|
|
|
- wktArr: [
|
|
|
|
|
- "POINT(110.34100329503417 21.516399336978793)",
|
|
|
|
|
- "POINT(113.89499662443995 22.653799122199416)",
|
|
|
|
|
- "POINT(113.9329988323152 22.653600638732314)",
|
|
|
|
|
- "POINT(113.94400024786592 22.614900553599)",
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 8,
|
|
|
|
|
- label: "萝卜",
|
|
|
|
|
- color: "#7ABB00",
|
|
|
|
|
- imgUrl: "https://birdseye-img.sysuimars.com/temp/pz/%E8%90%9D%E8%8F%9C.png",
|
|
|
|
|
- imgName: lb,
|
|
|
|
|
- children: [
|
|
|
|
|
- {
|
|
|
|
|
- id: 20,
|
|
|
|
|
- label: "拔节期",
|
|
|
|
|
- color: "#7ABB00",
|
|
|
|
|
- imgName: lb,
|
|
|
|
|
- wktArr: [
|
|
|
|
|
- "POINT(110.34100329503417 21.516399336978793)",
|
|
|
|
|
- "POINT(113.89499662443995 22.653799122199416)",
|
|
|
|
|
- "POINT(113.9329988323152 22.653600638732314)",
|
|
|
|
|
- "POINT(113.94400024786592 22.614900553599)",
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- },
|
|
|
|
|
-];
|
|
|
|
|
|
|
|
|
|
const treeActionData = ref([]);
|
|
const treeActionData = ref([]);
|
|
|
|
|
+// 保存原始数据,用于恢复
|
|
|
|
|
+const originalTreeData = ref([]);
|
|
|
|
|
|
|
|
// 物候期分布下,当前激活的“二级”节点(只允许一个)
|
|
// 物候期分布下,当前激活的“二级”节点(只允许一个)
|
|
|
const activePhenologySecondId = ref(null);
|
|
const activePhenologySecondId = ref(null);
|
|
@@ -436,6 +253,11 @@ onMounted(async () => {
|
|
|
// ai与地图交互
|
|
// ai与地图交互
|
|
|
eventBus.off("chat:showMapLayer", handleMapLayer);
|
|
eventBus.off("chat:showMapLayer", handleMapLayer);
|
|
|
eventBus.on("chat:showMapLayer", handleMapLayer);
|
|
eventBus.on("chat:showMapLayer", handleMapLayer);
|
|
|
|
|
+
|
|
|
|
|
+ // 时间轴
|
|
|
|
|
+ eventBus.on("weatherTime:changeTime", ({index}) => {
|
|
|
|
|
+ handleTimeChange(index)
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
// 注意:getRegionCropAreaYield 会在省级列表加载完成后自动调用(在 lazyLoad 中)
|
|
// 注意:getRegionCropAreaYield 会在省级列表加载完成后自动调用(在 lazyLoad 中)
|
|
|
// 如果 areaVal 已经有值,则立即调用
|
|
// 如果 areaVal 已经有值,则立即调用
|
|
@@ -444,6 +266,10 @@ onMounted(async () => {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+const handleTimeChange = (index) => {
|
|
|
|
|
+ console.log('index', index);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const getRegionCropAreaYield = async (adminCode) => {
|
|
const getRegionCropAreaYield = async (adminCode) => {
|
|
|
const code = adminCode || (areaVal.value && areaVal.value.length > 0 ? areaVal.value[areaVal.value.length - 1] : '156440000');
|
|
const code = adminCode || (areaVal.value && areaVal.value.length > 0 ? areaVal.value[areaVal.value.length - 1] : '156440000');
|
|
|
|
|
|
|
@@ -485,29 +311,40 @@ const handleDistributionTreeDefault = () => {
|
|
|
|
|
|
|
|
// 物候期分布默认选中并展开第一个节点,在地图上显示对应分布图层
|
|
// 物候期分布默认选中并展开第一个节点,在地图上显示对应分布图层
|
|
|
const handlePhenologyLayer = async () => {
|
|
const handlePhenologyLayer = async () => {
|
|
|
- const firstCategory = treeActionData.value[0].children[0];
|
|
|
|
|
|
|
+ const firstCategory = treeActionData.value[0].items[0];
|
|
|
getCommonMapData(firstCategory);
|
|
getCommonMapData(firstCategory);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 物候期分布树形结构默认展开与默认选中
|
|
// 物候期分布树形结构默认展开与默认选中
|
|
|
const handlePhenologyTreeDefault = () => {
|
|
const handlePhenologyTreeDefault = () => {
|
|
|
- defaultCheckedKeys.value = [
|
|
|
|
|
- treeActionData.value[0]?.children[0]?.id,
|
|
|
|
|
- ...(treeActionData.value[0]?.children[0]?.children?.map((c) => c.id) || []),
|
|
|
|
|
- ];
|
|
|
|
|
- defaultExpandedKeys.value = [treeActionData.value[0]?.children[0]?.id];
|
|
|
|
|
|
|
+ const firstSecondLevel = treeActionData.value[0]?.items?.[0];
|
|
|
|
|
+ if (!firstSecondLevel) return;
|
|
|
|
|
+
|
|
|
|
|
+ const secondLevelId = firstSecondLevel.id;
|
|
|
|
|
+ const thirdLevelIds = firstSecondLevel.items?.map((c) => c.id) || [];
|
|
|
|
|
+
|
|
|
|
|
+ defaultCheckedKeys.value = [secondLevelId, ...thirdLevelIds];
|
|
|
|
|
+ defaultExpandedKeys.value = [firstSecondLevel.items[0].id];
|
|
|
|
|
+
|
|
|
|
|
+ // 手动设置选中和展开状态
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
|
+ if (treeRef.value) {
|
|
|
|
|
+ // 设置选中(包括第二级和所有第三级)
|
|
|
|
|
+ treeRef.value.setCheckedKeys([secondLevelId, ...thirdLevelIds]);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 预警分布默认选中并展开第一个节点,在地图上显示对应分布图层
|
|
// 预警分布默认选中并展开第一个节点,在地图上显示对应分布图层
|
|
|
const handleAlarmLayer = async () => {
|
|
const handleAlarmLayer = async () => {
|
|
|
- const firstCategory = treeActionData.value[0].children[0];
|
|
|
|
|
|
|
+ const firstCategory = treeActionData.value[0].items[0];
|
|
|
getCommonMapData(firstCategory);
|
|
getCommonMapData(firstCategory);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 预警分布树形结构默认展开与默认选中
|
|
// 预警分布树形结构默认展开与默认选中
|
|
|
const handleAlarmTreeDefault = () => {
|
|
const handleAlarmTreeDefault = () => {
|
|
|
defaultCheckedKeys.value = [
|
|
defaultCheckedKeys.value = [
|
|
|
- treeActionData.value[0]?.children[0]?.id
|
|
|
|
|
|
|
+ treeActionData.value[0]?.items[0]?.id
|
|
|
];
|
|
];
|
|
|
defaultExpandedKeys.value = [treeActionData.value[0]?.id];
|
|
defaultExpandedKeys.value = [treeActionData.value[0]?.id];
|
|
|
};
|
|
};
|
|
@@ -530,8 +367,14 @@ const getCommonMapData = async (firstCategory) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const lastLevelNodes = getLastLevelNodes(firstCategory);
|
|
const lastLevelNodes = getLastLevelNodes(firstCategory);
|
|
|
|
|
+ if (activeBaseTab.value === "物候期分布") {
|
|
|
|
|
+ // 等待接口返回数据
|
|
|
|
|
+ const lastLevelIds = lastLevelNodes.map((n) => n.originalId);
|
|
|
|
|
+ const phenologyData = await getDistributionData(null, lastLevelIds);
|
|
|
|
|
+ distributionLayer.initData(phenologyData, 'phenologyName');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
const lastLevelIds = lastLevelNodes.map((n) => n.id);
|
|
const lastLevelIds = lastLevelNodes.map((n) => n.id);
|
|
|
-
|
|
|
|
|
// 并发请求所有数据
|
|
// 并发请求所有数据
|
|
|
const promises = lastLevelIds.map((id) => getDistributionData(id));
|
|
const promises = lastLevelIds.map((id) => getDistributionData(id));
|
|
|
const results = await Promise.all(promises);
|
|
const results = await Promise.all(promises);
|
|
@@ -582,29 +425,59 @@ const handleTabClick = (item) => {
|
|
|
if (distributionLayer) {
|
|
if (distributionLayer) {
|
|
|
distributionLayer.clear();
|
|
distributionLayer.clear();
|
|
|
}
|
|
}
|
|
|
|
|
+ panelType.value = 0;
|
|
|
// 所有操作前,先清空图层和选中项
|
|
// 所有操作前,先清空图层和选中项
|
|
|
legendImg.value = "";
|
|
legendImg.value = "";
|
|
|
staticMapLayers && staticMapLayers.hideAll();
|
|
staticMapLayers && staticMapLayers.hideAll();
|
|
|
// 通知预警列表组件清空默认选中项
|
|
// 通知预警列表组件清空默认选中项
|
|
|
eventBus.emit("warningHome:clearAlarm");
|
|
eventBus.emit("warningHome:clearAlarm");
|
|
|
// 使用 nextTick 确保树组件数据更新后再设置选中状态
|
|
// 使用 nextTick 确保树组件数据更新后再设置选中状态
|
|
|
- nextTick(() => {
|
|
|
|
|
if (treeRef.value) {
|
|
if (treeRef.value) {
|
|
|
|
|
+ defaultCheckedKeys.value = [];
|
|
|
|
|
+ defaultExpandedKeys.value = [];
|
|
|
// 先清空所有选中项
|
|
// 先清空所有选中项
|
|
|
treeRef.value.setCheckedKeys([]);
|
|
treeRef.value.setCheckedKeys([]);
|
|
|
- // 再设置新的选中项
|
|
|
|
|
- treeRef.value.setCheckedKeys(defaultCheckedKeys.value);
|
|
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
|
|
|
switch (item) {
|
|
switch (item) {
|
|
|
case "作物分布":
|
|
case "作物分布":
|
|
|
|
|
+ // 恢复原始数据
|
|
|
|
|
+ if (originalTreeData.value.length > 0) {
|
|
|
|
|
+ treeActionData.value = JSON.parse(JSON.stringify(originalTreeData.value));
|
|
|
|
|
+ }
|
|
|
handleDistributionTreeDefault();
|
|
handleDistributionTreeDefault();
|
|
|
handleDistributionLayer();
|
|
handleDistributionLayer();
|
|
|
break;
|
|
break;
|
|
|
case "物候期分布":
|
|
case "物候期分布":
|
|
|
- treeActionData.value = phenologyData;
|
|
|
|
|
- handlePhenologyTreeDefault()
|
|
|
|
|
|
|
+ // 先恢复原始数据,再修改第二级 children 的 items 字段为 phenologies
|
|
|
|
|
+ if (originalTreeData.value.length > 0) {
|
|
|
|
|
+ treeActionData.value = JSON.parse(JSON.stringify(originalTreeData.value));
|
|
|
|
|
+ }
|
|
|
|
|
+ // 修改第二级 children 的 items 字段为 phenologies,不修改其他项
|
|
|
|
|
+ treeActionData.value = treeActionData.value.map((firstLevel) => {
|
|
|
|
|
+ if (firstLevel.items && Array.isArray(firstLevel.items)) {
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...firstLevel,
|
|
|
|
|
+ items: firstLevel.items.map((secondLevel) => {
|
|
|
|
|
+ // 如果第二级有 phenologies 字段,将其设置为 items
|
|
|
|
|
+ if (secondLevel.phenologies) {
|
|
|
|
|
+ secondLevel.phenologies.forEach((phenology) => {
|
|
|
|
|
+ phenology.originalId = phenology.id;
|
|
|
|
|
+ phenology.id = 'phenology_' + phenology.id;
|
|
|
|
|
+ });
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...secondLevel,
|
|
|
|
|
+ items: secondLevel.phenologies,
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ return secondLevel;
|
|
|
|
|
+ }),
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ return firstLevel;
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log('222222222222treeActionData.value', treeActionData.value);
|
|
|
|
|
+ handlePhenologyTreeDefault();
|
|
|
handlePhenologyLayer();
|
|
handlePhenologyLayer();
|
|
|
break;
|
|
break;
|
|
|
case "预警分布":
|
|
case "预警分布":
|
|
@@ -614,6 +487,7 @@ const handleTabClick = (item) => {
|
|
|
eventBus.emit("warningHome:activeFirstAlarmFactor");
|
|
eventBus.emit("warningHome:activeFirstAlarmFactor");
|
|
|
break;
|
|
break;
|
|
|
case "农场分布":
|
|
case "农场分布":
|
|
|
|
|
+ panelType.value = 1;
|
|
|
const cropData = [
|
|
const cropData = [
|
|
|
{
|
|
{
|
|
|
id: 4,
|
|
id: 4,
|
|
@@ -661,6 +535,9 @@ const handleTabClick = (item) => {
|
|
|
distributionLayer.initData(cropData);
|
|
distributionLayer.initData(cropData);
|
|
|
distributionLayer.initFacilityData(facilityData);
|
|
distributionLayer.initFacilityData(facilityData);
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case "农服管理":
|
|
|
|
|
+ panelType.value = 2;
|
|
|
|
|
+ break;
|
|
|
default:
|
|
default:
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -669,13 +546,16 @@ const handleTabClick = (item) => {
|
|
|
const getSpeciesListData = async () => {
|
|
const getSpeciesListData = async () => {
|
|
|
const res = await VE_API.species.speciesList();
|
|
const res = await VE_API.species.speciesList();
|
|
|
treeActionData.value = res.data;
|
|
treeActionData.value = res.data;
|
|
|
|
|
+ // 保存原始数据副本(深拷贝)
|
|
|
|
|
+ originalTreeData.value = JSON.parse(JSON.stringify(res.data));
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const getDistributionData = async (speciesId) => {
|
|
|
|
|
|
|
+const getDistributionData = async (speciesId, phenologyIds) => {
|
|
|
const {data} = await VE_API.agri_land_crop.queryDistribution({
|
|
const {data} = await VE_API.agri_land_crop.queryDistribution({
|
|
|
year: 2025,
|
|
year: 2025,
|
|
|
quarter: 1,
|
|
quarter: 1,
|
|
|
- speciesId
|
|
|
|
|
|
|
+ speciesId,
|
|
|
|
|
+ phenologyIds: phenologyIds || []
|
|
|
});
|
|
});
|
|
|
return data;
|
|
return data;
|
|
|
};
|
|
};
|
|
@@ -880,10 +760,19 @@ const getTreeChecks = async (nodeData, data) => {
|
|
|
|
|
|
|
|
// 任意 tab 下,最终都用当前选中的节点驱动地图渲染
|
|
// 任意 tab 下,最终都用当前选中的节点驱动地图渲染
|
|
|
// 提取最后一级节点的 id 到数组(没有子节点的叶子节点)
|
|
// 提取最后一级节点的 id 到数组(没有子节点的叶子节点)
|
|
|
|
|
+ const field = activeBaseTab.value === "物候期分布" ? "originalId" : "id";
|
|
|
const lastLevelIds = finalCheckedNodes
|
|
const lastLevelIds = finalCheckedNodes
|
|
|
.filter((n) => (!n.items || n.items.length === 0) && (!n.children || n.children.length === 0))
|
|
.filter((n) => (!n.items || n.items.length === 0) && (!n.children || n.children.length === 0))
|
|
|
- .map((n) => n.id);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ .map((n) => n[field]);
|
|
|
|
|
+ if (lastLevelIds && lastLevelIds.length === 0) {
|
|
|
|
|
+ distributionLayer.initData([]);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (activeBaseTab.value === "物候期分布") {
|
|
|
|
|
+ const phenologyData = await getDistributionData(null, lastLevelIds);
|
|
|
|
|
+ distributionLayer.initData(phenologyData, 'phenologyName');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
// 并发请求所有数据,等待所有 Promise 完成
|
|
// 并发请求所有数据,等待所有 Promise 完成
|
|
|
const promises = lastLevelIds.map((id) => {
|
|
const promises = lastLevelIds.map((id) => {
|
|
|
const node = finalCheckedNodes.find((n) => n.id === id);
|
|
const node = finalCheckedNodes.find((n) => n.id === id);
|
|
@@ -954,6 +843,8 @@ const getTreeChecks = async (nodeData, data) => {
|
|
|
align-items: baseline;
|
|
align-items: baseline;
|
|
|
::v-deep {
|
|
::v-deep {
|
|
|
.el-tree {
|
|
.el-tree {
|
|
|
|
|
+ max-height: 400px;
|
|
|
|
|
+ overflow: auto;
|
|
|
background: #232323;
|
|
background: #232323;
|
|
|
border: 1px solid #444444;
|
|
border: 1px solid #444444;
|
|
|
border-radius: 5px;
|
|
border-radius: 5px;
|