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;