Skip to content

Commit

Permalink
#514 子表组件放开headerToolbar时,始终显示headerToolbar,没有记录时只隐藏crud内部表格,不隐藏head…
Browse files Browse the repository at this point in the history
…erToolbar
  • Loading branch information
yinlianghui committed Jan 8, 2025
1 parent 552c530 commit ddf662b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/@steedos-widgets/amis-lib/src/lib/objectsRelated.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: [email protected]
* @Date: 2022-07-05 15:55:39
* @LastEditors: 殷亮辉 [email protected]
* @LastEditTime: 2025-01-07 20:20:50
* @LastEditTime: 2025-01-08 13:32:51
* @Description:
*/

Expand Down Expand Up @@ -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");
Expand Down
7 changes: 7 additions & 0 deletions packages/@steedos-widgets/amis-object/src/styles/object.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ddf662b

Please sign in to comment.