From bb641e7a4bdcfef037ca9493868cc250cb2da1e4 Mon Sep 17 00:00:00 2001 From: LiaoYijun Date: Tue, 2 Dec 2025 10:40:33 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E8=B0=83=E6=95=B4=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=92=8C=E4=BB=B7=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 --- doc/RBAC 权限.sql | 6 +- src/config.js | 2 +- src/main.jsx | 8 +- .../products/Detail/ProductInfoQuotation.jsx | 76 +++++++++++-------- 4 files changed, 51 insertions(+), 41 deletions(-) diff --git a/doc/RBAC 权限.sql b/doc/RBAC 权限.sql index 610fbdd..cd671f7 100644 --- a/doc/RBAC 权限.sql +++ b/doc/RBAC 权限.sql @@ -83,11 +83,11 @@ VALUES ('所有火车票功能', '/train-ticket/all', 'train-ticket') -- 价格管理 INSERT INTO [dbo].[auth_resource] ([res_name] ,[res_pattern], [res_category]) -VALUES ('管理产品', '/products/*', 'products') +VALUES ('管理产品(供应商列表)', '/products/*', 'products') INSERT INTO [dbo].[auth_resource] ([res_name] ,[res_pattern], [res_category]) VALUES ('新增产品', '/products/new', 'products') -INSERT INTO [dbo].[auth_resource] ([res_name] ,[res_pattern], [res_category]) -VALUES ('审核信息', '/products/info/audit', 'products') +-- INSERT INTO [dbo].[auth_resource] ([res_name] ,[res_pattern], [res_category]) +-- VALUES ('审核信息', '/products/info/audit', 'products') INSERT INTO [dbo].[auth_resource] ([res_name] ,[res_pattern], [res_category]) VALUES ('录入信息', '/products/info/put', 'products') INSERT INTO [dbo].[auth_resource] ([res_name] ,[res_pattern], [res_category]) diff --git a/src/config.js b/src/config.js index 602adb4..850676f 100644 --- a/src/config.js +++ b/src/config.js @@ -53,7 +53,7 @@ export const PERM_TRAIN_TICKET = '/train-ticket/all' // 价格管理 export const PERM_PRODUCTS_MANAGEMENT = '/products/*'; // 管理 export const PERM_PRODUCTS_NEW = '/products/new'; // 新增产品 -export const PERM_PRODUCTS_INFO_AUDIT = '/products/info/audit'; // 信息.审核 @deprecated +// export const PERM_PRODUCTS_INFO_AUDIT = '/products/info/audit'; // 信息.审核 @deprecated export const PERM_PRODUCTS_INFO_PUT = '/products/info/put'; // 信息.录入 export const PERM_PRODUCTS_OFFER_AUDIT = '/products/offer/audit'; // 价格.审核 export const PERM_PRODUCTS_OFFER_PUT = '/products/offer/put'; // 价格.录入 diff --git a/src/main.jsx b/src/main.jsx index cb90680..39596da 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -56,7 +56,7 @@ import PickYear from './views/products/PickYear' import { PERM_ACCOUNT_MANAGEMENT, PERM_ROLE_NEW, PERM_TRAIN_TICKET, PERM_AIR_TICKET, PERM_PRODUCTS_MANAGEMENT, PERM_PRODUCTS_OFFER_PUT, - PERM_RESERVATION_ALL, PERM_FEEDBACK_ALL, PERM_INVOICE_ALL, PERM_REPORT_ALL, PERM_REVIEW_ALL + PERM_RESERVATION_ALL, PERM_FEEDBACK_ALL, PERM_INVOICE_ALL, PERM_REPORT_ALL, PERM_REVIEW_ALL, PERM_PRODUCTS_INFO_PUT } from '@/config' import './i18n' @@ -107,10 +107,10 @@ const initRouter = async () => { // { path: "products",element: }, { path: "products/:travel_agency_id/:use_year/:audit_state/audit",element:}, - { path: "products/:travel_agency_id/:use_year/:audit_state/edit",element:}, + { path: "products/:travel_agency_id/:use_year/:audit_state/edit",element:}, { path: "products/audit",element:}, - { path: "products/edit",element:}, - { path: "products/pick-year",element: }, + { path: "products/edit",element:}, + { path: "products/pick-year",element: }, // ] }, diff --git a/src/views/products/Detail/ProductInfoQuotation.jsx b/src/views/products/Detail/ProductInfoQuotation.jsx index 9e12784..3a1017f 100644 --- a/src/views/products/Detail/ProductInfoQuotation.jsx +++ b/src/views/products/Detail/ProductInfoQuotation.jsx @@ -22,11 +22,13 @@ import { StarTwoTone, PlusOutlined, QuestionCircleOutlined, + PushpinTwoTone } from "@ant-design/icons"; import { useDatePresets } from "@/hooks/useDatePresets"; import dayjs from "dayjs"; import useProductsStore from "@/stores/Products/Index"; +import useAuthStore from '@/stores/Auth' import PriceCompactInput from "@/views/products/Detail/PriceCompactInput"; import { formatGroupSize } from "@/hooks/useProductsSets"; @@ -57,6 +59,10 @@ const generateDefinitionValue = (year) => ({ const ProductInfoQuotation = ({ editable, ...props }) => { const { onChange } = props; + + const [isPermitted, currentUser] = useAuthStore( + (state) => [state.isPermitted, state.currentUser]) + const { t } = useTranslation(); const [ @@ -280,43 +286,47 @@ const ProductInfoQuotation = ({ editable, ...props }) => { dataIndex: "operation", width: "10rem", render: (_, quotation) => { - return ( - - - } - title="请确认" - description="你要删除这条价格吗?" - onConfirm={() => { - deleteQuotation(quotation) - .then((res) => { - triggerChange(res); - }) - .catch((ex) => { - notification.error({ - message: "Notification", - description: ex.message, - placement: "top", - duration: 4, - }); - }); - }} - > + if (editable) { + return ( + - - - ); + } + title="请确认" + description="你要删除这条价格吗?" + onConfirm={() => { + deleteQuotation(quotation) + .then((res) => { + triggerChange(res); + }) + .catch((ex) => { + notification.error({ + message: "Notification", + description: ex.message, + placement: "top", + duration: 4, + }); + }); + }} + > + + + + ); + } else { + () + } }, }, ];