@steedos-widgets/sortable 1.3.22-beta.4 → 3.6.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 +219 -66
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +219 -66
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +219 -66
- package/package.json +3 -3
package/dist/sortable.umd.js
CHANGED
|
@@ -20280,8 +20280,8 @@
|
|
|
20280
20280
|
/*
|
|
20281
20281
|
* @Author: baozhoutao@steedos.com
|
|
20282
20282
|
* @Date: 2022-07-20 16:29:22
|
|
20283
|
-
* @LastEditors:
|
|
20284
|
-
* @LastEditTime: 2023-
|
|
20283
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
20284
|
+
* @LastEditTime: 2023-12-28 14:59:08
|
|
20285
20285
|
* @Description:
|
|
20286
20286
|
*/
|
|
20287
20287
|
|
|
@@ -20338,6 +20338,21 @@
|
|
|
20338
20338
|
return listView;
|
|
20339
20339
|
}
|
|
20340
20340
|
|
|
20341
|
+
|
|
20342
|
+
/**
|
|
20343
|
+
* 获取可比较的amis版本号
|
|
20344
|
+
* @returns 只返回前两位版本,第三位忽略,比如3.6.3返回3.6
|
|
20345
|
+
*/
|
|
20346
|
+
function getComparableAmisVersion() {
|
|
20347
|
+
let amis = (window.amisRequire && window.amisRequire('amis')) || window.Amis;
|
|
20348
|
+
let amisVersion = amis && amis.version;
|
|
20349
|
+
if(amisVersion){
|
|
20350
|
+
let comparableVersions = amisVersion.split(".");
|
|
20351
|
+
let comparableVersion = parseFloat(comparableVersions[0].toString() + "." + comparableVersions[1].toString());
|
|
20352
|
+
return comparableVersion;
|
|
20353
|
+
}
|
|
20354
|
+
}
|
|
20355
|
+
|
|
20341
20356
|
function getNumberTpl(field){
|
|
20342
20357
|
return `<span>\${_display.${field.name}}</span>`
|
|
20343
20358
|
}
|
|
@@ -20406,7 +20421,7 @@
|
|
|
20406
20421
|
if(ctx && ctx.isLookup){
|
|
20407
20422
|
linkTarget = "target='_blank'";
|
|
20408
20423
|
}
|
|
20409
|
-
return `<a href="${href}" ${linkTarget}>\${${field.name}}</a>`
|
|
20424
|
+
return `<a href="${href}" ${linkTarget}>\${${field.name} | raw}</a>`
|
|
20410
20425
|
}
|
|
20411
20426
|
|
|
20412
20427
|
function getRelatedFieldTpl(field, ctx){
|
|
@@ -20731,7 +20746,7 @@
|
|
|
20731
20746
|
* @Author: baozhoutao@steedos.com
|
|
20732
20747
|
* @Date: 2022-10-28 14:15:09
|
|
20733
20748
|
* @LastEditors: liaodaxue
|
|
20734
|
-
* @LastEditTime: 2023-
|
|
20749
|
+
* @LastEditTime: 2023-12-29 10:46:50
|
|
20735
20750
|
* @Description:
|
|
20736
20751
|
*/
|
|
20737
20752
|
|
|
@@ -20785,7 +20800,8 @@
|
|
|
20785
20800
|
dataType: "form-data",
|
|
20786
20801
|
url: `\${context.rootUrl}/s3/${tableName}`,
|
|
20787
20802
|
requestAdaptor: `
|
|
20788
|
-
const
|
|
20803
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
20804
|
+
const { _master, global } = superData;
|
|
20789
20805
|
// const { recordId, objectName } = _master;
|
|
20790
20806
|
const { spaceId, userId, user } = global;
|
|
20791
20807
|
/*
|
|
@@ -20803,8 +20819,9 @@
|
|
|
20803
20819
|
return api;
|
|
20804
20820
|
`,
|
|
20805
20821
|
adaptor: `
|
|
20806
|
-
const
|
|
20807
|
-
|
|
20822
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
20823
|
+
const { context:pageContext } = superData;
|
|
20824
|
+
var rootUrl = pageContext.rootUrl + "/api/files/${tableName}/";
|
|
20808
20825
|
payload = {
|
|
20809
20826
|
status: response.status == 200 ? 0 : response.status,
|
|
20810
20827
|
msg: response.statusText,
|
|
@@ -21270,7 +21287,6 @@
|
|
|
21270
21287
|
{
|
|
21271
21288
|
"actionType": "custom",
|
|
21272
21289
|
"script": `
|
|
21273
|
-
|
|
21274
21290
|
var _display = _.cloneDeep(event.data._display);
|
|
21275
21291
|
${displayField}
|
|
21276
21292
|
doAction({actionType: 'setValue', "args": {"value": {_display}},componentId: "${quickEditId}"});
|
|
@@ -21408,8 +21424,9 @@
|
|
|
21408
21424
|
case "avatar":
|
|
21409
21425
|
case "image":
|
|
21410
21426
|
quickEditSchema.body[0].receiver.adaptor = `
|
|
21411
|
-
const
|
|
21412
|
-
|
|
21427
|
+
const superData = (typeof context != 'undefined') ? context : api.body;
|
|
21428
|
+
const { context:pageContext } = superData;
|
|
21429
|
+
var rootUrl = pageContext.rootUrl + "/api/files/${field.type}s/";
|
|
21413
21430
|
payload = {
|
|
21414
21431
|
status: response.status == 200 ? 0 : response.status,
|
|
21415
21432
|
msg: response.statusText,
|
|
@@ -21440,9 +21457,26 @@
|
|
|
21440
21457
|
"onEvent":{
|
|
21441
21458
|
"init":{
|
|
21442
21459
|
"actions":[
|
|
21460
|
+
//amis3.6无法从数据域中直接拿到正确的selectitems,需要通过crud组件的getSelected()函数获取
|
|
21461
|
+
{
|
|
21462
|
+
"actionType": "custom",
|
|
21463
|
+
"script": `
|
|
21464
|
+
crudScoped = event.context.scoped.getComponentById('${options.crudId}');
|
|
21465
|
+
const selectedItems = crudScoped && crudScoped.control.getSelected();
|
|
21466
|
+
doAction({
|
|
21467
|
+
"componentId": "${quickEditId}",
|
|
21468
|
+
"actionType": "setValue",
|
|
21469
|
+
"args": {
|
|
21470
|
+
"value": {
|
|
21471
|
+
selectedItems
|
|
21472
|
+
}
|
|
21473
|
+
}
|
|
21474
|
+
});
|
|
21475
|
+
`
|
|
21476
|
+
},
|
|
21443
21477
|
{
|
|
21444
21478
|
"actionType": "setValue",
|
|
21445
|
-
"componentId":
|
|
21479
|
+
"componentId": quickEditId,
|
|
21446
21480
|
"args": {
|
|
21447
21481
|
"value":{
|
|
21448
21482
|
"quickedit_record_permissions_loading": true
|
|
@@ -21467,7 +21501,7 @@
|
|
|
21467
21501
|
},
|
|
21468
21502
|
{
|
|
21469
21503
|
"actionType": "setValue",
|
|
21470
|
-
"componentId":
|
|
21504
|
+
"componentId": quickEditId,
|
|
21471
21505
|
"args": {
|
|
21472
21506
|
"value":{
|
|
21473
21507
|
"quickedit_record_permissions_loading": false
|
|
@@ -21476,7 +21510,7 @@
|
|
|
21476
21510
|
},
|
|
21477
21511
|
{
|
|
21478
21512
|
"actionType": "setValue",
|
|
21479
|
-
"componentId":
|
|
21513
|
+
"componentId": quickEditId,
|
|
21480
21514
|
"args": {
|
|
21481
21515
|
"value":{
|
|
21482
21516
|
"quickedit_record_permissions": "${event.data}"
|
|
@@ -21655,8 +21689,6 @@
|
|
|
21655
21689
|
async function getTableColumns(fields, options){
|
|
21656
21690
|
const columns = [];
|
|
21657
21691
|
if(!options.isLookup && !options.isInputTable){
|
|
21658
|
-
//将_display放入crud的columns中,可以通过setvalue修改行内数据域的_display,而不影响上层items的_display,用于批量编辑
|
|
21659
|
-
columns.push({name: '_display',type: 'static', width: 32, placeholder: "",id: "_display_${_index}", className: "hidden"});
|
|
21660
21692
|
if(!options.enable_tree){
|
|
21661
21693
|
columns.push({name: '_index',type: 'text', width: 32, placeholder: ""});
|
|
21662
21694
|
}
|
|
@@ -21814,8 +21846,8 @@
|
|
|
21814
21846
|
const href = Router.getObjectDetailPath({
|
|
21815
21847
|
...options, formFactor: options.formFactor, appId: "${appId}", objectName: options.objectName || "${objectName}", recordId: `\${${options.idFieldName}}`
|
|
21816
21848
|
});
|
|
21817
|
-
columns[
|
|
21818
|
-
columns[
|
|
21849
|
+
columns[0].type = "tpl";
|
|
21850
|
+
columns[0].tpl = `<a href="${href}">\${${columns[0].name}}</a>`;
|
|
21819
21851
|
}
|
|
21820
21852
|
return columns;
|
|
21821
21853
|
}
|
|
@@ -22074,7 +22106,7 @@
|
|
|
22074
22106
|
type: 'steedos-object-button',
|
|
22075
22107
|
name: button.name,
|
|
22076
22108
|
objectName: button.objectName,
|
|
22077
|
-
|
|
22109
|
+
visibleOnAlias: getButtonVisibleOn$1(button),
|
|
22078
22110
|
className: 'antd-Button--default'
|
|
22079
22111
|
});
|
|
22080
22112
|
});
|
|
@@ -22199,8 +22231,18 @@
|
|
|
22199
22231
|
}
|
|
22200
22232
|
|
|
22201
22233
|
if(!isLookup && !hiddenColumnOperation){
|
|
22202
|
-
|
|
22234
|
+
const toolbarOperation = await getTableOperation(options);
|
|
22235
|
+
columns.push(toolbarOperation);
|
|
22203
22236
|
}
|
|
22237
|
+
|
|
22238
|
+
}
|
|
22239
|
+
|
|
22240
|
+
const treeConfig = {};
|
|
22241
|
+
|
|
22242
|
+
if(options.enable_tree){
|
|
22243
|
+
treeConfig.expandConfig = {
|
|
22244
|
+
expand: 'first'
|
|
22245
|
+
};
|
|
22204
22246
|
}
|
|
22205
22247
|
|
|
22206
22248
|
return {
|
|
@@ -22218,6 +22260,7 @@
|
|
|
22218
22260
|
labelTpl: `\${${options.labelFieldName}}`,
|
|
22219
22261
|
autoFillHeight: false, // 自动高度效果不理想,先关闭
|
|
22220
22262
|
columnsTogglable: false,
|
|
22263
|
+
...treeConfig
|
|
22221
22264
|
}
|
|
22222
22265
|
}
|
|
22223
22266
|
|
|
@@ -22682,12 +22725,16 @@
|
|
|
22682
22725
|
// }
|
|
22683
22726
|
// listView.handleFilterSubmit(Object.assign({}, removedValues, filterFormValues));
|
|
22684
22727
|
// 点击搜索的时候自动收起搜索栏
|
|
22685
|
-
|
|
22686
|
-
|
|
22687
|
-
|
|
22688
|
-
|
|
22689
|
-
|
|
22690
|
-
|
|
22728
|
+
//触发amis crud 高度重算
|
|
22729
|
+
doAction({
|
|
22730
|
+
"actionType": "broadcast",
|
|
22731
|
+
"args": {
|
|
22732
|
+
"eventName": "@height.changed.${objectSchema.name}"
|
|
22733
|
+
},
|
|
22734
|
+
"data": {
|
|
22735
|
+
"timeOut": 500
|
|
22736
|
+
}
|
|
22737
|
+
});
|
|
22691
22738
|
const filterService = filterForm.context.getComponents().find(function(n){
|
|
22692
22739
|
return n.props.type === "service";
|
|
22693
22740
|
});
|
|
@@ -22772,7 +22819,7 @@
|
|
|
22772
22819
|
// crud && crud.setData({__changedFilterFormValues: {}});
|
|
22773
22820
|
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
22774
22821
|
if(isLookup && __lookupField){
|
|
22775
|
-
let lookupTag = "
|
|
22822
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
22776
22823
|
if(__lookupField.reference_to_field){
|
|
22777
22824
|
lookupTag += "__" + __lookupField.reference_to_field;
|
|
22778
22825
|
}
|
|
@@ -22789,9 +22836,16 @@
|
|
|
22789
22836
|
let filterFormService = SteedosUI.getClosestAmisComponentByType(filterForm.context, "service");
|
|
22790
22837
|
filterFormService.setData({showFieldsFilter: !!!filterFormService.props.data.showFieldsFilter});
|
|
22791
22838
|
//触发amis crud 高度重算
|
|
22792
|
-
|
|
22793
|
-
|
|
22794
|
-
|
|
22839
|
+
doAction({
|
|
22840
|
+
"actionType": "broadcast",
|
|
22841
|
+
"args": {
|
|
22842
|
+
"eventName": "@height.changed.${objectSchema.name}"
|
|
22843
|
+
},
|
|
22844
|
+
"data": {
|
|
22845
|
+
"timeOut": 100
|
|
22846
|
+
}
|
|
22847
|
+
});
|
|
22848
|
+
|
|
22795
22849
|
// 移除搜索按钮上的红点
|
|
22796
22850
|
// let crudService = scope.getComponentById("service_listview_" + event.data.objectName);
|
|
22797
22851
|
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
@@ -22948,9 +23002,15 @@
|
|
|
22948
23002
|
sessionStorage.setItem(listViewPropsStoreKey, JSON.stringify(localListViewProps));
|
|
22949
23003
|
}
|
|
22950
23004
|
//触发amis crud 高度重算
|
|
22951
|
-
|
|
22952
|
-
|
|
22953
|
-
|
|
23005
|
+
doAction({
|
|
23006
|
+
"actionType": "broadcast",
|
|
23007
|
+
"args": {
|
|
23008
|
+
"eventName": "@height.changed.${objectSchema.name}"
|
|
23009
|
+
},
|
|
23010
|
+
"data": {
|
|
23011
|
+
"timeOut": 100
|
|
23012
|
+
}
|
|
23013
|
+
});
|
|
22954
23014
|
// ===END===
|
|
22955
23015
|
`;
|
|
22956
23016
|
return {
|
|
@@ -24192,13 +24252,16 @@ const filterService = filterForm.context.getComponents().find(function(n){
|
|
|
24192
24252
|
});
|
|
24193
24253
|
let toShowFieldsFilter = !!!filterService.props.data.showFieldsFilter;
|
|
24194
24254
|
filterService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
24195
|
-
|
|
24196
|
-
|
|
24197
|
-
|
|
24198
|
-
|
|
24199
|
-
|
|
24200
|
-
}
|
|
24201
|
-
|
|
24255
|
+
//触发amis crud 高度重算
|
|
24256
|
+
doAction({
|
|
24257
|
+
"actionType": "broadcast",
|
|
24258
|
+
"args": {
|
|
24259
|
+
"eventName": "@height.changed." + event.data.objectName
|
|
24260
|
+
},
|
|
24261
|
+
"data": {
|
|
24262
|
+
"timeOut": 1000
|
|
24263
|
+
}
|
|
24264
|
+
});
|
|
24202
24265
|
// 手机端在显示搜索栏时隐藏crud上的刷新按钮,因为点击后crud高度显示有问题
|
|
24203
24266
|
let crudService = scope.getComponentById("service_listview_" + event.data.objectName);
|
|
24204
24267
|
crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
@@ -24271,7 +24334,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24271
24334
|
let __lookupField = event.data.__lookupField;
|
|
24272
24335
|
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
24273
24336
|
if(isLookup && __lookupField){
|
|
24274
|
-
let lookupTag = "
|
|
24337
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
24275
24338
|
if(__lookupField.reference_to_field){
|
|
24276
24339
|
lookupTag += "__" + __lookupField.reference_to_field;
|
|
24277
24340
|
}
|
|
@@ -24562,12 +24625,16 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24562
24625
|
return;
|
|
24563
24626
|
}
|
|
24564
24627
|
// 列表搜索栏字段值变更后立刻触发提交表单执行crud搜索,所以这里需要额外重算crud高度及筛选按钮红色星号图标显示隐藏
|
|
24565
|
-
|
|
24566
|
-
|
|
24567
|
-
|
|
24568
|
-
|
|
24569
|
-
|
|
24570
|
-
|
|
24628
|
+
//触发amis crud 高度重算
|
|
24629
|
+
doAction({
|
|
24630
|
+
"actionType": "broadcast",
|
|
24631
|
+
"args": {
|
|
24632
|
+
"eventName": "@height.changed.${objectSchema.name}"
|
|
24633
|
+
},
|
|
24634
|
+
"data": {
|
|
24635
|
+
"timeOut": 1000
|
|
24636
|
+
}
|
|
24637
|
+
});
|
|
24571
24638
|
resizeWindow();
|
|
24572
24639
|
const scope = event.context.scoped;
|
|
24573
24640
|
// let filterFormValues = event.data;
|
|
@@ -24583,13 +24650,13 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24583
24650
|
let onChangeScript = `
|
|
24584
24651
|
let isLookup = event.data.isLookup;
|
|
24585
24652
|
let __lookupField = event.data.__lookupField;
|
|
24586
|
-
console.log("==onChangeScript=isLookup===", isLookup);
|
|
24587
24653
|
const scope = event.context.scoped;
|
|
24588
24654
|
// let filterFormValues = event.data;
|
|
24589
24655
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
24590
24656
|
let filterFormService = SteedosUI.getClosestAmisComponentByType(filterForm.context, "service");
|
|
24591
24657
|
// 使用event.data的话,并不能拿到本地存储中的过滤条件,所以需要从filterFormService中取。
|
|
24592
24658
|
let filterFormValues = filterFormService.getData();
|
|
24659
|
+
filterFormValues = JSON.parse(JSON.stringify(filterFormValues)); //只取当层数据域中数据,去除__super层数据
|
|
24593
24660
|
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
24594
24661
|
const changedFilterFormValues = _.pickBy(filterFormValues, function(n,k){return /^__searchable__/.test(k);});;
|
|
24595
24662
|
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
@@ -24598,7 +24665,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24598
24665
|
// crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
24599
24666
|
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
24600
24667
|
if(isLookup && __lookupField){
|
|
24601
|
-
let lookupTag = "
|
|
24668
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
24602
24669
|
if(__lookupField.reference_to_field){
|
|
24603
24670
|
lookupTag += "__" + __lookupField.reference_to_field;
|
|
24604
24671
|
}
|
|
@@ -25211,6 +25278,60 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25211
25278
|
}
|
|
25212
25279
|
|
|
25213
25280
|
function getLookupSapceUserTreeSchema(isMobile){
|
|
25281
|
+
let apiAdaptor = `
|
|
25282
|
+
// console.log("===getLookupSapceUserTreeSchema===", JSON.stringify(payload));
|
|
25283
|
+
const records = payload.data.options;
|
|
25284
|
+
let isTreeOptionsComputed = false;
|
|
25285
|
+
if(records.length === 1 && records[0].children){
|
|
25286
|
+
isTreeOptionsComputed = true;
|
|
25287
|
+
}
|
|
25288
|
+
if(isTreeOptionsComputed){
|
|
25289
|
+
return payload;
|
|
25290
|
+
}
|
|
25291
|
+
const treeRecords = [];
|
|
25292
|
+
const getChildren = (records, childrenIds) => {
|
|
25293
|
+
if (!childrenIds) {
|
|
25294
|
+
return;
|
|
25295
|
+
}
|
|
25296
|
+
const children = _.filter(records, (record) => {
|
|
25297
|
+
return _.includes(childrenIds, record.value)
|
|
25298
|
+
});
|
|
25299
|
+
_.each(children, (item) => {
|
|
25300
|
+
if (item.children) {
|
|
25301
|
+
item.children = getChildren(records, item.children)
|
|
25302
|
+
}else{
|
|
25303
|
+
item.children = [];
|
|
25304
|
+
}
|
|
25305
|
+
})
|
|
25306
|
+
return children;
|
|
25307
|
+
}
|
|
25308
|
+
|
|
25309
|
+
const getRoot = (records) => {
|
|
25310
|
+
for (var i = 0; i < records.length; i++) {
|
|
25311
|
+
records[i].noParent = 0;
|
|
25312
|
+
if (!!records[i].parent) {
|
|
25313
|
+
biaozhi = 1
|
|
25314
|
+
for (var j = 0; j < records.length; j++) {
|
|
25315
|
+
if (records[i].parent == records[j].value)
|
|
25316
|
+
biaozhi = 0;
|
|
25317
|
+
}
|
|
25318
|
+
if (biaozhi == 1) records[i].noParent = 1;
|
|
25319
|
+
} else records[i].noParent = 1;
|
|
25320
|
+
}
|
|
25321
|
+
}
|
|
25322
|
+
getRoot(records);
|
|
25323
|
+
console.log(records)
|
|
25324
|
+
|
|
25325
|
+
_.each(records, (record) => {
|
|
25326
|
+
if (record.noParent == 1) {
|
|
25327
|
+
treeRecords.push(Object.assign({}, record, { children: getChildren(records, record.children) }));
|
|
25328
|
+
}
|
|
25329
|
+
});
|
|
25330
|
+
console.log(treeRecords)
|
|
25331
|
+
|
|
25332
|
+
payload.data.options = treeRecords;
|
|
25333
|
+
return payload;
|
|
25334
|
+
`;
|
|
25214
25335
|
const treeSchema = {
|
|
25215
25336
|
"type": "input-tree",
|
|
25216
25337
|
"className":"steedos-select-user-tree",
|
|
@@ -25221,8 +25342,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25221
25342
|
"headers": {
|
|
25222
25343
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
25223
25344
|
},
|
|
25224
|
-
"adaptor":
|
|
25225
|
-
"requestAdaptor": "\n ",
|
|
25345
|
+
"adaptor": apiAdaptor,
|
|
25226
25346
|
"data": {
|
|
25227
25347
|
"query": "{options:organizations(filters:[\"hidden\", \"!=\", true],sort:\"sort_no desc\"){value:_id label:name,parent,children}}"
|
|
25228
25348
|
},
|
|
@@ -25426,7 +25546,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25426
25546
|
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
25427
25547
|
let __lookupField = api.data.$self.__lookupField;
|
|
25428
25548
|
if(__lookupField){
|
|
25429
|
-
let lookupTag = "
|
|
25549
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
25430
25550
|
if(__lookupField.reference_to_field){
|
|
25431
25551
|
lookupTag += "__" + __lookupField.reference_to_field;
|
|
25432
25552
|
}
|
|
@@ -25535,8 +25655,19 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25535
25655
|
})
|
|
25536
25656
|
payload.data.rows = rows;
|
|
25537
25657
|
*/
|
|
25658
|
+
if(enable_tree){
|
|
25659
|
+
const rows = _.map(payload.data.rows, (item)=>{
|
|
25660
|
+
delete item.children;
|
|
25661
|
+
delete item.parent;
|
|
25662
|
+
return item;
|
|
25663
|
+
})
|
|
25664
|
+
payload.data.rows = rows;
|
|
25665
|
+
}
|
|
25538
25666
|
return payload;
|
|
25539
25667
|
}
|
|
25668
|
+
if(!payload.data.rows){
|
|
25669
|
+
payload.data.rows = [];
|
|
25670
|
+
}
|
|
25540
25671
|
if(enable_tree){
|
|
25541
25672
|
const records = payload.data.rows;
|
|
25542
25673
|
const treeRecords = [];
|
|
@@ -25563,6 +25694,8 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25563
25694
|
_.each(children, (item)=>{
|
|
25564
25695
|
if(item.children){
|
|
25565
25696
|
item.children = getChildren(records, item.children)
|
|
25697
|
+
}else{
|
|
25698
|
+
item.children = [];
|
|
25566
25699
|
}
|
|
25567
25700
|
})
|
|
25568
25701
|
return children;
|
|
@@ -25575,14 +25708,6 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25575
25708
|
}
|
|
25576
25709
|
});
|
|
25577
25710
|
payload.data.rows = treeRecords;
|
|
25578
|
-
try{
|
|
25579
|
-
setTimeout(() => {
|
|
25580
|
-
$('.amis-dialog-widget.antd-Modal .antd-Table-content .antd-Table-table thead .antd-Table-expandBtn')[0]?.click();
|
|
25581
|
-
}, 600);
|
|
25582
|
-
}
|
|
25583
|
-
catch(ex){
|
|
25584
|
-
console.error("tree数据格式展开异常:", ex);
|
|
25585
|
-
}
|
|
25586
25711
|
}
|
|
25587
25712
|
return payload;
|
|
25588
25713
|
`;
|
|
@@ -25609,6 +25734,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25609
25734
|
labelFieldName,
|
|
25610
25735
|
top: top,
|
|
25611
25736
|
isLookup: true,
|
|
25737
|
+
enable_tree: refObjectConfig.enable_tree,
|
|
25612
25738
|
...ctx
|
|
25613
25739
|
});
|
|
25614
25740
|
|
|
@@ -25624,7 +25750,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25624
25750
|
const isAllowCreate = refObjectConfig.permissions.allowCreate;
|
|
25625
25751
|
const isCreate = lodash.exports.isBoolean(field.create) ? field.create : true;
|
|
25626
25752
|
// lookup字段配置过滤条件就强制不显示新建按钮
|
|
25627
|
-
let isHasFilters = (field.filters || field._filtersFunction) ? true : false;
|
|
25753
|
+
let isHasFilters = (field.filters || field.filtersFunction || field._filtersFunction) ? true : false;
|
|
25628
25754
|
if (isAllowCreate && isCreate && !isHasFilters) {
|
|
25629
25755
|
const new_button = await getSchema$5(refObjectConfig, { appId: ctx.appId, objectName: refObjectConfig.name, formFactor: ctx.formFactor });
|
|
25630
25756
|
new_button.align = "right";
|
|
@@ -25822,7 +25948,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25822
25948
|
sendOn.push(`this.${fName}`);
|
|
25823
25949
|
});
|
|
25824
25950
|
if(depend_on.length > 0){
|
|
25825
|
-
apiInfo.url = `${apiInfo.url}
|
|
25951
|
+
apiInfo.url = `${apiInfo.url}&${depend_on.join('&')}`;
|
|
25826
25952
|
apiInfo.sendOn = `${sendOn.join(' && ')}`;
|
|
25827
25953
|
}
|
|
25828
25954
|
}
|
|
@@ -25930,6 +26056,13 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25930
26056
|
autoComplete: apiInfo,
|
|
25931
26057
|
searchable: true,
|
|
25932
26058
|
};
|
|
26059
|
+
let amisVersion = getComparableAmisVersion();
|
|
26060
|
+
if(amisVersion >= 3.6){
|
|
26061
|
+
// amis 3.6中不加source会造成子表组件中弹出行编辑窗口的lookup字段有时不请求接口(概率现象,同一个地方反复操作有时请求有时不请求)
|
|
26062
|
+
// 但是同时配置autoComplete和source会多请求一次接口
|
|
26063
|
+
// TODO:应该想办法把是否字段在子表组件内,即ctx.isInputTable,如果不在子表组件内不需要加source
|
|
26064
|
+
data.source = apiInfo;
|
|
26065
|
+
}
|
|
25933
26066
|
//删除xlink:href中的rootUrl前缀,解决客户端svg为空的问题
|
|
25934
26067
|
const select_menuTpl = `<span class='flex items-center mt-0.5'>
|
|
25935
26068
|
<span role='img' aria-label='smile' class='anticon anticon-smile'>
|
|
@@ -26011,18 +26144,37 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26011
26144
|
|
|
26012
26145
|
// 优先取字段中配置的enable_enhanced_lookup,字段上没配置时,才从对象上取enable_enhanced_lookup属性
|
|
26013
26146
|
let enableEnhancedLookup = lodash.exports.isBoolean(field.enable_enhanced_lookup) ? field.enable_enhanced_lookup : refObject.enable_enhanced_lookup;
|
|
26147
|
+
let amisVersion = getComparableAmisVersion();
|
|
26148
|
+
if(amisVersion >= 3.6){
|
|
26149
|
+
// amis 3.6.3单选和多选的树picker都有bug(https://github.com/baidu/amis/issues/9279,https://github.com/baidu/amis/issues/9295),我们改amis源码修正了
|
|
26150
|
+
// amis 3.6.3多选的下拉树组件有bug,多选树字段的选中值在编辑模式展开树时不会自动勾选树里面的节点,而是始终勾选显示在最外面的选中值选项(即defaultValueOptions),amis 3.2没有这个问题
|
|
26151
|
+
// 这里强制禁用多选下拉树,统一改为弹出树,如果以后需要下拉树功能,可以把下拉树组件改为一次性加载所有树节点数据模式来跳过这个问题
|
|
26152
|
+
if(!enableEnhancedLookup && refObject.enable_tree && field.multiple){
|
|
26153
|
+
enableEnhancedLookup = true;
|
|
26154
|
+
}
|
|
26155
|
+
}
|
|
26156
|
+
let amisSchema;
|
|
26014
26157
|
// 默认使用下拉框模式显示lookup选项,只能配置了enable_enhanced_lookup才使用弹出增强模式
|
|
26015
26158
|
if(enableEnhancedLookup == true){
|
|
26016
|
-
|
|
26159
|
+
amisSchema = await lookupToAmisPicker(field, readonly, ctx);
|
|
26017
26160
|
}else if(refObject.enable_tree) {
|
|
26018
|
-
|
|
26161
|
+
amisSchema = await lookupToAmisTreeSelect(field, readonly, Object.assign({}, ctx, {
|
|
26019
26162
|
labelField: referenceTo.labelField?.name || 'name',
|
|
26020
26163
|
valueField: referenceTo.valueField?.name || '_id',
|
|
26021
26164
|
objectName: referenceTo.objectName
|
|
26022
26165
|
}));
|
|
26023
26166
|
}else {
|
|
26024
|
-
|
|
26167
|
+
amisSchema = await lookupToAmisSelect(field, readonly, ctx);
|
|
26168
|
+
}
|
|
26169
|
+
let refLookupPage = refObject.pages && refObject.pages.lookup;
|
|
26170
|
+
if(refLookupPage){
|
|
26171
|
+
if(typeof refLookupPage == 'string'){
|
|
26172
|
+
refLookupPage = JSON.parse(refLookupPage);
|
|
26173
|
+
}
|
|
26174
|
+
// Object.assign(amisSchema, refLookupPage);
|
|
26175
|
+
// amisSchema = _.defaultsDeep({}, refLookupPage, amisSchema);
|
|
26025
26176
|
}
|
|
26177
|
+
return amisSchema;
|
|
26026
26178
|
}
|
|
26027
26179
|
|
|
26028
26180
|
async function lookupToAmisIdsPicker(field, readonly, ctx){
|
|
@@ -26660,7 +26812,8 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26660
26812
|
},
|
|
26661
26813
|
pipeOut: (value, oldValue, data) => {
|
|
26662
26814
|
if(value){
|
|
26663
|
-
|
|
26815
|
+
const result = value/100;
|
|
26816
|
+
return Number(result.toFixed(field.scale+2));
|
|
26664
26817
|
}
|
|
26665
26818
|
return value;
|
|
26666
26819
|
},
|
|
@@ -26892,7 +27045,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26892
27045
|
}
|
|
26893
27046
|
if(!lodash.exports.isEmpty(convertData)){
|
|
26894
27047
|
if(field.is_wide || convertData.type === 'group'){
|
|
26895
|
-
convertData.className = 'col-span-2 m-
|
|
27048
|
+
convertData.className = 'col-span-2 m-0';
|
|
26896
27049
|
}else {
|
|
26897
27050
|
convertData.className = 'm-1';
|
|
26898
27051
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos-widgets/sortable",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.6.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": "
|
|
48
|
+
"@steedos-widgets/amis-lib": "3.6.0-beta.10"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "e9e5980573c3e5711983e6910d702d41c38bf3c5"
|
|
51
51
|
}
|