Selaa lähdekoodia

📦 上传页细节修改

快乐的梦鱼 1 viikko sitten
vanhempi
commit
775bc7333f

+ 2 - 2
src/App.vue

@@ -11,7 +11,7 @@
     <main>
       <RouterView />
     </main>
-    <Footer />
+    <FooterSmall />
   </a-config-provider>
 </template>
 
@@ -20,9 +20,9 @@ import { onMounted, watch } from 'vue';
 import { RouterView, useRoute } from 'vue-router'
 import { useAuthStore } from './stores/auth';
 import NavBar from './components/NavBar.vue';
-import Footer from './components/Footer.vue';
 import zhCN from 'ant-design-vue/es/locale/zh_CN';
 import { useRedirectLoginPage } from './common/LoginPageRedirect';
+import FooterSmall from './components/FooterSmall.vue';
 
 const authStore = useAuthStore();
 const { checkAndRedirectLoginPage } = useRedirectLoginPage();

+ 8 - 0
src/api/inheritor/InheritorContent.ts

@@ -17,6 +17,10 @@ export class CommonInfo<T extends DataModel> extends DataModel<T> {
       expandInfo: { serverSide: 'undefined' },
       region: { clientSide: 'number', serverSide: 'number' },
     };
+    this._beforeSolveClient = (data) => {
+      if (!data.contentId && data.id)
+        data.contentId = data.id;
+    }
   }
 
   contentId = null as number|null;
@@ -75,7 +79,10 @@ export class IchInfo extends CommonInfo<IchInfo> {
       data.longitude = this.lonlat[0];
       data.latitude = this.lonlat[1];
     };
+
+    const _superBeforeSolveClient = this._beforeSolveClient;
     this._beforeSolveClient = (data) => {
+      _superBeforeSolveClient?.(data);
       if (!this.expandInfo)
         this.expandInfo = new IchExpandInfo();
       this.expandInfo.batch = this.batch;
@@ -85,6 +92,7 @@ export class IchInfo extends CommonInfo<IchInfo> {
       this.expandInfo.ichType = this.ichType!;
       this.expandInfo.contentId = this.contentId!;
       this.expandInfo.collectId = this.collectId!;
+
     };
   }
 

+ 1 - 0
src/assets/scss/colors.scss

@@ -6,6 +6,7 @@ $text-color-light: #fff;
 $text-second-color: #6d6d6d;
 $text-second-color-light: #ddd;
 
+$background-color: rgb(249, 246, 237);
 
 $text-content-color: #654A38;
 $text-content-second-color: rgba(101, 74, 56, 0.6);

+ 38 - 0
src/components/FooterSmall.vue

@@ -0,0 +1,38 @@
+<template>
+  <footer class="small-footer">
+    <a href="https://minnan.wenlvti.net/">闽南文化生态保护区 (厦门市)</a>
+    <a href="#">
+      <img src="@/assets/images/footer/GonganLogo.png" />
+      闽公网安备 44040202000131号
+    </a>
+    <a href="http://beian.miit.gov.cn/">闽ICP备09020130号</a>
+  </footer>
+</template>
+
+<style lang="scss">
+@use '@/assets/scss/colors.scss' as *;
+
+.small-footer {
+  display: flex;
+  flex-direction: row;
+  justify-content: center;
+  align-items: center;
+  padding: 40px 0;
+  background-color: $background-color;
+
+  a {
+    text-decoration: none;
+    color: $primary-color;
+    font-size: 0.9rem;
+    margin-right: 40px;
+
+    &:hover {
+      color: $primary-dark-color;
+    }
+
+    img {
+      margin-right: 10px;
+    }
+  }
+}
+</style>

+ 25 - 17
src/pages/forms/form.vue

@@ -10,23 +10,30 @@
           <h2>{{ title }}</h2>
         </div>
         <a-spin v-if="loadingData" />
-        <template v-else>
-          
+        <template v-else>   
           <a-tabs centered>
             <a-tab-pane key="1" :tab="basicTabText">
-              <DynamicForm
-                ref="formBase"
-                :model="(formModel as any)" 
-                :options="formOptions"
-              />
-              <a-button 
-                type="primary"
-                block 
-                :loading="loading" class="mt-3" 
-                @click="handleSubmitBase"
-              >
-                提交
-              </a-button>
+              <ScrollRect scroll="vertical" style="height: 80vh">
+                <DynamicForm
+                  ref="formBase"
+                  :model="(formModel as any)" 
+                  :options="formOptions"
+                />
+              </ScrollRect>
+              <div class="d-flex flex-column mt-3">
+                <span>
+                  <ExclamationCircleOutlined />
+                  提示:上传文件时请勿离开页面防止上传失败,在关闭页面之前请提交您的修改以防丢失。
+                </span>
+                <a-button 
+                  type="primary"
+                  block 
+                  :loading="loading" class="mt-3" 
+                  @click="handleSubmitBase"
+                >
+                  提交
+                </a-button>
+              </div>
             </a-tab-pane>
             <a-tab-pane v-if="extendFormOptions" key="2" tab="扩展信息">
               <DynamicForm
@@ -56,9 +63,10 @@ import { useRoute, useRouter } from 'vue-router';
 import { useWindowOnUnLoadConfirm } from '@/composeable/WindowOnUnLoad';
 import { DynamicForm, type IDynamicFormOptions, type IDynamicFormRef } from '@imengyu/vue-dynamic-form';
 import { message, Modal, type FormInstance } from 'ant-design-vue';
-import { ArrowLeftOutlined } from '@ant-design/icons-vue';
+import { ArrowLeftOutlined, ExclamationCircleOutlined } from '@ant-design/icons-vue';
 import InheritorContent from '@/api/inheritor/InheritorContent';
 import type { DataModel } from '@imengyu/js-request-transform';
+import { ScrollRect } from '@imengyu/vue-scroll-rect';
 
 const props = defineProps({
   title: {
@@ -197,7 +205,7 @@ async function loadData() {
 function handleBack() {
   Modal.confirm({
     title: '确定返回吗?',
-    content: '返回后将丢失当前填写的信息,若有修改请先提交哦',
+    content: '返回后将丢失当未提交的信息,若有修改请先提交哦!',
     okText: '确定',
     okType: 'danger',
     onOk() {