Bladeren bron

📦 申报页按钮和其他图片更换

imengyu 15 uur geleden
bovenliggende
commit
57d5c1536d

+ 5 - 0
src/api/CommonContent.ts

@@ -84,6 +84,11 @@ export class GetContentListParams extends DataModel<GetContentListParams> {
     return this; 
   }
 
+  static TYPE_ARTICLE = 1;
+  static TYPE_AUDIO = 2;
+  static TYPE_VIDEO = 3;
+  static TYPE_IMAGE = 4;
+
   modelId ?: number;
   /**
    * 主体栏目id

BIN
src/assets/images/about/Banner.jpg


BIN
src/assets/images/inheritor/Image11.jpg


+ 50 - 3
src/views/inheritor/submit.vue

@@ -9,9 +9,11 @@
           <h2>项目申报</h2>
         </div>
         <DynamicForm 
+          ref="form"
           :model="formModel" 
           :options="formOptions"
         />
+        <a-button type="primary" block @click="handleSubmit">提交</a-button>
       </div>
     </section>
   </div>
@@ -22,9 +24,11 @@ import CommonContent from '@/api/CommonContent';
 import { RecommendForm } from '@/api/inheritor/SubmitApi';
 import type { IdAsValueDropdownProps } from '@/components/dynamicf/Dropdown/IdAsValueDropdown';
 import type { DataModel } from '@imengyu/js-request-transform';
-import { DynamicForm, type IDynamicFormOptions } from '@imengyu/vue-dynamic-form';
+import { DynamicForm, type IDynamicFormOptions, IDynamicFormRef } from '@imengyu/vue-dynamic-form';
+import { Modal, type FormInstance } from 'ant-design-vue';
 import { ref } from 'vue';
 
+const form = ref<IDynamicFormRef>();
 const formModel = ref(new RecommendForm());
 const formOptions = ref<IDynamicFormOptions>({
   formLabelCol: { span: 6 },
@@ -100,7 +104,7 @@ const formOptions = ref<IDynamicFormOptions>({
     },
     {
       label: '民族',
-      name: 'name',
+      name: 'nation',
       type: 'text',
       additionalProps: {
         placeholder: '请输入民族' 
@@ -130,7 +134,50 @@ const formOptions = ref<IDynamicFormOptions>({
         placeholder: '请输入职务职称' 
       }
     },
-  ]
+  ],
+  formRules: {
+    name: [
+      { required: true, message: '请输入姓名' },
+      { min: 2, max: 5, message: '长度在 2 到 5 个字符' }
+    ],
+    // idPhoto: [
+    //   { required: true, message: '请上传证件照' }
+    // ],
+    ichName: [
+      { required: true, message: '请输入项目名称' }
+    ],
+    type: [
+      { required: true, message: '请选择类型' }
+    ],
+    unit: [
+      { required: true, message: '请输入保护单位' }
+    ],
+    gender: [
+      { required: true, message: '请选择性别' }
+    ],
+    birthday: [
+      { required: true, message: '请输入出生日期' }
+    ],
+    job: [
+      { required: true, message: '请输入职业' }
+    ],
+    jobTitle: [
+      { required: true, message: '请输入职业' } 
+    ],
+    nation: [
+      { required: true, message: '请输入民族' }
+    ]
+  },
+
 });
+
+function handleSubmit() {
+  (form.value?.getFormRef() as FormInstance).validate().then(() => { 
+    Modal.success({
+      title: '提交成功',
+      content: '您的项目申报已提交成功。请耐心等待审核!',
+    });
+  });
+}
 </script>