|
@@ -15,13 +15,13 @@
|
|
|
<!-- 作物档案 -->
|
|
<!-- 作物档案 -->
|
|
|
<div class="archives-time-line" :class="{ 'no-top': !varietyTabs.length && !gardenId }" v-show="activeGardenTab === 'current'">
|
|
<div class="archives-time-line" :class="{ 'no-top': !varietyTabs.length && !gardenId }" v-show="activeGardenTab === 'current'">
|
|
|
<div class="archives-time-line-header">
|
|
<div class="archives-time-line-header">
|
|
|
- <div class="line-title" @click="handlePage">农情档案</div>
|
|
|
|
|
|
|
+ <div class="line-title">农情档案</div>
|
|
|
<div class="header-right">
|
|
<div class="header-right">
|
|
|
<div class="add-variety-btn" v-if="varietyTabs.length > 0" @click="handleAddVariety">
|
|
<div class="add-variety-btn" v-if="varietyTabs.length > 0" @click="handleAddVariety">
|
|
|
<span>分区管理</span>
|
|
<span>分区管理</span>
|
|
|
</div>
|
|
</div>
|
|
|
<el-date-picker
|
|
<el-date-picker
|
|
|
- style="width: 110px"
|
|
|
|
|
|
|
+ style="width: 100px"
|
|
|
:editable="false"
|
|
:editable="false"
|
|
|
v-model="date"
|
|
v-model="date"
|
|
|
type="year"
|
|
type="year"
|
|
@@ -31,10 +31,16 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<!-- 品种选择 -->
|
|
<!-- 品种选择 -->
|
|
|
|
|
+ <div class="variety-tabs" v-if="farmsCategoryList.length > 0">
|
|
|
|
|
+ <div v-for="(v, index) in farmsCategoryList" :key="index" class="variety-tab"
|
|
|
|
|
+ :class="{ 'variety-tab--active': activeFarmsCategory === v.speciesId }" @click="handleFarmsCategoryClick(v, index)">
|
|
|
|
|
+ {{ v.speciesName }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
<div class="variety-tabs" v-if="varietyTabs.length > 0">
|
|
<div class="variety-tabs" v-if="varietyTabs.length > 0">
|
|
|
<div v-for="(v, index) in varietyTabs" :key="index" class="variety-tab"
|
|
<div v-for="(v, index) in varietyTabs" :key="index" class="variety-tab"
|
|
|
:class="{ 'variety-tab--active': activeVariety === index }" @click="handleVarietyClick(v, index)">
|
|
:class="{ 'variety-tab--active': activeVariety === index }" @click="handleVarietyClick(v, index)">
|
|
|
- {{ v.regionName || v.problemZoneTypeName }}
|
|
|
|
|
|
|
+ {{ v.regionName }}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<template v-if="!varietyTabs.length">
|
|
<template v-if="!varietyTabs.length">
|
|
@@ -44,24 +50,11 @@
|
|
|
专属数字农场,种好卖好
|
|
专属数字农场,种好卖好
|
|
|
<div>点击解锁一键溯源增产</div>
|
|
<div>点击解锁一键溯源增产</div>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
<div class="lock-btn">点击解锁</div>
|
|
<div class="lock-btn">点击解锁</div>
|
|
|
</div>
|
|
</div>
|
|
|
<img class="example-img" src="@/assets/img/monitor/example.png" alt="">
|
|
<img class="example-img" src="@/assets/img/monitor/example.png" alt="">
|
|
|
</template>
|
|
</template>
|
|
|
<div class="archives-time-line-content">
|
|
<div class="archives-time-line-content">
|
|
|
- <!-- <div class="report-box" v-if="hasReport">
|
|
|
|
|
- <div class="box-content">
|
|
|
|
|
- <div class="box-title" @click="handleReportClick">
|
|
|
|
|
- <span>农情互动报告</span>
|
|
|
|
|
- <el-icon>
|
|
|
|
|
- <CaretRight />
|
|
|
|
|
- </el-icon>
|
|
|
|
|
- </div>
|
|
|
|
|
- <span class="box-text">点击查看您的长势报告</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- <img src="@/assets/img/monitor/report-icon.png" alt="" class="report-icon" />
|
|
|
|
|
- </div> -->
|
|
|
|
|
<div class="time-line">
|
|
<div class="time-line">
|
|
|
<archives-farm-time-line :year="date.getFullYear()" :problemZoneId="currentVariety?.id" :farmId="farmIdData" :regionId="regionData" @card-click="handleCardClick"></archives-farm-time-line>
|
|
<archives-farm-time-line :year="date.getFullYear()" :problemZoneId="currentVariety?.id" :farmId="farmIdData" :regionId="regionData" @card-click="handleCardClick"></archives-farm-time-line>
|
|
|
</div>
|
|
</div>
|
|
@@ -87,20 +80,15 @@ import wx from "weixin-js-sdk";
|
|
|
import weatherInfo from "@/components/weatherInfo.vue";
|
|
import weatherInfo from "@/components/weatherInfo.vue";
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
import selectRegionPopup from "@/components/popup/selectRegionPopup.vue";
|
|
import selectRegionPopup from "@/components/popup/selectRegionPopup.vue";
|
|
|
-import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
|
|
import ArchivesFarmTimeLine from "@/components/pageComponents/ArchivesFarmTimeLine.vue";
|
|
import ArchivesFarmTimeLine from "@/components/pageComponents/ArchivesFarmTimeLine.vue";
|
|
|
import agriExecutePopup from "@/components/popup/agriExecutePopup.vue";
|
|
import agriExecutePopup from "@/components/popup/agriExecutePopup.vue";
|
|
|
import startInteractPopup from "@/components/popup/startInteractPopup.vue";
|
|
import startInteractPopup from "@/components/popup/startInteractPopup.vue";
|
|
|
import gardenList from "@/components/gardenList.vue";
|
|
import gardenList from "@/components/gardenList.vue";
|
|
|
|
|
|
|
|
const startInteractPopupRef = ref(null);
|
|
const startInteractPopupRef = ref(null);
|
|
|
-const handlePage = () => {
|
|
|
|
|
- // router.push("/interaction_list");
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
const agriExecutePopupRef = ref(null);
|
|
const agriExecutePopupRef = ref(null);
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// 品种选择(作物档案内)- 根据主体ID动态获取分区列表
|
|
// 品种选择(作物档案内)- 根据主体ID动态获取分区列表
|
|
|
const varietyTabs = ref([]);
|
|
const varietyTabs = ref([]);
|
|
|
const activeVariety = ref(0);
|
|
const activeVariety = ref(0);
|
|
@@ -113,9 +101,6 @@ const getVarietyTabs = async (isShowPopup = true) => {
|
|
|
const res = await VE_API.basic_farm.fetchProblemZoneList({
|
|
const res = await VE_API.basic_farm.fetchProblemZoneList({
|
|
|
subjectId: gardenId.value,
|
|
subjectId: gardenId.value,
|
|
|
});
|
|
});
|
|
|
- // if(res.data && res.data.regionList && res.data.problemZones){
|
|
|
|
|
- // varietyTabs.value = res.data.regionList.concat(res.data.problemZones)
|
|
|
|
|
- // }
|
|
|
|
|
varietyTabs.value = res.data?.regionList || []
|
|
varietyTabs.value = res.data?.regionList || []
|
|
|
if (varietyTabs.value.length > 0) {
|
|
if (varietyTabs.value.length > 0) {
|
|
|
handleVarietyClick(varietyTabs.value[activeVariety.value || 0], activeVariety.value || 0)
|
|
handleVarietyClick(varietyTabs.value[activeVariety.value || 0], activeVariety.value || 0)
|
|
@@ -160,7 +145,6 @@ const disabledYearDate = (time) => {
|
|
|
const showSelectRegionPopup = ref(false);
|
|
const showSelectRegionPopup = ref(false);
|
|
|
|
|
|
|
|
const handleAddVariety = () => {
|
|
const handleAddVariety = () => {
|
|
|
- // router.push("/interaction?addVariety=true&subjectId=" + gardenId.value);
|
|
|
|
|
router.push(`/draw_area?subjectId=${gardenId.value}&type=viewOnly`);
|
|
router.push(`/draw_area?subjectId=${gardenId.value}&type=viewOnly`);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -179,8 +163,6 @@ const handleGoSelectRegion = () => {
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const showFarmPopup = ref(false); // 农场领取成功弹窗
|
|
|
|
|
-
|
|
|
|
|
const defaultGardenId = ref(null);
|
|
const defaultGardenId = ref(null);
|
|
|
const selectedGardenId = ref(null);
|
|
const selectedGardenId = ref(null);
|
|
|
const gardenListRef = ref(null);
|
|
const gardenListRef = ref(null);
|
|
@@ -199,7 +181,6 @@ const handleGardenSelected = (garden) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const isHeaderShow = ref(false);
|
|
const isHeaderShow = ref(false);
|
|
|
-const isDefaultFarm = ref(false);
|
|
|
|
|
const weatherInfoRef = ref(null);
|
|
const weatherInfoRef = ref(null);
|
|
|
onActivated(() => {
|
|
onActivated(() => {
|
|
|
sessionStorage.removeItem('interactionListScrollTop');
|
|
sessionStorage.removeItem('interactionListScrollTop');
|
|
@@ -207,8 +188,6 @@ onActivated(() => {
|
|
|
if (route.query.isHeaderShow) {
|
|
if (route.query.isHeaderShow) {
|
|
|
isHeaderShow.value = true;
|
|
isHeaderShow.value = true;
|
|
|
defaultGardenId.value = route.query.farmId;
|
|
defaultGardenId.value = route.query.farmId;
|
|
|
- // 统一转换为布尔值
|
|
|
|
|
- isDefaultFarm.value = route.query.defaultFarm === "true" || route.query.defaultFarm === true;
|
|
|
|
|
}
|
|
}
|
|
|
const savedFarmId = localStorage.getItem("selectedFarmId");
|
|
const savedFarmId = localStorage.getItem("selectedFarmId");
|
|
|
selectedGardenId.value = savedFarmId ? Number(savedFarmId) : null;
|
|
selectedGardenId.value = savedFarmId ? Number(savedFarmId) : null;
|
|
@@ -239,8 +218,6 @@ const handleLockClick = () => {
|
|
|
|
|
|
|
|
// 组件卸载时停止语音播放
|
|
// 组件卸载时停止语音播放
|
|
|
onDeactivated(() => {
|
|
onDeactivated(() => {
|
|
|
- showFarmPopup.value = false;
|
|
|
|
|
- isDefaultFarm.value = false;
|
|
|
|
|
regionData.value = null;
|
|
regionData.value = null;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -258,12 +235,21 @@ const handleMaskClick = () => {
|
|
|
|
|
|
|
|
const gardenId = ref(store.state.home.gardenId);
|
|
const gardenId = ref(store.state.home.gardenId);
|
|
|
|
|
|
|
|
-// 初始化加载数据
|
|
|
|
|
-onMounted(() => {
|
|
|
|
|
- if (gardenId.value) {
|
|
|
|
|
- getVarietyTabs();
|
|
|
|
|
|
|
+const farmsCategoryList = ref([]);
|
|
|
|
|
+const activeFarmsCategory = ref(null);
|
|
|
|
|
+const getListFarmsBySubjectId = async () => {
|
|
|
|
|
+ const res = await VE_API.monitor.listFarmsBySubjectId({
|
|
|
|
|
+ subjectId: gardenId.value,
|
|
|
|
|
+ });
|
|
|
|
|
+ farmsCategoryList.value = res.data || [];
|
|
|
|
|
+ if(farmsCategoryList.value.length > 0){
|
|
|
|
|
+ activeFarmsCategory.value = res.data[0].speciesId;
|
|
|
}
|
|
}
|
|
|
-});
|
|
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const handleFarmsCategoryClick = (tab, index) => {
|
|
|
|
|
+ activeFarmsCategory.value = tab.speciesId;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const changeGarden = ({ id }) => {
|
|
const changeGarden = ({ id }) => {
|
|
|
gardenId.value = id;
|
|
gardenId.value = id;
|
|
@@ -276,17 +262,11 @@ const changeGarden = ({ id }) => {
|
|
|
// 更新 store 中的状态
|
|
// 更新 store 中的状态
|
|
|
store.commit("home/SET_GARDEN_ID", id);
|
|
store.commit("home/SET_GARDEN_ID", id);
|
|
|
getVarietyTabs();
|
|
getVarietyTabs();
|
|
|
|
|
+ getListFarmsBySubjectId();
|
|
|
|
|
|
|
|
startInteractPopupRef.value.getPhenologyInitOrConfirmStatus();
|
|
startInteractPopupRef.value.getPhenologyInitOrConfirmStatus();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-function handleReportClick() {
|
|
|
|
|
- router.push({
|
|
|
|
|
- path: "/growth_report",
|
|
|
|
|
- query: { farmId: gardenId.value },
|
|
|
|
|
- });
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
const handleCardClick = () => {
|
|
const handleCardClick = () => {
|
|
|
sessionStorage.setItem('activeVariety', activeVariety.value);
|
|
sessionStorage.setItem('activeVariety', activeVariety.value);
|
|
|
}
|
|
}
|
|
@@ -364,7 +344,7 @@ const handleCardClick = () => {
|
|
|
.archives-time-line {
|
|
.archives-time-line {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
padding: 150px 12px 12px 12px;
|
|
padding: 150px 12px 12px 12px;
|
|
|
- height: calc(100% - 90px);
|
|
|
|
|
|
|
+ height: calc(100% - 158px);
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
min-height: 0;
|
|
min-height: 0;
|
|
@@ -451,36 +431,6 @@ const handleCardClick = () => {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
- .report-box {
|
|
|
|
|
- background: linear-gradient(120deg, #eef8ff, #bbe3ff);
|
|
|
|
|
- border-radius: 4px;
|
|
|
|
|
- padding: 6px 0 0 16px;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: space-between;
|
|
|
|
|
- margin-bottom: 12px;
|
|
|
|
|
-
|
|
|
|
|
- .box-content {
|
|
|
|
|
- .box-title {
|
|
|
|
|
- font-size: 16px;
|
|
|
|
|
- color: #2199f8;
|
|
|
|
|
- font-weight: 500;
|
|
|
|
|
- margin-bottom: 4px;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .box-text {
|
|
|
|
|
- color: #4e5969;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .report-icon {
|
|
|
|
|
- width: 120px;
|
|
|
|
|
- height: 85px;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
.time-line {
|
|
.time-line {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
min-height: 0;
|
|
min-height: 0;
|