@steedos-widgets/sortable 3.6.0-beta.4 → 3.6.0-beta.6
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 +146 -20
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +146 -20
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +146 -20
- package/package.json +3 -3
package/dist/sortable.umd.js
CHANGED
|
@@ -20421,7 +20421,7 @@
|
|
|
20421
20421
|
if(ctx && ctx.isLookup){
|
|
20422
20422
|
linkTarget = "target='_blank'";
|
|
20423
20423
|
}
|
|
20424
|
-
return `<a href="${href}" ${linkTarget}>\${${field.name}}</a>`
|
|
20424
|
+
return `<a href="${href}" ${linkTarget}>\${${field.name} | raw}</a>`
|
|
20425
20425
|
}
|
|
20426
20426
|
|
|
20427
20427
|
function getRelatedFieldTpl(field, ctx){
|
|
@@ -20746,7 +20746,7 @@
|
|
|
20746
20746
|
* @Author: baozhoutao@steedos.com
|
|
20747
20747
|
* @Date: 2022-10-28 14:15:09
|
|
20748
20748
|
* @LastEditors: liaodaxue
|
|
20749
|
-
* @LastEditTime: 2023-
|
|
20749
|
+
* @LastEditTime: 2023-12-29 10:46:50
|
|
20750
20750
|
* @Description:
|
|
20751
20751
|
*/
|
|
20752
20752
|
|
|
@@ -20800,7 +20800,8 @@
|
|
|
20800
20800
|
dataType: "form-data",
|
|
20801
20801
|
url: `\${context.rootUrl}/s3/${tableName}`,
|
|
20802
20802
|
requestAdaptor: `
|
|
20803
|
-
const
|
|
20803
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
20804
|
+
const { _master, global } = superData;
|
|
20804
20805
|
// const { recordId, objectName } = _master;
|
|
20805
20806
|
const { spaceId, userId, user } = global;
|
|
20806
20807
|
/*
|
|
@@ -20818,8 +20819,9 @@
|
|
|
20818
20819
|
return api;
|
|
20819
20820
|
`,
|
|
20820
20821
|
adaptor: `
|
|
20821
|
-
const
|
|
20822
|
-
|
|
20822
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
20823
|
+
const { context:pageContext } = superData;
|
|
20824
|
+
var rootUrl = pageContext.rootUrl + "/api/files/${tableName}/";
|
|
20823
20825
|
payload = {
|
|
20824
20826
|
status: response.status == 200 ? 0 : response.status,
|
|
20825
20827
|
msg: response.statusText,
|
|
@@ -21423,8 +21425,9 @@
|
|
|
21423
21425
|
case "avatar":
|
|
21424
21426
|
case "image":
|
|
21425
21427
|
quickEditSchema.body[0].receiver.adaptor = `
|
|
21426
|
-
const
|
|
21427
|
-
|
|
21428
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
21429
|
+
const { context:pageContext } = superData;
|
|
21430
|
+
var rootUrl = pageContext.rootUrl + "/api/files/${field.type}s/";
|
|
21428
21431
|
payload = {
|
|
21429
21432
|
status: response.status == 200 ? 0 : response.status,
|
|
21430
21433
|
msg: response.statusText,
|
|
@@ -22087,7 +22090,7 @@
|
|
|
22087
22090
|
type: 'steedos-object-button',
|
|
22088
22091
|
name: button.name,
|
|
22089
22092
|
objectName: button.objectName,
|
|
22090
|
-
|
|
22093
|
+
visibleOnAlias: getButtonVisibleOn$1(button),
|
|
22091
22094
|
className: 'antd-Button--default'
|
|
22092
22095
|
});
|
|
22093
22096
|
});
|
|
@@ -22212,7 +22215,8 @@
|
|
|
22212
22215
|
}
|
|
22213
22216
|
|
|
22214
22217
|
if(!isLookup && !hiddenColumnOperation){
|
|
22215
|
-
|
|
22218
|
+
const toolbarOperation = await getTableOperation(options);
|
|
22219
|
+
columns.push(toolbarOperation);
|
|
22216
22220
|
}
|
|
22217
22221
|
|
|
22218
22222
|
}
|
|
@@ -22734,6 +22738,8 @@
|
|
|
22734
22738
|
`;
|
|
22735
22739
|
const onCancelScript = `
|
|
22736
22740
|
// console.log("===onCancelScript=form==");
|
|
22741
|
+
let isLookup = event.data.isLookup;
|
|
22742
|
+
let __lookupField = event.data.__lookupField;
|
|
22737
22743
|
const scope = event.context.scoped;
|
|
22738
22744
|
var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
22739
22745
|
return n.props.type === "form";
|
|
@@ -22781,7 +22787,20 @@
|
|
|
22781
22787
|
// });
|
|
22782
22788
|
|
|
22783
22789
|
// 清除__changedFilterFormValues中的值
|
|
22784
|
-
crud && crud.setData({__changedFilterFormValues: {}});
|
|
22790
|
+
// crud && crud.setData({__changedFilterFormValues: {}});
|
|
22791
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
22792
|
+
if(isLookup && __lookupField){
|
|
22793
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
22794
|
+
if(__lookupField.reference_to_field){
|
|
22795
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
22796
|
+
}
|
|
22797
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
22798
|
+
}
|
|
22799
|
+
if(crud){
|
|
22800
|
+
let crudData = crud.getData();
|
|
22801
|
+
crudData[__changedFilterFormValuesKey] = {};
|
|
22802
|
+
crud.setData(crudData);
|
|
22803
|
+
}
|
|
22785
22804
|
filterForm.handleFormSubmit(event);
|
|
22786
22805
|
// crud.handleFilterSubmit(removedValues);
|
|
22787
22806
|
|
|
@@ -24248,7 +24267,12 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24248
24267
|
__changedSearchBoxValues["${keywordsSearchBoxName}"] = event.data["${keywordsSearchBoxName}"];
|
|
24249
24268
|
// crudService && crudService.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
24250
24269
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
24251
|
-
crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
24270
|
+
// crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
24271
|
+
if(crud){
|
|
24272
|
+
let crudData = crud.getData();
|
|
24273
|
+
crudData.__changedSearchBoxValues = __changedSearchBoxValues;
|
|
24274
|
+
crud.setData(crudData);
|
|
24275
|
+
}
|
|
24252
24276
|
`;
|
|
24253
24277
|
|
|
24254
24278
|
// onSearchScript中加上了onChangeScript中的脚本,是因为amis 3.2不能用change事件执行onChangeScript
|
|
@@ -24261,9 +24285,19 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24261
24285
|
// const scope = event.context.scoped;
|
|
24262
24286
|
// 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
|
|
24263
24287
|
// 点击取消按钮后继续在表单项中输入过滤条件且最后没有点击回车按键或点击表单项搜索按钮的话,在快速搜索中点击回车按钮提交搜索会所顶部搜索表单中的字段值清空
|
|
24288
|
+
let isLookup = event.data.isLookup;
|
|
24289
|
+
let __lookupField = event.data.__lookupField;
|
|
24290
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
24291
|
+
if(isLookup && __lookupField){
|
|
24292
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
24293
|
+
if(__lookupField.reference_to_field){
|
|
24294
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
24295
|
+
}
|
|
24296
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
24297
|
+
}
|
|
24264
24298
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
24265
24299
|
setTimeout(function(){
|
|
24266
|
-
filterForm.setValues(event.data
|
|
24300
|
+
filterForm.setValues(event.data[__changedFilterFormValuesKey]);
|
|
24267
24301
|
}, 500);
|
|
24268
24302
|
`;
|
|
24269
24303
|
|
|
@@ -24284,8 +24318,8 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24284
24318
|
"name": keywordsSearchBoxName,
|
|
24285
24319
|
"placeholder": "搜索此列表",
|
|
24286
24320
|
"value": crudKeywords,
|
|
24287
|
-
"clearable": true
|
|
24288
|
-
|
|
24321
|
+
// "clearable": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
|
|
24322
|
+
"clearAndSubmit": true,
|
|
24289
24323
|
"searchImediately": false,
|
|
24290
24324
|
"onEvent": {
|
|
24291
24325
|
"search": {
|
|
@@ -24565,18 +24599,34 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24565
24599
|
crudService && crudService.setData({isFieldsFilterEmpty});
|
|
24566
24600
|
`;
|
|
24567
24601
|
let onChangeScript = `
|
|
24602
|
+
let isLookup = event.data.isLookup;
|
|
24603
|
+
let __lookupField = event.data.__lookupField;
|
|
24568
24604
|
const scope = event.context.scoped;
|
|
24569
24605
|
// let filterFormValues = event.data;
|
|
24570
24606
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
24571
24607
|
let filterFormService = SteedosUI.getClosestAmisComponentByType(filterForm.context, "service");
|
|
24572
24608
|
// 使用event.data的话,并不能拿到本地存储中的过滤条件,所以需要从filterFormService中取。
|
|
24573
24609
|
let filterFormValues = filterFormService.getData();
|
|
24610
|
+
filterFormValues = JSON.parse(JSON.stringify(filterFormValues)); //只取当层数据域中数据,去除__super层数据
|
|
24574
24611
|
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
24575
24612
|
const changedFilterFormValues = _.pickBy(filterFormValues, function(n,k){return /^__searchable__/.test(k);});;
|
|
24576
24613
|
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
24577
24614
|
// crudService && crudService.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
24578
24615
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
24579
|
-
crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
24616
|
+
// crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
24617
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
24618
|
+
if(isLookup && __lookupField){
|
|
24619
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
24620
|
+
if(__lookupField.reference_to_field){
|
|
24621
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
24622
|
+
}
|
|
24623
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
24624
|
+
}
|
|
24625
|
+
if(crud){
|
|
24626
|
+
let crudData = crud.getData();
|
|
24627
|
+
crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
|
|
24628
|
+
crud.setData(crudData);
|
|
24629
|
+
}
|
|
24580
24630
|
`;
|
|
24581
24631
|
return {
|
|
24582
24632
|
"title": "",
|
|
@@ -25179,6 +25229,58 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25179
25229
|
}
|
|
25180
25230
|
|
|
25181
25231
|
function getLookupSapceUserTreeSchema(isMobile){
|
|
25232
|
+
let apiAdaptor = `
|
|
25233
|
+
// console.log("===getLookupSapceUserTreeSchema===", JSON.stringify(payload));
|
|
25234
|
+
const records = payload.data.options;
|
|
25235
|
+
let isTreeOptionsComputed = false;
|
|
25236
|
+
if(records.length === 1 && records[0].children){
|
|
25237
|
+
isTreeOptionsComputed = true;
|
|
25238
|
+
}
|
|
25239
|
+
if(isTreeOptionsComputed){
|
|
25240
|
+
return payload;
|
|
25241
|
+
}
|
|
25242
|
+
const treeRecords = [];
|
|
25243
|
+
const getChildren = (records, childrenIds) => {
|
|
25244
|
+
if (!childrenIds) {
|
|
25245
|
+
return;
|
|
25246
|
+
}
|
|
25247
|
+
const children = _.filter(records, (record) => {
|
|
25248
|
+
return _.includes(childrenIds, record.value)
|
|
25249
|
+
});
|
|
25250
|
+
_.each(children, (item) => {
|
|
25251
|
+
if (item.children) {
|
|
25252
|
+
item.children = getChildren(records, item.children)
|
|
25253
|
+
}
|
|
25254
|
+
})
|
|
25255
|
+
return children;
|
|
25256
|
+
}
|
|
25257
|
+
|
|
25258
|
+
const getRoot = (records) => {
|
|
25259
|
+
for (var i = 0; i < records.length; i++) {
|
|
25260
|
+
records[i].noParent = 0;
|
|
25261
|
+
if (!!records[i].parent) {
|
|
25262
|
+
biaozhi = 1
|
|
25263
|
+
for (var j = 0; j < records.length; j++) {
|
|
25264
|
+
if (records[i].parent == records[j].value)
|
|
25265
|
+
biaozhi = 0;
|
|
25266
|
+
}
|
|
25267
|
+
if (biaozhi == 1) records[i].noParent = 1;
|
|
25268
|
+
} else records[i].noParent = 1;
|
|
25269
|
+
}
|
|
25270
|
+
}
|
|
25271
|
+
getRoot(records);
|
|
25272
|
+
console.log(records)
|
|
25273
|
+
|
|
25274
|
+
_.each(records, (record) => {
|
|
25275
|
+
if (record.noParent == 1) {
|
|
25276
|
+
treeRecords.push(Object.assign({}, record, { children: getChildren(records, record.children) }));
|
|
25277
|
+
}
|
|
25278
|
+
});
|
|
25279
|
+
console.log(treeRecords)
|
|
25280
|
+
|
|
25281
|
+
payload.data.options = treeRecords;
|
|
25282
|
+
return payload;
|
|
25283
|
+
`;
|
|
25182
25284
|
const treeSchema = {
|
|
25183
25285
|
"type": "input-tree",
|
|
25184
25286
|
"className":"steedos-select-user-tree",
|
|
@@ -25189,8 +25291,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25189
25291
|
"headers": {
|
|
25190
25292
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
25191
25293
|
},
|
|
25192
|
-
"adaptor":
|
|
25193
|
-
"requestAdaptor": "\n ",
|
|
25294
|
+
"adaptor": apiAdaptor,
|
|
25194
25295
|
"data": {
|
|
25195
25296
|
"query": "{options:organizations(filters:[\"hidden\", \"!=\", true],sort:\"sort_no desc\"){value:_id label:name,parent,children}}"
|
|
25196
25297
|
},
|
|
@@ -25391,13 +25492,24 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25391
25492
|
let keywordsSearchBoxName = `__keywords_lookup__${field.name.replace(/\./g, "_")}__to__${refObjectConfig.name}`;
|
|
25392
25493
|
|
|
25393
25494
|
source.requestAdaptor = `
|
|
25394
|
-
let
|
|
25495
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
25496
|
+
let __lookupField = api.data.$self.__lookupField;
|
|
25497
|
+
if(__lookupField){
|
|
25498
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
25499
|
+
if(__lookupField.reference_to_field){
|
|
25500
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
25501
|
+
}
|
|
25502
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
25503
|
+
}
|
|
25504
|
+
let __changedFilterFormValues = api.data.$self[__changedFilterFormValuesKey] || {};
|
|
25395
25505
|
let __changedSearchBoxValues = api.data.$self.__changedSearchBoxValues || {};
|
|
25396
25506
|
// 把表单搜索和快速搜索中的change事件中记录的过滤条件也拼到$self中,是为解决触发搜索请求时,两边输入的过滤条件都带上,即:
|
|
25397
25507
|
// 有时在搜索表单中输入过滤条件事,忘记点击回车键或搜索按钮,而是进一步修改快速搜索框中的关键字点击其中回车键触发搜索
|
|
25398
25508
|
// 这种情况下,触发的搜索请求中没有带上搜索表单中输入的过滤条件。
|
|
25399
25509
|
// 反过来先在快速搜索框中输入过滤条件却不点击其中回车键触发搜索,而是到搜索表单中触发搜索请求也是一样的。
|
|
25400
|
-
|
|
25510
|
+
if(api.data.$self.op !== 'loadOptions'){
|
|
25511
|
+
Object.assign(api.data.$self, __changedSearchBoxValues, __changedFilterFormValues);
|
|
25512
|
+
}
|
|
25401
25513
|
const selfData = JSON.parse(JSON.stringify(api.data.$self));
|
|
25402
25514
|
var filters = [];
|
|
25403
25515
|
var pageSize = api.data.pageSize || 10;
|
|
@@ -25604,7 +25716,12 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25604
25716
|
"objectName": refObjectConfig.name,
|
|
25605
25717
|
"uiSchema": refObjectConfig,
|
|
25606
25718
|
"listName": listName,// 需要按视图取可搜索项
|
|
25607
|
-
"isLookup": true
|
|
25719
|
+
"isLookup": true,
|
|
25720
|
+
"__lookupField": {
|
|
25721
|
+
"name": field.name,
|
|
25722
|
+
"reference_to": refObjectConfig.name,
|
|
25723
|
+
"reference_to_field": field.reference_to_field
|
|
25724
|
+
}
|
|
25608
25725
|
});
|
|
25609
25726
|
|
|
25610
25727
|
if(!pickerSchema.onEvent){
|
|
@@ -25973,6 +26090,15 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25973
26090
|
|
|
25974
26091
|
// 优先取字段中配置的enable_enhanced_lookup,字段上没配置时,才从对象上取enable_enhanced_lookup属性
|
|
25975
26092
|
let enableEnhancedLookup = lodash.exports.isBoolean(field.enable_enhanced_lookup) ? field.enable_enhanced_lookup : refObject.enable_enhanced_lookup;
|
|
26093
|
+
let amisVersion = getComparableAmisVersion();
|
|
26094
|
+
if(amisVersion >= 3.6){
|
|
26095
|
+
// amis 3.6.3单选和多选的树picker都有bug(https://github.com/baidu/amis/issues/9279,https://github.com/baidu/amis/issues/9295),我们改amis源码修正了
|
|
26096
|
+
// amis 3.6.3多选的下拉树组件有bug,多选树字段的选中值在编辑模式展开树时不会自动勾选树里面的节点,而是始终勾选显示在最外面的选中值选项(即defaultValueOptions),amis 3.2没有这个问题
|
|
26097
|
+
// 这里强制禁用多选下拉树,统一改为弹出树,如果以后需要下拉树功能,可以把下拉树组件改为一次性加载所有树节点数据模式来跳过这个问题
|
|
26098
|
+
if(!enableEnhancedLookup && refObject.enable_tree && field.multiple){
|
|
26099
|
+
enableEnhancedLookup = true;
|
|
26100
|
+
}
|
|
26101
|
+
}
|
|
25976
26102
|
// 默认使用下拉框模式显示lookup选项,只能配置了enable_enhanced_lookup才使用弹出增强模式
|
|
25977
26103
|
if(enableEnhancedLookup == true){
|
|
25978
26104
|
return await lookupToAmisPicker(field, readonly, ctx);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos-widgets/sortable",
|
|
3
|
-
"version": "3.6.0-beta.
|
|
3
|
+
"version": "3.6.0-beta.6",
|
|
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": "3.6.0-beta.
|
|
48
|
+
"@steedos-widgets/amis-lib": "3.6.0-beta.6"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "11c3240e1faf4d5ae87634df9b6777268bd08c6f"
|
|
51
51
|
}
|