Merge remote-tracking branch 'origin/main' into dev/chat

dev/chat
Lei OT 1 year ago
commit 7bdd2a6eac

@ -0,0 +1,20 @@
import React, { ReactNode } from 'react'
export type ConditionalProps = {
/**
* the condition to test against
*/
condition: boolean
/**
* the component to render when condition is true
*/
whenTrue: ReactNode
/**
* the component to render when condition is false
*/
whenFalse: ReactNode
}
export function Conditional({ condition, whenFalse, whenTrue }: ConditionalProps) {
return condition ? whenTrue : whenFalse;
}

@ -120,7 +120,7 @@ function App() {
<ConfigProvider <ConfigProvider
theme={{ theme={{
token: { token: {
colorPrimary: '#645822', colorPrimary: '#1ba784',
borderRadius: 4 borderRadius: 4
}, },
algorithm: theme.defaultAlgorithm, algorithm: theme.defaultAlgorithm,

@ -1,12 +1,16 @@
import { useNavigate } from 'react-router-dom' import { useNavigate } from 'react-router-dom'
import { useRef, useEffect, useState } from 'react' import { useRef, useEffect, useState } from 'react'
import { observer } from 'mobx-react' import { observer } from 'mobx-react'
import { Row, Col, Divider, Table , Card, Button, Input, import {
Space, Segmented, Radio, Select, AutoComplete, Spin, Typography, Flex Row, Col, Divider, Table, Card, Button, Input,
Space, Segmented, Radio, Select, AutoComplete, Spin, Typography, Flex, DatePicker, List, Avatar
} from 'antd' } from 'antd'
import { import {
StarFilled, ZoomInOutlined, StarOutlined, BarsOutlined , AppstoreOutlined StarFilled, ZoomInOutlined, StarOutlined, BarsOutlined, AppstoreOutlined, SearchOutlined
} from '@ant-design/icons' } from '@ant-design/icons'
import { Conditional } from '@/components/Conditional'
const { RangePicker } = DatePicker;
const dataSource = [ const dataSource = [
{ {
@ -82,24 +86,24 @@ const columns = [
width: 300, width: 300,
render: (text, record, inde) => { render: (text, record, inde) => {
return ( return (
<Space size="middle"> <Space size='middle'>
<a>{text}</a> {text}
<Segmented <Segmented
options={[ options={[
{ {
label: '潜力', label: '潜力',
value: '潜力', value: '潜力',
}, },
{ {
label: '重点', label: '重点',
value: '重点', value: '重点',
}, },
{ {
label: '休眠', label: '休眠',
value: '休眠', value: '休眠',
}, },
]} ]}
/> />
</Space> </Space>
) )
} }
@ -108,15 +112,23 @@ const columns = [
title: '客人姓名', title: '客人姓名',
dataIndex: 'fullname', dataIndex: 'fullname',
key: 'fullname', key: 'fullname',
render: (text, record, index) => {
return (
<Space size='middle'>
<a>{text}</a>
</Space>
)
}
}, },
{ {
title: '订单状态', title: '订单状态',
dataIndex: 'orderStatus', dataIndex: 'orderStatus',
key: 'orderStatus', key: 'orderStatus',
width: 120,
render: (text, record, inde) => { render: (text, record, inde) => {
return ( return (
<Select <Select
defaultValue="新订单" defaultValue='新订单'
style={{ style={{
width: 100, width: 100,
}} }}
@ -170,10 +182,90 @@ const columns = [
]; ];
function OrderFollow() { function OrderFollow() {
const [taskCategory, setTaskCategory] = useState('today')
useEffect(() => { useEffect(() => {
}, []) }, [])
function AdvanceCriteria() {
return (
<Space direction='vertical' style={{ width: '100%' }}>
<Row gutter={[16, 16]} justify='start' align='middle'>
<Col span={2}>
<Select
defaultValue='全部'
style={{
width: 100,
}}
options={[
{
value: '潜力',
label: '潜力',
},
{
value: '重点',
label: '重点',
},
{
value: '休眠',
label: '休眠',
}
]}
/>
</Col>
<Col span={2}>
<Select
defaultValue='全部'
style={{
width: 100,
}}
options={[
{
value: '新订单',
label: '新订单',
},
{
value: '报价中',
label: '报价中',
},
{
value: '丢失',
label: '丢失',
},
{
value: '一催',
label: '一催',
},
{
value: '二催',
label: '二催',
},
{
value: '三催',
label: '三催',
},
]}
/>
</Col>
<Col span={6}>
<Input placeholder="订单号" allowClear />
</Col>
<Col span={4}>
<RangePicker />
</Col>
<Col span={2}>
<Button icon={<SearchOutlined />} onClick={() => {
search()
}}>搜索</Button>
</Col>
</Row>
</Space>
)
}
return ( return (
<Spin spinning={false} delay={500}> <Spin spinning={false} delay={500}>
<Space direction='vertical' style={{ width: '100%' }}> <Space direction='vertical' style={{ width: '100%' }}>
@ -189,15 +281,16 @@ function OrderFollow() {
{ label: '走团后一月', value: 'lastMonth' }, { label: '走团后一月', value: 'lastMonth' },
{ label: '高级查询', value: 'advance' } { label: '高级查询', value: 'advance' }
]} ]}
value={'today'} value={taskCategory}
onChange={({ target: { value } }) => { onChange={({ target: { value } }) => {
setSearchType(value) setTaskCategory(value)
}} }}
optionType='button' optionType='button'
buttonStyle='solid' buttonStyle='solid'
/> />
</Col> </Col>
</Row> </Row>
<Conditional condition={taskCategory==='advance'} whenTrue={<AdvanceCriteria />} />
</Space> </Space>
<Divider plain orientation='left'></Divider> <Divider plain orientation='left'></Divider>
<Space <Space

@ -97,7 +97,7 @@ function Standlone() {
<ConfigProvider <ConfigProvider
theme={{ theme={{
token: { token: {
colorPrimary: '#645822', colorPrimary: '#1ba784',
borderRadius: 4 borderRadius: 4
}, },
algorithm: theme.defaultAlgorithm, algorithm: theme.defaultAlgorithm,

Loading…
Cancel
Save