diff --git a/.gitignore b/.gitignore index 3ca70fc..d779301 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ /package-lock.json /yarn.lock *.yaml +# +/docs diff --git a/.umirc.ts b/.umirc.ts index 8abb35a..723972c 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -4,6 +4,7 @@ const isDev = process.env.NODE_ENV === 'development'; const UMI_APP_API_URL = isDev ? 'http://localhost:7001' : 'https://api.yoone.ca'; + import { codeInspectorPlugin } from 'code-inspector-plugin'; export default defineConfig({ hash: true, @@ -18,6 +19,13 @@ export default defineConfig({ define: { UMI_APP_API_URL, }, + chainWebpack(config) { + config.plugin('code-inspector-plugin').use( + codeInspectorPlugin({ + bundler: 'webpack', + }) + ); + }, routes: [ { path: '/', redirect: '/home' }, { name: '追踪', path: '/track', component: './Track', layout: false }, diff --git a/package.json b/package.json index b09cc56..07c5682 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "devDependencies": { "@types/react": "^18.0.33", "@types/react-dom": "^18.0.11", + "code-inspector-plugin": "^1.2.10", "husky": "^9", "lint-staged": "^13.2.0", "prettier": "^2.8.7", diff --git a/src/pages/Order/List/index.tsx b/src/pages/Order/List/index.tsx index 4a6b295..35e2d6e 100644 --- a/src/pages/Order/List/index.tsx +++ b/src/pages/Order/List/index.tsx @@ -128,12 +128,15 @@ const ListPage: React.FC = () => { label: '已申请退款', }, { + key: 'refund_approved', - label: '退款申请已通过', + label: "已退款", + // label: '退款申请已通过', }, { key: 'refund_cancelled', - label: '已取消退款', + label: "已完成" + // label: '已取消退款', }, // { // key: 'pending_refund', @@ -295,7 +298,7 @@ const ListPage: React.FC = () => { record.orderStatus, ) ? ( <> - + ) : ( @@ -425,7 +428,7 @@ const ListPage: React.FC = () => { actionRef={actionRef} rowKey="id" rowClassName={(record) => { - return record.id === activeLine ? styles['selected-line-order-protable']: ''; + return record.id === activeLine ? styles['selected-line-order-protable'] : ''; }} toolBarRender={() => [ , @@ -769,16 +772,17 @@ const Detail: React.FC<{ valueEnum={ORDER_STATUS_ENUM} /> - - { return ( -
- - {record?.shipping?.phone || record?.billing?.phone || '-'} - -
- ); - }} /> + + { + return ( +
+ + {record?.shipping?.phone || record?.billing?.phone || '-'} + +
+ ); + }} /> @@ -911,7 +915,7 @@ const Detail: React.FC<{ ); }} /> - { @@ -1395,16 +1399,16 @@ const Shipping: React.FC<{ - // value && value.length > 0 - // ? Promise.resolve() - // : Promise.reject('至少需要一个商品'), - // }, - // ]} + // rules={[ + // { + // required: true, + // message: '至少需要一个商品', + // validator: (_, value) => + // value && value.length > 0 + // ? Promise.resolve() + // : Promise.reject('至少需要一个商品'), + // }, + // ]} > { - let idx = acc.findIndex((v: any) => v.productId === cur.productId); - if (idx === -1) { - acc.push(cur); - } else { - acc[idx].quantity += cur.quantity; - } - return acc; - }, + let idx = acc.findIndex((v: any) => v.productId === cur.productId); + if (idx === -1) { + acc.push(cur); + } else { + acc[idx].quantity += cur.quantity; + } + return acc; + }, [], ); @@ -1997,13 +2001,12 @@ const SalesChange: React.FC<{ return { ...data}; }} onFinish={async (formData: any) => { - const { sales,items } = formData; - const data ={sales,items } - const res = await ordercontrollerUpdateorderitems({orderId:id}, data); + const { sales } = formData; + const res = await ordercontrollerUpdateorderitems({ orderId: id }, sales); if (!res.success) { message.error(`更新货物信息失败: ${res.message}`); return false; - } + } message.success('更新成功') detailRef?.current?.reload(); return true; @@ -2067,7 +2070,7 @@ const SalesChange: React.FC<{ { try { const { data } = await productcontrollerSearchproducts({