|
@@ -9,9 +9,11 @@
|
|
<h2>项目申报</h2>
|
|
<h2>项目申报</h2>
|
|
</div>
|
|
</div>
|
|
<DynamicForm
|
|
<DynamicForm
|
|
|
|
+ ref="form"
|
|
:model="formModel"
|
|
:model="formModel"
|
|
:options="formOptions"
|
|
:options="formOptions"
|
|
/>
|
|
/>
|
|
|
|
+ <a-button type="primary" block @click="handleSubmit">提交</a-button>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
@@ -22,9 +24,11 @@ import CommonContent from '@/api/CommonContent';
|
|
import { RecommendForm } from '@/api/inheritor/SubmitApi';
|
|
import { RecommendForm } from '@/api/inheritor/SubmitApi';
|
|
import type { IdAsValueDropdownProps } from '@/components/dynamicf/Dropdown/IdAsValueDropdown';
|
|
import type { IdAsValueDropdownProps } from '@/components/dynamicf/Dropdown/IdAsValueDropdown';
|
|
import type { DataModel } from '@imengyu/js-request-transform';
|
|
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';
|
|
import { ref } from 'vue';
|
|
|
|
|
|
|
|
+const form = ref<IDynamicFormRef>();
|
|
const formModel = ref(new RecommendForm());
|
|
const formModel = ref(new RecommendForm());
|
|
const formOptions = ref<IDynamicFormOptions>({
|
|
const formOptions = ref<IDynamicFormOptions>({
|
|
formLabelCol: { span: 6 },
|
|
formLabelCol: { span: 6 },
|
|
@@ -100,7 +104,7 @@ const formOptions = ref<IDynamicFormOptions>({
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: '民族',
|
|
label: '民族',
|
|
- name: 'name',
|
|
|
|
|
|
+ name: 'nation',
|
|
type: 'text',
|
|
type: 'text',
|
|
additionalProps: {
|
|
additionalProps: {
|
|
placeholder: '请输入民族'
|
|
placeholder: '请输入民族'
|
|
@@ -130,7 +134,50 @@ const formOptions = ref<IDynamicFormOptions>({
|
|
placeholder: '请输入职务职称'
|
|
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>
|
|
</script>
|
|
|
|
|