@steedos-widgets/sortable 3.6.0-beta.5 → 3.6.0-beta.7
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 +73 -19
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +73 -19
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +73 -19
- package/package.json +3 -3
package/dist/assets.json
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
{
|
|
4
4
|
"package": "@steedos-widgets/sortable",
|
|
5
5
|
"urls": [
|
|
6
|
-
"https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.
|
|
7
|
-
"https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.
|
|
6
|
+
"https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.7/dist/sortable.umd.js",
|
|
7
|
+
"https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.7/dist/sortable.umd.css"
|
|
8
8
|
],
|
|
9
9
|
"library": "BuilderSortable"
|
|
10
10
|
}
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"npm": {
|
|
16
16
|
"package": "@steedos-widgets/sortable"
|
|
17
17
|
},
|
|
18
|
-
"url": "https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.
|
|
18
|
+
"url": "https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.7/dist/meta.js",
|
|
19
19
|
"urls": {
|
|
20
|
-
"default": "https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.
|
|
21
|
-
"design": "https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.
|
|
20
|
+
"default": "https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.7/dist/meta.js",
|
|
21
|
+
"design": "https://unpkg.com/@steedos-widgets/sortable@3.6.0-beta.7/dist/meta.js"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
]
|
package/dist/sortable.cjs.js
CHANGED
|
@@ -55920,6 +55920,14 @@ async function getTableSchema$1(fields, options){
|
|
|
55920
55920
|
|
|
55921
55921
|
}
|
|
55922
55922
|
|
|
55923
|
+
const treeConfig = {};
|
|
55924
|
+
|
|
55925
|
+
if(options.enable_tree){
|
|
55926
|
+
treeConfig.expandConfig = {
|
|
55927
|
+
expand: 'first'
|
|
55928
|
+
};
|
|
55929
|
+
}
|
|
55930
|
+
|
|
55923
55931
|
return {
|
|
55924
55932
|
mode: "table",
|
|
55925
55933
|
perPageAvailable: [5, 10, 20, 50, 100, 500],
|
|
@@ -55935,6 +55943,7 @@ async function getTableSchema$1(fields, options){
|
|
|
55935
55943
|
labelTpl: `\${${options.labelFieldName}}`,
|
|
55936
55944
|
autoFillHeight: false, // 自动高度效果不理想,先关闭
|
|
55937
55945
|
columnsTogglable: false,
|
|
55946
|
+
...treeConfig
|
|
55938
55947
|
}
|
|
55939
55948
|
}
|
|
55940
55949
|
|
|
@@ -56489,7 +56498,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
56489
56498
|
// crud && crud.setData({__changedFilterFormValues: {}});
|
|
56490
56499
|
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
56491
56500
|
if(isLookup && __lookupField){
|
|
56492
|
-
let lookupTag = "
|
|
56501
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
56493
56502
|
if(__lookupField.reference_to_field){
|
|
56494
56503
|
lookupTag += "__" + __lookupField.reference_to_field;
|
|
56495
56504
|
}
|
|
@@ -57988,7 +57997,7 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57988
57997
|
let __lookupField = event.data.__lookupField;
|
|
57989
57998
|
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
57990
57999
|
if(isLookup && __lookupField){
|
|
57991
|
-
let lookupTag = "
|
|
58000
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
57992
58001
|
if(__lookupField.reference_to_field){
|
|
57993
58002
|
lookupTag += "__" + __lookupField.reference_to_field;
|
|
57994
58003
|
}
|
|
@@ -58300,13 +58309,13 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58300
58309
|
let onChangeScript = `
|
|
58301
58310
|
let isLookup = event.data.isLookup;
|
|
58302
58311
|
let __lookupField = event.data.__lookupField;
|
|
58303
|
-
console.log("==onChangeScript=isLookup===", isLookup);
|
|
58304
58312
|
const scope = event.context.scoped;
|
|
58305
58313
|
// let filterFormValues = event.data;
|
|
58306
58314
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
58307
58315
|
let filterFormService = SteedosUI.getClosestAmisComponentByType(filterForm.context, "service");
|
|
58308
58316
|
// 使用event.data的话,并不能拿到本地存储中的过滤条件,所以需要从filterFormService中取。
|
|
58309
58317
|
let filterFormValues = filterFormService.getData();
|
|
58318
|
+
filterFormValues = JSON.parse(JSON.stringify(filterFormValues)); //只取当层数据域中数据,去除__super层数据
|
|
58310
58319
|
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
58311
58320
|
const changedFilterFormValues = _.pickBy(filterFormValues, function(n,k){return /^__searchable__/.test(k);});;
|
|
58312
58321
|
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
@@ -58315,7 +58324,7 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58315
58324
|
// crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
58316
58325
|
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
58317
58326
|
if(isLookup && __lookupField){
|
|
58318
|
-
let lookupTag = "
|
|
58327
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
58319
58328
|
if(__lookupField.reference_to_field){
|
|
58320
58329
|
lookupTag += "__" + __lookupField.reference_to_field;
|
|
58321
58330
|
}
|
|
@@ -58928,6 +58937,58 @@ function getReferenceToSync(field) {
|
|
|
58928
58937
|
}
|
|
58929
58938
|
|
|
58930
58939
|
function getLookupSapceUserTreeSchema(isMobile){
|
|
58940
|
+
let apiAdaptor = `
|
|
58941
|
+
// console.log("===getLookupSapceUserTreeSchema===", JSON.stringify(payload));
|
|
58942
|
+
const records = payload.data.options;
|
|
58943
|
+
let isTreeOptionsComputed = false;
|
|
58944
|
+
if(records.length === 1 && records[0].children){
|
|
58945
|
+
isTreeOptionsComputed = true;
|
|
58946
|
+
}
|
|
58947
|
+
if(isTreeOptionsComputed){
|
|
58948
|
+
return payload;
|
|
58949
|
+
}
|
|
58950
|
+
const treeRecords = [];
|
|
58951
|
+
const getChildren = (records, childrenIds) => {
|
|
58952
|
+
if (!childrenIds) {
|
|
58953
|
+
return;
|
|
58954
|
+
}
|
|
58955
|
+
const children = _.filter(records, (record) => {
|
|
58956
|
+
return _.includes(childrenIds, record.value)
|
|
58957
|
+
});
|
|
58958
|
+
_.each(children, (item) => {
|
|
58959
|
+
if (item.children) {
|
|
58960
|
+
item.children = getChildren(records, item.children)
|
|
58961
|
+
}
|
|
58962
|
+
})
|
|
58963
|
+
return children;
|
|
58964
|
+
}
|
|
58965
|
+
|
|
58966
|
+
const getRoot = (records) => {
|
|
58967
|
+
for (var i = 0; i < records.length; i++) {
|
|
58968
|
+
records[i].noParent = 0;
|
|
58969
|
+
if (!!records[i].parent) {
|
|
58970
|
+
biaozhi = 1
|
|
58971
|
+
for (var j = 0; j < records.length; j++) {
|
|
58972
|
+
if (records[i].parent == records[j].value)
|
|
58973
|
+
biaozhi = 0;
|
|
58974
|
+
}
|
|
58975
|
+
if (biaozhi == 1) records[i].noParent = 1;
|
|
58976
|
+
} else records[i].noParent = 1;
|
|
58977
|
+
}
|
|
58978
|
+
}
|
|
58979
|
+
getRoot(records);
|
|
58980
|
+
console.log(records)
|
|
58981
|
+
|
|
58982
|
+
_.each(records, (record) => {
|
|
58983
|
+
if (record.noParent == 1) {
|
|
58984
|
+
treeRecords.push(Object.assign({}, record, { children: getChildren(records, record.children) }));
|
|
58985
|
+
}
|
|
58986
|
+
});
|
|
58987
|
+
console.log(treeRecords)
|
|
58988
|
+
|
|
58989
|
+
payload.data.options = treeRecords;
|
|
58990
|
+
return payload;
|
|
58991
|
+
`;
|
|
58931
58992
|
const treeSchema = {
|
|
58932
58993
|
"type": "input-tree",
|
|
58933
58994
|
"className":"steedos-select-user-tree",
|
|
@@ -58938,8 +58999,7 @@ function getLookupSapceUserTreeSchema(isMobile){
|
|
|
58938
58999
|
"headers": {
|
|
58939
59000
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
58940
59001
|
},
|
|
58941
|
-
"adaptor":
|
|
58942
|
-
"requestAdaptor": "\n ",
|
|
59002
|
+
"adaptor": apiAdaptor,
|
|
58943
59003
|
"data": {
|
|
58944
59004
|
"query": "{options:organizations(filters:[\"hidden\", \"!=\", true],sort:\"sort_no desc\"){value:_id label:name,parent,children}}"
|
|
58945
59005
|
},
|
|
@@ -59143,7 +59203,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59143
59203
|
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
59144
59204
|
let __lookupField = api.data.$self.__lookupField;
|
|
59145
59205
|
if(__lookupField){
|
|
59146
|
-
let lookupTag = "
|
|
59206
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
59147
59207
|
if(__lookupField.reference_to_field){
|
|
59148
59208
|
lookupTag += "__" + __lookupField.reference_to_field;
|
|
59149
59209
|
}
|
|
@@ -59295,14 +59355,6 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59295
59355
|
}
|
|
59296
59356
|
});
|
|
59297
59357
|
payload.data.rows = treeRecords;
|
|
59298
|
-
try{
|
|
59299
|
-
setTimeout(() => {
|
|
59300
|
-
$('.amis-dialog-widget.antd-Modal .antd-Table-content .antd-Table-table thead .antd-Table-expandBtn')[0]?.click();
|
|
59301
|
-
}, 600);
|
|
59302
|
-
}
|
|
59303
|
-
catch(ex){
|
|
59304
|
-
console.error("tree数据格式展开异常:", ex);
|
|
59305
|
-
}
|
|
59306
59358
|
}
|
|
59307
59359
|
return payload;
|
|
59308
59360
|
`;
|
|
@@ -59329,6 +59381,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59329
59381
|
labelFieldName,
|
|
59330
59382
|
top: top,
|
|
59331
59383
|
isLookup: true,
|
|
59384
|
+
enable_tree: refObjectConfig.enable_tree,
|
|
59332
59385
|
...ctx
|
|
59333
59386
|
});
|
|
59334
59387
|
|
|
@@ -59740,10 +59793,11 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
59740
59793
|
let enableEnhancedLookup = lodash.exports.isBoolean(field.enable_enhanced_lookup) ? field.enable_enhanced_lookup : refObject.enable_enhanced_lookup;
|
|
59741
59794
|
let amisVersion = getComparableAmisVersion();
|
|
59742
59795
|
if(amisVersion >= 3.6){
|
|
59743
|
-
// amis 3.6.3
|
|
59744
|
-
// amis 3.6.3
|
|
59745
|
-
|
|
59746
|
-
|
|
59796
|
+
// amis 3.6.3单选和多选的树picker都有bug(https://github.com/baidu/amis/issues/9279,https://github.com/baidu/amis/issues/9295),我们改amis源码修正了
|
|
59797
|
+
// amis 3.6.3多选的下拉树组件有bug,多选树字段的选中值在编辑模式展开树时不会自动勾选树里面的节点,而是始终勾选显示在最外面的选中值选项(即defaultValueOptions),amis 3.2没有这个问题
|
|
59798
|
+
// 这里强制禁用多选下拉树,统一改为弹出树,如果以后需要下拉树功能,可以把下拉树组件改为一次性加载所有树节点数据模式来跳过这个问题
|
|
59799
|
+
if(!enableEnhancedLookup && refObject.enable_tree && field.multiple){
|
|
59800
|
+
enableEnhancedLookup = true;
|
|
59747
59801
|
}
|
|
59748
59802
|
}
|
|
59749
59803
|
// 默认使用下拉框模式显示lookup选项,只能配置了enable_enhanced_lookup才使用弹出增强模式
|