@steedos-widgets/sortable 1.3.22-beta.2 → 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 +75 -10
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +75 -10
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +75 -10
- package/package.json +3 -3
package/dist/sortable.esm.js
CHANGED
|
@@ -54965,6 +54965,7 @@ async function getQuickEditSchema(field, options){
|
|
|
54965
54965
|
{
|
|
54966
54966
|
"actionType": "custom",
|
|
54967
54967
|
"script": `
|
|
54968
|
+
|
|
54968
54969
|
var _display = _.cloneDeep(event.data._display);
|
|
54969
54970
|
${displayField}
|
|
54970
54971
|
doAction({actionType: 'setValue', "args": {"value": {_display}},componentId: "${quickEditId}"});
|
|
@@ -55351,7 +55352,9 @@ async function getTableColumns(fields, options){
|
|
|
55351
55352
|
if(!options.isLookup && !options.isInputTable){
|
|
55352
55353
|
//将_display放入crud的columns中,可以通过setvalue修改行内数据域的_display,而不影响上层items的_display,用于批量编辑
|
|
55353
55354
|
columns.push({name: '_display',type: 'static', width: 32, placeholder: "",id: "_display_${_index}", className: "hidden"});
|
|
55354
|
-
|
|
55355
|
+
if(!options.enable_tree){
|
|
55356
|
+
columns.push({name: '_index',type: 'text', width: 32, placeholder: ""});
|
|
55357
|
+
}
|
|
55355
55358
|
}
|
|
55356
55359
|
const allowEdit = options.permissions?.allowEdit && !options.isLookup && options.enable_inline_edit != false;
|
|
55357
55360
|
|
|
@@ -56412,6 +56415,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
56412
56415
|
`;
|
|
56413
56416
|
const onCancelScript = `
|
|
56414
56417
|
// console.log("===onCancelScript=form==");
|
|
56418
|
+
let isLookup = event.data.isLookup;
|
|
56419
|
+
let __lookupField = event.data.__lookupField;
|
|
56415
56420
|
const scope = event.context.scoped;
|
|
56416
56421
|
var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
56417
56422
|
return n.props.type === "form";
|
|
@@ -56459,7 +56464,20 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
56459
56464
|
// });
|
|
56460
56465
|
|
|
56461
56466
|
// 清除__changedFilterFormValues中的值
|
|
56462
|
-
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
|
+
}
|
|
56463
56481
|
filterForm.handleFormSubmit(event);
|
|
56464
56482
|
// crud.handleFilterSubmit(removedValues);
|
|
56465
56483
|
|
|
@@ -57926,7 +57944,12 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57926
57944
|
__changedSearchBoxValues["${keywordsSearchBoxName}"] = event.data["${keywordsSearchBoxName}"];
|
|
57927
57945
|
// crudService && crudService.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
57928
57946
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
57929
|
-
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
|
+
}
|
|
57930
57953
|
`;
|
|
57931
57954
|
|
|
57932
57955
|
// onSearchScript中加上了onChangeScript中的脚本,是因为amis 3.2不能用change事件执行onChangeScript
|
|
@@ -57939,9 +57962,19 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57939
57962
|
// const scope = event.context.scoped;
|
|
57940
57963
|
// 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
|
|
57941
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
|
+
}
|
|
57942
57975
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
57943
57976
|
setTimeout(function(){
|
|
57944
|
-
filterForm.setValues(event.data
|
|
57977
|
+
filterForm.setValues(event.data[__changedFilterFormValuesKey]);
|
|
57945
57978
|
}, 500);
|
|
57946
57979
|
`;
|
|
57947
57980
|
|
|
@@ -57962,8 +57995,8 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57962
57995
|
"name": keywordsSearchBoxName,
|
|
57963
57996
|
"placeholder": "搜索此列表",
|
|
57964
57997
|
"value": crudKeywords,
|
|
57965
|
-
"clearable": true
|
|
57966
|
-
|
|
57998
|
+
// "clearable": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
|
|
57999
|
+
"clearAndSubmit": true,
|
|
57967
58000
|
"searchImediately": false,
|
|
57968
58001
|
"onEvent": {
|
|
57969
58002
|
"search": {
|
|
@@ -58243,6 +58276,9 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58243
58276
|
crudService && crudService.setData({isFieldsFilterEmpty});
|
|
58244
58277
|
`;
|
|
58245
58278
|
let onChangeScript = `
|
|
58279
|
+
let isLookup = event.data.isLookup;
|
|
58280
|
+
let __lookupField = event.data.__lookupField;
|
|
58281
|
+
console.log("==onChangeScript=isLookup===", isLookup);
|
|
58246
58282
|
const scope = event.context.scoped;
|
|
58247
58283
|
// let filterFormValues = event.data;
|
|
58248
58284
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
@@ -58254,7 +58290,20 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58254
58290
|
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
58255
58291
|
// crudService && crudService.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
58256
58292
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
58257
|
-
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
|
+
}
|
|
58258
58307
|
`;
|
|
58259
58308
|
return {
|
|
58260
58309
|
"title": "",
|
|
@@ -59069,13 +59118,24 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59069
59118
|
let keywordsSearchBoxName = `__keywords_lookup__${field.name.replace(/\./g, "_")}__to__${refObjectConfig.name}`;
|
|
59070
59119
|
|
|
59071
59120
|
source.requestAdaptor = `
|
|
59072
|
-
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] || {};
|
|
59073
59131
|
let __changedSearchBoxValues = api.data.$self.__changedSearchBoxValues || {};
|
|
59074
59132
|
// 把表单搜索和快速搜索中的change事件中记录的过滤条件也拼到$self中,是为解决触发搜索请求时,两边输入的过滤条件都带上,即:
|
|
59075
59133
|
// 有时在搜索表单中输入过滤条件事,忘记点击回车键或搜索按钮,而是进一步修改快速搜索框中的关键字点击其中回车键触发搜索
|
|
59076
59134
|
// 这种情况下,触发的搜索请求中没有带上搜索表单中输入的过滤条件。
|
|
59077
59135
|
// 反过来先在快速搜索框中输入过滤条件却不点击其中回车键触发搜索,而是到搜索表单中触发搜索请求也是一样的。
|
|
59078
|
-
|
|
59136
|
+
if(api.data.$self.op !== 'loadOptions'){
|
|
59137
|
+
Object.assign(api.data.$self, __changedSearchBoxValues, __changedFilterFormValues);
|
|
59138
|
+
}
|
|
59079
59139
|
const selfData = JSON.parse(JSON.stringify(api.data.$self));
|
|
59080
59140
|
var filters = [];
|
|
59081
59141
|
var pageSize = api.data.pageSize || 10;
|
|
@@ -59279,7 +59339,12 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59279
59339
|
"objectName": refObjectConfig.name,
|
|
59280
59340
|
"uiSchema": refObjectConfig,
|
|
59281
59341
|
"listName": listName,// 需要按视图取可搜索项
|
|
59282
|
-
"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
|
+
}
|
|
59283
59348
|
});
|
|
59284
59349
|
|
|
59285
59350
|
if(!pickerSchema.onEvent){
|