@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.cjs.js
CHANGED
|
@@ -53932,14 +53932,13 @@ function getRootUrl(defaultRootUrl){
|
|
|
53932
53932
|
/*
|
|
53933
53933
|
* @Author: baozhoutao@steedos.com
|
|
53934
53934
|
* @Date: 2022-08-16 17:02:08
|
|
53935
|
-
* @LastEditors:
|
|
53936
|
-
* @LastEditTime:
|
|
53935
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
53936
|
+
* @LastEditTime: 2024-02-02 10:15:00
|
|
53937
53937
|
* @Description:
|
|
53938
53938
|
*/
|
|
53939
53939
|
|
|
53940
53940
|
const Router = {
|
|
53941
|
-
getTabDisplayAs(tab_id){
|
|
53942
|
-
const uiSchema = getUISchemaSync$1(tab_id, false);
|
|
53941
|
+
getTabDisplayAs(tab_id, defaultEnableSplit){
|
|
53943
53942
|
var urlSearch = new URLSearchParams(document.location.search);
|
|
53944
53943
|
if(urlSearch.has('display')){
|
|
53945
53944
|
return urlSearch.get('display')
|
|
@@ -53948,9 +53947,12 @@ const Router = {
|
|
|
53948
53947
|
// const key = `page_display`;
|
|
53949
53948
|
const value = sessionStorage.getItem(key);
|
|
53950
53949
|
let defaultDisplay = "grid";
|
|
53951
|
-
if(
|
|
53950
|
+
if(defaultEnableSplit === true){
|
|
53952
53951
|
defaultDisplay = "split";
|
|
53953
53952
|
}
|
|
53953
|
+
if(window.innerWidth <= 768){
|
|
53954
|
+
return "grid";
|
|
53955
|
+
}
|
|
53954
53956
|
return value ? value : defaultDisplay;
|
|
53955
53957
|
},
|
|
53956
53958
|
|
|
@@ -53983,8 +53985,8 @@ const Router = {
|
|
|
53983
53985
|
/*
|
|
53984
53986
|
* @Author: baozhoutao@steedos.com
|
|
53985
53987
|
* @Date: 2022-07-20 16:29:22
|
|
53986
|
-
* @LastEditors:
|
|
53987
|
-
* @LastEditTime:
|
|
53988
|
+
* @LastEditors: liaodaxue
|
|
53989
|
+
* @LastEditTime: 2024-01-25 14:44:17
|
|
53988
53990
|
* @Description:
|
|
53989
53991
|
*/
|
|
53990
53992
|
|
|
@@ -54056,6 +54058,25 @@ function getComparableAmisVersion() {
|
|
|
54056
54058
|
}
|
|
54057
54059
|
}
|
|
54058
54060
|
|
|
54061
|
+
/**
|
|
54062
|
+
* 判断浏览器类型
|
|
54063
|
+
* @returns 按需返回浏览器类型;
|
|
54064
|
+
*/
|
|
54065
|
+
function getBowserType() {
|
|
54066
|
+
const userAgent = navigator.userAgent;
|
|
54067
|
+
if (userAgent.indexOf("Chrome")!== -1 && userAgent.indexOf("Safari") !== -1 && userAgent.indexOf("Edg") === -1) {
|
|
54068
|
+
return "Chrome";
|
|
54069
|
+
} else if (userAgent.indexOf("Firefox") !== -1) {
|
|
54070
|
+
return "Firefox";
|
|
54071
|
+
} else if (userAgent.indexOf("Safari") !== -1 && userAgent.indexOf("Chrome") === -1 && userAgent.indexOf("Edge") === -1) {
|
|
54072
|
+
return "Safari";
|
|
54073
|
+
} else if (userAgent.indexOf("Edg") !== -1) {
|
|
54074
|
+
return "Edge";
|
|
54075
|
+
} else {
|
|
54076
|
+
return "Unknown browser"; // 其他浏览器...(可根据自己需要确定是否新增其他浏览器的判断)
|
|
54077
|
+
}
|
|
54078
|
+
}
|
|
54079
|
+
|
|
54059
54080
|
function getNumberTpl(field){
|
|
54060
54081
|
return `<span>\${_display.${field.name}}</span>`
|
|
54061
54082
|
}
|
|
@@ -54096,7 +54117,7 @@ function getSelectMap(selectOptions){
|
|
|
54096
54117
|
lodash.exports.forEach(selectOptions,(option)=>{
|
|
54097
54118
|
const optionValue = option.value + '';
|
|
54098
54119
|
const optionColor = option.color + '';
|
|
54099
|
-
if(optionColor){
|
|
54120
|
+
if(optionColor && optionColor != "undefined"){
|
|
54100
54121
|
const background = optionColor.charAt(0) === '#' ? optionColor : '#'+optionColor;
|
|
54101
54122
|
const color = getContrastColor(background);
|
|
54102
54123
|
const optionColorStyle = 'background:'+background+';color:'+color+';line-height:1.5rem';
|
|
@@ -54480,7 +54501,31 @@ const getAmisFileReadonlySchema = (steedosField)=>{
|
|
|
54480
54501
|
}
|
|
54481
54502
|
}
|
|
54482
54503
|
if(type === 'file'){
|
|
54483
|
-
return {
|
|
54504
|
+
return window.Meteor?.isCordova ? {
|
|
54505
|
+
"type": "control",
|
|
54506
|
+
"body": {
|
|
54507
|
+
"type": "each",
|
|
54508
|
+
"name": "_display." + steedosField.name,
|
|
54509
|
+
"items": {
|
|
54510
|
+
"type": "tpl",
|
|
54511
|
+
"tpl": "${name}",
|
|
54512
|
+
"className": "antd-Button--link inline-block",
|
|
54513
|
+
"onEvent": {
|
|
54514
|
+
"click": {
|
|
54515
|
+
"actions": [
|
|
54516
|
+
{
|
|
54517
|
+
"script": `
|
|
54518
|
+
Steedos.cordovaDownload(encodeURI(event.data.url), event.data.name);
|
|
54519
|
+
`,
|
|
54520
|
+
"actionType": "custom"
|
|
54521
|
+
}
|
|
54522
|
+
],
|
|
54523
|
+
"weight": 0
|
|
54524
|
+
}
|
|
54525
|
+
}
|
|
54526
|
+
}
|
|
54527
|
+
}
|
|
54528
|
+
} : {
|
|
54484
54529
|
type: amisFieldType,
|
|
54485
54530
|
tpl: `
|
|
54486
54531
|
<% let fileData = data._display.${steedosField.name}; if (fileData) { %>
|
|
@@ -54624,6 +54669,7 @@ var frontend_notifications$1 = "Notifications";
|
|
|
54624
54669
|
var frontend_notifications_allread$1 = "Mark all as read";
|
|
54625
54670
|
var frontend_notifications_allread_message$1 = "All marked as read";
|
|
54626
54671
|
var frontend_profile$1 = "Profile";
|
|
54672
|
+
var switch_space$1 = "Switch Space";
|
|
54627
54673
|
var frontend_about$1 = "About";
|
|
54628
54674
|
var frontend_log_out$1 = "Log out";
|
|
54629
54675
|
var frontend_listview_warning_start$1 = "The current ";
|
|
@@ -54711,6 +54757,7 @@ var en_us = {
|
|
|
54711
54757
|
frontend_notifications_allread: frontend_notifications_allread$1,
|
|
54712
54758
|
frontend_notifications_allread_message: frontend_notifications_allread_message$1,
|
|
54713
54759
|
frontend_profile: frontend_profile$1,
|
|
54760
|
+
switch_space: switch_space$1,
|
|
54714
54761
|
frontend_about: frontend_about$1,
|
|
54715
54762
|
frontend_log_out: frontend_log_out$1,
|
|
54716
54763
|
frontend_listview_warning_start: frontend_listview_warning_start$1,
|
|
@@ -54766,7 +54813,7 @@ var frontend_listview_control_delete_label = "删除";
|
|
|
54766
54813
|
var frontend_listview_control_delete_confirm_text = "如果您删除此列表视图,该视图将为所有具备访问权限的用户永久删除。是否确定要删除?";
|
|
54767
54814
|
var frontend_listview_control_delete_message_success = "删除成功";
|
|
54768
54815
|
var frontend_listview_control_filters = "过滤设置";
|
|
54769
|
-
var frontend_listview_control_filters_fields_extend = "条件组件
|
|
54816
|
+
var frontend_listview_control_filters_fields_extend = "条件组件";
|
|
54770
54817
|
var frontend_listview_control_new_label = "新建";
|
|
54771
54818
|
var frontend_listview_control_new_title = "新建 列表视图";
|
|
54772
54819
|
var frontend_listview_control_new_message_success = "成功";
|
|
@@ -54800,6 +54847,7 @@ var frontend_notifications = "通知";
|
|
|
54800
54847
|
var frontend_notifications_allread = "全部标记为已读";
|
|
54801
54848
|
var frontend_notifications_allread_message = "已全部标记为已读";
|
|
54802
54849
|
var frontend_profile = "个人资料";
|
|
54850
|
+
var switch_space = "切换工作区";
|
|
54803
54851
|
var frontend_about = "关于";
|
|
54804
54852
|
var frontend_log_out = "注销";
|
|
54805
54853
|
var frontend_listview_warning_start = "当前";
|
|
@@ -54888,6 +54936,7 @@ var zh_cn = {
|
|
|
54888
54936
|
frontend_notifications_allread: frontend_notifications_allread,
|
|
54889
54937
|
frontend_notifications_allread_message: frontend_notifications_allread_message,
|
|
54890
54938
|
frontend_profile: frontend_profile,
|
|
54939
|
+
switch_space: switch_space,
|
|
54891
54940
|
frontend_about: frontend_about,
|
|
54892
54941
|
frontend_log_out: frontend_log_out,
|
|
54893
54942
|
frontend_listview_warning_start: frontend_listview_warning_start,
|
|
@@ -54942,7 +54991,7 @@ async function getQuickEditSchema(field, options){
|
|
|
54942
54991
|
isAmisVersionforBatchEdit = window.Amis.version[0] >= 3 && window.Amis.version[2] >= 2;
|
|
54943
54992
|
}
|
|
54944
54993
|
const quickEditId = options.objectName + "_" + field.name + "_quickEdit";//定义快速编辑的表单id,用于setvalue传值
|
|
54945
|
-
var quickEditSchema = { body: [], id: quickEditId };
|
|
54994
|
+
var quickEditSchema = { body: [], id: quickEditId, className: "steedos-table-quickEdit" };
|
|
54946
54995
|
//select,avatar,image,file等组件无法行记录字段赋值,暂不支持批量编辑;
|
|
54947
54996
|
if(field.type != 'avatar' && field.type != 'image' && field.type != 'file' && isAmisVersionforBatchEdit){
|
|
54948
54997
|
const submitEvent = {
|
|
@@ -55201,7 +55250,8 @@ async function getQuickEditSchema(field, options){
|
|
|
55201
55250
|
"failed": "失败了呢。。"
|
|
55202
55251
|
}
|
|
55203
55252
|
}
|
|
55204
|
-
}
|
|
55253
|
+
},
|
|
55254
|
+
"expression": "${!recordPermissions.modifyAllRecords}"
|
|
55205
55255
|
},
|
|
55206
55256
|
{
|
|
55207
55257
|
"actionType": "setValue",
|
|
@@ -55217,7 +55267,7 @@ async function getQuickEditSchema(field, options){
|
|
|
55217
55267
|
"componentId": quickEditId,
|
|
55218
55268
|
"args": {
|
|
55219
55269
|
"value":{
|
|
55220
|
-
"quickedit_record_permissions": "${event.data}"
|
|
55270
|
+
"quickedit_record_permissions": "${recordPermissions.modifyAllRecords ? {'allowEdit': true} : event.data}"
|
|
55221
55271
|
}
|
|
55222
55272
|
}
|
|
55223
55273
|
}
|
|
@@ -55281,7 +55331,7 @@ async function getQuickEditSchema(field, options){
|
|
|
55281
55331
|
`
|
|
55282
55332
|
}
|
|
55283
55333
|
},
|
|
55284
|
-
"expression":"${event.data.value}"
|
|
55334
|
+
"expression":"${event.data.value && !recordPermissions.modifyAllRecords}"
|
|
55285
55335
|
},
|
|
55286
55336
|
{
|
|
55287
55337
|
"actionType": "setValue",
|
|
@@ -55312,10 +55362,20 @@ async function getQuickEditSchema(field, options){
|
|
|
55312
55362
|
"script": `
|
|
55313
55363
|
const noPermission = event.data.noPermission;
|
|
55314
55364
|
const crudComponent = event.context.scoped.getComponentById("${options.crudId}");
|
|
55315
|
-
|
|
55365
|
+
let selectedItems = crudComponent && crudComponent.props.store.selectedItems.concat();
|
|
55316
55366
|
noPermission.forEach(function (item) {
|
|
55317
55367
|
crudComponent && crudComponent.unSelectItem(_.find(selectedItems,{_id:item}));
|
|
55368
|
+
_.remove(selectedItems, (selected) => selected._id === item);
|
|
55318
55369
|
})
|
|
55370
|
+
doAction({
|
|
55371
|
+
"componentId": "${quickEditId}",
|
|
55372
|
+
"actionType": "setValue",
|
|
55373
|
+
"args": {
|
|
55374
|
+
"value": {
|
|
55375
|
+
selectedItems
|
|
55376
|
+
}
|
|
55377
|
+
}
|
|
55378
|
+
});
|
|
55319
55379
|
`
|
|
55320
55380
|
},
|
|
55321
55381
|
{
|
|
@@ -55376,7 +55436,7 @@ async function getQuickEditSchema(field, options){
|
|
|
55376
55436
|
}
|
|
55377
55437
|
|
|
55378
55438
|
function getFieldWidth(width){
|
|
55379
|
-
const defaultWidth =
|
|
55439
|
+
const defaultWidth = null;
|
|
55380
55440
|
if(typeof width == 'string'){
|
|
55381
55441
|
if(isNaN(width)){
|
|
55382
55442
|
return width || defaultWidth;
|
|
@@ -55406,22 +55466,35 @@ async function getTableColumns(fields, options){
|
|
|
55406
55466
|
//增加quickEdit属性,实现快速编辑
|
|
55407
55467
|
const quickEditSchema = allowEdit ? await getQuickEditSchema(field, options) : allowEdit;
|
|
55408
55468
|
let className = "";
|
|
55409
|
-
|
|
55410
|
-
|
|
55411
|
-
|
|
55412
|
-
|
|
55469
|
+
const bowserType = getBowserType();
|
|
55470
|
+
if(bowserType === "Safari"){
|
|
55471
|
+
className += " whitespace-nowrap ";
|
|
55472
|
+
}else {
|
|
55473
|
+
if(field.wrap != true){
|
|
55413
55474
|
className += " whitespace-nowrap ";
|
|
55475
|
+
}else {
|
|
55476
|
+
className += " break-words ";
|
|
55414
55477
|
}
|
|
55415
|
-
}else {
|
|
55416
|
-
className += " break-words ";
|
|
55417
55478
|
}
|
|
55479
|
+
|
|
55480
|
+
if (typeof field.amis?.className == "object") {
|
|
55481
|
+
className = {
|
|
55482
|
+
[className]: "true",
|
|
55483
|
+
...field.amis.className
|
|
55484
|
+
};
|
|
55485
|
+
} else if (typeof field.amis?.className == "string") {
|
|
55486
|
+
className = `${className} ${field.amis.className} `;
|
|
55487
|
+
}
|
|
55488
|
+
let fieldAmis = lodash.exports.clone(field.amis);
|
|
55489
|
+
delete fieldAmis?.className;
|
|
55490
|
+
|
|
55418
55491
|
let columnItem;
|
|
55419
55492
|
if((field.is_name || field.name === options.labelFieldName) && options.objectName === 'cms_files'){
|
|
55420
55493
|
const previewFileScript = `
|
|
55421
55494
|
var data = event.data;
|
|
55422
55495
|
var file_name = data.versions ? data.name : "${field.label}";
|
|
55423
|
-
var file_id = data._id;
|
|
55424
|
-
|
|
55496
|
+
var file_id = data.versions && data.versions[0] && data.versions[0]._id;
|
|
55497
|
+
window.previewFile && window.previewFile({file_name, file_id});
|
|
55425
55498
|
`;
|
|
55426
55499
|
columnItem = {
|
|
55427
55500
|
"type": "button",
|
|
@@ -55446,11 +55519,11 @@ async function getTableColumns(fields, options){
|
|
|
55446
55519
|
"expression": "!!!(window && window.nw && window.nw.require)"//浏览器上直接下载
|
|
55447
55520
|
},
|
|
55448
55521
|
{
|
|
55449
|
-
|
|
55450
|
-
|
|
55451
|
-
|
|
55452
|
-
|
|
55453
|
-
|
|
55522
|
+
"args": {},
|
|
55523
|
+
"actionType": "custom",
|
|
55524
|
+
"script": previewFileScript,
|
|
55525
|
+
// "expression": "!!window?.nw?.require" //PC客户端预览附件
|
|
55526
|
+
"expression": "!!(window && window.nw && window.nw.require)"//PC客户端预览附件
|
|
55454
55527
|
}
|
|
55455
55528
|
]
|
|
55456
55529
|
}
|
|
@@ -55465,7 +55538,7 @@ async function getTableColumns(fields, options){
|
|
|
55465
55538
|
toggled: field.toggled,
|
|
55466
55539
|
static: true,
|
|
55467
55540
|
className,
|
|
55468
|
-
},
|
|
55541
|
+
}, fieldAmis, {name: field.name});
|
|
55469
55542
|
}else if(field.type === 'avatar' || field.type === 'image' || field.type === 'file'){
|
|
55470
55543
|
columnItem = Object.assign({}, {
|
|
55471
55544
|
type: "switch",
|
|
@@ -55476,7 +55549,7 @@ async function getTableColumns(fields, options){
|
|
|
55476
55549
|
static: true,
|
|
55477
55550
|
className,
|
|
55478
55551
|
...getAmisFileReadonlySchema(field)
|
|
55479
|
-
},
|
|
55552
|
+
}, fieldAmis, {name: field.name});
|
|
55480
55553
|
}
|
|
55481
55554
|
else if(field.type === 'select'){
|
|
55482
55555
|
const map = getSelectMap(field.options);
|
|
@@ -55491,7 +55564,7 @@ async function getTableColumns(fields, options){
|
|
|
55491
55564
|
className,
|
|
55492
55565
|
inputClassName: "inline",
|
|
55493
55566
|
static: true,
|
|
55494
|
-
},
|
|
55567
|
+
}, fieldAmis, {name: field.name});
|
|
55495
55568
|
}
|
|
55496
55569
|
else {
|
|
55497
55570
|
const tpl = await getFieldTpl(field, options);
|
|
@@ -55518,15 +55591,6 @@ async function getTableColumns(fields, options){
|
|
|
55518
55591
|
// }
|
|
55519
55592
|
|
|
55520
55593
|
//field上的amis属性里的clssname需要单独判断类型合并
|
|
55521
|
-
if (typeof field.amis?.className == "object") {
|
|
55522
|
-
className = {
|
|
55523
|
-
[className]: "true",
|
|
55524
|
-
...field.amis.className
|
|
55525
|
-
};
|
|
55526
|
-
} else if (typeof field.amis?.className == "string") {
|
|
55527
|
-
className = `${className} ${field.amis.className} `;
|
|
55528
|
-
}
|
|
55529
|
-
delete field.amis?.className;
|
|
55530
55594
|
|
|
55531
55595
|
if(!field.hidden && !field.extra){
|
|
55532
55596
|
columnItem = Object.assign({}, {
|
|
@@ -55543,7 +55607,7 @@ async function getTableColumns(fields, options){
|
|
|
55543
55607
|
static: true,
|
|
55544
55608
|
options: field.type === 'html' ? {html: true} : null
|
|
55545
55609
|
// toggled: true
|
|
55546
|
-
},
|
|
55610
|
+
}, fieldAmis, {name: field.name});
|
|
55547
55611
|
|
|
55548
55612
|
if(field.type === 'color'){
|
|
55549
55613
|
columnItem.type = 'color';
|
|
@@ -55739,10 +55803,10 @@ async function getMobileTableColumns(fields, options){
|
|
|
55739
55803
|
if(value.url){
|
|
55740
55804
|
cms_url = value.url;
|
|
55741
55805
|
}else{
|
|
55742
|
-
cms_url = "/api/files/files/"+value+"?download=true"
|
|
55806
|
+
cms_url = Steedos.absoluteUrl("/api/files/files/"+value+"?download=true");
|
|
55743
55807
|
}
|
|
55744
55808
|
}
|
|
55745
|
-
Steedos.cordovaDownload(encodeURI(
|
|
55809
|
+
Steedos.cordovaDownload(encodeURI(cms_url), event.data.name);
|
|
55746
55810
|
`,
|
|
55747
55811
|
"actionType": "custom"
|
|
55748
55812
|
}
|
|
@@ -56004,6 +56068,50 @@ async function getTableSchema$1(fields, options){
|
|
|
56004
56068
|
}
|
|
56005
56069
|
}
|
|
56006
56070
|
|
|
56071
|
+
/*
|
|
56072
|
+
img/avatar字段值添加URL前缀使其在amis中正常显示图片。
|
|
56073
|
+
*/
|
|
56074
|
+
function getScriptForAddUrlPrefixForImgFields(fields){
|
|
56075
|
+
let imgFieldsKeys = [];
|
|
56076
|
+
let imgFields = {};
|
|
56077
|
+
fields.forEach((item)=>{
|
|
56078
|
+
if(lodash.exports.includes(['image','avatar'], item.type)){
|
|
56079
|
+
imgFieldsKeys.push(item.name);
|
|
56080
|
+
imgFields[item.name] = {
|
|
56081
|
+
name: item.name,
|
|
56082
|
+
type: item.type,
|
|
56083
|
+
multiple: item.multiple
|
|
56084
|
+
};
|
|
56085
|
+
}
|
|
56086
|
+
});
|
|
56087
|
+
if(!imgFieldsKeys.length){
|
|
56088
|
+
return '';
|
|
56089
|
+
}
|
|
56090
|
+
return `
|
|
56091
|
+
// image字段值添加URL前缀
|
|
56092
|
+
let imgFieldsKeys = ${JSON.stringify(imgFieldsKeys)};
|
|
56093
|
+
let imgFields = ${JSON.stringify(imgFields)};
|
|
56094
|
+
imgFieldsKeys.forEach((item)=>{
|
|
56095
|
+
let imgFieldValue = data[item];
|
|
56096
|
+
let imgFieldDisplayValue = data._display && data._display[item];
|
|
56097
|
+
if(imgFieldValue && imgFieldValue.length){
|
|
56098
|
+
let fieldProps = imgFields[item];
|
|
56099
|
+
if(fieldProps.multiple){
|
|
56100
|
+
if(imgFieldDisplayValue instanceof Array){
|
|
56101
|
+
data[item] = imgFieldDisplayValue.map((i)=>{
|
|
56102
|
+
const url = window.getImageFieldUrl(i.url);
|
|
56103
|
+
return url;
|
|
56104
|
+
});
|
|
56105
|
+
}
|
|
56106
|
+
}else{
|
|
56107
|
+
const url = imgFieldDisplayValue && window.getImageFieldUrl(imgFieldDisplayValue.url);
|
|
56108
|
+
data[item] = url;
|
|
56109
|
+
}
|
|
56110
|
+
}
|
|
56111
|
+
})
|
|
56112
|
+
`
|
|
56113
|
+
}
|
|
56114
|
+
|
|
56007
56115
|
/******************************************************************************
|
|
56008
56116
|
Copyright (c) Microsoft Corporation.
|
|
56009
56117
|
|
|
@@ -56375,7 +56483,7 @@ async function getObjectFieldsFilterFormSchema(ctx) {
|
|
|
56375
56483
|
const formSchema = {
|
|
56376
56484
|
"type": "service",
|
|
56377
56485
|
"visibleOn": "this.filterFormSearchableFields && this.filterFormSearchableFields.length",
|
|
56378
|
-
"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-
|
|
56486
|
+
"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",
|
|
56379
56487
|
"style":{
|
|
56380
56488
|
"max-height":ctx.formFactor === 'SMALL'?"30vh":"unset"
|
|
56381
56489
|
},
|
|
@@ -56962,7 +57070,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
56962
57070
|
"className": "slds-filters"
|
|
56963
57071
|
},
|
|
56964
57072
|
"size": "xs",
|
|
56965
|
-
"className": `border-
|
|
57073
|
+
"className": `border-y slds-grid slds-grid_vertical slds-nowrap ${!ctx.isLookup && "mt-2"}`,
|
|
56966
57074
|
"visibleOn": "this.showFieldsFilter",
|
|
56967
57075
|
},
|
|
56968
57076
|
"className": "bg-white"
|
|
@@ -57008,6 +57116,7 @@ const getNewListviewButtonSchema = ()=>{
|
|
|
57008
57116
|
"objectApiName": "object_listviews",
|
|
57009
57117
|
"recordId": "",
|
|
57010
57118
|
"mode": "edit",
|
|
57119
|
+
"layout": "normal",
|
|
57011
57120
|
"defaultData": {
|
|
57012
57121
|
"&": "${list_view}",
|
|
57013
57122
|
"name":"",
|
|
@@ -57015,8 +57124,16 @@ const getNewListviewButtonSchema = ()=>{
|
|
|
57015
57124
|
"filters":"",
|
|
57016
57125
|
"shared":false,
|
|
57017
57126
|
"object_name": "${targetObjectName}",
|
|
57127
|
+
"_id":"",
|
|
57128
|
+
"shared_to": null,
|
|
57129
|
+
"shared_to_organizations": null,
|
|
57130
|
+
"locked": false,
|
|
57131
|
+
"owner": null,
|
|
57132
|
+
"company_id": null,
|
|
57133
|
+
"company_ids": null,
|
|
57134
|
+
"is_system": false
|
|
57018
57135
|
},
|
|
57019
|
-
"fieldsExtend": fieldsExtend$
|
|
57136
|
+
"fieldsExtend": fieldsExtend$5(),
|
|
57020
57137
|
"fields": fields$1(),
|
|
57021
57138
|
"onEvent": {
|
|
57022
57139
|
"submitSucc": {
|
|
@@ -57067,14 +57184,17 @@ function fields$1(){
|
|
|
57067
57184
|
"mobile_columns",
|
|
57068
57185
|
"searchable_fields",
|
|
57069
57186
|
"is_system",
|
|
57070
|
-
"shared"
|
|
57187
|
+
"shared",
|
|
57188
|
+
"shared_to",
|
|
57189
|
+
"shared_to_organizations"
|
|
57071
57190
|
]
|
|
57072
57191
|
}
|
|
57073
57192
|
|
|
57074
|
-
function fieldsExtend$
|
|
57193
|
+
function fieldsExtend$5(){
|
|
57075
57194
|
return {
|
|
57076
57195
|
"group": "",
|
|
57077
57196
|
"label": {
|
|
57197
|
+
"group": "",
|
|
57078
57198
|
"is_wide": true
|
|
57079
57199
|
},
|
|
57080
57200
|
"name": {
|
|
@@ -57156,9 +57276,19 @@ function fieldsExtend$4(){
|
|
|
57156
57276
|
"shared": {
|
|
57157
57277
|
"group": "",
|
|
57158
57278
|
"amis": {
|
|
57159
|
-
"visibleOn": "${
|
|
57279
|
+
"visibleOn": "${false}"
|
|
57280
|
+
}
|
|
57281
|
+
},
|
|
57282
|
+
"shared_to": {
|
|
57283
|
+
"group": "",
|
|
57284
|
+
"amis":{
|
|
57285
|
+
"type": "radios",
|
|
57286
|
+
"inline": false
|
|
57160
57287
|
}
|
|
57161
57288
|
},
|
|
57289
|
+
"shared_to_organizations": {
|
|
57290
|
+
"group": ""
|
|
57291
|
+
},
|
|
57162
57292
|
"filters": {
|
|
57163
57293
|
"group": "",
|
|
57164
57294
|
"amis": {
|
|
@@ -57196,14 +57326,23 @@ const getCopyListviewButtonSchema = ()=>{
|
|
|
57196
57326
|
"objectApiName": "object_listviews",
|
|
57197
57327
|
"recordId": "",
|
|
57198
57328
|
"mode": "edit",
|
|
57329
|
+
"layout": "normal",
|
|
57199
57330
|
"defaultData": {
|
|
57200
57331
|
"&": "${list_view}",
|
|
57201
57332
|
"name":"",
|
|
57202
57333
|
"label": instance.t('frontend_listview_control_clone_defaultData_label_start') + " ${list_view.label} " + instance.t('frontend_listview_control_clone_defaultData_label_end'),
|
|
57203
57334
|
"shared":false,
|
|
57204
57335
|
"object_name": "${targetObjectName}",
|
|
57336
|
+
"_id":"",
|
|
57337
|
+
"shared_to": null,
|
|
57338
|
+
"shared_to_organizations": null,
|
|
57339
|
+
"locked": false,
|
|
57340
|
+
"owner": null,
|
|
57341
|
+
"company_id": null,
|
|
57342
|
+
"company_ids": null,
|
|
57343
|
+
"is_system": false
|
|
57205
57344
|
},
|
|
57206
|
-
"fieldsExtend": fieldsExtend$
|
|
57345
|
+
"fieldsExtend": fieldsExtend$4(),
|
|
57207
57346
|
"fields": fields(),
|
|
57208
57347
|
"onEvent": {
|
|
57209
57348
|
"submitSucc": {
|
|
@@ -57251,13 +57390,16 @@ function fields(){
|
|
|
57251
57390
|
"mobile_columns.$.field",
|
|
57252
57391
|
"searchable_fields.$.field",
|
|
57253
57392
|
"is_system",
|
|
57254
|
-
"shared"
|
|
57393
|
+
"shared",
|
|
57394
|
+
"shared_to",
|
|
57395
|
+
"shared_to_organizations"
|
|
57255
57396
|
]
|
|
57256
57397
|
}
|
|
57257
57398
|
|
|
57258
|
-
function fieldsExtend$
|
|
57399
|
+
function fieldsExtend$4(){
|
|
57259
57400
|
return {
|
|
57260
57401
|
"label": {
|
|
57402
|
+
"group": "",
|
|
57261
57403
|
"is_wide": true
|
|
57262
57404
|
},
|
|
57263
57405
|
"name": {
|
|
@@ -57307,10 +57449,21 @@ function fieldsExtend$3(){
|
|
|
57307
57449
|
}
|
|
57308
57450
|
},
|
|
57309
57451
|
"shared": {
|
|
57452
|
+
"group": "",
|
|
57310
57453
|
"amis": {
|
|
57311
|
-
"visibleOn": "${
|
|
57454
|
+
"visibleOn": "${false}"
|
|
57455
|
+
}
|
|
57456
|
+
},
|
|
57457
|
+
"shared_to": {
|
|
57458
|
+
"group": "",
|
|
57459
|
+
"amis":{
|
|
57460
|
+
"type": "radios",
|
|
57461
|
+
"inline": false
|
|
57312
57462
|
}
|
|
57313
57463
|
},
|
|
57464
|
+
"shared_to_organizations": {
|
|
57465
|
+
"group": ""
|
|
57466
|
+
},
|
|
57314
57467
|
"filters": {
|
|
57315
57468
|
"group": "",
|
|
57316
57469
|
"amis": {
|
|
@@ -57320,6 +57473,12 @@ function fieldsExtend$3(){
|
|
|
57320
57473
|
}
|
|
57321
57474
|
}
|
|
57322
57475
|
|
|
57476
|
+
/*
|
|
57477
|
+
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
57478
|
+
* @Date: 2023-06-13 13:51:19
|
|
57479
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
57480
|
+
* @LastEditTime: 2024-02-05 11:25:09
|
|
57481
|
+
*/
|
|
57323
57482
|
const getRenameListviewButtonSchema = ()=>{
|
|
57324
57483
|
return {
|
|
57325
57484
|
"type": "button",
|
|
@@ -57345,6 +57504,7 @@ const getRenameListviewButtonSchema = ()=>{
|
|
|
57345
57504
|
"label": "对象表单",
|
|
57346
57505
|
"objectApiName": "object_listviews",
|
|
57347
57506
|
"recordId": "${recordId}",
|
|
57507
|
+
"layout": "normal",
|
|
57348
57508
|
"mode": "edit",
|
|
57349
57509
|
"fields": [
|
|
57350
57510
|
"label"
|
|
@@ -57379,6 +57539,12 @@ const getRenameListviewButtonSchema = ()=>{
|
|
|
57379
57539
|
}
|
|
57380
57540
|
};
|
|
57381
57541
|
|
|
57542
|
+
/*
|
|
57543
|
+
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
57544
|
+
* @Date: 2023-06-13 13:51:19
|
|
57545
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
57546
|
+
* @LastEditTime: 2024-02-06 15:38:49
|
|
57547
|
+
*/
|
|
57382
57548
|
const getSetListviewShareButtonSchema = ()=>{
|
|
57383
57549
|
return {
|
|
57384
57550
|
"type": "button",
|
|
@@ -57394,6 +57560,8 @@ const getSetListviewShareButtonSchema = ()=>{
|
|
|
57394
57560
|
"title": instance.t('frontend_listview_control_share'),
|
|
57395
57561
|
"data": {
|
|
57396
57562
|
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
57563
|
+
"appId": "${appId}",
|
|
57564
|
+
"global": "${global}",
|
|
57397
57565
|
"context": "${context}"
|
|
57398
57566
|
},
|
|
57399
57567
|
"body": [
|
|
@@ -57403,9 +57571,12 @@ const getSetListviewShareButtonSchema = ()=>{
|
|
|
57403
57571
|
"objectApiName": "object_listviews",
|
|
57404
57572
|
"recordId": "${recordId}",
|
|
57405
57573
|
"mode": "edit",
|
|
57574
|
+
"layout": "normal",
|
|
57406
57575
|
"fields": [
|
|
57407
|
-
"
|
|
57408
|
-
|
|
57576
|
+
"shared_to",
|
|
57577
|
+
"shared_to_organizations"
|
|
57578
|
+
],
|
|
57579
|
+
"fieldsExtend": fieldsExtend$3(),
|
|
57409
57580
|
}
|
|
57410
57581
|
],
|
|
57411
57582
|
"showCloseButton": true,
|
|
@@ -57423,6 +57594,21 @@ const getSetListviewShareButtonSchema = ()=>{
|
|
|
57423
57594
|
}
|
|
57424
57595
|
};
|
|
57425
57596
|
|
|
57597
|
+
function fieldsExtend$3(){
|
|
57598
|
+
return {
|
|
57599
|
+
"shared_to": {
|
|
57600
|
+
"group": "",
|
|
57601
|
+
"amis":{
|
|
57602
|
+
"type": "radios",
|
|
57603
|
+
"inline": false
|
|
57604
|
+
}
|
|
57605
|
+
},
|
|
57606
|
+
"shared_to_organizations": {
|
|
57607
|
+
"group": ""
|
|
57608
|
+
}
|
|
57609
|
+
}
|
|
57610
|
+
}
|
|
57611
|
+
|
|
57426
57612
|
const getSetListviewFiltersButtonSchema = ()=>{
|
|
57427
57613
|
return {
|
|
57428
57614
|
"type": "button",
|
|
@@ -57554,10 +57740,12 @@ function apiRequestAdaptor$2(){
|
|
|
57554
57740
|
function fieldsExtend$2(){
|
|
57555
57741
|
return {
|
|
57556
57742
|
"filters": {
|
|
57743
|
+
"label": "",
|
|
57744
|
+
"group": "",
|
|
57557
57745
|
"visible_on": "true",
|
|
57558
57746
|
"amis": {
|
|
57559
57747
|
"type": "condition-builder",
|
|
57560
|
-
"label":
|
|
57748
|
+
// "label": i18next.t('frontend_listview_control_filters_fields_extend'),
|
|
57561
57749
|
"source": {
|
|
57562
57750
|
"method": "get",
|
|
57563
57751
|
"url": "${context.rootUrl}/service/api/amis-metadata-listviews/getFilterFields?objectName=${targetObjectName}",
|
|
@@ -57600,6 +57788,7 @@ const getSetListviewColumnsButtonSchema = ()=>{
|
|
|
57600
57788
|
"objectApiName": "object_listviews",
|
|
57601
57789
|
"recordId": "${recordId}",
|
|
57602
57790
|
"mode": "edit",
|
|
57791
|
+
"layout": "normal",
|
|
57603
57792
|
"fieldsExtend": fieldsExtend$1(),
|
|
57604
57793
|
"initApiAdaptor": initApiAdaptor$1(),
|
|
57605
57794
|
"apiRequestAdaptor": apiRequestAdaptor$1(),
|
|
@@ -57796,6 +57985,8 @@ const getSetListviewSortButtonSchema = ()=>{
|
|
|
57796
57985
|
function fieldsExtend(){
|
|
57797
57986
|
return {
|
|
57798
57987
|
"sort": {
|
|
57988
|
+
"label": "",
|
|
57989
|
+
"group": "",
|
|
57799
57990
|
"amis": {
|
|
57800
57991
|
"type": "tabs-transfer",
|
|
57801
57992
|
"sortable": true,
|
|
@@ -57923,7 +58114,7 @@ const getSettingListviewToolbarButtonSchema = ()=>{
|
|
|
57923
58114
|
"icon": "fa fa-cog",
|
|
57924
58115
|
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
57925
58116
|
// "tooltip": i18next.t('frontend_button_listview_control_tooltip'),
|
|
57926
|
-
"btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded
|
|
58117
|
+
"btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded text-gray-500",
|
|
57927
58118
|
"align": "right",
|
|
57928
58119
|
"visibleOn": "${!isLookup}",
|
|
57929
58120
|
"buttons": [
|
|
@@ -57944,8 +58135,8 @@ const getSettingListviewToolbarButtonSchema = ()=>{
|
|
|
57944
58135
|
}
|
|
57945
58136
|
};
|
|
57946
58137
|
|
|
57947
|
-
const getDisplayAsButton = function(objectName,
|
|
57948
|
-
let displayAs = Router.getTabDisplayAs(objectName);
|
|
58138
|
+
const getDisplayAsButton = function(objectName, defaultEnableSplit){
|
|
58139
|
+
let displayAs = Router.getTabDisplayAs(objectName, defaultEnableSplit);
|
|
57949
58140
|
let buttons = [
|
|
57950
58141
|
{
|
|
57951
58142
|
"type": "button",
|
|
@@ -57968,7 +58159,7 @@ const getDisplayAsButton = function(objectName, showDisplayAs){
|
|
|
57968
58159
|
"icon": "fa fa-table-columns",
|
|
57969
58160
|
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
57970
58161
|
// "tooltip": `${i18next.t('frontend_display_as')} ${displayAsLabel}`,
|
|
57971
|
-
"btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded
|
|
58162
|
+
"btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded text-gray-500",
|
|
57972
58163
|
"align": "right",
|
|
57973
58164
|
"visibleOn": "${window:innerWidth > 768 && !!!isLookup}",
|
|
57974
58165
|
"buttons": [
|
|
@@ -58161,7 +58352,7 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
58161
58352
|
// //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
58162
58353
|
// // "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
58163
58354
|
// "tooltipPlacement": "top",
|
|
58164
|
-
// "className": "bg-white p-2 rounded
|
|
58355
|
+
// "className": "bg-white p-2 rounded text-gray-500",
|
|
58165
58356
|
// "label": "",
|
|
58166
58357
|
// "icon": "fa fa-sync",
|
|
58167
58358
|
// "visibleOn": "${!showFieldsFilter}",
|
|
@@ -58185,7 +58376,7 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
58185
58376
|
// "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
58186
58377
|
"tooltip":"",
|
|
58187
58378
|
"tooltipPlacement": "top",
|
|
58188
|
-
"className": "bg-white p-2 rounded
|
|
58379
|
+
"className": "bg-white p-2 rounded text-gray-500"
|
|
58189
58380
|
};
|
|
58190
58381
|
}
|
|
58191
58382
|
else {
|
|
@@ -58196,7 +58387,7 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
58196
58387
|
// "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
58197
58388
|
"tooltip":"",
|
|
58198
58389
|
"tooltipPlacement": "top",
|
|
58199
|
-
"className": "bg-white p-2 rounded
|
|
58390
|
+
"className": "bg-white p-2 rounded text-gray-500"
|
|
58200
58391
|
};
|
|
58201
58392
|
}
|
|
58202
58393
|
let toolbarFilter;
|
|
@@ -58218,7 +58409,7 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
58218
58409
|
"visibleOn": "${isFieldsFilterEmpty == false && isLookup != true}"
|
|
58219
58410
|
},
|
|
58220
58411
|
"align": "right",
|
|
58221
|
-
"className": "bg-white p-2 rounded
|
|
58412
|
+
"className": "bg-white p-2 rounded text-gray-500",
|
|
58222
58413
|
"onEvent": {
|
|
58223
58414
|
"click": {
|
|
58224
58415
|
"actions": [
|
|
@@ -58232,7 +58423,7 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
58232
58423
|
"id": "steedos_crud_toolbar_filter"
|
|
58233
58424
|
};
|
|
58234
58425
|
}
|
|
58235
|
-
let toolbarDisplayAsButton = getDisplayAsButton(mainObject?.name);
|
|
58426
|
+
let toolbarDisplayAsButton = getDisplayAsButton(mainObject?.name, mainObject?.enable_split);
|
|
58236
58427
|
let toolbarDQuickSearchBox = getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLookup, keywordsSearchBoxName });
|
|
58237
58428
|
|
|
58238
58429
|
// toolbars返回的数组元素不可以是空对象{},比如hiddenCount ? {} : {"type": "tpl",...},因为空对象最终还是会生成一个空的.antd-Crud-toolbar-item dom
|
|
@@ -58378,7 +58569,6 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58378
58569
|
"timeOut": 1000
|
|
58379
58570
|
}
|
|
58380
58571
|
});
|
|
58381
|
-
resizeWindow();
|
|
58382
58572
|
const scope = event.context.scoped;
|
|
58383
58573
|
// let filterFormValues = event.data;
|
|
58384
58574
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
@@ -58454,8 +58644,8 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
58454
58644
|
/*
|
|
58455
58645
|
* @Author: baozhoutao@steedos.com
|
|
58456
58646
|
* @Date: 2022-07-05 15:55:39
|
|
58457
|
-
* @LastEditors:
|
|
58458
|
-
* @LastEditTime: 2024-
|
|
58647
|
+
* @LastEditors: liaodaxue
|
|
58648
|
+
* @LastEditTime: 2024-02-05 17:56:27
|
|
58459
58649
|
* @Description:
|
|
58460
58650
|
*/
|
|
58461
58651
|
|
|
@@ -59022,17 +59212,13 @@ function getReferenceToSync(field) {
|
|
|
59022
59212
|
|
|
59023
59213
|
function getLookupSapceUserTreeSchema(isMobile){
|
|
59024
59214
|
let apiAdaptor = `
|
|
59025
|
-
// console.log("===getLookupSapceUserTreeSchema===", JSON.stringify(payload));
|
|
59026
59215
|
const records = payload.data.options;
|
|
59027
|
-
let isTreeOptionsComputed = false;
|
|
59028
|
-
if(records.length === 1 && records[0].children){
|
|
59029
|
-
isTreeOptionsComputed = true;
|
|
59030
|
-
}
|
|
59031
|
-
if(isTreeOptionsComputed){
|
|
59032
|
-
return payload;
|
|
59033
|
-
}
|
|
59034
59216
|
const treeRecords = [];
|
|
59035
|
-
const getChildren = (records, childrenIds) => {
|
|
59217
|
+
const getChildren = (currentRecord, records, childrenIds) => {
|
|
59218
|
+
if (currentRecord.children && typeof currentRecord.children[0] === "object") {
|
|
59219
|
+
// 考虑api配置了cache缓存的话,不会请求接口但是会重新进这个接收适配器脚本且payload.data.options返回的会是上一次计算结果,这里直接返回计算过的children
|
|
59220
|
+
return currentRecord.children;
|
|
59221
|
+
}
|
|
59036
59222
|
if (!childrenIds) {
|
|
59037
59223
|
return;
|
|
59038
59224
|
}
|
|
@@ -59041,7 +59227,7 @@ function getLookupSapceUserTreeSchema(isMobile){
|
|
|
59041
59227
|
});
|
|
59042
59228
|
_.each(children, (item) => {
|
|
59043
59229
|
if (item.children) {
|
|
59044
|
-
item.children = getChildren(records, item.children)
|
|
59230
|
+
item.children = getChildren(item, records, item.children)
|
|
59045
59231
|
}else{
|
|
59046
59232
|
item.children = [];
|
|
59047
59233
|
}
|
|
@@ -59067,7 +59253,7 @@ function getLookupSapceUserTreeSchema(isMobile){
|
|
|
59067
59253
|
|
|
59068
59254
|
_.each(records, (record) => {
|
|
59069
59255
|
if (record.noParent == 1) {
|
|
59070
|
-
treeRecords.push(Object.assign({}, record, { children: getChildren(records, record.children) }));
|
|
59256
|
+
treeRecords.push(Object.assign({}, record, { children: getChildren(record, records, record.children) }));
|
|
59071
59257
|
}
|
|
59072
59258
|
});
|
|
59073
59259
|
console.log(treeRecords)
|
|
@@ -59117,6 +59303,7 @@ function getLookupSapceUserTreeSchema(isMobile){
|
|
|
59117
59303
|
}
|
|
59118
59304
|
},
|
|
59119
59305
|
"label": "",
|
|
59306
|
+
"mode": "normal",
|
|
59120
59307
|
"name": "organizations",
|
|
59121
59308
|
"multiple": false,
|
|
59122
59309
|
"joinValues": false,
|
|
@@ -59259,6 +59446,9 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59259
59446
|
}
|
|
59260
59447
|
});
|
|
59261
59448
|
|
|
59449
|
+
let listviewFilter = getListViewFilter(listView);
|
|
59450
|
+
let listviewFiltersFunction = listView && listView._filters;
|
|
59451
|
+
|
|
59262
59452
|
let sort = "";
|
|
59263
59453
|
if(listView){
|
|
59264
59454
|
sort = getListViewSort(listView);
|
|
@@ -59305,7 +59495,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59305
59495
|
Object.assign(api.data.$self, __changedSearchBoxValues, __changedFilterFormValues);
|
|
59306
59496
|
}
|
|
59307
59497
|
const selfData = JSON.parse(JSON.stringify(api.data.$self));
|
|
59308
|
-
var filters = [];
|
|
59498
|
+
${listviewFilter && !ctx.inFilterForm ? `var filters = ${JSON.stringify(listviewFilter)};` : 'var filters = [];'}
|
|
59309
59499
|
var pageSize = api.data.pageSize || 10;
|
|
59310
59500
|
var pageNo = api.data.pageNo || 1;
|
|
59311
59501
|
var skip = (pageNo - 1) * pageSize;
|
|
@@ -59367,6 +59557,16 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59367
59557
|
}
|
|
59368
59558
|
|
|
59369
59559
|
const inFilterForm = ${ctx.inFilterForm};
|
|
59560
|
+
|
|
59561
|
+
const listviewFiltersFunction = ${listviewFiltersFunction};
|
|
59562
|
+
|
|
59563
|
+
if(listviewFiltersFunction && !inFilterForm){
|
|
59564
|
+
const _filters0 = listviewFiltersFunction(filters, api.data.$self.__super);
|
|
59565
|
+
if(_filters0 && _filters0.length){
|
|
59566
|
+
filters.push(_filters0);
|
|
59567
|
+
}
|
|
59568
|
+
}
|
|
59569
|
+
|
|
59370
59570
|
const filtersFunction = ${field.filtersFunction || field._filtersFunction};
|
|
59371
59571
|
|
|
59372
59572
|
if(filtersFunction && !inFilterForm){
|
|
@@ -59454,6 +59654,16 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59454
59654
|
});
|
|
59455
59655
|
payload.data.rows = treeRecords;
|
|
59456
59656
|
}
|
|
59657
|
+
const result = payload.data.rows;
|
|
59658
|
+
if(result && result.length){
|
|
59659
|
+
const updatedResult = _.map(result, (element) => {
|
|
59660
|
+
const data = { ...element };
|
|
59661
|
+
// image字段值添加URL前缀
|
|
59662
|
+
${getScriptForAddUrlPrefixForImgFields(lodash.exports.values(refObjectConfig.fields))}
|
|
59663
|
+
return data;
|
|
59664
|
+
});
|
|
59665
|
+
payload.data.rows = updatedResult;
|
|
59666
|
+
}
|
|
59457
59667
|
return payload;
|
|
59458
59668
|
`;
|
|
59459
59669
|
if(field.optionsFunction || field._optionsFunction){
|
|
@@ -59485,13 +59695,15 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59485
59695
|
|
|
59486
59696
|
pickerSchema.affixHeader = false;
|
|
59487
59697
|
|
|
59488
|
-
|
|
59698
|
+
|
|
59699
|
+
|
|
59700
|
+
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, fieldsArr, ctx.formFactor, { isLookup: true, keywordsSearchBoxName });
|
|
59701
|
+
|
|
59489
59702
|
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user"){
|
|
59490
|
-
|
|
59703
|
+
pickerSchema.headerToolbar.push(getLookupSapceUserTreeSchema(isMobile));
|
|
59491
59704
|
pickerSchema.className = pickerSchema.className || "" + " steedos-select-user";
|
|
59492
59705
|
}
|
|
59493
|
-
|
|
59494
|
-
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, fieldsArr, ctx.formFactor, { headerToolbarItems, isLookup: true, keywordsSearchBoxName });
|
|
59706
|
+
|
|
59495
59707
|
const isAllowCreate = refObjectConfig.permissions.allowCreate;
|
|
59496
59708
|
const isCreate = lodash.exports.isBoolean(field.create) ? field.create : true;
|
|
59497
59709
|
// lookup字段配置过滤条件就强制不显示新建按钮
|
|
@@ -59604,8 +59816,19 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59604
59816
|
pickerSchema.footerToolbar = ["pagination"];
|
|
59605
59817
|
}
|
|
59606
59818
|
|
|
59819
|
+
if(field.inlineHelpText){
|
|
59820
|
+
pickerSchema.toolbarClassName = "hasHelpText";
|
|
59821
|
+
pickerSchema.headerToolbar = [{
|
|
59822
|
+
"type": "tpl",
|
|
59823
|
+
"tpl": field.inlineHelpText,
|
|
59824
|
+
"className": "text-secondary"
|
|
59825
|
+
}, ...pickerSchema.headerToolbar];
|
|
59826
|
+
}
|
|
59827
|
+
pickerSchema.className = (pickerSchema.className || "") + " steedos-lookup-crud";
|
|
59828
|
+
|
|
59607
59829
|
const data = {
|
|
59608
59830
|
type: getAmisStaticFieldType('picker', readonly),
|
|
59831
|
+
className: ctx.className || '',
|
|
59609
59832
|
modalTitle: instance.t('frontend_form_please_select') + " " + refObjectConfig.label,
|
|
59610
59833
|
labelField: referenceTo.labelField.name,
|
|
59611
59834
|
valueField: referenceTo.valueField.name,
|
|
@@ -59679,6 +59902,9 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
59679
59902
|
const refObjectConfig = referenceTo && await getUISchema(referenceTo.objectName);
|
|
59680
59903
|
let listView = getLookupListView(refObjectConfig);
|
|
59681
59904
|
|
|
59905
|
+
let listviewFilter = getListViewFilter(listView);
|
|
59906
|
+
let listviewFiltersFunction = listView && listView._filters;
|
|
59907
|
+
|
|
59682
59908
|
let sort = "";
|
|
59683
59909
|
if(listView){
|
|
59684
59910
|
sort = getListViewSort(listView);
|
|
@@ -59708,7 +59934,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
59708
59934
|
apiInfo.data['rfield'] = `\${object_name}`;
|
|
59709
59935
|
// [["_id", "=", "$${field.name}._id"],"or",["name", "contains", "$term"]]
|
|
59710
59936
|
apiInfo.requestAdaptor = `
|
|
59711
|
-
var filters = [];
|
|
59937
|
+
${listviewFilter && !ctx.inFilterForm ? `var filters = ${JSON.stringify(listviewFilter)};` : 'var filters = [];'}
|
|
59712
59938
|
var top = 200;
|
|
59713
59939
|
if(api.data.$term){
|
|
59714
59940
|
filters = [["${referenceTo?.NAME_FIELD_KEY || 'name'}", "contains", api.data.$term]];
|
|
@@ -59731,6 +59957,16 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
59731
59957
|
}
|
|
59732
59958
|
|
|
59733
59959
|
const inFilterForm = ${ctx.inFilterForm};
|
|
59960
|
+
|
|
59961
|
+
const listviewFiltersFunction = ${listviewFiltersFunction};
|
|
59962
|
+
|
|
59963
|
+
if(listviewFiltersFunction && !inFilterForm){
|
|
59964
|
+
const _filters0 = listviewFiltersFunction(filters, api.data.$);
|
|
59965
|
+
if(_filters0 && _filters0.length){
|
|
59966
|
+
filters.push(_filters0);
|
|
59967
|
+
}
|
|
59968
|
+
}
|
|
59969
|
+
|
|
59734
59970
|
const filtersFunction = ${field.filtersFunction || field._filtersFunction};
|
|
59735
59971
|
|
|
59736
59972
|
if(filtersFunction && !inFilterForm){
|
|
@@ -59807,6 +60043,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
59807
60043
|
// 但是同时配置autoComplete和source会多请求一次接口
|
|
59808
60044
|
// TODO:应该想办法把是否字段在子表组件内,即ctx.isInputTable,如果不在子表组件内不需要加source
|
|
59809
60045
|
data.source = apiInfo;
|
|
60046
|
+
delete data.autoComplete;
|
|
59810
60047
|
}
|
|
59811
60048
|
//删除xlink:href中的rootUrl前缀,解决客户端svg为空的问题
|
|
59812
60049
|
const select_menuTpl = `<span class='flex items-center mt-0.5'>
|
|
@@ -59853,7 +60090,8 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
59853
60090
|
}
|
|
59854
60091
|
// console.log(`lookupToAmis====`, field, readonly, ctx)
|
|
59855
60092
|
if(readonly){
|
|
59856
|
-
if(field.reference_to){
|
|
60093
|
+
if(field.reference_to && !field.isTableField){
|
|
60094
|
+
//isTableField只在grid字段内存在
|
|
59857
60095
|
return {
|
|
59858
60096
|
type: 'steedos-field',
|
|
59859
60097
|
config: field,
|
|
@@ -60064,8 +60302,8 @@ if(typeof window != 'undefined'){
|
|
|
60064
60302
|
/*
|
|
60065
60303
|
* @Author: baozhoutao@steedos.com
|
|
60066
60304
|
* @Date: 2023-01-13 17:27:54
|
|
60067
|
-
* @LastEditors:
|
|
60068
|
-
* @LastEditTime:
|
|
60305
|
+
* @LastEditors: liaodaxue
|
|
60306
|
+
* @LastEditTime: 2024-02-04 17:29:54
|
|
60069
60307
|
* @Description:
|
|
60070
60308
|
*/
|
|
60071
60309
|
|
|
@@ -60166,7 +60404,8 @@ const getHtmlFieldSchema = (field, readonly, ctx)=>{
|
|
|
60166
60404
|
"title": "Insert",
|
|
60167
60405
|
"items": "image link media addcomment pageembed codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents | insertdatetime"
|
|
60168
60406
|
}
|
|
60169
|
-
}
|
|
60407
|
+
},
|
|
60408
|
+
"statusbar": false
|
|
60170
60409
|
},
|
|
60171
60410
|
"name": field.name
|
|
60172
60411
|
}
|
|
@@ -60404,13 +60643,31 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
60404
60643
|
};
|
|
60405
60644
|
break;
|
|
60406
60645
|
case 'input-datetime-range':
|
|
60646
|
+
// convertData = {
|
|
60647
|
+
// type: "input-datetime-range",
|
|
60648
|
+
// inputFormat: 'YYYY-MM-DD HH:mm',
|
|
60649
|
+
// format:'YYYY-MM-DDTHH:mm:ss.SSSZ',
|
|
60650
|
+
// tpl: readonly ? Tpl.getDateTimeTpl(field) : null,
|
|
60651
|
+
// utc: true,
|
|
60652
|
+
// joinValues: false
|
|
60653
|
+
// }
|
|
60654
|
+
// 日期时间字段,按日期方式展现显示控件,用户不用关心小时分钟
|
|
60407
60655
|
convertData = {
|
|
60408
|
-
type: "input-
|
|
60409
|
-
inputFormat:
|
|
60656
|
+
type: "input-date-range",
|
|
60657
|
+
inputFormat: "YYYY-MM-DD HH:mm",
|
|
60410
60658
|
format:'YYYY-MM-DDTHH:mm:ss.SSSZ',
|
|
60411
60659
|
tpl: readonly ? getDateTimeTpl(field) : null,
|
|
60412
60660
|
utc: true,
|
|
60413
|
-
joinValues: false
|
|
60661
|
+
joinValues: false,
|
|
60662
|
+
"shortcuts": [
|
|
60663
|
+
"thismonth",
|
|
60664
|
+
"2monthsago",
|
|
60665
|
+
"3monthslater",
|
|
60666
|
+
"prevquarter",
|
|
60667
|
+
"thisquarter",
|
|
60668
|
+
"thisyear",
|
|
60669
|
+
"lastYear"
|
|
60670
|
+
]
|
|
60414
60671
|
};
|
|
60415
60672
|
break;
|
|
60416
60673
|
case 'datetime':
|
|
@@ -60461,7 +60718,7 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
60461
60718
|
convertData = {
|
|
60462
60719
|
type: getAmisStaticFieldType('datetime', readonly),
|
|
60463
60720
|
inputFormat: 'YYYY-MM-DD HH:mm',
|
|
60464
|
-
format: 'YYYY-MM-DDTHH:mm:
|
|
60721
|
+
format: 'YYYY-MM-DDTHH:mm:00.000Z',
|
|
60465
60722
|
tpl: readonly ? getDateTimeTpl(field) : null,
|
|
60466
60723
|
utc: true,
|
|
60467
60724
|
};
|
|
@@ -60592,6 +60849,36 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
60592
60849
|
convertData = {
|
|
60593
60850
|
type: 'static-text'
|
|
60594
60851
|
};
|
|
60852
|
+
}else if(field.autonumber_enable_modify){
|
|
60853
|
+
convertData = {
|
|
60854
|
+
"type": "input-group",
|
|
60855
|
+
"body": [
|
|
60856
|
+
{
|
|
60857
|
+
"type": "input-text",
|
|
60858
|
+
"name": field.name
|
|
60859
|
+
},
|
|
60860
|
+
{
|
|
60861
|
+
"type": "button",
|
|
60862
|
+
"label": "自动获取",
|
|
60863
|
+
"actionType": "ajax",
|
|
60864
|
+
"api": {
|
|
60865
|
+
"url": `\${context.rootUrl}/api/autonumber/generator/\${objectName}/${field.name}`,
|
|
60866
|
+
"method": "post",
|
|
60867
|
+
"headers": {
|
|
60868
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
60869
|
+
},
|
|
60870
|
+
"adaptor": `
|
|
60871
|
+
payload.data["${field.name}"] = payload.data && payload.data.autonumber;
|
|
60872
|
+
delete payload.data.autonumber;
|
|
60873
|
+
return payload;
|
|
60874
|
+
`
|
|
60875
|
+
},
|
|
60876
|
+
"messages": {
|
|
60877
|
+
"success": "获取成功"
|
|
60878
|
+
}
|
|
60879
|
+
}
|
|
60880
|
+
]
|
|
60881
|
+
};
|
|
60595
60882
|
}
|
|
60596
60883
|
break;
|
|
60597
60884
|
case 'url':
|
|
@@ -60797,12 +61084,13 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
60797
61084
|
break;
|
|
60798
61085
|
}
|
|
60799
61086
|
if(!lodash.exports.isEmpty(convertData)){
|
|
61087
|
+
const className = convertData.className;
|
|
60800
61088
|
if(field.is_wide || convertData.type === 'group'){
|
|
60801
|
-
convertData.className = 'col-span-2 m-0';
|
|
61089
|
+
convertData.className = className ? 'col-span-2 m-0 ' + className : 'col-span-2 m-0';
|
|
60802
61090
|
}else {
|
|
60803
|
-
convertData.className = 'm-0';
|
|
61091
|
+
convertData.className = className ? 'm-0 ' + className : 'm-0';
|
|
60804
61092
|
}
|
|
60805
|
-
if(readonly){
|
|
61093
|
+
if(readonly && ctx.mode !== 'edit'){
|
|
60806
61094
|
convertData.className = `${convertData.className} border-b`;
|
|
60807
61095
|
}
|
|
60808
61096
|
if(readonly){
|
|
@@ -60810,11 +61098,7 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
60810
61098
|
}
|
|
60811
61099
|
|
|
60812
61100
|
let fieldTypeClassName = ' steedos-' + convertData.type + (readonly ? '-readonly' : '-edit');
|
|
60813
|
-
|
|
60814
|
-
convertData.className = convertData.className + fieldTypeClassName;
|
|
60815
|
-
} else {
|
|
60816
|
-
convertData.className = fieldTypeClassName;
|
|
60817
|
-
}
|
|
61101
|
+
convertData.className = convertData.className + fieldTypeClassName;
|
|
60818
61102
|
|
|
60819
61103
|
if(field.visible_on && !ctx.inFilterForm){
|
|
60820
61104
|
// convertData.visibleOn = `\$${field.visible_on.substring(1, field.visible_on.length -1).replace(/formData./g, '')}`;
|
|
@@ -60897,8 +61181,9 @@ async function getFieldSearchable(perField, permissionFields, ctx){
|
|
|
60897
61181
|
fieldNamePrefix = `${fieldNamePrefix}between__`;
|
|
60898
61182
|
}
|
|
60899
61183
|
if(_field.type === 'datetime'){
|
|
60900
|
-
//
|
|
60901
|
-
|
|
61184
|
+
// 这里如果想把搜索范围展示效果改为日期范围,不可以直接改为input-date-range,因为它们规则不一样,包括时区规则和小时分秒的存值规则都不一样
|
|
61185
|
+
// 所以想改为展示日期范围效果,只能改input-datetime-range类型本身的属性来实现
|
|
61186
|
+
_field.type = 'input-datetime-range';
|
|
60902
61187
|
_field.is_wide = true;
|
|
60903
61188
|
fieldNamePrefix = `${fieldNamePrefix}between__`;
|
|
60904
61189
|
}
|