Compare commits
No commits in common. "5c244d1a72830d8aad00207e9cdb5609bdd06023" and "0fcdf6e00f9f0659310542aa12cccf2eec65b609" have entirely different histories.
5c244d1a72
...
0fcdf6e00f
@ -1,31 +0,0 @@
|
|||||||
import { MyButtons } from '@/common';
|
|
||||||
import { Modal } from 'antd';
|
|
||||||
import { useState } from 'react';
|
|
||||||
|
|
||||||
export function MyModal(props?: any) {
|
|
||||||
const [open, setOpen] = useState(false);
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<MyButtons.View
|
|
||||||
title={props.title || '详情'}
|
|
||||||
onClick={() => setOpen(true)}
|
|
||||||
/>
|
|
||||||
<Modal
|
|
||||||
title={props?.modal?.title || '标题'}
|
|
||||||
open={open}
|
|
||||||
onOk={() => {
|
|
||||||
setOpen(false);
|
|
||||||
props?.handleOk?.();
|
|
||||||
}}
|
|
||||||
onCancel={() => {
|
|
||||||
setOpen(false);
|
|
||||||
props?.onCancel?.();
|
|
||||||
}}
|
|
||||||
footer={props?.modal?.footer || false}
|
|
||||||
{...props}
|
|
||||||
>
|
|
||||||
{props?.node}
|
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -6,6 +6,7 @@ import {
|
|||||||
rulesHelper,
|
rulesHelper,
|
||||||
} from '@/common';
|
} from '@/common';
|
||||||
import { Address } from '@/components/Address';
|
import { Address } from '@/components/Address';
|
||||||
|
import { SysSelects } from '@/components/Select';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { CompaniesMerchantTypeEnum } from '@/gen/Enums';
|
import { CompaniesMerchantTypeEnum } from '@/gen/Enums';
|
||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
@ -29,15 +30,20 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
.catch(() => false)
|
.catch(() => false)
|
||||||
}
|
}
|
||||||
columns={[
|
columns={[
|
||||||
|
SysSelects?.Companies({
|
||||||
|
key: 'parent_id',
|
||||||
|
title: '上级组织',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
}),
|
||||||
{
|
{
|
||||||
key: 'name',
|
key: 'name',
|
||||||
title: '机构名称',
|
title: '组织名称',
|
||||||
colProps: { span: 8 },
|
colProps: { span: 8 },
|
||||||
formItemProps: { ...rulesHelper.text },
|
formItemProps: { ...rulesHelper.text },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'short_name',
|
key: 'short_name',
|
||||||
title: '机构简称',
|
title: '组织简称',
|
||||||
colProps: { span: 8 },
|
colProps: { span: 8 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -89,7 +95,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
key: 'address',
|
key: 'address',
|
||||||
title: '详细地址',
|
title: '机构地址',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
|
|||||||
@ -6,34 +6,31 @@ import {
|
|||||||
rulesHelper,
|
rulesHelper,
|
||||||
} from '@/common';
|
} from '@/common';
|
||||||
import { Address } from '@/components/Address';
|
import { Address } from '@/components/Address';
|
||||||
|
import { SysSelects } from '@/components/Select';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { CompaniesMerchantTypeEnum } from '@/gen/Enums';
|
import { CompaniesMerchantTypeEnum } from '@/gen/Enums';
|
||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
import { Form, message } from 'antd';
|
import { message } from 'antd';
|
||||||
|
|
||||||
export default function Update(props: MyBetaModalFormProps) {
|
export default function Update(props: MyBetaModalFormProps) {
|
||||||
const [form] = Form.useForm();
|
|
||||||
return (
|
return (
|
||||||
<BetaSchemaForm<ApiTypes.Company.Companies.Update>
|
<BetaSchemaForm<ApiTypes.Company.Companies.Update>
|
||||||
{...MyModalFormProps.props}
|
{...MyModalFormProps.props}
|
||||||
title={`编辑${props.title}`}
|
title={`编辑${props.title}`}
|
||||||
form={form}
|
|
||||||
trigger={<MyButtons.Edit />}
|
trigger={<MyButtons.Edit />}
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="800px"
|
width="800px"
|
||||||
onOpenChange={(open: any) => {
|
request={() =>
|
||||||
if (open && props.item) {
|
Promise.resolve({
|
||||||
form.setFieldsValue({
|
...props.item,
|
||||||
...props.item,
|
casacader: [
|
||||||
casacader: [
|
props.item?.province_id || '',
|
||||||
props.item?.province_id || '',
|
props.item?.city_id || '',
|
||||||
props.item?.city_id || '',
|
props.item?.area_id || '',
|
||||||
props.item?.area_id || '',
|
props.item?.street_id || '',
|
||||||
props.item?.street_id || '',
|
],
|
||||||
],
|
})
|
||||||
});
|
}
|
||||||
}
|
|
||||||
}}
|
|
||||||
onFinish={async (values) =>
|
onFinish={async (values) =>
|
||||||
Apis.Company.Companies.Update({ ...values, id: props.item?.id ?? 0 })
|
Apis.Company.Companies.Update({ ...values, id: props.item?.id ?? 0 })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@ -44,15 +41,20 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
.catch(() => false)
|
.catch(() => false)
|
||||||
}
|
}
|
||||||
columns={[
|
columns={[
|
||||||
|
SysSelects?.Companies({
|
||||||
|
key: 'parent_id',
|
||||||
|
title: '上级组织',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
}),
|
||||||
{
|
{
|
||||||
key: 'name',
|
key: 'name',
|
||||||
title: '机构名称',
|
title: '组织名称',
|
||||||
colProps: { span: 8 },
|
colProps: { span: 8 },
|
||||||
formItemProps: { ...rulesHelper.text },
|
formItemProps: { ...rulesHelper.text },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'short_name',
|
key: 'short_name',
|
||||||
title: '机构简称',
|
title: '组织简称',
|
||||||
colProps: { span: 8 },
|
colProps: { span: 8 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -104,7 +106,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
key: 'address',
|
key: 'address',
|
||||||
title: '详细地址',
|
title: '机构地址',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
|
|||||||
@ -2,10 +2,9 @@ import { MyBetaModalFormProps, MyButtons, MyModalFormProps } from '@/common';
|
|||||||
import { SysSelects } from '@/components/SysSelects';
|
import { SysSelects } from '@/components/SysSelects';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
import { Form, message } from 'antd';
|
import { message } from 'antd';
|
||||||
|
|
||||||
export default function Update(props: MyBetaModalFormProps) {
|
export default function Update(props: MyBetaModalFormProps) {
|
||||||
const [form] = Form.useForm();
|
|
||||||
return (
|
return (
|
||||||
<BetaSchemaForm<ApiTypes.Common.Admins.Update>
|
<BetaSchemaForm<ApiTypes.Common.Admins.Update>
|
||||||
{...MyModalFormProps.props}
|
{...MyModalFormProps.props}
|
||||||
@ -13,15 +12,12 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
trigger={<MyButtons.Edit />}
|
trigger={<MyButtons.Edit />}
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="500px"
|
width="500px"
|
||||||
form={form}
|
request={() =>
|
||||||
onOpenChange={(open: any) => {
|
Promise.resolve({
|
||||||
if (open && props.item) {
|
...props.item,
|
||||||
form.setFieldsValue({
|
roles_id: props.item?.roles?.map((item: any) => item.value),
|
||||||
...props.item,
|
})
|
||||||
roles_id: props.item?.roles?.map((item: any) => item.value),
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onFinish={async (values) =>
|
onFinish={async (values) =>
|
||||||
Apis.Common.Admins.Update({ ...values, id: props.item?.id ?? 0 })
|
Apis.Common.Admins.Update({ ...values, id: props.item?.id ?? 0 })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user