|
@@ -11,18 +11,16 @@
|
|
|
</div> -->
|
|
</div> -->
|
|
|
<div v-for="(p, idx) in phenologyList" :key="`phenology-${uniqueTimestamp}-${idx}`"
|
|
<div v-for="(p, idx) in phenologyList" :key="`phenology-${uniqueTimestamp}-${idx}`"
|
|
|
class="phenology-bar">
|
|
class="phenology-bar">
|
|
|
- <div class="phenology-title"
|
|
|
|
|
- :class="{
|
|
|
|
|
- 'phenology-title--wide': showPhenologyName && !phenologyNeedsTwoLabelColumns(p),
|
|
|
|
|
- 'phenology-red': !shouldShowBlue(p),
|
|
|
|
|
- 'phenology-blue': shouldShowBlue(p),
|
|
|
|
|
- }"
|
|
|
|
|
- v-if="shouldShowPhenologyBarTitle(idx)">
|
|
|
|
|
|
|
+ <div class="phenology-title" :class="{
|
|
|
|
|
+ 'phenology-title--wide': showPhenologyName && !phenologyNeedsTwoLabelColumns(p),
|
|
|
|
|
+ 'phenology-red': !shouldShowBlue(p),
|
|
|
|
|
+ 'phenology-blue': shouldShowBlue(p),
|
|
|
|
|
+ }" v-if="shouldShowPhenologyBarTitle(idx)">
|
|
|
{{ p.phenologyName }}
|
|
{{ p.phenologyName }}
|
|
|
</div>
|
|
</div>
|
|
|
<div v-for="(r, rIdx) in Array.isArray(p.reproductiveList) ? p.reproductiveList : []"
|
|
<div v-for="(r, rIdx) in Array.isArray(p.reproductiveList) ? p.reproductiveList : []"
|
|
|
:key="`reproductive-${uniqueTimestamp}-${idx}-${rIdx}`" class="reproductive-item">
|
|
:key="`reproductive-${uniqueTimestamp}-${idx}-${rIdx}`" class="reproductive-item">
|
|
|
- <div class="arranges" :class="{'arranges-min':!showPhenologyName}">
|
|
|
|
|
|
|
+ <div class="arranges" :class="{ 'arranges-min': !showPhenologyName }">
|
|
|
<div v-for="(fw, aIdx) in Array.isArray(r.farmWorkArrangeList) ? r.farmWorkArrangeList : []"
|
|
<div v-for="(fw, aIdx) in Array.isArray(r.farmWorkArrangeList) ? r.farmWorkArrangeList : []"
|
|
|
:key="`arrange-${uniqueTimestamp}-${idx}-${rIdx}-${aIdx}`" class="arrange-card" :class="[
|
|
:key="`arrange-${uniqueTimestamp}-${idx}-${rIdx}-${aIdx}`" class="arrange-card" :class="[
|
|
|
getArrangeStatusClass(fw),
|
|
getArrangeStatusClass(fw),
|
|
@@ -36,22 +34,21 @@
|
|
|
]" @click="handleRowClick(fw)">
|
|
]" @click="handleRowClick(fw)">
|
|
|
<div class="card-content">
|
|
<div class="card-content">
|
|
|
<div class="card-left"
|
|
<div class="card-left"
|
|
|
|
|
+ @click.stop="handleStatusDetail(fw)"
|
|
|
:style="{ width: fw.sourceDataJson && fw.sourceDataJson.resFilename ? 'calc(100% - 45px)' : '100%' }"
|
|
:style="{ width: fw.sourceDataJson && fw.sourceDataJson.resFilename ? 'calc(100% - 45px)' : '100%' }"
|
|
|
v-if="pageType === 'agri_plan'">
|
|
v-if="pageType === 'agri_plan'">
|
|
|
<div class="left-info">
|
|
<div class="left-info">
|
|
|
<div class="left-date">{{ formatDate(fw.createTime) }}</div>
|
|
<div class="left-date">{{ formatDate(fw.createTime) }}</div>
|
|
|
- <div class="text" @click.stop="handleStatusDetail(fw)">
|
|
|
|
|
|
|
+ <div class="status-tag">{{ archiveTypeObj[fw.archiveType] }}</div>
|
|
|
|
|
+ <div class="text">
|
|
|
<span class="van-ellipsis">{{ fw.title }}</span>
|
|
<span class="van-ellipsis">{{ fw.title }}</span>
|
|
|
- <!-- <el-icon v-if="shouldShowBlue(p)">
|
|
|
|
|
- <ArrowRight />
|
|
|
|
|
- </el-icon> -->
|
|
|
|
|
</div>
|
|
</div>
|
|
|
- <!-- <div class="text green van-ellipsis" v-if="fw?.sourceType === 7">
|
|
|
|
|
- 执行者:{{ fw.sourceDataJson.executorName }}
|
|
|
|
|
- </div> -->
|
|
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="title-text van-ellipsis"
|
|
|
|
|
- v-if="!shouldGrayFarmWorkCard(fw, p) && fw.sourceType != 4">{{ fw.content }}</div>
|
|
|
|
|
|
|
+ <div class="title-text van-ellipsis">{{ fw.description }}</div>
|
|
|
|
|
+ <!-- <div class="title-text van-ellipsis"
|
|
|
|
|
+ v-if="!shouldGrayFarmWorkCard(fw, p) && fw.sourceType != 4">{{ fw.content }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-else class="title-text van-ellipsis">点击查看区域</div> -->
|
|
|
</div>
|
|
</div>
|
|
|
<div class="card-left agri-record-card" v-else>
|
|
<div class="card-left agri-record-card" v-else>
|
|
|
<div class="left-info">
|
|
<div class="left-info">
|
|
@@ -63,9 +60,10 @@
|
|
|
</el-icon>
|
|
</el-icon>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="title-wrap van-ellipsis" v-if="fw.flowStatus != null && fw.flowStatus != 0 && fw.flowStatus != -2">
|
|
|
|
|
- <div class="title-text">{{ handleTagType(fw.flowStatus, fw.executeEvidenceAuditStatus) }}</div>
|
|
|
|
|
- <!-- <div class="title-text blue-tag" v-if="fw?.executionLimitDays >= 0">限时溯源</div> -->
|
|
|
|
|
|
|
+ <div class="title-wrap van-ellipsis"
|
|
|
|
|
+ v-if="fw.flowStatus != null && fw.flowStatus != 0 && fw.flowStatus != -2">
|
|
|
|
|
+ <div class="title-text">{{ handleTagType(fw.flowStatus,
|
|
|
|
|
+ fw.executeEvidenceAuditStatus) }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="card-right"
|
|
<div class="card-right"
|
|
@@ -80,18 +78,18 @@
|
|
|
fw?.sourceDataJson?.executeImageUrls?.length || 0 }}
|
|
fw?.sourceDataJson?.executeImageUrls?.length || 0 }}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div class="status-right" v-if="fw.archiveType === 2">待校准</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<template v-if="showPhenologyName">
|
|
<template v-if="showPhenologyName">
|
|
|
<template v-if="r.name === p.phenologyName">
|
|
<template v-if="r.name === p.phenologyName">
|
|
|
<template v-if="!shouldShowPhenologyBarTitle(idx)">
|
|
<template v-if="!shouldShowPhenologyBarTitle(idx)">
|
|
|
- <div class="phenology-name"
|
|
|
|
|
- :class="{
|
|
|
|
|
- single: showPhenologyName && !phenologyNeedsTwoLabelColumns(p),
|
|
|
|
|
- 'phenology-red': !shouldShowBlueLeft(p, r),
|
|
|
|
|
- 'text-blue': shouldShowBlueLeft(p, r),
|
|
|
|
|
- }"
|
|
|
|
|
|
|
+ <div class="phenology-name" :class="{
|
|
|
|
|
+ single: showPhenologyName && !phenologyNeedsTwoLabelColumns(p),
|
|
|
|
|
+ 'phenology-red': !shouldShowBlueLeft(p, r),
|
|
|
|
|
+ 'text-blue': shouldShowBlueLeft(p, r),
|
|
|
|
|
+ }"
|
|
|
:style="p.phenologyName === getNextPhenologyName(idx, rIdx) ? 'padding: 6px 0;' : ''">
|
|
:style="p.phenologyName === getNextPhenologyName(idx, rIdx) ? 'padding: 6px 0;' : ''">
|
|
|
{{ p.phenologyName }}
|
|
{{ p.phenologyName }}
|
|
|
</div>
|
|
</div>
|
|
@@ -183,13 +181,6 @@ const props = defineProps({
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-const farmWorkType = {
|
|
|
|
|
- 0: "预警农事",
|
|
|
|
|
- 1: "标准农事",
|
|
|
|
|
- 2: "建议农事",
|
|
|
|
|
- 3: "自建农事",
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
const emits = defineEmits(["row-click", "card-click"]);
|
|
const emits = defineEmits(["row-click", "card-click"]);
|
|
|
|
|
|
|
|
const solarTerms = ref([]);
|
|
const solarTerms = ref([]);
|
|
@@ -266,11 +257,28 @@ let resizeObserver = null;
|
|
|
const isEmpty = ref(false);
|
|
const isEmpty = ref(false);
|
|
|
// 标记是否正在请求数据,防止重复请求
|
|
// 标记是否正在请求数据,防止重复请求
|
|
|
const isRequesting = ref(false);
|
|
const isRequesting = ref(false);
|
|
|
-// 记录上一次请求的 regionId + problemZoneId,避免相同参数重复请求
|
|
|
|
|
|
|
+// 记录上一次请求作用域,避免相同参数重复请求
|
|
|
const lastRequestedFarmId = ref(null);
|
|
const lastRequestedFarmId = ref(null);
|
|
|
|
|
|
|
|
const farmWorkPlanScopeKey = () =>
|
|
const farmWorkPlanScopeKey = () =>
|
|
|
- JSON.stringify([props.regionId ?? null, props.problemZoneId ?? null]);
|
|
|
|
|
|
|
+ JSON.stringify([
|
|
|
|
|
+ props.pageType ?? null,
|
|
|
|
|
+ props.farmId ?? null,
|
|
|
|
|
+ props.regionId ?? null,
|
|
|
|
|
+ props.problemZoneId ?? null,
|
|
|
|
|
+ props.year ?? null,
|
|
|
|
|
+ props.containerId ?? null,
|
|
|
|
|
+ ]);
|
|
|
|
|
+
|
|
|
|
|
+const resetTimelineData = () => {
|
|
|
|
|
+ solarTerms.value = [];
|
|
|
|
|
+ phenologyList.value = [];
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const setEmptyTimelineData = () => {
|
|
|
|
|
+ resetTimelineData();
|
|
|
|
|
+ isEmpty.value = true;
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
// 获取当前季节
|
|
// 获取当前季节
|
|
|
const getCurrentSeason = () => {
|
|
const getCurrentSeason = () => {
|
|
@@ -588,9 +596,30 @@ const handleSeasonClick = (seasonValue) => {
|
|
|
wrap.scrollTo({ top: scrollTop, behavior: "smooth" });
|
|
wrap.scrollTo({ top: scrollTop, behavior: "smooth" });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+const archiveTypeObj = {
|
|
|
|
|
+ 1: "管理信息",
|
|
|
|
|
+ 2: "物候进程",
|
|
|
|
|
+ 3: "物候进程",
|
|
|
|
|
+ 4: "异常发现",
|
|
|
|
|
+ 5: "气象风险",
|
|
|
|
|
+ 6: "农事进度",
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ MANAGEMENT_INFO(1, "管理信息"),
|
|
|
|
|
+ EXPECTED_PHENOLOGY_PROGRESS(2, "预计物候进程"),
|
|
|
|
|
+ PHENOLOGY_PROGRESS(3, "物候进程"),
|
|
|
|
|
+ ABNORMAL_DISCOVERY(4, "异常发现"),
|
|
|
|
|
+ WEATHER_RISK(5, "气象风险"),
|
|
|
|
|
+ FARM_WORK_PROGRESS(6, "农事进度");
|
|
|
|
|
+ * 农事状态样式映射
|
|
|
|
|
+ * @param fw 农事
|
|
|
|
|
+ * @returns 农事状态样式
|
|
|
|
|
+ */
|
|
|
// 农事状态样式映射
|
|
// 农事状态样式映射
|
|
|
const getArrangeStatusClass = (fw) => {
|
|
const getArrangeStatusClass = (fw) => {
|
|
|
- const t = props.pageType === 'agri_record' ? fw?.flowStatus : fw?.sourceType;
|
|
|
|
|
|
|
+ const t = props.pageType === 'agri_record' ? fw?.flowStatus : fw?.archiveType;
|
|
|
if (props.pageType === 'agri_record') {
|
|
if (props.pageType === 'agri_record') {
|
|
|
if (t == null || t == 0 || t == -2) return "status-default";
|
|
if (t == null || t == 0 || t == -2) return "status-default";
|
|
|
const status = getAuditStatusPriority(fw.executeEvidenceAuditStatus);
|
|
const status = getAuditStatusPriority(fw.executeEvidenceAuditStatus);
|
|
@@ -600,8 +629,11 @@ const getArrangeStatusClass = (fw) => {
|
|
|
if (t == 5) return "status-normal";
|
|
if (t == 5) return "status-normal";
|
|
|
return "status-act";
|
|
return "status-act";
|
|
|
} else {
|
|
} else {
|
|
|
- if (t == 10) return "status-complete";
|
|
|
|
|
- if (t == 11) return "status-warning";
|
|
|
|
|
|
|
+ if (t == 1) return "status-green-info";
|
|
|
|
|
+ if (t == 4 && fw.sourceDataJson?.abnormalType === '病虫') return "status-warning";
|
|
|
|
|
+ if (t == 4 && fw.sourceDataJson?.abnormalType !== '病虫') return "status-complete";
|
|
|
|
|
+ if (t == 5) return "status-orange";
|
|
|
|
|
+ if (t == 6) return "status-green-farm";
|
|
|
return "status-normal";
|
|
return "status-normal";
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
@@ -614,7 +646,7 @@ const handleRowClick = (item) => {
|
|
|
|
|
|
|
|
// 获取农事规划数据
|
|
// 获取农事规划数据
|
|
|
const getFarmWorkPlan = () => {
|
|
const getFarmWorkPlan = () => {
|
|
|
- phenologyList.value = [];
|
|
|
|
|
|
|
+ resetTimelineData();
|
|
|
if (!props.farmId) return;
|
|
if (!props.farmId) return;
|
|
|
const scopeKey = farmWorkPlanScopeKey();
|
|
const scopeKey = farmWorkPlanScopeKey();
|
|
|
if (isRequesting.value || lastRequestedFarmId.value === scopeKey) return;
|
|
if (isRequesting.value || lastRequestedFarmId.value === scopeKey) return;
|
|
@@ -631,15 +663,15 @@ const getFarmWorkPlan = () => {
|
|
|
savedScrollTop = timelineContainerRef.value.scrollTop || 0;
|
|
savedScrollTop = timelineContainerRef.value.scrollTop || 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const apiFunc = props.pageType === 'agri_record' ? VE_API.monitor.getFarmWorkPlan : VE_API.monitor.getArchivesList;
|
|
|
|
|
|
|
+ const apiFunc = props.pageType === "agri_record" ? VE_API.monitor.getFarmWorkPlan : VE_API.monitor.getArchivesList;
|
|
|
|
|
|
|
|
const params = {
|
|
const params = {
|
|
|
farmId: props.farmId,
|
|
farmId: props.farmId,
|
|
|
regionId: props.regionId,
|
|
regionId: props.regionId,
|
|
|
problemZoneId: props.problemZoneId,
|
|
problemZoneId: props.problemZoneId,
|
|
|
year: props.year,
|
|
year: props.year,
|
|
|
- }
|
|
|
|
|
- if (props.pageType === 'agri_record') {
|
|
|
|
|
|
|
+ };
|
|
|
|
|
+ if (props.pageType === "agri_record") {
|
|
|
params.containerId = props.containerId;
|
|
params.containerId = props.containerId;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -667,10 +699,10 @@ const getFarmWorkPlan = () => {
|
|
|
const reproductiveList = Array.isArray(it.reproductiveList)
|
|
const reproductiveList = Array.isArray(it.reproductiveList)
|
|
|
? await Promise.all(
|
|
? await Promise.all(
|
|
|
it.reproductiveList.map(async (r) => {
|
|
it.reproductiveList.map(async (r) => {
|
|
|
- const farmWorkArrangeList = Array.isArray(r.broadcastList || r.interactionFarmWorkList)
|
|
|
|
|
|
|
+ const farmWorkArrangeList = Array.isArray(r.archiveList || r.interactionFarmWorkList)
|
|
|
? await Promise.all(
|
|
? await Promise.all(
|
|
|
- (r.broadcastList || r.interactionFarmWorkList).map(async (fw) => {
|
|
|
|
|
- const sourceDataJson = parseSourceDataSafe(fw.sourceData);
|
|
|
|
|
|
|
+ (r.archiveList || r.interactionFarmWorkList).map(async (fw) => {
|
|
|
|
|
+ const sourceDataJson = parseSourceDataSafe(fw.data);
|
|
|
// 如果有 imageIds,获取图片 URL
|
|
// 如果有 imageIds,获取图片 URL
|
|
|
if (
|
|
if (
|
|
|
sourceDataJson &&
|
|
sourceDataJson &&
|
|
@@ -686,24 +718,6 @@ const getFarmWorkPlan = () => {
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
sourceDataJson.resFilename = resFilenameList;
|
|
sourceDataJson.resFilename = resFilenameList;
|
|
|
- // 调用 findSuitabilityByPoint 接口获取天气适宜性信息
|
|
|
|
|
- if (fw.farmId && fw.createTime) {
|
|
|
|
|
- try {
|
|
|
|
|
- const dateStr = formatDateForAPI(fw.createTime);
|
|
|
|
|
- if (dateStr) {
|
|
|
|
|
- const suitabilityRes = await VE_API.ali.findSuitabilityByPoint({
|
|
|
|
|
- farmId: fw.farmId,
|
|
|
|
|
- date: dateStr,
|
|
|
|
|
- });
|
|
|
|
|
- if (suitabilityRes && suitabilityRes.code === 0 && suitabilityRes.data) {
|
|
|
|
|
- // 将返回的数据合并到 sourceDataJson
|
|
|
|
|
- sourceDataJson.suitability = suitabilityRes.data;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- console.error("获取天气适宜性信息失败:", error);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
return {
|
|
return {
|
|
|
...fw,
|
|
...fw,
|
|
@@ -782,27 +796,19 @@ const getFarmWorkPlan = () => {
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- // 收集所有farmWorkId
|
|
|
|
|
- const farmWorkIds = [];
|
|
|
|
|
- const farmWorks = [];
|
|
|
|
|
- phenologyList.value.forEach((phenology) => {
|
|
|
|
|
- if (Array.isArray(phenology.reproductiveList)) {
|
|
|
|
|
- phenology.reproductiveList.forEach((reproductive) => {
|
|
|
|
|
- if (Array.isArray(reproductive.farmWorkArrangeList)) {
|
|
|
|
|
- reproductive.farmWorkArrangeList.forEach((farmWork) => {
|
|
|
|
|
- if (farmWork.farmWorkId && farmWork.isFollow !== 0) {
|
|
|
|
|
- farmWorkIds.push(farmWork.farmWorkId);
|
|
|
|
|
- farmWorks.push(farmWork);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ const farmWorks = phenologyList.value.flatMap((phenology) =>
|
|
|
|
|
+ (Array.isArray(phenology?.reproductiveList) ? phenology.reproductiveList : []).flatMap((reproductive) =>
|
|
|
|
|
+ Array.isArray(reproductive?.farmWorkArrangeList) ? reproductive.farmWorkArrangeList : []
|
|
|
|
|
+ )
|
|
|
|
|
+ );
|
|
|
|
|
+ const quoteValidationFarmWorks = farmWorks.filter(
|
|
|
|
|
+ (farmWork) => farmWork?.farmWorkId && farmWork?.isFollow !== 0
|
|
|
|
|
+ );
|
|
|
|
|
+ const farmWorkIds = quoteValidationFarmWorks.map((farmWork) => farmWork.farmWorkId);
|
|
|
|
|
|
|
|
// 调用验证方法,传入所有ids
|
|
// 调用验证方法,传入所有ids
|
|
|
if (farmWorkIds.length > 0) {
|
|
if (farmWorkIds.length > 0) {
|
|
|
- batchValidatePesticideFertilizerQuotes(farmWorkIds, farmWorks);
|
|
|
|
|
|
|
+ batchValidatePesticideFertilizerQuotes(farmWorkIds, quoteValidationFarmWorks);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 判断是否为空数据:没有节气或没有物候期数据
|
|
// 判断是否为空数据:没有节气或没有物候期数据
|
|
@@ -813,18 +819,14 @@ const getFarmWorkPlan = () => {
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
// 接口返回错误码,显示暂无数据
|
|
// 接口返回错误码,显示暂无数据
|
|
|
- isEmpty.value = true;
|
|
|
|
|
- solarTerms.value = [];
|
|
|
|
|
- phenologyList.value = [];
|
|
|
|
|
|
|
+ setEmptyTimelineData();
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.catch((error) => {
|
|
.catch((error) => {
|
|
|
console.error("获取农事规划数据失败:", error);
|
|
console.error("获取农事规划数据失败:", error);
|
|
|
ElMessage.error("获取农事规划数据失败");
|
|
ElMessage.error("获取农事规划数据失败");
|
|
|
// 接口报错,显示暂无数据
|
|
// 接口报错,显示暂无数据
|
|
|
- isEmpty.value = true;
|
|
|
|
|
- solarTerms.value = [];
|
|
|
|
|
- phenologyList.value = [];
|
|
|
|
|
|
|
+ setEmptyTimelineData();
|
|
|
})
|
|
})
|
|
|
.finally(() => {
|
|
.finally(() => {
|
|
|
// 请求完成,重置请求标志
|
|
// 请求完成,重置请求标志
|
|
@@ -833,69 +835,61 @@ const getFarmWorkPlan = () => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const updateFarmWorkPlan = () => {
|
|
const updateFarmWorkPlan = () => {
|
|
|
- solarTerms.value = [];
|
|
|
|
|
- phenologyList.value = [];
|
|
|
|
|
|
|
+ resetTimelineData();
|
|
|
isEmpty.value = false;
|
|
isEmpty.value = false;
|
|
|
getFarmWorkPlan();
|
|
getFarmWorkPlan();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-watch(
|
|
|
|
|
- () => props.regionId,
|
|
|
|
|
- (val, oldVal) => {
|
|
|
|
|
- // 如果 farmId 没有值,则不触发
|
|
|
|
|
- if (!val) return;
|
|
|
|
|
- // 如果 farmId 变化了,重置上次请求的 farmId,允许请求新数据
|
|
|
|
|
- if (val !== oldVal) {
|
|
|
|
|
- lastRequestedFarmId.value = null;
|
|
|
|
|
- }
|
|
|
|
|
- // getFarmWorkPlan 内部已经有防重复请求的检查,这里直接调用即可
|
|
|
|
|
- isInitialLoad.value = true;
|
|
|
|
|
- updateFarmWorkPlan();
|
|
|
|
|
- },
|
|
|
|
|
- { immediate: true }
|
|
|
|
|
-);
|
|
|
|
|
-
|
|
|
|
|
-watch(
|
|
|
|
|
- () => props.year,
|
|
|
|
|
- (val, oldVal) => {
|
|
|
|
|
- if (!props.farmId) return;
|
|
|
|
|
- if (val !== oldVal) {
|
|
|
|
|
- lastRequestedFarmId.value = null;
|
|
|
|
|
- }
|
|
|
|
|
- isInitialLoad.value = true;
|
|
|
|
|
- updateFarmWorkPlan();
|
|
|
|
|
- },
|
|
|
|
|
-);
|
|
|
|
|
-
|
|
|
|
|
const showPhenologyName = computed(() => {
|
|
const showPhenologyName = computed(() => {
|
|
|
return !props.problemZoneId;
|
|
return !props.problemZoneId;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
watch(
|
|
watch(
|
|
|
- () => props.problemZoneId,
|
|
|
|
|
|
|
+ () => [props.farmId, props.regionId, props.year, props.problemZoneId, props.pageType, props.containerId],
|
|
|
(val, oldVal) => {
|
|
(val, oldVal) => {
|
|
|
if (!props.farmId) return;
|
|
if (!props.farmId) return;
|
|
|
- if (val !== oldVal) {
|
|
|
|
|
|
|
+ const changed =
|
|
|
|
|
+ !oldVal ||
|
|
|
|
|
+ val.some((item, index) => item !== oldVal[index]);
|
|
|
|
|
+ if (changed) {
|
|
|
lastRequestedFarmId.value = null;
|
|
lastRequestedFarmId.value = null;
|
|
|
}
|
|
}
|
|
|
isInitialLoad.value = true;
|
|
isInitialLoad.value = true;
|
|
|
updateFarmWorkPlan();
|
|
updateFarmWorkPlan();
|
|
|
},
|
|
},
|
|
|
|
|
+ { immediate: true }
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
const handleStatusDetail = (fw) => {
|
|
const handleStatusDetail = (fw) => {
|
|
|
// 跳转前记录当前滚动位置
|
|
// 跳转前记录当前滚动位置
|
|
|
saveTimelineScrollTop();
|
|
saveTimelineScrollTop();
|
|
|
emits('card-click');
|
|
emits('card-click');
|
|
|
|
|
+ console.log(fw);
|
|
|
if (props.pageType === 'agri_plan') {
|
|
if (props.pageType === 'agri_plan') {
|
|
|
- console.log(fw);
|
|
|
|
|
- if (fw?.sourceData && fw?.id) {
|
|
|
|
|
|
|
+ if (fw?.archiveType === 2) {
|
|
|
|
|
+ // router.push(`/interaction_list?farmId=${farmIdData.value}®ionId=${popupData.value.regionId}&interactionTypeId=${popupData.value.interactionTypeId}`);
|
|
|
|
|
+ }else if(fw?.archiveType === 6){
|
|
|
|
|
+ router.push({
|
|
|
|
|
+ path: "/work_detail",
|
|
|
|
|
+ query: {
|
|
|
|
|
+ miniJson: JSON.stringify({
|
|
|
|
|
+ paramsPage: JSON.stringify({
|
|
|
|
|
+ farmId: 98570,
|
|
|
|
|
+ farmWorkLibId: '832268348690534411',
|
|
|
|
|
+ recordId: "832268363366404096",
|
|
|
|
|
+ reproductiveId: 149,
|
|
|
|
|
+ typeId: props.typeId
|
|
|
|
|
+ }),
|
|
|
|
|
+ }),
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ }else{
|
|
|
router.push({
|
|
router.push({
|
|
|
path: "/agricultural_detail",
|
|
path: "/agricultural_detail",
|
|
|
query: {
|
|
query: {
|
|
|
id: fw?.id,
|
|
id: fw?.id,
|
|
|
- title: fw?.title,
|
|
|
|
|
- content: fw?.content,
|
|
|
|
|
|
|
+ title: archiveTypeObj[fw?.archiveType],
|
|
|
|
|
+ content: fw?.description,
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -991,13 +985,6 @@ const getPhenologyTermProgress = (phenologyProgress) => {
|
|
|
return matchedTermProgress;
|
|
return matchedTermProgress;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const flowStatusStr = {
|
|
|
|
|
- '3': '待认证',
|
|
|
|
|
- '-1': '已过期',
|
|
|
|
|
- '-2': '已过期',
|
|
|
|
|
- '5': '已认证',
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
const handleTagType = (tagType, executeEvidenceAuditStatus) => {
|
|
const handleTagType = (tagType, executeEvidenceAuditStatus) => {
|
|
|
if (tagType == 0) return "待触发";
|
|
if (tagType == 0) return "待触发";
|
|
|
if (tagType == -1) return "已过期";
|
|
if (tagType == -1) return "已过期";
|
|
@@ -1288,6 +1275,42 @@ watch(
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
|
|
+@mixin arrange-card-status($color, $title-color: null, $title-bg: null, $text-color: null) {
|
|
|
|
|
+ border-color: $color;
|
|
|
|
|
+
|
|
|
|
|
+ .card-content {
|
|
|
|
|
+ @if $text-color !=null {
|
|
|
|
|
+ color: $text-color;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .card-left {
|
|
|
|
|
+ .left-info {
|
|
|
|
|
+ .left-date {
|
|
|
|
|
+ color: $color;
|
|
|
|
|
+ border-color: $color;
|
|
|
|
|
+ }
|
|
|
|
|
+ .status-tag {
|
|
|
|
|
+ background: $color;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .title-text {
|
|
|
|
|
+ @if $title-color !=null {
|
|
|
|
|
+ color: $title-color;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @if $title-bg !=null {
|
|
|
|
|
+ background: $title-bg;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ &::before {
|
|
|
|
|
+ border-right-color: $color;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
.timeline-container {
|
|
.timeline-container {
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
overflow: auto;
|
|
overflow: auto;
|
|
@@ -1417,7 +1440,8 @@ watch(
|
|
|
min-width: calc(100vw - 83px);
|
|
min-width: calc(100vw - 83px);
|
|
|
gap: 5px;
|
|
gap: 5px;
|
|
|
letter-spacing: 0px;
|
|
letter-spacing: 0px;
|
|
|
- &.arranges-min{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ &.arranges-min {
|
|
|
max-width: calc(100vw - 58px);
|
|
max-width: calc(100vw - 58px);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1454,18 +1478,26 @@ watch(
|
|
|
.left-date {
|
|
.left-date {
|
|
|
color: #2199f8;
|
|
color: #2199f8;
|
|
|
border: 1px solid #2199f8;
|
|
border: 1px solid #2199f8;
|
|
|
- padding: 1px 0;
|
|
|
|
|
border-radius: 2px;
|
|
border-radius: 2px;
|
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
|
- width: 45px;
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
|
|
+ width: 36px;
|
|
|
|
|
+ height: 20px;
|
|
|
|
|
+ line-height: 20px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .status-tag {
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ background: #47B881;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ width: 63px;
|
|
|
|
|
+ border-radius: 2px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.text {
|
|
.text {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
gap: 2px;
|
|
gap: 2px;
|
|
|
- width: calc(100% - 50px);
|
|
|
|
|
|
|
+ width: calc(100% - 115px);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1483,6 +1515,9 @@ watch(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
&.agri-record-card {
|
|
&.agri-record-card {
|
|
|
|
|
+ .text{
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ }
|
|
|
.title-wrap {
|
|
.title-wrap {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: flex-end;
|
|
align-items: flex-end;
|
|
@@ -1496,7 +1531,7 @@ watch(
|
|
|
color: #B7B7B7;
|
|
color: #B7B7B7;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .blue-tag{
|
|
|
|
|
|
|
+ .blue-tag {
|
|
|
color: #2199F8;
|
|
color: #2199F8;
|
|
|
background: rgba(33, 153, 248, 0.1);
|
|
background: rgba(33, 153, 248, 0.1);
|
|
|
}
|
|
}
|
|
@@ -1532,6 +1567,17 @@ watch(
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .status-right {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ color: #fff;
|
|
|
|
|
+ background: #2199F8;
|
|
|
|
|
+ border-radius: 2px;
|
|
|
|
|
+ padding: 0 5px;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
&::before {
|
|
&::before {
|
|
@@ -1552,34 +1598,20 @@ watch(
|
|
|
opacity: 0.3;
|
|
opacity: 0.3;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .arrange-card.status-normal {
|
|
|
|
|
- border-color: #2199f8;
|
|
|
|
|
|
|
+ // .arrange-card.status-normal {
|
|
|
|
|
+ // border-color: #2199f8;
|
|
|
|
|
|
|
|
- &::before {
|
|
|
|
|
- border-right-color: #2199f8;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // &::before {
|
|
|
|
|
+ // border-right-color: #2199f8;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ .arrange-card.status-normal {
|
|
|
|
|
+ @include arrange-card-status(#2199f8, #2199f8, rgba(33, 153, 248, 0.1));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.arrange-card.status-warning {
|
|
.arrange-card.status-warning {
|
|
|
- border-color: #FF4E4E;
|
|
|
|
|
-
|
|
|
|
|
- .card-left {
|
|
|
|
|
- .left-info {
|
|
|
|
|
- .left-date {
|
|
|
|
|
- color: #FF4E4E;
|
|
|
|
|
- border-color: #FF4E4E;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .title-text {
|
|
|
|
|
- color: #FF4E4E;
|
|
|
|
|
- background: rgba(255, 78, 78, 0.1);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &::before {
|
|
|
|
|
- border-right-color: #FF4E4E;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ @include arrange-card-status(#FF4E4E, #FF4E4E, rgba(255, 78, 78, 0.1));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.arrange-card.status-warning.status-warning-agri-record {
|
|
.arrange-card.status-warning.status-warning-agri-record {
|
|
@@ -1592,7 +1624,9 @@ watch(
|
|
|
border-color: #bbbbbb;
|
|
border-color: #bbbbbb;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- .text-name,.text-icon {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .text-name,
|
|
|
|
|
+ .text-icon {
|
|
|
color: #bbbbbb;
|
|
color: #bbbbbb;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1603,133 +1637,65 @@ watch(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.arrange-card.status-complete {
|
|
.arrange-card.status-complete {
|
|
|
- border-color: #FF943D;
|
|
|
|
|
|
|
+ @include arrange-card-status(#FF943D, #FF943D, rgba(255, 149, 61, 0.1));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- .card-left {
|
|
|
|
|
- .left-info {
|
|
|
|
|
- .left-date {
|
|
|
|
|
- color: #FF943D;
|
|
|
|
|
- border-color: #FF943D;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .arrange-card.status-green-info {
|
|
|
|
|
+ @include arrange-card-status(#47B881, #fff, rgba(71, 184, 129, 0.1));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- .title-text {
|
|
|
|
|
- color: #FF943D;
|
|
|
|
|
- background: rgba(255, 149, 61, 0.1);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .arrange-card.status-orange {
|
|
|
|
|
+ @include arrange-card-status(#FFB129, #FFB129, rgba(253, 181, 55, 0.1));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- &::before {
|
|
|
|
|
- border-right-color: #FF943D;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .arrange-card.status-green-farm {
|
|
|
|
|
+ @include arrange-card-status(#5BB349, #5BB349, rgba(91, 179, 73, 0.1));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.arrange-card.status-act {
|
|
.arrange-card.status-act {
|
|
|
- border-color: #FF953D;
|
|
|
|
|
-
|
|
|
|
|
- .card-left {
|
|
|
|
|
- .left-info {
|
|
|
|
|
- .left-date {
|
|
|
|
|
- color: #FF953D;
|
|
|
|
|
- border-color: #FF953D;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .title-text {
|
|
|
|
|
- color: #fff;
|
|
|
|
|
- background: #FF953D;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &::before {
|
|
|
|
|
- border-right-color: #FF953D;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ @include arrange-card-status(#FF953D, #fff, #FF953D);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.arrange-card.status-default {
|
|
.arrange-card.status-default {
|
|
|
- border-color: #BBBBBB;
|
|
|
|
|
|
|
+ @include arrange-card-status(#BBBBBB, #fff, #BBBBBB);
|
|
|
|
|
|
|
|
.card-left {
|
|
.card-left {
|
|
|
.left-info {
|
|
.left-info {
|
|
|
- .left-date {
|
|
|
|
|
- color: #BBBBBB;
|
|
|
|
|
- border-color: #BBBBBB;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
.text-name,
|
|
.text-name,
|
|
|
.text-icon {
|
|
.text-icon {
|
|
|
color: #BBBBBB;
|
|
color: #BBBBBB;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- .title-text {
|
|
|
|
|
- color: #fff;
|
|
|
|
|
- background: #BBBBBB;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &::before {
|
|
|
|
|
- border-right-color: #BBBBBB;
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 未来节气对应的农事卡片:跟随左侧物候期的“未开始”灰色样式
|
|
// 未来节气对应的农事卡片:跟随左侧物候期的“未开始”灰色样式
|
|
|
.arrange-card.future-card {
|
|
.arrange-card.future-card {
|
|
|
- border-color: #e4e4e4;
|
|
|
|
|
-
|
|
|
|
|
- .card-content {
|
|
|
|
|
- color: rgba(36, 36, 36, 0.5);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ @include arrange-card-status(#e4e4e4, null, null, rgba(36, 36, 36, 0.5));
|
|
|
|
|
|
|
|
.card-left {
|
|
.card-left {
|
|
|
.left-info {
|
|
.left-info {
|
|
|
.left-date {
|
|
.left-date {
|
|
|
color: #CACACA;
|
|
color: #CACACA;
|
|
|
- border-color: #e4e4e4;
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- &::before {
|
|
|
|
|
- border-right-color: #e4e4e4;
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.arrange-card.status-warning-bg {
|
|
.arrange-card.status-warning-bg {
|
|
|
- border-color: #FF943D;
|
|
|
|
|
-
|
|
|
|
|
- .card-content {
|
|
|
|
|
- color: #000;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .card-left {
|
|
|
|
|
- .left-info {
|
|
|
|
|
- .left-date {
|
|
|
|
|
- color: #FF943D;
|
|
|
|
|
- border-color: #FF943D;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .title-text {
|
|
|
|
|
- color: #fff;
|
|
|
|
|
- background: #FF943D;;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- &::before {
|
|
|
|
|
- border-right-color: #FF943D;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ @include arrange-card-status(#FF943D, #fff, #FF943D, #000);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .reproductive-item + .reproductive-item {
|
|
|
|
|
|
|
+ .reproductive-item+.reproductive-item {
|
|
|
margin-top: 4px;
|
|
margin-top: 4px;
|
|
|
padding-top: 0;
|
|
padding-top: 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .phenology-bar + .phenology-bar {
|
|
|
|
|
|
|
+ .phenology-bar+.phenology-bar {
|
|
|
margin-top: 4px;
|
|
margin-top: 4px;
|
|
|
padding-top: 0;
|
|
padding-top: 0;
|
|
|
}
|
|
}
|