@steedos-widgets/amis-object 6.3.12-beta.13 → 6.3.12-beta.15
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/amis-object.cjs.js +66 -22
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.js +66 -22
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.js +16 -27
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +21 -21
- package/dist/meta.js +6 -0
- package/package.json +3 -3
package/dist/amis-object.cjs.js
CHANGED
|
@@ -5067,7 +5067,6 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
5067
5067
|
{
|
|
5068
5068
|
actionType: "custom",
|
|
5069
5069
|
script: `
|
|
5070
|
-
console.log("asdasd");
|
|
5071
5070
|
let items = _.cloneDeep(event.data.items);
|
|
5072
5071
|
let selectedItems = _.cloneDeep(event.data.selectedItems);
|
|
5073
5072
|
if(event.data.isBatchEdit){
|
|
@@ -6608,6 +6607,11 @@ async function getTableApi(mainObject, fields, options){
|
|
|
6608
6607
|
}, 600);
|
|
6609
6608
|
}
|
|
6610
6609
|
}
|
|
6610
|
+
|
|
6611
|
+
// 列表搜索和快速搜索,有时在某些操作情况下还是会造成crud接口请求使用的过滤条件是上次的,这里强制把正确的过滤条件返回到crud,详细规则见:https://github.com/steedos/steedos-platform/issues/7112
|
|
6612
|
+
// lookup字段的弹出列表搜索不受这里影响,因为lookup字段的弹出列表搜索是单独的接口请求
|
|
6613
|
+
payload.data.__changedFilterFormValues = api.context.__changedFilterFormValues;
|
|
6614
|
+
payload.data.__changedSearchBoxValues = api.context.__changedSearchBoxValues;
|
|
6611
6615
|
${options.adaptor || ''}
|
|
6612
6616
|
return payload;
|
|
6613
6617
|
`;
|
|
@@ -9339,6 +9343,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
9339
9343
|
if (!ctx) {
|
|
9340
9344
|
ctx = {};
|
|
9341
9345
|
}
|
|
9346
|
+
const searchableFields = ctx.searchable_fields;
|
|
9347
|
+
const autoOpenFilter = !!ctx.auto_open_filter;
|
|
9342
9348
|
const btnSearchId = "btn_filter_form_search_" + new Date().getTime();
|
|
9343
9349
|
const filterFormSchema = await getObjectFieldsFilterFormSchema(ctx);
|
|
9344
9350
|
const keywordsSearchBoxName = ctx.keywordsSearchBoxName || "__keywords";
|
|
@@ -9352,6 +9358,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
9352
9358
|
});
|
|
9353
9359
|
// 使用filterForm.getValues()的话,并不能拿到本地存储中的过滤条件,所以需要从event.data中取,因为本地存储中的过滤条件自动填充到表单上时filterForm.getValues()拿不到。
|
|
9354
9360
|
let filterFormValues = event.data;
|
|
9361
|
+
filterFormValues = JSON.parse(JSON.stringify(filterFormValues)); //只取当层数据域中数据,去除__super层数据
|
|
9362
|
+
const changedFilterFormValues = _.pickBy(filterFormValues, function(n,k){return /^__searchable__/.test(k);});
|
|
9355
9363
|
// 同步__changedFilterFormValues中的值
|
|
9356
9364
|
// crud && crud.setData({__changedFilterFormValues: {}});
|
|
9357
9365
|
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
@@ -9364,7 +9372,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
9364
9372
|
}
|
|
9365
9373
|
if(crud){
|
|
9366
9374
|
let crudData = crud.getData();
|
|
9367
|
-
crudData[__changedFilterFormValuesKey] =
|
|
9375
|
+
crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
|
|
9368
9376
|
crud.setData(crudData);
|
|
9369
9377
|
}
|
|
9370
9378
|
filterForm.handleFormSubmit(event);
|
|
@@ -9506,6 +9514,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
9506
9514
|
crudService && crudService.setData({isFieldsFilterEmpty: true, showFieldsFilter: false});
|
|
9507
9515
|
`;
|
|
9508
9516
|
const dataProviderInited = `
|
|
9517
|
+
const searchableFields = ${JSON.stringify(searchableFields)};
|
|
9518
|
+
const autoOpenFilter = ${autoOpenFilter};
|
|
9509
9519
|
const objectName = data.objectName;
|
|
9510
9520
|
const isLookup = data.isLookup;
|
|
9511
9521
|
const listName = data.listName;
|
|
@@ -9518,6 +9528,11 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
9518
9528
|
if(defaultSearchableFields){
|
|
9519
9529
|
defaultSearchableFields = defaultSearchableFields.split(",");
|
|
9520
9530
|
}
|
|
9531
|
+
if(_.isEmpty(defaultSearchableFields) && searchableFields){
|
|
9532
|
+
if(searchableFields.length){
|
|
9533
|
+
defaultSearchableFields = _.map(searchableFields, 'field');
|
|
9534
|
+
}
|
|
9535
|
+
}
|
|
9521
9536
|
if(_.isEmpty(defaultSearchableFields) && data.uiSchema){
|
|
9522
9537
|
let listView = data.uiSchema.list_views[data.listName];
|
|
9523
9538
|
const sFields = listView && listView.searchable_fields;
|
|
@@ -9536,7 +9551,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
9536
9551
|
setData({ filterFormSearchableFields: defaultSearchableFields });
|
|
9537
9552
|
if(isLookup){
|
|
9538
9553
|
// looup字段过滤器不在本地缓存记住过滤条件,所以初始始终隐藏过滤器
|
|
9539
|
-
setData({ showFieldsFilter:
|
|
9554
|
+
setData({ showFieldsFilter: autoOpenFilter });
|
|
9540
9555
|
}
|
|
9541
9556
|
else{
|
|
9542
9557
|
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
@@ -12127,7 +12142,6 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
12127
12142
|
}
|
|
12128
12143
|
|
|
12129
12144
|
const onChangeScript = `
|
|
12130
|
-
// console.log("==search=onChangeScript===");
|
|
12131
12145
|
const scope = event.context.scoped;
|
|
12132
12146
|
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
12133
12147
|
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
|
|
@@ -12498,8 +12512,26 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
12498
12512
|
let filterFormService = SteedosUI.getClosestAmisComponentByType(filterForm.context, "service");
|
|
12499
12513
|
// 使用event.data的话,并不能拿到本地存储中的过滤条件,所以需要从filterFormService中取。
|
|
12500
12514
|
let filterFormValues = filterFormService.getData();
|
|
12515
|
+
filterFormValues = JSON.parse(JSON.stringify(filterFormValues)); //只取当层数据域中数据,去除__super层数据
|
|
12501
12516
|
let isFieldsFilterEmpty = SteedosUI.isFilterFormValuesEmpty(filterFormValues);
|
|
12502
12517
|
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
12518
|
+
const changedFilterFormValues = _.pickBy(filterFormValues, function(n,k){return /^__searchable__/.test(k);});
|
|
12519
|
+
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
12520
|
+
// crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
12521
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
12522
|
+
if(isLookup && __lookupField){
|
|
12523
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
12524
|
+
if(__lookupField.reference_to_field){
|
|
12525
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
12526
|
+
}
|
|
12527
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
12528
|
+
}
|
|
12529
|
+
if(crud){
|
|
12530
|
+
let crudData = crud.getData();
|
|
12531
|
+
crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
|
|
12532
|
+
crud.setData(crudData);
|
|
12533
|
+
}
|
|
12534
|
+
|
|
12503
12535
|
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
|
|
12504
12536
|
crudService && crudService.setData({isFieldsFilterEmpty});
|
|
12505
12537
|
`;
|
|
@@ -15080,6 +15112,9 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
15080
15112
|
ctx.idFieldName = refObjectConfig.idFieldName;
|
|
15081
15113
|
ctx.objectName = refObjectConfig.name;
|
|
15082
15114
|
|
|
15115
|
+
// 是否显示lookup字段左侧的过滤器(如果有的话),默认为true,目前只有lookup选人字段有左侧树过滤器
|
|
15116
|
+
const showLeftFilter = field.show_left_filter !== false;
|
|
15117
|
+
|
|
15083
15118
|
let tableFields = [];
|
|
15084
15119
|
const searchableFields = [];
|
|
15085
15120
|
|
|
@@ -15411,6 +15446,20 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
15411
15446
|
});
|
|
15412
15447
|
payload.data.rows = updatedResult;
|
|
15413
15448
|
}
|
|
15449
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
15450
|
+
let __lookupField = api.data.$self.__lookupField;
|
|
15451
|
+
if(__lookupField){
|
|
15452
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
15453
|
+
if(__lookupField.reference_to_field){
|
|
15454
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
15455
|
+
}
|
|
15456
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
15457
|
+
}
|
|
15458
|
+
let __changedFilterFormValues = api.context[__changedFilterFormValuesKey] || {};
|
|
15459
|
+
let __changedSearchBoxValues = api.context.__changedSearchBoxValues || {};
|
|
15460
|
+
// 列表搜索和快速搜索,有时在某些操作情况下还是会造成crud接口请求使用的过滤条件是上次的,这里强制把正确的过滤条件返回到crud,详细规则见:https://github.com/steedos/steedos-platform/issues/7112
|
|
15461
|
+
payload.data[__changedFilterFormValuesKey] = __changedFilterFormValues;
|
|
15462
|
+
payload.data.__changedSearchBoxValues = __changedSearchBoxValues;
|
|
15414
15463
|
return payload;
|
|
15415
15464
|
`;
|
|
15416
15465
|
if(field.optionsFunction || field._optionsFunction){
|
|
@@ -15446,7 +15495,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
15446
15495
|
|
|
15447
15496
|
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, fieldsArr, ctx.formFactor, { isLookup: true, keywordsSearchBoxName });
|
|
15448
15497
|
|
|
15449
|
-
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user"){
|
|
15498
|
+
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user" && showLeftFilter){
|
|
15450
15499
|
pickerSchema.headerToolbar.push(getLookupSapceUserTreeSchema(isMobile));
|
|
15451
15500
|
pickerSchema.className = pickerSchema.className || "" + " steedos-select-user";
|
|
15452
15501
|
}
|
|
@@ -15466,7 +15515,10 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
15466
15515
|
pickerSchema.filter = await getObjectFilter(refObjectConfig, fields, {
|
|
15467
15516
|
...ctx,
|
|
15468
15517
|
isLookup: true,
|
|
15469
|
-
keywordsSearchBoxName
|
|
15518
|
+
keywordsSearchBoxName,
|
|
15519
|
+
searchable_fields: field.searchable_fields,
|
|
15520
|
+
auto_open_filter: field.auto_open_filter,
|
|
15521
|
+
show_left_filter: field.show_left_filter
|
|
15470
15522
|
});
|
|
15471
15523
|
}
|
|
15472
15524
|
pickerSchema.data = Object.assign({}, pickerSchema.data, {
|
|
@@ -27987,6 +28039,7 @@ function generateRandomString(length) {
|
|
|
27987
28039
|
// 通用函数生成器
|
|
27988
28040
|
var createFieldFunction = function (type) {
|
|
27989
28041
|
return function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28042
|
+
var schema;
|
|
27990
28043
|
var _a;
|
|
27991
28044
|
return __generator(this, function (_b) {
|
|
27992
28045
|
switch (_b.label) {
|
|
@@ -28049,22 +28102,13 @@ var createFieldFunction = function (type) {
|
|
|
28049
28102
|
};
|
|
28050
28103
|
}
|
|
28051
28104
|
}
|
|
28052
|
-
return [4 /*yield*/, AmisSteedosField(props)
|
|
28053
|
-
|
|
28054
|
-
|
|
28055
|
-
|
|
28056
|
-
|
|
28057
|
-
|
|
28058
|
-
|
|
28059
|
-
];
|
|
28060
|
-
case 1: return [2 /*return*/, _b.sent()
|
|
28061
|
-
// {
|
|
28062
|
-
// type: "steedos-field",
|
|
28063
|
-
// config: Object.assign({}, props.config || {}, {
|
|
28064
|
-
// type: type
|
|
28065
|
-
// })
|
|
28066
|
-
// };
|
|
28067
|
-
];
|
|
28105
|
+
return [4 /*yield*/, AmisSteedosField(props)];
|
|
28106
|
+
case 1:
|
|
28107
|
+
schema = _b.sent();
|
|
28108
|
+
if (_$1.has(props, '$$editor')) {
|
|
28109
|
+
delete schema.visibleOn;
|
|
28110
|
+
}
|
|
28111
|
+
return [2 /*return*/, schema];
|
|
28068
28112
|
}
|
|
28069
28113
|
});
|
|
28070
28114
|
}); };
|