diff --git a/src/pages/account/center/index.tsx b/src/pages/account/center/index.tsx index 5f01ce59..bf1131ea 100644 --- a/src/pages/account/center/index.tsx +++ b/src/pages/account/center/index.tsx @@ -83,7 +83,6 @@ const TagList: React.FC<{ const showInput = () => { setInputVisible(true); if (ref.current) { - // eslint-disable-next-line no-unused-expressions ref.current?.focus(); } }; diff --git a/src/pages/chatbot/index.tsx b/src/pages/chatbot/index.tsx index f3525925..6aff93a6 100644 --- a/src/pages/chatbot/index.tsx +++ b/src/pages/chatbot/index.tsx @@ -156,10 +156,8 @@ const ChatbotPage: React.FC = () => { const [activeKey, setActiveKey] = useState('default'); const [inputValue, setInputValue] = useState(''); - // eslint-disable-next-line @typescript-eslint/no-explicit-any const provider = useMemo(() => createChatProvider() as any, []); const { onRequest, abort, isRequesting, parsedMessages } = useXChat< - // eslint-disable-next-line @typescript-eslint/no-explicit-any any, ParsedMessage >({ diff --git a/src/pages/form/advanced-form/index.tsx b/src/pages/form/advanced-form/index.tsx index 280648b9..9553cc04 100644 --- a/src/pages/form/advanced-form/index.tsx +++ b/src/pages/form/advanced-form/index.tsx @@ -105,7 +105,9 @@ const AdvancedForm: FC> = () => { { if (trigger?.parentNode) { diff --git a/src/pages/form/step-form/index.tsx b/src/pages/form/step-form/index.tsx index 0354f0dd..b5366577 100644 --- a/src/pages/form/step-form/index.tsx +++ b/src/pages/form/step-form/index.tsx @@ -25,28 +25,23 @@ const StepDescriptions: React.FC<{ bordered?: boolean; }> = ({ stepData, bordered }) => { const { payAccount, receiverAccount, receiverName, amount } = stepData; - return ( - - {payAccount} - {receiverAccount} - {receiverName} - + const items = [ + { key: 'payAccount', label: '付款账户', children: payAccount }, + { key: 'receiverAccount', label: '收款账户', children: receiverAccount }, + { key: 'receiverName', label: '收款人姓名', children: receiverName }, + { + key: 'amount', + label: '转账金额', + children: ( - 元 - - } + suffix={元} precision={2} /> - - - ); + ), + }, + ]; + return ; }; const StepResult: React.FC<{ onFinish: () => Promise; @@ -191,7 +186,7 @@ const StepForm: React.FC> = () => { 12421 }, + { key: '5', label: '生效日期', children: '2017-07-07 ~ 2017-08-08' }, + { key: '6', label: '备注', children: '请于两个工作日内确认' }, +]; +const userInfoItems: DescriptionsProps['items'] = [ + { key: '1', label: '用户姓名', children: '付小小' }, + { key: '2', label: '会员卡号', children: '32943898021309809423' }, + { key: '3', label: '身份证', children: '3321944288191034921' }, + { key: '4', label: '联系方式', children: '18112345678' }, + { + key: '5', + label: '联系地址', + children: '曲丽丽 18100000000 浙江省杭州市西湖区黄姑山路工专路交叉路口', + }, +]; +const infoGroupItems: DescriptionsProps['items'] = [ + { key: '1', label: '某某数据', children: '725' }, + { key: '2', label: '该数据更新时间', children: '2017-08-08' }, + { + key: '3', + label: ( + + 某某数据 + + + + + ), + children: '725', + }, + { key: '4', label: '该数据更新时间', children: '2017-08-08' }, +]; +const groupItems1: DescriptionsProps['items'] = [ + { key: '1', label: '负责人', children: '林东东' }, + { key: '2', label: '角色码', children: '1234567' }, + { key: '3', label: '所属部门', children: 'XX公司 - YY部' }, + { key: '4', label: '过期时间', children: '2017-08-08' }, + { + key: '5', + label: '描述', + children: + '这段描述很长很长很长很长很长很长很长很长很长很长很长很长很长很长...', + }, +]; +const groupItems2: DescriptionsProps['items'] = [ + { + key: '1', + label: '学名', + children: + 'Citrullus lanatus (Thunb.) Matsum. et Nakai一年生蔓生藤本;茎、枝粗壮,具明显的棱。卷须较粗..', + }, +]; +const groupItems3: DescriptionsProps['items'] = [ + { key: '1', label: '负责人', children: '付小小' }, + { key: '2', label: '角色码', children: '1234568' }, +]; +const customDot: IconRenderType = (dot: React.ReactNode, { active }) => { + if (active) { + const popoverContent = ( +
+ 吴加号 + + + 未响应 + + } + /> + +
+ 耗时:2小时25分钟 +
+
+ ); + return ( + + {dot} + + ); + } + return dot; +}; + type AdvancedState = { operationKey: 'tab1' | 'tab2' | 'tab3'; tabActiveKey: string; @@ -165,25 +279,13 @@ const Advanced: FC = () => { className={styles.headerList} size="small" column={isMobile ? 1 : 2} - > - 曲丽丽 - XX 服务 - 2017-07-07 - - 12421 - - - 2017-07-07 ~ 2017-08-08 - - - 请于两个工作日内确认 - -
+ items={descriptionItems} + /> )} ); const desc1 = ( -
+
曲丽丽 {
); + const stepsItems: StepsProps['items'] = [ + { title: '创建项目', content: desc1 }, + { title: '部门初审', content: desc2 }, + { title: '财务复核' }, + { title: '完成' }, + ]; const [tabStatus, seTabStatus] = useState({ operationKey: 'tab1', tabActiveKey: 'detail', }); - const customDot = ( - dot: React.ReactNode, - { - status, - }: { - status: string; - }, - ) => { - const popoverContent = ( -
- 吴加号 - - - 未响应 - - } - /> - -
- 耗时:2小时25分钟 -
-
- ); - if (status === 'process') { - return ( - - {dot} - - ); - } - return dot; - }; - const { data = {}, isLoading: loading } = useQuery({ queryKey: ['profile-advanced'], queryFn: () => queryAdvancedProfile().then((res) => res.data), @@ -345,15 +395,10 @@ const Advanced: FC = () => { {({ isMobile }) => ( )} @@ -369,52 +414,15 @@ const Advanced: FC = () => { style={{ marginBottom: 24, }} - > - 付小小 - - 32943898021309809423 - - - 3321944288191034921 - - - 18112345678 - - - 曲丽丽 18100000000 浙江省杭州市西湖区黄姑山路工专路交叉路口 - - + items={userInfoItems} + /> - 725 - - 2017-08-08 - - - 某某数据 - - - - - } - > - 725 - - - 2017-08-08 - - + items={infoGroupItems} + />

{ 信息组

- - 林东东 - 1234567 - - XX公司 - YY部 - - - 2017-08-08 - - - 这段描述很长很长很长很长很长很长很长很长很长很长很长很长很长很长... - - - - - - Citrullus lanatus (Thunb.) Matsum. et - Nakai一年生蔓生藤本;茎、枝粗壮,具明显的棱。卷须较粗.. - - - - - 付小小 - 1234568 - + + + + + { }, stepDescription: { position: 'relative', - left: '38px', paddingTop: '8px', fontSize: '14px', textAlign: 'left', diff --git a/src/pages/profile/basic/index.tsx b/src/pages/profile/basic/index.tsx index ff3d4bde..687bf88e 100644 --- a/src/pages/profile/basic/index.tsx +++ b/src/pages/profile/basic/index.tsx @@ -1,28 +1,25 @@ import type { ProColumns } from '@ant-design/pro-components'; import { PageContainer, ProTable } from '@ant-design/pro-components'; import { useQuery } from '@tanstack/react-query'; -import { Badge, Card, Descriptions, Divider } from 'antd'; +import type { DescriptionsProps } from 'antd'; +import { Badge, Card, Descriptions, Divider, Table } from 'antd'; import type { FC } from 'react'; import React from 'react'; import type { BasicGood, BasicProgress } from './data.d'; import { queryBasicProfile } from './service'; -import useStyles from './style.style'; const progressColumns: ProColumns[] = [ { title: '时间', dataIndex: 'time', - key: 'time', }, { title: '当前进度', dataIndex: 'rate', - key: 'rate', }, { title: '状态', dataIndex: 'status', - key: 'status', render: (text: React.ReactNode) => { if (text === 'success') { return ; @@ -33,16 +30,92 @@ const progressColumns: ProColumns[] = [ { title: '操作员ID', dataIndex: 'operator', - key: 'operator', }, { title: '耗时', dataIndex: 'cost', - key: 'cost', }, ]; +const goodsColumns: ProColumns[] = [ + { + title: '商品编号', + dataIndex: 'id', + }, + { + title: '商品名称', + dataIndex: 'name', + }, + { + title: '商品条码', + dataIndex: 'barcode', + }, + { + title: '单价', + dataIndex: 'price', + }, + { + title: '数量(件)', + dataIndex: 'num', + align: 'right', + }, + { + title: '金额', + dataIndex: 'amount', + align: 'right', + }, +]; + +const Descriptions1: DescriptionsProps['items'] = [ + { + key: '1', + label: '取货单号', + children: '1000000000', + }, + { + key: '2', + label: '状态', + children: '已取货', + }, + { + key: '3', + label: '销售单号', + children: '1234123421', + }, + { + key: '4', + label: '子订单', + children: '3214321432', + }, +]; +const Descriptions2: DescriptionsProps['items'] = [ + { + key: '1', + label: '用户姓名', + children: '付小小', + }, + { + key: '2', + label: '联系电话', + children: '18100000000', + }, + { + key: '3', + label: '常用快递', + children: '菜鸟仓储', + }, + { + key: '4', + label: '取货地址', + children: '浙江省杭州市西湖区万塘路18号', + }, + { + key: '5', + label: '备注', + children: '无', + }, +]; + const Basic: FC = () => { - const { styles } = useStyles(); const { data, isLoading: loading } = useQuery({ queryKey: ['profile-basic'], queryFn: () => queryBasicProfile().then((res) => res.data), @@ -51,160 +124,15 @@ const Basic: FC = () => { basicGoods: [], basicProgress: [], }; - let goodsData: typeof basicGoods = []; - if (basicGoods.length) { - let num = 0; - let amount = 0; - basicGoods.forEach((item) => { - num += Number(item.num); - amount += Number(item.amount); - }); - goodsData = basicGoods.concat({ - id: '总计', - num, - amount, - }); - } - const renderContent = (value: any, _: any, index: any) => { - const obj: { - children: any; - props: { - colSpan?: number; - }; - } = { - children: value, - props: {}, - }; - if (index === basicGoods.length) { - obj.props.colSpan = 0; - } - return obj; - }; - const goodsColumns: ProColumns[] = [ - { - title: '商品编号', - dataIndex: 'id', - key: 'id', - render: (text: React.ReactNode, _: any, index: number) => { - if (index < basicGoods.length) { - return {text}; - } - return { - children: ( - - 总计 - - ), - props: { - colSpan: 4, - }, - }; - }, - }, - { - title: '商品名称', - dataIndex: 'name', - key: 'name', - render: renderContent, - }, - { - title: '商品条码', - dataIndex: 'barcode', - key: 'barcode', - render: renderContent, - }, - { - title: '单价', - dataIndex: 'price', - key: 'price', - align: 'right' as 'left' | 'right' | 'center', - render: renderContent, - }, - { - title: '数量(件)', - dataIndex: 'num', - key: 'num', - align: 'right' as 'left' | 'right' | 'center', - render: (text: React.ReactNode, _: any, index: number) => { - if (index < basicGoods.length) { - return text; - } - return ( - - {text} - - ); - }, - }, - { - title: '金额', - dataIndex: 'amount', - key: 'amount', - align: 'right' as 'left' | 'right' | 'center', - render: (text: React.ReactNode, _: any, index: number) => { - if (index < basicGoods.length) { - return text; - } - return ( - - {text} - - ); - }, - }, - ]; return ( - - 1000000000 - 已取货 - 1234123421 - 3214321432 - - - - 付小小 - 18100000000 - 菜鸟仓储 - - 浙江省杭州市西湖区万塘路18号 - - 无 - - -
退货商品
+ + + + { search={false} loading={loading} options={false} - toolBarRender={false} - dataSource={goodsData} + dataSource={basicGoods} + ghost columns={goodsColumns} rowKey="id" + summary={(pageData) => { + let totalNum = 0; + let totalAmount = 0; + pageData.forEach(({ num, amount }) => { + totalNum += Number(num); + totalAmount += Number(amount); + }); + return ( + + + 总计 + + + {totalNum} + + + {totalAmount} + + + ); + }} /> -
退货进度
diff --git a/src/pages/profile/basic/style.style.ts b/src/pages/profile/basic/style.style.ts deleted file mode 100644 index 154eb819..00000000 --- a/src/pages/profile/basic/style.style.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { createStyles } from 'antd-style'; - -const useStyles = createStyles(({ token }) => { - return { - title: { - marginBottom: '16px', - color: token.colorTextHeading, - fontWeight: '500', - fontSize: '16px', - }, - }; -}); - -export default useStyles; diff --git a/src/pages/result/success/index.tsx b/src/pages/result/success/index.tsx index ba1f00ce..6b6d779c 100644 --- a/src/pages/result/success/index.tsx +++ b/src/pages/result/success/index.tsx @@ -3,7 +3,13 @@ import { GridContent } from '@ant-design/pro-components'; import { Button, Card, Descriptions, Result, Steps } from 'antd'; import useStyles from './index.style'; -export default () => { +const descriptionItems = [ + { key: 'id', label: '项目 ID', children: '23421' }, + { key: 'owner', label: '负责人', children: '曲丽丽' }, + { key: 'time', label: '生效时间', children: '2016-12-12 ~ 2017-12-12' }, +]; + +const Success: React.FC = () => { const { styles } = useStyles(); const desc1 = (
@@ -50,16 +56,10 @@ export default () => { ); const content = ( <> - - 23421 - 曲丽丽 - - 2016-12-12 ~ 2017-12-12 - - +
{ 创建项目 ), - description: desc1, + content: desc1, }, { title: ( @@ -84,7 +84,7 @@ export default () => { 部门初审 ), - description: desc2, + content: desc2, }, { title: ( @@ -137,3 +137,5 @@ export default () => { ); }; + +export default Success;