@steedos-widgets/sortable 3.6.0-beta.4 → 3.6.0-beta.5
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 +92 -18
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +92 -18
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +92 -18
- package/package.json +3 -3
package/dist/sortable.esm.js
CHANGED
|
@@ -54116,7 +54116,7 @@ function getNameTpl(field, ctx){
|
|
|
54116
54116
|
if(ctx && ctx.isLookup){
|
|
54117
54117
|
linkTarget = "target='_blank'";
|
|
54118
54118
|
}
|
|
54119
|
-
return `<a href="${href}" ${linkTarget}>\${${field.name}}</a>`
|
|
54119
|
+
return `<a href="${href}" ${linkTarget}>\${${field.name} | raw}</a>`
|
|
54120
54120
|
}
|
|
54121
54121
|
|
|
54122
54122
|
function getRelatedFieldTpl(field, ctx){
|
|
@@ -54441,7 +54441,7 @@ function getAmisStaticFieldType(type, readonly, options){
|
|
|
54441
54441
|
* @Author: baozhoutao@steedos.com
|
|
54442
54442
|
* @Date: 2022-10-28 14:15:09
|
|
54443
54443
|
* @LastEditors: liaodaxue
|
|
54444
|
-
* @LastEditTime: 2023-
|
|
54444
|
+
* @LastEditTime: 2023-12-29 10:46:50
|
|
54445
54445
|
* @Description:
|
|
54446
54446
|
*/
|
|
54447
54447
|
|
|
@@ -54495,7 +54495,8 @@ const getAmisFileEditSchema = (steedosField)=>{
|
|
|
54495
54495
|
dataType: "form-data",
|
|
54496
54496
|
url: `\${context.rootUrl}/s3/${tableName}`,
|
|
54497
54497
|
requestAdaptor: `
|
|
54498
|
-
const
|
|
54498
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
54499
|
+
const { _master, global } = superData;
|
|
54499
54500
|
// const { recordId, objectName } = _master;
|
|
54500
54501
|
const { spaceId, userId, user } = global;
|
|
54501
54502
|
/*
|
|
@@ -54513,8 +54514,9 @@ const getAmisFileEditSchema = (steedosField)=>{
|
|
|
54513
54514
|
return api;
|
|
54514
54515
|
`,
|
|
54515
54516
|
adaptor: `
|
|
54516
|
-
const
|
|
54517
|
-
|
|
54517
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
54518
|
+
const { context:pageContext } = superData;
|
|
54519
|
+
var rootUrl = pageContext.rootUrl + "/api/files/${tableName}/";
|
|
54518
54520
|
payload = {
|
|
54519
54521
|
status: response.status == 200 ? 0 : response.status,
|
|
54520
54522
|
msg: response.statusText,
|
|
@@ -55118,8 +55120,9 @@ async function getQuickEditSchema(field, options){
|
|
|
55118
55120
|
case "avatar":
|
|
55119
55121
|
case "image":
|
|
55120
55122
|
quickEditSchema.body[0].receiver.adaptor = `
|
|
55121
|
-
const
|
|
55122
|
-
|
|
55123
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
55124
|
+
const { context:pageContext } = superData;
|
|
55125
|
+
var rootUrl = pageContext.rootUrl + "/api/files/${field.type}s/";
|
|
55123
55126
|
payload = {
|
|
55124
55127
|
status: response.status == 200 ? 0 : response.status,
|
|
55125
55128
|
msg: response.statusText,
|
|
@@ -55782,7 +55785,7 @@ async function getTableOperation(ctx){
|
|
|
55782
55785
|
type: 'steedos-object-button',
|
|
55783
55786
|
name: button.name,
|
|
55784
55787
|
objectName: button.objectName,
|
|
55785
|
-
|
|
55788
|
+
visibleOnAlias: getButtonVisibleOn$1(button),
|
|
55786
55789
|
className: 'antd-Button--default'
|
|
55787
55790
|
});
|
|
55788
55791
|
});
|
|
@@ -55907,7 +55910,8 @@ async function getTableSchema$1(fields, options){
|
|
|
55907
55910
|
}
|
|
55908
55911
|
|
|
55909
55912
|
if(!isLookup && !hiddenColumnOperation){
|
|
55910
|
-
|
|
55913
|
+
const toolbarOperation = await getTableOperation(options);
|
|
55914
|
+
columns.push(toolbarOperation);
|
|
55911
55915
|
}
|
|
55912
55916
|
|
|
55913
55917
|
}
|
|
@@ -56429,6 +56433,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
56429
56433
|
`;
|
|
56430
56434
|
const onCancelScript = `
|
|
56431
56435
|
// console.log("===onCancelScript=form==");
|
|
56436
|
+
let isLookup = event.data.isLookup;
|
|
56437
|
+
let __lookupField = event.data.__lookupField;
|
|
56432
56438
|
const scope = event.context.scoped;
|
|
56433
56439
|
var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
56434
56440
|
return n.props.type === "form";
|
|
@@ -56476,7 +56482,20 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
56476
56482
|
// });
|
|
56477
56483
|
|
|
56478
56484
|
// 清除__changedFilterFormValues中的值
|
|
56479
|
-
crud && crud.setData({__changedFilterFormValues: {}});
|
|
56485
|
+
// crud && crud.setData({__changedFilterFormValues: {}});
|
|
56486
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
56487
|
+
if(isLookup && __lookupField){
|
|
56488
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
56489
|
+
if(__lookupField.reference_to_field){
|
|
56490
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
56491
|
+
}
|
|
56492
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
56493
|
+
}
|
|
56494
|
+
if(crud){
|
|
56495
|
+
let crudData = crud.getData();
|
|
56496
|
+
crudData[__changedFilterFormValuesKey] = {};
|
|
56497
|
+
crud.setData(crudData);
|
|
56498
|
+
}
|
|
56480
56499
|
filterForm.handleFormSubmit(event);
|
|
56481
56500
|
// crud.handleFilterSubmit(removedValues);
|
|
56482
56501
|
|
|
@@ -57943,7 +57962,12 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57943
57962
|
__changedSearchBoxValues["${keywordsSearchBoxName}"] = event.data["${keywordsSearchBoxName}"];
|
|
57944
57963
|
// crudService && crudService.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
57945
57964
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
57946
|
-
crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
57965
|
+
// crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
57966
|
+
if(crud){
|
|
57967
|
+
let crudData = crud.getData();
|
|
57968
|
+
crudData.__changedSearchBoxValues = __changedSearchBoxValues;
|
|
57969
|
+
crud.setData(crudData);
|
|
57970
|
+
}
|
|
57947
57971
|
`;
|
|
57948
57972
|
|
|
57949
57973
|
// onSearchScript中加上了onChangeScript中的脚本,是因为amis 3.2不能用change事件执行onChangeScript
|
|
@@ -57956,9 +57980,19 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57956
57980
|
// const scope = event.context.scoped;
|
|
57957
57981
|
// 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
|
|
57958
57982
|
// 点击取消按钮后继续在表单项中输入过滤条件且最后没有点击回车按键或点击表单项搜索按钮的话,在快速搜索中点击回车按钮提交搜索会所顶部搜索表单中的字段值清空
|
|
57983
|
+
let isLookup = event.data.isLookup;
|
|
57984
|
+
let __lookupField = event.data.__lookupField;
|
|
57985
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
57986
|
+
if(isLookup && __lookupField){
|
|
57987
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
57988
|
+
if(__lookupField.reference_to_field){
|
|
57989
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
57990
|
+
}
|
|
57991
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
57992
|
+
}
|
|
57959
57993
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
57960
57994
|
setTimeout(function(){
|
|
57961
|
-
filterForm.setValues(event.data
|
|
57995
|
+
filterForm.setValues(event.data[__changedFilterFormValuesKey]);
|
|
57962
57996
|
}, 500);
|
|
57963
57997
|
`;
|
|
57964
57998
|
|
|
@@ -57979,8 +58013,8 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
57979
58013
|
"name": keywordsSearchBoxName,
|
|
57980
58014
|
"placeholder": "搜索此列表",
|
|
57981
58015
|
"value": crudKeywords,
|
|
57982
|
-
"clearable": true
|
|
57983
|
-
|
|
58016
|
+
// "clearable": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
|
|
58017
|
+
"clearAndSubmit": true,
|
|
57984
58018
|
"searchImediately": false,
|
|
57985
58019
|
"onEvent": {
|
|
57986
58020
|
"search": {
|
|
@@ -58260,6 +58294,9 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58260
58294
|
crudService && crudService.setData({isFieldsFilterEmpty});
|
|
58261
58295
|
`;
|
|
58262
58296
|
let onChangeScript = `
|
|
58297
|
+
let isLookup = event.data.isLookup;
|
|
58298
|
+
let __lookupField = event.data.__lookupField;
|
|
58299
|
+
console.log("==onChangeScript=isLookup===", isLookup);
|
|
58263
58300
|
const scope = event.context.scoped;
|
|
58264
58301
|
// let filterFormValues = event.data;
|
|
58265
58302
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
@@ -58271,7 +58308,20 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58271
58308
|
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
58272
58309
|
// crudService && crudService.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
58273
58310
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
58274
|
-
crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
58311
|
+
// crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
58312
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
58313
|
+
if(isLookup && __lookupField){
|
|
58314
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
58315
|
+
if(__lookupField.reference_to_field){
|
|
58316
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
58317
|
+
}
|
|
58318
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
58319
|
+
}
|
|
58320
|
+
if(crud){
|
|
58321
|
+
let crudData = crud.getData();
|
|
58322
|
+
crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
|
|
58323
|
+
crud.setData(crudData);
|
|
58324
|
+
}
|
|
58275
58325
|
`;
|
|
58276
58326
|
return {
|
|
58277
58327
|
"title": "",
|
|
@@ -59086,13 +59136,24 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59086
59136
|
let keywordsSearchBoxName = `__keywords_lookup__${field.name.replace(/\./g, "_")}__to__${refObjectConfig.name}`;
|
|
59087
59137
|
|
|
59088
59138
|
source.requestAdaptor = `
|
|
59089
|
-
let
|
|
59139
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
59140
|
+
let __lookupField = api.data.$self.__lookupField;
|
|
59141
|
+
if(__lookupField){
|
|
59142
|
+
let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
59143
|
+
if(__lookupField.reference_to_field){
|
|
59144
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
59145
|
+
}
|
|
59146
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
59147
|
+
}
|
|
59148
|
+
let __changedFilterFormValues = api.data.$self[__changedFilterFormValuesKey] || {};
|
|
59090
59149
|
let __changedSearchBoxValues = api.data.$self.__changedSearchBoxValues || {};
|
|
59091
59150
|
// 把表单搜索和快速搜索中的change事件中记录的过滤条件也拼到$self中,是为解决触发搜索请求时,两边输入的过滤条件都带上,即:
|
|
59092
59151
|
// 有时在搜索表单中输入过滤条件事,忘记点击回车键或搜索按钮,而是进一步修改快速搜索框中的关键字点击其中回车键触发搜索
|
|
59093
59152
|
// 这种情况下,触发的搜索请求中没有带上搜索表单中输入的过滤条件。
|
|
59094
59153
|
// 反过来先在快速搜索框中输入过滤条件却不点击其中回车键触发搜索,而是到搜索表单中触发搜索请求也是一样的。
|
|
59095
|
-
|
|
59154
|
+
if(api.data.$self.op !== 'loadOptions'){
|
|
59155
|
+
Object.assign(api.data.$self, __changedSearchBoxValues, __changedFilterFormValues);
|
|
59156
|
+
}
|
|
59096
59157
|
const selfData = JSON.parse(JSON.stringify(api.data.$self));
|
|
59097
59158
|
var filters = [];
|
|
59098
59159
|
var pageSize = api.data.pageSize || 10;
|
|
@@ -59299,7 +59360,12 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59299
59360
|
"objectName": refObjectConfig.name,
|
|
59300
59361
|
"uiSchema": refObjectConfig,
|
|
59301
59362
|
"listName": listName,// 需要按视图取可搜索项
|
|
59302
|
-
"isLookup": true
|
|
59363
|
+
"isLookup": true,
|
|
59364
|
+
"__lookupField": {
|
|
59365
|
+
"name": field.name,
|
|
59366
|
+
"reference_to": refObjectConfig.name,
|
|
59367
|
+
"reference_to_field": field.reference_to_field
|
|
59368
|
+
}
|
|
59303
59369
|
});
|
|
59304
59370
|
|
|
59305
59371
|
if(!pickerSchema.onEvent){
|
|
@@ -59668,6 +59734,14 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
59668
59734
|
|
|
59669
59735
|
// 优先取字段中配置的enable_enhanced_lookup,字段上没配置时,才从对象上取enable_enhanced_lookup属性
|
|
59670
59736
|
let enableEnhancedLookup = lodash.exports.isBoolean(field.enable_enhanced_lookup) ? field.enable_enhanced_lookup : refObject.enable_enhanced_lookup;
|
|
59737
|
+
let amisVersion = getComparableAmisVersion();
|
|
59738
|
+
if(amisVersion >= 3.6){
|
|
59739
|
+
// amis 3.6.3单选的树picker有严重bug(https://github.com/baidu/amis/issues/9279),先强制使用下拉方式显示
|
|
59740
|
+
// amis 3.6.3多选的树会自动把下层节点,及下下层等所有子节点自动选中,跟amis 3.2不一样,而且目前没有开关,这不适合目前的业务场景,也先强制使用下拉方式显示
|
|
59741
|
+
if(enableEnhancedLookup && refObject.enable_tree){
|
|
59742
|
+
enableEnhancedLookup = false;
|
|
59743
|
+
}
|
|
59744
|
+
}
|
|
59671
59745
|
// 默认使用下拉框模式显示lookup选项,只能配置了enable_enhanced_lookup才使用弹出增强模式
|
|
59672
59746
|
if(enableEnhancedLookup == true){
|
|
59673
59747
|
return await lookupToAmisPicker(field, readonly, ctx);
|