|
@@ -10,7 +10,7 @@
|
|
<h2>{{ title }}</h2>
|
|
<h2>{{ title }}</h2>
|
|
<div class="button-placeholder"></div>
|
|
<div class="button-placeholder"></div>
|
|
</div>
|
|
</div>
|
|
- <a-spin v-if="loadingData" />
|
|
|
|
|
|
+ <a-spin v-if="loadingData" class="w-100 h-100" />
|
|
<template v-else>
|
|
<template v-else>
|
|
<a-tabs centered>
|
|
<a-tabs centered>
|
|
<a-tab-pane key="1" :tab="basicTabText">
|
|
<a-tab-pane key="1" :tab="basicTabText">
|
|
@@ -27,7 +27,7 @@
|
|
<ExclamationCircleOutlined class="me-3" />
|
|
<ExclamationCircleOutlined class="me-3" />
|
|
提示:上传文件时请勿离开页面防止上传失败,在关闭页面之前请提交您的修改以防丢失。
|
|
提示:上传文件时请勿离开页面防止上传失败,在关闭页面之前请提交您的修改以防丢失。
|
|
</span>
|
|
</span>
|
|
- <a-button size="small" type="primary">历史版本</a-button>
|
|
|
|
|
|
+ <a-button size="small" type="primary" @click="showHistory = true">历史版本</a-button>
|
|
</div>
|
|
</div>
|
|
<a-button
|
|
<a-button
|
|
type="primary"
|
|
type="primary"
|
|
@@ -58,6 +58,42 @@
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
|
|
+
|
|
|
|
+ <a-drawer
|
|
|
|
+ v-model:open="showHistory"
|
|
|
|
+ title="历史版本"
|
|
|
|
+ placement="right"
|
|
|
|
+ :width="showHistoryModel ? '90%' : '50%'"
|
|
|
|
+ >
|
|
|
|
+ <div v-if="showHistoryModel">
|
|
|
|
+ <div class="d-flex flex-row justify-content-between">
|
|
|
|
+ <a-button :icon="h(ArrowLeftOutlined)" @click="showHistoryModel = null">返回</a-button>
|
|
|
|
+ <span>您正在查看 {{ showHistoryModel.desc }} 保存的版本</span>
|
|
|
|
+ </div>
|
|
|
|
+ <a-spin v-if="showHistoryLoading" class="w-100 h-100" />
|
|
|
|
+ <DynamicForm
|
|
|
|
+ v-else
|
|
|
|
+ :model="(showHistoryModel as any)"
|
|
|
|
+ :options="{
|
|
|
|
+ ...formOptions,
|
|
|
|
+ disabled: true,
|
|
|
|
+ }"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ <CommonListBlock
|
|
|
|
+ v-else
|
|
|
|
+ :showTotal="true"
|
|
|
|
+ :showSearch="false"
|
|
|
|
+ :rowCount="1"
|
|
|
|
+ :rowType="6"
|
|
|
|
+ :load="(page: number, pageSize: number, _, searchText: string, dropDownValues: number[]) => loadHistoryData(page, pageSize, dropDownValues, searchText)"
|
|
|
|
+ detailsPage="none"
|
|
|
|
+ >
|
|
|
|
+ <template #itemRight="{ item }">
|
|
|
|
+ <a-button type="link" @click.stop="handleShowHistory(item)">查看</a-button>
|
|
|
|
+ </template>
|
|
|
|
+ </CommonListBlock>
|
|
|
|
+ </a-drawer>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -69,8 +105,11 @@ import { DynamicForm, type IDynamicFormOptions, type IDynamicFormRef } from '@im
|
|
import { message, Modal, type FormInstance } from 'ant-design-vue';
|
|
import { message, Modal, type FormInstance } from 'ant-design-vue';
|
|
import { ArrowLeftOutlined, ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
|
import { ArrowLeftOutlined, ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
|
import { ScrollRect } from '@imengyu/vue-scroll-rect';
|
|
import { ScrollRect } from '@imengyu/vue-scroll-rect';
|
|
|
|
+import { useAuthStore } from '@/stores/auth';
|
|
import type { DataModel } from '@imengyu/js-request-transform';
|
|
import type { DataModel } from '@imengyu/js-request-transform';
|
|
import InheritorContent from '@/api/inheritor/InheritorContent';
|
|
import InheritorContent from '@/api/inheritor/InheritorContent';
|
|
|
|
+import CommonListBlock from '@/components/content/CommonListBlock.vue';
|
|
|
|
+import { DateUtils, waitTimeOut } from '@imengyu/imengyu-utils';
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
title: {
|
|
title: {
|
|
@@ -115,11 +154,15 @@ const { formModel, formOptions, extendFormOptions, load } = toRefs(props);
|
|
const formBase = ref<IDynamicFormRef>();
|
|
const formBase = ref<IDynamicFormRef>();
|
|
const formExtend = ref<IDynamicFormRef>();
|
|
const formExtend = ref<IDynamicFormRef>();
|
|
|
|
|
|
|
|
+const authStore = useAuthStore();
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
const loadingData = ref(false);
|
|
const loadingData = ref(false);
|
|
const readonly = ref(false);
|
|
const readonly = ref(false);
|
|
|
|
+const showHistory = ref(false);
|
|
|
|
+const showHistoryLoading = ref(false);
|
|
|
|
+const showHistoryModel = ref<any>(null);
|
|
|
|
|
|
watch(readonly, (newValue) => {
|
|
watch(readonly, (newValue) => {
|
|
formOptions.value.disabled = newValue;
|
|
formOptions.value.disabled = newValue;
|
|
@@ -205,6 +248,31 @@ async function loadData() {
|
|
loadingData.value = false;
|
|
loadingData.value = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+async function loadHistoryData(page: number, pageSize: number, dropDownValues: number[], searchText: string) {
|
|
|
|
+ const res = (await InheritorContent.getCollectList({
|
|
|
|
+ collectType: 'content',
|
|
|
|
+ modelId: 2,
|
|
|
|
+ userId: authStore.userInfo?.id,
|
|
|
|
+ page,
|
|
|
|
+ pageSize
|
|
|
|
+ }))
|
|
|
|
+ return {
|
|
|
|
+ page,
|
|
|
|
+ total: res.total,
|
|
|
|
+ data: res.data.map((p) => {
|
|
|
|
+ p.desc = DateUtils.formatDate(p.updatedAt as Date, DateUtils.FormatStrings.CommonDate);
|
|
|
|
+ return p;
|
|
|
|
+ }),
|
|
|
|
+ };
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+async function handleShowHistory(item: any) {
|
|
|
|
+ showHistoryLoading.value = true;
|
|
|
|
+ showHistory.value = true;
|
|
|
|
+ showHistoryModel.value = item;
|
|
|
|
+ await waitTimeOut(800);
|
|
|
|
+ showHistoryLoading.value = false;
|
|
|
|
+}
|
|
|
|
|
|
function handleBack() {
|
|
function handleBack() {
|
|
Modal.confirm({
|
|
Modal.confirm({
|