@steedos-widgets/sortable 3.6.14 → 6.3.0-beta.10
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 -43
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +75 -43
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +75 -43
- package/package.json +3 -3
package/dist/sortable.umd.js
CHANGED
|
@@ -20446,10 +20446,23 @@
|
|
|
20446
20446
|
if(ctx && ctx.isLookup){
|
|
20447
20447
|
linkTarget = "target='_blank'";
|
|
20448
20448
|
}
|
|
20449
|
+
let nameLabel = field.name;
|
|
20450
|
+
//若字段类型是lookup,则按照相关表tpl的label规则显示;若是其它类型,则显示_display或字段本身的值
|
|
20451
|
+
if (field.type == "lookup") {
|
|
20452
|
+
if(!field.reference_to && (field.optionsFunction || field._optionsFunction || field.options)){
|
|
20453
|
+
if(!field.isTableField){
|
|
20454
|
+
nameLabel = `\${${field.name}__label}`;
|
|
20455
|
+
}
|
|
20456
|
+
} else {
|
|
20457
|
+
nameLabel = `\${_display.${field.name}.label}`;
|
|
20458
|
+
}
|
|
20459
|
+
} else {
|
|
20460
|
+
nameLabel = `\${_display.${field.name} || ${field.name}}`;
|
|
20461
|
+
}
|
|
20449
20462
|
if(ctx.isRelated && window.innerWidth >= 768){
|
|
20450
|
-
return `<a href="${href}" ${linkTarget} onclick="return false;">\${${
|
|
20463
|
+
return `<a href="${href}" ${linkTarget} onclick="return false;">\${${nameLabel} | raw}</a>`
|
|
20451
20464
|
}else {
|
|
20452
|
-
return `<a href="${href}" ${linkTarget}>\${${
|
|
20465
|
+
return `<a href="${href}" ${linkTarget}>\${${nameLabel} | raw}</a>`
|
|
20453
20466
|
}
|
|
20454
20467
|
}
|
|
20455
20468
|
|
|
@@ -20574,7 +20587,7 @@
|
|
|
20574
20587
|
}
|
|
20575
20588
|
|
|
20576
20589
|
async function getFieldTpl (field, options){
|
|
20577
|
-
if((field.is_name || field.name === options.labelFieldName) && !options.onlyDisplayLookLabel){
|
|
20590
|
+
if((field.is_name || field.name === options.labelFieldName) && !options.onlyDisplayLookLabel && field.multiple !== true){
|
|
20578
20591
|
return getNameTpl(field, options)
|
|
20579
20592
|
}
|
|
20580
20593
|
switch (field.type) {
|
|
@@ -21963,7 +21976,7 @@
|
|
|
21963
21976
|
"title": " ",
|
|
21964
21977
|
"headerClassName": "hidden",
|
|
21965
21978
|
"size": "lg",
|
|
21966
|
-
"bodyClassName": "p-0 m-0",
|
|
21979
|
+
"bodyClassName": "p-0 m-0 bg-gray-100",
|
|
21967
21980
|
"closeOnEsc": true,
|
|
21968
21981
|
"closeOnOutside": true,
|
|
21969
21982
|
"resizable": true,
|
|
@@ -22825,7 +22838,8 @@
|
|
|
22825
22838
|
type: 'button',
|
|
22826
22839
|
actionType: 'confirm',
|
|
22827
22840
|
label: instance.t('frontend_form_save'),
|
|
22828
|
-
primary: true
|
|
22841
|
+
primary: true,
|
|
22842
|
+
close: `object_actions_drawer_${uiSchema.name}`
|
|
22829
22843
|
},
|
|
22830
22844
|
]
|
|
22831
22845
|
}
|
|
@@ -25043,7 +25057,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25043
25057
|
* @Author: baozhoutao@steedos.com
|
|
25044
25058
|
* @Date: 2022-07-05 15:55:39
|
|
25045
25059
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
25046
|
-
* @LastEditTime: 2024-
|
|
25060
|
+
* @LastEditTime: 2024-04-26 16:46:44
|
|
25047
25061
|
* @Description:
|
|
25048
25062
|
*/
|
|
25049
25063
|
|
|
@@ -25276,37 +25290,44 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25276
25290
|
* 本次存储代码段
|
|
25277
25291
|
*/
|
|
25278
25292
|
try {
|
|
25279
|
-
|
|
25280
|
-
|
|
25281
|
-
|
|
25282
|
-
|
|
25283
|
-
|
|
25284
|
-
|
|
25285
|
-
|
|
25286
|
-
|
|
25287
|
-
|
|
25288
|
-
|
|
25289
|
-
|
|
25290
|
-
|
|
25291
|
-
|
|
25292
|
-
|
|
25293
|
-
|
|
25294
|
-
|
|
25295
|
-
|
|
25296
|
-
|
|
25297
|
-
|
|
25298
|
-
|
|
25299
|
-
|
|
25300
|
-
|
|
25293
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
25294
|
+
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
25295
|
+
/**
|
|
25296
|
+
* localListViewProps规范来自crud请求api中api.data.$self参数值的。
|
|
25297
|
+
* 比如:{"perPage":20,"page":1,"__searchable__name":"7","__searchable__between__n1__c":[null,null],"filter":[["name","contains","a"]]}
|
|
25298
|
+
* __searchable__...:顶部放大镜搜索条件
|
|
25299
|
+
* filter:右侧过滤器
|
|
25300
|
+
* perPage:每页条数
|
|
25301
|
+
* page:当前页码
|
|
25302
|
+
* orderBy:排序字段
|
|
25303
|
+
* orderDir:排序方向
|
|
25304
|
+
*/
|
|
25305
|
+
if (localListViewProps) {
|
|
25306
|
+
localListViewProps = JSON.parse(localListViewProps);
|
|
25307
|
+
// localListViewProps.perPage = 3;
|
|
25308
|
+
let listSchema = {};
|
|
25309
|
+
if (localListViewProps.orderBy) {
|
|
25310
|
+
listSchema.orderBy = localListViewProps.orderBy;
|
|
25311
|
+
}
|
|
25312
|
+
if (localListViewProps.orderDir) {
|
|
25313
|
+
listSchema.orderDir = localListViewProps.orderDir;
|
|
25314
|
+
}
|
|
25301
25315
|
|
|
25302
|
-
|
|
25303
|
-
|
|
25316
|
+
if (localListViewProps.perPage) {
|
|
25317
|
+
listSchema.perPage = localListViewProps.perPage;
|
|
25318
|
+
}
|
|
25319
|
+
defaults.listSchema = lodash.exports.defaultsDeep({}, listSchema, defaults.listSchema || {});
|
|
25304
25320
|
}
|
|
25305
|
-
defaults.listSchema = lodash.exports.defaultsDeep({}, listSchema, defaults.listSchema || {});
|
|
25306
|
-
}
|
|
25307
25321
|
}
|
|
25308
25322
|
catch (ex) {
|
|
25309
|
-
|
|
25323
|
+
console.error("本地存储中crud参数解析异常:", ex);
|
|
25324
|
+
}
|
|
25325
|
+
|
|
25326
|
+
if (window.innerWidth > 768) {
|
|
25327
|
+
// 列表视图组件PC端高度自动计算实现满屏效果,手机端不需要满屏效果,所以不用autofillheight,且允许重写微页面中重新组件autoFillHeight属性
|
|
25328
|
+
defaults.listSchema = lodash.exports.defaultsDeep({}, defaults.listSchema || {}, {
|
|
25329
|
+
autoFillHeight: true
|
|
25330
|
+
});
|
|
25310
25331
|
}
|
|
25311
25332
|
|
|
25312
25333
|
ctx.defaults = defaults;
|
|
@@ -25867,7 +25888,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25867
25888
|
});
|
|
25868
25889
|
|
|
25869
25890
|
// 把自动填充规则中依赖的字段也加到api请求中
|
|
25870
|
-
let autoFillMapping =
|
|
25891
|
+
let autoFillMapping = field.auto_fill_mapping;
|
|
25871
25892
|
if (autoFillMapping && autoFillMapping.length) {
|
|
25872
25893
|
autoFillMapping.forEach(function (item) {
|
|
25873
25894
|
if(!lodash.exports.find(tableFields, function(f){
|
|
@@ -26017,7 +26038,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26017
26038
|
// 如果当前元素不是数组,则处理该元素
|
|
26018
26039
|
// 下面正则用于匹配amis公式\${}
|
|
26019
26040
|
if(/\\\$\\\{([^}]*)\\\}/.test(arr[i])) {
|
|
26020
|
-
arr[i] = currentAmis.evaluate(arr[i], api.data.$);
|
|
26041
|
+
arr[i] = currentAmis.evaluate(arr[i], api.data.$self);
|
|
26021
26042
|
}
|
|
26022
26043
|
}
|
|
26023
26044
|
}
|
|
@@ -26339,7 +26360,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26339
26360
|
];
|
|
26340
26361
|
|
|
26341
26362
|
// 把自动填充规则中依赖的字段也加到api请求中
|
|
26342
|
-
let autoFillMapping =
|
|
26363
|
+
let autoFillMapping = field.auto_fill_mapping;
|
|
26343
26364
|
if (autoFillMapping && autoFillMapping.length) {
|
|
26344
26365
|
autoFillMapping.forEach(function (item) {
|
|
26345
26366
|
queryFields.push(refObjectConfig.fields[item.from]);
|
|
@@ -26434,7 +26455,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26434
26455
|
// 如果当前元素不是数组,则处理该元素
|
|
26435
26456
|
// 下面正则用于匹配amis公式\${}
|
|
26436
26457
|
if(/\\\$\\\{([^}]*)\\\}/.test(arr[i])) {
|
|
26437
|
-
arr[i] = currentAmis.evaluate(arr[i], api.data.$);
|
|
26458
|
+
arr[i] = currentAmis.evaluate(arr[i], api.data.$self);
|
|
26438
26459
|
}
|
|
26439
26460
|
}
|
|
26440
26461
|
}
|
|
@@ -26581,14 +26602,25 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26581
26602
|
}
|
|
26582
26603
|
|
|
26583
26604
|
async function getAutoFill(field, refObject) {
|
|
26584
|
-
let autoFillMapping =
|
|
26605
|
+
let autoFillMapping = field.auto_fill_mapping;
|
|
26585
26606
|
if (autoFillMapping && autoFillMapping.length) {
|
|
26586
26607
|
let fillMapping = {};
|
|
26608
|
+
if (field.multiple) {
|
|
26609
|
+
autoFillMapping.forEach(function (item) {
|
|
26610
|
+
//from的字段类型为lookup、master_detail、select时,需要保留数组格式;其他类型需要转变为字符串格式
|
|
26611
|
+
if (lodash.exports.includes(["lookup","master_detail","select"], refObject.fields[item.from].type)) {
|
|
26612
|
+
fillMapping[item.to] = `\${items | pick:${item.from}}`;
|
|
26613
|
+
} else {
|
|
26614
|
+
fillMapping[item.to] = `\${items | pick:${item.from} | join}`;
|
|
26615
|
+
}
|
|
26616
|
+
});
|
|
26617
|
+
}else {
|
|
26618
|
+
autoFillMapping.forEach(function (item) {
|
|
26619
|
+
fillMapping[item.to] = `\${${item.from}}`;
|
|
26620
|
+
});
|
|
26621
|
+
}
|
|
26587
26622
|
// let fieldsForApi = [];
|
|
26588
|
-
|
|
26589
|
-
fillMapping[item.to] = `\${${item.from}}`;
|
|
26590
|
-
// fieldsForApi.push(item.from);
|
|
26591
|
-
});
|
|
26623
|
+
// fieldsForApi.push(item.from);
|
|
26592
26624
|
// let api = {
|
|
26593
26625
|
// // "url": "/amis/api/mock2/form/autoUpdate?browser=${browser}&version=${version}",
|
|
26594
26626
|
// "url": `/api/v1/${refObject.name}/\${${field.name}}?fields=${JSON.stringify(fieldsForApi)}`,
|
|
@@ -26690,7 +26722,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26690
26722
|
amisSchema = lodash.exports.defaultsDeep({}, pageAmisSchema, amisSchema);
|
|
26691
26723
|
}
|
|
26692
26724
|
}
|
|
26693
|
-
const autoFill = await getAutoFill(field);
|
|
26725
|
+
const autoFill = await getAutoFill(field, refObject);
|
|
26694
26726
|
if(autoFill){
|
|
26695
26727
|
amisSchema.autoFill = autoFill;
|
|
26696
26728
|
// 这里不配置initAutoFill值,按amis规则initAutoFill默认值为fillIfNotSet处理--需要amis sdk 版本 > 3.6.3-patch.6(不包括)版本
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos-widgets/sortable",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "6.3.0-beta.10",
|
|
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.
|
|
48
|
+
"@steedos-widgets/amis-lib": "6.3.0-beta.10"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "9bde0fd0766dc725e40940998b53e4f8fbeaea05"
|
|
51
51
|
}
|