@steedos-widgets/amis-object 3.6.14 → 6.3.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/amis-object.cjs.css +45 -3
- package/dist/amis-object.cjs.js +163 -88
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +45 -3
- package/dist/amis-object.esm.js +163 -88
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +45 -3
- package/dist/amis-object.umd.js +60 -52
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +21 -21
- package/dist/meta.js +46 -11
- package/package.json +3 -3
package/dist/amis-object.cjs.js
CHANGED
|
@@ -3751,10 +3751,23 @@ function getNameTpl(field, ctx){
|
|
|
3751
3751
|
if(ctx && ctx.isLookup){
|
|
3752
3752
|
linkTarget = "target='_blank'";
|
|
3753
3753
|
}
|
|
3754
|
+
let nameLabel = field.name;
|
|
3755
|
+
//若字段类型是lookup,则按照相关表tpl的label规则显示;若是其它类型,则显示_display或字段本身的值
|
|
3756
|
+
if (field.type == "lookup") {
|
|
3757
|
+
if(!field.reference_to && (field.optionsFunction || field._optionsFunction || field.options)){
|
|
3758
|
+
if(!field.isTableField){
|
|
3759
|
+
nameLabel = `\${${field.name}__label}`;
|
|
3760
|
+
}
|
|
3761
|
+
} else {
|
|
3762
|
+
nameLabel = `\${_display.${field.name}.label}`;
|
|
3763
|
+
}
|
|
3764
|
+
} else {
|
|
3765
|
+
nameLabel = `\${_display.${field.name} || ${field.name}}`;
|
|
3766
|
+
}
|
|
3754
3767
|
if(ctx.isRelated && window.innerWidth >= 768){
|
|
3755
|
-
return `<a href="${href}" ${linkTarget} onclick="return false;">\${${
|
|
3768
|
+
return `<a href="${href}" ${linkTarget} onclick="return false;">\${${nameLabel} | raw}</a>`
|
|
3756
3769
|
}else {
|
|
3757
|
-
return `<a href="${href}" ${linkTarget}>\${${
|
|
3770
|
+
return `<a href="${href}" ${linkTarget}>\${${nameLabel} | raw}</a>`
|
|
3758
3771
|
}
|
|
3759
3772
|
}
|
|
3760
3773
|
|
|
@@ -3879,7 +3892,7 @@ function getLocationTpl(field){
|
|
|
3879
3892
|
}
|
|
3880
3893
|
|
|
3881
3894
|
async function getFieldTpl (field, options){
|
|
3882
|
-
if((field.is_name || field.name === options.labelFieldName) && !options.onlyDisplayLookLabel){
|
|
3895
|
+
if((field.is_name || field.name === options.labelFieldName) && !options.onlyDisplayLookLabel && field.multiple !== true){
|
|
3883
3896
|
return getNameTpl(field, options)
|
|
3884
3897
|
}
|
|
3885
3898
|
switch (field.type) {
|
|
@@ -5500,7 +5513,7 @@ async function getTableColumns$1(object, fields, options){
|
|
|
5500
5513
|
"title": " ",
|
|
5501
5514
|
"headerClassName": "hidden",
|
|
5502
5515
|
"size": "lg",
|
|
5503
|
-
"bodyClassName": "p-0 m-0",
|
|
5516
|
+
"bodyClassName": "p-0 m-0 bg-gray-100",
|
|
5504
5517
|
"closeOnEsc": true,
|
|
5505
5518
|
"closeOnOutside": true,
|
|
5506
5519
|
"resizable": true,
|
|
@@ -6436,6 +6449,19 @@ function getReadonlyFormAdaptor(object, fields, options){
|
|
|
6436
6449
|
// })
|
|
6437
6450
|
|
|
6438
6451
|
var fieldNames = _$1__namespace.map(fields, function(n){return n.name});
|
|
6452
|
+
var nameField = object.fields[object.NAME_FIELD_KEY];
|
|
6453
|
+
let nameLabel = nameField && nameField.name;
|
|
6454
|
+
if (nameField && nameField.type == "lookup") {
|
|
6455
|
+
if(!nameField.reference_to && (nameField.optionsFunction || nameField._optionsFunction || nameField.options)){
|
|
6456
|
+
if(!nameField.isTableField){
|
|
6457
|
+
nameLabel = `record.${nameField.name}__label`;
|
|
6458
|
+
}
|
|
6459
|
+
} else {
|
|
6460
|
+
nameLabel = `record._display.${nameField.name}.label`;
|
|
6461
|
+
}
|
|
6462
|
+
} else if (nameField){
|
|
6463
|
+
nameLabel = `record._display.${nameField.name} || record.${nameField.name}`;
|
|
6464
|
+
}
|
|
6439
6465
|
return `
|
|
6440
6466
|
if(payload.data.data.length === 0){
|
|
6441
6467
|
var isEditor = !!${options && options.isEditor};
|
|
@@ -6477,8 +6503,7 @@ function getReadonlyFormAdaptor(object, fields, options){
|
|
|
6477
6503
|
payload.data = data;
|
|
6478
6504
|
payload.data.__objectName = "${object.name}";
|
|
6479
6505
|
payload.data.record = record;
|
|
6480
|
-
|
|
6481
|
-
payload.data.NAME_FIELD_VALUE = record.${object.NAME_FIELD_KEY || 'name'};
|
|
6506
|
+
payload.data.NAME_FIELD_VALUE = ${nameLabel} || record.name;
|
|
6482
6507
|
payload.data._master = {
|
|
6483
6508
|
record: record,
|
|
6484
6509
|
objectName: "${object.name}",
|
|
@@ -7945,7 +7970,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
7945
7970
|
type: 'button',
|
|
7946
7971
|
actionType: 'confirm',
|
|
7947
7972
|
label: instance.t('frontend_form_save'),
|
|
7948
|
-
primary: true
|
|
7973
|
+
primary: true,
|
|
7974
|
+
close: `object_actions_drawer_${uiSchema.name}`
|
|
7949
7975
|
},
|
|
7950
7976
|
]
|
|
7951
7977
|
}
|
|
@@ -8064,6 +8090,20 @@ const getSchema$4 = async (uiSchema, ctx) => {
|
|
|
8064
8090
|
]
|
|
8065
8091
|
}
|
|
8066
8092
|
},
|
|
8093
|
+
"actions": [
|
|
8094
|
+
{
|
|
8095
|
+
type: 'button',
|
|
8096
|
+
actionType: 'cancel',
|
|
8097
|
+
label: instance.t('frontend_form_cancel')
|
|
8098
|
+
},
|
|
8099
|
+
{
|
|
8100
|
+
type: 'button',
|
|
8101
|
+
actionType: 'confirm',
|
|
8102
|
+
label: instance.t('frontend_form_save'),
|
|
8103
|
+
primary: true,
|
|
8104
|
+
close: `object_actions_drawer_${uiSchema.name}`
|
|
8105
|
+
},
|
|
8106
|
+
]
|
|
8067
8107
|
},
|
|
8068
8108
|
},
|
|
8069
8109
|
],
|
|
@@ -8145,7 +8185,8 @@ const getSchema$3 = (uiSchema)=>{
|
|
|
8145
8185
|
}
|
|
8146
8186
|
]
|
|
8147
8187
|
}
|
|
8148
|
-
}
|
|
8188
|
+
},
|
|
8189
|
+
"close": `object_actions_drawer_${uiSchema.name}`
|
|
8149
8190
|
}
|
|
8150
8191
|
],
|
|
8151
8192
|
"regions": [
|
|
@@ -12080,10 +12121,6 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
12080
12121
|
}
|
|
12081
12122
|
}
|
|
12082
12123
|
`;
|
|
12083
|
-
let autoFillHeight = true;
|
|
12084
|
-
if(options.isRelated || window.innerWidth < 768){
|
|
12085
|
-
autoFillHeight = false;
|
|
12086
|
-
}
|
|
12087
12124
|
|
|
12088
12125
|
body = Object.assign({}, table, {
|
|
12089
12126
|
type: 'crud',
|
|
@@ -12094,7 +12131,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
12094
12131
|
keepItemSelectionOnPageChange: true,
|
|
12095
12132
|
api: await getTableApi(objectSchema, fields, options),
|
|
12096
12133
|
hiddenOn: options.tableHiddenOn,
|
|
12097
|
-
autoFillHeight
|
|
12134
|
+
// autoFillHeight,//autoFillHeight按amis规范默认为false,需要配置此属性时在各个组件层配置,比如列表视图组件那边传入此属性为true
|
|
12098
12135
|
className: `flex-auto ${crudClassName || ""}`,
|
|
12099
12136
|
// 这里不可以用动态className,因为它会把样式类加到.antd-Crud和.antd-Table.antd-Crud-body这两层div中,而子表列表中crudClassName中有hidden样式类会造成所有子表都不显示的bug
|
|
12100
12137
|
// className: {
|
|
@@ -12267,6 +12304,10 @@ async function getFormSchemaWithDataFilter(form, options = {}){
|
|
|
12267
12304
|
async function getObjectForm(objectSchema, ctx){
|
|
12268
12305
|
const { recordId, formFactor, layout = formFactor === 'SMALL' ? 'normal' : "horizontal", labelAlign, tabId, appId, defaults, submitSuccActions = [],
|
|
12269
12306
|
formDataFilter, onFormDataFilter, amisData, env } = ctx;
|
|
12307
|
+
//优先识别组件上的enableTabs属性,若不存在,则识别对象上定义的
|
|
12308
|
+
if (typeof ctx.enableTabs !== 'boolean') {
|
|
12309
|
+
ctx.enableTabs = objectSchema.enable_form_tabs;
|
|
12310
|
+
}
|
|
12270
12311
|
const fields = _$1__default["default"].values(objectSchema.fields);
|
|
12271
12312
|
const formFields = getFormFields$1(objectSchema, ctx);
|
|
12272
12313
|
const formSchema = defaults && defaults.formSchema || {};
|
|
@@ -12360,7 +12401,7 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
12360
12401
|
|
|
12361
12402
|
async function getObjectDetail(objectSchema, recordId, ctx){
|
|
12362
12403
|
const { formFactor, layout = formFactor === 'SMALL' ? 'normal' : "horizontal", labelAlign,
|
|
12363
|
-
formDataFilter, onFormDataFilter, amisData, env } = ctx;
|
|
12404
|
+
formDataFilter, onFormDataFilter, amisData, env, enableInitApi } = ctx;
|
|
12364
12405
|
const fields = _$1__default["default"].values(objectSchema.fields);
|
|
12365
12406
|
const formFields = getFormFields$1(objectSchema, ctx);
|
|
12366
12407
|
const serviceId = `service_detail_page`;
|
|
@@ -12427,6 +12468,16 @@ async function getObjectDetail(objectSchema, recordId, ctx){
|
|
|
12427
12468
|
// }
|
|
12428
12469
|
};
|
|
12429
12470
|
|
|
12471
|
+
if(enableInitApi){
|
|
12472
|
+
amisSchema.api = await getReadonlyFormInitApi(objectSchema, recordId, fields, ctx);
|
|
12473
|
+
// 开启初始化api请求时,如果不把recordLoaded默认设置为false,recordLoaded值会取RecordServic组件中的recordLoaded值
|
|
12474
|
+
// 这会造成表单内steedos field组件lookup字段中props.data取到的是RecordServic组件
|
|
12475
|
+
amisSchema.data = {
|
|
12476
|
+
...amisSchema.data,
|
|
12477
|
+
recordLoaded: false
|
|
12478
|
+
};
|
|
12479
|
+
}
|
|
12480
|
+
|
|
12430
12481
|
amisSchema.body[0].body = await getFormSchemaWithDataFilter(amisSchema.body[0].body, { formDataFilter, onFormDataFilter, amisData, env });
|
|
12431
12482
|
// console.log('getObjectDetail=====>', amisSchema);
|
|
12432
12483
|
return amisSchema;
|
|
@@ -12918,7 +12969,7 @@ async function getObjectRelatedListsMiniSchema(objectApiName){
|
|
|
12918
12969
|
* @Author: baozhoutao@steedos.com
|
|
12919
12970
|
* @Date: 2022-07-05 15:55:39
|
|
12920
12971
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
12921
|
-
* @LastEditTime: 2024-
|
|
12972
|
+
* @LastEditTime: 2024-04-26 16:46:44
|
|
12922
12973
|
* @Description:
|
|
12923
12974
|
*/
|
|
12924
12975
|
|
|
@@ -13183,37 +13234,44 @@ async function getListSchema(
|
|
|
13183
13234
|
* 本次存储代码段
|
|
13184
13235
|
*/
|
|
13185
13236
|
try {
|
|
13186
|
-
|
|
13187
|
-
|
|
13188
|
-
|
|
13189
|
-
|
|
13190
|
-
|
|
13191
|
-
|
|
13192
|
-
|
|
13193
|
-
|
|
13194
|
-
|
|
13195
|
-
|
|
13196
|
-
|
|
13197
|
-
|
|
13198
|
-
|
|
13199
|
-
|
|
13200
|
-
|
|
13201
|
-
|
|
13202
|
-
|
|
13203
|
-
|
|
13204
|
-
|
|
13205
|
-
|
|
13206
|
-
|
|
13207
|
-
|
|
13237
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
13238
|
+
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
13239
|
+
/**
|
|
13240
|
+
* localListViewProps规范来自crud请求api中api.data.$self参数值的。
|
|
13241
|
+
* 比如:{"perPage":20,"page":1,"__searchable__name":"7","__searchable__between__n1__c":[null,null],"filter":[["name","contains","a"]]}
|
|
13242
|
+
* __searchable__...:顶部放大镜搜索条件
|
|
13243
|
+
* filter:右侧过滤器
|
|
13244
|
+
* perPage:每页条数
|
|
13245
|
+
* page:当前页码
|
|
13246
|
+
* orderBy:排序字段
|
|
13247
|
+
* orderDir:排序方向
|
|
13248
|
+
*/
|
|
13249
|
+
if (localListViewProps) {
|
|
13250
|
+
localListViewProps = JSON.parse(localListViewProps);
|
|
13251
|
+
// localListViewProps.perPage = 3;
|
|
13252
|
+
let listSchema = {};
|
|
13253
|
+
if (localListViewProps.orderBy) {
|
|
13254
|
+
listSchema.orderBy = localListViewProps.orderBy;
|
|
13255
|
+
}
|
|
13256
|
+
if (localListViewProps.orderDir) {
|
|
13257
|
+
listSchema.orderDir = localListViewProps.orderDir;
|
|
13258
|
+
}
|
|
13208
13259
|
|
|
13209
|
-
|
|
13210
|
-
|
|
13260
|
+
if (localListViewProps.perPage) {
|
|
13261
|
+
listSchema.perPage = localListViewProps.perPage;
|
|
13262
|
+
}
|
|
13263
|
+
defaults.listSchema = _$1.defaultsDeep({}, listSchema, defaults.listSchema || {});
|
|
13211
13264
|
}
|
|
13212
|
-
defaults.listSchema = _$1.defaultsDeep({}, listSchema, defaults.listSchema || {});
|
|
13213
|
-
}
|
|
13214
13265
|
}
|
|
13215
13266
|
catch (ex) {
|
|
13216
|
-
|
|
13267
|
+
console.error("本地存储中crud参数解析异常:", ex);
|
|
13268
|
+
}
|
|
13269
|
+
|
|
13270
|
+
if (window.innerWidth > 768) {
|
|
13271
|
+
// 列表视图组件PC端高度自动计算实现满屏效果,手机端不需要满屏效果,所以不用autofillheight,且允许重写微页面中重新组件autoFillHeight属性
|
|
13272
|
+
defaults.listSchema = _$1.defaultsDeep({}, defaults.listSchema || {}, {
|
|
13273
|
+
autoFillHeight: true
|
|
13274
|
+
});
|
|
13217
13275
|
}
|
|
13218
13276
|
|
|
13219
13277
|
ctx.defaults = defaults;
|
|
@@ -13263,15 +13321,15 @@ async function getListSchema(
|
|
|
13263
13321
|
async function convertColumnsToTableFields(columns, uiSchema, ctx = {}) {
|
|
13264
13322
|
let fields = [];
|
|
13265
13323
|
for (const column of columns) {
|
|
13324
|
+
let columnField, fieldName, displayName, filedInfo, rfUiSchema, rfFieldInfo;
|
|
13266
13325
|
if (_$1.isString(column)) {
|
|
13267
|
-
let columnField;
|
|
13268
13326
|
if (column.indexOf('.') > 0) {
|
|
13269
|
-
|
|
13270
|
-
|
|
13271
|
-
|
|
13327
|
+
fieldName = column.split('.')[0];
|
|
13328
|
+
displayName = column.split('.')[1];
|
|
13329
|
+
filedInfo = uiSchema.fields[fieldName];
|
|
13272
13330
|
if (filedInfo && (filedInfo.type === 'lookup' || filedInfo.type === 'master_detail') && _$1.isString(filedInfo.reference_to)) {
|
|
13273
|
-
|
|
13274
|
-
|
|
13331
|
+
rfUiSchema = await getUISchema(filedInfo.reference_to);
|
|
13332
|
+
rfFieldInfo = rfUiSchema.fields[displayName];
|
|
13275
13333
|
columnField = Object.assign({}, rfFieldInfo, { name: `${fieldName}__expand.${displayName}`, expand: true, expandInfo: { fieldName, displayName } }, ctx);
|
|
13276
13334
|
}else if(filedInfo && filedInfo.type === 'object'){
|
|
13277
13335
|
columnField = uiSchema.fields[column];
|
|
@@ -13295,14 +13353,13 @@ async function convertColumnsToTableFields(columns, uiSchema, ctx = {}) {
|
|
|
13295
13353
|
}
|
|
13296
13354
|
|
|
13297
13355
|
} else if (_$1.isObject(column)) {
|
|
13298
|
-
let columnField;
|
|
13299
13356
|
if (column.field.indexOf('.') > 0) {
|
|
13300
|
-
|
|
13301
|
-
|
|
13302
|
-
|
|
13357
|
+
fieldName = column.field.split('.')[0];
|
|
13358
|
+
displayName = column.field.split('.')[1];
|
|
13359
|
+
filedInfo = uiSchema.fields[fieldName];
|
|
13303
13360
|
if (filedInfo && (filedInfo.type === 'lookup' || filedInfo.type === 'master_detail') && _$1.isString(filedInfo.reference_to)) {
|
|
13304
|
-
|
|
13305
|
-
|
|
13361
|
+
rfUiSchema = await getUISchema(filedInfo.reference_to);
|
|
13362
|
+
rfFieldInfo = rfUiSchema.fields[displayName];
|
|
13306
13363
|
columnField = Object.assign({}, rfFieldInfo, ctx,
|
|
13307
13364
|
{ name: `${fieldName}__expand.${displayName}`, expand: true, expandInfo: { fieldName, displayName } },
|
|
13308
13365
|
{
|
|
@@ -13310,6 +13367,8 @@ async function convertColumnsToTableFields(columns, uiSchema, ctx = {}) {
|
|
|
13310
13367
|
wrap: column.wrap // wrap = true 是没效果的
|
|
13311
13368
|
}
|
|
13312
13369
|
);
|
|
13370
|
+
} else if (filedInfo && filedInfo.type === 'object') {
|
|
13371
|
+
columnField = uiSchema.fields[column.field];
|
|
13313
13372
|
}
|
|
13314
13373
|
} else {
|
|
13315
13374
|
if (uiSchema.fields[column.field]) {
|
|
@@ -13444,7 +13503,7 @@ async function getRecordDetailSchema(objectName, appId, props = {}){
|
|
|
13444
13503
|
};
|
|
13445
13504
|
const content = {
|
|
13446
13505
|
"type": "tabs",
|
|
13447
|
-
"className": "steedos-record-tabs bg-white p-4
|
|
13506
|
+
"className": "steedos-record-tabs bg-white p-4 m-2 border rounded",
|
|
13448
13507
|
"contentClassName": "bg-none",
|
|
13449
13508
|
"tabs": [
|
|
13450
13509
|
detailed
|
|
@@ -13520,6 +13579,10 @@ async function getRecordServiceSchema(objectName, appId, props = {}, body) {
|
|
|
13520
13579
|
data: {
|
|
13521
13580
|
"_master.objectName": "${objectName}",
|
|
13522
13581
|
"_master.recordId": "${recordId}",
|
|
13582
|
+
// 微页面设计器中用RecordServic组件包裹一个ObjectForm只读组件时,如果这里不把recordLoaded默认设置为false
|
|
13583
|
+
// recordLoaded值会取父作用域中已经被设置为true的值(比如父级有RecordServic组件,在加载完数据后,父作用域中recordLoaded值为true)
|
|
13584
|
+
// 这会造成表单内steedos field组件lookup字段中props.data取到的是父作用域中的数据
|
|
13585
|
+
"recordLoaded": false,
|
|
13523
13586
|
...(props.data || {})
|
|
13524
13587
|
},
|
|
13525
13588
|
"style": {
|
|
@@ -14408,7 +14471,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
14408
14471
|
});
|
|
14409
14472
|
|
|
14410
14473
|
// 把自动填充规则中依赖的字段也加到api请求中
|
|
14411
|
-
let autoFillMapping =
|
|
14474
|
+
let autoFillMapping = field.auto_fill_mapping;
|
|
14412
14475
|
if (autoFillMapping && autoFillMapping.length) {
|
|
14413
14476
|
autoFillMapping.forEach(function (item) {
|
|
14414
14477
|
if(!_$1__namespace.find(tableFields, function(f){
|
|
@@ -14558,7 +14621,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
14558
14621
|
// 如果当前元素不是数组,则处理该元素
|
|
14559
14622
|
// 下面正则用于匹配amis公式\${}
|
|
14560
14623
|
if(/\\\$\\\{([^}]*)\\\}/.test(arr[i])) {
|
|
14561
|
-
arr[i] = currentAmis.evaluate(arr[i], api.data.$);
|
|
14624
|
+
arr[i] = currentAmis.evaluate(arr[i], api.data.$self);
|
|
14562
14625
|
}
|
|
14563
14626
|
}
|
|
14564
14627
|
}
|
|
@@ -14880,7 +14943,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
14880
14943
|
];
|
|
14881
14944
|
|
|
14882
14945
|
// 把自动填充规则中依赖的字段也加到api请求中
|
|
14883
|
-
let autoFillMapping =
|
|
14946
|
+
let autoFillMapping = field.auto_fill_mapping;
|
|
14884
14947
|
if (autoFillMapping && autoFillMapping.length) {
|
|
14885
14948
|
autoFillMapping.forEach(function (item) {
|
|
14886
14949
|
queryFields.push(refObjectConfig.fields[item.from]);
|
|
@@ -14975,7 +15038,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
14975
15038
|
// 如果当前元素不是数组,则处理该元素
|
|
14976
15039
|
// 下面正则用于匹配amis公式\${}
|
|
14977
15040
|
if(/\\\$\\\{([^}]*)\\\}/.test(arr[i])) {
|
|
14978
|
-
arr[i] = currentAmis.evaluate(arr[i], api.data.$);
|
|
15041
|
+
arr[i] = currentAmis.evaluate(arr[i], api.data.$self);
|
|
14979
15042
|
}
|
|
14980
15043
|
}
|
|
14981
15044
|
}
|
|
@@ -15122,14 +15185,25 @@ async function getApi(object, recordId, fields, options){
|
|
|
15122
15185
|
}
|
|
15123
15186
|
|
|
15124
15187
|
async function getAutoFill(field, refObject) {
|
|
15125
|
-
let autoFillMapping =
|
|
15188
|
+
let autoFillMapping = field.auto_fill_mapping;
|
|
15126
15189
|
if (autoFillMapping && autoFillMapping.length) {
|
|
15127
15190
|
let fillMapping = {};
|
|
15191
|
+
if (field.multiple) {
|
|
15192
|
+
autoFillMapping.forEach(function (item) {
|
|
15193
|
+
//from的字段类型为lookup、master_detail、select时,需要保留数组格式;其他类型需要转变为字符串格式
|
|
15194
|
+
if (_$1__namespace.includes(["lookup","master_detail","select"], refObject.fields[item.from].type)) {
|
|
15195
|
+
fillMapping[item.to] = `\${items | pick:${item.from}}`;
|
|
15196
|
+
} else {
|
|
15197
|
+
fillMapping[item.to] = `\${items | pick:${item.from} | join}`;
|
|
15198
|
+
}
|
|
15199
|
+
});
|
|
15200
|
+
}else {
|
|
15201
|
+
autoFillMapping.forEach(function (item) {
|
|
15202
|
+
fillMapping[item.to] = `\${${item.from}}`;
|
|
15203
|
+
});
|
|
15204
|
+
}
|
|
15128
15205
|
// let fieldsForApi = [];
|
|
15129
|
-
|
|
15130
|
-
fillMapping[item.to] = `\${${item.from}}`;
|
|
15131
|
-
// fieldsForApi.push(item.from);
|
|
15132
|
-
});
|
|
15206
|
+
// fieldsForApi.push(item.from);
|
|
15133
15207
|
// let api = {
|
|
15134
15208
|
// // "url": "/amis/api/mock2/form/autoUpdate?browser=${browser}&version=${version}",
|
|
15135
15209
|
// "url": `/api/v1/${refObject.name}/\${${field.name}}?fields=${JSON.stringify(fieldsForApi)}`,
|
|
@@ -15231,7 +15305,7 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
15231
15305
|
amisSchema = _$1__namespace.defaultsDeep({}, pageAmisSchema, amisSchema);
|
|
15232
15306
|
}
|
|
15233
15307
|
}
|
|
15234
|
-
const autoFill = await getAutoFill(field);
|
|
15308
|
+
const autoFill = await getAutoFill(field, refObject);
|
|
15235
15309
|
if(autoFill){
|
|
15236
15310
|
amisSchema.autoFill = autoFill;
|
|
15237
15311
|
// 这里不配置initAutoFill值,按amis规则initAutoFill默认值为fillIfNotSet处理--需要amis sdk 版本 > 3.6.3-patch.6(不包括)版本
|
|
@@ -21480,11 +21554,11 @@ var SteedosSkeleton = function (props) {
|
|
|
21480
21554
|
};
|
|
21481
21555
|
|
|
21482
21556
|
var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
21483
|
-
var $schema, recordId, defaultData, mode, _a, layout, labelAlign, appId, fieldsExtend, _b, excludedFields, _c, fields, _d, form, _e, className, initApiRequestAdaptor, initApiAdaptor, apiRequestAdaptor, apiAdaptor, enableTabs, tabsMode, submitSuccActions, data, formDataFilter, onFormDataFilter, env, objectApiName, schemaKeys, formSchema, defaults, options, globalData, amisSchema, uiSchema, allData, schema, schema, formData
|
|
21557
|
+
var $schema, recordId, defaultData, mode, _a, layout, labelAlign, appId, fieldsExtend, _b, excludedFields, _c, fields, _d, form, _e, className, enableInitApi, initApiRequestAdaptor, initApiAdaptor, apiRequestAdaptor, apiAdaptor, enableTabs, tabsMode, submitSuccActions, data, formDataFilter, onFormDataFilter, env, objectApiName, schemaKeys, formSchema, defaults, options, globalData, amisSchema, uiSchema, allData, schema, schema, formData;
|
|
21484
21558
|
return __generator(this, function (_f) {
|
|
21485
21559
|
switch (_f.label) {
|
|
21486
21560
|
case 0:
|
|
21487
|
-
$schema = props.$schema, recordId = props.recordId, defaultData = props.defaultData, mode = props.mode, _a = props.layout, layout = _a === void 0 ? "horizontal" : _a, labelAlign = props.labelAlign, appId = props.appId, fieldsExtend = props.fieldsExtend, _b = props.excludedFields, excludedFields = _b === void 0 ? null : _b, _c = props.fields, fields = _c === void 0 ? null : _c, _d = props.form, form = _d === void 0 ? {} : _d, _e = props.className, className = _e === void 0 ? "" : _e, initApiRequestAdaptor = props.initApiRequestAdaptor, initApiAdaptor = props.initApiAdaptor, apiRequestAdaptor = props.apiRequestAdaptor, apiAdaptor = props.apiAdaptor, enableTabs = props.enableTabs, tabsMode = props.tabsMode, submitSuccActions = props.submitSuccActions, data = props.data, formDataFilter = props.formDataFilter, onFormDataFilter = props.onFormDataFilter, env = props.env;
|
|
21561
|
+
$schema = props.$schema, recordId = props.recordId, defaultData = props.defaultData, mode = props.mode, _a = props.layout, layout = _a === void 0 ? "horizontal" : _a, labelAlign = props.labelAlign, appId = props.appId, fieldsExtend = props.fieldsExtend, _b = props.excludedFields, excludedFields = _b === void 0 ? null : _b, _c = props.fields, fields = _c === void 0 ? null : _c, _d = props.form, form = _d === void 0 ? {} : _d, _e = props.className, className = _e === void 0 ? "" : _e, enableInitApi = props.enableInitApi, initApiRequestAdaptor = props.initApiRequestAdaptor, initApiAdaptor = props.initApiAdaptor, apiRequestAdaptor = props.apiRequestAdaptor, apiAdaptor = props.apiAdaptor, enableTabs = props.enableTabs, tabsMode = props.tabsMode, submitSuccActions = props.submitSuccActions, data = props.data, formDataFilter = props.formDataFilter, onFormDataFilter = props.onFormDataFilter, env = props.env;
|
|
21488
21562
|
objectApiName = props.objectApiName || "space_users";
|
|
21489
21563
|
schemaKeys = _$1.difference(_$1.keys($schema), ["id", "form", "type", "mode", "layout", "defaultData", "formDataFilter", "onFormDataFilter", "env"]);
|
|
21490
21564
|
formSchema = _$1.pick(props, schemaKeys);
|
|
@@ -21540,6 +21614,7 @@ var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
21540
21614
|
options.isEditor = true;
|
|
21541
21615
|
}
|
|
21542
21616
|
return [4 /*yield*/, getViewSchema(objectApiName, recordId, Object.assign({}, options, {
|
|
21617
|
+
enableInitApi: enableInitApi,
|
|
21543
21618
|
initApiRequestAdaptor: initApiRequestAdaptor,
|
|
21544
21619
|
initApiAdaptor: initApiAdaptor,
|
|
21545
21620
|
enableTabs: enableTabs,
|
|
@@ -21569,16 +21644,6 @@ var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
21569
21644
|
if (_$1.has(props, 'objectApiName')) {
|
|
21570
21645
|
amisSchema.data.objectName = objectApiName;
|
|
21571
21646
|
}
|
|
21572
|
-
if (props.$$editor) {
|
|
21573
|
-
fieldsArray = fields || [];
|
|
21574
|
-
excludedFieldsArray = excludedFields || [];
|
|
21575
|
-
InitApiResendOn = fieldsArray.concat(excludedFieldsArray).join('');
|
|
21576
|
-
if (InitApiResendOn) {
|
|
21577
|
-
amisSchema.data.InitApiResendOn = InitApiResendOn;
|
|
21578
|
-
amisSchema.api.url += "&InitApiResendOn=${InitApiResendOn}";
|
|
21579
|
-
// amisSchema.api.InitApiResendOn = "${InitApiResendOn}"; 这种写法有bug,当多选几个显示的字段/排除的字段时,表单一直loding。
|
|
21580
|
-
}
|
|
21581
|
-
}
|
|
21582
21647
|
return [2 /*return*/, amisSchema];
|
|
21583
21648
|
}
|
|
21584
21649
|
});
|
|
@@ -21996,12 +22061,12 @@ var AmisRecordDetail = function (props) { return __awaiter(void 0, void 0, void
|
|
|
21996
22061
|
/*
|
|
21997
22062
|
* @Author: baozhoutao@steedos.com
|
|
21998
22063
|
* @Date: 2022-12-08 10:32:17
|
|
21999
|
-
* @LastEditors:
|
|
22000
|
-
* @LastEditTime: 2024-
|
|
22064
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
22065
|
+
* @LastEditTime: 2024-04-25 19:21:15
|
|
22001
22066
|
* @Description:
|
|
22002
22067
|
*/
|
|
22003
22068
|
var AmisRecordService = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
22004
|
-
var className, $schema, appId, _a, objectApiName, body, style, recordId, options, schema;
|
|
22069
|
+
var className, $schema, appId, _a, objectApiName, body, style, recordId, options, schema, formData;
|
|
22005
22070
|
return __generator(this, function (_b) {
|
|
22006
22071
|
switch (_b.label) {
|
|
22007
22072
|
case 0:
|
|
@@ -22028,6 +22093,14 @@ var AmisRecordService = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22028
22093
|
}
|
|
22029
22094
|
Object.assign(schema.style, style);
|
|
22030
22095
|
}
|
|
22096
|
+
formData = {};
|
|
22097
|
+
if (_$1.has(props, "recordId") && $schema.recordId !== "${recordId}") {
|
|
22098
|
+
formData.recordId = props.recordId;
|
|
22099
|
+
}
|
|
22100
|
+
schema.data = Object.assign({}, schema.data || {}, formData);
|
|
22101
|
+
if (_$1.has(props, 'objectApiName')) {
|
|
22102
|
+
schema.data.objectName = objectApiName;
|
|
22103
|
+
}
|
|
22031
22104
|
// console.log(`AmisRecordService====schema==>`, schema)
|
|
22032
22105
|
return [2 /*return*/, schema];
|
|
22033
22106
|
}
|
|
@@ -22217,7 +22290,7 @@ var AmisProvider = function (props) { return __awaiter(void 0, void 0, void 0, f
|
|
|
22217
22290
|
* @Author: baozhoutao@steedos.com
|
|
22218
22291
|
* @Date: 2022-09-01 14:44:57
|
|
22219
22292
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
22220
|
-
* @LastEditTime: 2024-05-14
|
|
22293
|
+
* @LastEditTime: 2024-05-14 15:12:49
|
|
22221
22294
|
* @Description:
|
|
22222
22295
|
*/
|
|
22223
22296
|
var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -22231,7 +22304,7 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
22231
22304
|
isMobile = formFactor === "SMALL" ? true : false;
|
|
22232
22305
|
on_click_script = "\n var evalFunString = \"(function(){\" + event.data.on_click + \"})()\";\n try{\n eval(evalFunString);\n }\n catch(e){\n console.error(\"catch some error when eval the on_click script for app link:\");\n console.error(e.message + \"\\r\\n\" + e.stack);\n }\n ";
|
|
22233
22306
|
mobile_blank_script = "\n if(event.data.path[0] == \"/\"){\n Steedos.openWindow(event.data.context.rootUrl + event.data.path)\n }else{\n Steedos.openWindow(event.data.path)\n }\n ";
|
|
22234
|
-
convertAppVisibleOnScript = "\n var currentAmis = amisRequire('amis');\n app_items.forEach((item) => {\n let visible_on = item.visible_on && item.visible_on.trim();\n if(visible_on){\n // amis visibleOn\u5C5E\u6027\u4E2D\u7684\u8868\u8FBE\u5F0F\u6765\u81EA\u4F5C\u7528\u57DF\u4E2D\u53D8\u91CF\u65F6,amis\u4E0D\u8BA4,\u6240\u4EE5\u8FD9\u91CC\u628A\u516C\u5F0F\u8868\u8FBE\u5F0F\u63D0\u524D\u8FD0\u884C\u4E0B\n try{\n visible_on = currentAmis.evaluate(visible_on, BuilderAmisObject.AmisLib.createObject(context, item));\n item.visible_on = visible_on;\n }\n catch(ex){\n console.error(\"\u8FD0\u884C\u5E94\u7528\u201C\" + item.name + \"\u201D\u7684\u663E\u793A\u516C\u5F0F\u8868\u8FBE\u5F0F\u65F6\u51FA\u73B0\u9519\u8BEF:\",ex);\n item.visible_on = false;\n }\n }\n });\n ";
|
|
22307
|
+
convertAppVisibleOnScript = "\n var currentAmis = amisRequire('amis');\n app_items.forEach((item) => {\n let visible_on = item.visible_on && item.visible_on.trim();\n if(visible_on){\n // amis visibleOn\u5C5E\u6027\u4E2D\u7684\u8868\u8FBE\u5F0F\u6765\u81EA\u4F5C\u7528\u57DF\u4E2D\u53D8\u91CF\u65F6,amis\u4E0D\u8BA4,\u6240\u4EE5\u8FD9\u91CC\u628A\u516C\u5F0F\u8868\u8FBE\u5F0F\u63D0\u524D\u8FD0\u884C\u4E0B\n try{\n visible_on = currentAmis.evaluate(visible_on, BuilderAmisObject.AmisLib.createObject(context, item));\n item.visible_on = visible_on;\n }\n catch(ex){\n console.error(\"\u8FD0\u884C\u5E94\u7528\u201C\" + item.name + \"\u201D\u7684\u663E\u793A\u516C\u5F0F\u8868\u8FBE\u5F0F\u65F6\u51FA\u73B0\u9519\u8BEF:\",ex);\n item.visible_on = false;\n }\n }\n else{\n item.visible_on = true;\n }\n });\n ";
|
|
22235
22308
|
pcInitApiAdaptorScript = "\n let app_items = payload;\n let object_items = [];\n let objects = [];\n app_items.forEach((item) => {\n item.children.forEach((i) => {\n if (objects.indexOf(i.id) < 0) {\n objects.push(i.id);\n if(i.type != 'url' && i.type != 'page'){object_items.push(i);}\n }\n })\n })\n ".concat(convertAppVisibleOnScript, "\n payload = {\n app_items,\n object_items\n }\n return payload;\n ");
|
|
22236
22309
|
mobileInitApiAdaptorScript = "\n let app_items = payload;\n ".concat(convertAppVisibleOnScript, "\n payload = {\n app_items\n }\n return payload;\n ");
|
|
22237
22310
|
dialogSchema = {};
|
|
@@ -22613,7 +22686,7 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
22613
22686
|
schemaApi: {
|
|
22614
22687
|
"method": "get",
|
|
22615
22688
|
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus"),
|
|
22616
|
-
"adaptor": "\n try {\n // console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"").concat(data.tabId, "\";\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 whitespace-normal leading-6 block -ml-px no-underline group flex items-center text-[14px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n // active: selectedId === tab.id,\n })\n })\n } else {\n var tabGroup = _.find(tab_groups, {\"group_name\": groupName});\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": tabGroup && tabGroup.default_open != false,\n \"isGroup\": true,\n \"children\": _.sortBy(_.map(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 whitespace-normal leading-6 block -ml-px no-underline group flex items-center text-[14px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n // active: selectedId === tab.id,\n }\n }),(tab) => {return tab.index})\n }) \n }\n });\n \n }else{\n _.each(payload.children, (tab)=>{\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 whitespace-normal leading-6 block -ml-px no-underline group flex items-center text-[14px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n // active: selectedId === tab.id,\n });\n })\n }\n //\u4EE5\u4E0B\u4E3Anav\u7B2C\u4E00\u5C42\u6392\u5E8F\uFF0C\u5305\u62EC\u5206\u7EC4\u4E0E\u9009\u9879\u5361\n // let groupLength = ((payload.tab_groups && payload.tab_groups.length) || 0) + 1000;\n data.nav = _.sortBy(data.nav, function(tab){\n if(tab.isGroup){\n return _.findIndex(payload.tab_groups, function(group){\n return group.group_name === tab.label;\n });\n }else{\n // \u6CA1\u6709\u5206\u7EC4\u7684\u9009\u9879\u5361\u6309index\u6392\u5217\u5728\u6709\u5206\u7EC4\u7684\u9009\u9879\u5361\u524D\u65B9\n return (tab.index || 0) - 1000;\n }\n })\n payload.data = {\n \"type\":\"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav,\n \"keyvalues\": \"${ss:keyvalues}\"\n },\n \"id\": \"appMenuService\",\n \"onEvent\": {\n \"@data.changed.steedos_keyvalues\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"args\": {\n \"value\": {\n \"keyvalues\": \"${event.data.keyvalues}\"\n }\n }\n }\n ]\n }\n },\n \"body\":{\n \"type\": \"nav\",\n className: \"").concat(className, " text-black\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"source\": \"${items}\",\n //\u5DE6\u5C42\u663E\u793A\u65F6\u5BA1\u6279\u5355\u663E\u793Abadge\u6570\u91CF\n \"itemBadge\": {\n \"mode\": \"text\",\n \"text\": \"").concat(badgeText, "\",\n \"visibleOn\": \"${id == 'instance_tasks'}\",\n \"overflowCount\": 99,\n \"style\": stacked?{\n \"right\": \"20%\",\n \"margin-right\": \"-23px\",\n \"height\": \"20px\",\n \"border-radius\": \"10px\",\n \"font-size\": \"16px\",\n \"line-height\": \"18px\",\n \"top\": \"50%\"\n }:{\n \"transform\": \"translate(calc(50% - 17px), calc(-50% + 10px))\",\n \"border-radius\": \"6.5px\",\n \"height\": \"15px\",\n \"line-height\": \"13px\",\n \"padding\": \"0px 4px\",\n \"font-size\": \"12px\"\n }\n },\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n },\n \"@tabId.changed\":{\n \"actions\":[\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.tabId}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.tabId}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n }\n }\n }\n };\n } catch (error) {\n console.log(`error`, error)\n }\n // console.log('payload===2==>', payload)\n return payload;\n "),
|
|
22689
|
+
"adaptor": "\n try {\n // console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"").concat(data.tabId, "\";\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n tab.iconClass = (tab.icon || 'account').replaceAll('_', '-');\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='whitespace-normal leading-6 block no-underline group flex items-center text-[14px] rounded-md'><svg class=\"slds-icon_container slds-icon-standard-${ tab.iconClass } slds-icon !fill-white rounded-xl mr-2 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"searchKey\": tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n // active: selectedId === tab.id,\n })\n })\n } else {\n var tabGroup = _.find(tab_groups, {\"group_name\": groupName});\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": tabGroup && tabGroup.default_open != false,\n \"isGroup\": true,\n \"children\": _.sortBy(_.map(tabs, (tab) => {\n tab.iconClass = (tab.icon || 'account').replaceAll('_', '-');\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='whitespace-normal leading-6 block no-underline group flex items-center text-[14px] rounded-md'><svg class=\"slds-icon_container slds-icon-standard-${ tab.iconClass } !fill-white slds-icon rounded-xl mr-2 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"searchKey\": tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n // active: selectedId === tab.id,\n }\n }),(tab) => {return tab.index})\n }) \n }\n });\n \n }else{\n _.each(payload.children, (tab)=>{\n tab.iconClass = (tab.icon || 'account').replaceAll('_', '-');\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='whitespace-normal leading-6 block no-underline group flex items-center text-[14px] rounded-md'><svg class=\"slds-icon_container slds-icon-standard-${ tab.iconClass } slds-icon !fill-white rounded-xl mr-2 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"searchKey\": tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n // active: selectedId === tab.id,\n });\n })\n }\n //\u4EE5\u4E0B\u4E3Anav\u7B2C\u4E00\u5C42\u6392\u5E8F\uFF0C\u5305\u62EC\u5206\u7EC4\u4E0E\u9009\u9879\u5361\n // let groupLength = ((payload.tab_groups && payload.tab_groups.length) || 0) + 1000;\n data.nav = _.sortBy(data.nav, function(tab){\n if(tab.isGroup){\n return _.findIndex(payload.tab_groups, function(group){\n return group.group_name === tab.label;\n });\n }else{\n // \u6CA1\u6709\u5206\u7EC4\u7684\u9009\u9879\u5361\u6309index\u6392\u5217\u5728\u6709\u5206\u7EC4\u7684\u9009\u9879\u5361\u524D\u65B9\n return (tab.index || 0) - 1000;\n }\n })\n payload.data = {\n \"type\":\"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav,\n \"keyvalues\": \"${ss:keyvalues}\"\n },\n \"id\": \"appMenuService\",\n \"onEvent\": {\n \"@data.changed.steedos_keyvalues\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"args\": {\n \"value\": {\n \"keyvalues\": \"${event.data.keyvalues}\"\n }\n }\n }\n ]\n }\n },\n \"body\":{\n \"type\": \"nav\",\n \"searchable\": ").concat(stacked, ",\n \"searchConfig\": {\n \"placeholder\": \"\u641C\u7D22\u83DC\u5355\",\n \"matchFunc\": \"return link.searchKey && link.searchKey.indexOf(keyword)>=0;\"\n },\n className: \"").concat(className, " text-black steedos-app-menu ").concat(stacked ? 'stacked' : '', "\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"source\": \"${items}\",\n //\u5DE6\u5C42\u663E\u793A\u65F6\u5BA1\u6279\u5355\u663E\u793Abadge\u6570\u91CF\n \"itemBadge\": {\n \"mode\": \"text\",\n \"text\": \"").concat(badgeText, "\",\n \"visibleOn\": \"${id == 'instance_tasks'}\",\n \"overflowCount\": 99,\n \"style\": stacked?{\n \"right\": \"20%\",\n \"margin-right\": \"-23px\",\n \"height\": \"20px\",\n \"border-radius\": \"10px\",\n \"font-size\": \"16px\",\n \"line-height\": \"18px\",\n \"top\": \"50%\"\n }:{\n \"transform\": \"translate(calc(50% - 17px), calc(-50% + 10px))\",\n \"border-radius\": \"6.5px\",\n \"height\": \"15px\",\n \"line-height\": \"13px\",\n \"padding\": \"0px 4px\",\n \"font-size\": \"12px\"\n }\n },\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n },\n \"@tabId.changed\":{\n \"actions\":[\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.tabId}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.tabId}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n }\n }\n }\n };\n } catch (error) {\n console.log(`error`, error)\n }\n // console.log('payload===2==>', payload)\n return payload;\n "),
|
|
22617
22690
|
"headers": {
|
|
22618
22691
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
22619
22692
|
}
|
|
@@ -23050,7 +23123,8 @@ var AmisGlobalHeaderToolbar = function (props) { return __awaiter(void 0, void 0
|
|
|
23050
23123
|
"color": "#FFFFFF"
|
|
23051
23124
|
},
|
|
23052
23125
|
},
|
|
23053
|
-
]
|
|
23126
|
+
],
|
|
23127
|
+
"xs": "auto"
|
|
23054
23128
|
},
|
|
23055
23129
|
{
|
|
23056
23130
|
"body": [
|
|
@@ -23066,7 +23140,8 @@ var AmisGlobalHeaderToolbar = function (props) { return __awaiter(void 0, void 0
|
|
|
23066
23140
|
"tpl": "${context.user.email}",
|
|
23067
23141
|
"inline": true,
|
|
23068
23142
|
},
|
|
23069
|
-
]
|
|
23143
|
+
],
|
|
23144
|
+
"columnClassName": "break-all"
|
|
23070
23145
|
}
|
|
23071
23146
|
]
|
|
23072
23147
|
},
|
|
@@ -23311,7 +23386,7 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
|
|
|
23311
23386
|
body: [
|
|
23312
23387
|
{
|
|
23313
23388
|
type: "wrapper",
|
|
23314
|
-
className: 'sidebar-wrapper px-0
|
|
23389
|
+
className: 'sidebar-wrapper px-0 py-3 pb-16 fixed z-20 h-full h-fill ease-in-out duration-300 flex flex-col border-r overflow-y-auto bg-gray-50 border-gray-200 block -translate-x-0 sm:w-[220px] w-64',
|
|
23315
23390
|
body: [
|
|
23316
23391
|
{
|
|
23317
23392
|
"type": "steedos-app-launcher",
|
|
@@ -23421,7 +23496,7 @@ var REFERENCE_VALUE_ITEM_ONCLICK = {
|
|
|
23421
23496
|
"title": " ",
|
|
23422
23497
|
"headerClassName": "hidden",
|
|
23423
23498
|
"size": "lg",
|
|
23424
|
-
"bodyClassName": "p-0 m-0",
|
|
23499
|
+
"bodyClassName": "p-0 m-0 bg-gray-100",
|
|
23425
23500
|
"closeOnEsc": true,
|
|
23426
23501
|
"closeOnOutside": true,
|
|
23427
23502
|
"resizable": true,
|
|
@@ -24359,7 +24434,7 @@ var PageRecordDetail = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24359
24434
|
recordPage = _a.sent();
|
|
24360
24435
|
recordSchema = recordPage ? recordPage.schema : {
|
|
24361
24436
|
"type": "wrapper",
|
|
24362
|
-
"className": "steedos-record-content overflow-y-auto p-0 m-0 flex-1 h-full",
|
|
24437
|
+
"className": "steedos-record-content overflow-y-auto p-0 m-0 flex-1 h-full bg-gray-100",
|
|
24363
24438
|
"name": "amis-".concat(appId, "-").concat(objectApiName, "-detail"),
|
|
24364
24439
|
"body": [
|
|
24365
24440
|
{
|