Browse Source

页面数据修改

dev-V1.0.1
wangmingyong 5 months ago
parent
commit
73242646ff
  1. 109
      zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/components/EnforcementRecordList.vue
  2. 8
      zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/components/HistoryActivityList.vue

109
zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/components/EnforcementRecordList.vue

@ -11,41 +11,32 @@
</div> </div>
<!-- 执法记录列表 --> <!-- 执法记录列表 -->
<van-list <div class="record-list">
v-model:loading="loading" <van-loading v-if="loading" class="loading-state" type="spinner">加载中...</van-loading>
:finished="!hasMore" <template v-else>
finished-text="已加载全部数据" <div v-for="(item, index) in cityRecords" :key="index" class="record-card-item">
@load="onLoad" <div class="record-header">
class="record-list" <div class="record-date">{{ item.createTime }}</div>
> <div class="record-company">{{ enterpriseName }}</div>
<template v-if="cityRecords.length === 0"> <div class="record-count">{{ item.caseType || '执法检查' }}</div>
<!-- <div class="empty-state"> </div>
<van-icon name="file-o" class="empty-icon" /> <div class="record-timeline" v-if="isRecordExpanded">
<div class="empty-text">暂无数据</div> <div class="timeline-item">
</div> --> <div class="timeline-dot"></div>
</template> <div class="timeline-content">
<div v-for="(item, index) in cityRecords" :key="index" class="record-card-item"> <div class="timeline-time">{{ item.createTime }}</div>
<div class="record-header"> <div class="timeline-unit"><span class="unit-label">执法单位:</span>{{
<div class="record-date">{{ item.createTime }}</div> item.enforcementUnit ||
<div class="record-company">{{ enterpriseName }}</div> item.unitName }}</div>
<div class="record-count">{{ item.caseType || '执法检查' }}</div> </div>
</div>
<div class="record-timeline" v-if="isRecordExpanded">
<div class="timeline-item">
<div class="timeline-dot"></div>
<div class="timeline-content">
<div class="timeline-time">{{ item.createTime }}</div>
<div class="timeline-unit"><span class="unit-label">执法单位:</span>{{
item.enforcementUnit ||
item.unitName }}</div>
</div> </div>
</div> </div>
<div class="record-expand" @click="$emit('toggle-expand')">
<van-icon :name="isRecordExpanded ? 'arrow-up' : 'arrow-down'" />
</div>
</div> </div>
<div class="record-expand" @click="$emit('toggle-expand')"> </template>
<van-icon :name="isRecordExpanded ? 'arrow-up' : 'arrow-down'" /> </div>
</div>
</div>
</van-list>
</div> </div>
</template> </template>
@ -68,38 +59,22 @@ defineEmits(['toggle-expand']);
// ========== 数据 ========== // ========== 数据 ==========
const recordTab = ref(0); const recordTab = ref(0);
// 历史执法案件数据
const cityRecords = ref([]); const cityRecords = ref([]);
// 分页相关
const pageNum = ref(1);
const pageSize = ref(10);
const hasMore = ref(true);
const loading = ref(false); const loading = ref(false);
// ========== 获取执法记录数据 ========== // ========== 获取执法记录数据 ==========
const fetchEnfRegistrationList = (isLoadMore = false) => { const fetchEnfRegistrationList = () => {
loading.value = true;
const params = { const params = {
pageSize: pageSize.value, warnType: recordTab.value === 0 ? 1 : 0,
pageNum: isLoadMore ? pageNum.value : 1, // pageSize: 20,
warnType: recordTab.value === 0 ? 1 : 0 // 0=本单位,1=全市 // pageNum: 1,
}; };
queryEnfRegistrationList(params, (res) => { queryEnfRegistrationList(params, (res) => {
loading.value = false; loading.value = false;
if (res.code === 200) { if (res.code === 200) {
const data = res.data.list || []; const data = res.data || [];
if (isLoadMore) { cityRecords.value = data.filter(item => item !== null && item !== undefined);
cityRecords.value = [...cityRecords.value, ...data];
} else {
cityRecords.value = data;
pageNum.value = 1;
}
// 判断是否还有更多数据
hasMore.value = data.length >= pageSize.value;
if (hasMore.value) {
pageNum.value++;
}
} else { } else {
console.error('获取执法记录失败:', res.msg); console.error('获取执法记录失败:', res.msg);
} }
@ -109,25 +84,10 @@ const fetchEnfRegistrationList = (isLoadMore = false) => {
}); });
}; };
// ========== 列表加载处理 ==========
const onLoad = () => {
if (loading.value || !hasMore.value) return;
fetchEnfRegistrationList(true);
};
// ========== 重置分页 ==========
const resetPagination = () => {
pageNum.value = 1;
hasMore.value = true;
loading.value = false;
cityRecords.value = [];
};
// ========== 切换执法记录 Tab ========== // ========== 切换执法记录 Tab ==========
const handleRecordTabChange = (tabIndex) => { const handleRecordTabChange = (tabIndex) => {
recordTab.value = tabIndex; recordTab.value = tabIndex;
resetPagination(); cityRecords.value = [];
loading.value = true;
fetchEnfRegistrationList(); fetchEnfRegistrationList();
}; };
@ -272,6 +232,13 @@ fetchEnfRegistrationList();
font-size: 0.4rem; font-size: 0.4rem;
} }
.loading-state {
display: flex;
justify-content: center;
align-items: center;
padding: 2rem 0;
}
.record-list { .record-list {
height: calc(100vh - 150px); height: calc(100vh - 150px);
} }

8
zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/components/HistoryActivityList.vue

@ -107,6 +107,14 @@ const fetchActivityList = (isLoadMore = false) => {
if (dateSearch.value) { if (dateSearch.value) {
params.dateSearch = dateSearch.value; params.dateSearch = dateSearch.value;
} }
// 日期类型:month=1, quarter=2, year=3
if (dateSearch.value === 'month') {
params.dateType = 1;
} else if (dateSearch.value === 'quarter') {
params.dateType = 2;
} else if (dateSearch.value === 'year') {
params.dateType = 3;
}
queryNonRegistrationList(params, (res) => { queryNonRegistrationList(params, (res) => {
loading.value = false; loading.value = false;

Loading…
Cancel
Save