Skip to content

Commit

Permalink
#514 子表组件设置过滤条件后没有在按钮上显示红圆点
Browse files Browse the repository at this point in the history
  • Loading branch information
yinlianghui committed Jan 8, 2025
1 parent c8f6f04 commit 8e6a433
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
filterService.setData({showFieldsFilter});
// resizeWindow();//已迁移到搜索栏表单提交事件中执行,因为表单项change后也会触发表单提交了
let isFieldsFilterEmpty = SteedosUI.isFilterFormValuesEmpty(filterFormValues);
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
crudService && crudService.setData({isFieldsFilterEmpty, showFieldsFilter});
`;
const onCancelScript = `
Expand Down Expand Up @@ -259,7 +259,7 @@ export async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
// 移除搜索按钮上的红点
// let crudService = scope.getComponentById("service_listview_" + event.data.objectName);
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
crudService && crudService.setData({isFieldsFilterEmpty: true, showFieldsFilter: false});
`;
const dataProviderInited = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ export async function getObjectCRUD(objectSchema, fields, options){
className: crudModeClassName,
//目前crud的service层id不认用户自定义id,只支持默认规则id,许多地方的格式都写死了service_listview_${objectname}
id: `service_${id}`,
name: `page`,
name: "service_object_table_crud",
data: options.amisData,
body: body,
//监听广播事件,重算crud高度
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
// console.log("==search=onChangeScript===");
const scope = event.context.scoped;
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
let __changedSearchBoxValues = {};
__changedSearchBoxValues["${keywordsSearchBoxName}"] = event.data["${keywordsSearchBoxName}"];
// crudService && crudService.setData({__changedSearchBoxValues: __changedSearchBoxValues});
Expand Down Expand Up @@ -475,10 +475,10 @@ export async function getObjectFilter(objectSchema, fields, options) {
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
let filterFormService = SteedosUI.getClosestAmisComponentByType(filterForm.context, "service");
// 使用event.data的话,并不能拿到本地存储中的过滤条件,所以需要从filterFormService中取。
let filterFormValues = filterFormService.getData()
let filterFormValues = filterFormService.getData();
let isFieldsFilterEmpty = SteedosUI.isFilterFormValuesEmpty(filterFormValues);
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
crudService && crudService.setData({isFieldsFilterEmpty});
`;
let onChangeScript = `
Expand All @@ -493,7 +493,7 @@ export async function getObjectFilter(objectSchema, fields, options) {
filterFormValues = JSON.parse(JSON.stringify(filterFormValues)); //只取当层数据域中数据,去除__super层数据
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
const changedFilterFormValues = _.pickBy(filterFormValues, function(n,k){return /^__searchable__/.test(k);});;
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
// crudService && crudService.setData({__changedFilterFormValues: changedFilterFormValues});
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
// crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
Expand Down

0 comments on commit 8e6a433

Please sign in to comment.