|
@@ -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">{{ t('recordDetails.growthQuestion') }}</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>
|
|
@@ -19,22 +19,22 @@
|
|
|
<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.growthScience')" />
|
|
|
|
|
|
|
+ :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': activeTab1 === index }"
|
|
|
|
|
- v-for="(item, index) in tabsList1" :key="index" @click="activeTab1 = index">{{ item.label }}
|
|
|
|
|
|
|
+ <div class="item-tab" :class="{ 'item-tab--active': activeGrowthAnomalyIndex === index }"
|
|
|
|
|
+ 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="t('recordDetails.growthPhenotype')" />
|
|
|
|
|
|
|
+ :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="t('recordDetails.growthHighRisk')" />
|
|
|
|
|
|
|
+ :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'">
|
|
@@ -51,27 +51,27 @@
|
|
|
@click="handlePestTopClick(i)">{{ label }}</div>
|
|
@click="handlePestTopClick(i)">{{ label }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="pest-classify-picker__row pest-classify-picker__row--grid4">
|
|
<div class="pest-classify-picker__row pest-classify-picker__row--grid4">
|
|
|
- <div v-for="(label, i) in pestCategoryLabels" :key="'cat-' + i"
|
|
|
|
|
|
|
+ <div v-for="(item, i) in pestCategoryLabels" :key="'cat-' + item.value"
|
|
|
class="pest-classify-picker__chip pest-classify-picker__chip--solid"
|
|
class="pest-classify-picker__chip pest-classify-picker__chip--solid"
|
|
|
:class="{ 'pest-classify-picker__chip--solid-active': pestCategoryIndex === i }"
|
|
:class="{ 'pest-classify-picker__chip--solid-active': pestCategoryIndex === i }"
|
|
|
- @click="handlePestCategoryClick(i)">{{ label }}</div>
|
|
|
|
|
|
|
+ @click="handlePestCategoryClick(i)">{{ item.label }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="pest-classify-picker__row pest-classify-picker__row--grid4">
|
|
<div class="pest-classify-picker__row pest-classify-picker__row--grid4">
|
|
|
- <div v-for="(label, i) in pestDetailLabels" :key="'det-' + i"
|
|
|
|
|
|
|
+ <div v-for="(item, i) in pestDetailLabels" :key="'det-' + item.value"
|
|
|
class="pest-classify-picker__chip pest-classify-picker__chip--soft"
|
|
class="pest-classify-picker__chip pest-classify-picker__chip--soft"
|
|
|
:class="{ 'pest-classify-picker__chip--soft-active': pestDetailIndex === i }"
|
|
:class="{ 'pest-classify-picker__chip--soft-active': pestDetailIndex === i }"
|
|
|
- @click="handlePestDetailClick(i)">{{ label }}</div>
|
|
|
|
|
|
|
+ @click="handlePestDetailClick(i)">{{ item.label }}</div>
|
|
|
</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="pestText1Content" />
|
|
|
|
|
|
|
+ :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="pestText2Content" />
|
|
|
|
|
|
|
+ :content="currentPestDetail?.patrol_points" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="card-wrap" v-else>
|
|
<div class="card-wrap" v-else>
|
|
@@ -273,66 +273,75 @@ const showMap = ref(false);
|
|
|
const pestTopIndex = ref(0);
|
|
const pestTopIndex = ref(0);
|
|
|
const pestCategoryIndex = ref(0);
|
|
const pestCategoryIndex = ref(0);
|
|
|
const pestDetailIndex = ref(0);
|
|
const pestDetailIndex = ref(0);
|
|
|
-const pestDetailKeys = ref(['detDownyMildew', 'detAnthracnose', 'detBlast', 'detSheathBlight']);
|
|
|
|
|
|
|
+const pestData = ref([]);
|
|
|
|
|
|
|
|
const pestTopLabels = computed(() => [t('recordDetails.pestDisease'), t('recordDetails.pestInsect')]);
|
|
const pestTopLabels = computed(() => [t('recordDetails.pestDisease'), t('recordDetails.pestInsect')]);
|
|
|
|
|
|
|
|
|
|
+const PEST_CATEGORY_DISEASE = [
|
|
|
|
|
+ { key: 'catDiseaseFungal', value: 1 },
|
|
|
|
|
+ { key: 'catDiseaseBacterial', value: 2 },
|
|
|
|
|
+ { key: 'catDiseaseSoilBorne', value: 3 },
|
|
|
|
|
+ { key: 'catDiseaseInsectBorne', value: 4 },
|
|
|
|
|
+ { key: 'catDiseaseViral', value: 5 },
|
|
|
|
|
+];
|
|
|
|
|
+
|
|
|
|
|
+const PEST_CATEGORY_INSECT = [
|
|
|
|
|
+ { key: 'catInsectPiercing', value: 1 },
|
|
|
|
|
+ { key: 'catInsectChewing', value: 2 },
|
|
|
|
|
+ { key: 'catInsectBoring', value: 3 },
|
|
|
|
|
+ { key: 'catInsectUnderground', value: 4 },
|
|
|
|
|
+];
|
|
|
|
|
+
|
|
|
const pestCategoryLabels = computed(() => {
|
|
const pestCategoryLabels = computed(() => {
|
|
|
- if (pestTopIndex.value === 0) {
|
|
|
|
|
- return ['catFungal', 'catBorer', 'catVirus', 'catOther'].map((k) => t(`recordDetails.${k}`));
|
|
|
|
|
- }
|
|
|
|
|
- return ['catChewing', 'catMasticate', 'catBorer', 'catOther'].map((k) => t(`recordDetails.${k}`));
|
|
|
|
|
|
|
+ const list = pestTopIndex.value === 0 ? PEST_CATEGORY_DISEASE : PEST_CATEGORY_INSECT;
|
|
|
|
|
+ return list.map(({ key, value }) => ({
|
|
|
|
|
+ label: t(`recordDetails.${key}`),
|
|
|
|
|
+ value,
|
|
|
|
|
+ }));
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const pestDetailLabels = computed(() =>
|
|
const pestDetailLabels = computed(() =>
|
|
|
- pestDetailKeys.value.map((k) => t(`recordDetails.${k}`))
|
|
|
|
|
|
|
+ pestData.value.map((item) => ({
|
|
|
|
|
+ label: item.label ?? item.name ?? '',
|
|
|
|
|
+ value: item.value ?? item.fourth_type ?? item.id,
|
|
|
|
|
+ }))
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
-const pestText1Content = computed(() => {
|
|
|
|
|
- const top = pestTopIndex.value;
|
|
|
|
|
- const cat = pestCategoryIndex.value;
|
|
|
|
|
- const det = pestDetailIndex.value;
|
|
|
|
|
- if (top === 0) {
|
|
|
|
|
- return det === 0 ? t('recordDetails.pestT1_downy') : t('recordDetails.pestT1_anthracnose');
|
|
|
|
|
- }
|
|
|
|
|
- if (cat === 0) return t('recordDetails.pestT1_stinkbug');
|
|
|
|
|
- if (cat !== 0 && det !== 0) return t('recordDetails.pestT1_stemborer');
|
|
|
|
|
- return t('recordDetails.pestT1_riceborer');
|
|
|
|
|
-});
|
|
|
|
|
|
|
+const currentPestDetail = computed(() => pestData.value[pestDetailIndex.value]);
|
|
|
|
|
|
|
|
-const pestText2Content = computed(() => {
|
|
|
|
|
- const top = pestTopIndex.value;
|
|
|
|
|
- const cat = pestCategoryIndex.value;
|
|
|
|
|
- const det = pestDetailIndex.value;
|
|
|
|
|
- if (top === 0) {
|
|
|
|
|
- return det === 0 ? t('recordDetails.pestT2_downy') : t('recordDetails.pestT2_anthracnose');
|
|
|
|
|
|
|
+/** 病虫害列表查询 */
|
|
|
|
|
+const getAbnormalPlan = async () => {
|
|
|
|
|
+ const category = pestCategoryLabels.value[pestCategoryIndex.value];
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ crop_type: JSON.parse(localStorage.getItem('selectedFarmData')).farm_variety,
|
|
|
|
|
+ phenology_code: route.query.curCode,
|
|
|
|
|
+ second_type: pestTopIndex.value === 0 ? 2 : 1,
|
|
|
|
|
+ third_type: category?.value ?? 1,
|
|
|
|
|
+ };
|
|
|
|
|
+ const res = await VE_API.record.abnormalPlan(params);
|
|
|
|
|
+ if (res.code === 200 && res.data?.length) {
|
|
|
|
|
+ pestData.value = res.data;
|
|
|
|
|
+ if (pestDetailIndex.value >= res.data.length) {
|
|
|
|
|
+ pestDetailIndex.value = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ pestData.value = [];
|
|
|
|
|
+ pestDetailIndex.value = 0;
|
|
|
}
|
|
}
|
|
|
- if (cat === 0) return t('recordDetails.pestT2_stinkbug');
|
|
|
|
|
- if (cat !== 0 && det !== 0) return t('recordDetails.pestT2_stemborer');
|
|
|
|
|
- return t('recordDetails.pestT2_riceborer');
|
|
|
|
|
-});
|
|
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
-const handlePestTopClick = (index) => {
|
|
|
|
|
|
|
+/** 病虫害分类选择 */
|
|
|
|
|
+const handlePestTopClick = async (index) => {
|
|
|
pestTopIndex.value = index;
|
|
pestTopIndex.value = index;
|
|
|
pestCategoryIndex.value = 0;
|
|
pestCategoryIndex.value = 0;
|
|
|
pestDetailIndex.value = 0;
|
|
pestDetailIndex.value = 0;
|
|
|
- if (index === 0) {
|
|
|
|
|
- pestDetailKeys.value = ['detDownyMildew', 'detAnthracnose', 'detBlast', 'detSheathBlight'];
|
|
|
|
|
- } else {
|
|
|
|
|
- pestDetailKeys.value = ['detStinkBug'];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ await getAbnormalPlan();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const handlePestCategoryClick = (index) => {
|
|
|
|
|
|
|
+const handlePestCategoryClick = async (index) => {
|
|
|
pestCategoryIndex.value = index;
|
|
pestCategoryIndex.value = index;
|
|
|
pestDetailIndex.value = 0;
|
|
pestDetailIndex.value = 0;
|
|
|
- if (pestTopIndex.value === 1) {
|
|
|
|
|
- pestDetailKeys.value = index === 0 ? ['detStinkBug'] : ['detRiceBorer'];
|
|
|
|
|
- } else if (index !== 0) {
|
|
|
|
|
- pestDetailKeys.value = ['detStemBorer'];
|
|
|
|
|
- } else {
|
|
|
|
|
- pestDetailKeys.value = ['detDownyMildew', 'detAnthracnose', 'detBlast', 'detSheathBlight'];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ await getAbnormalPlan();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handlePestDetailClick = (index) => {
|
|
const handlePestDetailClick = (index) => {
|
|
@@ -351,13 +360,19 @@ const tabsList = ref([
|
|
|
{ label: '分区四', value: 3 },
|
|
{ label: '分区四', value: 3 },
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
-const activeTab1 = ref(0);
|
|
|
|
|
-const tabsList1 = computed(() => [
|
|
|
|
|
- { label: t('recordDetails.tabFruitBlocked'), value: 0 },
|
|
|
|
|
- { label: t('recordDetails.tabSlowGrowth'), value: 1 },
|
|
|
|
|
- { label: t('recordDetails.tabVigorous'), value: 2 },
|
|
|
|
|
- { label: t('recordDetails.tabWilting'), value: 3 },
|
|
|
|
|
-]);
|
|
|
|
|
|
|
+const activeGrowthAnomalyIndex = ref(0);
|
|
|
|
|
+const growthAnomalyData = ref([]);
|
|
|
|
|
+const growthAnomalyTabs = computed(() =>
|
|
|
|
|
+ growthAnomalyData.value.map((item, index) => ({
|
|
|
|
|
+ label: item.name ?? '',
|
|
|
|
|
+ value: item.value ?? item.id ?? index,
|
|
|
|
|
+ }))
|
|
|
|
|
+);
|
|
|
|
|
+
|
|
|
|
|
+const currentGrowthAnomalyDetail = computed(() => growthAnomalyData.value[activeGrowthAnomalyIndex.value]);
|
|
|
|
|
+const handleGrowthAnomalyTabClick = (index) => {
|
|
|
|
|
+ activeGrowthAnomalyIndex.value = index;
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
const currentStatusText = computed(() =>
|
|
const currentStatusText = computed(() =>
|
|
|
t('recordDetails.currentStatus', {
|
|
t('recordDetails.currentStatus', {
|
|
@@ -532,7 +547,15 @@ function syncCurStageFromModel() {
|
|
|
watch([growthStages, growthStageIndex], syncCurStageFromModel, { immediate: true });
|
|
watch([growthStages, growthStageIndex], syncCurStageFromModel, { immediate: true });
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- getWorkDetail();
|
|
|
|
|
|
|
+ if (route.query.workId) {
|
|
|
|
|
+ getWorkDetail();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (route.query.type === 'pest') {
|
|
|
|
|
+ getAbnormalPlan();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (route.query.type === 'growth') {
|
|
|
|
|
+ getGrowthAnomalyInfo();
|
|
|
|
|
+ }
|
|
|
getFarmRecord()
|
|
getFarmRecord()
|
|
|
getFindPhenologyInfo()
|
|
getFindPhenologyInfo()
|
|
|
if (showMap.value) {
|
|
if (showMap.value) {
|
|
@@ -549,6 +572,22 @@ const getWorkDetail = async () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 获取生长异常列表
|
|
|
|
|
+const getGrowthAnomalyInfo = async () => {
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ crop_type: JSON.parse(localStorage.getItem('selectedFarmData')).farm_variety,
|
|
|
|
|
+ phenology_code: route.query.curCode,
|
|
|
|
|
+ }
|
|
|
|
|
+ const res = await VE_API.record.growthAnomalyInfo(params);
|
|
|
|
|
+ if (res.code === 200 && res.data?.length) {
|
|
|
|
|
+ growthAnomalyData.value = res.data;
|
|
|
|
|
+ activeGrowthAnomalyIndex.value = 0;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ growthAnomalyData.value = [];
|
|
|
|
|
+ activeGrowthAnomalyIndex.value = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const getFarmRecord = async () => {
|
|
const getFarmRecord = async () => {
|
|
|
// const res = await VE_API.monitor.getFarmRecord();
|
|
// const res = await VE_API.monitor.getFarmRecord();
|
|
|
const res = {
|
|
const res = {
|
|
@@ -720,12 +759,12 @@ const getFindPhenologyInfo = async () => {
|
|
|
margin: 10px 0;
|
|
margin: 10px 0;
|
|
|
flex-shrink: 0;
|
|
flex-shrink: 0;
|
|
|
display: grid;
|
|
display: grid;
|
|
|
- grid-template-columns: repeat(4, 1fr);
|
|
|
|
|
|
|
+ grid-template-columns: repeat(auto-fill, minmax(8em, 1fr));
|
|
|
gap: 8px;
|
|
gap: 8px;
|
|
|
|
|
|
|
|
.item-tab {
|
|
.item-tab {
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
- padding: 4px;
|
|
|
|
|
|
|
+ padding: 6px 4px;
|
|
|
border-radius: 2px;
|
|
border-radius: 2px;
|
|
|
color: #767676;
|
|
color: #767676;
|
|
|
background: #fff;
|
|
background: #fff;
|
|
@@ -733,8 +772,9 @@ const getFindPhenologyInfo = async () => {
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
- word-break: break-word;
|
|
|
|
|
- overflow-wrap: anywhere;
|
|
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ word-break: keep-all;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.item-tab--active {
|
|
.item-tab--active {
|