Sfoglia il codice sorgente

📦 历史记录列表

快乐的梦鱼 1 settimana fa
parent
commit
8aa1b0b3fa

+ 55 - 4
src/api/inheritor/InheritorContent.ts

@@ -2,6 +2,7 @@ import { DataModel, transformArrayDataModel, transformDataModel } from '@imengyu
 import { AppServerRequestModule } from '../RequestModules';
 import dayjs from 'dayjs';
 import { transformSomeToArray } from '../Utils';
+import { GetContentListItem } from '../CommonContent';
 
 export class CommonInfo<T extends DataModel> extends DataModel<T> {
 
@@ -13,7 +14,7 @@ export class CommonInfo<T extends DataModel> extends DataModel<T> {
       flag: { clientSide: 'splitCommaArray', serverSide: 'commaArrayMerge' },
       type: { clientSide: 'number', serverSide: 'number' },
       keywords: { clientSide: 'splitCommaArray', serverSide: 'commaArrayMerge' },
-      images: { clientSide: 'array', serverSide: 'string' },
+      images: { clientSide: 'array', serverSide: 'array' },
       expandInfo: { serverSide: 'undefined' },
       region: { clientSide: 'number', serverSide: 'number' },
     };
@@ -504,7 +505,6 @@ export class InheritorSubmitInfo extends DataModel<InheritorSubmitInfo> {
   progress = 0 as number;
 }
 
-
 export class InheritorContentApi extends AppServerRequestModule<DataModel> {
 
   constructor() {
@@ -553,6 +553,58 @@ export class InheritorContentApi extends AppServerRequestModule<DataModel> {
     return (await this.post('/ich/inheritor/savePlans', dataModel.toServerSide(), '保存项目五年计划'));
   }
 
+  /**
+   * 获取采集列表
+   * @param data 
+   * @returns 
+   */
+  async getCollectList(data: {
+    /**
+     * 采集类型
+     * * content 基础
+     * * ich 扩展
+     */
+    collectType: 'content'|'ich',
+    /**
+     * 采集模型:2=非遗项目,7=传承人,17=传习所
+     */
+    modelId: 2|7|17,
+    /**
+     * 提交用户ID
+     */
+    userId?: number,
+    /**
+     * 进度:-1=审核失败,0=待审核,1=审核通过
+     */
+    progress?: number,
+    /**
+     * 审核人用户ID
+     */
+    reviewId?: number,
+    /**
+     * 原基础表记录ID
+     */
+    contentId?: number,
+    page?: number,
+    pageSize?: number,
+  }) {
+    return this.post('/ich/inheritor/collectList', {
+      collect_type: data.collectType,
+      model_id: data.modelId,
+      user_id: data.userId,
+      progress: data.progress,
+      review_id: data.reviewId,
+      content_id: data.contentId,
+      page: data.page,
+      pageSize: data.pageSize,
+    }, '获取采集列表', undefined).then((res) => {
+      return {
+        data: transformArrayDataModel<GetContentListItem>(GetContentListItem, transformSomeToArray(res.data2.data), 'data2'),
+        total: res.data2.total,
+      }
+    })
+  }
+
   async getInheritorAccountInfo(contentId: number) {
     return this.post('/ich/inheritor/getAccount', {
       content_id: contentId,
@@ -569,8 +621,7 @@ export class InheritorContentApi extends AppServerRequestModule<DataModel> {
     }, '获取传承人采集数据列表', undefined).then((res) => {
       return transformArrayDataModel<InheritorSubmitInfo>(InheritorSubmitInfo, transformSomeToArray(res.data2), 'data2');
     })
-  }
-  
+  }  
 
   async getIchInfo(id: number|undefined) {
     return await this.getBaseInfo(id, IchInfo);

+ 1 - 5
src/assets/scss/main.scss

@@ -124,13 +124,9 @@ $small-banner-height: 445px;
   cursor: pointer;
   -webkit-user-select: none;
   user-select: none;
-  transition: all 0.2s ease; 
 
-  &:hover {
-    transform: scale(1.01);
-  }
   &:active {
-    transform: scale(0.99); 
+    transform: scale(0.996); 
   }
 }
 

+ 8 - 0
src/assets/scss/news.scss

@@ -109,6 +109,14 @@
         height: 80px;
       }
     }
+    &.row-type6 {
+      .TitleDescBlock h3 {
+        font-size: 15px;
+      }
+      img {
+        display: none;
+      }
+    }
     &.empty {
       background-color: transparent;
       border: none;

+ 3 - 3
src/components/FooterSmall.vue

@@ -1,11 +1,11 @@
 <template>
   <footer class="small-footer">
     <!-- <a href="https://minnan.wenlvti.net/">闽南文化生态保护区 (厦门市)</a> -->
-    <a href="#">
+    <!-- <a href="#">
       <img src="@/assets/images/footer/GonganLogo.png" />
       闽公网安备 44040202000131号
-    </a>
-    <a href="http://beian.miit.gov.cn/">闽ICP备09020130号</a>
+    </a> -->
+    <a href="http://beian.miit.gov.cn/">闽ICP备2023000538号-1</a>
   </footer>
 </template>
 

+ 1 - 1
src/components/NavBar.vue

@@ -308,7 +308,7 @@ nav.main {
           &.large {
             height: 23px;
             font-size: 1.4rem;
-            letter-spacing: -0.1rem;
+            letter-spacing: -0.15rem;
           }
         }
       }

+ 70 - 2
src/pages/forms/form.vue

@@ -10,7 +10,7 @@
           <h2>{{ title }}</h2>
           <div class="button-placeholder"></div>
         </div>
-        <a-spin v-if="loadingData" />
+        <a-spin v-if="loadingData" class="w-100 h-100" />
         <template v-else>   
           <a-tabs centered>
             <a-tab-pane key="1" :tab="basicTabText">
@@ -27,7 +27,7 @@
                     <ExclamationCircleOutlined class="me-3" />
                     提示:上传文件时请勿离开页面防止上传失败,在关闭页面之前请提交您的修改以防丢失。
                   </span>
-                  <a-button size="small" type="primary">历史版本</a-button>
+                  <a-button size="small" type="primary" @click="showHistory = true">历史版本</a-button>
                 </div>
                 <a-button 
                   type="primary"
@@ -58,6 +58,42 @@
         </template>
       </div>
     </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>
 </template>
 
@@ -69,8 +105,11 @@ import { DynamicForm, type IDynamicFormOptions, type IDynamicFormRef } from '@im
 import { message, Modal, type FormInstance } from 'ant-design-vue';
 import { ArrowLeftOutlined, ExclamationCircleOutlined } from '@ant-design/icons-vue';
 import { ScrollRect } from '@imengyu/vue-scroll-rect';
+import { useAuthStore } from '@/stores/auth';
 import type { DataModel } from '@imengyu/js-request-transform';
 import InheritorContent from '@/api/inheritor/InheritorContent';
+import CommonListBlock from '@/components/content/CommonListBlock.vue';
+import { DateUtils, waitTimeOut } from '@imengyu/imengyu-utils';
 
 const props = defineProps({
   title: {
@@ -115,11 +154,15 @@ const { formModel, formOptions, extendFormOptions, load } = toRefs(props);
 const formBase = ref<IDynamicFormRef>();
 const formExtend = ref<IDynamicFormRef>();
 
+const authStore = useAuthStore();
 const router = useRouter();
 const route = useRoute();
 const loading = ref(false);
 const loadingData = ref(false);
 const readonly = ref(false);
+const showHistory = ref(false);
+const showHistoryLoading = ref(false);
+const showHistoryModel = ref<any>(null);
 
 watch(readonly, (newValue) => {
   formOptions.value.disabled = newValue;
@@ -205,6 +248,31 @@ async function loadData() {
     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() {
   Modal.confirm({