|
@@ -4,7 +4,7 @@
|
|
|
<div class="record-content">
|
|
<div class="record-content">
|
|
|
<div class="record-header" v-if="recordType === 'growth'">
|
|
<div class="record-header" v-if="recordType === 'growth'">
|
|
|
<span>{{ t('agriRecord.growthWorkName') }}</span>
|
|
<span>{{ t('agriRecord.growthWorkName') }}</span>
|
|
|
- <div class="question">{{currentGrowthAnomalyDetail?.interact_question }}</div>
|
|
|
|
|
|
|
+ <div class="question">{{ currentGrowthAnomalyDetail?.interact_question }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="record-header" v-else-if="recordType === 'pest'">
|
|
<div class="record-header" v-else-if="recordType === 'pest'">
|
|
|
<span>{{ t('agriRecord.pestWorkName') }}</span>
|
|
<span>{{ t('agriRecord.pestWorkName') }}</span>
|
|
@@ -18,29 +18,34 @@
|
|
|
<div class="card-wrap" v-if="recordType === 'growth'">
|
|
<div class="card-wrap" v-if="recordType === 'growth'">
|
|
|
<div class="card-item">
|
|
<div class="card-item">
|
|
|
<span class="item-label">{{ t('recordDetails.scienceLabel') }}</span>
|
|
<span class="item-label">{{ t('recordDetails.scienceLabel') }}</span>
|
|
|
- <text-ellipsis class="item-value" :expand-text="expandCollapse.expand" :collapse-text="expandCollapse.collapse" rows="3"
|
|
|
|
|
|
|
+ <text-ellipsis class="item-value" :expand-text="expandCollapse.expand"
|
|
|
|
|
+ :collapse-text="expandCollapse.collapse" rows="3"
|
|
|
:content="currentGrowthAnomalyDetail?.agri_judgment" />
|
|
:content="currentGrowthAnomalyDetail?.agri_judgment" />
|
|
|
</div>
|
|
</div>
|
|
|
<div class="tabs-list" v-if="!showMap">
|
|
<div class="tabs-list" v-if="!showMap">
|
|
|
<div class="item-tab" :class="{ 'item-tab--active': activeGrowthAnomalyIndex === index }"
|
|
<div class="item-tab" :class="{ 'item-tab--active': activeGrowthAnomalyIndex === index }"
|
|
|
- v-for="(item, index) in growthAnomalyTabs" :key="index" @click="handleGrowthAnomalyTabClick(index)">{{ item.label }}
|
|
|
|
|
|
|
+ v-for="(item, index) in growthAnomalyTabs" :key="index"
|
|
|
|
|
+ @click="handleGrowthAnomalyTabClick(index)">{{ item.label }}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="card-item">
|
|
<div class="card-item">
|
|
|
<span class="item-label">{{ t('recordDetails.phenotypeLabel') }}</span>
|
|
<span class="item-label">{{ t('recordDetails.phenotypeLabel') }}</span>
|
|
|
- <text-ellipsis class="item-value" :expand-text="expandCollapse.expand" :collapse-text="expandCollapse.collapse" rows="3"
|
|
|
|
|
|
|
+ <text-ellipsis class="item-value" :expand-text="expandCollapse.expand"
|
|
|
|
|
+ :collapse-text="expandCollapse.collapse" rows="3"
|
|
|
:content="currentGrowthAnomalyDetail?.phenotype" />
|
|
:content="currentGrowthAnomalyDetail?.phenotype" />
|
|
|
</div>
|
|
</div>
|
|
|
<div class="card-item">
|
|
<div class="card-item">
|
|
|
<span class="item-label">{{ t('recordDetails.highRiskLabel') }}</span>
|
|
<span class="item-label">{{ t('recordDetails.highRiskLabel') }}</span>
|
|
|
- <text-ellipsis class="item-value" :expand-text="expandCollapse.expand" :collapse-text="expandCollapse.collapse" rows="3"
|
|
|
|
|
|
|
+ <text-ellipsis class="item-value" :expand-text="expandCollapse.expand"
|
|
|
|
|
+ :collapse-text="expandCollapse.collapse" rows="3"
|
|
|
:content="currentGrowthAnomalyDetail?.patrol_points" />
|
|
:content="currentGrowthAnomalyDetail?.patrol_points" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="card-wrap" v-else-if="recordType === 'pest'">
|
|
<div class="card-wrap" v-else-if="recordType === 'pest'">
|
|
|
<div class="card-item">
|
|
<div class="card-item">
|
|
|
<span class="item-label">{{ t('recordDetails.scienceLabel') }}</span>
|
|
<span class="item-label">{{ t('recordDetails.scienceLabel') }}</span>
|
|
|
- <text-ellipsis class="item-value" :expand-text="expandCollapse.expand" :collapse-text="expandCollapse.collapse" rows="3"
|
|
|
|
|
|
|
+ <text-ellipsis class="item-value" :expand-text="expandCollapse.expand"
|
|
|
|
|
+ :collapse-text="expandCollapse.collapse" rows="3"
|
|
|
:content="t('recordDetails.pestScience')" />
|
|
:content="t('recordDetails.pestScience')" />
|
|
|
</div>
|
|
</div>
|
|
|
<div class="pest-classify-picker">
|
|
<div class="pest-classify-picker">
|
|
@@ -65,29 +70,33 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="card-item">
|
|
<div class="card-item">
|
|
|
<span class="item-label">{{ t('recordDetails.phenotypeLabel') }}</span>
|
|
<span class="item-label">{{ t('recordDetails.phenotypeLabel') }}</span>
|
|
|
- <text-ellipsis class="item-value" :expand-text="expandCollapse.expand" :collapse-text="expandCollapse.collapse" rows="3"
|
|
|
|
|
- :content="currentPestDetail?.phenotype" />
|
|
|
|
|
|
|
+ <text-ellipsis class="item-value" :expand-text="expandCollapse.expand"
|
|
|
|
|
+ :collapse-text="expandCollapse.collapse" rows="3" :content="currentPestDetail?.phenotype" />
|
|
|
</div>
|
|
</div>
|
|
|
<div class="card-item">
|
|
<div class="card-item">
|
|
|
<span class="item-label">{{ t('recordDetails.highRiskLabel') }}</span>
|
|
<span class="item-label">{{ t('recordDetails.highRiskLabel') }}</span>
|
|
|
- <text-ellipsis class="item-value" :expand-text="expandCollapse.expand" :collapse-text="expandCollapse.collapse" rows="3"
|
|
|
|
|
|
|
+ <text-ellipsis class="item-value" :expand-text="expandCollapse.expand"
|
|
|
|
|
+ :collapse-text="expandCollapse.collapse" rows="3"
|
|
|
:content="currentPestDetail?.patrol_points" />
|
|
:content="currentPestDetail?.patrol_points" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="card-wrap" v-else>
|
|
<div class="card-wrap" v-else>
|
|
|
<div class="card-item">
|
|
<div class="card-item">
|
|
|
<span class="item-label">{{ t('recordDetails.farmAnalysisLabel') }}</span>
|
|
<span class="item-label">{{ t('recordDetails.farmAnalysisLabel') }}</span>
|
|
|
- <text-ellipsis class="item-value" :expand-text="expandCollapse.expand" :collapse-text="expandCollapse.collapse" rows="3"
|
|
|
|
|
|
|
+ <text-ellipsis class="item-value" :expand-text="expandCollapse.expand"
|
|
|
|
|
+ :collapse-text="expandCollapse.collapse" rows="3"
|
|
|
:content="t('recordDetails.phenologyAnalysis')" />
|
|
:content="t('recordDetails.phenologyAnalysis')" />
|
|
|
</div>
|
|
</div>
|
|
|
<div class="card-item">
|
|
<div class="card-item">
|
|
|
<span class="item-label">{{ t('recordDetails.patrolLabel') }}</span>
|
|
<span class="item-label">{{ t('recordDetails.patrolLabel') }}</span>
|
|
|
- <text-ellipsis class="item-value" :expand-text="expandCollapse.expand" :collapse-text="expandCollapse.collapse" rows="3"
|
|
|
|
|
|
|
+ <text-ellipsis class="item-value" :expand-text="expandCollapse.expand"
|
|
|
|
|
+ :collapse-text="expandCollapse.collapse" rows="3"
|
|
|
:content="workDetail.inspection_keypoints" />
|
|
:content="workDetail.inspection_keypoints" />
|
|
|
</div>
|
|
</div>
|
|
|
<div class="card-item">
|
|
<div class="card-item">
|
|
|
<span class="item-label">{{ t('recordDetails.phenotypeLabel') }}</span>
|
|
<span class="item-label">{{ t('recordDetails.phenotypeLabel') }}</span>
|
|
|
- <text-ellipsis class="item-value" :expand-text="expandCollapse.expand" :collapse-text="expandCollapse.collapse" rows="3"
|
|
|
|
|
|
|
+ <text-ellipsis class="item-value" :expand-text="expandCollapse.expand"
|
|
|
|
|
+ :collapse-text="expandCollapse.collapse" rows="3"
|
|
|
:content="t('recordDetails.phenologyPhenotype')" />
|
|
:content="t('recordDetails.phenologyPhenotype')" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -124,8 +133,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="time-line">
|
|
<div class="time-line">
|
|
|
<GrowthStageTimeline v-model="growthStageIndex" :stages="growthStages"
|
|
<GrowthStageTimeline v-model="growthStageIndex" :stages="growthStages"
|
|
|
- @scroll-settled="onStageScrollSettled"
|
|
|
|
|
- @locale-change="getFindPhenologyInfo" />
|
|
|
|
|
|
|
+ @scroll-settled="onStageScrollSettled" @locale-change="getFindPhenologyInfo" />
|
|
|
<!-- <GrowthStageTimeline v-model="growthStageIndex" :stages="growthStages" /> -->
|
|
<!-- <GrowthStageTimeline v-model="growthStageIndex" :stages="growthStages" /> -->
|
|
|
</div>
|
|
</div>
|
|
|
<div class="confirm-btn-wrap">
|
|
<div class="confirm-btn-wrap">
|
|
@@ -142,8 +150,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="phenology-track-section">
|
|
<div class="phenology-track-section">
|
|
|
- <PhenologyTrackTimelineItem v-for="(row, idx) in displayPhenologyTrackList" :key="idx" :date="row.date"
|
|
|
|
|
- :content="row.content" :images="row.images" />
|
|
|
|
|
|
|
+ <PhenologyTrackTimelineItem :abnormalType="recordTypeObj[recordType]" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -199,12 +206,16 @@
|
|
|
|
|
|
|
|
<UploadProgressPopup ref="uploadProgressPopupRef" v-model:show="showUploadProgressPopup"
|
|
<UploadProgressPopup ref="uploadProgressPopupRef" v-model:show="showUploadProgressPopup"
|
|
|
:popup-image-upload-loading="popupImageUploadLoading" :init-img-arr="initImgArr"
|
|
:popup-image-upload-loading="popupImageUploadLoading" :init-img-arr="initImgArr"
|
|
|
- @cancel="handleCancelUploadPopup" @confirm="handleConfirmUpload" @handleUpload="handleUploadSuccess">
|
|
|
|
|
|
|
+ :confirm-text="t('recordDetails.confirmUpload')" :upload-required="false"
|
|
|
|
|
+ @reset="handleUploadPopupReset" @cancel="handleCancelUploadPopup" @confirm="handleConfirmUpload">
|
|
|
<template #header>
|
|
<template #header>
|
|
|
<div class="upload-form">
|
|
<div class="upload-form">
|
|
|
- <div class="form-item aaa">
|
|
|
|
|
- <div class="item-label" style="font-size: 14px;color: #5A5A5A;">{{ t('recordDetails.abnormalCount') }}</div>
|
|
|
|
|
- <el-input v-model="formData.regionName" size="large" :placeholder="t('recordDetails.inputPlaceholder')">
|
|
|
|
|
|
|
+ <div class="form-item special-input">
|
|
|
|
|
+ <div class="item-label" style="font-size: 14px;color: #5A5A5A;">
|
|
|
|
|
+ <span>{{ t('recordDetails.abnormalCount') }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-input v-model="formData.ratio" type="number" size="large"
|
|
|
|
|
+ :placeholder="t('recordDetails.inputPlaceholder')">
|
|
|
<template #suffix>
|
|
<template #suffix>
|
|
|
%
|
|
%
|
|
|
</template>
|
|
</template>
|
|
@@ -216,10 +227,11 @@
|
|
|
<div class="upload-form">
|
|
<div class="upload-form">
|
|
|
<div class="form-item">
|
|
<div class="form-item">
|
|
|
<div class="item-label">{{ t('recordDetails.patrolDesc') }}</div>
|
|
<div class="item-label">{{ t('recordDetails.patrolDesc') }}</div>
|
|
|
- <el-input v-model="formData.regionName" size="large" :placeholder="t('recordDetails.inputDescPlaceholder')" />
|
|
|
|
|
|
|
+ <el-input v-model="formData.regionName" size="large"
|
|
|
|
|
+ :placeholder="t('recordDetails.inputDescPlaceholder')" />
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="map-container" ref="mapContainer">
|
|
|
|
|
- <div class="tip">{{ t('recordDetails.drawTip') }}</div>
|
|
|
|
|
|
|
+ <div class="map-container" ref="uploadMapContainer" @click="handleMapClick">
|
|
|
|
|
+ <div class="tip" v-if="!hasMapConfirmGeometry">{{ t('recordDetails.drawTip') }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -232,8 +244,9 @@ import customHeader from "@/components/customHeader.vue";
|
|
|
import PhenologyTrackTimelineItem from "@/components/pageComponents/PhenologyTrackTimelineItem.vue";
|
|
import PhenologyTrackTimelineItem from "@/components/pageComponents/PhenologyTrackTimelineItem.vue";
|
|
|
import GrowthStageTimeline from "@/components/pageComponents/GrowthStageTimeline.vue";
|
|
import GrowthStageTimeline from "@/components/pageComponents/GrowthStageTimeline.vue";
|
|
|
import UploadProgressPopup from "@/components/popup/UploadProgressPopup.vue";
|
|
import UploadProgressPopup from "@/components/popup/UploadProgressPopup.vue";
|
|
|
-import { ref, onMounted, watch, nextTick, computed } from 'vue';
|
|
|
|
|
|
|
+import { ref, onActivated, watch, nextTick, computed } from 'vue';
|
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
|
|
|
+import { useStore } from 'vuex';
|
|
|
import { useI18n } from '@/i18n';
|
|
import { useI18n } from '@/i18n';
|
|
|
import { RECORD_KEY_MAP } from '@/i18n/recordTextMap';
|
|
import { RECORD_KEY_MAP } from '@/i18n/recordTextMap';
|
|
|
import { Uploader, TextEllipsis } from "vant";
|
|
import { Uploader, TextEllipsis } from "vant";
|
|
@@ -245,6 +258,7 @@ import { Plus } from "@element-plus/icons-vue";
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
|
|
+const store = useStore();
|
|
|
const { t } = useI18n();
|
|
const { t } = useI18n();
|
|
|
|
|
|
|
|
const TYPE_LEGACY_MAP = {
|
|
const TYPE_LEGACY_MAP = {
|
|
@@ -350,6 +364,7 @@ const handlePestDetailClick = (index) => {
|
|
|
|
|
|
|
|
const indexMap = new IndexMap();
|
|
const indexMap = new IndexMap();
|
|
|
const mapContainer = ref(null);
|
|
const mapContainer = ref(null);
|
|
|
|
|
+const uploadMapContainer = ref(null);
|
|
|
const location = ref(null);
|
|
const location = ref(null);
|
|
|
const input = ref('');
|
|
const input = ref('');
|
|
|
|
|
|
|
@@ -381,29 +396,96 @@ const currentStatusText = computed(() =>
|
|
|
})
|
|
})
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
|
|
+const DEFAULT_MAP_LOCATION = "POINT(113.6142086995688 23.585836479509055)";
|
|
|
|
|
+
|
|
|
|
|
+const mapConfirmPayload = computed(() => store.state.recordDetails.mapConfirmPayload);
|
|
|
|
|
+
|
|
|
|
|
+const hasMapConfirmGeometry = computed(() => {
|
|
|
|
|
+ const coordinates = mapConfirmPayload.value?.coordinates;
|
|
|
|
|
+ return Array.isArray(coordinates) && coordinates.length > 0;
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
const formData = ref({
|
|
const formData = ref({
|
|
|
|
|
+ ratio: '',
|
|
|
regionName: '',
|
|
regionName: '',
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+function destroyUploadMap() {
|
|
|
|
|
+ if (indexMap.kmap?.destroy) {
|
|
|
|
|
+ indexMap.kmap.destroy();
|
|
|
|
|
+ }
|
|
|
|
|
+ indexMap.kmap = null;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function ensureUploadMap() {
|
|
|
|
|
+ if (!uploadMapContainer.value) return false;
|
|
|
|
|
+ location.value = location.value || DEFAULT_MAP_LOCATION;
|
|
|
|
|
+ destroyUploadMap();
|
|
|
|
|
+ indexMap.initMap(location.value, uploadMapContainer.value, { editable: false, movable: false });
|
|
|
|
|
+ return Boolean(indexMap.kmap);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function resizeUploadMap() {
|
|
|
|
|
+ indexMap.kmap?.map?.updateSize?.();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 弹窗动画结束后再初始化,避免容器尺寸为 0 导致白屏 */
|
|
|
|
|
+function syncUploadMapView() {
|
|
|
|
|
+ const { coordinates } = mapConfirmPayload.value;
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ if (!ensureUploadMap()) return;
|
|
|
|
|
+ resizeUploadMap();
|
|
|
|
|
+ if (Array.isArray(coordinates) && coordinates.length) {
|
|
|
|
|
+ indexMap.setAreaGeometry(coordinates);
|
|
|
|
|
+ resizeUploadMap();
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 250);
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function syncFormFromMapConfirmPayload() {
|
|
|
|
|
+ if (!showUploadProgressPopup.value) return;
|
|
|
|
|
+ syncUploadMapView();
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const handleAbnormalRecord = () => {
|
|
const handleAbnormalRecord = () => {
|
|
|
|
|
+ formData.value.ratio = '';
|
|
|
|
|
+ formData.value.regionName = '';
|
|
|
showUploadProgressPopup.value = true;
|
|
showUploadProgressPopup.value = true;
|
|
|
- nextTick(() => {
|
|
|
|
|
- location.value = "POINT(113.6142086995688 23.585836479509055)";
|
|
|
|
|
- indexMap.initMap(location.value, mapContainer.value);
|
|
|
|
|
- })
|
|
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const handleMapClick = () => {
|
|
|
|
|
+ router.push({
|
|
|
|
|
+ name: 'MapManage', query: {
|
|
|
|
|
+ type: 'pest',
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const showUploadProgressPopup = ref(false);
|
|
const showUploadProgressPopup = ref(false);
|
|
|
|
|
+
|
|
|
|
|
+watch(showUploadProgressPopup, (show) => {
|
|
|
|
|
+ if (show) {
|
|
|
|
|
+ syncUploadMapView();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ destroyUploadMap();
|
|
|
|
|
+ }
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
const initImgArr = ref([]);
|
|
const initImgArr = ref([]);
|
|
|
const uploadProgressPopupRef = ref(null);
|
|
const uploadProgressPopupRef = ref(null);
|
|
|
const popupImageUploadLoading = ref(false);
|
|
const popupImageUploadLoading = ref(false);
|
|
|
const uploadFileObj = new UploadFile();
|
|
const uploadFileObj = new UploadFile();
|
|
|
const miniUserId = localStorage.getItem("MINI_USER_ID");
|
|
const miniUserId = localStorage.getItem("MINI_USER_ID");
|
|
|
|
|
|
|
|
-const beforeReadUpload = (file) => {
|
|
|
|
|
- showUploadProgressPopup.value = true;
|
|
|
|
|
|
|
+const handleUploadPopupReset = () => {
|
|
|
initImgArr.value = [];
|
|
initImgArr.value = [];
|
|
|
popupImageUploadLoading.value = false;
|
|
popupImageUploadLoading.value = false;
|
|
|
- uploadProgressPopupRef.value?.uploadReset();
|
|
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+const beforeReadUpload = (file) => {
|
|
|
|
|
+ showUploadProgressPopup.value = true;
|
|
|
return true;
|
|
return true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -468,54 +550,62 @@ const afterReadUpload = async (data) => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const uploadData = ref([]);
|
|
|
|
|
-const handleUploadSuccess = (data) => {
|
|
|
|
|
- uploadData.value = data.imgArr;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
const handleCancelUploadPopup = () => {
|
|
const handleCancelUploadPopup = () => {
|
|
|
showUploadProgressPopup.value = false;
|
|
showUploadProgressPopup.value = false;
|
|
|
|
|
+ store.commit('recordDetails/CLEAR_MAP_CONFIRM_PAYLOAD');
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const handleConfirmUpload = () => {
|
|
|
|
|
- if (!uploadData.value || uploadData.value.length === 0) {
|
|
|
|
|
- ElMessage.warning(t('recordDetails.uploadPhotoFirst'));
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- showUploadProgressPopup.value = false;
|
|
|
|
|
|
|
+const recordTypeObj = {
|
|
|
|
|
+ phenology: 0,
|
|
|
|
|
+ pest: 1,
|
|
|
|
|
+ growth: 2,
|
|
|
};
|
|
};
|
|
|
|
|
+function validateAbnormalRatio() {
|
|
|
|
|
+ const ratio = String(formData.value.ratio ?? '').trim();
|
|
|
|
|
+ if (ratio === '' || Number.isNaN(Number(ratio))) {
|
|
|
|
|
+ ElMessage.warning(t('recordDetails.ratioRequired'));
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
-const handleUploadClick = () => { };
|
|
|
|
|
|
|
+const handleConfirmUpload = (imgArr) => {
|
|
|
|
|
+ if (!validateAbnormalRatio()) return;
|
|
|
|
|
|
|
|
-/** 物候跟踪时间轴原始数据,接入接口后可替换 */
|
|
|
|
|
-const phenologyTrackRawList = ref([]);
|
|
|
|
|
|
|
+ if (recordType.value === 'pest') {
|
|
|
|
|
+ const coordinates = mapConfirmPayload.value?.coordinates;
|
|
|
|
|
+ const hasDrawnMap = Array.isArray(coordinates) && coordinates.length > 0;
|
|
|
|
|
+ if (!hasDrawnMap) {
|
|
|
|
|
+ handleMapClick();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
-const formatTrackItemContent = (item) => {
|
|
|
|
|
- const recordText = t(RECORD_KEY_MAP[item.record] || item.record);
|
|
|
|
|
- const ratio = String(item.ratio ?? "").trim();
|
|
|
|
|
- return ratio ? `${recordText}${ratio}%` : recordText;
|
|
|
|
|
|
|
+ const farmData = JSON.parse(localStorage.getItem('selectedFarmData'));
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ farm_id: farmData.farm_id,
|
|
|
|
|
+ variety_code: farmData.farm_variety,
|
|
|
|
|
+ category_code: farmData.farm_category,
|
|
|
|
|
+ type: recordTypeObj[recordType.value],
|
|
|
|
|
+ time: new Date().toISOString().slice(0, 10),
|
|
|
|
|
+ zone_name: mapConfirmPayload.value.zone_name,
|
|
|
|
|
+ coordinates: mapConfirmPayload.value.coordinates[0],
|
|
|
|
|
+ "recog_type": "20",
|
|
|
|
|
+ image_urls: imgArr,
|
|
|
|
|
+ ...formData.value,
|
|
|
|
|
+ }
|
|
|
|
|
+ VE_API.record.writeFarmRecord(params).then(res => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ showUploadProgressPopup.value = false;
|
|
|
|
|
+ store.commit('recordDetails/CLEAR_MAP_CONFIRM_PAYLOAD');
|
|
|
|
|
+ ElMessage.success(t('recordDetails.confirmSuccess'));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage.error(res.msg);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const displayPhenologyTrackList = computed(() =>
|
|
|
|
|
- phenologyTrackRawList.value.map((item) => ({
|
|
|
|
|
- date: item.time,
|
|
|
|
|
- content: formatTrackItemContent(item),
|
|
|
|
|
- images: item.images || [],
|
|
|
|
|
- }))
|
|
|
|
|
-);
|
|
|
|
|
-// const phenologyTrackList = ref([
|
|
|
|
|
-// { date: '04/18', content: '有 60%已经来花了', images: [] },
|
|
|
|
|
-// {
|
|
|
|
|
-// date: '04/18',
|
|
|
|
|
-// content: '有 60% 进入 红黄叶 阶段',
|
|
|
|
|
-// images: [
|
|
|
|
|
-// 'https://birdseye-img.sysuimars.com/birdseye-look-mini/custom-empty-image.png',
|
|
|
|
|
-// 'https://birdseye-img.sysuimars.com/birdseye-look-mini/custom-empty-image.png',
|
|
|
|
|
-// 'https://birdseye-img.sysuimars.com/birdseye-look-mini/custom-empty-image.png',
|
|
|
|
|
-// 'https://birdseye-img.sysuimars.com/birdseye-look-mini/custom-empty-image.png',
|
|
|
|
|
-// ],
|
|
|
|
|
-// },
|
|
|
|
|
-// ]);
|
|
|
|
|
|
|
+const handleUploadClick = () => { };
|
|
|
|
|
|
|
|
const activeTab = ref(0);
|
|
const activeTab = ref(0);
|
|
|
|
|
|
|
@@ -546,7 +636,9 @@ function syncCurStageFromModel() {
|
|
|
|
|
|
|
|
watch([growthStages, growthStageIndex], syncCurStageFromModel, { immediate: true });
|
|
watch([growthStages, growthStageIndex], syncCurStageFromModel, { immediate: true });
|
|
|
|
|
|
|
|
-onMounted(() => {
|
|
|
|
|
|
|
+onActivated(() => {
|
|
|
|
|
+ sessionStorage.removeItem('mapManageConfirmPayload');
|
|
|
|
|
+ syncFormFromMapConfirmPayload();
|
|
|
if (route.query.workId) {
|
|
if (route.query.workId) {
|
|
|
getWorkDetail();
|
|
getWorkDetail();
|
|
|
}
|
|
}
|
|
@@ -556,7 +648,6 @@ onMounted(() => {
|
|
|
if (route.query.type === 'growth') {
|
|
if (route.query.type === 'growth') {
|
|
|
getGrowthAnomalyInfo();
|
|
getGrowthAnomalyInfo();
|
|
|
}
|
|
}
|
|
|
- getFarmRecord()
|
|
|
|
|
getFindPhenologyInfo()
|
|
getFindPhenologyInfo()
|
|
|
if (showMap.value) {
|
|
if (showMap.value) {
|
|
|
location.value = "POINT(113.6142086995688 23.585836479509055)";
|
|
location.value = "POINT(113.6142086995688 23.585836479509055)";
|
|
@@ -574,9 +665,11 @@ const getWorkDetail = async () => {
|
|
|
|
|
|
|
|
// 获取生长异常列表
|
|
// 获取生长异常列表
|
|
|
const getGrowthAnomalyInfo = async () => {
|
|
const getGrowthAnomalyInfo = async () => {
|
|
|
|
|
+ const farmData = JSON.parse(localStorage.getItem('selectedFarmData'));
|
|
|
const params = {
|
|
const params = {
|
|
|
- crop_type: JSON.parse(localStorage.getItem('selectedFarmData')).farm_variety,
|
|
|
|
|
|
|
+ crop_type: farmData.farm_variety,
|
|
|
phenology_code: route.query.curCode,
|
|
phenology_code: route.query.curCode,
|
|
|
|
|
+ farm_id: farmData.farm_id,
|
|
|
}
|
|
}
|
|
|
const res = await VE_API.record.growthAnomalyInfo(params);
|
|
const res = await VE_API.record.growthAnomalyInfo(params);
|
|
|
if (res.code === 200 && res.data?.length) {
|
|
if (res.code === 200 && res.data?.length) {
|
|
@@ -588,103 +681,6 @@ const getGrowthAnomalyInfo = async () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const getFarmRecord = async () => {
|
|
|
|
|
- // const res = await VE_API.monitor.getFarmRecord();
|
|
|
|
|
- const res = {
|
|
|
|
|
- "code": 200,
|
|
|
|
|
- "data": {
|
|
|
|
|
- "abnormal": [
|
|
|
|
|
- {
|
|
|
|
|
- "id": 2,
|
|
|
|
|
- "ratio": "5",
|
|
|
|
|
- "record": "果园出现蒂蛀虫为害果,占比",
|
|
|
|
|
- "time": "05-12"
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "id": 3,
|
|
|
|
|
- "ratio": "8",
|
|
|
|
|
- "record": "果园出现缺钙裂果症状,占比",
|
|
|
|
|
- "time": "05-12"
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "id": 4,
|
|
|
|
|
- "ratio": "",
|
|
|
|
|
- "record": "果园出现荔枝蝽象若虫为害",
|
|
|
|
|
- "time": "05-03"
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "id": 1,
|
|
|
|
|
- "ratio": "",
|
|
|
|
|
- "record": "果园出现花而不实现象",
|
|
|
|
|
- "time": "04-15"
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- "farming": [
|
|
|
|
|
- {
|
|
|
|
|
- "id": 2,
|
|
|
|
|
- "ratio": "",
|
|
|
|
|
- "record": "执行了膨果壮果追肥农事",
|
|
|
|
|
- "time": "05-07"
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "id": 3,
|
|
|
|
|
- "ratio": "",
|
|
|
|
|
- "record": "执行了蒂蛀虫防治农事",
|
|
|
|
|
- "time": "05-03"
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "id": 4,
|
|
|
|
|
- "ratio": "",
|
|
|
|
|
- "record": "执行了保花保果药剂喷施农事",
|
|
|
|
|
- "time": "04-10"
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "id": 1,
|
|
|
|
|
- "ratio": "",
|
|
|
|
|
- "record": "执行了花前病虫综合防治农事",
|
|
|
|
|
- "time": "03-15"
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- "phenology": [
|
|
|
|
|
- {
|
|
|
|
|
- "id": 2,
|
|
|
|
|
- "ratio": "65",
|
|
|
|
|
- "record": "果园出现果实迅速膨大,占比",
|
|
|
|
|
- "time": "05-10"
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "id": 3,
|
|
|
|
|
- "ratio": "80",
|
|
|
|
|
- "record": "果园出现谢花坐果,占比",
|
|
|
|
|
- "time": "04-25"
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "id": 4,
|
|
|
|
|
- "ratio": "",
|
|
|
|
|
- "record": "果园进入盛花期",
|
|
|
|
|
- "time": "03-20"
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- "id": 1,
|
|
|
|
|
- "ratio": "100",
|
|
|
|
|
- "record": "果园出现花穗抽生",
|
|
|
|
|
- "time": "02-15"
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- "polygon":[
|
|
|
|
|
- "MULTIPOLYGON (((110.48938292603424 21.417825047316228, 110.4899730323636 21.417990023279287, 110.49068052543606 21.417796493784067, 110.49084867401376 21.41706679240906, 110.49043306149144 21.415388479246303, 110.48927822974991 21.415515383833224, 110.48873888525532 21.416276811355146, 110.48938292603424 21.417825047316228)))",
|
|
|
|
|
- "MULTIPOLYGON (((110.48996192821238 21.41538768609246, 110.49012614274784 21.415411734511736, 110.4903759544273 21.415328199567455, 110.4905258604706 21.415064079395847, 110.4906400745989 21.41417654044062, 110.49084470824545 21.413217617655164, 110.49126349338252 21.41276314060309, 110.49141339942582 21.412484743665402, 110.49060914160583 21.412625131864786, 110.49000713797136 21.41311768029294, 110.48996192821238 21.41538768609246)))",
|
|
|
|
|
- "MULTIPOLYGON (((110.49144762747073 21.417923243516555, 110.49146967053326 21.417909231135127, 110.49165526849174 21.41746823769546, 110.49183769383541 21.416946342581525, 110.49196777103703 21.416824196916536, 110.49210815923641 21.416644944187453, 110.4923865561741 21.416283266114533, 110.49282437699918 21.415975522491067, 110.49311308493458 21.415770095690846, 110.49327568143673 21.415638432181936, 110.49335023788149 21.41553373589761, 110.49344541632172 21.41515064267577, 110.49345255470479 21.414922214419164, 110.49277207842925 21.414636431237852, 110.49198459250442 21.414455575677493, 110.49168240095673 21.414377846617867, 110.49167605572734 21.414614206411272, 110.49148411253958 21.414625310562485, 110.4913199297302 21.414685590241334, 110.4913104118861 21.414970332408416, 110.49127789258574 21.415159896135265, 110.49120730190918 21.415339148864177, 110.49111212346895 21.41546288083657, 110.49093366389366 21.415717483164258, 110.49088924728812 21.415978430721168, 110.49090193774674 21.416193375365253, 110.49094714750589 21.41630679633994, 110.49102963548751 21.41653443144287, 110.49111767554473 21.4168675559838, 110.49114940169142 21.41712136515764, 110.49114860853774 21.41767498641832, 110.4913286544205 21.41780585677361, 110.49144762747073 21.417923243516555)))",
|
|
|
|
|
- // "POLYGON ((110.48760606287757 21.42397019891643, 110.4878409330982 21.423999557694007, 110.48775285676547 21.423823405028536, 110.48760606287757 21.42397019891643))"
|
|
|
|
|
- ]
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if (res.code === 200 && res.data?.abnormal?.length) {
|
|
|
|
|
- phenologyTrackRawList.value =
|
|
|
|
|
- recordType.value === "phenology" ? res.data.phenology || [] : res.data.abnormal || [];
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
function normalizeTimeDescribe(raw) {
|
|
function normalizeTimeDescribe(raw) {
|
|
|
if (Array.isArray(raw)) return raw;
|
|
if (Array.isArray(raw)) return raw;
|
|
|
if (typeof raw === 'string' && raw.trim()) {
|
|
if (typeof raw === 'string' && raw.trim()) {
|
|
@@ -1087,7 +1083,8 @@ const getFindPhenologyInfo = async () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- .aaa{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .special-input {
|
|
|
padding: 8px;
|
|
padding: 8px;
|
|
|
background: rgba(33, 153, 248, 0.1);
|
|
background: rgba(33, 153, 248, 0.1);
|
|
|
border-radius: 5px;
|
|
border-radius: 5px;
|