From c8d152f59584aa821ef95f56e570a128c58da800 Mon Sep 17 00:00:00 2001 From: mll Date: Wed, 25 Mar 2026 19:11:56 +0800 Subject: [PATCH] =?UTF-8?q?menuBtn=E7=9A=84=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LowDesign/src/LowTable/components/TableButton.vue | 9 ++++++++- src/components/LowDesign/src/LowTable/index.vue | 10 ++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/LowDesign/src/LowTable/components/TableButton.vue b/src/components/LowDesign/src/LowTable/components/TableButton.vue index fd9a16b..b992a24 100644 --- a/src/components/LowDesign/src/LowTable/components/TableButton.vue +++ b/src/components/LowDesign/src/LowTable/components/TableButton.vue @@ -86,6 +86,7 @@ const btnData = computed(() => { if (!btnObj[key].display) continue btn[key] = btnObj[key] } + return { [props.type]: btn } } else { const menuObj = cloneDeep(props.buttonObj.menu) @@ -95,11 +96,17 @@ const btnData = computed(() => { if (props.row && props.row[`$btn__${key}`] !== undefined) { menuObj[key].display = props.row[`$btn__${key}`] } + if(props.buttonObj.setConfig&&props.row){ + let data= props.buttonObj.setConfig(props.row) + Object.keys(data).forEach(key => { + menuObj[key]={ ...menuObj[key],...data[key]} + }) + } if (!menuObj[key].display) continue if (props.type == 'more' && Object.keys(menu).length >= (props.maxNum || 1)) { more[key] = menuObj[key] } else menu[key] = menuObj[key] - } + } return { menu, more } } }) diff --git a/src/components/LowDesign/src/LowTable/index.vue b/src/components/LowDesign/src/LowTable/index.vue index ae86ac5..ebf64e4 100644 --- a/src/components/LowDesign/src/LowTable/index.vue +++ b/src/components/LowDesign/src/LowTable/index.vue @@ -1903,6 +1903,16 @@ const initEnhanceUseFun = () => { if (!curConfig) enhanceErrorTip(`调用useFun.setPropConfig方法,未找到字段:${prop}`, '') else setDeepObject(curConfig, config) }, + /** + * 设置按钮配置 + * @param prop 数据绑定key + * @param config 需修改的配置,非覆盖,格式Object,支持深结构修改 例:'params.deep.deep' + */ + setMenuButtonConfig: (prop, config) => { + if(buttonObj.value){ + setDeepObject(buttonObj.value, config) + } + }, /** * 设置附表控件配置 * @param prop 数据绑定key