@steedos-widgets/sortable 1.3.22-beta.3 → 1.3.22-beta.4
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/assets.json +5 -5
- package/dist/sortable.cjs.js +71 -9
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +71 -9
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +71 -9
- package/package.json +3 -3
package/dist/sortable.esm.js
CHANGED
|
@@ -56415,6 +56415,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
56415
56415
|
`;
|
|
56416
56416
|
const onCancelScript = `
|
|
56417
56417
|
// console.log("===onCancelScript=form==");
|
|
56418
|
+
let isLookup = event.data.isLookup;
|
|
56419
|
+
let __lookupField = event.data.__lookupField;
|
|
56418
56420
|
const scope = event.context.scoped;
|
|
56419
56421
|
var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
56420
56422
|
return n.props.type === "form";
|
|
@@ -56462,7 +56464,20 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
56462
56464
|
// });
|
|
56463
56465
|
|
|
56464
56466
|
// 清除__changedFilterFormValues中的值
|
|
56465
|
-
crud && crud.setData({__changedFilterFormValues: {}});
|
|
56467
|
+
// crud && crud.setData({__changedFilterFormValues: {}});
|
|
56468
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
56469
|
+
if(isLookup && __lookupField){
|
|
56470
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
56471
|
+
if(__lookupField.reference_to_field){
|
|
56472
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
56473
|
+
}
|
|
56474
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
56475
|
+
}
|
|
56476
|
+
if(crud){
|
|
56477
|
+
let crudData = crud.getData();
|
|
56478
|
+
crudData[__changedFilterFormValuesKey] = {};
|
|
56479
|
+
crud.setData(crudData);
|
|
56480
|
+
}
|
|
56466
56481
|
filterForm.handleFormSubmit(event);
|
|
56467
56482
|
// crud.handleFilterSubmit(removedValues);
|
|
56468
56483
|
|
|
@@ -57929,7 +57944,12 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57929
57944
|
__changedSearchBoxValues["${keywordsSearchBoxName}"] = event.data["${keywordsSearchBoxName}"];
|
|
57930
57945
|
// crudService && crudService.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
57931
57946
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
57932
|
-
crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
57947
|
+
// crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
57948
|
+
if(crud){
|
|
57949
|
+
let crudData = crud.getData();
|
|
57950
|
+
crudData.__changedSearchBoxValues = __changedSearchBoxValues;
|
|
57951
|
+
crud.setData(crudData);
|
|
57952
|
+
}
|
|
57933
57953
|
`;
|
|
57934
57954
|
|
|
57935
57955
|
// onSearchScript中加上了onChangeScript中的脚本,是因为amis 3.2不能用change事件执行onChangeScript
|
|
@@ -57942,9 +57962,19 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57942
57962
|
// const scope = event.context.scoped;
|
|
57943
57963
|
// 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
|
|
57944
57964
|
// 点击取消按钮后继续在表单项中输入过滤条件且最后没有点击回车按键或点击表单项搜索按钮的话,在快速搜索中点击回车按钮提交搜索会所顶部搜索表单中的字段值清空
|
|
57965
|
+
let isLookup = event.data.isLookup;
|
|
57966
|
+
let __lookupField = event.data.__lookupField;
|
|
57967
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
57968
|
+
if(isLookup && __lookupField){
|
|
57969
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
57970
|
+
if(__lookupField.reference_to_field){
|
|
57971
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
57972
|
+
}
|
|
57973
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
57974
|
+
}
|
|
57945
57975
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
57946
57976
|
setTimeout(function(){
|
|
57947
|
-
filterForm.setValues(event.data
|
|
57977
|
+
filterForm.setValues(event.data[__changedFilterFormValuesKey]);
|
|
57948
57978
|
}, 500);
|
|
57949
57979
|
`;
|
|
57950
57980
|
|
|
@@ -57965,8 +57995,8 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57965
57995
|
"name": keywordsSearchBoxName,
|
|
57966
57996
|
"placeholder": "搜索此列表",
|
|
57967
57997
|
"value": crudKeywords,
|
|
57968
|
-
"clearable": true
|
|
57969
|
-
|
|
57998
|
+
// "clearable": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
|
|
57999
|
+
"clearAndSubmit": true,
|
|
57970
58000
|
"searchImediately": false,
|
|
57971
58001
|
"onEvent": {
|
|
57972
58002
|
"search": {
|
|
@@ -58246,6 +58276,9 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58246
58276
|
crudService && crudService.setData({isFieldsFilterEmpty});
|
|
58247
58277
|
`;
|
|
58248
58278
|
let onChangeScript = `
|
|
58279
|
+
let isLookup = event.data.isLookup;
|
|
58280
|
+
let __lookupField = event.data.__lookupField;
|
|
58281
|
+
console.log("==onChangeScript=isLookup===", isLookup);
|
|
58249
58282
|
const scope = event.context.scoped;
|
|
58250
58283
|
// let filterFormValues = event.data;
|
|
58251
58284
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
@@ -58257,7 +58290,20 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58257
58290
|
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
58258
58291
|
// crudService && crudService.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
58259
58292
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
58260
|
-
crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
58293
|
+
// crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
58294
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
58295
|
+
if(isLookup && __lookupField){
|
|
58296
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
58297
|
+
if(__lookupField.reference_to_field){
|
|
58298
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
58299
|
+
}
|
|
58300
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
58301
|
+
}
|
|
58302
|
+
if(crud){
|
|
58303
|
+
let crudData = crud.getData();
|
|
58304
|
+
crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
|
|
58305
|
+
crud.setData(crudData);
|
|
58306
|
+
}
|
|
58261
58307
|
`;
|
|
58262
58308
|
return {
|
|
58263
58309
|
"title": "",
|
|
@@ -59072,13 +59118,24 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59072
59118
|
let keywordsSearchBoxName = `__keywords_lookup__${field.name.replace(/\./g, "_")}__to__${refObjectConfig.name}`;
|
|
59073
59119
|
|
|
59074
59120
|
source.requestAdaptor = `
|
|
59075
|
-
let
|
|
59121
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
59122
|
+
let __lookupField = api.data.$self.__lookupField;
|
|
59123
|
+
if(__lookupField){
|
|
59124
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
59125
|
+
if(__lookupField.reference_to_field){
|
|
59126
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
59127
|
+
}
|
|
59128
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
59129
|
+
}
|
|
59130
|
+
let __changedFilterFormValues = api.data.$self[__changedFilterFormValuesKey] || {};
|
|
59076
59131
|
let __changedSearchBoxValues = api.data.$self.__changedSearchBoxValues || {};
|
|
59077
59132
|
// 把表单搜索和快速搜索中的change事件中记录的过滤条件也拼到$self中,是为解决触发搜索请求时,两边输入的过滤条件都带上,即:
|
|
59078
59133
|
// 有时在搜索表单中输入过滤条件事,忘记点击回车键或搜索按钮,而是进一步修改快速搜索框中的关键字点击其中回车键触发搜索
|
|
59079
59134
|
// 这种情况下,触发的搜索请求中没有带上搜索表单中输入的过滤条件。
|
|
59080
59135
|
// 反过来先在快速搜索框中输入过滤条件却不点击其中回车键触发搜索,而是到搜索表单中触发搜索请求也是一样的。
|
|
59081
|
-
|
|
59136
|
+
if(api.data.$self.op !== 'loadOptions'){
|
|
59137
|
+
Object.assign(api.data.$self, __changedSearchBoxValues, __changedFilterFormValues);
|
|
59138
|
+
}
|
|
59082
59139
|
const selfData = JSON.parse(JSON.stringify(api.data.$self));
|
|
59083
59140
|
var filters = [];
|
|
59084
59141
|
var pageSize = api.data.pageSize || 10;
|
|
@@ -59282,7 +59339,12 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59282
59339
|
"objectName": refObjectConfig.name,
|
|
59283
59340
|
"uiSchema": refObjectConfig,
|
|
59284
59341
|
"listName": listName,// 需要按视图取可搜索项
|
|
59285
|
-
"isLookup": true
|
|
59342
|
+
"isLookup": true,
|
|
59343
|
+
"__lookupField": {
|
|
59344
|
+
"name": field.name,
|
|
59345
|
+
"reference_to": refObjectConfig.name,
|
|
59346
|
+
"reference_to_field": field.reference_to_field
|
|
59347
|
+
}
|
|
59286
59348
|
});
|
|
59287
59349
|
|
|
59288
59350
|
if(!pickerSchema.onEvent){
|