fix:更新金刚区1 #24
89
src/pages/company/list/modals/JinGangQuCreate.tsx
Normal file
89
src/pages/company/list/modals/JinGangQuCreate.tsx
Normal file
@ -0,0 +1,89 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Company.CompanyQuickActions.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title="添加金刚区"
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="600px"
|
||||
trigger={<MyButtons.Create title="添加金刚区" />}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values: any) =>
|
||||
Apis.Company.CompanyQuickActions.Store({
|
||||
...values,
|
||||
is_show: values?.is_show || 0,
|
||||
is_bind_house: values?.is_bind_house || 0,
|
||||
companies_id: props?.item?.id,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('添加成功!');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
key: 'name',
|
||||
title: '名称',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'skip_url',
|
||||
title: '跳转链接',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'sort',
|
||||
title: '排序',
|
||||
tooltip: '越小越靠前',
|
||||
valueType: 'digit',
|
||||
colProps: { span: 8 },
|
||||
fieldProps: {
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '是否显示',
|
||||
key: 'is_show',
|
||||
valueType: 'switch',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
title: '是否要绑房打开',
|
||||
key: 'is_bind_house',
|
||||
tooltip: '是:必须绑房后才能使用功能,否:不绑房也可以使用当前功能',
|
||||
valueType: 'switch',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
MyFormItems.UploadImages({
|
||||
key: 'icon',
|
||||
title: '图标',
|
||||
max: 1,
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.array },
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
90
src/pages/company/list/modals/JinGangQuUpdate.tsx
Normal file
90
src/pages/company/list/modals/JinGangQuUpdate.tsx
Normal file
@ -0,0 +1,90 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Company.CompanyQuickActions.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title="编辑金刚区"
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="600px"
|
||||
trigger={<MyButtons.Edit title="编辑" />}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
form.setFieldsValue(props.item);
|
||||
}
|
||||
}}
|
||||
onFinish={async (values: any) =>
|
||||
Apis.Company.CompanyQuickActions.Update({
|
||||
...values,
|
||||
is_show: values?.is_show || 0,
|
||||
is_bind_house: values?.is_bind_house || 0,
|
||||
companies_id: props?.item?.companies_id,
|
||||
id: props?.item?.id ?? 0,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('编辑成功!');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
key: 'name',
|
||||
title: '名称',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'skip_url',
|
||||
title: '跳转链接',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'sort',
|
||||
title: '排序',
|
||||
tooltip: '越小越靠前',
|
||||
valueType: 'digit',
|
||||
colProps: { span: 8 },
|
||||
fieldProps: {
|
||||
style: { width: '100%' },
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '是否显示',
|
||||
key: 'is_show',
|
||||
valueType: 'switch',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
title: '是否要绑房打开',
|
||||
key: 'is_bind_house',
|
||||
tooltip: '是:必须绑房后才能使用功能,否:不绑房也可以使用当前功能',
|
||||
valueType: 'switch',
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
MyFormItems.UploadImages({
|
||||
key: 'icon',
|
||||
title: '图标',
|
||||
max: 1,
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.array },
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
95
src/pages/company/list/pages/set_gan_info.tsx
Normal file
95
src/pages/company/list/pages/set_gan_info.tsx
Normal file
@ -0,0 +1,95 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useSearchParams } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import Create from '../modals/JinGangQuCreate';
|
||||
import Update from '../modals/JinGangQuUpdate';
|
||||
|
||||
export default function Index({ title = '金刚区配置' }) {
|
||||
const [searchParams] = useSearchParams();
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey={`company-set-gan-info-${searchParams.get('id')}`}
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{ ...params, companies_id: searchParams.get('id') },
|
||||
sort,
|
||||
Apis.Company.CompanyQuickActions.List,
|
||||
)
|
||||
}
|
||||
bordered
|
||||
toolBarRender={(action) => [
|
||||
<Create
|
||||
key="Create"
|
||||
reload={action?.reload}
|
||||
item={{ id: searchParams.get('id') }}
|
||||
title={title}
|
||||
/>,
|
||||
]}
|
||||
search={false}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '标题',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '跳转地址',
|
||||
dataIndex: 'skip_url',
|
||||
},
|
||||
MyColumns.Boolean({
|
||||
title: '是否显示',
|
||||
dataIndex: 'is_show',
|
||||
}),
|
||||
MyColumns.Boolean({
|
||||
title: '是否要绑房',
|
||||
dataIndex: 'is_bind_house',
|
||||
}),
|
||||
{
|
||||
title: '图标',
|
||||
dataIndex: 'icon',
|
||||
search: false,
|
||||
render: (_, item) => (
|
||||
<img
|
||||
src={item?.icon?.[0]?.url || ''}
|
||||
alt="图标"
|
||||
style={{ width: 40, height: 40 }}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
dataIndex: 'sort',
|
||||
},
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space>
|
||||
<Update item={item} reload={action?.reload} title={title} />
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Company.CompanyQuickActions.Delete({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
@ -28,18 +28,27 @@ export default function CustomerEnd(props: MyBetaModalFormProps) {
|
||||
替换系统默认的颜色统一调整为机构主色,保持视觉格一致,以及首屏底部菜单图标。
|
||||
</div>
|
||||
</ProCard>
|
||||
{/* <ProCard
|
||||
<ProCard
|
||||
title="金刚区图标配置"
|
||||
type="inner"
|
||||
bordered
|
||||
extra={
|
||||
<MyButtons.Default title="去配置" type="primary" size="small" />
|
||||
<MyButtons.Default
|
||||
title="去配置"
|
||||
type="primary"
|
||||
size="small"
|
||||
onClick={() => {
|
||||
navigate(
|
||||
`/company/list/pages/set_gan_info?id=${props?.item?.id}`,
|
||||
);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<div style={{ height: '80px' }}>
|
||||
品牌主色是机构在小程序中最核心的视觉代表色。通过配置品牌主色,你可以让整个小程序的交互组件自动统一为机构专属风格,提升品牌识别度。
|
||||
</div>
|
||||
</ProCard> */}
|
||||
</ProCard>
|
||||
</ProCard>
|
||||
</div>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user