Commit 2fcdcc8a by 宋春膨

Merge remote-tracking branch 'origin/weiqiao-vue3' into weiqiao-vue3

parents c20fa73e cd86d842
......@@ -12,6 +12,7 @@ tests/server/static/upload
.env.local
.env.*.local
.eslintcache
.env.development
# Log files
npm-debug.log*
......@@ -38,3 +39,4 @@ jinayi
/src/api/jianyi
/src/views/code/demo3
.history
xjrsoft-uni/package-lock.json
......@@ -16,7 +16,7 @@ VITE_DROP_CONSOLE = false
# 接口地址
# 如果没有跨域问题,直接在这里配置即可
# VITE_GLOB_API_URL=http://192.168.8.73:8080
# VITE_GLOB_API_URL=http://192.168.8.37:8080
VITE_GLOB_API_URL=http://localhost:8080
# 文件上传接口 可选
......
......@@ -89,6 +89,9 @@
</template>
</BasicTable>
</a-tab-pane>
<a-tab-pane key="6" tab="所持证书" force-render>
<BasicForm @register="registerForm3" />
</a-tab-pane>
</a-tabs>
<RoleModal @register="registerRoleModal" @success="handleRoleSuccess" />
<PostModal @register="registerPostModal" @success="handlePostSuccess" />
......@@ -429,6 +432,26 @@
dataIndex: 'name',
},
];
const certificateFormSchema: FormSchema[] = [
{
field: 'certificateCode',
label: '证书编号',
component: 'Input',
colProps: { span: 12 },
componentProps: {
placeholder: '请输入证书编号',
},
},
{
field: 'certificateName',
label: '证书名称',
component: 'Input',
colProps: { span: 12 },
componentProps: {
placeholder: '请输入证书名称',
},
},
];
const emit = defineEmits(['success', 'register']);
const { notification } = useMessage();
const isUpdate = ref(true);
......@@ -441,6 +464,7 @@
const roleDatasource = ref<any[]>([]);
const postDatasource = ref<any[]>([]);
const orgDatasource = ref<any[]>([]);
const certificateDatasource = ref<any[]>([]);
const [
registerForm1,
......@@ -477,6 +501,21 @@
},
});
const [
registerForm3,
{ setFieldsValue: setFieldsValue3, resetFields: resetFields3, validate: validate3 },
] = useForm({
rowProps: {
gutter: 32,
},
layout: 'vertical',
schemas: certificateFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
const [registerTable1, { setTableData: setTableData1, setPagination: setPagination1 }] = useTable(
{
rowKey: 'id',
......@@ -534,6 +573,7 @@
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields1();
resetFields2();
resetFields3();
setModalProps({ confirmLoading: false, width: 800, fixedHeight: true, destroyOnClose: true });
activeKey.value = '1';
isUpdate.value = !!data?.isUpdate;
......@@ -549,6 +589,10 @@
setFieldsValue2({
...record,
});
setFieldsValue3({
certificateCode: record.certificates?.[0]?.certificateCode || '',
certificateName: record.certificates?.[0]?.certificateName || '',
});
roleDatasource.value = record.roles || [];
postDatasource.value = record.posts || [];
orgDatasource.value = record.chargeDepartments || [];
......@@ -658,6 +702,7 @@
try {
const values = await validate1();
const values2 = await validate2();
const values3 = await validate3();
const roleIds = roleDatasource.value?.map((x) => x.id);
const postIds = postDatasource.value?.map((x) => x.id);
const chargeDepartmentIds = orgDatasource.value?.map((x) => x.id);
......@@ -668,6 +713,10 @@
roleIds,
postIds,
chargeDepartmentIds,
certificates: values3.certificateCode || values3.certificateName ? [{
certificateCode: values3.certificateCode || '',
certificateName: values3.certificateName || '',
}] : [],
};
setModalProps({ confirmLoading: true });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment