From 5644ee4325a9cbaf20a1c7436ffb831eaaccbfac Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 28 Jan 2026 18:25:20 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=9B=B4=E6=96=B0=E9=87=91?= =?UTF-8?q?=E5=88=9A=E5=8C=BA1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../company/list/modals/JinGangQuCreate.tsx | 89 +++++++++++++++++ .../company/list/modals/JinGangQuUpdate.tsx | 90 ++++++++++++++++++ src/pages/company/list/pages/set_gan_info.tsx | 95 +++++++++++++++++++ src/pages/company/list/table/CustomerEnd.tsx | 15 ++- 4 files changed, 286 insertions(+), 3 deletions(-) create mode 100644 src/pages/company/list/modals/JinGangQuCreate.tsx create mode 100644 src/pages/company/list/modals/JinGangQuUpdate.tsx create mode 100644 src/pages/company/list/pages/set_gan_info.tsx diff --git a/src/pages/company/list/modals/JinGangQuCreate.tsx b/src/pages/company/list/modals/JinGangQuCreate.tsx new file mode 100644 index 0000000..4959f7c --- /dev/null +++ b/src/pages/company/list/modals/JinGangQuCreate.tsx @@ -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 ( + + {...MyModalFormProps.props} + title="添加金刚区" + wrapperCol={{ span: 24 }} + width="600px" + trigger={} + 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 }, + }), + ]} + /> + ); +} diff --git a/src/pages/company/list/modals/JinGangQuUpdate.tsx b/src/pages/company/list/modals/JinGangQuUpdate.tsx new file mode 100644 index 0000000..8a50525 --- /dev/null +++ b/src/pages/company/list/modals/JinGangQuUpdate.tsx @@ -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 ( + + {...MyModalFormProps.props} + title="编辑金刚区" + wrapperCol={{ span: 24 }} + width="600px" + trigger={} + 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 }, + }), + ]} + /> + ); +} diff --git a/src/pages/company/list/pages/set_gan_info.tsx b/src/pages/company/list/pages/set_gan_info.tsx new file mode 100644 index 0000000..40365ab --- /dev/null +++ b/src/pages/company/list/pages/set_gan_info.tsx @@ -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 ( + + + MyProTableProps.request( + { ...params, companies_id: searchParams.get('id') }, + sort, + Apis.Company.CompanyQuickActions.List, + ) + } + bordered + toolBarRender={(action) => [ + , + ]} + 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) => ( + 图标 + ), + }, + { + title: '排序', + dataIndex: 'sort', + }, + MyColumns.CreatedAt(), + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + + Apis.Company.CompanyQuickActions.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + + ), + }), + ]} + /> + + ); +} diff --git a/src/pages/company/list/table/CustomerEnd.tsx b/src/pages/company/list/table/CustomerEnd.tsx index 0e28094..e3655e6 100644 --- a/src/pages/company/list/table/CustomerEnd.tsx +++ b/src/pages/company/list/table/CustomerEnd.tsx @@ -28,18 +28,27 @@ export default function CustomerEnd(props: MyBetaModalFormProps) { 替换系统默认的颜色统一调整为机构主色,保持视觉格一致,以及首屏底部菜单图标。 - {/* + { + navigate( + `/company/list/pages/set_gan_info?id=${props?.item?.id}`, + ); + }} + /> } >
品牌主色是机构在小程序中最核心的视觉代表色。通过配置品牌主色,你可以让整个小程序的交互组件自动统一为机构专属风格,提升品牌识别度。
-
*/} + ); -- 2.47.2