@steedos-widgets/sortable 1.3.4-beta.19 → 1.3.4-beta.21
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 +232 -94
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +232 -94
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +232 -94
- package/package.json +3 -3
package/dist/sortable.esm.js
CHANGED
|
@@ -55213,7 +55213,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
55213
55213
|
if(isLookup){
|
|
55214
55214
|
searchableFieldsStoreKey += "/lookup/" + objectName;
|
|
55215
55215
|
}
|
|
55216
|
-
|
|
55216
|
+
searchableFieldsStoreKey = searchableFieldsStoreKey + "/" + (data.context && data.context.userId);
|
|
55217
|
+
let defaultSearchableFields = localStorage.getItem(searchableFieldsStoreKey);
|
|
55217
55218
|
if(defaultSearchableFields){
|
|
55218
55219
|
defaultSearchableFields = defaultSearchableFields.split(",");
|
|
55219
55220
|
}
|
|
@@ -55282,7 +55283,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
55282
55283
|
if(isLookup){
|
|
55283
55284
|
searchableFieldsStoreKey += "/lookup/" + objectName;
|
|
55284
55285
|
}
|
|
55285
|
-
|
|
55286
|
+
searchableFieldsStoreKey = searchableFieldsStoreKey + "/" + (data.context && data.context.userId);
|
|
55287
|
+
localStorage.setItem(searchableFieldsStoreKey, value);
|
|
55286
55288
|
|
|
55287
55289
|
// ===START===:当变更可搜索字段时,如果被移除的可搜索字段在本地存储中已经存入过滤条件中则应该清除本地存储中相关字段的过滤条件。
|
|
55288
55290
|
const searchableFields = data.fields;
|
|
@@ -58341,8 +58343,6 @@ function getSelectFieldOptions(field){
|
|
|
58341
58343
|
}
|
|
58342
58344
|
|
|
58343
58345
|
async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
58344
|
-
// console.log('convertSFieldToAmisField====>', field, readonly, ctx)
|
|
58345
|
-
const isMobile = window.innerWidth <= 768;
|
|
58346
58346
|
// 创建人和修改人、创建时间和修改时间不显示
|
|
58347
58347
|
if(lodash.exports.includes(OMIT_FIELDS, field.name) && ctx.showSystemFields != true){
|
|
58348
58348
|
return;
|
|
@@ -58431,26 +58431,33 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
58431
58431
|
};
|
|
58432
58432
|
break;
|
|
58433
58433
|
case 'date':
|
|
58434
|
-
convertData = isMobile && !readonly ? {
|
|
58435
|
-
|
|
58436
|
-
|
|
58437
|
-
|
|
58438
|
-
|
|
58439
|
-
|
|
58440
|
-
|
|
58441
|
-
|
|
58442
|
-
|
|
58443
|
-
|
|
58444
|
-
|
|
58445
|
-
|
|
58446
|
-
|
|
58447
|
-
|
|
58448
|
-
|
|
58449
|
-
|
|
58450
|
-
|
|
58451
|
-
|
|
58452
|
-
|
|
58453
|
-
} : {
|
|
58434
|
+
// convertData = isMobile && !readonly ? {
|
|
58435
|
+
// type: "native-date",
|
|
58436
|
+
// pipeIn: (value, data) => {
|
|
58437
|
+
// if (value) {
|
|
58438
|
+
// value = moment(value).utc().format('YYYY-MM-DD');
|
|
58439
|
+
// return value;
|
|
58440
|
+
// } else {
|
|
58441
|
+
// return "";
|
|
58442
|
+
// }
|
|
58443
|
+
|
|
58444
|
+
// },
|
|
58445
|
+
// pipeOut: (value, oldValue, data) => {
|
|
58446
|
+
// if (value) {
|
|
58447
|
+
// value = moment(value).format('YYYY-MM-DDT00:00:00.000[Z]');
|
|
58448
|
+
// return value;
|
|
58449
|
+
// } else {
|
|
58450
|
+
// return "";
|
|
58451
|
+
// }
|
|
58452
|
+
// }
|
|
58453
|
+
// } : {
|
|
58454
|
+
// type: getAmisStaticFieldType('date', readonly),
|
|
58455
|
+
// inputFormat: "YYYY-MM-DD",
|
|
58456
|
+
// format:'YYYY-MM-DDT00:00:00.000[Z]',
|
|
58457
|
+
// tpl: readonly ? Tpl.getDateTpl(field) : null,
|
|
58458
|
+
// // utc: true
|
|
58459
|
+
// }
|
|
58460
|
+
convertData = {
|
|
58454
58461
|
type: getAmisStaticFieldType('date', readonly),
|
|
58455
58462
|
inputFormat: "YYYY-MM-DD",
|
|
58456
58463
|
format:'YYYY-MM-DDT00:00:00.000[Z]',
|
|
@@ -58469,43 +58476,51 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
58469
58476
|
};
|
|
58470
58477
|
break;
|
|
58471
58478
|
case 'datetime':
|
|
58472
|
-
convertData = isMobile && !readonly ? {
|
|
58473
|
-
|
|
58474
|
-
|
|
58475
|
-
|
|
58476
|
-
|
|
58477
|
-
|
|
58478
|
-
|
|
58479
|
-
|
|
58480
|
-
|
|
58481
|
-
|
|
58482
|
-
|
|
58483
|
-
|
|
58484
|
-
|
|
58485
|
-
|
|
58486
|
-
|
|
58487
|
-
|
|
58488
|
-
|
|
58489
|
-
|
|
58490
|
-
|
|
58491
|
-
|
|
58492
|
-
|
|
58493
|
-
|
|
58494
|
-
|
|
58495
|
-
|
|
58496
|
-
|
|
58497
|
-
|
|
58498
|
-
|
|
58499
|
-
|
|
58500
|
-
|
|
58501
|
-
|
|
58502
|
-
|
|
58503
|
-
|
|
58504
|
-
|
|
58505
|
-
|
|
58506
|
-
|
|
58507
|
-
|
|
58508
|
-
} : {
|
|
58479
|
+
// convertData = isMobile && !readonly ? {
|
|
58480
|
+
// type: "combo",
|
|
58481
|
+
// pipeIn: (value, data) => {
|
|
58482
|
+
// let revalue = {};
|
|
58483
|
+
// if (value && value != "Invalid date") {
|
|
58484
|
+
// value = moment(value).format('YYYY-MM-DD HH:mm:ss');
|
|
58485
|
+
// revalue[field.name + "-native-date"] = value.split(' ')[0];
|
|
58486
|
+
// revalue[field.name + "-native-time"] = value.split(' ')[1];
|
|
58487
|
+
// } else {
|
|
58488
|
+
// revalue[field.name + "-native-date"] = "";
|
|
58489
|
+
// revalue[field.name + "-native-time"] = "";
|
|
58490
|
+
// }
|
|
58491
|
+
// return revalue;
|
|
58492
|
+
// },
|
|
58493
|
+
// pipeOut: (value, oldValue, data) => {
|
|
58494
|
+
// let revalue = "";
|
|
58495
|
+
// if (value[field.name + "-native-date"] && value[field.name + "-native-time"]) {
|
|
58496
|
+
// revalue = value[field.name + "-native-date"] + " " + value[field.name + "-native-time"];
|
|
58497
|
+
// revalue = moment(revalue).utc().format('YYYY-MM-DDTHH:mm:ss.SSS[Z]');
|
|
58498
|
+
// }
|
|
58499
|
+
// return revalue;
|
|
58500
|
+
// },
|
|
58501
|
+
// items: [
|
|
58502
|
+
// {
|
|
58503
|
+
// type: "native-date",
|
|
58504
|
+
// name: field.name + "-native-date",
|
|
58505
|
+
// className: "steedos-native-date",
|
|
58506
|
+
// value: ""
|
|
58507
|
+
// },
|
|
58508
|
+
// {
|
|
58509
|
+
// type: "native-time",
|
|
58510
|
+
// name: field.name + "-native-time",
|
|
58511
|
+
// className: "steedos-native-time",
|
|
58512
|
+
// value: ""
|
|
58513
|
+
// }
|
|
58514
|
+
// ]
|
|
58515
|
+
// } : {
|
|
58516
|
+
// type: getAmisStaticFieldType('datetime', readonly),
|
|
58517
|
+
// inputFormat: 'YYYY-MM-DD HH:mm',
|
|
58518
|
+
// format: 'YYYY-MM-DDTHH:mm:ss.SSSZ',
|
|
58519
|
+
// tpl: readonly ? Tpl.getDateTimeTpl(field) : null,
|
|
58520
|
+
// utc: true,
|
|
58521
|
+
// }
|
|
58522
|
+
|
|
58523
|
+
convertData = {
|
|
58509
58524
|
type: getAmisStaticFieldType('datetime', readonly),
|
|
58510
58525
|
inputFormat: 'YYYY-MM-DD HH:mm',
|
|
58511
58526
|
format: 'YYYY-MM-DDTHH:mm:ss.SSSZ',
|
|
@@ -58525,26 +58540,34 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
58525
58540
|
};
|
|
58526
58541
|
break;
|
|
58527
58542
|
case 'time':
|
|
58528
|
-
convertData = isMobile && !readonly ? {
|
|
58529
|
-
|
|
58530
|
-
|
|
58531
|
-
|
|
58532
|
-
|
|
58533
|
-
|
|
58534
|
-
|
|
58535
|
-
|
|
58536
|
-
|
|
58537
|
-
|
|
58538
|
-
|
|
58539
|
-
|
|
58540
|
-
|
|
58541
|
-
|
|
58542
|
-
|
|
58543
|
-
|
|
58544
|
-
|
|
58545
|
-
|
|
58546
|
-
|
|
58547
|
-
} : {
|
|
58543
|
+
// convertData = isMobile && !readonly ? {
|
|
58544
|
+
// type: "native-time",
|
|
58545
|
+
// pipeIn: (value, data) => {
|
|
58546
|
+
// if (value) {
|
|
58547
|
+
// value = moment(value).utc().format('HH:mm');
|
|
58548
|
+
// return value;
|
|
58549
|
+
// } else {
|
|
58550
|
+
// return "";
|
|
58551
|
+
// }
|
|
58552
|
+
|
|
58553
|
+
// },
|
|
58554
|
+
// pipeOut: (value, oldValue, data) => {
|
|
58555
|
+
// if (value) {
|
|
58556
|
+
// value = moment('1970-01-01 ' + value).format('1970-01-01THH:mm:00.000[Z]');
|
|
58557
|
+
// return value;
|
|
58558
|
+
// } else {
|
|
58559
|
+
// return "";
|
|
58560
|
+
// }
|
|
58561
|
+
// }
|
|
58562
|
+
// } : {
|
|
58563
|
+
// type: getAmisStaticFieldType('time', readonly),
|
|
58564
|
+
// inputFormat: 'HH:mm',
|
|
58565
|
+
// timeFormat:'HH:mm',
|
|
58566
|
+
// format:'1970-01-01THH:mm:00.000[Z]',
|
|
58567
|
+
// tpl: readonly ? Tpl.getDateTimeTpl(field) : null,
|
|
58568
|
+
// // utc: true
|
|
58569
|
+
// }
|
|
58570
|
+
convertData = {
|
|
58548
58571
|
type: getAmisStaticFieldType('time', readonly),
|
|
58549
58572
|
inputFormat: 'HH:mm',
|
|
58550
58573
|
timeFormat:'HH:mm',
|
|
@@ -59004,7 +59027,7 @@ var config = {
|
|
|
59004
59027
|
async function getQuickEditSchema(field, options){
|
|
59005
59028
|
//判断在amis3.2以上环境下,放开批量编辑
|
|
59006
59029
|
const isAmisVersionforBatchEdit = amisRequire('amis').version[0] >= 3 && amisRequire('amis').version[2] >= 2;
|
|
59007
|
-
const quickEditId = options.objectName + "_" + field.name + "
|
|
59030
|
+
const quickEditId = options.objectName + "_" + field.name + "_quickEdit";//定义快速编辑的表单id,用于setvalue传值
|
|
59008
59031
|
var quickEditSchema = { body: [], id: quickEditId };
|
|
59009
59032
|
//select,avatar,image,file等组件无法行记录字段赋值,暂不支持批量编辑;
|
|
59010
59033
|
if(field.type != 'avatar' && field.type != 'image' && field.type != 'file' && isAmisVersionforBatchEdit){
|
|
@@ -59014,19 +59037,16 @@ async function getQuickEditSchema(field, options){
|
|
|
59014
59037
|
{
|
|
59015
59038
|
actionType: "custom",
|
|
59016
59039
|
script: `
|
|
59017
|
-
|
|
59018
|
-
|
|
59040
|
+
let items = _.cloneDeep(event.data.items);
|
|
59041
|
+
let selectedItems = _.cloneDeep(event.data.selectedItems);
|
|
59019
59042
|
if(event.data.isBatchEdit){
|
|
59020
59043
|
selectedItems.forEach(function(selectedItem){
|
|
59021
|
-
|
|
59022
|
-
|
|
59023
|
-
doAction({actionType: 'setValue', "args": {"value": {items}},componentId: "${options.crudId}","dataMergeMode": "override"});
|
|
59024
|
-
selectedItems.forEach(function(selectedItem){
|
|
59044
|
+
selectedItem._display.${field.name} = event.data._display.${field.name};
|
|
59045
|
+
doAction({actionType: 'setValue', "args": {"value": selectedItem._display},componentId: "_display_" + selectedItem._index});
|
|
59025
59046
|
doAction({actionType: 'setValue', "args": {"value": event.data.${field.name}},componentId: "${options.objectName + "_" + field.name + "_"}" + selectedItem._index});
|
|
59026
59047
|
})
|
|
59027
59048
|
}else{
|
|
59028
|
-
|
|
59029
|
-
doAction({actionType: 'setValue', "args": {"value": {items}},componentId: "${options.crudId}","dataMergeMode": "override"});
|
|
59049
|
+
doAction({actionType: 'setValue', "args": {"value": event.data._display},componentId: "_display_" + event.data._index});
|
|
59030
59050
|
doAction({actionType: 'setValue', "args": {"value": event.data.${field.name}},componentId: "${options.objectName + "_" + field.name + "_"}" + event.data._index});
|
|
59031
59051
|
}
|
|
59032
59052
|
`
|
|
@@ -59056,7 +59076,7 @@ async function getQuickEditSchema(field, options){
|
|
|
59056
59076
|
{
|
|
59057
59077
|
"actionType": "custom",
|
|
59058
59078
|
"script": `
|
|
59059
|
-
var _display = event.data._display;
|
|
59079
|
+
var _display = _.cloneDeep(event.data._display);
|
|
59060
59080
|
${displayField}
|
|
59061
59081
|
doAction({actionType: 'setValue', "args": {"value": {_display}},componentId: "${quickEditId}"});
|
|
59062
59082
|
`
|
|
@@ -59078,7 +59098,7 @@ async function getQuickEditSchema(field, options){
|
|
|
59078
59098
|
第二种是增加选项时,按照value的值,找到对应选项,并按照_display的规则为其赋值
|
|
59079
59099
|
*/
|
|
59080
59100
|
TempDisplayField = `
|
|
59081
|
-
const preData = event.data.__super.${field.name};
|
|
59101
|
+
const preData = _.cloneDeep(event.data.__super.${field.name});
|
|
59082
59102
|
if(preData && event.data.${field.name}.length < preData.length){
|
|
59083
59103
|
let deletedIndex;
|
|
59084
59104
|
preData.forEach(function(item,index){
|
|
@@ -59277,8 +59297,124 @@ async function getQuickEditSchema(field, options){
|
|
|
59277
59297
|
quickEditSchema.body.push({
|
|
59278
59298
|
"name": "isBatchEdit",
|
|
59279
59299
|
"type": "checkbox",
|
|
59280
|
-
"option":
|
|
59281
|
-
|
|
59300
|
+
"option": [
|
|
59301
|
+
{
|
|
59302
|
+
"type": "tpl",
|
|
59303
|
+
"tpl": "更新${COUNT(selectedItems)}个选定记录"
|
|
59304
|
+
},
|
|
59305
|
+
{
|
|
59306
|
+
"type": "spinner",
|
|
59307
|
+
"showOn": "${batchPermissionLoading}",
|
|
59308
|
+
"size": "sm",
|
|
59309
|
+
"className": "mr-4"
|
|
59310
|
+
}
|
|
59311
|
+
],
|
|
59312
|
+
"visibleOn": "${ARRAYSOME(selectedItems, item => item._id === _id) && COUNT(selectedItems)>1 && quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}",
|
|
59313
|
+
"disabledOn": "${batchPermissionLoading}",
|
|
59314
|
+
"onEvent":{
|
|
59315
|
+
"change":{
|
|
59316
|
+
"actions":[
|
|
59317
|
+
{
|
|
59318
|
+
"actionType": "setValue",
|
|
59319
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
59320
|
+
"args": {
|
|
59321
|
+
"value":{
|
|
59322
|
+
"batchPermissionLoading": true
|
|
59323
|
+
}
|
|
59324
|
+
},
|
|
59325
|
+
"expression":"${event.data.value}"
|
|
59326
|
+
},
|
|
59327
|
+
{
|
|
59328
|
+
"actionType": "ajax",
|
|
59329
|
+
"args": {
|
|
59330
|
+
"api": {
|
|
59331
|
+
"url": "${context.rootUrl}/graphql",
|
|
59332
|
+
"method": "post",
|
|
59333
|
+
"headers": {
|
|
59334
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
59335
|
+
},
|
|
59336
|
+
"data": {
|
|
59337
|
+
"query": "{rows:${objectName}(filters:[\"_id\",\"in\",${selectedItems | pick:_id | split | json}]){_id,_permissions{allowEdit}}}"
|
|
59338
|
+
},
|
|
59339
|
+
"adaptor": `
|
|
59340
|
+
const noPermission = [];
|
|
59341
|
+
payload.data.rows.forEach(function (row) {
|
|
59342
|
+
if(!row._permissions.allowEdit){
|
|
59343
|
+
noPermission.push(row._id);
|
|
59344
|
+
}
|
|
59345
|
+
})
|
|
59346
|
+
return payload = {data:{noPermission}};
|
|
59347
|
+
`
|
|
59348
|
+
}
|
|
59349
|
+
},
|
|
59350
|
+
"expression":"${event.data.value}"
|
|
59351
|
+
},
|
|
59352
|
+
{
|
|
59353
|
+
"actionType": "setValue",
|
|
59354
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
59355
|
+
"args": {
|
|
59356
|
+
"value":{
|
|
59357
|
+
"batchPermissionLoading": false
|
|
59358
|
+
}
|
|
59359
|
+
},
|
|
59360
|
+
"expression":"${event.data.value}"
|
|
59361
|
+
},
|
|
59362
|
+
{
|
|
59363
|
+
"actionType": "dialog",
|
|
59364
|
+
"dialog":{
|
|
59365
|
+
"title": "记录权限",
|
|
59366
|
+
"showCloseButton": false,
|
|
59367
|
+
"body":[
|
|
59368
|
+
{
|
|
59369
|
+
"type": "tpl",
|
|
59370
|
+
"tpl": "当前选中记录中,有${COUNT(noPermission)}条记录无编辑权限,是否需要批量编辑其他记录?"
|
|
59371
|
+
}
|
|
59372
|
+
],
|
|
59373
|
+
"onEvent":{
|
|
59374
|
+
"confirm":{
|
|
59375
|
+
"actions":[
|
|
59376
|
+
{
|
|
59377
|
+
"actionType": "custom",
|
|
59378
|
+
"script": `
|
|
59379
|
+
const noPermission = event.data.noPermission;
|
|
59380
|
+
const crudComponent = event.context.scoped.getComponentById("${options.crudId}");
|
|
59381
|
+
const selectedItems = crudComponent && crudComponent.props.store.selectedItems.concat();
|
|
59382
|
+
noPermission.forEach(function (item) {
|
|
59383
|
+
crudComponent && crudComponent.unSelectItem(_.find(selectedItems,{_id:item}));
|
|
59384
|
+
})
|
|
59385
|
+
`
|
|
59386
|
+
},
|
|
59387
|
+
{
|
|
59388
|
+
"actionType": "setValue",
|
|
59389
|
+
"componentId": quickEditId,
|
|
59390
|
+
"args": {
|
|
59391
|
+
"value":{
|
|
59392
|
+
"isBatchEdit": true
|
|
59393
|
+
}
|
|
59394
|
+
},
|
|
59395
|
+
}
|
|
59396
|
+
]
|
|
59397
|
+
},
|
|
59398
|
+
"cancel":{
|
|
59399
|
+
"actions":[
|
|
59400
|
+
{
|
|
59401
|
+
"actionType": "setValue",
|
|
59402
|
+
"componentId": quickEditId,
|
|
59403
|
+
"args": {
|
|
59404
|
+
"value":{
|
|
59405
|
+
"isBatchEdit": false
|
|
59406
|
+
}
|
|
59407
|
+
},
|
|
59408
|
+
}
|
|
59409
|
+
]
|
|
59410
|
+
}
|
|
59411
|
+
}
|
|
59412
|
+
},
|
|
59413
|
+
"expression":"${COUNT(event.data.noPermission)>0}"
|
|
59414
|
+
}
|
|
59415
|
+
]
|
|
59416
|
+
}
|
|
59417
|
+
}
|
|
59282
59418
|
});
|
|
59283
59419
|
}
|
|
59284
59420
|
} else {
|
|
@@ -59315,6 +59451,8 @@ async function getTableColumns(fields, options){
|
|
|
59315
59451
|
const columns = [];
|
|
59316
59452
|
if(!options.isLookup){
|
|
59317
59453
|
columns.push({name: '_index',type: 'text', width: 32, placeholder: ""});
|
|
59454
|
+
//将_display放入crud的columns中,可以通过setvalue修改行内数据域的_display,而不影响上层items的_display,用于批量编辑
|
|
59455
|
+
columns.push({name: '_display',type: 'static', width: 32, placeholder: "",id: "_display_${_index}", className: "hidden"});
|
|
59318
59456
|
}
|
|
59319
59457
|
const allowEdit = options.permissions?.allowEdit && !options.isLookup && options.enable_inline_edit != false;
|
|
59320
59458
|
|