@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.umd.js
CHANGED
|
@@ -21270,6 +21270,7 @@
|
|
|
21270
21270
|
{
|
|
21271
21271
|
"actionType": "custom",
|
|
21272
21272
|
"script": `
|
|
21273
|
+
|
|
21273
21274
|
var _display = _.cloneDeep(event.data._display);
|
|
21274
21275
|
${displayField}
|
|
21275
21276
|
doAction({actionType: 'setValue', "args": {"value": {_display}},componentId: "${quickEditId}"});
|
|
@@ -21656,7 +21657,9 @@
|
|
|
21656
21657
|
if(!options.isLookup && !options.isInputTable){
|
|
21657
21658
|
//将_display放入crud的columns中,可以通过setvalue修改行内数据域的_display,而不影响上层items的_display,用于批量编辑
|
|
21658
21659
|
columns.push({name: '_display',type: 'static', width: 32, placeholder: "",id: "_display_${_index}", className: "hidden"});
|
|
21659
|
-
|
|
21660
|
+
if(!options.enable_tree){
|
|
21661
|
+
columns.push({name: '_index',type: 'text', width: 32, placeholder: ""});
|
|
21662
|
+
}
|
|
21660
21663
|
}
|
|
21661
21664
|
const allowEdit = options.permissions?.allowEdit && !options.isLookup && options.enable_inline_edit != false;
|
|
21662
21665
|
|
|
@@ -22717,6 +22720,8 @@
|
|
|
22717
22720
|
`;
|
|
22718
22721
|
const onCancelScript = `
|
|
22719
22722
|
// console.log("===onCancelScript=form==");
|
|
22723
|
+
let isLookup = event.data.isLookup;
|
|
22724
|
+
let __lookupField = event.data.__lookupField;
|
|
22720
22725
|
const scope = event.context.scoped;
|
|
22721
22726
|
var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
22722
22727
|
return n.props.type === "form";
|
|
@@ -22764,7 +22769,20 @@
|
|
|
22764
22769
|
// });
|
|
22765
22770
|
|
|
22766
22771
|
// 清除__changedFilterFormValues中的值
|
|
22767
|
-
crud && crud.setData({__changedFilterFormValues: {}});
|
|
22772
|
+
// crud && crud.setData({__changedFilterFormValues: {}});
|
|
22773
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
22774
|
+
if(isLookup && __lookupField){
|
|
22775
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
22776
|
+
if(__lookupField.reference_to_field){
|
|
22777
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
22778
|
+
}
|
|
22779
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
22780
|
+
}
|
|
22781
|
+
if(crud){
|
|
22782
|
+
let crudData = crud.getData();
|
|
22783
|
+
crudData[__changedFilterFormValuesKey] = {};
|
|
22784
|
+
crud.setData(crudData);
|
|
22785
|
+
}
|
|
22768
22786
|
filterForm.handleFormSubmit(event);
|
|
22769
22787
|
// crud.handleFilterSubmit(removedValues);
|
|
22770
22788
|
|
|
@@ -24231,7 +24249,12 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24231
24249
|
__changedSearchBoxValues["${keywordsSearchBoxName}"] = event.data["${keywordsSearchBoxName}"];
|
|
24232
24250
|
// crudService && crudService.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
24233
24251
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
24234
|
-
crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
24252
|
+
// crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
24253
|
+
if(crud){
|
|
24254
|
+
let crudData = crud.getData();
|
|
24255
|
+
crudData.__changedSearchBoxValues = __changedSearchBoxValues;
|
|
24256
|
+
crud.setData(crudData);
|
|
24257
|
+
}
|
|
24235
24258
|
`;
|
|
24236
24259
|
|
|
24237
24260
|
// onSearchScript中加上了onChangeScript中的脚本,是因为amis 3.2不能用change事件执行onChangeScript
|
|
@@ -24244,9 +24267,19 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24244
24267
|
// const scope = event.context.scoped;
|
|
24245
24268
|
// 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
|
|
24246
24269
|
// 点击取消按钮后继续在表单项中输入过滤条件且最后没有点击回车按键或点击表单项搜索按钮的话,在快速搜索中点击回车按钮提交搜索会所顶部搜索表单中的字段值清空
|
|
24270
|
+
let isLookup = event.data.isLookup;
|
|
24271
|
+
let __lookupField = event.data.__lookupField;
|
|
24272
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
24273
|
+
if(isLookup && __lookupField){
|
|
24274
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
24275
|
+
if(__lookupField.reference_to_field){
|
|
24276
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
24277
|
+
}
|
|
24278
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
24279
|
+
}
|
|
24247
24280
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
24248
24281
|
setTimeout(function(){
|
|
24249
|
-
filterForm.setValues(event.data
|
|
24282
|
+
filterForm.setValues(event.data[__changedFilterFormValuesKey]);
|
|
24250
24283
|
}, 500);
|
|
24251
24284
|
`;
|
|
24252
24285
|
|
|
@@ -24267,8 +24300,8 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24267
24300
|
"name": keywordsSearchBoxName,
|
|
24268
24301
|
"placeholder": "搜索此列表",
|
|
24269
24302
|
"value": crudKeywords,
|
|
24270
|
-
"clearable": true
|
|
24271
|
-
|
|
24303
|
+
// "clearable": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
|
|
24304
|
+
"clearAndSubmit": true,
|
|
24272
24305
|
"searchImediately": false,
|
|
24273
24306
|
"onEvent": {
|
|
24274
24307
|
"search": {
|
|
@@ -24548,6 +24581,9 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24548
24581
|
crudService && crudService.setData({isFieldsFilterEmpty});
|
|
24549
24582
|
`;
|
|
24550
24583
|
let onChangeScript = `
|
|
24584
|
+
let isLookup = event.data.isLookup;
|
|
24585
|
+
let __lookupField = event.data.__lookupField;
|
|
24586
|
+
console.log("==onChangeScript=isLookup===", isLookup);
|
|
24551
24587
|
const scope = event.context.scoped;
|
|
24552
24588
|
// let filterFormValues = event.data;
|
|
24553
24589
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
@@ -24559,7 +24595,20 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24559
24595
|
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
24560
24596
|
// crudService && crudService.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
24561
24597
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
24562
|
-
crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
24598
|
+
// crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
24599
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
24600
|
+
if(isLookup && __lookupField){
|
|
24601
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
24602
|
+
if(__lookupField.reference_to_field){
|
|
24603
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
24604
|
+
}
|
|
24605
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
24606
|
+
}
|
|
24607
|
+
if(crud){
|
|
24608
|
+
let crudData = crud.getData();
|
|
24609
|
+
crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
|
|
24610
|
+
crud.setData(crudData);
|
|
24611
|
+
}
|
|
24563
24612
|
`;
|
|
24564
24613
|
return {
|
|
24565
24614
|
"title": "",
|
|
@@ -25374,13 +25423,24 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25374
25423
|
let keywordsSearchBoxName = `__keywords_lookup__${field.name.replace(/\./g, "_")}__to__${refObjectConfig.name}`;
|
|
25375
25424
|
|
|
25376
25425
|
source.requestAdaptor = `
|
|
25377
|
-
let
|
|
25426
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
25427
|
+
let __lookupField = api.data.$self.__lookupField;
|
|
25428
|
+
if(__lookupField){
|
|
25429
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
25430
|
+
if(__lookupField.reference_to_field){
|
|
25431
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
25432
|
+
}
|
|
25433
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
25434
|
+
}
|
|
25435
|
+
let __changedFilterFormValues = api.data.$self[__changedFilterFormValuesKey] || {};
|
|
25378
25436
|
let __changedSearchBoxValues = api.data.$self.__changedSearchBoxValues || {};
|
|
25379
25437
|
// 把表单搜索和快速搜索中的change事件中记录的过滤条件也拼到$self中,是为解决触发搜索请求时,两边输入的过滤条件都带上,即:
|
|
25380
25438
|
// 有时在搜索表单中输入过滤条件事,忘记点击回车键或搜索按钮,而是进一步修改快速搜索框中的关键字点击其中回车键触发搜索
|
|
25381
25439
|
// 这种情况下,触发的搜索请求中没有带上搜索表单中输入的过滤条件。
|
|
25382
25440
|
// 反过来先在快速搜索框中输入过滤条件却不点击其中回车键触发搜索,而是到搜索表单中触发搜索请求也是一样的。
|
|
25383
|
-
|
|
25441
|
+
if(api.data.$self.op !== 'loadOptions'){
|
|
25442
|
+
Object.assign(api.data.$self, __changedSearchBoxValues, __changedFilterFormValues);
|
|
25443
|
+
}
|
|
25384
25444
|
const selfData = JSON.parse(JSON.stringify(api.data.$self));
|
|
25385
25445
|
var filters = [];
|
|
25386
25446
|
var pageSize = api.data.pageSize || 10;
|
|
@@ -25584,7 +25644,12 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25584
25644
|
"objectName": refObjectConfig.name,
|
|
25585
25645
|
"uiSchema": refObjectConfig,
|
|
25586
25646
|
"listName": listName,// 需要按视图取可搜索项
|
|
25587
|
-
"isLookup": true
|
|
25647
|
+
"isLookup": true,
|
|
25648
|
+
"__lookupField": {
|
|
25649
|
+
"name": field.name,
|
|
25650
|
+
"reference_to": refObjectConfig.name,
|
|
25651
|
+
"reference_to_field": field.reference_to_field
|
|
25652
|
+
}
|
|
25588
25653
|
});
|
|
25589
25654
|
|
|
25590
25655
|
if(!pickerSchema.onEvent){
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos-widgets/sortable",
|
|
3
|
-
"version": "1.3.22-beta.
|
|
3
|
+
"version": "1.3.22-beta.4",
|
|
4
4
|
"main": "dist/sortable.cjs.js",
|
|
5
5
|
"module": "dist/sortable.esm.js",
|
|
6
6
|
"unpkg": "dist/sortable.umd.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@dnd-kit/core": "^6.0.5",
|
|
47
47
|
"@dnd-kit/sortable": "^7.0.1",
|
|
48
|
-
"@steedos-widgets/amis-lib": "1.3.22-beta.
|
|
48
|
+
"@steedos-widgets/amis-lib": "1.3.22-beta.4"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "3b5853a3f3241b1b9cedae095223544b136f7aeb"
|
|
51
51
|
}
|