From ddf662bc17a8a1a52f7bac13020527443c1195ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B7=E4=BA=AE=E8=BE=89?= Date: Wed, 8 Jan 2025 13:49:57 +0800 Subject: [PATCH] =?UTF-8?q?=20#514=20=E5=AD=90=E8=A1=A8=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=94=BE=E5=BC=80headerToolbar=E6=97=B6=EF=BC=8C=E5=A7=8B?= =?UTF-8?q?=E7=BB=88=E6=98=BE=E7=A4=BAheaderToolbar=EF=BC=8C=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E8=AE=B0=E5=BD=95=E6=97=B6=E5=8F=AA=E9=9A=90=E8=97=8F?= =?UTF-8?q?crud=E5=86=85=E9=83=A8=E8=A1=A8=E6=A0=BC=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E9=9A=90=E8=97=8FheaderToolbar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../@steedos-widgets/amis-lib/src/lib/objectsRelated.js | 7 ++++--- .../@steedos-widgets/amis-object/src/styles/object.less | 7 +++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/@steedos-widgets/amis-lib/src/lib/objectsRelated.js b/packages/@steedos-widgets/amis-lib/src/lib/objectsRelated.js index 6e7a5dbb..8fd1a376 100644 --- a/packages/@steedos-widgets/amis-lib/src/lib/objectsRelated.js +++ b/packages/@steedos-widgets/amis-lib/src/lib/objectsRelated.js @@ -2,7 +2,7 @@ * @Author: baozhoutao@steedos.com * @Date: 2022-07-05 15:55:39 * @LastEditors: 殷亮辉 yinlianghui@hotoa.com - * @LastEditTime: 2025-01-07 20:20:50 + * @LastEditTime: 2025-01-08 13:32:51 * @Description: */ @@ -368,8 +368,9 @@ export async function getRelatedListSchema( try{ if(setDataToComponentId){ // 子表列表在headerToolbar过滤器中设置过过滤条件的话,始终显示子表列表,无论是否查询到数据 - var headerToolbarFilterChanged = context.isFieldsFilterEmpty === false; - if(payload.data.count || headerToolbarFilterChanged){ + // 改为使用css样式控制子表列表放开headerToolbar时,始终显示crud,只隐藏crud内部的表格,从而始终显示headerToolbar不受这里逻辑影响 + // var headerToolbarFilterChanged = context.isFieldsFilterEmpty === false; + if(payload.data.count){ setTimeout(function(){ // 设计器中获取不到window.$从而导致报错, 所以用纯js替换下。 // window.$("." + setDataToComponentId + " .antd-Crud").removeClass("hidden"); diff --git a/packages/@steedos-widgets/amis-object/src/styles/object.less b/packages/@steedos-widgets/amis-object/src/styles/object.less index 723b595d..ed28bcdc 100644 --- a/packages/@steedos-widgets/amis-object/src/styles/object.less +++ b/packages/@steedos-widgets/amis-object/src/styles/object.less @@ -22,9 +22,16 @@ display: none; } &.enable-header-toolbar{ + // 子表组件放开headerToolbar时,始终显示headerToolbar,没有记录时只隐藏crud内部表格,不隐藏headerToolbar .antd-Table-headToolbar{ display: block; } + .steedos-record-related-crud.hidden{ + display: block; + .antd-Table-contentWrap{ + display: none; + } + } } .antd-Images{ display: inline !important;