@steedos-widgets/sortable 3.6.2-beta.9 → 3.6.2
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.esm.js
CHANGED
|
@@ -53928,14 +53928,13 @@ function getRootUrl(defaultRootUrl){
|
|
|
53928
53928
|
/*
|
|
53929
53929
|
* @Author: baozhoutao@steedos.com
|
|
53930
53930
|
* @Date: 2022-08-16 17:02:08
|
|
53931
|
-
* @LastEditors:
|
|
53932
|
-
* @LastEditTime:
|
|
53931
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
53932
|
+
* @LastEditTime: 2024-02-02 10:15:00
|
|
53933
53933
|
* @Description:
|
|
53934
53934
|
*/
|
|
53935
53935
|
|
|
53936
53936
|
const Router = {
|
|
53937
|
-
getTabDisplayAs(tab_id){
|
|
53938
|
-
const uiSchema = getUISchemaSync$1(tab_id, false);
|
|
53937
|
+
getTabDisplayAs(tab_id, defaultEnableSplit){
|
|
53939
53938
|
var urlSearch = new URLSearchParams(document.location.search);
|
|
53940
53939
|
if(urlSearch.has('display')){
|
|
53941
53940
|
return urlSearch.get('display')
|
|
@@ -53944,9 +53943,12 @@ const Router = {
|
|
|
53944
53943
|
// const key = `page_display`;
|
|
53945
53944
|
const value = sessionStorage.getItem(key);
|
|
53946
53945
|
let defaultDisplay = "grid";
|
|
53947
|
-
if(
|
|
53946
|
+
if(defaultEnableSplit === true){
|
|
53948
53947
|
defaultDisplay = "split";
|
|
53949
53948
|
}
|
|
53949
|
+
if(window.innerWidth <= 768){
|
|
53950
|
+
return "grid";
|
|
53951
|
+
}
|
|
53950
53952
|
return value ? value : defaultDisplay;
|
|
53951
53953
|
},
|
|
53952
53954
|
|
|
@@ -53979,8 +53981,8 @@ const Router = {
|
|
|
53979
53981
|
/*
|
|
53980
53982
|
* @Author: baozhoutao@steedos.com
|
|
53981
53983
|
* @Date: 2022-07-20 16:29:22
|
|
53982
|
-
* @LastEditors:
|
|
53983
|
-
* @LastEditTime:
|
|
53984
|
+
* @LastEditors: liaodaxue
|
|
53985
|
+
* @LastEditTime: 2024-01-25 14:44:17
|
|
53984
53986
|
* @Description:
|
|
53985
53987
|
*/
|
|
53986
53988
|
|
|
@@ -54052,6 +54054,25 @@ function getComparableAmisVersion() {
|
|
|
54052
54054
|
}
|
|
54053
54055
|
}
|
|
54054
54056
|
|
|
54057
|
+
/**
|
|
54058
|
+
* 判断浏览器类型
|
|
54059
|
+
* @returns 按需返回浏览器类型;
|
|
54060
|
+
*/
|
|
54061
|
+
function getBowserType() {
|
|
54062
|
+
const userAgent = navigator.userAgent;
|
|
54063
|
+
if (userAgent.indexOf("Chrome")!== -1 && userAgent.indexOf("Safari") !== -1 && userAgent.indexOf("Edg") === -1) {
|
|
54064
|
+
return "Chrome";
|
|
54065
|
+
} else if (userAgent.indexOf("Firefox") !== -1) {
|
|
54066
|
+
return "Firefox";
|
|
54067
|
+
} else if (userAgent.indexOf("Safari") !== -1 && userAgent.indexOf("Chrome") === -1 && userAgent.indexOf("Edge") === -1) {
|
|
54068
|
+
return "Safari";
|
|
54069
|
+
} else if (userAgent.indexOf("Edg") !== -1) {
|
|
54070
|
+
return "Edge";
|
|
54071
|
+
} else {
|
|
54072
|
+
return "Unknown browser"; // 其他浏览器...(可根据自己需要确定是否新增其他浏览器的判断)
|
|
54073
|
+
}
|
|
54074
|
+
}
|
|
54075
|
+
|
|
54055
54076
|
function getNumberTpl(field){
|
|
54056
54077
|
return `<span>\${_display.${field.name}}</span>`
|
|
54057
54078
|
}
|
|
@@ -54092,7 +54113,7 @@ function getSelectMap(selectOptions){
|
|
|
54092
54113
|
lodash.exports.forEach(selectOptions,(option)=>{
|
|
54093
54114
|
const optionValue = option.value + '';
|
|
54094
54115
|
const optionColor = option.color + '';
|
|
54095
|
-
if(optionColor){
|
|
54116
|
+
if(optionColor && optionColor != "undefined"){
|
|
54096
54117
|
const background = optionColor.charAt(0) === '#' ? optionColor : '#'+optionColor;
|
|
54097
54118
|
const color = getContrastColor(background);
|
|
54098
54119
|
const optionColorStyle = 'background:'+background+';color:'+color+';line-height:1.5rem';
|
|
@@ -54476,7 +54497,31 @@ const getAmisFileReadonlySchema = (steedosField)=>{
|
|
|
54476
54497
|
}
|
|
54477
54498
|
}
|
|
54478
54499
|
if(type === 'file'){
|
|
54479
|
-
return {
|
|
54500
|
+
return window.Meteor?.isCordova ? {
|
|
54501
|
+
"type": "control",
|
|
54502
|
+
"body": {
|
|
54503
|
+
"type": "each",
|
|
54504
|
+
"name": "_display." + steedosField.name,
|
|
54505
|
+
"items": {
|
|
54506
|
+
"type": "tpl",
|
|
54507
|
+
"tpl": "${name}",
|
|
54508
|
+
"className": "antd-Button--link inline-block",
|
|
54509
|
+
"onEvent": {
|
|
54510
|
+
"click": {
|
|
54511
|
+
"actions": [
|
|
54512
|
+
{
|
|
54513
|
+
"script": `
|
|
54514
|
+
Steedos.cordovaDownload(encodeURI(event.data.url), event.data.name);
|
|
54515
|
+
`,
|
|
54516
|
+
"actionType": "custom"
|
|
54517
|
+
}
|
|
54518
|
+
],
|
|
54519
|
+
"weight": 0
|
|
54520
|
+
}
|
|
54521
|
+
}
|
|
54522
|
+
}
|
|
54523
|
+
}
|
|
54524
|
+
} : {
|
|
54480
54525
|
type: amisFieldType,
|
|
54481
54526
|
tpl: `
|
|
54482
54527
|
<% let fileData = data._display.${steedosField.name}; if (fileData) { %>
|
|
@@ -54620,6 +54665,7 @@ var frontend_notifications$1 = "Notifications";
|
|
|
54620
54665
|
var frontend_notifications_allread$1 = "Mark all as read";
|
|
54621
54666
|
var frontend_notifications_allread_message$1 = "All marked as read";
|
|
54622
54667
|
var frontend_profile$1 = "Profile";
|
|
54668
|
+
var switch_space$1 = "Switch Space";
|
|
54623
54669
|
var frontend_about$1 = "About";
|
|
54624
54670
|
var frontend_log_out$1 = "Log out";
|
|
54625
54671
|
var frontend_listview_warning_start$1 = "The current ";
|
|
@@ -54707,6 +54753,7 @@ var en_us = {
|
|
|
54707
54753
|
frontend_notifications_allread: frontend_notifications_allread$1,
|
|
54708
54754
|
frontend_notifications_allread_message: frontend_notifications_allread_message$1,
|
|
54709
54755
|
frontend_profile: frontend_profile$1,
|
|
54756
|
+
switch_space: switch_space$1,
|
|
54710
54757
|
frontend_about: frontend_about$1,
|
|
54711
54758
|
frontend_log_out: frontend_log_out$1,
|
|
54712
54759
|
frontend_listview_warning_start: frontend_listview_warning_start$1,
|
|
@@ -54762,7 +54809,7 @@ var frontend_listview_control_delete_label = "删除";
|
|
|
54762
54809
|
var frontend_listview_control_delete_confirm_text = "如果您删除此列表视图,该视图将为所有具备访问权限的用户永久删除。是否确定要删除?";
|
|
54763
54810
|
var frontend_listview_control_delete_message_success = "删除成功";
|
|
54764
54811
|
var frontend_listview_control_filters = "过滤设置";
|
|
54765
|
-
var frontend_listview_control_filters_fields_extend = "条件组件
|
|
54812
|
+
var frontend_listview_control_filters_fields_extend = "条件组件";
|
|
54766
54813
|
var frontend_listview_control_new_label = "新建";
|
|
54767
54814
|
var frontend_listview_control_new_title = "新建 列表视图";
|
|
54768
54815
|
var frontend_listview_control_new_message_success = "成功";
|
|
@@ -54796,6 +54843,7 @@ var frontend_notifications = "通知";
|
|
|
54796
54843
|
var frontend_notifications_allread = "全部标记为已读";
|
|
54797
54844
|
var frontend_notifications_allread_message = "已全部标记为已读";
|
|
54798
54845
|
var frontend_profile = "个人资料";
|
|
54846
|
+
var switch_space = "切换工作区";
|
|
54799
54847
|
var frontend_about = "关于";
|
|
54800
54848
|
var frontend_log_out = "注销";
|
|
54801
54849
|
var frontend_listview_warning_start = "当前";
|
|
@@ -54884,6 +54932,7 @@ var zh_cn = {
|
|
|
54884
54932
|
frontend_notifications_allread: frontend_notifications_allread,
|
|
54885
54933
|
frontend_notifications_allread_message: frontend_notifications_allread_message,
|
|
54886
54934
|
frontend_profile: frontend_profile,
|
|
54935
|
+
switch_space: switch_space,
|
|
54887
54936
|
frontend_about: frontend_about,
|
|
54888
54937
|
frontend_log_out: frontend_log_out,
|
|
54889
54938
|
frontend_listview_warning_start: frontend_listview_warning_start,
|
|
@@ -54938,7 +54987,7 @@ async function getQuickEditSchema(field, options){
|
|
|
54938
54987
|
isAmisVersionforBatchEdit = window.Amis.version[0] >= 3 && window.Amis.version[2] >= 2;
|
|
54939
54988
|
}
|
|
54940
54989
|
const quickEditId = options.objectName + "_" + field.name + "_quickEdit";//定义快速编辑的表单id,用于setvalue传值
|
|
54941
|
-
var quickEditSchema = { body: [], id: quickEditId };
|
|
54990
|
+
var quickEditSchema = { body: [], id: quickEditId, className: "steedos-table-quickEdit" };
|
|
54942
54991
|
//select,avatar,image,file等组件无法行记录字段赋值,暂不支持批量编辑;
|
|
54943
54992
|
if(field.type != 'avatar' && field.type != 'image' && field.type != 'file' && isAmisVersionforBatchEdit){
|
|
54944
54993
|
const submitEvent = {
|
|
@@ -55197,7 +55246,8 @@ async function getQuickEditSchema(field, options){
|
|
|
55197
55246
|
"failed": "失败了呢。。"
|
|
55198
55247
|
}
|
|
55199
55248
|
}
|
|
55200
|
-
}
|
|
55249
|
+
},
|
|
55250
|
+
"expression": "${!recordPermissions.modifyAllRecords}"
|
|
55201
55251
|
},
|
|
55202
55252
|
{
|
|
55203
55253
|
"actionType": "setValue",
|
|
@@ -55213,7 +55263,7 @@ async function getQuickEditSchema(field, options){
|
|
|
55213
55263
|
"componentId": quickEditId,
|
|
55214
55264
|
"args": {
|
|
55215
55265
|
"value":{
|
|
55216
|
-
"quickedit_record_permissions": "${event.data}"
|
|
55266
|
+
"quickedit_record_permissions": "${recordPermissions.modifyAllRecords ? {'allowEdit': true} : event.data}"
|
|
55217
55267
|
}
|
|
55218
55268
|
}
|
|
55219
55269
|
}
|
|
@@ -55277,7 +55327,7 @@ async function getQuickEditSchema(field, options){
|
|
|
55277
55327
|
`
|
|
55278
55328
|
}
|
|
55279
55329
|
},
|
|
55280
|
-
"expression":"${event.data.value}"
|
|
55330
|
+
"expression":"${event.data.value && !recordPermissions.modifyAllRecords}"
|
|
55281
55331
|
},
|
|
55282
55332
|
{
|
|
55283
55333
|
"actionType": "setValue",
|
|
@@ -55308,10 +55358,20 @@ async function getQuickEditSchema(field, options){
|
|
|
55308
55358
|
"script": `
|
|
55309
55359
|
const noPermission = event.data.noPermission;
|
|
55310
55360
|
const crudComponent = event.context.scoped.getComponentById("${options.crudId}");
|
|
55311
|
-
|
|
55361
|
+
let selectedItems = crudComponent && crudComponent.props.store.selectedItems.concat();
|
|
55312
55362
|
noPermission.forEach(function (item) {
|
|
55313
55363
|
crudComponent && crudComponent.unSelectItem(_.find(selectedItems,{_id:item}));
|
|
55364
|
+
_.remove(selectedItems, (selected) => selected._id === item);
|
|
55314
55365
|
})
|
|
55366
|
+
doAction({
|
|
55367
|
+
"componentId": "${quickEditId}",
|
|
55368
|
+
"actionType": "setValue",
|
|
55369
|
+
"args": {
|
|
55370
|
+
"value": {
|
|
55371
|
+
selectedItems
|
|
55372
|
+
}
|
|
55373
|
+
}
|
|
55374
|
+
});
|
|
55315
55375
|
`
|
|
55316
55376
|
},
|
|
55317
55377
|
{
|
|
@@ -55372,7 +55432,7 @@ async function getQuickEditSchema(field, options){
|
|
|
55372
55432
|
}
|
|
55373
55433
|
|
|
55374
55434
|
function getFieldWidth(width){
|
|
55375
|
-
const defaultWidth =
|
|
55435
|
+
const defaultWidth = null;
|
|
55376
55436
|
if(typeof width == 'string'){
|
|
55377
55437
|
if(isNaN(width)){
|
|
55378
55438
|
return width || defaultWidth;
|
|
@@ -55402,22 +55462,35 @@ async function getTableColumns(fields, options){
|
|
|
55402
55462
|
//增加quickEdit属性,实现快速编辑
|
|
55403
55463
|
const quickEditSchema = allowEdit ? await getQuickEditSchema(field, options) : allowEdit;
|
|
55404
55464
|
let className = "";
|
|
55405
|
-
|
|
55406
|
-
|
|
55407
|
-
|
|
55408
|
-
|
|
55465
|
+
const bowserType = getBowserType();
|
|
55466
|
+
if(bowserType === "Safari"){
|
|
55467
|
+
className += " whitespace-nowrap ";
|
|
55468
|
+
}else {
|
|
55469
|
+
if(field.wrap != true){
|
|
55409
55470
|
className += " whitespace-nowrap ";
|
|
55471
|
+
}else {
|
|
55472
|
+
className += " break-words ";
|
|
55410
55473
|
}
|
|
55411
|
-
}else {
|
|
55412
|
-
className += " break-words ";
|
|
55413
55474
|
}
|
|
55475
|
+
|
|
55476
|
+
if (typeof field.amis?.className == "object") {
|
|
55477
|
+
className = {
|
|
55478
|
+
[className]: "true",
|
|
55479
|
+
...field.amis.className
|
|
55480
|
+
};
|
|
55481
|
+
} else if (typeof field.amis?.className == "string") {
|
|
55482
|
+
className = `${className} ${field.amis.className} `;
|
|
55483
|
+
}
|
|
55484
|
+
let fieldAmis = lodash.exports.clone(field.amis);
|
|
55485
|
+
delete fieldAmis?.className;
|
|
55486
|
+
|
|
55414
55487
|
let columnItem;
|
|
55415
55488
|
if((field.is_name || field.name === options.labelFieldName) && options.objectName === 'cms_files'){
|
|
55416
55489
|
const previewFileScript = `
|
|
55417
55490
|
var data = event.data;
|
|
55418
55491
|
var file_name = data.versions ? data.name : "${field.label}";
|
|
55419
|
-
var file_id = data._id;
|
|
55420
|
-
|
|
55492
|
+
var file_id = data.versions && data.versions[0] && data.versions[0]._id;
|
|
55493
|
+
window.previewFile && window.previewFile({file_name, file_id});
|
|
55421
55494
|
`;
|
|
55422
55495
|
columnItem = {
|
|
55423
55496
|
"type": "button",
|
|
@@ -55442,11 +55515,11 @@ async function getTableColumns(fields, options){
|
|
|
55442
55515
|
"expression": "!!!(window && window.nw && window.nw.require)"//浏览器上直接下载
|
|
55443
55516
|
},
|
|
55444
55517
|
{
|
|
55445
|
-
|
|
55446
|
-
|
|
55447
|
-
|
|
55448
|
-
|
|
55449
|
-
|
|
55518
|
+
"args": {},
|
|
55519
|
+
"actionType": "custom",
|
|
55520
|
+
"script": previewFileScript,
|
|
55521
|
+
// "expression": "!!window?.nw?.require" //PC客户端预览附件
|
|
55522
|
+
"expression": "!!(window && window.nw && window.nw.require)"//PC客户端预览附件
|
|
55450
55523
|
}
|
|
55451
55524
|
]
|
|
55452
55525
|
}
|
|
@@ -55461,7 +55534,7 @@ async function getTableColumns(fields, options){
|
|
|
55461
55534
|
toggled: field.toggled,
|
|
55462
55535
|
static: true,
|
|
55463
55536
|
className,
|
|
55464
|
-
},
|
|
55537
|
+
}, fieldAmis, {name: field.name});
|
|
55465
55538
|
}else if(field.type === 'avatar' || field.type === 'image' || field.type === 'file'){
|
|
55466
55539
|
columnItem = Object.assign({}, {
|
|
55467
55540
|
type: "switch",
|
|
@@ -55472,7 +55545,7 @@ async function getTableColumns(fields, options){
|
|
|
55472
55545
|
static: true,
|
|
55473
55546
|
className,
|
|
55474
55547
|
...getAmisFileReadonlySchema(field)
|
|
55475
|
-
},
|
|
55548
|
+
}, fieldAmis, {name: field.name});
|
|
55476
55549
|
}
|
|
55477
55550
|
else if(field.type === 'select'){
|
|
55478
55551
|
const map = getSelectMap(field.options);
|
|
@@ -55487,7 +55560,7 @@ async function getTableColumns(fields, options){
|
|
|
55487
55560
|
className,
|
|
55488
55561
|
inputClassName: "inline",
|
|
55489
55562
|
static: true,
|
|
55490
|
-
},
|
|
55563
|
+
}, fieldAmis, {name: field.name});
|
|
55491
55564
|
}
|
|
55492
55565
|
else {
|
|
55493
55566
|
const tpl = await getFieldTpl(field, options);
|
|
@@ -55514,15 +55587,6 @@ async function getTableColumns(fields, options){
|
|
|
55514
55587
|
// }
|
|
55515
55588
|
|
|
55516
55589
|
//field上的amis属性里的clssname需要单独判断类型合并
|
|
55517
|
-
if (typeof field.amis?.className == "object") {
|
|
55518
|
-
className = {
|
|
55519
|
-
[className]: "true",
|
|
55520
|
-
...field.amis.className
|
|
55521
|
-
};
|
|
55522
|
-
} else if (typeof field.amis?.className == "string") {
|
|
55523
|
-
className = `${className} ${field.amis.className} `;
|
|
55524
|
-
}
|
|
55525
|
-
delete field.amis?.className;
|
|
55526
55590
|
|
|
55527
55591
|
if(!field.hidden && !field.extra){
|
|
55528
55592
|
columnItem = Object.assign({}, {
|
|
@@ -55539,7 +55603,7 @@ async function getTableColumns(fields, options){
|
|
|
55539
55603
|
static: true,
|
|
55540
55604
|
options: field.type === 'html' ? {html: true} : null
|
|
55541
55605
|
// toggled: true
|
|
55542
|
-
},
|
|
55606
|
+
}, fieldAmis, {name: field.name});
|
|
55543
55607
|
|
|
55544
55608
|
if(field.type === 'color'){
|
|
55545
55609
|
columnItem.type = 'color';
|
|
@@ -55735,10 +55799,10 @@ async function getMobileTableColumns(fields, options){
|
|
|
55735
55799
|
if(value.url){
|
|
55736
55800
|
cms_url = value.url;
|
|
55737
55801
|
}else{
|
|
55738
|
-
cms_url = "/api/files/files/"+value+"?download=true"
|
|
55802
|
+
cms_url = Steedos.absoluteUrl("/api/files/files/"+value+"?download=true");
|
|
55739
55803
|
}
|
|
55740
55804
|
}
|
|
55741
|
-
Steedos.cordovaDownload(encodeURI(
|
|
55805
|
+
Steedos.cordovaDownload(encodeURI(cms_url), event.data.name);
|
|
55742
55806
|
`,
|
|
55743
55807
|
"actionType": "custom"
|
|
55744
55808
|
}
|
|
@@ -56000,6 +56064,50 @@ async function getTableSchema$1(fields, options){
|
|
|
56000
56064
|
}
|
|
56001
56065
|
}
|
|
56002
56066
|
|
|
56067
|
+
/*
|
|
56068
|
+
img/avatar字段值添加URL前缀使其在amis中正常显示图片。
|
|
56069
|
+
*/
|
|
56070
|
+
function getScriptForAddUrlPrefixForImgFields(fields){
|
|
56071
|
+
let imgFieldsKeys = [];
|
|
56072
|
+
let imgFields = {};
|
|
56073
|
+
fields.forEach((item)=>{
|
|
56074
|
+
if(lodash.exports.includes(['image','avatar'], item.type)){
|
|
56075
|
+
imgFieldsKeys.push(item.name);
|
|
56076
|
+
imgFields[item.name] = {
|
|
56077
|
+
name: item.name,
|
|
56078
|
+
type: item.type,
|
|
56079
|
+
multiple: item.multiple
|
|
56080
|
+
};
|
|
56081
|
+
}
|
|
56082
|
+
});
|
|
56083
|
+
if(!imgFieldsKeys.length){
|
|
56084
|
+
return '';
|
|
56085
|
+
}
|
|
56086
|
+
return `
|
|
56087
|
+
// image字段值添加URL前缀
|
|
56088
|
+
let imgFieldsKeys = ${JSON.stringify(imgFieldsKeys)};
|
|
56089
|
+
let imgFields = ${JSON.stringify(imgFields)};
|
|
56090
|
+
imgFieldsKeys.forEach((item)=>{
|
|
56091
|
+
let imgFieldValue = data[item];
|
|
56092
|
+
let imgFieldDisplayValue = data._display && data._display[item];
|
|
56093
|
+
if(imgFieldValue && imgFieldValue.length){
|
|
56094
|
+
let fieldProps = imgFields[item];
|
|
56095
|
+
if(fieldProps.multiple){
|
|
56096
|
+
if(imgFieldDisplayValue instanceof Array){
|
|
56097
|
+
data[item] = imgFieldDisplayValue.map((i)=>{
|
|
56098
|
+
const url = window.getImageFieldUrl(i.url);
|
|
56099
|
+
return url;
|
|
56100
|
+
});
|
|
56101
|
+
}
|
|
56102
|
+
}else{
|
|
56103
|
+
const url = imgFieldDisplayValue && window.getImageFieldUrl(imgFieldDisplayValue.url);
|
|
56104
|
+
data[item] = url;
|
|
56105
|
+
}
|
|
56106
|
+
}
|
|
56107
|
+
})
|
|
56108
|
+
`
|
|
56109
|
+
}
|
|
56110
|
+
|
|
56003
56111
|
/******************************************************************************
|
|
56004
56112
|
Copyright (c) Microsoft Corporation.
|
|
56005
56113
|
|
|
@@ -56371,7 +56479,7 @@ async function getObjectFieldsFilterFormSchema(ctx) {
|
|
|
56371
56479
|
const formSchema = {
|
|
56372
56480
|
"type": "service",
|
|
56373
56481
|
"visibleOn": "this.filterFormSearchableFields && this.filterFormSearchableFields.length",
|
|
56374
|
-
"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-
|
|
56482
|
+
"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",
|
|
56375
56483
|
"style":{
|
|
56376
56484
|
"max-height":ctx.formFactor === 'SMALL'?"30vh":"unset"
|
|
56377
56485
|
},
|
|
@@ -56958,7 +57066,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
56958
57066
|
"className": "slds-filters"
|
|
56959
57067
|
},
|
|
56960
57068
|
"size": "xs",
|
|
56961
|
-
"className": `border-
|
|
57069
|
+
"className": `border-y slds-grid slds-grid_vertical slds-nowrap ${!ctx.isLookup && "mt-2"}`,
|
|
56962
57070
|
"visibleOn": "this.showFieldsFilter",
|
|
56963
57071
|
},
|
|
56964
57072
|
"className": "bg-white"
|
|
@@ -57004,6 +57112,7 @@ const getNewListviewButtonSchema = ()=>{
|
|
|
57004
57112
|
"objectApiName": "object_listviews",
|
|
57005
57113
|
"recordId": "",
|
|
57006
57114
|
"mode": "edit",
|
|
57115
|
+
"layout": "normal",
|
|
57007
57116
|
"defaultData": {
|
|
57008
57117
|
"&": "${list_view}",
|
|
57009
57118
|
"name":"",
|
|
@@ -57011,8 +57120,16 @@ const getNewListviewButtonSchema = ()=>{
|
|
|
57011
57120
|
"filters":"",
|
|
57012
57121
|
"shared":false,
|
|
57013
57122
|
"object_name": "${targetObjectName}",
|
|
57123
|
+
"_id":"",
|
|
57124
|
+
"shared_to": null,
|
|
57125
|
+
"shared_to_organizations": null,
|
|
57126
|
+
"locked": false,
|
|
57127
|
+
"owner": null,
|
|
57128
|
+
"company_id": null,
|
|
57129
|
+
"company_ids": null,
|
|
57130
|
+
"is_system": false
|
|
57014
57131
|
},
|
|
57015
|
-
"fieldsExtend": fieldsExtend$
|
|
57132
|
+
"fieldsExtend": fieldsExtend$5(),
|
|
57016
57133
|
"fields": fields$1(),
|
|
57017
57134
|
"onEvent": {
|
|
57018
57135
|
"submitSucc": {
|
|
@@ -57063,14 +57180,17 @@ function fields$1(){
|
|
|
57063
57180
|
"mobile_columns",
|
|
57064
57181
|
"searchable_fields",
|
|
57065
57182
|
"is_system",
|
|
57066
|
-
"shared"
|
|
57183
|
+
"shared",
|
|
57184
|
+
"shared_to",
|
|
57185
|
+
"shared_to_organizations"
|
|
57067
57186
|
]
|
|
57068
57187
|
}
|
|
57069
57188
|
|
|
57070
|
-
function fieldsExtend$
|
|
57189
|
+
function fieldsExtend$5(){
|
|
57071
57190
|
return {
|
|
57072
57191
|
"group": "",
|
|
57073
57192
|
"label": {
|
|
57193
|
+
"group": "",
|
|
57074
57194
|
"is_wide": true
|
|
57075
57195
|
},
|
|
57076
57196
|
"name": {
|
|
@@ -57152,9 +57272,19 @@ function fieldsExtend$4(){
|
|
|
57152
57272
|
"shared": {
|
|
57153
57273
|
"group": "",
|
|
57154
57274
|
"amis": {
|
|
57155
|
-
"visibleOn": "${
|
|
57275
|
+
"visibleOn": "${false}"
|
|
57276
|
+
}
|
|
57277
|
+
},
|
|
57278
|
+
"shared_to": {
|
|
57279
|
+
"group": "",
|
|
57280
|
+
"amis":{
|
|
57281
|
+
"type": "radios",
|
|
57282
|
+
"inline": false
|
|
57156
57283
|
}
|
|
57157
57284
|
},
|
|
57285
|
+
"shared_to_organizations": {
|
|
57286
|
+
"group": ""
|
|
57287
|
+
},
|
|
57158
57288
|
"filters": {
|
|
57159
57289
|
"group": "",
|
|
57160
57290
|
"amis": {
|
|
@@ -57192,14 +57322,23 @@ const getCopyListviewButtonSchema = ()=>{
|
|
|
57192
57322
|
"objectApiName": "object_listviews",
|
|
57193
57323
|
"recordId": "",
|
|
57194
57324
|
"mode": "edit",
|
|
57325
|
+
"layout": "normal",
|
|
57195
57326
|
"defaultData": {
|
|
57196
57327
|
"&": "${list_view}",
|
|
57197
57328
|
"name":"",
|
|
57198
57329
|
"label": instance.t('frontend_listview_control_clone_defaultData_label_start') + " ${list_view.label} " + instance.t('frontend_listview_control_clone_defaultData_label_end'),
|
|
57199
57330
|
"shared":false,
|
|
57200
57331
|
"object_name": "${targetObjectName}",
|
|
57332
|
+
"_id":"",
|
|
57333
|
+
"shared_to": null,
|
|
57334
|
+
"shared_to_organizations": null,
|
|
57335
|
+
"locked": false,
|
|
57336
|
+
"owner": null,
|
|
57337
|
+
"company_id": null,
|
|
57338
|
+
"company_ids": null,
|
|
57339
|
+
"is_system": false
|
|
57201
57340
|
},
|
|
57202
|
-
"fieldsExtend": fieldsExtend$
|
|
57341
|
+
"fieldsExtend": fieldsExtend$4(),
|
|
57203
57342
|
"fields": fields(),
|
|
57204
57343
|
"onEvent": {
|
|
57205
57344
|
"submitSucc": {
|
|
@@ -57247,13 +57386,16 @@ function fields(){
|
|
|
57247
57386
|
"mobile_columns.$.field",
|
|
57248
57387
|
"searchable_fields.$.field",
|
|
57249
57388
|
"is_system",
|
|
57250
|
-
"shared"
|
|
57389
|
+
"shared",
|
|
57390
|
+
"shared_to",
|
|
57391
|
+
"shared_to_organizations"
|
|
57251
57392
|
]
|
|
57252
57393
|
}
|
|
57253
57394
|
|
|
57254
|
-
function fieldsExtend$
|
|
57395
|
+
function fieldsExtend$4(){
|
|
57255
57396
|
return {
|
|
57256
57397
|
"label": {
|
|
57398
|
+
"group": "",
|
|
57257
57399
|
"is_wide": true
|
|
57258
57400
|
},
|
|
57259
57401
|
"name": {
|
|
@@ -57303,10 +57445,21 @@ function fieldsExtend$3(){
|
|
|
57303
57445
|
}
|
|
57304
57446
|
},
|
|
57305
57447
|
"shared": {
|
|
57448
|
+
"group": "",
|
|
57306
57449
|
"amis": {
|
|
57307
|
-
"visibleOn": "${
|
|
57450
|
+
"visibleOn": "${false}"
|
|
57451
|
+
}
|
|
57452
|
+
},
|
|
57453
|
+
"shared_to": {
|
|
57454
|
+
"group": "",
|
|
57455
|
+
"amis":{
|
|
57456
|
+
"type": "radios",
|
|
57457
|
+
"inline": false
|
|
57308
57458
|
}
|
|
57309
57459
|
},
|
|
57460
|
+
"shared_to_organizations": {
|
|
57461
|
+
"group": ""
|
|
57462
|
+
},
|
|
57310
57463
|
"filters": {
|
|
57311
57464
|
"group": "",
|
|
57312
57465
|
"amis": {
|
|
@@ -57316,6 +57469,12 @@ function fieldsExtend$3(){
|
|
|
57316
57469
|
}
|
|
57317
57470
|
}
|
|
57318
57471
|
|
|
57472
|
+
/*
|
|
57473
|
+
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
57474
|
+
* @Date: 2023-06-13 13:51:19
|
|
57475
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
57476
|
+
* @LastEditTime: 2024-02-05 11:25:09
|
|
57477
|
+
*/
|
|
57319
57478
|
const getRenameListviewButtonSchema = ()=>{
|
|
57320
57479
|
return {
|
|
57321
57480
|
"type": "button",
|
|
@@ -57341,6 +57500,7 @@ const getRenameListviewButtonSchema = ()=>{
|
|
|
57341
57500
|
"label": "对象表单",
|
|
57342
57501
|
"objectApiName": "object_listviews",
|
|
57343
57502
|
"recordId": "${recordId}",
|
|
57503
|
+
"layout": "normal",
|
|
57344
57504
|
"mode": "edit",
|
|
57345
57505
|
"fields": [
|
|
57346
57506
|
"label"
|
|
@@ -57375,6 +57535,12 @@ const getRenameListviewButtonSchema = ()=>{
|
|
|
57375
57535
|
}
|
|
57376
57536
|
};
|
|
57377
57537
|
|
|
57538
|
+
/*
|
|
57539
|
+
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
57540
|
+
* @Date: 2023-06-13 13:51:19
|
|
57541
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
57542
|
+
* @LastEditTime: 2024-02-06 15:38:49
|
|
57543
|
+
*/
|
|
57378
57544
|
const getSetListviewShareButtonSchema = ()=>{
|
|
57379
57545
|
return {
|
|
57380
57546
|
"type": "button",
|
|
@@ -57390,6 +57556,8 @@ const getSetListviewShareButtonSchema = ()=>{
|
|
|
57390
57556
|
"title": instance.t('frontend_listview_control_share'),
|
|
57391
57557
|
"data": {
|
|
57392
57558
|
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
57559
|
+
"appId": "${appId}",
|
|
57560
|
+
"global": "${global}",
|
|
57393
57561
|
"context": "${context}"
|
|
57394
57562
|
},
|
|
57395
57563
|
"body": [
|
|
@@ -57399,9 +57567,12 @@ const getSetListviewShareButtonSchema = ()=>{
|
|
|
57399
57567
|
"objectApiName": "object_listviews",
|
|
57400
57568
|
"recordId": "${recordId}",
|
|
57401
57569
|
"mode": "edit",
|
|
57570
|
+
"layout": "normal",
|
|
57402
57571
|
"fields": [
|
|
57403
|
-
"
|
|
57404
|
-
|
|
57572
|
+
"shared_to",
|
|
57573
|
+
"shared_to_organizations"
|
|
57574
|
+
],
|
|
57575
|
+
"fieldsExtend": fieldsExtend$3(),
|
|
57405
57576
|
}
|
|
57406
57577
|
],
|
|
57407
57578
|
"showCloseButton": true,
|
|
@@ -57419,6 +57590,21 @@ const getSetListviewShareButtonSchema = ()=>{
|
|
|
57419
57590
|
}
|
|
57420
57591
|
};
|
|
57421
57592
|
|
|
57593
|
+
function fieldsExtend$3(){
|
|
57594
|
+
return {
|
|
57595
|
+
"shared_to": {
|
|
57596
|
+
"group": "",
|
|
57597
|
+
"amis":{
|
|
57598
|
+
"type": "radios",
|
|
57599
|
+
"inline": false
|
|
57600
|
+
}
|
|
57601
|
+
},
|
|
57602
|
+
"shared_to_organizations": {
|
|
57603
|
+
"group": ""
|
|
57604
|
+
}
|
|
57605
|
+
}
|
|
57606
|
+
}
|
|
57607
|
+
|
|
57422
57608
|
const getSetListviewFiltersButtonSchema = ()=>{
|
|
57423
57609
|
return {
|
|
57424
57610
|
"type": "button",
|
|
@@ -57550,10 +57736,12 @@ function apiRequestAdaptor$2(){
|
|
|
57550
57736
|
function fieldsExtend$2(){
|
|
57551
57737
|
return {
|
|
57552
57738
|
"filters": {
|
|
57739
|
+
"label": "",
|
|
57740
|
+
"group": "",
|
|
57553
57741
|
"visible_on": "true",
|
|
57554
57742
|
"amis": {
|
|
57555
57743
|
"type": "condition-builder",
|
|
57556
|
-
"label":
|
|
57744
|
+
// "label": i18next.t('frontend_listview_control_filters_fields_extend'),
|
|
57557
57745
|
"source": {
|
|
57558
57746
|
"method": "get",
|
|
57559
57747
|
"url": "${context.rootUrl}/service/api/amis-metadata-listviews/getFilterFields?objectName=${targetObjectName}",
|
|
@@ -57596,6 +57784,7 @@ const getSetListviewColumnsButtonSchema = ()=>{
|
|
|
57596
57784
|
"objectApiName": "object_listviews",
|
|
57597
57785
|
"recordId": "${recordId}",
|
|
57598
57786
|
"mode": "edit",
|
|
57787
|
+
"layout": "normal",
|
|
57599
57788
|
"fieldsExtend": fieldsExtend$1(),
|
|
57600
57789
|
"initApiAdaptor": initApiAdaptor$1(),
|
|
57601
57790
|
"apiRequestAdaptor": apiRequestAdaptor$1(),
|
|
@@ -57792,6 +57981,8 @@ const getSetListviewSortButtonSchema = ()=>{
|
|
|
57792
57981
|
function fieldsExtend(){
|
|
57793
57982
|
return {
|
|
57794
57983
|
"sort": {
|
|
57984
|
+
"label": "",
|
|
57985
|
+
"group": "",
|
|
57795
57986
|
"amis": {
|
|
57796
57987
|
"type": "tabs-transfer",
|
|
57797
57988
|
"sortable": true,
|
|
@@ -57919,7 +58110,7 @@ const getSettingListviewToolbarButtonSchema = ()=>{
|
|
|
57919
58110
|
"icon": "fa fa-cog",
|
|
57920
58111
|
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
57921
58112
|
// "tooltip": i18next.t('frontend_button_listview_control_tooltip'),
|
|
57922
|
-
"btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded
|
|
58113
|
+
"btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded text-gray-500",
|
|
57923
58114
|
"align": "right",
|
|
57924
58115
|
"visibleOn": "${!isLookup}",
|
|
57925
58116
|
"buttons": [
|
|
@@ -57940,8 +58131,8 @@ const getSettingListviewToolbarButtonSchema = ()=>{
|
|
|
57940
58131
|
}
|
|
57941
58132
|
};
|
|
57942
58133
|
|
|
57943
|
-
const getDisplayAsButton = function(objectName,
|
|
57944
|
-
let displayAs = Router.getTabDisplayAs(objectName);
|
|
58134
|
+
const getDisplayAsButton = function(objectName, defaultEnableSplit){
|
|
58135
|
+
let displayAs = Router.getTabDisplayAs(objectName, defaultEnableSplit);
|
|
57945
58136
|
let buttons = [
|
|
57946
58137
|
{
|
|
57947
58138
|
"type": "button",
|
|
@@ -57964,7 +58155,7 @@ const getDisplayAsButton = function(objectName, showDisplayAs){
|
|
|
57964
58155
|
"icon": "fa fa-table-columns",
|
|
57965
58156
|
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
57966
58157
|
// "tooltip": `${i18next.t('frontend_display_as')} ${displayAsLabel}`,
|
|
57967
|
-
"btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded
|
|
58158
|
+
"btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded text-gray-500",
|
|
57968
58159
|
"align": "right",
|
|
57969
58160
|
"visibleOn": "${window:innerWidth > 768 && !!!isLookup}",
|
|
57970
58161
|
"buttons": [
|
|
@@ -58157,7 +58348,7 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
58157
58348
|
// //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
58158
58349
|
// // "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
58159
58350
|
// "tooltipPlacement": "top",
|
|
58160
|
-
// "className": "bg-white p-2 rounded
|
|
58351
|
+
// "className": "bg-white p-2 rounded text-gray-500",
|
|
58161
58352
|
// "label": "",
|
|
58162
58353
|
// "icon": "fa fa-sync",
|
|
58163
58354
|
// "visibleOn": "${!showFieldsFilter}",
|
|
@@ -58181,7 +58372,7 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
58181
58372
|
// "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
58182
58373
|
"tooltip":"",
|
|
58183
58374
|
"tooltipPlacement": "top",
|
|
58184
|
-
"className": "bg-white p-2 rounded
|
|
58375
|
+
"className": "bg-white p-2 rounded text-gray-500"
|
|
58185
58376
|
};
|
|
58186
58377
|
}
|
|
58187
58378
|
else {
|
|
@@ -58192,7 +58383,7 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
58192
58383
|
// "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
58193
58384
|
"tooltip":"",
|
|
58194
58385
|
"tooltipPlacement": "top",
|
|
58195
|
-
"className": "bg-white p-2 rounded
|
|
58386
|
+
"className": "bg-white p-2 rounded text-gray-500"
|
|
58196
58387
|
};
|
|
58197
58388
|
}
|
|
58198
58389
|
let toolbarFilter;
|
|
@@ -58214,7 +58405,7 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
58214
58405
|
"visibleOn": "${isFieldsFilterEmpty == false && isLookup != true}"
|
|
58215
58406
|
},
|
|
58216
58407
|
"align": "right",
|
|
58217
|
-
"className": "bg-white p-2 rounded
|
|
58408
|
+
"className": "bg-white p-2 rounded text-gray-500",
|
|
58218
58409
|
"onEvent": {
|
|
58219
58410
|
"click": {
|
|
58220
58411
|
"actions": [
|
|
@@ -58228,7 +58419,7 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
58228
58419
|
"id": "steedos_crud_toolbar_filter"
|
|
58229
58420
|
};
|
|
58230
58421
|
}
|
|
58231
|
-
let toolbarDisplayAsButton = getDisplayAsButton(mainObject?.name);
|
|
58422
|
+
let toolbarDisplayAsButton = getDisplayAsButton(mainObject?.name, mainObject?.enable_split);
|
|
58232
58423
|
let toolbarDQuickSearchBox = getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLookup, keywordsSearchBoxName });
|
|
58233
58424
|
|
|
58234
58425
|
// toolbars返回的数组元素不可以是空对象{},比如hiddenCount ? {} : {"type": "tpl",...},因为空对象最终还是会生成一个空的.antd-Crud-toolbar-item dom
|
|
@@ -58374,7 +58565,6 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58374
58565
|
"timeOut": 1000
|
|
58375
58566
|
}
|
|
58376
58567
|
});
|
|
58377
|
-
resizeWindow();
|
|
58378
58568
|
const scope = event.context.scoped;
|
|
58379
58569
|
// let filterFormValues = event.data;
|
|
58380
58570
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
@@ -58450,8 +58640,8 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58450
58640
|
/*
|
|
58451
58641
|
* @Author: baozhoutao@steedos.com
|
|
58452
58642
|
* @Date: 2022-07-05 15:55:39
|
|
58453
|
-
* @LastEditors:
|
|
58454
|
-
* @LastEditTime: 2024-
|
|
58643
|
+
* @LastEditors: liaodaxue
|
|
58644
|
+
* @LastEditTime: 2024-02-05 17:56:27
|
|
58455
58645
|
* @Description:
|
|
58456
58646
|
*/
|
|
58457
58647
|
|
|
@@ -59018,17 +59208,13 @@ function getReferenceToSync(field) {
|
|
|
59018
59208
|
|
|
59019
59209
|
function getLookupSapceUserTreeSchema(isMobile){
|
|
59020
59210
|
let apiAdaptor = `
|
|
59021
|
-
// console.log("===getLookupSapceUserTreeSchema===", JSON.stringify(payload));
|
|
59022
59211
|
const records = payload.data.options;
|
|
59023
|
-
let isTreeOptionsComputed = false;
|
|
59024
|
-
if(records.length === 1 && records[0].children){
|
|
59025
|
-
isTreeOptionsComputed = true;
|
|
59026
|
-
}
|
|
59027
|
-
if(isTreeOptionsComputed){
|
|
59028
|
-
return payload;
|
|
59029
|
-
}
|
|
59030
59212
|
const treeRecords = [];
|
|
59031
|
-
const getChildren = (records, childrenIds) => {
|
|
59213
|
+
const getChildren = (currentRecord, records, childrenIds) => {
|
|
59214
|
+
if (currentRecord.children && typeof currentRecord.children[0] === "object") {
|
|
59215
|
+
// 考虑api配置了cache缓存的话,不会请求接口但是会重新进这个接收适配器脚本且payload.data.options返回的会是上一次计算结果,这里直接返回计算过的children
|
|
59216
|
+
return currentRecord.children;
|
|
59217
|
+
}
|
|
59032
59218
|
if (!childrenIds) {
|
|
59033
59219
|
return;
|
|
59034
59220
|
}
|
|
@@ -59037,7 +59223,7 @@ function getLookupSapceUserTreeSchema(isMobile){
|
|
|
59037
59223
|
});
|
|
59038
59224
|
_.each(children, (item) => {
|
|
59039
59225
|
if (item.children) {
|
|
59040
|
-
item.children = getChildren(records, item.children)
|
|
59226
|
+
item.children = getChildren(item, records, item.children)
|
|
59041
59227
|
}else{
|
|
59042
59228
|
item.children = [];
|
|
59043
59229
|
}
|
|
@@ -59063,7 +59249,7 @@ function getLookupSapceUserTreeSchema(isMobile){
|
|
|
59063
59249
|
|
|
59064
59250
|
_.each(records, (record) => {
|
|
59065
59251
|
if (record.noParent == 1) {
|
|
59066
|
-
treeRecords.push(Object.assign({}, record, { children: getChildren(records, record.children) }));
|
|
59252
|
+
treeRecords.push(Object.assign({}, record, { children: getChildren(record, records, record.children) }));
|
|
59067
59253
|
}
|
|
59068
59254
|
});
|
|
59069
59255
|
console.log(treeRecords)
|
|
@@ -59113,6 +59299,7 @@ function getLookupSapceUserTreeSchema(isMobile){
|
|
|
59113
59299
|
}
|
|
59114
59300
|
},
|
|
59115
59301
|
"label": "",
|
|
59302
|
+
"mode": "normal",
|
|
59116
59303
|
"name": "organizations",
|
|
59117
59304
|
"multiple": false,
|
|
59118
59305
|
"joinValues": false,
|
|
@@ -59255,6 +59442,9 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59255
59442
|
}
|
|
59256
59443
|
});
|
|
59257
59444
|
|
|
59445
|
+
let listviewFilter = getListViewFilter(listView);
|
|
59446
|
+
let listviewFiltersFunction = listView && listView._filters;
|
|
59447
|
+
|
|
59258
59448
|
let sort = "";
|
|
59259
59449
|
if(listView){
|
|
59260
59450
|
sort = getListViewSort(listView);
|
|
@@ -59301,7 +59491,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59301
59491
|
Object.assign(api.data.$self, __changedSearchBoxValues, __changedFilterFormValues);
|
|
59302
59492
|
}
|
|
59303
59493
|
const selfData = JSON.parse(JSON.stringify(api.data.$self));
|
|
59304
|
-
var filters = [];
|
|
59494
|
+
${listviewFilter && !ctx.inFilterForm ? `var filters = ${JSON.stringify(listviewFilter)};` : 'var filters = [];'}
|
|
59305
59495
|
var pageSize = api.data.pageSize || 10;
|
|
59306
59496
|
var pageNo = api.data.pageNo || 1;
|
|
59307
59497
|
var skip = (pageNo - 1) * pageSize;
|
|
@@ -59363,6 +59553,16 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59363
59553
|
}
|
|
59364
59554
|
|
|
59365
59555
|
const inFilterForm = ${ctx.inFilterForm};
|
|
59556
|
+
|
|
59557
|
+
const listviewFiltersFunction = ${listviewFiltersFunction};
|
|
59558
|
+
|
|
59559
|
+
if(listviewFiltersFunction && !inFilterForm){
|
|
59560
|
+
const _filters0 = listviewFiltersFunction(filters, api.data.$self.__super);
|
|
59561
|
+
if(_filters0 && _filters0.length){
|
|
59562
|
+
filters.push(_filters0);
|
|
59563
|
+
}
|
|
59564
|
+
}
|
|
59565
|
+
|
|
59366
59566
|
const filtersFunction = ${field.filtersFunction || field._filtersFunction};
|
|
59367
59567
|
|
|
59368
59568
|
if(filtersFunction && !inFilterForm){
|
|
@@ -59450,6 +59650,16 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59450
59650
|
});
|
|
59451
59651
|
payload.data.rows = treeRecords;
|
|
59452
59652
|
}
|
|
59653
|
+
const result = payload.data.rows;
|
|
59654
|
+
if(result && result.length){
|
|
59655
|
+
const updatedResult = _.map(result, (element) => {
|
|
59656
|
+
const data = { ...element };
|
|
59657
|
+
// image字段值添加URL前缀
|
|
59658
|
+
${getScriptForAddUrlPrefixForImgFields(lodash.exports.values(refObjectConfig.fields))}
|
|
59659
|
+
return data;
|
|
59660
|
+
});
|
|
59661
|
+
payload.data.rows = updatedResult;
|
|
59662
|
+
}
|
|
59453
59663
|
return payload;
|
|
59454
59664
|
`;
|
|
59455
59665
|
if(field.optionsFunction || field._optionsFunction){
|
|
@@ -59481,13 +59691,15 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59481
59691
|
|
|
59482
59692
|
pickerSchema.affixHeader = false;
|
|
59483
59693
|
|
|
59484
|
-
|
|
59694
|
+
|
|
59695
|
+
|
|
59696
|
+
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, fieldsArr, ctx.formFactor, { isLookup: true, keywordsSearchBoxName });
|
|
59697
|
+
|
|
59485
59698
|
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user"){
|
|
59486
|
-
|
|
59699
|
+
pickerSchema.headerToolbar.push(getLookupSapceUserTreeSchema(isMobile));
|
|
59487
59700
|
pickerSchema.className = pickerSchema.className || "" + " steedos-select-user";
|
|
59488
59701
|
}
|
|
59489
|
-
|
|
59490
|
-
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, fieldsArr, ctx.formFactor, { headerToolbarItems, isLookup: true, keywordsSearchBoxName });
|
|
59702
|
+
|
|
59491
59703
|
const isAllowCreate = refObjectConfig.permissions.allowCreate;
|
|
59492
59704
|
const isCreate = lodash.exports.isBoolean(field.create) ? field.create : true;
|
|
59493
59705
|
// lookup字段配置过滤条件就强制不显示新建按钮
|
|
@@ -59600,8 +59812,19 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59600
59812
|
pickerSchema.footerToolbar = ["pagination"];
|
|
59601
59813
|
}
|
|
59602
59814
|
|
|
59815
|
+
if(field.inlineHelpText){
|
|
59816
|
+
pickerSchema.toolbarClassName = "hasHelpText";
|
|
59817
|
+
pickerSchema.headerToolbar = [{
|
|
59818
|
+
"type": "tpl",
|
|
59819
|
+
"tpl": field.inlineHelpText,
|
|
59820
|
+
"className": "text-secondary"
|
|
59821
|
+
}, ...pickerSchema.headerToolbar];
|
|
59822
|
+
}
|
|
59823
|
+
pickerSchema.className = (pickerSchema.className || "") + " steedos-lookup-crud";
|
|
59824
|
+
|
|
59603
59825
|
const data = {
|
|
59604
59826
|
type: getAmisStaticFieldType('picker', readonly),
|
|
59827
|
+
className: ctx.className || '',
|
|
59605
59828
|
modalTitle: instance.t('frontend_form_please_select') + " " + refObjectConfig.label,
|
|
59606
59829
|
labelField: referenceTo.labelField.name,
|
|
59607
59830
|
valueField: referenceTo.valueField.name,
|
|
@@ -59675,6 +59898,9 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
59675
59898
|
const refObjectConfig = referenceTo && await getUISchema(referenceTo.objectName);
|
|
59676
59899
|
let listView = getLookupListView(refObjectConfig);
|
|
59677
59900
|
|
|
59901
|
+
let listviewFilter = getListViewFilter(listView);
|
|
59902
|
+
let listviewFiltersFunction = listView && listView._filters;
|
|
59903
|
+
|
|
59678
59904
|
let sort = "";
|
|
59679
59905
|
if(listView){
|
|
59680
59906
|
sort = getListViewSort(listView);
|
|
@@ -59704,7 +59930,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
59704
59930
|
apiInfo.data['rfield'] = `\${object_name}`;
|
|
59705
59931
|
// [["_id", "=", "$${field.name}._id"],"or",["name", "contains", "$term"]]
|
|
59706
59932
|
apiInfo.requestAdaptor = `
|
|
59707
|
-
var filters = [];
|
|
59933
|
+
${listviewFilter && !ctx.inFilterForm ? `var filters = ${JSON.stringify(listviewFilter)};` : 'var filters = [];'}
|
|
59708
59934
|
var top = 200;
|
|
59709
59935
|
if(api.data.$term){
|
|
59710
59936
|
filters = [["${referenceTo?.NAME_FIELD_KEY || 'name'}", "contains", api.data.$term]];
|
|
@@ -59727,6 +59953,16 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
59727
59953
|
}
|
|
59728
59954
|
|
|
59729
59955
|
const inFilterForm = ${ctx.inFilterForm};
|
|
59956
|
+
|
|
59957
|
+
const listviewFiltersFunction = ${listviewFiltersFunction};
|
|
59958
|
+
|
|
59959
|
+
if(listviewFiltersFunction && !inFilterForm){
|
|
59960
|
+
const _filters0 = listviewFiltersFunction(filters, api.data.$);
|
|
59961
|
+
if(_filters0 && _filters0.length){
|
|
59962
|
+
filters.push(_filters0);
|
|
59963
|
+
}
|
|
59964
|
+
}
|
|
59965
|
+
|
|
59730
59966
|
const filtersFunction = ${field.filtersFunction || field._filtersFunction};
|
|
59731
59967
|
|
|
59732
59968
|
if(filtersFunction && !inFilterForm){
|
|
@@ -59803,6 +60039,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
59803
60039
|
// 但是同时配置autoComplete和source会多请求一次接口
|
|
59804
60040
|
// TODO:应该想办法把是否字段在子表组件内,即ctx.isInputTable,如果不在子表组件内不需要加source
|
|
59805
60041
|
data.source = apiInfo;
|
|
60042
|
+
delete data.autoComplete;
|
|
59806
60043
|
}
|
|
59807
60044
|
//删除xlink:href中的rootUrl前缀,解决客户端svg为空的问题
|
|
59808
60045
|
const select_menuTpl = `<span class='flex items-center mt-0.5'>
|
|
@@ -59849,7 +60086,8 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
59849
60086
|
}
|
|
59850
60087
|
// console.log(`lookupToAmis====`, field, readonly, ctx)
|
|
59851
60088
|
if(readonly){
|
|
59852
|
-
if(field.reference_to){
|
|
60089
|
+
if(field.reference_to && !field.isTableField){
|
|
60090
|
+
//isTableField只在grid字段内存在
|
|
59853
60091
|
return {
|
|
59854
60092
|
type: 'steedos-field',
|
|
59855
60093
|
config: field,
|
|
@@ -60060,8 +60298,8 @@ if(typeof window != 'undefined'){
|
|
|
60060
60298
|
/*
|
|
60061
60299
|
* @Author: baozhoutao@steedos.com
|
|
60062
60300
|
* @Date: 2023-01-13 17:27:54
|
|
60063
|
-
* @LastEditors:
|
|
60064
|
-
* @LastEditTime:
|
|
60301
|
+
* @LastEditors: liaodaxue
|
|
60302
|
+
* @LastEditTime: 2024-02-04 17:29:54
|
|
60065
60303
|
* @Description:
|
|
60066
60304
|
*/
|
|
60067
60305
|
|
|
@@ -60162,7 +60400,8 @@ const getHtmlFieldSchema = (field, readonly, ctx)=>{
|
|
|
60162
60400
|
"title": "Insert",
|
|
60163
60401
|
"items": "image link media addcomment pageembed codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents | insertdatetime"
|
|
60164
60402
|
}
|
|
60165
|
-
}
|
|
60403
|
+
},
|
|
60404
|
+
"statusbar": false
|
|
60166
60405
|
},
|
|
60167
60406
|
"name": field.name
|
|
60168
60407
|
}
|
|
@@ -60400,13 +60639,31 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
60400
60639
|
};
|
|
60401
60640
|
break;
|
|
60402
60641
|
case 'input-datetime-range':
|
|
60642
|
+
// convertData = {
|
|
60643
|
+
// type: "input-datetime-range",
|
|
60644
|
+
// inputFormat: 'YYYY-MM-DD HH:mm',
|
|
60645
|
+
// format:'YYYY-MM-DDTHH:mm:ss.SSSZ',
|
|
60646
|
+
// tpl: readonly ? Tpl.getDateTimeTpl(field) : null,
|
|
60647
|
+
// utc: true,
|
|
60648
|
+
// joinValues: false
|
|
60649
|
+
// }
|
|
60650
|
+
// 日期时间字段,按日期方式展现显示控件,用户不用关心小时分钟
|
|
60403
60651
|
convertData = {
|
|
60404
|
-
type: "input-
|
|
60405
|
-
inputFormat:
|
|
60652
|
+
type: "input-date-range",
|
|
60653
|
+
inputFormat: "YYYY-MM-DD HH:mm",
|
|
60406
60654
|
format:'YYYY-MM-DDTHH:mm:ss.SSSZ',
|
|
60407
60655
|
tpl: readonly ? getDateTimeTpl(field) : null,
|
|
60408
60656
|
utc: true,
|
|
60409
|
-
joinValues: false
|
|
60657
|
+
joinValues: false,
|
|
60658
|
+
"shortcuts": [
|
|
60659
|
+
"thismonth",
|
|
60660
|
+
"2monthsago",
|
|
60661
|
+
"3monthslater",
|
|
60662
|
+
"prevquarter",
|
|
60663
|
+
"thisquarter",
|
|
60664
|
+
"thisyear",
|
|
60665
|
+
"lastYear"
|
|
60666
|
+
]
|
|
60410
60667
|
};
|
|
60411
60668
|
break;
|
|
60412
60669
|
case 'datetime':
|
|
@@ -60457,7 +60714,7 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
60457
60714
|
convertData = {
|
|
60458
60715
|
type: getAmisStaticFieldType('datetime', readonly),
|
|
60459
60716
|
inputFormat: 'YYYY-MM-DD HH:mm',
|
|
60460
|
-
format: 'YYYY-MM-DDTHH:mm:
|
|
60717
|
+
format: 'YYYY-MM-DDTHH:mm:00.000Z',
|
|
60461
60718
|
tpl: readonly ? getDateTimeTpl(field) : null,
|
|
60462
60719
|
utc: true,
|
|
60463
60720
|
};
|
|
@@ -60588,6 +60845,36 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
60588
60845
|
convertData = {
|
|
60589
60846
|
type: 'static-text'
|
|
60590
60847
|
};
|
|
60848
|
+
}else if(field.autonumber_enable_modify){
|
|
60849
|
+
convertData = {
|
|
60850
|
+
"type": "input-group",
|
|
60851
|
+
"body": [
|
|
60852
|
+
{
|
|
60853
|
+
"type": "input-text",
|
|
60854
|
+
"name": field.name
|
|
60855
|
+
},
|
|
60856
|
+
{
|
|
60857
|
+
"type": "button",
|
|
60858
|
+
"label": "自动获取",
|
|
60859
|
+
"actionType": "ajax",
|
|
60860
|
+
"api": {
|
|
60861
|
+
"url": `\${context.rootUrl}/api/autonumber/generator/\${objectName}/${field.name}`,
|
|
60862
|
+
"method": "post",
|
|
60863
|
+
"headers": {
|
|
60864
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
60865
|
+
},
|
|
60866
|
+
"adaptor": `
|
|
60867
|
+
payload.data["${field.name}"] = payload.data && payload.data.autonumber;
|
|
60868
|
+
delete payload.data.autonumber;
|
|
60869
|
+
return payload;
|
|
60870
|
+
`
|
|
60871
|
+
},
|
|
60872
|
+
"messages": {
|
|
60873
|
+
"success": "获取成功"
|
|
60874
|
+
}
|
|
60875
|
+
}
|
|
60876
|
+
]
|
|
60877
|
+
};
|
|
60591
60878
|
}
|
|
60592
60879
|
break;
|
|
60593
60880
|
case 'url':
|
|
@@ -60793,12 +61080,13 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
60793
61080
|
break;
|
|
60794
61081
|
}
|
|
60795
61082
|
if(!lodash.exports.isEmpty(convertData)){
|
|
61083
|
+
const className = convertData.className;
|
|
60796
61084
|
if(field.is_wide || convertData.type === 'group'){
|
|
60797
|
-
convertData.className = 'col-span-2 m-0';
|
|
61085
|
+
convertData.className = className ? 'col-span-2 m-0 ' + className : 'col-span-2 m-0';
|
|
60798
61086
|
}else {
|
|
60799
|
-
convertData.className = 'm-0';
|
|
61087
|
+
convertData.className = className ? 'm-0 ' + className : 'm-0';
|
|
60800
61088
|
}
|
|
60801
|
-
if(readonly){
|
|
61089
|
+
if(readonly && ctx.mode !== 'edit'){
|
|
60802
61090
|
convertData.className = `${convertData.className} border-b`;
|
|
60803
61091
|
}
|
|
60804
61092
|
if(readonly){
|
|
@@ -60806,11 +61094,7 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
60806
61094
|
}
|
|
60807
61095
|
|
|
60808
61096
|
let fieldTypeClassName = ' steedos-' + convertData.type + (readonly ? '-readonly' : '-edit');
|
|
60809
|
-
|
|
60810
|
-
convertData.className = convertData.className + fieldTypeClassName;
|
|
60811
|
-
} else {
|
|
60812
|
-
convertData.className = fieldTypeClassName;
|
|
60813
|
-
}
|
|
61097
|
+
convertData.className = convertData.className + fieldTypeClassName;
|
|
60814
61098
|
|
|
60815
61099
|
if(field.visible_on && !ctx.inFilterForm){
|
|
60816
61100
|
// convertData.visibleOn = `\$${field.visible_on.substring(1, field.visible_on.length -1).replace(/formData./g, '')}`;
|
|
@@ -60893,8 +61177,9 @@ async function getFieldSearchable(perField, permissionFields, ctx){
|
|
|
60893
61177
|
fieldNamePrefix = `${fieldNamePrefix}between__`;
|
|
60894
61178
|
}
|
|
60895
61179
|
if(_field.type === 'datetime'){
|
|
60896
|
-
//
|
|
60897
|
-
|
|
61180
|
+
// 这里如果想把搜索范围展示效果改为日期范围,不可以直接改为input-date-range,因为它们规则不一样,包括时区规则和小时分秒的存值规则都不一样
|
|
61181
|
+
// 所以想改为展示日期范围效果,只能改input-datetime-range类型本身的属性来实现
|
|
61182
|
+
_field.type = 'input-datetime-range';
|
|
60898
61183
|
_field.is_wide = true;
|
|
60899
61184
|
fieldNamePrefix = `${fieldNamePrefix}between__`;
|
|
60900
61185
|
}
|