From cd8b52bdf89a4d1101f72e0ece9f4df22a3d3f7a Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 15 十月 2026 16:03:32 +0800
Subject: [PATCH] feat(mdm): 物料列表隐藏辅单位与销售价列
---
src/components/table-action/table-action.vue | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/components/table-action/table-action.vue b/src/components/table-action/table-action.vue
index 78220f5..e968d87 100644
--- a/src/components/table-action/table-action.vue
+++ b/src/components/table-action/table-action.vue
@@ -20,6 +20,9 @@
Tooltip,
} from 'ant-design-vue';
+import { automaticApproval } from '#/store/audit-policy';
+import { auditActionMode } from '#/utils/audit-ui-policy';
+
const props = defineProps({
actions: {
type: Array as PropType<ActionItem[]>,
@@ -43,6 +46,7 @@
/** 妫�鏌ユ槸鍚︽樉绀� */
function isIfShow(action: ActionItem): boolean {
+ if (auditActionMode(action.label, automaticApproval.value) === 'hidden') return false;
const ifShow = action.ifShow;
let isIfShow = true;
if (isBoolean(ifShow)) {
@@ -61,15 +65,21 @@
/** 澶勭悊鎸夐挳 actions */
const getActions = computed(() => {
const actions = props.actions || [];
- return actions.filter((action: ActionItem) => isIfShow(action));
+ return actions.filter((action: ActionItem) => isIfShow(action)).map(displayAction);
});
/** 澶勭悊涓嬫媺鑿滃崟 actions */
const getDropdownList = computed(() => {
const dropDownActions = props.dropDownActions || [];
- return dropDownActions.filter((action: ActionItem) => isIfShow(action));
+ return dropDownActions.filter((action: ActionItem) => isIfShow(action)).map(displayAction);
});
+function displayAction(action: ActionItem): ActionItem {
+ return auditActionMode(action.label, automaticApproval.value) === 'activate'
+ ? { ...action, label: '鐢熸晥', tooltip: '鎻愪氦鍚庤嚜鍔ㄧ敓鏁�' }
+ : action;
+}
+
/** Space 缁勪欢鐨� size */
const spaceSize = computed(() => {
const actions = unref(getActions);
--
Gitblit v1.9.3