diff --git a/packages/@steedos-widgets/amis-lib/src/lib/converter/amis/fields_filter.js b/packages/@steedos-widgets/amis-lib/src/lib/converter/amis/fields_filter.js index 45f08d33..ba21aeb4 100644 --- a/packages/@steedos-widgets/amis-lib/src/lib/converter/amis/fields_filter.js +++ b/packages/@steedos-widgets/amis-lib/src/lib/converter/amis/fields_filter.js @@ -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 = ` @@ -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 = ` diff --git a/packages/@steedos-widgets/amis-lib/src/lib/converter/amis/index.js b/packages/@steedos-widgets/amis-lib/src/lib/converter/amis/index.js index 51a69201..5e35032a 100644 --- a/packages/@steedos-widgets/amis-lib/src/lib/converter/amis/index.js +++ b/packages/@steedos-widgets/amis-lib/src/lib/converter/amis/index.js @@ -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高度 diff --git a/packages/@steedos-widgets/amis-lib/src/lib/converter/amis/toolbar.js b/packages/@steedos-widgets/amis-lib/src/lib/converter/amis/toolbar.js index b6ef8f8d..2a416ab6 100644 --- a/packages/@steedos-widgets/amis-lib/src/lib/converter/amis/toolbar.js +++ b/packages/@steedos-widgets/amis-lib/src/lib/converter/amis/toolbar.js @@ -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}); @@ -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 = ` @@ -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});