From 1c8c3c956c64e6dbd83e1cabf4ba6bc66bf0beae Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 22 Jun 2025 11:14:58 +0800 Subject: [PATCH] =?UTF-8?q?review=EF=BC=9A=E3=80=90ANTD=E3=80=91=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/table-action/table-action.vue | 21 ++++++++++--------- .../effects/layouts/src/widgets/help/help.vue | 1 + .../tenant-dropdown/tenant-dropdown.vue | 1 + 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/apps/web-antd/src/components/table-action/table-action.vue b/apps/web-antd/src/components/table-action/table-action.vue index 88e47d356..93d30fbd9 100644 --- a/apps/web-antd/src/components/table-action/table-action.vue +++ b/apps/web-antd/src/components/table-action/table-action.vue @@ -41,11 +41,12 @@ const props = defineProps({ const { hasAccessByCodes } = useAccess(); -/** 缓存处理后的actions */ +/** 缓存处理后的 actions */ const processedActions = ref([]); const processedDropdownActions = ref([]); /** 用于比较的字符串化版本 */ +// TODO @xingyu:下面的拼写错误,需要修改 const actionsStringified = ref(''); const dropdownActionsStringified = ref(''); @@ -65,7 +66,7 @@ function isIfShow(action: ActionItem): boolean { return isIfShow; } -/** 处理actions的纯函数 */ +/** 处理 actions 的纯函数 */ function processActions(actions: ActionItem[]): any[] { return actions .filter((action: ActionItem) => { @@ -84,7 +85,7 @@ function processActions(actions: ActionItem[]): any[] { }); } -/** 处理下拉菜单actions的纯函数 */ +/** 处理下拉菜单 actions 的纯函数 */ function processDropdownActions( dropDownActions: ActionItem[], divider: boolean, @@ -108,7 +109,7 @@ function processDropdownActions( }); } -/** 监听actions变化并更新缓存 */ +/** 监听 actions 变化并更新缓存 */ watchEffect(() => { const rawActions = toRaw(props.actions) || []; const currentStringified = JSON.stringify( @@ -127,7 +128,7 @@ watchEffect(() => { } }); -/** 监听dropDownActions变化并更新缓存 */ +/** 监听 dropDownActions 变化并更新缓存 */ watchEffect(() => { const rawDropDownActions = toRaw(props.dropDownActions) || []; const currentStringified = JSON.stringify({ @@ -154,14 +155,14 @@ const getActions = computed(() => processedActions.value); const getDropdownList = computed(() => processedDropdownActions.value); -/** 缓存Space组件的size计算结果 */ +/** 缓存 Space 组件的 size 计算结果 */ const spaceSize = computed(() => { return unref(getActions)?.some((item: ActionItem) => item.type === 'link') ? 0 : 8; }); -/** 缓存PopConfirm属性 */ +/** 缓存 PopConfirm 属性 */ const popConfirmPropsMap = new Map(); function getPopConfirmProps(attrs: PopConfirm) { @@ -191,7 +192,7 @@ function getPopConfirmProps(attrs: PopConfirm) { return originAttrs; } -/** 缓存Button属性 */ +/** 缓存 Button 属性 */ const buttonPropsMap = new Map(); function getButtonProps(action: ActionItem) { @@ -217,7 +218,7 @@ function getButtonProps(action: ActionItem) { return res; } -/** 缓存Tooltip属性 */ +/** 缓存 Tooltip 属性 */ const tooltipPropsMap = new Map(); function getTooltipProps(tooltip: any | string) { @@ -243,7 +244,7 @@ function handleMenuClick(e: any) { } } -/** 生成稳定的key */ +/** 生成稳定的 key */ function getActionKey(action: ActionItem, index: number) { return `${action.label || ''}-${action.type || ''}-${index}`; } diff --git a/packages/effects/layouts/src/widgets/help/help.vue b/packages/effects/layouts/src/widgets/help/help.vue index ca3c79c8c..640da3453 100644 --- a/packages/effects/layouts/src/widgets/help/help.vue +++ b/packages/effects/layouts/src/widgets/help/help.vue @@ -29,6 +29,7 @@ const [Modal, modalApi] = useVbenModal({
+

项目地址: