|
@@ -15,151 +15,137 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!-- 最新报告 -->
|
|
|
|
|
- <div class="report-section">
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- <!-- 报告生成中:status=generating 时展示,并轮询状态 -->
|
|
|
|
|
- <div v-if="showGeneratingCard" class="generating-card">
|
|
|
|
|
- <div class="generating-card__spinner"></div>
|
|
|
|
|
- <div class="generating-card__text">
|
|
|
|
|
- <div class="generating-card__title">报告生成中</div>
|
|
|
|
|
- <div class="generating-card__desc">
|
|
|
|
|
- {{ selectedZoneName || "当前分区" }}
|
|
|
|
|
- <template v-if="reportGenMessage"> · {{ reportGenMessage }}</template>
|
|
|
|
|
|
|
+ <!-- 最新、历史都无数据:只显示统一空态(生成中除外) -->
|
|
|
|
|
+ <div v-if="isAllReportsEmpty" class="report-empty report-empty--all">暂无报告</div>
|
|
|
|
|
+
|
|
|
|
|
+ <template v-else>
|
|
|
|
|
+ <!-- 最新报告 -->
|
|
|
|
|
+ <div class="report-section">
|
|
|
|
|
+ <!-- 报告生成中:status=generating 时展示,并轮询状态 -->
|
|
|
|
|
+ <div v-if="showGeneratingCard" class="generating-card">
|
|
|
|
|
+ <div class="generating-card__spinner"></div>
|
|
|
|
|
+ <div class="generating-card__text">
|
|
|
|
|
+ <div class="generating-card__title">报告生成中</div>
|
|
|
|
|
+ <div class="generating-card__desc">
|
|
|
|
|
+ {{ selectedZoneName || "当前分区" }}
|
|
|
|
|
+ <template v-if="reportGenMessage"> · {{ reportGenMessage }}</template>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
|
|
|
|
- <div class="report-section__title">最新报告</div>
|
|
|
|
|
-
|
|
|
|
|
- <div
|
|
|
|
|
- v-for="report in latestReports"
|
|
|
|
|
- :key="report.id"
|
|
|
|
|
- class="latest-card"
|
|
|
|
|
- @click="handleReportClick(report)"
|
|
|
|
|
- >
|
|
|
|
|
- <div class="latest-card__header">
|
|
|
|
|
- <div class="latest-card__header-left">
|
|
|
|
|
- <div class="latest-card__type-icon">
|
|
|
|
|
- <el-icon><Search /></el-icon>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="latest-card__type-meta">
|
|
|
|
|
- <div class="latest-card__type-name">
|
|
|
|
|
- {{ report.title || "—" }}
|
|
|
|
|
- <span v-if="report.showUnRead" class="new-report-badge"></span>
|
|
|
|
|
|
|
+ <div class="report-section__title">最新报告</div>
|
|
|
|
|
+
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-for="report in latestReports"
|
|
|
|
|
+ :key="report.id"
|
|
|
|
|
+ class="latest-card"
|
|
|
|
|
+ @click="handleReportClick(report)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="latest-card__header">
|
|
|
|
|
+ <div class="latest-card__header-left">
|
|
|
|
|
+ <div class="latest-card__type-icon">
|
|
|
|
|
+ <el-icon><Search /></el-icon>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="latest-card__type-meta">
|
|
|
|
|
+ <div class="latest-card__type-name">
|
|
|
|
|
+ {{ report.title || "—" }}
|
|
|
|
|
+ <span v-if="report.showUnRead" class="new-report-badge"></span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="latest-card__date">{{ report.dateText }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="latest-card__date">{{ report.dateText }}</div>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <span class="risk-badge" :class="'badge-'+report.riskLevel">{{ report.riskLevelText || "—" }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <span class="risk-badge" :class="'badge-'+report.riskLevel">{{ report.riskLevelText || "—" }}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <div class="latest-card__subject">{{ report.riskName || "—" }}</div>
|
|
|
|
|
|
|
|
|
|
- <div class="latest-card__conclusion">
|
|
|
|
|
- <div class="latest-card__conclusion-label">核心结论</div>
|
|
|
|
|
- <div class="latest-card__conclusion-text">
|
|
|
|
|
- {{ report.desc || "—" }}
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div class="latest-card__subject">{{ report.riskName || "—" }}</div>
|
|
|
|
|
|
|
|
- <!-- <div class="latest-card__evidence">
|
|
|
|
|
- <div class="latest-card__avatars">
|
|
|
|
|
- <img
|
|
|
|
|
- v-for="(src, idx) in mockPhotoAvatars"
|
|
|
|
|
- :key="idx"
|
|
|
|
|
- class="latest-card__avatar"
|
|
|
|
|
- :src="src"
|
|
|
|
|
- alt=""
|
|
|
|
|
- />
|
|
|
|
|
- <span class="latest-card__avatar-more">+3</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="latest-card__evidence-text">
|
|
|
|
|
- 基于 <em>6</em> 张待完善待完善 · <em>4</em> 项待完善
|
|
|
|
|
|
|
+ <div class="latest-card__conclusion">
|
|
|
|
|
+ <div class="latest-card__conclusion-label">核心结论</div>
|
|
|
|
|
+ <div class="latest-card__conclusion-text">
|
|
|
|
|
+ {{ report.desc || "—" }}
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div> -->
|
|
|
|
|
|
|
|
|
|
- <div class="latest-card__footer">
|
|
|
|
|
- <div class="latest-card__share" @click.stop="handleShare(report)">
|
|
|
|
|
- <Icon size="14" color="rgba(255,255,255,0.75)" name="share" />
|
|
|
|
|
- <span>转发</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="latest-card__detail" @click.stop="handleReportClick(report)">
|
|
|
|
|
- 查看完整报告 <el-icon><ArrowRight /></el-icon>
|
|
|
|
|
|
|
+ <div class="latest-card__footer">
|
|
|
|
|
+ <div class="latest-card__share" @click.stop="handleShare(report)">
|
|
|
|
|
+ <Icon size="14" color="rgba(255,255,255,0.75)" name="share" />
|
|
|
|
|
+ <span>转发</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="latest-card__detail" @click.stop="handleReportClick(report)">
|
|
|
|
|
+ 查看完整报告 <el-icon><ArrowRight /></el-icon>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
|
|
|
|
- <div v-if="!latestReports.length && !showGeneratingCard" class="report-empty">暂无最新报告</div>
|
|
|
|
|
-
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 历史报告 -->
|
|
|
|
|
- <div class="report-section report-section--history">
|
|
|
|
|
- <div class="report-section__head">
|
|
|
|
|
- <div class="report-section__title">历史报告</div>
|
|
|
|
|
- <div class="report-section__meta">
|
|
|
|
|
- 共 <span class="report-section__meta-count">{{ historyCount }}</span> 份 · 按时间排序
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div v-if="!latestReports.length && !showGeneratingCard" class="report-empty">暂无最新报告</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <List
|
|
|
|
|
- v-model:loading="historyLoading"
|
|
|
|
|
- :finished="historyFinished"
|
|
|
|
|
- :finished-text="historyMonthGroups.length ? '没有更多了' : ''"
|
|
|
|
|
- @load="loadHistoryPage"
|
|
|
|
|
- >
|
|
|
|
|
- <div v-if="!historyMonthGroups.length && !historyLoading" class="report-empty">
|
|
|
|
|
- 暂无历史报告
|
|
|
|
|
|
|
+ <!-- 历史报告 -->
|
|
|
|
|
+ <div class="report-section report-section--history">
|
|
|
|
|
+ <div class="report-section__head">
|
|
|
|
|
+ <div class="report-section__title">历史报告</div>
|
|
|
|
|
+ <div class="report-section__meta">
|
|
|
|
|
+ 共 <span class="report-section__meta-count">{{ historyCount }}</span> 份 · 按时间排序
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <div
|
|
|
|
|
- v-for="monthGroup in historyMonthGroups"
|
|
|
|
|
- :key="monthGroup.key"
|
|
|
|
|
- class="history-month"
|
|
|
|
|
|
|
+ <List
|
|
|
|
|
+ v-model:loading="historyLoading"
|
|
|
|
|
+ :finished="historyFinished"
|
|
|
|
|
+ :finished-text="historyMonthGroups.length ? '没有更多了' : ''"
|
|
|
|
|
+ @load="loadHistoryPage"
|
|
|
>
|
|
>
|
|
|
- <div class="history-month__label">
|
|
|
|
|
- <span>{{ monthGroup.label }}</span>
|
|
|
|
|
- <i class="history-month__line"></i>
|
|
|
|
|
|
|
+ <div v-if="!historyMonthGroups.length && !historyLoading" class="report-empty">
|
|
|
|
|
+ 暂无历史报告
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div
|
|
<div
|
|
|
- v-for="item in monthGroup.items"
|
|
|
|
|
- :key="item.id"
|
|
|
|
|
- class="history-card"
|
|
|
|
|
- @click="handleReportClick(item)"
|
|
|
|
|
|
|
+ v-for="monthGroup in historyMonthGroups"
|
|
|
|
|
+ :key="monthGroup.key"
|
|
|
|
|
+ class="history-month"
|
|
|
>
|
|
>
|
|
|
- <div class="history-card-wrap">
|
|
|
|
|
- <img class="history-card__cover" :src="item.cover" alt="" />
|
|
|
|
|
- <div class="history-card__body">
|
|
|
|
|
- <div class="history-card__top">
|
|
|
|
|
- <div class="history-card__type">
|
|
|
|
|
- <el-icon><WarningFilled /></el-icon>
|
|
|
|
|
- <span>{{ resolveTypeLabel(item.type) }}</span>
|
|
|
|
|
|
|
+ <div class="history-month__label">
|
|
|
|
|
+ <span>{{ monthGroup.label }}</span>
|
|
|
|
|
+ <i class="history-month__line"></i>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div
|
|
|
|
|
+ v-for="item in monthGroup.items"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ class="history-card"
|
|
|
|
|
+ @click="handleReportClick(item)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div class="history-card-wrap">
|
|
|
|
|
+ <img class="history-card__cover" :src="item.cover" alt="" />
|
|
|
|
|
+ <div class="history-card__body">
|
|
|
|
|
+ <div class="history-card__top">
|
|
|
|
|
+ <div class="history-card__type">
|
|
|
|
|
+ <el-icon><WarningFilled /></el-icon>
|
|
|
|
|
+ <span>{{ resolveTypeLabel(item.type) }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <span class="risk-badge" :class="'badge-'+item.riskLevel">{{ item.riskLevelText || "—" }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="history-card__title van-ellipsis">
|
|
|
|
|
+ {{ item.title || "—" }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="history-card__desc van-ellipsis">
|
|
|
|
|
+ {{ item.desc || "—" }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="history-card__line"></div>
|
|
|
|
|
+ <div class="history-card__bottom">
|
|
|
|
|
+ <span class="history-card__time">
|
|
|
|
|
+ <el-icon><Clock /></el-icon>
|
|
|
|
|
+ {{ item.dateText }}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <el-icon class="history-card__arrow"><ArrowRight /></el-icon>
|
|
|
</div>
|
|
</div>
|
|
|
- <span class="risk-badge" :class="'badge-'+item.riskLevel">{{ item.riskLevelText || "—" }}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="history-card__title van-ellipsis">
|
|
|
|
|
- {{ item.title || "—" }}
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="history-card__desc van-ellipsis">
|
|
|
|
|
- {{ item.desc || "—" }}
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="history-card__line"></div>
|
|
|
|
|
- <div class="history-card__bottom">
|
|
|
|
|
- <span class="history-card__time">
|
|
|
|
|
- <el-icon><Clock /></el-icon>
|
|
|
|
|
- {{ item.dateText }}
|
|
|
|
|
- </span>
|
|
|
|
|
- <el-icon class="history-card__arrow"><ArrowRight /></el-icon>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- </List>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </List>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -234,6 +220,16 @@ const historyMonthGroups = computed(() => {
|
|
|
return Array.from(map.values());
|
|
return Array.from(map.values());
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+/** 最新 + 历史都无数据且不在生成中 / 加载中:统一「暂无报告」 */
|
|
|
|
|
+const isAllReportsEmpty = computed(
|
|
|
|
|
+ () =>
|
|
|
|
|
+ !showGeneratingCard.value &&
|
|
|
|
|
+ !latestReports.value.length &&
|
|
|
|
|
+ !historyList.value.length &&
|
|
|
|
|
+ historyFinished.value &&
|
|
|
|
|
+ !historyLoading.value
|
|
|
|
|
+);
|
|
|
|
|
+
|
|
|
const getSelectedFarm = () => {
|
|
const getSelectedFarm = () => {
|
|
|
try {
|
|
try {
|
|
|
return JSON.parse(localStorage.getItem("selectedFarmData") || "{}");
|
|
return JSON.parse(localStorage.getItem("selectedFarmData") || "{}");
|
|
@@ -401,7 +397,6 @@ const parseReportTime = (raw) => {
|
|
|
|
|
|
|
|
const mapReportItem = (item, index) => {
|
|
const mapReportItem = (item, index) => {
|
|
|
const timeInfo = parseReportTime(item.time || item.date);
|
|
const timeInfo = parseReportTime(item.time || item.date);
|
|
|
- console.log("iiiii", item)
|
|
|
|
|
return {
|
|
return {
|
|
|
id: item.id ?? `${item.time || ""}-${index}`,
|
|
id: item.id ?? `${item.time || ""}-${index}`,
|
|
|
taskId: item.task_id || "",
|
|
taskId: item.task_id || "",
|
|
@@ -687,6 +682,10 @@ watch(
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
font-size: 13px;
|
|
font-size: 13px;
|
|
|
color: rgba(255, 255, 255, 0.35);
|
|
color: rgba(255, 255, 255, 0.35);
|
|
|
|
|
+
|
|
|
|
|
+ &--all {
|
|
|
|
|
+ padding: 48px 0;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// ---------- 最新报告卡片 ----------
|
|
// ---------- 最新报告卡片 ----------
|