From a113d48e5154c7d9676ff9bbd71b874bd3d03b62 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Mon, 4 Aug 2025 16:42:20 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BA=A7=E5=93=81=E5=AE=A1=E6=A0=B8:?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E/=E4=BF=AE=E6=94=B9=E4=B8=AD,=20=E4=B9=9F?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=8E=86=E5=8F=B2=E5=92=8C=E4=B8=8A=E6=AC=A1?= =?UTF-8?q?=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/products/Audit.jsx | 2 +- .../Detail/ProductQuotationLogPopover.jsx | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/views/products/Audit.jsx b/src/views/products/Audit.jsx index a55db7e..3df9410 100644 --- a/src/views/products/Audit.jsx +++ b/src/views/products/Audit.jsx @@ -108,7 +108,7 @@ const PriceTable = ({ productType, dataSource, refresh }) => { title: '', key: 'action', render: (_, r, ri) => - [0, 3].includes(Number(r.audit_state_id)) ? ( + [-1, 0, 3].includes(Number(r.audit_state_id)) ? ( {Number(r.audit_state_id) === 0 && ( diff --git a/src/views/products/Detail/ProductQuotationLogPopover.jsx b/src/views/products/Detail/ProductQuotationLogPopover.jsx index 155ea8c..36d5573 100644 --- a/src/views/products/Detail/ProductQuotationLogPopover.jsx +++ b/src/views/products/Detail/ProductQuotationLogPopover.jsx @@ -35,6 +35,7 @@ const parseJson = (str) => { } }; +const statesForHideEdited = [1, 2]; export const columnsSets = (t, colorize = true) => [ { key: 'adult', @@ -42,7 +43,7 @@ export const columnsSets = (t, colorize = true) => [ width: '12rem', render: (_, { adult_cost, currency, unit_id, unit_name, audit_state_id, lastedit_changed }) => { const _changed = parseJson(lastedit_changed); - const ifCompare = colorize && ![-1, 1, 2].includes(audit_state_id); + const ifCompare = colorize && !statesForHideEdited.includes(audit_state_id); const ifData = isNotEmpty(_changed.adult_cost) || isNotEmpty(_changed.unit_id) || isNotEmpty(_changed.currency); const preValue = ifCompare && ifData ? ( @@ -63,7 +64,7 @@ export const columnsSets = (t, colorize = true) => [ width: '12rem', render: (_, { child_cost, currency, unit_id, unit_name, audit_state_id, lastedit_changed }) => { const _changed = parseJson(lastedit_changed); - const ifCompare = colorize && ![-1, 1, 2].includes(audit_state_id); + const ifCompare = colorize && !statesForHideEdited.includes(audit_state_id); const ifData = isNotEmpty(_changed.child_cost) || isNotEmpty(_changed.unit_id) || isNotEmpty(_changed.currency); const preValue = ifCompare && ifData ? ( @@ -87,10 +88,10 @@ export const columnsSets = (t, colorize = true) => [ render: (_, { audit_state_id, group_size_min, group_size_max, lastedit_changed }) => { const _changed = parseJson(lastedit_changed); const preValue = - colorize && ![-1, 1, 2].includes(audit_state_id) && (isNotEmpty(_changed.group_size_min) || isNotEmpty(_changed.group_size_max)) ? ( + colorize && !statesForHideEdited.includes(audit_state_id) && (isNotEmpty(_changed.group_size_min) || isNotEmpty(_changed.group_size_max)) ? (
{`${_changed.group_size_min ?? group_size_min} - ${_changed.group_size_max ?? group_size_max}`}
) : null; - const editCls = colorize && ![-1, 1, 2].includes(audit_state_id) && (isNotEmpty(_changed.group_size_min) || isNotEmpty(_changed.group_size_max)) ? 'text-danger' : ''; + const editCls = colorize && !statesForHideEdited.includes(audit_state_id) && (isNotEmpty(_changed.group_size_min) || isNotEmpty(_changed.group_size_max)) ? 'text-danger' : ''; return (
{preValue} @@ -107,13 +108,13 @@ export const columnsSets = (t, colorize = true) => [ render: (_, { use_dates_start, use_dates_end, weekdays, audit_state_id, lastedit_changed }) => { const _changed = parseJson(lastedit_changed); const preValue = - colorize && ![-1, 1, 2].includes(audit_state_id) && (isNotEmpty(_changed.use_dates_start) || isNotEmpty(_changed.use_dates_end)) ? ( + colorize && !statesForHideEdited.includes(audit_state_id) && (isNotEmpty(_changed.use_dates_start) || isNotEmpty(_changed.use_dates_end)) ? (
{isNotEmpty(_changed.use_dates_start) ? {_changed.use_dates_start} : use_dates_start} ~{' '} {isNotEmpty(_changed.use_dates_end) ? {_changed.use_dates_end} : use_dates_end}
) : null; - const editCls = colorize && ![-1, 1, 2].includes(audit_state_id) && (isNotEmpty(_changed.use_dates_start) || isNotEmpty(_changed.use_dates_end)) ? 'text-danger' : ''; + const editCls = colorize && !statesForHideEdited.includes(audit_state_id) && (isNotEmpty(_changed.use_dates_start) || isNotEmpty(_changed.use_dates_end)) ? 'text-danger' : ''; return (
{preValue} @@ -129,7 +130,7 @@ export const columnsSets = (t, colorize = true) => [ width: '6rem', render: (text, { weekdays, audit_state_id, lastedit_changed }) => { const _changed = parseJson(lastedit_changed); - const ifCompare = colorize && ![-1, 1, 2].includes(audit_state_id); + const ifCompare = colorize && !statesForHideEdited.includes(audit_state_id); const ifData = !isEmpty((_changed.weekdayList || []).filter((s) => s)); const preValue = ifCompare && ifData ?
{_changed.weekdayList}
: null; const editCls = ifCompare && ifData ? 'text-danger' : '';