@steedos-widgets/amis-lib 6.3.12-beta.13 → 6.3.12-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +40 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +40 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +6 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1868,7 +1868,6 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
1868
1868
|
{
|
|
1869
1869
|
actionType: "custom",
|
|
1870
1870
|
script: `
|
|
1871
|
-
console.log("asdasd");
|
|
1872
1871
|
let items = _.cloneDeep(event.data.items);
|
|
1873
1872
|
let selectedItems = _.cloneDeep(event.data.selectedItems);
|
|
1874
1873
|
if(event.data.isBatchEdit){
|
|
@@ -3409,6 +3408,11 @@ async function getTableApi(mainObject, fields, options){
|
|
|
3409
3408
|
}, 600);
|
|
3410
3409
|
}
|
|
3411
3410
|
}
|
|
3411
|
+
|
|
3412
|
+
// 列表搜索和快速搜索,有时在某些操作情况下还是会造成crud接口请求使用的过滤条件是上次的,这里强制把正确的过滤条件返回到crud,详细规则见:https://github.com/steedos/steedos-platform/issues/7112
|
|
3413
|
+
// lookup字段的弹出列表搜索不受这里影响,因为lookup字段的弹出列表搜索是单独的接口请求
|
|
3414
|
+
payload.data.__changedFilterFormValues = api.context.__changedFilterFormValues;
|
|
3415
|
+
payload.data.__changedSearchBoxValues = api.context.__changedSearchBoxValues;
|
|
3412
3416
|
${options.adaptor || ''}
|
|
3413
3417
|
return payload;
|
|
3414
3418
|
`;
|
|
@@ -6153,6 +6157,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6153
6157
|
});
|
|
6154
6158
|
// 使用filterForm.getValues()的话,并不能拿到本地存储中的过滤条件,所以需要从event.data中取,因为本地存储中的过滤条件自动填充到表单上时filterForm.getValues()拿不到。
|
|
6155
6159
|
let filterFormValues = event.data;
|
|
6160
|
+
filterFormValues = JSON.parse(JSON.stringify(filterFormValues)); //只取当层数据域中数据,去除__super层数据
|
|
6161
|
+
const changedFilterFormValues = _.pickBy(filterFormValues, function(n,k){return /^__searchable__/.test(k);});
|
|
6156
6162
|
// 同步__changedFilterFormValues中的值
|
|
6157
6163
|
// crud && crud.setData({__changedFilterFormValues: {}});
|
|
6158
6164
|
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
@@ -6165,7 +6171,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6165
6171
|
}
|
|
6166
6172
|
if(crud){
|
|
6167
6173
|
let crudData = crud.getData();
|
|
6168
|
-
crudData[__changedFilterFormValuesKey] =
|
|
6174
|
+
crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
|
|
6169
6175
|
crud.setData(crudData);
|
|
6170
6176
|
}
|
|
6171
6177
|
filterForm.handleFormSubmit(event);
|
|
@@ -8928,7 +8934,6 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
8928
8934
|
}
|
|
8929
8935
|
|
|
8930
8936
|
const onChangeScript = `
|
|
8931
|
-
// console.log("==search=onChangeScript===");
|
|
8932
8937
|
const scope = event.context.scoped;
|
|
8933
8938
|
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
8934
8939
|
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
|
|
@@ -9299,8 +9304,26 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
9299
9304
|
let filterFormService = SteedosUI.getClosestAmisComponentByType(filterForm.context, "service");
|
|
9300
9305
|
// 使用event.data的话,并不能拿到本地存储中的过滤条件,所以需要从filterFormService中取。
|
|
9301
9306
|
let filterFormValues = filterFormService.getData();
|
|
9307
|
+
filterFormValues = JSON.parse(JSON.stringify(filterFormValues)); //只取当层数据域中数据,去除__super层数据
|
|
9302
9308
|
let isFieldsFilterEmpty = SteedosUI.isFilterFormValuesEmpty(filterFormValues);
|
|
9303
9309
|
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
9310
|
+
const changedFilterFormValues = _.pickBy(filterFormValues, function(n,k){return /^__searchable__/.test(k);});
|
|
9311
|
+
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
9312
|
+
// crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
9313
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
9314
|
+
if(isLookup && __lookupField){
|
|
9315
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
9316
|
+
if(__lookupField.reference_to_field){
|
|
9317
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
9318
|
+
}
|
|
9319
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
9320
|
+
}
|
|
9321
|
+
if(crud){
|
|
9322
|
+
let crudData = crud.getData();
|
|
9323
|
+
crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
|
|
9324
|
+
crud.setData(crudData);
|
|
9325
|
+
}
|
|
9326
|
+
|
|
9304
9327
|
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
|
|
9305
9328
|
crudService && crudService.setData({isFieldsFilterEmpty});
|
|
9306
9329
|
`;
|
|
@@ -12212,6 +12235,20 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
12212
12235
|
});
|
|
12213
12236
|
payload.data.rows = updatedResult;
|
|
12214
12237
|
}
|
|
12238
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
12239
|
+
let __lookupField = api.data.$self.__lookupField;
|
|
12240
|
+
if(__lookupField){
|
|
12241
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
12242
|
+
if(__lookupField.reference_to_field){
|
|
12243
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
12244
|
+
}
|
|
12245
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
12246
|
+
}
|
|
12247
|
+
let __changedFilterFormValues = api.context[__changedFilterFormValuesKey] || {};
|
|
12248
|
+
let __changedSearchBoxValues = api.context.__changedSearchBoxValues || {};
|
|
12249
|
+
// 列表搜索和快速搜索,有时在某些操作情况下还是会造成crud接口请求使用的过滤条件是上次的,这里强制把正确的过滤条件返回到crud,详细规则见:https://github.com/steedos/steedos-platform/issues/7112
|
|
12250
|
+
payload.data[__changedFilterFormValuesKey] = __changedFilterFormValues;
|
|
12251
|
+
payload.data.__changedSearchBoxValues = __changedSearchBoxValues;
|
|
12215
12252
|
return payload;
|
|
12216
12253
|
`;
|
|
12217
12254
|
if(field.optionsFunction || field._optionsFunction){
|