@steedos-widgets/sortable 1.3.4-beta.18 → 1.3.4-beta.19
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 +51 -6
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +51 -6
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +51 -6
- package/package.json +3 -3
package/dist/sortable.esm.js
CHANGED
|
@@ -57873,10 +57873,10 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
57873
57873
|
|
|
57874
57874
|
const refObject = await getUISchema(referenceTo.objectName);
|
|
57875
57875
|
|
|
57876
|
-
//
|
|
57877
|
-
|
|
57878
|
-
//
|
|
57879
|
-
if(
|
|
57876
|
+
// 优先取字段中配置的enable_enhanced_lookup,字段上没配置时,才从对象上取enable_enhanced_lookup属性
|
|
57877
|
+
let enableEnhancedLookup = lodash.exports.isBoolean(field.enable_enhanced_lookup) ? field.enable_enhanced_lookup : refObject.enable_enhanced_lookup;
|
|
57878
|
+
// 默认使用下拉框模式显示lookup选项,只能配置了enable_enhanced_lookup才使用弹出增强模式
|
|
57879
|
+
if(enableEnhancedLookup == true){
|
|
57880
57880
|
return await lookupToAmisPicker(field, readonly, ctx);
|
|
57881
57881
|
}else if(refObject.enable_tree) {
|
|
57882
57882
|
return await lookupToAmisTreeSelect(field, readonly, Object.assign({}, ctx, {
|
|
@@ -59002,8 +59002,44 @@ var config = {
|
|
|
59002
59002
|
};
|
|
59003
59003
|
|
|
59004
59004
|
async function getQuickEditSchema(field, options){
|
|
59005
|
+
//判断在amis3.2以上环境下,放开批量编辑
|
|
59006
|
+
const isAmisVersionforBatchEdit = amisRequire('amis').version[0] >= 3 && amisRequire('amis').version[2] >= 2;
|
|
59005
59007
|
const quickEditId = options.objectName + "_" + field.name + "QuickEdit";//定义快速编辑的表单id,用于setvalue传值
|
|
59006
59008
|
var quickEditSchema = { body: [], id: quickEditId };
|
|
59009
|
+
//select,avatar,image,file等组件无法行记录字段赋值,暂不支持批量编辑;
|
|
59010
|
+
if(field.type != 'avatar' && field.type != 'image' && field.type != 'file' && isAmisVersionforBatchEdit){
|
|
59011
|
+
const submitEvent = {
|
|
59012
|
+
submit: {
|
|
59013
|
+
actions: [
|
|
59014
|
+
{
|
|
59015
|
+
actionType: "custom",
|
|
59016
|
+
script: `
|
|
59017
|
+
const items = event.data.items;
|
|
59018
|
+
const selectedItems = event.data.selectedItems;
|
|
59019
|
+
if(event.data.isBatchEdit){
|
|
59020
|
+
selectedItems.forEach(function(selectedItem){
|
|
59021
|
+
items[selectedItem._index-1]._display.${field.name} = event.data._display.${field.name};
|
|
59022
|
+
})
|
|
59023
|
+
doAction({actionType: 'setValue', "args": {"value": {items}},componentId: "${options.crudId}","dataMergeMode": "override"});
|
|
59024
|
+
selectedItems.forEach(function(selectedItem){
|
|
59025
|
+
doAction({actionType: 'setValue', "args": {"value": event.data.${field.name}},componentId: "${options.objectName + "_" + field.name + "_"}" + selectedItem._index});
|
|
59026
|
+
})
|
|
59027
|
+
}else{
|
|
59028
|
+
items[event.data._index-1]._display.${field.name} = event.data._display.${field.name};
|
|
59029
|
+
doAction({actionType: 'setValue', "args": {"value": {items}},componentId: "${options.crudId}","dataMergeMode": "override"});
|
|
59030
|
+
doAction({actionType: 'setValue', "args": {"value": event.data.${field.name}},componentId: "${options.objectName + "_" + field.name + "_"}" + event.data._index});
|
|
59031
|
+
}
|
|
59032
|
+
`
|
|
59033
|
+
},
|
|
59034
|
+
{
|
|
59035
|
+
"actionType": "closeDialog"
|
|
59036
|
+
}
|
|
59037
|
+
]
|
|
59038
|
+
}
|
|
59039
|
+
};
|
|
59040
|
+
quickEditSchema.onEvent = submitEvent;
|
|
59041
|
+
}
|
|
59042
|
+
|
|
59007
59043
|
if (field.disabled) {
|
|
59008
59044
|
quickEditSchema = false;
|
|
59009
59045
|
} else {
|
|
@@ -59237,6 +59273,14 @@ async function getQuickEditSchema(field, options){
|
|
|
59237
59273
|
}
|
|
59238
59274
|
|
|
59239
59275
|
});
|
|
59276
|
+
if(field.type != 'avatar' && field.type != 'image' && field.type != 'file' && isAmisVersionforBatchEdit){
|
|
59277
|
+
quickEditSchema.body.push({
|
|
59278
|
+
"name": "isBatchEdit",
|
|
59279
|
+
"type": "checkbox",
|
|
59280
|
+
"option": "更新${COUNT(selectedItems)}个选定记录",
|
|
59281
|
+
"visibleOn": "${ARRAYSOME(selectedItems, item => item._id === _id) && COUNT(selectedItems)>1}"
|
|
59282
|
+
});
|
|
59283
|
+
}
|
|
59240
59284
|
} else {
|
|
59241
59285
|
quickEditSchema = false;
|
|
59242
59286
|
}
|
|
@@ -59349,7 +59393,7 @@ async function getTableColumns(fields, options){
|
|
|
59349
59393
|
else if(field.type === 'select'){
|
|
59350
59394
|
const map = getSelectMap(field.options);
|
|
59351
59395
|
columnItem = Object.assign({}, {
|
|
59352
|
-
type: "mapping",
|
|
59396
|
+
type: "static-mapping",
|
|
59353
59397
|
name: field.name,
|
|
59354
59398
|
label: field.label,
|
|
59355
59399
|
map: map,
|
|
@@ -59364,7 +59408,7 @@ async function getTableColumns(fields, options){
|
|
|
59364
59408
|
const tpl = await getFieldTpl(field, options);
|
|
59365
59409
|
let type = 'text';
|
|
59366
59410
|
if(tpl){
|
|
59367
|
-
type = '
|
|
59411
|
+
type = 'static';
|
|
59368
59412
|
}else if(field.type === 'html'){
|
|
59369
59413
|
type = 'markdown';
|
|
59370
59414
|
}else if(field.type === 'url'){
|
|
@@ -59405,6 +59449,7 @@ async function getTableColumns(fields, options){
|
|
|
59405
59449
|
columnItem.quickEdit = quickEditSchema;
|
|
59406
59450
|
columnItem.quickEditEnabledOn = "${is_system !== true}";
|
|
59407
59451
|
}
|
|
59452
|
+
columnItem.id = `${options.objectName}_${field.name}_\${_index}`;
|
|
59408
59453
|
columns.push(columnItem);
|
|
59409
59454
|
}
|
|
59410
59455
|
}
|