Compare commits

..

3 Commits

Author SHA1 Message Date
tikkhun d0097aec38 feat(Product): 新增品牌空间页面
refactor: 优化订单列表和统计页面的代码格式和逻辑

style: 调整多个页面的代码格式和导入顺序

fix: 修复订单列表中的物流信息显示问题

chore: 更新路由配置添加品牌空间页面
2026-01-14 19:57:15 +08:00
tikkhun 66256acee0 feat(产品分类): 在分类页面显示短名称并支持编辑短名称字段
feat(CSV工具): 增强SKU生成功能并支持CSV文件解析

1. 在分类页面显示短名称并支持编辑短名称字段
2. 重构SKU生成逻辑,支持更多属性组合
3. 添加对CSV文件的支持,优化中文编码处理
4. 增加尺寸和数量属性支持
5. 添加为single类型生成bundle SKU的选项
6. 优化表单选项显示,同时展示名称和短名称
2026-01-14 19:54:13 +08:00
zhuotianyuan bf32957f0a feat: 添加webhook地址字段和区域选择功能
在站点列表和编辑表单中添加webhook地址字段
在订单列表中添加付款日期字段
在统计页面添加国家/区域选择功能,支持多选和搜索
引入i18n-iso-countries库实现国家名称本地化
2026-01-10 07:27:41 +00:00
5 changed files with 87 additions and 4 deletions

View File

@ -215,11 +215,17 @@ const ListPage: React.FC = () => {
dataIndex: 'externalOrderId',
},
{
title: '订单日期',
title: '订单创建日期',
dataIndex: 'date_created',
hideInSearch: true,
valueType: 'dateTime',
},
{
title: '付款日期',
dataIndex: 'date_paid',
hideInSearch: true,
valueType: 'dateTime',
},
{
title: '金额',
dataIndex: 'total',

View File

@ -202,6 +202,8 @@ const SiteList: React.FC = () => {
</a>
),
},
{ title: 'webhook地址', dataIndex: 'webhookUrl', width: 280, hideInSearch: true },
{
title: 'SKU 前缀',
dataIndex: 'skuPrefix',

View File

@ -100,6 +100,11 @@ const EditSiteForm: React.FC<EditSiteFormProps> = ({
label="网站地址"
placeholder="请输入网站地址"
/>
<ProFormText
name="webhookUrl"
label="Webhook 地址"
placeholder="请输入 Webhook 地址"
/>
<ProFormSelect
name="type"
label="平台"
@ -164,6 +169,7 @@ const EditSiteForm: React.FC<EditSiteFormProps> = ({
label="区域"
mode="multiple"
placeholder="请选择区域"
showSearch
filterOption={(input, option) =>
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())

View File

@ -2,6 +2,7 @@ import { ORDER_STATUS_ENUM } from '@/constants';
import { AddTag } from '@/pages/Customer/List';
import { customercontrollerDeltag } from '@/servers/api/customer';
import { sitecontrollerAll } from '@/servers/api/site';
import * as countries from 'i18n-iso-countries';
import {
statisticscontrollerGetorderbydate,
statisticscontrollerGetorderbyemail,
@ -38,6 +39,17 @@ const highlightText = (text: string, keyword: string) => {
);
};
// 获取所有国家/地区的选项
const getCountryOptions = () => {
// 获取所有国家的 ISO 代码
const countryCodes = countries.getAlpha2Codes();
// 将国家代码转换为选项数组
return Object.keys(countryCodes).map((code) => ({
label: countries.getName(code, 'zh') || code, // 使用中文名称, 如果没有则使用代码
value: code,
}));
};
const ListPage: React.FC = () => {
const [xAxis, setXAxis] = useState([]);
const [series, setSeries] = useState<any[]>([]);
@ -622,6 +634,19 @@ const ListPage: React.FC = () => {
}));
}}
/>
<ProFormSelect
name="country"
label="区域"
mode="multiple"
placeholder="请选择区域"
showSearch
filterOption={(input, option) =>
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
}
options={getCountryOptions()}
/>
{/* <ProFormSelect
label="类型"
name="purchaseType"

View File

@ -9,18 +9,28 @@ import {
PageContainer,
ProColumns,
ProTable,
ProForm,
ProFormSelect,
} from '@ant-design/pro-components';
import { Space, Tag } from 'antd';
import dayjs from 'dayjs';
import ReactECharts from 'echarts-for-react';
import { HistoryOrder } from '../Order';
import * as countries from 'i18n-iso-countries';
import zhCN from 'i18n-iso-countries/langs/zh';
countries.registerLocale(zhCN);
const ListPage: React.FC = () => {
const [data, setData] = useState({});
useEffect(() => {
statisticscontrollerGetordersorce().then(({ data, success }) => {
const initialValues = {
country: ['CA'],
};
function handleSubmit(values: typeof initialValues) {
statisticscontrollerGetordersorce({params: values}).then(({ data, success }) => {
if (success) setData(data);
});
}
useEffect(() => {
handleSubmit(initialValues)
}, []);
const option = useMemo(() => {
@ -277,9 +287,29 @@ const ListPage: React.FC = () => {
);
},
},
];
return (
<PageContainer ghost>
<ProForm
initialValues={initialValues}
layout="inline"
onFinish={handleSubmit}
>
<ProFormSelect
name="country"
label="区域"
mode="multiple"
placeholder="请选择区域"
showSearch
filterOption={(input, option) =>
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
}
options={getCountryOptions()}
/>
</ProForm>
<ReactECharts
option={option}
style={{ height: 1050 }}
@ -296,6 +326,7 @@ const ListPage: React.FC = () => {
},
}}
/>
{tableData?.length ? (
<ProTable
search={false}
@ -312,4 +343,17 @@ const ListPage: React.FC = () => {
);
};
// 获取所有国家/地区的选项
const getCountryOptions = () => {
// 获取所有国家的 ISO 代码
const countryCodes = countries.getAlpha2Codes();
// 将国家代码转换为选项数组
return Object.keys(countryCodes).map((code) => ({
label: countries.getName(code, 'zh') || code, // 使用中文名称, 如果没有则使用代码
value: code,
}));
};
export default ListPage;