|
|
@@ -7,11 +7,18 @@
|
|
|
<span class="table-meta-chip">当前页 {{ currentPageFileCount }} 条</span>
|
|
|
<span class="table-meta-chip is-selected">已选 {{ selectedRowKeysRef.length }} 条</span>
|
|
|
</div>
|
|
|
- <Popconfirm title="是否确认删除选中的导入记录?" @confirm="handleDeleteSelected()">
|
|
|
- <a-button v-if="selectedRowKeysRef.length > 0" danger class="batch-delete-btn" type="default">
|
|
|
- <Icon icon="i-ant-design:delete-outlined" color="error" /> 删除 ({{ selectedRowKeysRef.length }})
|
|
|
+ <div class="table-toolbar__actions">
|
|
|
+ <a-button class="task-log-btn" type="default" @click="openTaskLog">
|
|
|
+ <Icon icon="i-ant-design:file-text-outlined" />
|
|
|
+ 任务日志
|
|
|
+ <span v-if="taskLogCount" class="task-log-btn__count">{{ taskLogCount }}</span>
|
|
|
</a-button>
|
|
|
- </Popconfirm>
|
|
|
+ <Popconfirm title="是否确认删除选中的导入记录?" @confirm="handleDeleteSelected()">
|
|
|
+ <a-button v-if="selectedRowKeysRef.length > 0" danger class="batch-delete-btn" type="default">
|
|
|
+ <Icon icon="i-ant-design:delete-outlined" color="error" /> 删除 ({{ selectedRowKeysRef.length }})
|
|
|
+ </a-button>
|
|
|
+ </Popconfirm>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</BasicTable>
|
|
|
@@ -33,10 +40,18 @@
|
|
|
:file-infos="currentLogFileInfos"
|
|
|
:initial-sheet-id="currentLogSheetId"
|
|
|
/>
|
|
|
+
|
|
|
+ <TaskLogDrawer
|
|
|
+ v-model:open="taskLogDrawerOpen"
|
|
|
+ :logs="taskLogSnapshot?.logs || []"
|
|
|
+ :status="taskLogSnapshot?.status || ''"
|
|
|
+ :batch-id="taskLogSnapshot?.batchId || ''"
|
|
|
+ :updated-at="taskLogSnapshot?.updatedAt || null"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts" setup name="ViewsSysEmpUserList">
|
|
|
- import { h, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
|
|
+ import { computed, h, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
|
|
import type { PropType } from 'vue';
|
|
|
import { Popconfirm } from 'ant-design-vue';
|
|
|
import AnalysisPagination from '@/core/components/AnalysisPagination/src/AnalysisPagination.vue';
|
|
|
@@ -45,7 +60,7 @@
|
|
|
import { useDesign } from '@/core/hooks/web/useDesign';
|
|
|
import { useGo } from '@/core/hooks/web/usePage';
|
|
|
import { useMessage } from '@/core/hooks/web/useMessage';
|
|
|
- import { useEmitter } from '@/core/store/modules/case';
|
|
|
+ import { useEmitter, useUserStore } from '@/core/store/modules/case';
|
|
|
import { PageEnum } from '@/core/enums/pageEnum';
|
|
|
import type { FormProps } from '@/core/components/Form';
|
|
|
import type { FileInfo } from '@/types';
|
|
|
@@ -54,7 +69,13 @@
|
|
|
import { FileStatusEnum } from '@/case/types/enum';
|
|
|
import componentSetting from '@/core/settings/componentSetting';
|
|
|
import CleanLogModal from './components/CleanLogModal.vue';
|
|
|
- import { resetImportProgressSession, setCleanFlowSource } from './importProgressSession';
|
|
|
+ import TaskLogDrawer from './components/TaskLogDrawer.vue';
|
|
|
+ import {
|
|
|
+ getTaskLogSnapshot,
|
|
|
+ resetImportProgressSession,
|
|
|
+ setCleanFlowSource,
|
|
|
+ type TaskLogSnapshot,
|
|
|
+ } from './importProgressSession';
|
|
|
|
|
|
const props = defineProps({
|
|
|
treeCodes: Array as PropType<string[]>,
|
|
|
@@ -68,6 +89,7 @@
|
|
|
const { prefixCls } = useDesign('case-import-list');
|
|
|
const go = useGo();
|
|
|
const emitter = useEmitter();
|
|
|
+ const userStore = useUserStore();
|
|
|
const { createMessage } = useMessage();
|
|
|
const CASE_DATA_REFRESH_EVENT = 'case-data:refresh';
|
|
|
const CASE_IMPORT_FILE_REFRESH_EVENT = 'case-import-file:refresh';
|
|
|
@@ -80,6 +102,17 @@
|
|
|
const logModalOpen = ref(false);
|
|
|
const currentLogFileInfos = ref<FileInfo[]>([]);
|
|
|
const currentLogSheetId = ref<string>('');
|
|
|
+ /** 最近一次清洗任务日志(进度页在任务结束时落盘,结果页只读) */
|
|
|
+ const taskLogDrawerOpen = ref(false);
|
|
|
+ const taskLogSnapshot = ref<TaskLogSnapshot | null>(null);
|
|
|
+ const taskLogCount = computed(() => taskLogSnapshot.value?.logs?.length ?? 0);
|
|
|
+ const refreshTaskLogSnapshot = () => {
|
|
|
+ taskLogSnapshot.value = getTaskLogSnapshot(userStore.getCaseInfo?.id);
|
|
|
+ };
|
|
|
+ const openTaskLog = () => {
|
|
|
+ refreshTaskLogSnapshot();
|
|
|
+ taskLogDrawerOpen.value = true;
|
|
|
+ };
|
|
|
const hasLoadedOnActivate = ref(false);
|
|
|
const recleaningFileIds = ref<string[]>([]);
|
|
|
const paginationLoading = ref(false);
|
|
|
@@ -369,6 +402,7 @@
|
|
|
|
|
|
const handleImportListRefresh = () => {
|
|
|
hasLoadedOnActivate.value = true;
|
|
|
+ refreshTaskLogSnapshot();
|
|
|
syncTableLayout();
|
|
|
void reload();
|
|
|
};
|
|
|
@@ -377,6 +411,7 @@
|
|
|
() => props.active,
|
|
|
(active) => {
|
|
|
if (!active) return;
|
|
|
+ refreshTaskLogSnapshot();
|
|
|
if (!hasLoadedOnActivate.value) {
|
|
|
handleImportListRefresh();
|
|
|
return;
|
|
|
@@ -388,6 +423,7 @@
|
|
|
);
|
|
|
|
|
|
onMounted(() => {
|
|
|
+ refreshTaskLogSnapshot();
|
|
|
emitter.on(CASE_DATA_REFRESH_EVENT, handleImportListRefresh);
|
|
|
emitter.on(CASE_IMPORT_FILE_REFRESH_EVENT, handleImportListRefresh);
|
|
|
// 整页刷新直达 ?tab=files 时组件创建即为 active:watch 捕获不到「变化」,
|
|
|
@@ -601,6 +637,38 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ .table-toolbar__actions {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 10px;
|
|
|
+ margin-left: auto;
|
|
|
+ }
|
|
|
+
|
|
|
+ .task-log-btn {
|
|
|
+ display: inline-flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 6px;
|
|
|
+ height: 34px;
|
|
|
+ padding: 0 14px;
|
|
|
+ border-radius: 8px;
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+
|
|
|
+ .task-log-btn__count {
|
|
|
+ display: inline-flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ min-width: 18px;
|
|
|
+ height: 18px;
|
|
|
+ padding: 0 5px;
|
|
|
+ border-radius: 999px;
|
|
|
+ background: #eef4ff;
|
|
|
+ color: #315efb;
|
|
|
+ font-size: 11px;
|
|
|
+ font-weight: 600;
|
|
|
+ line-height: 18px;
|
|
|
+ }
|
|
|
+
|
|
|
.batch-delete-btn {
|
|
|
height: 34px;
|
|
|
padding: 0 14px;
|