Files
tuanwei-admin/src/views/gxmu/components/reviewHistoryModal.vue
T
weicw 4b810a731c fix(gxmu): 审核驳回状态在各页面统一显示为「驳回」
申报模块状态标签、审核历史、稿件审核记录与列表、我的申报历史、审核列表编辑表单及接口注释,原「不通过」文案统一改为「驳回」。
2026-11-01 18:21:46 +08:00

134 lines
3.8 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<ele-modal
:width="860"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="title || '审核历史'"
:body-style="{ paddingBottom: '20px' }"
@update:visible="updateVisible"
okText="关闭"
@ok="updateVisible(false)"
>
<a-space style="margin-bottom: 12px">
<span>当前审核状态:</span>
<ReviewStatusTag :review-list="list" />
<a-button size="small" :loading="loading" @click="refresh">
刷新
</a-button>
</a-space>
<div style="overflow-y: auto; padding: 10px 0" class="ele-scrollbar-hover">
<a-timeline v-if="displayList.length > 0">
<a-timeline-item
v-for="item in displayList"
:key="item.id"
:color="item.status === 1 ? 'green' : item.status === 0 ? 'red' : 'gray'"
>
<div style="margin-bottom: 8px">
<span style="color: rgba(0, 0, 0, 0.45)">
{{ toDateString(item.createTime, 'yyyy-MM-dd HH:mm:ss') }}
</span>
<a-tag
:color="item.status === 1 ? 'success' : item.status === 2 ? 'error' : 'default'"
style="margin-left: 8px"
>
{{ item.status === 1 ? '通过' : item.status === 2 ? '驳回' : '待审核' }}
</a-tag>
</div>
<div v-if="item.user?.realName" style="margin-bottom: 4px">
<span style="font-weight: 500">审核人:</span>
<span>{{ item.user.realName }}</span>
</div>
<div v-if="item.content" style="color: rgba(0, 0, 0, 0.85)">
{{ item.content }}
</div>
</a-timeline-item>
</a-timeline>
<a-empty v-else description="暂无审核记录" :image="simpleImage" />
</div>
</ele-modal>
</template>
<script lang="ts" setup>
import { computed, ref, watch } from 'vue';
import { message, Empty } from 'ant-design-vue';
import { toDateString } from 'ele-admin-pro';
import { listReviewList } from '@/api/gxmu/reviewList';
import type { ReviewList } from '@/api/gxmu/reviewList/model';
import ReviewStatusTag from './reviewStatusTag.vue';
const props = defineProps<{
visible: boolean;
title?: string;
module?: string;
pk?: number;
reviewList?: ReviewList[];
}>();
const emit = defineEmits<{
(e: 'update:visible', visible: boolean): void;
}>();
const loading = ref(false);
const maxable = ref(true);
const list = ref<ReviewList[]>([]);
const simpleImage = Empty.PRESENTED_IMAGE_SIMPLE;
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
const displayList = computed(() => {
const getTime = (value?: string) => {
const t = Date.parse(value || '');
return Number.isFinite(t) ? t : 0;
};
return [...(list.value ?? [])].sort((a, b) => {
const diff = getTime(b.createTime) - getTime(a.createTime);
if (diff !== 0) return diff;
return (b.id || 0) - (a.id || 0);
});
});
const refresh = () => {
if (!props.module || !props.pk) {
list.value = props.reviewList ? [...props.reviewList] : [];
return;
}
loading.value = true;
listReviewList({
module: props.module,
pk: props.pk
})
.then((data) => {
loading.value = false;
list.value = data || [];
})
.catch((e) => {
loading.value = false;
message.error(e.message);
list.value = props.reviewList ? [...props.reviewList] : [];
});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
list.value = props.reviewList ? [...props.reviewList] : [];
refresh();
} else {
list.value = [];
}
},
{ immediate: true }
);
</script>
<style lang="less" scoped>
.ele-scrollbar-hover :deep(.ant-timeline-item-last > .ant-timeline-item-content) {
min-height: auto;
}
</style>