Browse Source

🎄修改首页接口

快乐的梦鱼 1 day ago
parent
commit
0dd95ad2f4

+ 24 - 0
package-lock.json

@@ -9,6 +9,7 @@
       "version": "0.0.0",
       "dependencies": {
         "@imengyu/js-request-transform": "^0.3.3",
+        "@imengyu/vue-dynamic-form": "^0.1.1",
         "@vuemap/vue-amap": "^2.1.12",
         "ant-design-vue": "^4.2.6",
         "bootstrap": "^5.3.0",
@@ -994,6 +995,29 @@
         "dayjs": "^1.11.7"
       }
     },
+    "node_modules/@imengyu/vue-dynamic-form": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npmmirror.com/@imengyu/vue-dynamic-form/-/vue-dynamic-form-0.1.1.tgz",
+      "integrity": "sha512-xyzO7hSwAjp/B8ROwZEMHK4m3Id94ViTb0JSpD/Z7QYb78m72/Io0LkeKkL2t/qBAyo3dvvi3Dewv+Y+ljWP9Q==",
+      "dependencies": {
+        "async-validator": "^4.2.5",
+        "scroll-into-view-if-needed": "^3.0.3",
+        "vue": "^3.2.45"
+      }
+    },
+    "node_modules/@imengyu/vue-dynamic-form/node_modules/compute-scroll-into-view": {
+      "version": "3.1.1",
+      "resolved": "https://registry.npmmirror.com/compute-scroll-into-view/-/compute-scroll-into-view-3.1.1.tgz",
+      "integrity": "sha512-VRhuHOLoKYOy4UbilLbUzbYg93XLjv2PncJC50EuTWPA3gaja1UjBsUP/D/9/juV3vQFr6XBEzn9KCAHdUvOHw=="
+    },
+    "node_modules/@imengyu/vue-dynamic-form/node_modules/scroll-into-view-if-needed": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmmirror.com/scroll-into-view-if-needed/-/scroll-into-view-if-needed-3.1.0.tgz",
+      "integrity": "sha512-49oNpRjWRvnU8NyGVmUaYG4jtTkNonFZI86MmGRDqBphEK2EXT9gdEUoQPZhuBM8yWHxCWbobltqYO5M4XrUvQ==",
+      "dependencies": {
+        "compute-scroll-into-view": "^3.0.2"
+      }
+    },
     "node_modules/@jridgewell/gen-mapping": {
       "version": "0.3.8",
       "resolved": "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz",

+ 1 - 0
package.json

@@ -12,6 +12,7 @@
   },
   "dependencies": {
     "@imengyu/js-request-transform": "^0.3.3",
+    "@imengyu/vue-dynamic-form": "^0.1.1",
     "@vuemap/vue-amap": "^2.1.12",
     "ant-design-vue": "^4.2.6",
     "bootstrap": "^5.3.0",

+ 2 - 1
src/api/introduction/IndexContent.ts

@@ -52,7 +52,8 @@ export class IndexContentApi extends CommonContentApi {
   async getBanner() {
     return transformArrayDataModel<IndexBanner>(
       IndexBanner,
-      (await this.get('/minnansoul/banner_function/getIndexBanner', '首页轮播图列表', {
+      (await this.get('/content/banner_function/getotherBanner', '首页轮播图列表', {
+        open_type: 3,
       })).data as any, 
       '首页轮播图列表'
     );

+ 1 - 1
src/components/NavBar.vue

@@ -108,7 +108,7 @@ nav.main {
   z-index: 100;
   width: 100%;
   height: $nav-height;
-  background-color: transparent;
+  background-color: rgba(#000, 0.1);
   border-bottom: 1px solid rgba(#fff, 0.2);
   color: #fff;
   transition: all ease-in-out 0.3s;

+ 45 - 0
src/components/dynamicf/index.ts

@@ -0,0 +1,45 @@
+import { markRaw } from "vue";
+import { 
+  Alert, Checkbox, DatePicker, Form, 
+  FormItem, Image, Input, InputNumber, 
+  Rate, Switch, Textarea, TimePicker
+} from "ant-design-vue";
+import { DynamicFormItemRegistry, type IDynamicFormOptions, configDefaultDynamicFormOptions } from "@imengyu/vue-dynamic-form";
+
+export const defaultConfig = {
+  internalWidgets: {
+    Form: {
+      component: markRaw(Form),
+      propsMap: {
+        rules: 'rules',
+        wrapperCol: 'wrapperCol',
+        labelCol: 'labelCol',
+      },
+    },
+    FormItem: {
+      component: markRaw(FormItem),
+      propsMap: {
+        name: 'name',
+        wrapperCol: 'wrapperCol',
+        labelCol: 'labelCol',
+      },
+    },
+  },
+} as IDynamicFormOptions
+
+export function registerAllFormComponents() {
+  configDefaultDynamicFormOptions(defaultConfig);
+
+  DynamicFormItemRegistry.register('text', markRaw(Input), {}, 'modelValue')
+    .register('password', markRaw(Input.Password), {}, 'modelValue')
+    .register('number', markRaw(InputNumber), {}, 'modelValue')
+    .register('text-area', markRaw(Textarea), {}, 'modelValue')
+    .register('switch', markRaw(Switch), {}, 'modelValue')
+    .register('check-box', markRaw(Checkbox), {}, 'modelValue')
+    .register('rate', markRaw(Rate))
+    .register('date', markRaw(DatePicker), {}, 'pickerValue')
+    .register('time', markRaw(TimePicker), {}, 'modelValue')
+    .register('date-time', markRaw(DatePicker), { showTime: true })
+    .register('alert', markRaw(Alert))
+    .register('static-image', markRaw(Image), {}, "src");
+}

+ 10 - 9
src/main.ts

@@ -16,22 +16,23 @@ import Antd from 'ant-design-vue';
 import VueAMap, {initAMapApiLoader} from '@vuemap/vue-amap';
 import CommonListPage from './components/content/CommonListPage.vue';
 import { registryConvert } from './common/ConvertRgeistry'
+import { registerAllFormComponents } from './components/dynamicf';
 
 initAMapApiLoader({
   key: '212b86dc49a5116a34e945d31da7ad14',
   securityJsCode: '46cae8205a707cfaf5801abcc4301566',
-})
+});
+registerAllFormComponents();
 
+const app = createApp(App);
 
-const app = createApp(App)
+app.use(createPinia());
+app.use(VueAMap);
+app.use(Antd);
+app.use(router);
+app.component('CommonListPage', CommonListPage);
 
-app.use(createPinia())
-app.use(VueAMap)
-app.use(Antd)
-app.use(router)
-app.component('CommonListPage', CommonListPage)
-
-app.mount('#app')
+app.mount('#app');
 
 
 registryConvert();

+ 6 - 1
src/router/index.ts

@@ -168,7 +168,12 @@ const router = createRouter({
       name: 'inheritor',
       component: () => import('../views/InheritorView.vue'),
     },
-        {
+    {
+      path: '/inheritor/submit',
+      name: 'InheritorSubmit',
+      component: () => import('../views/inheritor/submit.vue'),
+    },
+    {
       path: '/inheritor/inheritor',
       name: 'InheritorList',
       component: () => import('../views/inheritor/inheritor.vue'),

+ 20 - 3
src/views/HomeView.vue

@@ -141,13 +141,17 @@ import { Carousel, Slide, Pagination, Navigation } from 'vue3-carousel'
 import { onMounted, ref } from 'vue';
 import { useRouter } from 'vue-router';
 import { useSimpleDataLoader } from '@/composeable/SimpleDataLoader';
-import { GetContentListParams, type GetContentListItem } from '@/api/CommonContent';
+import CommonContent, { GetContentListParams, type GetContentListItem } from '@/api/CommonContent';
 import NewsIndexContent from '@/api/news/NewsIndexContent';
 import ImageTitleBlock from '@/components/parts/ImageTitleBlock.vue';
 import SimplePageContentLoader from '@/components/content/SimplePageContentLoader.vue';
 import IndexContent from '@/api/introduction/IndexContent';
 import { NO_CONTENT_STRING } from '@/common/ConstStrings';
 import SimpleRemoveRichHtml from '@/components/display/SimpleRemoveRichHtml.vue';
+import UnmoveableContent from '@/api/inheritor/UnmoveableContent';
+import ProjectContent from '@/api/research/ProjectContent';
+import ActivityContent from '@/api/inheritor/ActivityContent';
+import ProductContent from '@/api/fusion/ProductContent';
 
 const router = useRouter();
 
@@ -189,9 +193,22 @@ const overviewData = useSimpleDataLoader(async () => {
   }))).list[0]?.overview || NO_CONTENT_STRING
 });
 const recommendData = useSimpleDataLoader<GetContentListItem[]>(async () => {
-  return (await NewsIndexContent.getContentList(new GetContentListParams().setSelfValues({
+  const list = [];
+
+  list.push(...(await UnmoveableContent.getContentList(new GetContentListParams().setSelfValues({
     flag: 'recommend',
-  }), 1, 6)).list
+  }), 1, 2)).list);
+  list.push(...(await ProductContent.getContentList(new GetContentListParams().setSelfValues({
+    flag: 'recommend',
+  }), 1, 2)).list);
+  list.push(...(await ProjectContent.getContentList(new GetContentListParams().setSelfValues({
+    flag: 'recommend',
+  }), 1, 2)).list);
+  list.push(...(await ActivityContent.getContentList(new GetContentListParams().setSelfValues({
+    flag: 'recommend',
+  }), 1, 2)).list);
+
+  return list;
 });
 const newsData = useSimpleDataLoader<GetContentListItem[]>(async () => {
   return (await NewsIndexContent.getContentList(new GetContentListParams().setSelfValues({

+ 6 - 1
src/views/InheritorView.vue

@@ -139,7 +139,12 @@
         <div class="title">
           <h2>申报入口</h2>
         </div>
-        <img class="main-clickable mt-4 w-100" src="@/assets/images/inheritor/SubmitButton.png" alt="申报入口按钮" />
+        <img
+          class="main-clickable mt-4 w-100"
+          src="@/assets/images/inheritor/SubmitButton.png"
+          alt="申报入口按钮"
+          @click="navTo('/inheritor/submit')"
+        />
       </div>
     </section>
 

+ 15 - 0
src/views/inheritor/submit.vue

@@ -0,0 +1,15 @@
+<template>
+  <!-- 项目申报 -->
+  <div class="about main-background main-background-type0">
+    <div class="nav-placeholder"></div>
+    <!-- 表单 -->
+    <section class="main-section ">
+      <div class="content">
+        <div class="title">
+          <h2>项目申报</h2>
+        </div>
+      </div>
+    </section>
+  </div>
+</template>
+