From 0c91e886749b80913186bee51022d0617d7ab5a5 Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Wed, 12 Jun 2024 16:52:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E6=9D=83=E9=99=90?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E6=A0=B7=E5=BC=8F=EF=BC=9B=E5=88=A0=E9=99=A4?= =?UTF-8?q?=20Table=20Column=20Key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/account/Management.jsx | 57 ++++++++++++++++++-------------- src/views/reservation/Newest.jsx | 8 +---- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/views/account/Management.jsx b/src/views/account/Management.jsx index 6045a6b..32092c6 100644 --- a/src/views/account/Management.jsx +++ b/src/views/account/Management.jsx @@ -10,8 +10,6 @@ import SearchForm from '@/components/SearchForm' const { Title } = Typography -const { SHOW_PARENT } = TreeSelect - const permissionData = [ { title: '机票管理', @@ -77,47 +75,46 @@ function Management() { { title: t('account:username'), dataIndex: 'username', - key: 'account:username', + render: accountRender }, { title: t('account:realname'), dataIndex: 'realname', - key: 'account:realname', }, { title: t('account:email'), dataIndex: 'email', - key: 'account:email' }, { title: t('account:role'), dataIndex: 'role', - key: 'account:role' }, { title: t('account:lastLogin'), dataIndex: 'lastLogin', - key: 'account:lastLogin' }, { title: t('account:action'), - key: 'account:action', dataIndex: 'account:action', render: actionRender }, ] + function accountRender(text) { + return ( + + ) + } + function actionRender() { return ( - - - - + + + ) } - const onPermissionChange = (newValue) => { console.log('onChange ', newValue); setPermissionValue(newValue); @@ -128,6 +125,7 @@ function Management() { const [dataLoading, setDataLoading] = useState(false) const [accountList, setaccountList] = useState([ { + key: 1, username: 'bjyiran', realname: '怡小芳', email: 'xiaofang@yiran.com', @@ -135,6 +133,7 @@ function Management() { lastLogin: '2024-06-12 13:53' }, { + key: 2, username: 'int-robin', realname: 'Robin', email: 'robin@int.com', @@ -142,6 +141,7 @@ function Management() { lastLogin: '2024-06-12 13:53' }, { + key: 3, username: 'betty-wu', realname: '吴雪', email: 'betty@hainatravel.com', @@ -149,6 +149,7 @@ function Management() { lastLogin: '2024-06-12 13:53' }, { + key: 4, username: 'lancy', realname: '吴金倩', email: 'lancy@hainatravel.com', @@ -156,6 +157,7 @@ function Management() { lastLogin: '2024-06-12 13:53' }, { + key: 5, username: 'LYJ', realname: '廖一军', email: 'lyj@hainatravel.com', @@ -167,7 +169,7 @@ function Management() { const formValuesToSub = useFormStore((state) => state.formValuesToSub) const [form] = Form.useForm() - const [fetchAllGuideList, fetchReservationList, reservationList, reservationPage, cityList, selectReservation, getCityListByReservationId] = + const [fetchReservationList] = useReservationStore((state) => [state.fetchAllGuideList, state.fetchReservationList, state.reservationList, state.reservationPage, state.cityList, state.selectReservation, state.getCityListByReservationId]) @@ -221,11 +223,11 @@ function Management() { {t('account:management.newAccount')} @@ -233,11 +235,11 @@ function Management() { @@ -245,11 +247,11 @@ function Management() { @@ -287,11 +289,11 @@ function Management() { {t('account:management.newRole')} @@ -299,14 +301,19 @@ function Management() { { const after3Dayjs = dayjs().add(3, 'day'); const lastDayjs = dayjs().subtract(1, 'day'); @@ -31,28 +30,23 @@ function Newest() { { title: t('group:ArrivalDate'), dataIndex: 'arrivalDate', - key: 'Arrival date', render: (text, record) => (isEmpty(text) ? '' : dayjs(text).format('YYYY-MM-DD')), }, { title: t('group:Pax'), - key: 'Pax', dataIndex: 'pax' }, { title: t('group:Status'), - key: 'Status', dataIndex: 'status' }, { title: t('group:ResSendingDate'), - key: 'Reservation date', dataIndex: 'reservationDate', render: (text, record) => (isEmpty(text) ? '' : dayjs(text).format('YYYY-MM-DD')), }, { title: t('group:Guide'), - key: 'Guide', dataIndex: 'guide', render: guideRender }, @@ -82,7 +76,7 @@ function Newest() { style={{ width: 280, }} - bordered={false} + variant='borderless' allowClear placeholder='Select a guide' optionFilterProp='children'