diff --git a/src/components/Conditional.ts b/src/components/Conditional.ts new file mode 100644 index 0000000..400712f --- /dev/null +++ b/src/components/Conditional.ts @@ -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; +} \ No newline at end of file diff --git a/src/views/App.jsx b/src/views/App.jsx index edb6a46..a6af973 100644 --- a/src/views/App.jsx +++ b/src/views/App.jsx @@ -120,7 +120,7 @@ function App() { { return ( - - {text} + + {text} + options={[ + { + label: '潜力', + value: '潜力', + }, + { + label: '重点', + value: '重点', + }, + { + label: '休眠', + value: '休眠', + }, + ]} + /> ) } @@ -108,15 +112,23 @@ const columns = [ title: '客人姓名', dataIndex: 'fullname', key: 'fullname', + render: (text, record, index) => { + return ( + + {text} + + ) + } }, { title: '订单状态', dataIndex: 'orderStatus', key: 'orderStatus', + width: 120, render: (text, record, inde) => { return ( + + + + + + + + + + + + + + ) + } + return ( @@ -189,15 +281,16 @@ function OrderFollow() { { label: '走团后一月', value: 'lastMonth' }, { label: '高级查询', value: 'advance' } ]} - value={'today'} - onChange={({ target: { value } }) => { - setSearchType(value) + value={taskCategory} + onChange={({ target: { value } }) => { + setTaskCategory(value) }} optionType='button' buttonStyle='solid' /> + } />