From 70f5332839dd0716e492294c61fb6c6d15eea8a1 Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Fri, 5 Jul 2024 16:30:31 +0800 Subject: [PATCH 1/7] =?UTF-8?q?feat:=20=E7=99=BB=E9=99=86=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=A2=9E=E5=8A=A0=E7=89=88=E6=9C=AC=E5=8F=B7=EF=BC=9B?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=95=8C=E9=9D=A2=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/App.jsx | 1 - src/views/Login.jsx | 9 +++------ src/views/Standlone.jsx | 14 +++++--------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/views/App.jsx b/src/views/App.jsx index e31a19d..a9c4937 100644 --- a/src/views/App.jsx +++ b/src/views/App.jsx @@ -38,7 +38,6 @@ function App() { const noticeUnRead = useNoticeStore((state) => state.noticeUnRead) const href = useHref() const navigate = useNavigate() - const location = useLocation() // 除了路由 /p...以外都需要登陆系统 const needToLogin = href !== '/login' && isEmpty(loginToken) diff --git a/src/views/Login.jsx b/src/views/Login.jsx index 647a3fb..43119f5 100644 --- a/src/views/Login.jsx +++ b/src/views/Login.jsx @@ -40,14 +40,15 @@ function Login() { return (
), }, @@ -141,13 +141,13 @@ const Extras = ({ productId, onChange, ...props }) => { const columns = [ { title: t('products:Title'), dataIndex: ['info', 'title'], width: '16rem', }, - { - title: t('products:Offer'), - dataIndex: ['quotation', '0', 'value'], - width: '10rem', + // { + // title: t('products:Offer'), + // dataIndex: ['quotation', '0', 'value'], + // width: '10rem', - render: (_, { quotation }) => `${quotation[0].adult_cost} ${quotation[0].currency} / ${quotation[0].unit_name}`, // todo: 成人 儿童 - }, + // render: (_, { quotation }) => `${quotation[0].adult_cost} ${quotation[0].currency} / ${quotation[0].unit_name}`, + // }, // { title: t('products:Types'), dataIndex: 'age_type', width: '40%', }, { title: '', From 5baeb5162f7769e9affe2d989f815e3f931784a1 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Mon, 8 Jul 2024 11:27:06 +0800 Subject: [PATCH 4/7] style: primary, danger, muted --- src/hooks/useProductsSets.js | 4 ++-- tailwind.config.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hooks/useProductsSets.js b/src/hooks/useProductsSets.js index 888ad43..6f7fbe5 100644 --- a/src/hooks/useProductsSets.js +++ b/src/hooks/useProductsSets.js @@ -75,10 +75,10 @@ export const useProductsAuditStates = () => { useEffect(() => { const newData = [ - { key: '-1', value: '-1', label: t('products:auditState.New'), color: 'gray-500' }, + { key: '-1', value: '-1', label: t('products:auditState.New'), color: 'muted' }, { key: '0', value: '0', label: t('products:auditState.Pending'), color: '' }, { key: '2', value: '2', label: t('products:auditState.Approved'), color: 'primary' }, - { key: '3', value: '3', label: t('products:auditState.Rejected'), color: 'red-500' }, + { key: '3', value: '3', label: t('products:auditState.Rejected'), color: 'danger' }, { key: '1', value: '1', label: t('products:auditState.Published'), color: 'primary' }, // ELSE 未知 ]; diff --git a/tailwind.config.js b/tailwind.config.js index 9af3619..e4494b9 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -7,6 +7,8 @@ export default { colors: { ...colors, 'primary': '#00b96b', + 'danger': '#ef4444', + 'muted': '#6b7280', }, extend: {}, }, From b7d7c863199abdc79a63c36d356c2d2cbbdc7f8d Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Mon, 8 Jul 2024 16:55:53 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E6=90=9C=E7=B4=A2=E8=B4=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Account.js | 4 ++-- src/views/account/Management.jsx | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/stores/Account.js b/src/stores/Account.js index 47abc92..2b5e8d8 100644 --- a/src/stores/Account.js +++ b/src/stores/Account.js @@ -139,16 +139,16 @@ const useAccountStore = create((set, get) => ({ }, searchAccountByCriteria: async (formValues) => { - + const travel_agency_ids = formValues.agency.map((ele) => ele.key).join(',') const searchParams = { username: formValues.username, realname: formValues.realname, + travel_agency_ids: travel_agency_ids, lgc: 2 } const resultArray = await fetchAccountList(searchParams) - console.info(resultArray) const mapAccoutList = resultArray.map((r) => { return { accountId: r.wu_id, diff --git a/src/views/account/Management.jsx b/src/views/account/Management.jsx index bb00571..06e631b 100644 --- a/src/views/account/Management.jsx +++ b/src/views/account/Management.jsx @@ -324,12 +324,13 @@ function Management() { {t('account:accountList')} { handelAccountSearch() From 2a20ed0f14c57e5aa34e388f926cb3900e256dd0 Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Tue, 9 Jul 2024 09:41:05 +0800 Subject: [PATCH 6/7] =?UTF-8?q?feat:=20=E5=AF=BC=E8=88=AA=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BA=A7=E5=93=81=E7=AE=A1=E7=90=86=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Account.js | 7 +++++-- src/views/App.jsx | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/stores/Account.js b/src/stores/Account.js index 2b5e8d8..22c96ca 100644 --- a/src/stores/Account.js +++ b/src/stores/Account.js @@ -1,6 +1,6 @@ import { create } from 'zustand' import { fetchJSON, postForm } from '@/utils/request' -import { isEmpty } from '@/utils/commons' +import { isEmpty, isNotEmpty } from '@/utils/commons' import { HT_HOST } from "@/config" import { usingStorage } from '@/hooks/usingStorage' @@ -139,7 +139,10 @@ const useAccountStore = create((set, get) => ({ }, searchAccountByCriteria: async (formValues) => { - const travel_agency_ids = formValues.agency.map((ele) => ele.key).join(',') + let travel_agency_ids = null + if (isNotEmpty(formValues.agency)) { + travel_agency_ids = formValues.agency.map((ele) => ele.key).join(',') + } const searchParams = { username: formValues.username, realname: formValues.realname, diff --git a/src/views/App.jsx b/src/views/App.jsx index a9c4937..73abe43 100644 --- a/src/views/App.jsx +++ b/src/views/App.jsx @@ -17,7 +17,7 @@ import useAuthStore from '@/stores/Auth' import { useThemeContext } from '@/stores/ThemeContext' import { usingStorage } from '@/hooks/usingStorage' -import { PERM_ACCOUNT_MANAGEMENT, PERM_ROLE_NEW, PERM_OVERSEA, PERM_AIR_TICKET } from '@/config' +import { PERM_ACCOUNT_MANAGEMENT, PERM_ROLE_NEW, PERM_OVERSEA, PERM_AIR_TICKET, PERM_PRODUCTS_MANAGEMENT } from '@/config' const { Header, Content, Footer } = Layout; const { Title } = Typography; @@ -117,7 +117,7 @@ function App() { isPermitted(PERM_OVERSEA) ? { key: 'feedback', label: {t('menu.Feedback')} } : null, isPermitted(PERM_OVERSEA) ? { key: 'report', label: {t('menu.Report')} } : null, isPermitted(PERM_AIR_TICKET) ? { key: 'airticket', label: {t('menu.Airticket')} } : null, - { key: 'products', label: {t('menu.Products')} }, + isPermitted(PERM_PRODUCTS_MANAGEMENT) ? { key: 'products', label: {t('menu.Products')} } : null, { key: 'notice', label: ( From 395e2e44db1e55deb3f87a5b7ba4688e5c58173c Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Tue, 9 Jul 2024 14:43:38 +0800 Subject: [PATCH 7/7] =?UTF-8?q?feat:=20=E5=9B=A2=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E3=80=90=E6=9C=AA=E7=A1=AE=E8=AE=A4=E3=80=91?= =?UTF-8?q?=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/locales/en/group.json | 1 + public/locales/zh/group.json | 2 +- src/components/SearchForm.jsx | 10 +++++++++- src/stores/Reservation.js | 13 +++++++------ src/views/reservation/Newest.jsx | 3 ++- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/public/locales/en/group.json b/public/locales/en/group.json index 4286b80..2083c6e 100644 --- a/public/locales/en/group.json +++ b/public/locales/en/group.json @@ -1,6 +1,7 @@ { "ArrivalDate": "Arrival Date", "RefNo": "Reference number", + "unconfirmed": "Unconfirmed", "Pax": "Pax", "Status": "Status", "City": "City", diff --git a/public/locales/zh/group.json b/public/locales/zh/group.json index 2f25071..5b18f89 100644 --- a/public/locales/zh/group.json +++ b/public/locales/zh/group.json @@ -1,6 +1,7 @@ { "ArrivalDate": "抵达日期", "RefNo": "团号", + "unconfirmed": "未确认", "Pax": "人数", "Status": "状态", "City": "城市", @@ -11,6 +12,5 @@ "ConfirmationDate": "确认日期", "ConfirmationDetails": "确认信息", "PNR": "旅客订座记录", - "#": "#" } diff --git a/src/components/SearchForm.jsx b/src/components/SearchForm.jsx index 1dcafe2..153677d 100644 --- a/src/components/SearchForm.jsx +++ b/src/components/SearchForm.jsx @@ -1,5 +1,5 @@ import { useEffect } from 'react'; -import { Form, Input, Row, Col, Select, DatePicker, Space, Button } from 'antd'; +import { Form, Input, Row, Col, Select, DatePicker, Space, Button, Checkbox } from 'antd'; import { objectMapper, at } from '@/utils/commons'; import { DATE_FORMAT, SMALL_DATETIME_FORMAT } from '@/config'; import useFormStore from '@/stores/Form'; @@ -301,6 +301,14 @@ function getFields(props) { , fieldProps?.dept?.col || 6 ), + item( + 'unconfirmed', + 99, + + {t('group:unconfirmed')} + , + fieldProps?.unconfirmed?.col || 2 + ), ]; baseChildren = baseChildren .map((x) => { diff --git a/src/stores/Reservation.js b/src/stores/Reservation.js index 8990ae7..f777162 100644 --- a/src/stores/Reservation.js +++ b/src/stores/Reservation.js @@ -91,17 +91,18 @@ const useReservationStore = create((set, get) => ({ })) }, - fetchReservationList: (formVal, current=1) => { + fetchReservationList: (formValues, current=1) => { const { travelAgencyId } = usingStorage() const { reservationPage } = get() // 设置为 0,后端会重新计算总数,当跳转第 X 页时可用原来的总数。 - const totalNum = current == 1 ? 0 : reservationPage.total; + const totalNum = current == 1 ? 0 : reservationPage.total + const notConfirmValue = formValues.notConfirm ? 1 : 0 const fetchUrl = prepareUrl(HT_HOST + '/service-cusservice/GetPlanSearchList') .append('VEI_SN', travelAgencyId) - .append('GroupNo', formVal.referenceNo) - .append('DateStart', formVal.startdate) - .append('DateEnd', formVal.enddate) - .append('NotConfirm', '')//status)// Todo: 待解决 + .append('GroupNo', formValues.referenceNo) + .append('DateStart', formValues.startdate) + .append('DateEnd', formValues.enddate) + .append('NotConfirm', notConfirmValue) .append('TotalNum', totalNum) .append('PageSize', reservationPage.size) .append('PageIndex', current) diff --git a/src/views/reservation/Newest.jsx b/src/views/reservation/Newest.jsx index b2330ab..9a02816 100644 --- a/src/views/reservation/Newest.jsx +++ b/src/views/reservation/Newest.jsx @@ -201,8 +201,9 @@ function Newest() {