From c9d2f88b41cf6854147b57042e53e0b2c3cb63bd Mon Sep 17 00:00:00 2001 From: Lei OT Date: Tue, 2 Dec 2025 11:39:39 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BA=A7=E5=93=81=E7=AE=A1=E7=90=86:?= =?UTF-8?q?=20=E8=B0=83=E6=95=B4=E4=BF=A1=E6=81=AF=E5=92=8C=E4=BB=B7?= =?UTF-8?q?=E6=A0=BC=E7=BC=96=E8=BE=91=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/products/Detail/ProductInfo.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/views/products/Detail/ProductInfo.jsx b/src/views/products/Detail/ProductInfo.jsx index e108a27..33d234d 100644 --- a/src/views/products/Detail/ProductInfo.jsx +++ b/src/views/products/Detail/ProductInfo.jsx @@ -27,25 +27,25 @@ const ProductInfo = ({ ...props }) => { const [infoEditable, setInfoEditable] = useState(false); const [priceEditable, setPriceEditable] = useState(false); useEffect(() => { - const topPerm = isPermitted(PERM_PRODUCTS_MANAGEMENT); // 高级权限 + const isInternal = isPermitted(PERM_PRODUCTS_MANAGEMENT); // 公司内部才有权限: 管理产品 // topPerm const hasHT = (editingProduct?.info?.htid || 0) > 0; // const hasAuditPer = isPermitted(PERM_PRODUCTS_OFFER_AUDIT); const hasEditPer = isPermitted(PERM_PRODUCTS_INFO_PUT) || isPermitted(PERM_PRODUCTS_NEW); // || isPermitted(PERM_PRODUCTS_OFFER_PUT); - setEditablePerm(topPerm || hasEditPer); + setEditablePerm(hasEditPer); // topPerm || // setEditable(topPerm || (hasAuditPer ? true : (!hasHT && hasEditPer))); // setEditable(true); // debug: 0 // console.log('editable', hasAuditPer, (notAudit && hasEditPer)); - setInfoEditable(topPerm || (!hasHT && hasEditPer)); + setInfoEditable((isInternal && hasEditPer) || (!hasHT && hasEditPer)); const _priceEditable = [-1, 3].includes(activeAgency?.audit_state_id) || isEmpty(editingProduct?.info?.id); const hasPricePer = isPermitted(PERM_PRODUCTS_OFFER_PUT); // setPriceEditable(topPerm || (_priceEditable && hasPricePer)); - setPriceEditable(topPerm || (hasPricePer)); + setPriceEditable((hasPricePer)); // topPerm || // setPriceEditable(true); // debug: 0 - const showExtras = topPerm && hasHT; // !isEmpty(editingProduct) && + const showExtras = isInternal && hasHT; // !isEmpty(editingProduct) && setExtrasVisible(showExtras); setLgcEdits({});