|
|
@@ -13,7 +13,7 @@
|
|
|
<!-- <el-date-picker style="width: 110px" v-model="date" type="year" placeholder="全部日期" /> -->
|
|
|
</div>
|
|
|
<div class="archives-time-line-content">
|
|
|
- <div class="report-box">
|
|
|
+ <div class="report-box" v-if="hasReport">
|
|
|
<div class="box-content">
|
|
|
<div class="box-title" @click="handleReportClick">
|
|
|
<span>农情互动报告</span>
|
|
|
@@ -25,7 +25,7 @@
|
|
|
</div>
|
|
|
<img src="@/assets/img/monitor/report-icon.png" alt="" class="report-icon" />
|
|
|
</div>
|
|
|
- <div class="time-line">
|
|
|
+ <div class="time-line" :class="{ 'no-report': !hasReport }">
|
|
|
<archives-farm-time-line :farmId="gardenId"></archives-farm-time-line>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -90,7 +90,7 @@ const defaultGardenId = ref(null);
|
|
|
const isHeaderShow = ref(false);
|
|
|
const isDefaultFarm = ref(false);
|
|
|
const weatherInfoRef = ref(null);
|
|
|
-
|
|
|
+const hasReport = ref(false);
|
|
|
onActivated(() => {
|
|
|
// 用来接收我的农场跳转过来的农场详情逻辑
|
|
|
if (route.query.isHeaderShow) {
|
|
|
@@ -99,6 +99,8 @@ onActivated(() => {
|
|
|
// 统一转换为布尔值
|
|
|
isDefaultFarm.value = route.query.defaultFarm === "true" || route.query.defaultFarm === true;
|
|
|
}
|
|
|
+
|
|
|
+ getReport();
|
|
|
});
|
|
|
|
|
|
const receiveFarm = (json) => {
|
|
|
@@ -338,6 +340,7 @@ const changeGarden = ({ id }) => {
|
|
|
getStayCount();
|
|
|
getBroadcastList(1, false);
|
|
|
checkHasUnrepliedTriggeredInteraction();
|
|
|
+ getReport();
|
|
|
};
|
|
|
|
|
|
function handlePage(url) {
|
|
|
@@ -356,7 +359,7 @@ function handlePage(url) {
|
|
|
function handleReportClick() {
|
|
|
router.push({
|
|
|
path: "/growth_report",
|
|
|
- query: { miniJson: JSON.stringify({ id: gardenId.value }) },
|
|
|
+ query: { miniJson: JSON.stringify({ farmId: gardenId.value }) },
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -365,6 +368,16 @@ const handleClosePopup = () => {
|
|
|
interactionId: expertInfo.value.id,
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+const getReport = () => {
|
|
|
+ VE_API.farm.growthReportByFarm({farmId: gardenId.value, limit: 20}).then(({ data }) => {
|
|
|
+ if (data && data.length > 0) {
|
|
|
+ hasReport.value = true;
|
|
|
+ } else {
|
|
|
+ hasReport.value = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
@@ -460,6 +473,9 @@ const handleClosePopup = () => {
|
|
|
|
|
|
.time-line {
|
|
|
height: calc(100% - 100px);
|
|
|
+ &.no-report {
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|