From 47047ffeb080c3db2eb5912a436dd7cdbc72932f Mon Sep 17 00:00:00 2001 From: Lei OT Date: Tue, 29 Jul 2025 16:27:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BA=A7=E5=93=81=E5=AE=A1=E6=A0=B8:?= =?UTF-8?q?=20=E6=8B=92=E7=BB=9D=E7=9A=84=E4=BB=B7=E6=A0=BC:=20=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2`=E5=8E=9F=E4=BB=B7=E6=A0=BC`=E5=8D=B3`=E5=B7=B2?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E7=9A=84`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/products/Audit.jsx | 4 ++-- .../Detail/ProductQuotationLogPopover.jsx | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/views/products/Audit.jsx b/src/views/products/Audit.jsx index 0aa9f85..15988f2 100644 --- a/src/views/products/Audit.jsx +++ b/src/views/products/Audit.jsx @@ -102,7 +102,7 @@ const PriceTable = ({ productType, dataSource, refresh }) => { onCell: (r, index) => ({ rowSpan: r.rowSpan, }), render: (_, r) => { const showPublicBtn = null; // r.pendingQuotation ? : null; - const btn2 = r.pendingQuotation ? ( + const btn2 = r.showPublicBtn ? ( { lgc_details: c.lgc_details.reduce((rlgc, clgc) => ({...rlgc, [clgc.lgc]: clgc}), {}), rowSpan: i === 0 ? c.quotation.length : 0, rowSpanI: [ri, i], - pendingQuotation: c.quotation.findIndex(q2 => q2.audit_state_id===0) !== -1 , + showPublicBtn: c.quotation.some(q2 => [0, 3].includes(q2.audit_state_id)), })) ), [] diff --git a/src/views/products/Detail/ProductQuotationLogPopover.jsx b/src/views/products/Detail/ProductQuotationLogPopover.jsx index 8e24801..c1ed6be 100644 --- a/src/views/products/Detail/ProductQuotationLogPopover.jsx +++ b/src/views/products/Detail/ProductQuotationLogPopover.jsx @@ -147,14 +147,16 @@ const useLogMethod = (method) => { const { t } = useTranslation('products'); const methodMap = { 'history': { - title: t('versionHistory'), + title: '📑' + t('versionHistory'), + btnText: t('versionHistory'), fetchData: async (params) => { const data = await getPPLogAction(params); return data; }, }, 'published': { - title: t('versionPublished'), + title: '✅' + t('versionPublished'), + btnText: t('versionPublished'), fetchData: async (params) => { const { travel_agency_id, product_id, price_id, use_year } = params; const data = await getPPRunningAction({ travel_agency_id, product_id_list: product_id, use_year }); @@ -189,13 +191,17 @@ const ProductQuotationLogPopover = ({ method, triggerProps = {}, onOpenChange, . const [open, setOpen] = useState(false); const [logData, setLogData] = useState([]); - const { title, fetchData } = useLogMethod(method); + const { title, btnText: methodBtnText, fetchData } = useLogMethod(method); const tablePagination = useMemo(() => method === 'history' ? { pageSize: 5, position: ['bottomLeft']} : { pageSize: 10, position: ['bottomLeft']}, [method]); + + const [loading, setLoading] = useState(false); const getData = async () => { + setLoading(true); const data = await fetchData({ travel_agency_id, product_id, price_id, use_year }); setLogData(data); invokeOpenChange(true); + setLoading(false); }; const invokeOpenChange = (_open) => { @@ -226,7 +232,7 @@ const ProductQuotationLogPopover = ({ method, triggerProps = {}, onOpenChange, . } content={ <> - +
} trigger={['click']} @@ -236,7 +242,7 @@ const ProductQuotationLogPopover = ({ method, triggerProps = {}, onOpenChange, . invokeOpenChange(v); }}> );