Compare commits

..

No commits in common. "54be94e7dae2247381efd32166ca3824dea30c4b" and "d466eee7bb9de28314581eed8077df7e9edba828" have entirely different histories.

12 changed files with 59 additions and 260 deletions

View File

@ -53,19 +53,13 @@ export const MyFormItems = {
uploadType = 'image', uploadType = 'image',
...rest ...rest
}: { }: {
max?: number | undefined; max?: number;
help?: string; help?: string;
uploadType?: 'image' | 'file' | 'video' | 'audio' | undefined; uploadType?: 'image' | 'file' | 'video' | 'audio' | undefined;
} & PropsType): ReturnType { } & PropsType): ReturnType {
return { return {
renderFormItem() { renderFormItem() {
return ( return <MyUploadImages max={max} uploadType={uploadType} />;
<MyUploadImages
max={max}
uploadType={uploadType}
{...rest?.fieldProps}
/>
);
}, },
formItemProps: { formItemProps: {
help, help,

View File

@ -1,38 +0,0 @@
export const defaultMenu = [
{
pagePath: 'pages/index/index',
text: '首页',
iconPath: [
{
name: '首页默认图标',
url: 'https://pay-test-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KFMAHSTNJRDJQAY3ZMY5PZXV.png',
uid: 123123,
},
],
selectedIconPath: [
{
name: '首页高亮图标',
url: 'https://pay-test-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KFMAG5PNHCWCMQMYEXFC8XV2.png',
uid: 321321,
},
],
},
{
text: '我的',
pagePath: 'pages/me/index',
iconPath: [
{
name: '我的默认图标',
url: 'https://pay-test-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KFMAJ8EYMS0TTNG482YGVWQ1.png',
uid: 234234,
},
],
selectedIconPath: [
{
name: '我的高亮图标',
url: 'https://pay-test-1369486729.cos.ap-guangzhou.myqcloud.com/uploads/cs-test/01KFMAJZYRFEYY8T5VJVYH6XJ1.png',
uid: 432432,
},
],
},
];

View File

@ -43,11 +43,11 @@ export default function Index({ title = '岗位库' }) {
dataIndex: 'name', dataIndex: 'name',
width: 200, width: 200,
}, },
// { {
// title: '岗位编号', title: '岗位编号',
// dataIndex: 'code', dataIndex: 'code',
// width: 200, width: 200,
// }, },
{ {
title: '岗位说明', title: '岗位说明',
dataIndex: 'remark', dataIndex: 'remark',

View File

@ -45,12 +45,12 @@ export default function Create(props: MyBetaModalFormProps) {
colProps: { span: 24 }, colProps: { span: 24 },
formItemProps: { ...rulesHelper.text }, formItemProps: { ...rulesHelper.text },
}, },
// { {
// key: 'code', key: 'code',
// title: '岗位编号', title: '岗位编号',
// colProps: { span: 24 }, colProps: { span: 24 },
// formItemProps: { ...rulesHelper.text }, formItemProps: { ...rulesHelper.text },
// }, },
{ {
key: 'remark', key: 'remark',
title: '岗位说明', title: '岗位说明',

View File

@ -46,12 +46,12 @@ export default function Update(props: MyBetaModalFormProps) {
colProps: { span: 24 }, colProps: { span: 24 },
formItemProps: { ...rulesHelper.text }, formItemProps: { ...rulesHelper.text },
}, },
// { {
// key: 'code', key: 'code',
// title: '岗位编号', title: '岗位编号',
// colProps: { span: 24 }, colProps: { span: 24 },
// formItemProps: { ...rulesHelper.text }, formItemProps: { ...rulesHelper.text },
// }, },
{ {
key: 'remark', key: 'remark',
title: '岗位说明', title: '岗位说明',

View File

@ -63,7 +63,7 @@ export default function Create(props: MyBetaModalFormProps) {
name: ['app_type'], name: ['app_type'],
valueType: 'dependency', valueType: 'dependency',
columns: ({ app_type }: any) => { columns: ({ app_type }: any) => {
return app_type !== 'MpOfficial' return app_type === 'MiniProgram'
? [ ? [
MyFormItems.EnumRadio({ MyFormItems.EnumRadio({
key: 'module', key: 'module',

View File

@ -35,7 +35,7 @@ export default function Create(props: MyBetaModalFormProps) {
}) })
.then(() => { .then(() => {
props.reload?.(); props.reload?.();
message.success('添加成功'); message.success('编辑成功');
return true; return true;
}) })
.catch(() => false) .catch(() => false)

View File

@ -4,12 +4,11 @@ import {
MyModalFormProps, MyModalFormProps,
MyPageContainer, MyPageContainer,
} from '@/common'; } from '@/common';
import { defaultMenu } from '@/common/utils/wxCustomerConfig';
import { Apis } from '@/gen/Apis'; import { Apis } from '@/gen/Apis';
import { CaretDownOutlined } from '@ant-design/icons'; import { CaretDownOutlined } from '@ant-design/icons';
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components'; import { BetaSchemaForm } from '@ant-design/pro-components';
import { useSearchParams } from '@umijs/max'; import { useSearchParams } from '@umijs/max';
import { Card, Col, Flex, Form, message, Row, Space, Tag } from 'antd'; import { Card, Col, Flex, Form, message, Row, Tag } from 'antd';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import './style.scss'; import './style.scss';
@ -19,19 +18,16 @@ interface FormData {
pageColor: string; pageColor: string;
pageColorValue?: string[]; pageColorValue?: string[];
admin_logo?: { url: string }[]; admin_logo?: { url: string }[];
menu?: typeof defaultMenu;
} }
export default function Index({ title = '小程序页面配置' }) { export default function Index({ title = '小程序页面配置' }) {
const [form] = Form.useForm<FormData>(); const [form] = Form.useForm<FormData>();
const [menuIndex, setMenuIndex] = useState<number>(0);
const [getShowData, setShowData] = useState<any>({}); const [getShowData, setShowData] = useState<any>({});
const [searchParams] = useSearchParams(); const [searchParams] = useSearchParams();
const [formValues, setFormValues] = useState<FormData>({ const [formValues, setFormValues] = useState<FormData>({
logo: [], logo: [],
admin_logo: [], admin_logo: [],
color: '#1890ff', color: '#1890ff',
menu: defaultMenu,
// pageColor: `linear-gradient(180deg,rgba(255, 255, 255, 0.44) 0%,rgba(255, 255, 255, 0) 100%),linear-gradient(146deg,#d3d7ff 0%,rgba(255, 255, 255, 0) 37%),linear-gradient(194deg,#dffff3 0%,#f8f8f8 30%)`, // pageColor: `linear-gradient(180deg,rgba(255, 255, 255, 0.44) 0%,rgba(255, 255, 255, 0) 100%),linear-gradient(146deg,#d3d7ff 0%,rgba(255, 255, 255, 0) 37%),linear-gradient(194deg,#dffff3 0%,#f8f8f8 30%)`,
pageColor: `linear-gradient(180deg, rgba(208, 229, 255, 0.44) 0%, #f7f7f7 100%, rgba(255, 255, 255, 0) 100%), linear-gradient(145deg, #D3D7FF 3%, rgba(255, 255, 255, 0) 49%), linear-gradient(222deg, #84FFD8 0%, #F7F7F7 67%)`, pageColor: `linear-gradient(180deg, rgba(208, 229, 255, 0.44) 0%, #f7f7f7 100%, rgba(255, 255, 255, 0) 100%), linear-gradient(145deg, #D3D7FF 3%, rgba(255, 255, 255, 0) 49%), linear-gradient(222deg, #84FFD8 0%, #F7F7F7 67%)`,
}); });
@ -57,7 +53,6 @@ export default function Index({ title = '小程序页面配置' }) {
logo: row?.logo || formValues?.logo, logo: row?.logo || formValues?.logo,
pageColorValue: formValues?.pageColorValue, pageColorValue: formValues?.pageColorValue,
admin_logo: row?.admin_logo, admin_logo: row?.admin_logo,
menu: row?.menu?.length ? row?.menu : defaultMenu,
}, },
}; };
@ -92,7 +87,6 @@ export default function Index({ title = '小程序页面配置' }) {
setFormValues({ setFormValues({
...res?.data?.config_value, ...res?.data?.config_value,
pageColor: newCss, pageColor: newCss,
menu: defaultMenu,
}); });
console.log('newCss', newCss); console.log('newCss', newCss);
form.setFieldsValue({ form.setFieldsValue({
@ -255,127 +249,6 @@ export default function Index({ title = '小程序页面配置' }) {
}, },
}, },
}, },
{
valueType: 'divider',
fieldProps: {
orientation: 'left',
children: '首屏底部菜单图标',
},
},
{
valueType: 'formList',
dataIndex: 'menu',
fieldProps: {
copyIconProps: false,
deleteIconProps: false,
creatorButtonProps: false,
},
formItemProps: {
onChange: () => {
let formValues = form.getFieldsValue();
setFormValues({
...formValues,
menu: formValues?.menu,
});
},
style: {
borderRadius: '6px',
marginBottom: 0,
},
itemRender: (
{ listDom, action }: any,
{ index }: { index: number },
) => {
return (
<ProCard
bordered
style={{ marginBlockEnd: 10 }}
title={`菜单设置`}
size="small"
headerBordered
extra={
<Space>
<div
style={{ fontSize: '12px', color: '#666' }}
>
81*81
</div>
{/* {index ? (
<div
onClick={() => {
// 确认删除操作
// 获取当前表单值
const formValues = form.getFieldsValue();
// 检查menu数组是否存在
if (
formValues?.menu &&
Array.isArray(formValues.menu)
) {
// 创建新的menu数组删除指定下标项
const newMenu = formValues.menu.filter(
(_, i) => i !== index,
);
// 更新表单值
setFormValues({
...formValues,
menu: newMenu,
});
form.setFieldsValue({
...formValues,
menu: newMenu,
});
}
}}
style={{
cursor: 'pointer',
padding: '4px',
borderRadius: '4px',
}}
>
<DeleteFilled />
</div>
) : (
''
)} */}
</Space>
}
>
{listDom}
</ProCard>
);
},
},
columns: [
{
valueType: 'group',
colProps: { span: 24 },
columns: [
{
title: '菜单名称',
key: 'text',
colProps: { span: 4 },
},
{
title: '跳转链接',
key: 'pagePath',
colProps: { span: 8 },
},
MyFormItems.UploadImages({
key: 'iconPath',
title: '默认图标',
max: 1,
colProps: { span: 4 },
}),
MyFormItems.UploadImages({
key: 'selectedIconPath',
title: '选中图标',
max: 1,
colProps: { span: 4 },
}),
],
},
],
},
]} ]}
/> />
</Card> </Card>
@ -473,29 +346,6 @@ export default function Index({ title = '小程序页面配置' }) {
</Flex> </Flex>
</div> </div>
</div> </div>
<div className="menu-content">
{formValues?.menu?.map((item: any, index: number) => (
<div
key={`item_${index}`}
className="item"
onClick={() => {
setMenuIndex(index);
}}
>
<img
src={
index === menuIndex
? item?.selectedIconPath?.[0]?.url
: item?.iconPath?.[0]?.url
}
width="28"
height="28"
alt=""
/>
<div>{item?.text}</div>
</div>
))}
</div>
</div> </div>
</div> </div>
</Card> </Card>

View File

@ -53,18 +53,18 @@
} }
// 手机底部home键 // 手机底部home键
// &::after { &::after {
// content: ''; content: '';
// position: absolute; position: absolute;
// bottom: 10px; bottom: 10px;
// left: 50%; left: 50%;
// transform: translateX(-50%); transform: translateX(-50%);
// width: 50px; width: 50px;
// height: 50px; height: 50px;
// border: 2px solid #333; border: 2px solid #333;
// border-radius: 50%; border-radius: 50%;
// z-index: 1; z-index: 1;
// } }
} }
.phone-screen { .phone-screen {
@ -154,7 +154,6 @@
.tab-content { .tab-content {
padding: 15px 0 0 0; padding: 15px 0 0 0;
position: relative;
} }
.phone-button { .phone-button {
padding: 4px 12px; padding: 4px 12px;
@ -197,20 +196,3 @@
} }
} }
} }
.menu-content {
display: flex;
align-items: center;
position: absolute;
bottom: 0;
right: 0;
left: 0;
background-color: #fff;
font-size: 12px;
.item {
text-align: center;
padding: 10px 0;
width: 50%;
cursor: pointer;
}
}

View File

@ -46,7 +46,7 @@ export default function Show({ title }: { title?: string } = {}) {
let items = [ let items = [
{ {
label: '应用配置', label: '项目配置',
key: '1', key: '1',
closable: false, closable: false,
children: <CompanyApps item={data} />, children: <CompanyApps item={data} />,
@ -77,12 +77,17 @@ export default function Show({ title }: { title?: string } = {}) {
}, },
{ {
label: '品牌配置', label: '应用配置',
key: '6', key: '6',
closable: false, closable: false,
children: <Brands item={data} />, children: <Brands item={data} />,
}, },
{
label: '品牌配置',
key: '7',
closable: false,
children: <Assets item={data} />,
},
{ {
label: '权限配置', label: '权限配置',
key: '8', key: '8',
@ -95,12 +100,6 @@ export default function Show({ title }: { title?: string } = {}) {
closable: false, closable: false,
children: <CustomerEnd item={data} />, children: <CustomerEnd item={data} />,
}, },
{
label: '项目配置',
key: '7',
closable: false,
children: <Assets item={data} />,
},
]; ];
return ( return (
<MyPageContainer title={title}> <MyPageContainer title={title}>
@ -122,7 +121,7 @@ export default function Show({ title }: { title?: string } = {}) {
<div style={{ padding: '0 0 10px 0' }}> <div style={{ padding: '0 0 10px 0' }}>
<span> <span>
</span> </span>
</div> </div>
</ProCard> </ProCard>

View File

@ -8,7 +8,7 @@ export default function CustomerEnd(props: MyBetaModalFormProps) {
<div> <div>
<ProCard title="客户端小程序配置" bordered headerBordered gutter={16}> <ProCard title="客户端小程序配置" bordered headerBordered gutter={16}>
<ProCard <ProCard
title="底部菜单图标、品牌主色、全局渐变色配置" title="品牌主色、全局渐变色配置"
type="inner" type="inner"
bordered bordered
extra={ extra={
@ -25,7 +25,7 @@ export default function CustomerEnd(props: MyBetaModalFormProps) {
} }
> >
<div style={{ height: '80px' }}> <div style={{ height: '80px' }}>
</div> </div>
</ProCard> </ProCard>
<ProCard <ProCard
@ -40,6 +40,18 @@ export default function CustomerEnd(props: MyBetaModalFormProps) {
</div> </div>
</ProCard> </ProCard>
<ProCard
title="小程序首屏底部菜单图标"
type="inner"
bordered
extra={
<MyButtons.Default title="去配置" type="primary" size="small" />
}
>
<div style={{ height: '80px' }}>
png格式图标
</div>
</ProCard>
</ProCard> </ProCard>
</div> </div>
); );

View File

@ -31,7 +31,7 @@ export default function Create(props: MyBetaModalFormProps) {
onFinish={async (values: any) => onFinish={async (values: any) =>
Apis.Company.Organizations.Store({ Apis.Company.Organizations.Store({
...values, ...values,
companies_id: values?.companies_id || props?.item?.id, companies_id: values?.companies_id || props?.item?.companies_id,
parent_id: values?.parent_id?.[values.parent_id.length - 1], parent_id: values?.parent_id?.[values.parent_id.length - 1],
}) })
.then(() => { .then(() => {