|
|
@@ -38,17 +38,17 @@
|
|
|
<img class="header-img" src="@/assets/img/home/report.png" alt="" />
|
|
|
|
|
|
<div class="report-header">
|
|
|
- <div class="type-tabs" v-if="regionsData.length > 1">
|
|
|
+ <div class="type-tabs" v-if="subjectData.length > 1">
|
|
|
<div
|
|
|
- @click="handleSwipeChange(index)"
|
|
|
+ @click="handleTypeTabClick(item, index)"
|
|
|
class="type-item"
|
|
|
- v-for="(item, index) in regionsData"
|
|
|
- :class="{ 'type-item-active': currentIndex === index }"
|
|
|
- :key="index">荔枝</div>
|
|
|
+ v-for="(item, index) in subjectData"
|
|
|
+ :class="{ 'type-item-active': activeSubjectIndex === index }"
|
|
|
+ :key="index">{{ item.speciesName }}</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="time-tag">{{ workItems?.[0]?.reportDate }}</div>
|
|
|
- <div class="report-title">{{ regionsData[currentIndex]?.regionName }}长势报告</div>
|
|
|
+ <div class="report-title">{{ subjectData[activeSubjectIndex]?.speciesName }}长势报告</div>
|
|
|
<div class="report-info">
|
|
|
<div class="info-item">
|
|
|
<img class="info-icon" src="@/assets/img/home/farm.png" alt="" />
|
|
|
@@ -109,9 +109,9 @@
|
|
|
<div class="box-text">
|
|
|
<div class="box-bg">
|
|
|
<div class="types-info">
|
|
|
- 当前 <span class="text-bold">桂味</span> 处于为 梢期-新梢萌动<span class="text-link">(校准物候期)</span>,
|
|
|
- 当前 <span class="text-bold">桂某某品种味</span> 处于为 梢期-新梢萌动<span class="text-link">(校准物候期)</span>,
|
|
|
- 当前 <span class="text-bold">某某品种</span> 处于为 梢期-新梢萌动<span class="text-link">(校准物候期)</span>
|
|
|
+ 当前 <span class="text-bold">桂味</span> 处于为 梢期-新梢萌动<span class="text-link" @click="handleAdjustPopup">(校准物候期)</span>,
|
|
|
+ 当前 <span class="text-bold">桂某某品种味</span> 处于为 梢期-新梢萌动<span class="text-link" @click="handleAdjustPopup">(校准物候期)</span>,
|
|
|
+ 当前 <span class="text-bold">某某品种</span> 处于为 梢期-新梢萌动<span class="text-link" @click="handleAdjustPopup">(校准物候期)</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="warning-part">
|
|
|
@@ -138,8 +138,8 @@
|
|
|
<div class="report-box">
|
|
|
<div class="box-title">农事建议</div>
|
|
|
<div class="box-text">
|
|
|
- <div class="warning-part">
|
|
|
- <div class="report-part" v-for="(part, partI) in 3" :key="partI">
|
|
|
+ <div class="warning-part" v-for="(part, partI) in 3" :key="partI">
|
|
|
+ <div class="report-part">
|
|
|
<div class="part-top">
|
|
|
<div class="part-title">某某农事</div>
|
|
|
<div class="part-link">
|
|
|
@@ -226,6 +226,9 @@
|
|
|
<start-interact-popup ref="startInteractPopupRef" />
|
|
|
|
|
|
<agri-execute-popup ref="agriExecutePopupRef" />
|
|
|
+
|
|
|
+ <!-- 校准物候期 -->
|
|
|
+ <adjust-popup ref="adjustPopupRef" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -240,6 +243,7 @@ import tipPopup from "@/components/popup/tipPopup.vue";
|
|
|
import startInteractPopup from "@/components/popup/startInteractPopup.vue";
|
|
|
import agriExecutePopup from "@/components/popup/agriExecutePopup.vue";
|
|
|
import gardenList from "@/components/gardenList.vue";
|
|
|
+import adjustPopup from "./adjustPopup.vue";
|
|
|
|
|
|
const store = useStore();
|
|
|
const tabBarHeight = computed(() => store.state.home.tabBarHeight);
|
|
|
@@ -255,6 +259,11 @@ const paramsPage = ref({});
|
|
|
const showBindSuccess = ref(false);
|
|
|
const startInteractPopupRef = ref(null);
|
|
|
const agriExecutePopupRef = ref(null);
|
|
|
+const adjustPopupRef = ref(null);
|
|
|
+
|
|
|
+const handleAdjustPopup = () => {
|
|
|
+ adjustPopupRef.value.open();
|
|
|
+}
|
|
|
// 天气组件相关
|
|
|
const isExpanded = ref(false);
|
|
|
const weatherInfoRef = ref(null);
|
|
|
@@ -309,6 +318,7 @@ const changeGarden = async ({ id, name }) => {
|
|
|
};
|
|
|
// 初始化品种/大物候期转换
|
|
|
startInteractPopupRef.value.getPhenologyInitOrConfirmStatus();
|
|
|
+ await getSubjectData(id);
|
|
|
await getRegions();
|
|
|
};
|
|
|
|
|
|
@@ -401,7 +411,7 @@ const handleTodayPatrolFocusClick = (card) => {
|
|
|
}
|
|
|
|
|
|
const getTodayPatrolFocus = () => {
|
|
|
- VE_API.report.todayPatrolFocus({ farmId: paramsPage.value.farmId, regionId: paramsPage.value.regionId }).then(({ data }) => {
|
|
|
+ VE_API.report.todayPatrolFocus({ farmId: paramsPage.value.farmId }).then(({ data }) => {
|
|
|
todayPatrolFocus.value = data || [];
|
|
|
});
|
|
|
}
|
|
|
@@ -440,6 +450,23 @@ const getDetail = () => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+const subjectData = ref([])
|
|
|
+
|
|
|
+const getSubjectData = async (id) => {
|
|
|
+ const res = await VE_API.monitor.listFarmsBySubjectId({ subjectId: id });
|
|
|
+ subjectData.value = res.data || [];
|
|
|
+}
|
|
|
+
|
|
|
+const activeSubjectIndex = ref(0);
|
|
|
+const handleTypeTabClick = (item, index) => {
|
|
|
+ activeSubjectIndex.value = index;
|
|
|
+ paramsPage.value = {
|
|
|
+ ...(paramsPage.value || {}),
|
|
|
+ farmId: item.farmId,
|
|
|
+ };
|
|
|
+ getTodayPatrolFocus();
|
|
|
+}
|
|
|
+
|
|
|
const regionsData = ref([]);
|
|
|
const getRegions = async () => {
|
|
|
VE_API.monitor.listRegionsBySubjectId({
|
|
|
@@ -1070,6 +1097,9 @@ onUnmounted(() => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .warning-part + .warning-part {
|
|
|
+ margin-top: 8px;
|
|
|
+ }
|
|
|
.report-part + .report-part {
|
|
|
margin-top: 8px;
|
|
|
}
|