@steedos-widgets/sortable 3.6.2-beta.9 → 3.6.3-beta.1
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 +389 -104
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +389 -104
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +389 -104
- package/package.json +3 -3
package/dist/sortable.umd.js
CHANGED
|
@@ -20233,14 +20233,13 @@
|
|
|
20233
20233
|
/*
|
|
20234
20234
|
* @Author: baozhoutao@steedos.com
|
|
20235
20235
|
* @Date: 2022-08-16 17:02:08
|
|
20236
|
-
* @LastEditors:
|
|
20237
|
-
* @LastEditTime:
|
|
20236
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
20237
|
+
* @LastEditTime: 2024-02-02 10:15:00
|
|
20238
20238
|
* @Description:
|
|
20239
20239
|
*/
|
|
20240
20240
|
|
|
20241
20241
|
const Router = {
|
|
20242
|
-
getTabDisplayAs(tab_id){
|
|
20243
|
-
const uiSchema = getUISchemaSync$1(tab_id, false);
|
|
20242
|
+
getTabDisplayAs(tab_id, defaultEnableSplit){
|
|
20244
20243
|
var urlSearch = new URLSearchParams(document.location.search);
|
|
20245
20244
|
if(urlSearch.has('display')){
|
|
20246
20245
|
return urlSearch.get('display')
|
|
@@ -20249,9 +20248,12 @@
|
|
|
20249
20248
|
// const key = `page_display`;
|
|
20250
20249
|
const value = sessionStorage.getItem(key);
|
|
20251
20250
|
let defaultDisplay = "grid";
|
|
20252
|
-
if(
|
|
20251
|
+
if(defaultEnableSplit === true){
|
|
20253
20252
|
defaultDisplay = "split";
|
|
20254
20253
|
}
|
|
20254
|
+
if(window.innerWidth <= 768){
|
|
20255
|
+
return "grid";
|
|
20256
|
+
}
|
|
20255
20257
|
return value ? value : defaultDisplay;
|
|
20256
20258
|
},
|
|
20257
20259
|
|
|
@@ -20284,8 +20286,8 @@
|
|
|
20284
20286
|
/*
|
|
20285
20287
|
* @Author: baozhoutao@steedos.com
|
|
20286
20288
|
* @Date: 2022-07-20 16:29:22
|
|
20287
|
-
* @LastEditors:
|
|
20288
|
-
* @LastEditTime:
|
|
20289
|
+
* @LastEditors: liaodaxue
|
|
20290
|
+
* @LastEditTime: 2024-01-25 14:44:17
|
|
20289
20291
|
* @Description:
|
|
20290
20292
|
*/
|
|
20291
20293
|
|
|
@@ -20357,6 +20359,25 @@
|
|
|
20357
20359
|
}
|
|
20358
20360
|
}
|
|
20359
20361
|
|
|
20362
|
+
/**
|
|
20363
|
+
* 判断浏览器类型
|
|
20364
|
+
* @returns 按需返回浏览器类型;
|
|
20365
|
+
*/
|
|
20366
|
+
function getBowserType() {
|
|
20367
|
+
const userAgent = navigator.userAgent;
|
|
20368
|
+
if (userAgent.indexOf("Chrome")!== -1 && userAgent.indexOf("Safari") !== -1 && userAgent.indexOf("Edg") === -1) {
|
|
20369
|
+
return "Chrome";
|
|
20370
|
+
} else if (userAgent.indexOf("Firefox") !== -1) {
|
|
20371
|
+
return "Firefox";
|
|
20372
|
+
} else if (userAgent.indexOf("Safari") !== -1 && userAgent.indexOf("Chrome") === -1 && userAgent.indexOf("Edge") === -1) {
|
|
20373
|
+
return "Safari";
|
|
20374
|
+
} else if (userAgent.indexOf("Edg") !== -1) {
|
|
20375
|
+
return "Edge";
|
|
20376
|
+
} else {
|
|
20377
|
+
return "Unknown browser"; // 其他浏览器...(可根据自己需要确定是否新增其他浏览器的判断)
|
|
20378
|
+
}
|
|
20379
|
+
}
|
|
20380
|
+
|
|
20360
20381
|
function getNumberTpl(field){
|
|
20361
20382
|
return `<span>\${_display.${field.name}}</span>`
|
|
20362
20383
|
}
|
|
@@ -20397,7 +20418,7 @@
|
|
|
20397
20418
|
lodash.exports.forEach(selectOptions,(option)=>{
|
|
20398
20419
|
const optionValue = option.value + '';
|
|
20399
20420
|
const optionColor = option.color + '';
|
|
20400
|
-
if(optionColor){
|
|
20421
|
+
if(optionColor && optionColor != "undefined"){
|
|
20401
20422
|
const background = optionColor.charAt(0) === '#' ? optionColor : '#'+optionColor;
|
|
20402
20423
|
const color = getContrastColor(background);
|
|
20403
20424
|
const optionColorStyle = 'background:'+background+';color:'+color+';line-height:1.5rem';
|
|
@@ -20781,7 +20802,31 @@
|
|
|
20781
20802
|
}
|
|
20782
20803
|
}
|
|
20783
20804
|
if(type === 'file'){
|
|
20784
|
-
return {
|
|
20805
|
+
return window.Meteor?.isCordova ? {
|
|
20806
|
+
"type": "control",
|
|
20807
|
+
"body": {
|
|
20808
|
+
"type": "each",
|
|
20809
|
+
"name": "_display." + steedosField.name,
|
|
20810
|
+
"items": {
|
|
20811
|
+
"type": "tpl",
|
|
20812
|
+
"tpl": "${name}",
|
|
20813
|
+
"className": "antd-Button--link inline-block",
|
|
20814
|
+
"onEvent": {
|
|
20815
|
+
"click": {
|
|
20816
|
+
"actions": [
|
|
20817
|
+
{
|
|
20818
|
+
"script": `
|
|
20819
|
+
Steedos.cordovaDownload(encodeURI(event.data.url), event.data.name);
|
|
20820
|
+
`,
|
|
20821
|
+
"actionType": "custom"
|
|
20822
|
+
}
|
|
20823
|
+
],
|
|
20824
|
+
"weight": 0
|
|
20825
|
+
}
|
|
20826
|
+
}
|
|
20827
|
+
}
|
|
20828
|
+
}
|
|
20829
|
+
} : {
|
|
20785
20830
|
type: amisFieldType,
|
|
20786
20831
|
tpl: `
|
|
20787
20832
|
<% let fileData = data._display.${steedosField.name}; if (fileData) { %>
|
|
@@ -20925,6 +20970,7 @@
|
|
|
20925
20970
|
var frontend_notifications_allread$1 = "Mark all as read";
|
|
20926
20971
|
var frontend_notifications_allread_message$1 = "All marked as read";
|
|
20927
20972
|
var frontend_profile$1 = "Profile";
|
|
20973
|
+
var switch_space$1 = "Switch Space";
|
|
20928
20974
|
var frontend_about$1 = "About";
|
|
20929
20975
|
var frontend_log_out$1 = "Log out";
|
|
20930
20976
|
var frontend_listview_warning_start$1 = "The current ";
|
|
@@ -21012,6 +21058,7 @@
|
|
|
21012
21058
|
frontend_notifications_allread: frontend_notifications_allread$1,
|
|
21013
21059
|
frontend_notifications_allread_message: frontend_notifications_allread_message$1,
|
|
21014
21060
|
frontend_profile: frontend_profile$1,
|
|
21061
|
+
switch_space: switch_space$1,
|
|
21015
21062
|
frontend_about: frontend_about$1,
|
|
21016
21063
|
frontend_log_out: frontend_log_out$1,
|
|
21017
21064
|
frontend_listview_warning_start: frontend_listview_warning_start$1,
|
|
@@ -21067,7 +21114,7 @@
|
|
|
21067
21114
|
var frontend_listview_control_delete_confirm_text = "如果您删除此列表视图,该视图将为所有具备访问权限的用户永久删除。是否确定要删除?";
|
|
21068
21115
|
var frontend_listview_control_delete_message_success = "删除成功";
|
|
21069
21116
|
var frontend_listview_control_filters = "过滤设置";
|
|
21070
|
-
var frontend_listview_control_filters_fields_extend = "条件组件
|
|
21117
|
+
var frontend_listview_control_filters_fields_extend = "条件组件";
|
|
21071
21118
|
var frontend_listview_control_new_label = "新建";
|
|
21072
21119
|
var frontend_listview_control_new_title = "新建 列表视图";
|
|
21073
21120
|
var frontend_listview_control_new_message_success = "成功";
|
|
@@ -21101,6 +21148,7 @@
|
|
|
21101
21148
|
var frontend_notifications_allread = "全部标记为已读";
|
|
21102
21149
|
var frontend_notifications_allread_message = "已全部标记为已读";
|
|
21103
21150
|
var frontend_profile = "个人资料";
|
|
21151
|
+
var switch_space = "切换工作区";
|
|
21104
21152
|
var frontend_about = "关于";
|
|
21105
21153
|
var frontend_log_out = "注销";
|
|
21106
21154
|
var frontend_listview_warning_start = "当前";
|
|
@@ -21189,6 +21237,7 @@
|
|
|
21189
21237
|
frontend_notifications_allread: frontend_notifications_allread,
|
|
21190
21238
|
frontend_notifications_allread_message: frontend_notifications_allread_message,
|
|
21191
21239
|
frontend_profile: frontend_profile,
|
|
21240
|
+
switch_space: switch_space,
|
|
21192
21241
|
frontend_about: frontend_about,
|
|
21193
21242
|
frontend_log_out: frontend_log_out,
|
|
21194
21243
|
frontend_listview_warning_start: frontend_listview_warning_start,
|
|
@@ -21243,7 +21292,7 @@
|
|
|
21243
21292
|
isAmisVersionforBatchEdit = window.Amis.version[0] >= 3 && window.Amis.version[2] >= 2;
|
|
21244
21293
|
}
|
|
21245
21294
|
const quickEditId = options.objectName + "_" + field.name + "_quickEdit";//定义快速编辑的表单id,用于setvalue传值
|
|
21246
|
-
var quickEditSchema = { body: [], id: quickEditId };
|
|
21295
|
+
var quickEditSchema = { body: [], id: quickEditId, className: "steedos-table-quickEdit" };
|
|
21247
21296
|
//select,avatar,image,file等组件无法行记录字段赋值,暂不支持批量编辑;
|
|
21248
21297
|
if(field.type != 'avatar' && field.type != 'image' && field.type != 'file' && isAmisVersionforBatchEdit){
|
|
21249
21298
|
const submitEvent = {
|
|
@@ -21502,7 +21551,8 @@
|
|
|
21502
21551
|
"failed": "失败了呢。。"
|
|
21503
21552
|
}
|
|
21504
21553
|
}
|
|
21505
|
-
}
|
|
21554
|
+
},
|
|
21555
|
+
"expression": "${!recordPermissions.modifyAllRecords}"
|
|
21506
21556
|
},
|
|
21507
21557
|
{
|
|
21508
21558
|
"actionType": "setValue",
|
|
@@ -21518,7 +21568,7 @@
|
|
|
21518
21568
|
"componentId": quickEditId,
|
|
21519
21569
|
"args": {
|
|
21520
21570
|
"value":{
|
|
21521
|
-
"quickedit_record_permissions": "${event.data}"
|
|
21571
|
+
"quickedit_record_permissions": "${recordPermissions.modifyAllRecords ? {'allowEdit': true} : event.data}"
|
|
21522
21572
|
}
|
|
21523
21573
|
}
|
|
21524
21574
|
}
|
|
@@ -21582,7 +21632,7 @@
|
|
|
21582
21632
|
`
|
|
21583
21633
|
}
|
|
21584
21634
|
},
|
|
21585
|
-
"expression":"${event.data.value}"
|
|
21635
|
+
"expression":"${event.data.value && !recordPermissions.modifyAllRecords}"
|
|
21586
21636
|
},
|
|
21587
21637
|
{
|
|
21588
21638
|
"actionType": "setValue",
|
|
@@ -21613,10 +21663,20 @@
|
|
|
21613
21663
|
"script": `
|
|
21614
21664
|
const noPermission = event.data.noPermission;
|
|
21615
21665
|
const crudComponent = event.context.scoped.getComponentById("${options.crudId}");
|
|
21616
|
-
|
|
21666
|
+
let selectedItems = crudComponent && crudComponent.props.store.selectedItems.concat();
|
|
21617
21667
|
noPermission.forEach(function (item) {
|
|
21618
21668
|
crudComponent && crudComponent.unSelectItem(_.find(selectedItems,{_id:item}));
|
|
21669
|
+
_.remove(selectedItems, (selected) => selected._id === item);
|
|
21619
21670
|
})
|
|
21671
|
+
doAction({
|
|
21672
|
+
"componentId": "${quickEditId}",
|
|
21673
|
+
"actionType": "setValue",
|
|
21674
|
+
"args": {
|
|
21675
|
+
"value": {
|
|
21676
|
+
selectedItems
|
|
21677
|
+
}
|
|
21678
|
+
}
|
|
21679
|
+
});
|
|
21620
21680
|
`
|
|
21621
21681
|
},
|
|
21622
21682
|
{
|
|
@@ -21677,7 +21737,7 @@
|
|
|
21677
21737
|
}
|
|
21678
21738
|
|
|
21679
21739
|
function getFieldWidth(width){
|
|
21680
|
-
const defaultWidth =
|
|
21740
|
+
const defaultWidth = null;
|
|
21681
21741
|
if(typeof width == 'string'){
|
|
21682
21742
|
if(isNaN(width)){
|
|
21683
21743
|
return width || defaultWidth;
|
|
@@ -21707,22 +21767,35 @@
|
|
|
21707
21767
|
//增加quickEdit属性,实现快速编辑
|
|
21708
21768
|
const quickEditSchema = allowEdit ? await getQuickEditSchema(field, options) : allowEdit;
|
|
21709
21769
|
let className = "";
|
|
21710
|
-
|
|
21711
|
-
|
|
21712
|
-
|
|
21713
|
-
|
|
21770
|
+
const bowserType = getBowserType();
|
|
21771
|
+
if(bowserType === "Safari"){
|
|
21772
|
+
className += " whitespace-nowrap ";
|
|
21773
|
+
}else {
|
|
21774
|
+
if(field.wrap != true){
|
|
21714
21775
|
className += " whitespace-nowrap ";
|
|
21776
|
+
}else {
|
|
21777
|
+
className += " break-words ";
|
|
21715
21778
|
}
|
|
21716
|
-
}else {
|
|
21717
|
-
className += " break-words ";
|
|
21718
21779
|
}
|
|
21780
|
+
|
|
21781
|
+
if (typeof field.amis?.className == "object") {
|
|
21782
|
+
className = {
|
|
21783
|
+
[className]: "true",
|
|
21784
|
+
...field.amis.className
|
|
21785
|
+
};
|
|
21786
|
+
} else if (typeof field.amis?.className == "string") {
|
|
21787
|
+
className = `${className} ${field.amis.className} `;
|
|
21788
|
+
}
|
|
21789
|
+
let fieldAmis = lodash.exports.clone(field.amis);
|
|
21790
|
+
delete fieldAmis?.className;
|
|
21791
|
+
|
|
21719
21792
|
let columnItem;
|
|
21720
21793
|
if((field.is_name || field.name === options.labelFieldName) && options.objectName === 'cms_files'){
|
|
21721
21794
|
const previewFileScript = `
|
|
21722
21795
|
var data = event.data;
|
|
21723
21796
|
var file_name = data.versions ? data.name : "${field.label}";
|
|
21724
|
-
var file_id = data._id;
|
|
21725
|
-
|
|
21797
|
+
var file_id = data.versions && data.versions[0] && data.versions[0]._id;
|
|
21798
|
+
window.previewFile && window.previewFile({file_name, file_id});
|
|
21726
21799
|
`;
|
|
21727
21800
|
columnItem = {
|
|
21728
21801
|
"type": "button",
|
|
@@ -21747,11 +21820,11 @@
|
|
|
21747
21820
|
"expression": "!!!(window && window.nw && window.nw.require)"//浏览器上直接下载
|
|
21748
21821
|
},
|
|
21749
21822
|
{
|
|
21750
|
-
|
|
21751
|
-
|
|
21752
|
-
|
|
21753
|
-
|
|
21754
|
-
|
|
21823
|
+
"args": {},
|
|
21824
|
+
"actionType": "custom",
|
|
21825
|
+
"script": previewFileScript,
|
|
21826
|
+
// "expression": "!!window?.nw?.require" //PC客户端预览附件
|
|
21827
|
+
"expression": "!!(window && window.nw && window.nw.require)"//PC客户端预览附件
|
|
21755
21828
|
}
|
|
21756
21829
|
]
|
|
21757
21830
|
}
|
|
@@ -21766,7 +21839,7 @@
|
|
|
21766
21839
|
toggled: field.toggled,
|
|
21767
21840
|
static: true,
|
|
21768
21841
|
className,
|
|
21769
|
-
},
|
|
21842
|
+
}, fieldAmis, {name: field.name});
|
|
21770
21843
|
}else if(field.type === 'avatar' || field.type === 'image' || field.type === 'file'){
|
|
21771
21844
|
columnItem = Object.assign({}, {
|
|
21772
21845
|
type: "switch",
|
|
@@ -21777,7 +21850,7 @@
|
|
|
21777
21850
|
static: true,
|
|
21778
21851
|
className,
|
|
21779
21852
|
...getAmisFileReadonlySchema(field)
|
|
21780
|
-
},
|
|
21853
|
+
}, fieldAmis, {name: field.name});
|
|
21781
21854
|
}
|
|
21782
21855
|
else if(field.type === 'select'){
|
|
21783
21856
|
const map = getSelectMap(field.options);
|
|
@@ -21792,7 +21865,7 @@
|
|
|
21792
21865
|
className,
|
|
21793
21866
|
inputClassName: "inline",
|
|
21794
21867
|
static: true,
|
|
21795
|
-
},
|
|
21868
|
+
}, fieldAmis, {name: field.name});
|
|
21796
21869
|
}
|
|
21797
21870
|
else {
|
|
21798
21871
|
const tpl = await getFieldTpl(field, options);
|
|
@@ -21819,15 +21892,6 @@
|
|
|
21819
21892
|
// }
|
|
21820
21893
|
|
|
21821
21894
|
//field上的amis属性里的clssname需要单独判断类型合并
|
|
21822
|
-
if (typeof field.amis?.className == "object") {
|
|
21823
|
-
className = {
|
|
21824
|
-
[className]: "true",
|
|
21825
|
-
...field.amis.className
|
|
21826
|
-
};
|
|
21827
|
-
} else if (typeof field.amis?.className == "string") {
|
|
21828
|
-
className = `${className} ${field.amis.className} `;
|
|
21829
|
-
}
|
|
21830
|
-
delete field.amis?.className;
|
|
21831
21895
|
|
|
21832
21896
|
if(!field.hidden && !field.extra){
|
|
21833
21897
|
columnItem = Object.assign({}, {
|
|
@@ -21844,7 +21908,7 @@
|
|
|
21844
21908
|
static: true,
|
|
21845
21909
|
options: field.type === 'html' ? {html: true} : null
|
|
21846
21910
|
// toggled: true
|
|
21847
|
-
},
|
|
21911
|
+
}, fieldAmis, {name: field.name});
|
|
21848
21912
|
|
|
21849
21913
|
if(field.type === 'color'){
|
|
21850
21914
|
columnItem.type = 'color';
|
|
@@ -22040,10 +22104,10 @@
|
|
|
22040
22104
|
if(value.url){
|
|
22041
22105
|
cms_url = value.url;
|
|
22042
22106
|
}else{
|
|
22043
|
-
cms_url = "/api/files/files/"+value+"?download=true"
|
|
22107
|
+
cms_url = Steedos.absoluteUrl("/api/files/files/"+value+"?download=true");
|
|
22044
22108
|
}
|
|
22045
22109
|
}
|
|
22046
|
-
Steedos.cordovaDownload(encodeURI(
|
|
22110
|
+
Steedos.cordovaDownload(encodeURI(cms_url), event.data.name);
|
|
22047
22111
|
`,
|
|
22048
22112
|
"actionType": "custom"
|
|
22049
22113
|
}
|
|
@@ -22305,6 +22369,50 @@
|
|
|
22305
22369
|
}
|
|
22306
22370
|
}
|
|
22307
22371
|
|
|
22372
|
+
/*
|
|
22373
|
+
img/avatar字段值添加URL前缀使其在amis中正常显示图片。
|
|
22374
|
+
*/
|
|
22375
|
+
function getScriptForAddUrlPrefixForImgFields(fields){
|
|
22376
|
+
let imgFieldsKeys = [];
|
|
22377
|
+
let imgFields = {};
|
|
22378
|
+
fields.forEach((item)=>{
|
|
22379
|
+
if(lodash.exports.includes(['image','avatar'], item.type)){
|
|
22380
|
+
imgFieldsKeys.push(item.name);
|
|
22381
|
+
imgFields[item.name] = {
|
|
22382
|
+
name: item.name,
|
|
22383
|
+
type: item.type,
|
|
22384
|
+
multiple: item.multiple
|
|
22385
|
+
};
|
|
22386
|
+
}
|
|
22387
|
+
});
|
|
22388
|
+
if(!imgFieldsKeys.length){
|
|
22389
|
+
return '';
|
|
22390
|
+
}
|
|
22391
|
+
return `
|
|
22392
|
+
// image字段值添加URL前缀
|
|
22393
|
+
let imgFieldsKeys = ${JSON.stringify(imgFieldsKeys)};
|
|
22394
|
+
let imgFields = ${JSON.stringify(imgFields)};
|
|
22395
|
+
imgFieldsKeys.forEach((item)=>{
|
|
22396
|
+
let imgFieldValue = data[item];
|
|
22397
|
+
let imgFieldDisplayValue = data._display && data._display[item];
|
|
22398
|
+
if(imgFieldValue && imgFieldValue.length){
|
|
22399
|
+
let fieldProps = imgFields[item];
|
|
22400
|
+
if(fieldProps.multiple){
|
|
22401
|
+
if(imgFieldDisplayValue instanceof Array){
|
|
22402
|
+
data[item] = imgFieldDisplayValue.map((i)=>{
|
|
22403
|
+
const url = window.getImageFieldUrl(i.url);
|
|
22404
|
+
return url;
|
|
22405
|
+
});
|
|
22406
|
+
}
|
|
22407
|
+
}else{
|
|
22408
|
+
const url = imgFieldDisplayValue && window.getImageFieldUrl(imgFieldDisplayValue.url);
|
|
22409
|
+
data[item] = url;
|
|
22410
|
+
}
|
|
22411
|
+
}
|
|
22412
|
+
})
|
|
22413
|
+
`
|
|
22414
|
+
}
|
|
22415
|
+
|
|
22308
22416
|
/******************************************************************************
|
|
22309
22417
|
Copyright (c) Microsoft Corporation.
|
|
22310
22418
|
|
|
@@ -22676,7 +22784,7 @@
|
|
|
22676
22784
|
const formSchema = {
|
|
22677
22785
|
"type": "service",
|
|
22678
22786
|
"visibleOn": "this.filterFormSearchableFields && this.filterFormSearchableFields.length",
|
|
22679
|
-
"className": ctx.formFactor === 'SMALL' ? "slds-filters__body p-0 mb-2 overflow-y-auto overflow-x-hidden" : "slds-filters__body p-0 sm:grid sm:gap-
|
|
22787
|
+
"className": ctx.formFactor === 'SMALL' ? "slds-filters__body p-0 mb-2 overflow-y-auto overflow-x-hidden" : "slds-filters__body p-0 sm:grid sm:gap-4 sm:grid-cols-4 p-2",
|
|
22680
22788
|
"style":{
|
|
22681
22789
|
"max-height":ctx.formFactor === 'SMALL'?"30vh":"unset"
|
|
22682
22790
|
},
|
|
@@ -23263,7 +23371,7 @@
|
|
|
23263
23371
|
"className": "slds-filters"
|
|
23264
23372
|
},
|
|
23265
23373
|
"size": "xs",
|
|
23266
|
-
"className": `border-
|
|
23374
|
+
"className": `border-y slds-grid slds-grid_vertical slds-nowrap ${!ctx.isLookup && "mt-2"}`,
|
|
23267
23375
|
"visibleOn": "this.showFieldsFilter",
|
|
23268
23376
|
},
|
|
23269
23377
|
"className": "bg-white"
|
|
@@ -23309,6 +23417,7 @@
|
|
|
23309
23417
|
"objectApiName": "object_listviews",
|
|
23310
23418
|
"recordId": "",
|
|
23311
23419
|
"mode": "edit",
|
|
23420
|
+
"layout": "normal",
|
|
23312
23421
|
"defaultData": {
|
|
23313
23422
|
"&": "${list_view}",
|
|
23314
23423
|
"name":"",
|
|
@@ -23316,8 +23425,16 @@
|
|
|
23316
23425
|
"filters":"",
|
|
23317
23426
|
"shared":false,
|
|
23318
23427
|
"object_name": "${targetObjectName}",
|
|
23428
|
+
"_id":"",
|
|
23429
|
+
"shared_to": null,
|
|
23430
|
+
"shared_to_organizations": null,
|
|
23431
|
+
"locked": false,
|
|
23432
|
+
"owner": null,
|
|
23433
|
+
"company_id": null,
|
|
23434
|
+
"company_ids": null,
|
|
23435
|
+
"is_system": false
|
|
23319
23436
|
},
|
|
23320
|
-
"fieldsExtend": fieldsExtend$
|
|
23437
|
+
"fieldsExtend": fieldsExtend$5(),
|
|
23321
23438
|
"fields": fields$1(),
|
|
23322
23439
|
"onEvent": {
|
|
23323
23440
|
"submitSucc": {
|
|
@@ -23368,14 +23485,17 @@
|
|
|
23368
23485
|
"mobile_columns",
|
|
23369
23486
|
"searchable_fields",
|
|
23370
23487
|
"is_system",
|
|
23371
|
-
"shared"
|
|
23488
|
+
"shared",
|
|
23489
|
+
"shared_to",
|
|
23490
|
+
"shared_to_organizations"
|
|
23372
23491
|
]
|
|
23373
23492
|
}
|
|
23374
23493
|
|
|
23375
|
-
function fieldsExtend$
|
|
23494
|
+
function fieldsExtend$5(){
|
|
23376
23495
|
return {
|
|
23377
23496
|
"group": "",
|
|
23378
23497
|
"label": {
|
|
23498
|
+
"group": "",
|
|
23379
23499
|
"is_wide": true
|
|
23380
23500
|
},
|
|
23381
23501
|
"name": {
|
|
@@ -23457,9 +23577,19 @@
|
|
|
23457
23577
|
"shared": {
|
|
23458
23578
|
"group": "",
|
|
23459
23579
|
"amis": {
|
|
23460
|
-
"visibleOn": "${
|
|
23580
|
+
"visibleOn": "${false}"
|
|
23581
|
+
}
|
|
23582
|
+
},
|
|
23583
|
+
"shared_to": {
|
|
23584
|
+
"group": "",
|
|
23585
|
+
"amis":{
|
|
23586
|
+
"type": "radios",
|
|
23587
|
+
"inline": false
|
|
23461
23588
|
}
|
|
23462
23589
|
},
|
|
23590
|
+
"shared_to_organizations": {
|
|
23591
|
+
"group": ""
|
|
23592
|
+
},
|
|
23463
23593
|
"filters": {
|
|
23464
23594
|
"group": "",
|
|
23465
23595
|
"amis": {
|
|
@@ -23497,14 +23627,23 @@
|
|
|
23497
23627
|
"objectApiName": "object_listviews",
|
|
23498
23628
|
"recordId": "",
|
|
23499
23629
|
"mode": "edit",
|
|
23630
|
+
"layout": "normal",
|
|
23500
23631
|
"defaultData": {
|
|
23501
23632
|
"&": "${list_view}",
|
|
23502
23633
|
"name":"",
|
|
23503
23634
|
"label": instance.t('frontend_listview_control_clone_defaultData_label_start') + " ${list_view.label} " + instance.t('frontend_listview_control_clone_defaultData_label_end'),
|
|
23504
23635
|
"shared":false,
|
|
23505
23636
|
"object_name": "${targetObjectName}",
|
|
23637
|
+
"_id":"",
|
|
23638
|
+
"shared_to": null,
|
|
23639
|
+
"shared_to_organizations": null,
|
|
23640
|
+
"locked": false,
|
|
23641
|
+
"owner": null,
|
|
23642
|
+
"company_id": null,
|
|
23643
|
+
"company_ids": null,
|
|
23644
|
+
"is_system": false
|
|
23506
23645
|
},
|
|
23507
|
-
"fieldsExtend": fieldsExtend$
|
|
23646
|
+
"fieldsExtend": fieldsExtend$4(),
|
|
23508
23647
|
"fields": fields(),
|
|
23509
23648
|
"onEvent": {
|
|
23510
23649
|
"submitSucc": {
|
|
@@ -23552,13 +23691,16 @@
|
|
|
23552
23691
|
"mobile_columns.$.field",
|
|
23553
23692
|
"searchable_fields.$.field",
|
|
23554
23693
|
"is_system",
|
|
23555
|
-
"shared"
|
|
23694
|
+
"shared",
|
|
23695
|
+
"shared_to",
|
|
23696
|
+
"shared_to_organizations"
|
|
23556
23697
|
]
|
|
23557
23698
|
}
|
|
23558
23699
|
|
|
23559
|
-
function fieldsExtend$
|
|
23700
|
+
function fieldsExtend$4(){
|
|
23560
23701
|
return {
|
|
23561
23702
|
"label": {
|
|
23703
|
+
"group": "",
|
|
23562
23704
|
"is_wide": true
|
|
23563
23705
|
},
|
|
23564
23706
|
"name": {
|
|
@@ -23608,10 +23750,21 @@
|
|
|
23608
23750
|
}
|
|
23609
23751
|
},
|
|
23610
23752
|
"shared": {
|
|
23753
|
+
"group": "",
|
|
23611
23754
|
"amis": {
|
|
23612
|
-
"visibleOn": "${
|
|
23755
|
+
"visibleOn": "${false}"
|
|
23756
|
+
}
|
|
23757
|
+
},
|
|
23758
|
+
"shared_to": {
|
|
23759
|
+
"group": "",
|
|
23760
|
+
"amis":{
|
|
23761
|
+
"type": "radios",
|
|
23762
|
+
"inline": false
|
|
23613
23763
|
}
|
|
23614
23764
|
},
|
|
23765
|
+
"shared_to_organizations": {
|
|
23766
|
+
"group": ""
|
|
23767
|
+
},
|
|
23615
23768
|
"filters": {
|
|
23616
23769
|
"group": "",
|
|
23617
23770
|
"amis": {
|
|
@@ -23621,6 +23774,12 @@
|
|
|
23621
23774
|
}
|
|
23622
23775
|
}
|
|
23623
23776
|
|
|
23777
|
+
/*
|
|
23778
|
+
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
23779
|
+
* @Date: 2023-06-13 13:51:19
|
|
23780
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
23781
|
+
* @LastEditTime: 2024-02-05 11:25:09
|
|
23782
|
+
*/
|
|
23624
23783
|
const getRenameListviewButtonSchema = ()=>{
|
|
23625
23784
|
return {
|
|
23626
23785
|
"type": "button",
|
|
@@ -23646,6 +23805,7 @@
|
|
|
23646
23805
|
"label": "对象表单",
|
|
23647
23806
|
"objectApiName": "object_listviews",
|
|
23648
23807
|
"recordId": "${recordId}",
|
|
23808
|
+
"layout": "normal",
|
|
23649
23809
|
"mode": "edit",
|
|
23650
23810
|
"fields": [
|
|
23651
23811
|
"label"
|
|
@@ -23680,6 +23840,12 @@
|
|
|
23680
23840
|
}
|
|
23681
23841
|
};
|
|
23682
23842
|
|
|
23843
|
+
/*
|
|
23844
|
+
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
23845
|
+
* @Date: 2023-06-13 13:51:19
|
|
23846
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
23847
|
+
* @LastEditTime: 2024-02-06 15:38:49
|
|
23848
|
+
*/
|
|
23683
23849
|
const getSetListviewShareButtonSchema = ()=>{
|
|
23684
23850
|
return {
|
|
23685
23851
|
"type": "button",
|
|
@@ -23695,6 +23861,8 @@
|
|
|
23695
23861
|
"title": instance.t('frontend_listview_control_share'),
|
|
23696
23862
|
"data": {
|
|
23697
23863
|
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
23864
|
+
"appId": "${appId}",
|
|
23865
|
+
"global": "${global}",
|
|
23698
23866
|
"context": "${context}"
|
|
23699
23867
|
},
|
|
23700
23868
|
"body": [
|
|
@@ -23704,9 +23872,12 @@
|
|
|
23704
23872
|
"objectApiName": "object_listviews",
|
|
23705
23873
|
"recordId": "${recordId}",
|
|
23706
23874
|
"mode": "edit",
|
|
23875
|
+
"layout": "normal",
|
|
23707
23876
|
"fields": [
|
|
23708
|
-
"
|
|
23709
|
-
|
|
23877
|
+
"shared_to",
|
|
23878
|
+
"shared_to_organizations"
|
|
23879
|
+
],
|
|
23880
|
+
"fieldsExtend": fieldsExtend$3(),
|
|
23710
23881
|
}
|
|
23711
23882
|
],
|
|
23712
23883
|
"showCloseButton": true,
|
|
@@ -23724,6 +23895,21 @@
|
|
|
23724
23895
|
}
|
|
23725
23896
|
};
|
|
23726
23897
|
|
|
23898
|
+
function fieldsExtend$3(){
|
|
23899
|
+
return {
|
|
23900
|
+
"shared_to": {
|
|
23901
|
+
"group": "",
|
|
23902
|
+
"amis":{
|
|
23903
|
+
"type": "radios",
|
|
23904
|
+
"inline": false
|
|
23905
|
+
}
|
|
23906
|
+
},
|
|
23907
|
+
"shared_to_organizations": {
|
|
23908
|
+
"group": ""
|
|
23909
|
+
}
|
|
23910
|
+
}
|
|
23911
|
+
}
|
|
23912
|
+
|
|
23727
23913
|
const getSetListviewFiltersButtonSchema = ()=>{
|
|
23728
23914
|
return {
|
|
23729
23915
|
"type": "button",
|
|
@@ -23855,10 +24041,12 @@
|
|
|
23855
24041
|
function fieldsExtend$2(){
|
|
23856
24042
|
return {
|
|
23857
24043
|
"filters": {
|
|
24044
|
+
"label": "",
|
|
24045
|
+
"group": "",
|
|
23858
24046
|
"visible_on": "true",
|
|
23859
24047
|
"amis": {
|
|
23860
24048
|
"type": "condition-builder",
|
|
23861
|
-
"label":
|
|
24049
|
+
// "label": i18next.t('frontend_listview_control_filters_fields_extend'),
|
|
23862
24050
|
"source": {
|
|
23863
24051
|
"method": "get",
|
|
23864
24052
|
"url": "${context.rootUrl}/service/api/amis-metadata-listviews/getFilterFields?objectName=${targetObjectName}",
|
|
@@ -23901,6 +24089,7 @@
|
|
|
23901
24089
|
"objectApiName": "object_listviews",
|
|
23902
24090
|
"recordId": "${recordId}",
|
|
23903
24091
|
"mode": "edit",
|
|
24092
|
+
"layout": "normal",
|
|
23904
24093
|
"fieldsExtend": fieldsExtend$1(),
|
|
23905
24094
|
"initApiAdaptor": initApiAdaptor$1(),
|
|
23906
24095
|
"apiRequestAdaptor": apiRequestAdaptor$1(),
|
|
@@ -24097,6 +24286,8 @@
|
|
|
24097
24286
|
function fieldsExtend(){
|
|
24098
24287
|
return {
|
|
24099
24288
|
"sort": {
|
|
24289
|
+
"label": "",
|
|
24290
|
+
"group": "",
|
|
24100
24291
|
"amis": {
|
|
24101
24292
|
"type": "tabs-transfer",
|
|
24102
24293
|
"sortable": true,
|
|
@@ -24224,7 +24415,7 @@
|
|
|
24224
24415
|
"icon": "fa fa-cog",
|
|
24225
24416
|
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
24226
24417
|
// "tooltip": i18next.t('frontend_button_listview_control_tooltip'),
|
|
24227
|
-
"btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded
|
|
24418
|
+
"btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded text-gray-500",
|
|
24228
24419
|
"align": "right",
|
|
24229
24420
|
"visibleOn": "${!isLookup}",
|
|
24230
24421
|
"buttons": [
|
|
@@ -24245,8 +24436,8 @@
|
|
|
24245
24436
|
}
|
|
24246
24437
|
};
|
|
24247
24438
|
|
|
24248
|
-
const getDisplayAsButton = function(objectName,
|
|
24249
|
-
let displayAs = Router.getTabDisplayAs(objectName);
|
|
24439
|
+
const getDisplayAsButton = function(objectName, defaultEnableSplit){
|
|
24440
|
+
let displayAs = Router.getTabDisplayAs(objectName, defaultEnableSplit);
|
|
24250
24441
|
let buttons = [
|
|
24251
24442
|
{
|
|
24252
24443
|
"type": "button",
|
|
@@ -24269,7 +24460,7 @@
|
|
|
24269
24460
|
"icon": "fa fa-table-columns",
|
|
24270
24461
|
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
24271
24462
|
// "tooltip": `${i18next.t('frontend_display_as')} ${displayAsLabel}`,
|
|
24272
|
-
"btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded
|
|
24463
|
+
"btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded text-gray-500",
|
|
24273
24464
|
"align": "right",
|
|
24274
24465
|
"visibleOn": "${window:innerWidth > 768 && !!!isLookup}",
|
|
24275
24466
|
"buttons": [
|
|
@@ -24462,7 +24653,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24462
24653
|
// //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
24463
24654
|
// // "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
24464
24655
|
// "tooltipPlacement": "top",
|
|
24465
|
-
// "className": "bg-white p-2 rounded
|
|
24656
|
+
// "className": "bg-white p-2 rounded text-gray-500",
|
|
24466
24657
|
// "label": "",
|
|
24467
24658
|
// "icon": "fa fa-sync",
|
|
24468
24659
|
// "visibleOn": "${!showFieldsFilter}",
|
|
@@ -24486,7 +24677,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24486
24677
|
// "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
24487
24678
|
"tooltip":"",
|
|
24488
24679
|
"tooltipPlacement": "top",
|
|
24489
|
-
"className": "bg-white p-2 rounded
|
|
24680
|
+
"className": "bg-white p-2 rounded text-gray-500"
|
|
24490
24681
|
};
|
|
24491
24682
|
}
|
|
24492
24683
|
else {
|
|
@@ -24497,7 +24688,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24497
24688
|
// "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
24498
24689
|
"tooltip":"",
|
|
24499
24690
|
"tooltipPlacement": "top",
|
|
24500
|
-
"className": "bg-white p-2 rounded
|
|
24691
|
+
"className": "bg-white p-2 rounded text-gray-500"
|
|
24501
24692
|
};
|
|
24502
24693
|
}
|
|
24503
24694
|
let toolbarFilter;
|
|
@@ -24519,7 +24710,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24519
24710
|
"visibleOn": "${isFieldsFilterEmpty == false && isLookup != true}"
|
|
24520
24711
|
},
|
|
24521
24712
|
"align": "right",
|
|
24522
|
-
"className": "bg-white p-2 rounded
|
|
24713
|
+
"className": "bg-white p-2 rounded text-gray-500",
|
|
24523
24714
|
"onEvent": {
|
|
24524
24715
|
"click": {
|
|
24525
24716
|
"actions": [
|
|
@@ -24533,7 +24724,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24533
24724
|
"id": "steedos_crud_toolbar_filter"
|
|
24534
24725
|
};
|
|
24535
24726
|
}
|
|
24536
|
-
let toolbarDisplayAsButton = getDisplayAsButton(mainObject?.name);
|
|
24727
|
+
let toolbarDisplayAsButton = getDisplayAsButton(mainObject?.name, mainObject?.enable_split);
|
|
24537
24728
|
let toolbarDQuickSearchBox = getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLookup, keywordsSearchBoxName });
|
|
24538
24729
|
|
|
24539
24730
|
// toolbars返回的数组元素不可以是空对象{},比如hiddenCount ? {} : {"type": "tpl",...},因为空对象最终还是会生成一个空的.antd-Crud-toolbar-item dom
|
|
@@ -24679,7 +24870,6 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24679
24870
|
"timeOut": 1000
|
|
24680
24871
|
}
|
|
24681
24872
|
});
|
|
24682
|
-
resizeWindow();
|
|
24683
24873
|
const scope = event.context.scoped;
|
|
24684
24874
|
// let filterFormValues = event.data;
|
|
24685
24875
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
@@ -24755,8 +24945,8 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
24755
24945
|
/*
|
|
24756
24946
|
* @Author: baozhoutao@steedos.com
|
|
24757
24947
|
* @Date: 2022-07-05 15:55:39
|
|
24758
|
-
* @LastEditors:
|
|
24759
|
-
* @LastEditTime: 2024-
|
|
24948
|
+
* @LastEditors: liaodaxue
|
|
24949
|
+
* @LastEditTime: 2024-02-05 17:56:27
|
|
24760
24950
|
* @Description:
|
|
24761
24951
|
*/
|
|
24762
24952
|
|
|
@@ -25323,17 +25513,13 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25323
25513
|
|
|
25324
25514
|
function getLookupSapceUserTreeSchema(isMobile){
|
|
25325
25515
|
let apiAdaptor = `
|
|
25326
|
-
// console.log("===getLookupSapceUserTreeSchema===", JSON.stringify(payload));
|
|
25327
25516
|
const records = payload.data.options;
|
|
25328
|
-
let isTreeOptionsComputed = false;
|
|
25329
|
-
if(records.length === 1 && records[0].children){
|
|
25330
|
-
isTreeOptionsComputed = true;
|
|
25331
|
-
}
|
|
25332
|
-
if(isTreeOptionsComputed){
|
|
25333
|
-
return payload;
|
|
25334
|
-
}
|
|
25335
25517
|
const treeRecords = [];
|
|
25336
|
-
const getChildren = (records, childrenIds) => {
|
|
25518
|
+
const getChildren = (currentRecord, records, childrenIds) => {
|
|
25519
|
+
if (currentRecord.children && typeof currentRecord.children[0] === "object") {
|
|
25520
|
+
// 考虑api配置了cache缓存的话,不会请求接口但是会重新进这个接收适配器脚本且payload.data.options返回的会是上一次计算结果,这里直接返回计算过的children
|
|
25521
|
+
return currentRecord.children;
|
|
25522
|
+
}
|
|
25337
25523
|
if (!childrenIds) {
|
|
25338
25524
|
return;
|
|
25339
25525
|
}
|
|
@@ -25342,7 +25528,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25342
25528
|
});
|
|
25343
25529
|
_.each(children, (item) => {
|
|
25344
25530
|
if (item.children) {
|
|
25345
|
-
item.children = getChildren(records, item.children)
|
|
25531
|
+
item.children = getChildren(item, records, item.children)
|
|
25346
25532
|
}else{
|
|
25347
25533
|
item.children = [];
|
|
25348
25534
|
}
|
|
@@ -25368,7 +25554,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25368
25554
|
|
|
25369
25555
|
_.each(records, (record) => {
|
|
25370
25556
|
if (record.noParent == 1) {
|
|
25371
|
-
treeRecords.push(Object.assign({}, record, { children: getChildren(records, record.children) }));
|
|
25557
|
+
treeRecords.push(Object.assign({}, record, { children: getChildren(record, records, record.children) }));
|
|
25372
25558
|
}
|
|
25373
25559
|
});
|
|
25374
25560
|
console.log(treeRecords)
|
|
@@ -25418,6 +25604,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25418
25604
|
}
|
|
25419
25605
|
},
|
|
25420
25606
|
"label": "",
|
|
25607
|
+
"mode": "normal",
|
|
25421
25608
|
"name": "organizations",
|
|
25422
25609
|
"multiple": false,
|
|
25423
25610
|
"joinValues": false,
|
|
@@ -25560,6 +25747,9 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25560
25747
|
}
|
|
25561
25748
|
});
|
|
25562
25749
|
|
|
25750
|
+
let listviewFilter = getListViewFilter(listView);
|
|
25751
|
+
let listviewFiltersFunction = listView && listView._filters;
|
|
25752
|
+
|
|
25563
25753
|
let sort = "";
|
|
25564
25754
|
if(listView){
|
|
25565
25755
|
sort = getListViewSort(listView);
|
|
@@ -25606,7 +25796,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25606
25796
|
Object.assign(api.data.$self, __changedSearchBoxValues, __changedFilterFormValues);
|
|
25607
25797
|
}
|
|
25608
25798
|
const selfData = JSON.parse(JSON.stringify(api.data.$self));
|
|
25609
|
-
var filters = [];
|
|
25799
|
+
${listviewFilter && !ctx.inFilterForm ? `var filters = ${JSON.stringify(listviewFilter)};` : 'var filters = [];'}
|
|
25610
25800
|
var pageSize = api.data.pageSize || 10;
|
|
25611
25801
|
var pageNo = api.data.pageNo || 1;
|
|
25612
25802
|
var skip = (pageNo - 1) * pageSize;
|
|
@@ -25668,6 +25858,16 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25668
25858
|
}
|
|
25669
25859
|
|
|
25670
25860
|
const inFilterForm = ${ctx.inFilterForm};
|
|
25861
|
+
|
|
25862
|
+
const listviewFiltersFunction = ${listviewFiltersFunction};
|
|
25863
|
+
|
|
25864
|
+
if(listviewFiltersFunction && !inFilterForm){
|
|
25865
|
+
const _filters0 = listviewFiltersFunction(filters, api.data.$self.__super);
|
|
25866
|
+
if(_filters0 && _filters0.length){
|
|
25867
|
+
filters.push(_filters0);
|
|
25868
|
+
}
|
|
25869
|
+
}
|
|
25870
|
+
|
|
25671
25871
|
const filtersFunction = ${field.filtersFunction || field._filtersFunction};
|
|
25672
25872
|
|
|
25673
25873
|
if(filtersFunction && !inFilterForm){
|
|
@@ -25755,6 +25955,16 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25755
25955
|
});
|
|
25756
25956
|
payload.data.rows = treeRecords;
|
|
25757
25957
|
}
|
|
25958
|
+
const result = payload.data.rows;
|
|
25959
|
+
if(result && result.length){
|
|
25960
|
+
const updatedResult = _.map(result, (element) => {
|
|
25961
|
+
const data = { ...element };
|
|
25962
|
+
// image字段值添加URL前缀
|
|
25963
|
+
${getScriptForAddUrlPrefixForImgFields(lodash.exports.values(refObjectConfig.fields))}
|
|
25964
|
+
return data;
|
|
25965
|
+
});
|
|
25966
|
+
payload.data.rows = updatedResult;
|
|
25967
|
+
}
|
|
25758
25968
|
return payload;
|
|
25759
25969
|
`;
|
|
25760
25970
|
if(field.optionsFunction || field._optionsFunction){
|
|
@@ -25786,13 +25996,15 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25786
25996
|
|
|
25787
25997
|
pickerSchema.affixHeader = false;
|
|
25788
25998
|
|
|
25789
|
-
|
|
25999
|
+
|
|
26000
|
+
|
|
26001
|
+
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, fieldsArr, ctx.formFactor, { isLookup: true, keywordsSearchBoxName });
|
|
26002
|
+
|
|
25790
26003
|
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user"){
|
|
25791
|
-
|
|
26004
|
+
pickerSchema.headerToolbar.push(getLookupSapceUserTreeSchema(isMobile));
|
|
25792
26005
|
pickerSchema.className = pickerSchema.className || "" + " steedos-select-user";
|
|
25793
26006
|
}
|
|
25794
|
-
|
|
25795
|
-
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, fieldsArr, ctx.formFactor, { headerToolbarItems, isLookup: true, keywordsSearchBoxName });
|
|
26007
|
+
|
|
25796
26008
|
const isAllowCreate = refObjectConfig.permissions.allowCreate;
|
|
25797
26009
|
const isCreate = lodash.exports.isBoolean(field.create) ? field.create : true;
|
|
25798
26010
|
// lookup字段配置过滤条件就强制不显示新建按钮
|
|
@@ -25905,8 +26117,19 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25905
26117
|
pickerSchema.footerToolbar = ["pagination"];
|
|
25906
26118
|
}
|
|
25907
26119
|
|
|
26120
|
+
if(field.inlineHelpText){
|
|
26121
|
+
pickerSchema.toolbarClassName = "hasHelpText";
|
|
26122
|
+
pickerSchema.headerToolbar = [{
|
|
26123
|
+
"type": "tpl",
|
|
26124
|
+
"tpl": field.inlineHelpText,
|
|
26125
|
+
"className": "text-secondary"
|
|
26126
|
+
}, ...pickerSchema.headerToolbar];
|
|
26127
|
+
}
|
|
26128
|
+
pickerSchema.className = (pickerSchema.className || "") + " steedos-lookup-crud";
|
|
26129
|
+
|
|
25908
26130
|
const data = {
|
|
25909
26131
|
type: getAmisStaticFieldType('picker', readonly),
|
|
26132
|
+
className: ctx.className || '',
|
|
25910
26133
|
modalTitle: instance.t('frontend_form_please_select') + " " + refObjectConfig.label,
|
|
25911
26134
|
labelField: referenceTo.labelField.name,
|
|
25912
26135
|
valueField: referenceTo.valueField.name,
|
|
@@ -25980,6 +26203,9 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
25980
26203
|
const refObjectConfig = referenceTo && await getUISchema(referenceTo.objectName);
|
|
25981
26204
|
let listView = getLookupListView(refObjectConfig);
|
|
25982
26205
|
|
|
26206
|
+
let listviewFilter = getListViewFilter(listView);
|
|
26207
|
+
let listviewFiltersFunction = listView && listView._filters;
|
|
26208
|
+
|
|
25983
26209
|
let sort = "";
|
|
25984
26210
|
if(listView){
|
|
25985
26211
|
sort = getListViewSort(listView);
|
|
@@ -26009,7 +26235,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26009
26235
|
apiInfo.data['rfield'] = `\${object_name}`;
|
|
26010
26236
|
// [["_id", "=", "$${field.name}._id"],"or",["name", "contains", "$term"]]
|
|
26011
26237
|
apiInfo.requestAdaptor = `
|
|
26012
|
-
var filters = [];
|
|
26238
|
+
${listviewFilter && !ctx.inFilterForm ? `var filters = ${JSON.stringify(listviewFilter)};` : 'var filters = [];'}
|
|
26013
26239
|
var top = 200;
|
|
26014
26240
|
if(api.data.$term){
|
|
26015
26241
|
filters = [["${referenceTo?.NAME_FIELD_KEY || 'name'}", "contains", api.data.$term]];
|
|
@@ -26032,6 +26258,16 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26032
26258
|
}
|
|
26033
26259
|
|
|
26034
26260
|
const inFilterForm = ${ctx.inFilterForm};
|
|
26261
|
+
|
|
26262
|
+
const listviewFiltersFunction = ${listviewFiltersFunction};
|
|
26263
|
+
|
|
26264
|
+
if(listviewFiltersFunction && !inFilterForm){
|
|
26265
|
+
const _filters0 = listviewFiltersFunction(filters, api.data.$);
|
|
26266
|
+
if(_filters0 && _filters0.length){
|
|
26267
|
+
filters.push(_filters0);
|
|
26268
|
+
}
|
|
26269
|
+
}
|
|
26270
|
+
|
|
26035
26271
|
const filtersFunction = ${field.filtersFunction || field._filtersFunction};
|
|
26036
26272
|
|
|
26037
26273
|
if(filtersFunction && !inFilterForm){
|
|
@@ -26108,6 +26344,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26108
26344
|
// 但是同时配置autoComplete和source会多请求一次接口
|
|
26109
26345
|
// TODO:应该想办法把是否字段在子表组件内,即ctx.isInputTable,如果不在子表组件内不需要加source
|
|
26110
26346
|
data.source = apiInfo;
|
|
26347
|
+
delete data.autoComplete;
|
|
26111
26348
|
}
|
|
26112
26349
|
//删除xlink:href中的rootUrl前缀,解决客户端svg为空的问题
|
|
26113
26350
|
const select_menuTpl = `<span class='flex items-center mt-0.5'>
|
|
@@ -26154,7 +26391,8 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26154
26391
|
}
|
|
26155
26392
|
// console.log(`lookupToAmis====`, field, readonly, ctx)
|
|
26156
26393
|
if(readonly){
|
|
26157
|
-
if(field.reference_to){
|
|
26394
|
+
if(field.reference_to && !field.isTableField){
|
|
26395
|
+
//isTableField只在grid字段内存在
|
|
26158
26396
|
return {
|
|
26159
26397
|
type: 'steedos-field',
|
|
26160
26398
|
config: field,
|
|
@@ -26365,8 +26603,8 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26365
26603
|
/*
|
|
26366
26604
|
* @Author: baozhoutao@steedos.com
|
|
26367
26605
|
* @Date: 2023-01-13 17:27:54
|
|
26368
|
-
* @LastEditors:
|
|
26369
|
-
* @LastEditTime:
|
|
26606
|
+
* @LastEditors: liaodaxue
|
|
26607
|
+
* @LastEditTime: 2024-02-04 17:29:54
|
|
26370
26608
|
* @Description:
|
|
26371
26609
|
*/
|
|
26372
26610
|
|
|
@@ -26467,7 +26705,8 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26467
26705
|
"title": "Insert",
|
|
26468
26706
|
"items": "image link media addcomment pageembed codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents | insertdatetime"
|
|
26469
26707
|
}
|
|
26470
|
-
}
|
|
26708
|
+
},
|
|
26709
|
+
"statusbar": false
|
|
26471
26710
|
},
|
|
26472
26711
|
"name": field.name
|
|
26473
26712
|
}
|
|
@@ -26705,13 +26944,31 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26705
26944
|
};
|
|
26706
26945
|
break;
|
|
26707
26946
|
case 'input-datetime-range':
|
|
26947
|
+
// convertData = {
|
|
26948
|
+
// type: "input-datetime-range",
|
|
26949
|
+
// inputFormat: 'YYYY-MM-DD HH:mm',
|
|
26950
|
+
// format:'YYYY-MM-DDTHH:mm:ss.SSSZ',
|
|
26951
|
+
// tpl: readonly ? Tpl.getDateTimeTpl(field) : null,
|
|
26952
|
+
// utc: true,
|
|
26953
|
+
// joinValues: false
|
|
26954
|
+
// }
|
|
26955
|
+
// 日期时间字段,按日期方式展现显示控件,用户不用关心小时分钟
|
|
26708
26956
|
convertData = {
|
|
26709
|
-
type: "input-
|
|
26710
|
-
inputFormat:
|
|
26957
|
+
type: "input-date-range",
|
|
26958
|
+
inputFormat: "YYYY-MM-DD HH:mm",
|
|
26711
26959
|
format:'YYYY-MM-DDTHH:mm:ss.SSSZ',
|
|
26712
26960
|
tpl: readonly ? getDateTimeTpl(field) : null,
|
|
26713
26961
|
utc: true,
|
|
26714
|
-
joinValues: false
|
|
26962
|
+
joinValues: false,
|
|
26963
|
+
"shortcuts": [
|
|
26964
|
+
"thismonth",
|
|
26965
|
+
"2monthsago",
|
|
26966
|
+
"3monthslater",
|
|
26967
|
+
"prevquarter",
|
|
26968
|
+
"thisquarter",
|
|
26969
|
+
"thisyear",
|
|
26970
|
+
"lastYear"
|
|
26971
|
+
]
|
|
26715
26972
|
};
|
|
26716
26973
|
break;
|
|
26717
26974
|
case 'datetime':
|
|
@@ -26762,7 +27019,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26762
27019
|
convertData = {
|
|
26763
27020
|
type: getAmisStaticFieldType('datetime', readonly),
|
|
26764
27021
|
inputFormat: 'YYYY-MM-DD HH:mm',
|
|
26765
|
-
format: 'YYYY-MM-DDTHH:mm:
|
|
27022
|
+
format: 'YYYY-MM-DDTHH:mm:00.000Z',
|
|
26766
27023
|
tpl: readonly ? getDateTimeTpl(field) : null,
|
|
26767
27024
|
utc: true,
|
|
26768
27025
|
};
|
|
@@ -26893,6 +27150,36 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
26893
27150
|
convertData = {
|
|
26894
27151
|
type: 'static-text'
|
|
26895
27152
|
};
|
|
27153
|
+
}else if(field.autonumber_enable_modify){
|
|
27154
|
+
convertData = {
|
|
27155
|
+
"type": "input-group",
|
|
27156
|
+
"body": [
|
|
27157
|
+
{
|
|
27158
|
+
"type": "input-text",
|
|
27159
|
+
"name": field.name
|
|
27160
|
+
},
|
|
27161
|
+
{
|
|
27162
|
+
"type": "button",
|
|
27163
|
+
"label": "自动获取",
|
|
27164
|
+
"actionType": "ajax",
|
|
27165
|
+
"api": {
|
|
27166
|
+
"url": `\${context.rootUrl}/api/autonumber/generator/\${objectName}/${field.name}`,
|
|
27167
|
+
"method": "post",
|
|
27168
|
+
"headers": {
|
|
27169
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
27170
|
+
},
|
|
27171
|
+
"adaptor": `
|
|
27172
|
+
payload.data["${field.name}"] = payload.data && payload.data.autonumber;
|
|
27173
|
+
delete payload.data.autonumber;
|
|
27174
|
+
return payload;
|
|
27175
|
+
`
|
|
27176
|
+
},
|
|
27177
|
+
"messages": {
|
|
27178
|
+
"success": "获取成功"
|
|
27179
|
+
}
|
|
27180
|
+
}
|
|
27181
|
+
]
|
|
27182
|
+
};
|
|
26896
27183
|
}
|
|
26897
27184
|
break;
|
|
26898
27185
|
case 'url':
|
|
@@ -27098,12 +27385,13 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
27098
27385
|
break;
|
|
27099
27386
|
}
|
|
27100
27387
|
if(!lodash.exports.isEmpty(convertData)){
|
|
27388
|
+
const className = convertData.className;
|
|
27101
27389
|
if(field.is_wide || convertData.type === 'group'){
|
|
27102
|
-
convertData.className = 'col-span-2 m-0';
|
|
27390
|
+
convertData.className = className ? 'col-span-2 m-0 ' + className : 'col-span-2 m-0';
|
|
27103
27391
|
}else {
|
|
27104
|
-
convertData.className = 'm-0';
|
|
27392
|
+
convertData.className = className ? 'm-0 ' + className : 'm-0';
|
|
27105
27393
|
}
|
|
27106
|
-
if(readonly){
|
|
27394
|
+
if(readonly && ctx.mode !== 'edit'){
|
|
27107
27395
|
convertData.className = `${convertData.className} border-b`;
|
|
27108
27396
|
}
|
|
27109
27397
|
if(readonly){
|
|
@@ -27111,11 +27399,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
27111
27399
|
}
|
|
27112
27400
|
|
|
27113
27401
|
let fieldTypeClassName = ' steedos-' + convertData.type + (readonly ? '-readonly' : '-edit');
|
|
27114
|
-
|
|
27115
|
-
convertData.className = convertData.className + fieldTypeClassName;
|
|
27116
|
-
} else {
|
|
27117
|
-
convertData.className = fieldTypeClassName;
|
|
27118
|
-
}
|
|
27402
|
+
convertData.className = convertData.className + fieldTypeClassName;
|
|
27119
27403
|
|
|
27120
27404
|
if(field.visible_on && !ctx.inFilterForm){
|
|
27121
27405
|
// convertData.visibleOn = `\$${field.visible_on.substring(1, field.visible_on.length -1).replace(/formData./g, '')}`;
|
|
@@ -27198,8 +27482,9 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
27198
27482
|
fieldNamePrefix = `${fieldNamePrefix}between__`;
|
|
27199
27483
|
}
|
|
27200
27484
|
if(_field.type === 'datetime'){
|
|
27201
|
-
//
|
|
27202
|
-
|
|
27485
|
+
// 这里如果想把搜索范围展示效果改为日期范围,不可以直接改为input-date-range,因为它们规则不一样,包括时区规则和小时分秒的存值规则都不一样
|
|
27486
|
+
// 所以想改为展示日期范围效果,只能改input-datetime-range类型本身的属性来实现
|
|
27487
|
+
_field.type = 'input-datetime-range';
|
|
27203
27488
|
_field.is_wide = true;
|
|
27204
27489
|
fieldNamePrefix = `${fieldNamePrefix}between__`;
|
|
27205
27490
|
}
|