@steedos-widgets/amis-object 3.6.4-beta.3 → 3.6.4-beta.4
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 +6 -0
- package/dist/amis-object.cjs.js +47 -38
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +6 -0
- package/dist/amis-object.esm.js +47 -38
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +6 -0
- package/dist/amis-object.umd.js +114 -114
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +21 -21
- package/package.json +3 -3
package/dist/amis-object.esm.css
CHANGED
|
@@ -2649,6 +2649,12 @@ body.sidebar #sidebar {
|
|
|
2649
2649
|
.steedos-input-table .antd-DropDown-popover .antd-PopOver-overlay {
|
|
2650
2650
|
display: none;
|
|
2651
2651
|
}
|
|
2652
|
+
.steedos-input-table .antd-Table-table .antd-Table-placeholder {
|
|
2653
|
+
display: none;
|
|
2654
|
+
}
|
|
2655
|
+
.steedos-input-table .antd-Table-table thead > tr > th {
|
|
2656
|
+
border-right: none;
|
|
2657
|
+
}
|
|
2652
2658
|
|
|
2653
2659
|
|
|
2654
2660
|
.steedos-record-selected {
|
package/dist/amis-object.esm.js
CHANGED
|
@@ -4806,7 +4806,8 @@ instance
|
|
|
4806
4806
|
}
|
|
4807
4807
|
});
|
|
4808
4808
|
|
|
4809
|
-
async function getQuickEditSchema(
|
|
4809
|
+
async function getQuickEditSchema(object, columnField, options){
|
|
4810
|
+
let field = object.fields[columnField.name];
|
|
4810
4811
|
//判断在amis3.2以上环境下,放开批量编辑与lookup的单元格编辑
|
|
4811
4812
|
let isAmisVersionforBatchEdit = false;
|
|
4812
4813
|
if(window.amisRequire && window.amisRequire('amis')){
|
|
@@ -5274,7 +5275,7 @@ function getFieldWidth(width){
|
|
|
5274
5275
|
}
|
|
5275
5276
|
}
|
|
5276
5277
|
|
|
5277
|
-
async function getTableColumns$1(fields, options){
|
|
5278
|
+
async function getTableColumns$1(object, fields, options){
|
|
5278
5279
|
const columns = [];
|
|
5279
5280
|
if(!options.isLookup && !options.isInputTable){
|
|
5280
5281
|
if(!options.enable_tree){
|
|
@@ -5288,7 +5289,7 @@ async function getTableColumns$1(fields, options){
|
|
|
5288
5289
|
continue;
|
|
5289
5290
|
}
|
|
5290
5291
|
//增加quickEdit属性,实现快速编辑
|
|
5291
|
-
const quickEditSchema = allowEdit ? await getQuickEditSchema(field, options) : allowEdit;
|
|
5292
|
+
const quickEditSchema = allowEdit ? await getQuickEditSchema(object, field, options) : allowEdit;
|
|
5292
5293
|
let className = "";
|
|
5293
5294
|
const bowserType = getBowserType();
|
|
5294
5295
|
if(bowserType === "Safari"){
|
|
@@ -5860,7 +5861,7 @@ async function getDefaultCrudCard(columns, options) {
|
|
|
5860
5861
|
return card;
|
|
5861
5862
|
}
|
|
5862
5863
|
|
|
5863
|
-
async function getTableSchema$1(fields, options){
|
|
5864
|
+
async function getTableSchema$1(object, fields, options){
|
|
5864
5865
|
if(!options){
|
|
5865
5866
|
options = {};
|
|
5866
5867
|
}
|
|
@@ -5882,7 +5883,7 @@ async function getTableSchema$1(fields, options){
|
|
|
5882
5883
|
columns = await getMobileTableColumns(fields, options);
|
|
5883
5884
|
}
|
|
5884
5885
|
else {
|
|
5885
|
-
columns = await getTableColumns$1(fields, options);
|
|
5886
|
+
columns = await getTableColumns$1(object, fields, options);
|
|
5886
5887
|
|
|
5887
5888
|
if(listSchema.mode === "cards"){
|
|
5888
5889
|
let card = listSchema.card;
|
|
@@ -11970,7 +11971,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
11970
11971
|
crudId: listSchema.id || id, enable_tree: objectSchema.enable_tree
|
|
11971
11972
|
}, options);
|
|
11972
11973
|
tableOptions.amisData = createObject(options.amisData || {}, {});
|
|
11973
|
-
const table = await getTableSchema$1(fields, tableOptions);
|
|
11974
|
+
const table = await getTableSchema$1(objectSchema, fields, tableOptions);
|
|
11974
11975
|
// delete table.mode;
|
|
11975
11976
|
//image与avatar需要在提交修改时特别处理
|
|
11976
11977
|
const imageNames = _$1__default.compact(_$1__default.map(_$1__default.filter(fields, (field) => ["image","avatar"].includes(field.type)), 'name'));
|
|
@@ -12237,7 +12238,7 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
12237
12238
|
body: {
|
|
12238
12239
|
type: 'wrapper',
|
|
12239
12240
|
className: 'p-0 m-0',
|
|
12240
|
-
body: await getFormBody(fields, formFields, Object.assign({}, ctx, {fieldGroups: objectSchema.field_groups})),
|
|
12241
|
+
body: await getFormBody(fields, formFields, Object.assign({}, ctx, {fieldGroups: objectSchema.field_groups, omitReadonlyFields: true})),
|
|
12241
12242
|
hiddenOn: "${editFormInited != true}",
|
|
12242
12243
|
},
|
|
12243
12244
|
panelClassName:'m-0 sm:rounded-lg shadow-none border-none',
|
|
@@ -12845,8 +12846,8 @@ async function getObjectRelatedListsMiniSchema(objectApiName){
|
|
|
12845
12846
|
/*
|
|
12846
12847
|
* @Author: baozhoutao@steedos.com
|
|
12847
12848
|
* @Date: 2022-07-05 15:55:39
|
|
12848
|
-
* @LastEditors:
|
|
12849
|
-
* @LastEditTime: 2024-02-
|
|
12849
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
12850
|
+
* @LastEditTime: 2024-02-23 16:37:06
|
|
12850
12851
|
* @Description:
|
|
12851
12852
|
*/
|
|
12852
12853
|
|
|
@@ -13194,6 +13195,7 @@ async function convertColumnsToTableFields(columns, uiSchema, ctx = {}) {
|
|
|
13194
13195
|
let fields = [];
|
|
13195
13196
|
for (const column of columns) {
|
|
13196
13197
|
if (isString(column)) {
|
|
13198
|
+
let columnField;
|
|
13197
13199
|
if (column.indexOf('.') > 0) {
|
|
13198
13200
|
const fieldName = column.split('.')[0];
|
|
13199
13201
|
const displayName = column.split('.')[1];
|
|
@@ -13201,23 +13203,30 @@ async function convertColumnsToTableFields(columns, uiSchema, ctx = {}) {
|
|
|
13201
13203
|
if (filedInfo && (filedInfo.type === 'lookup' || filedInfo.type === 'master_detail') && isString(filedInfo.reference_to)) {
|
|
13202
13204
|
const rfUiSchema = await getUISchema(filedInfo.reference_to);
|
|
13203
13205
|
const rfFieldInfo = rfUiSchema.fields[displayName];
|
|
13204
|
-
|
|
13206
|
+
columnField = Object.assign({}, rfFieldInfo, { name: `${fieldName}__expand.${displayName}`, expand: true, expandInfo: { fieldName, displayName } }, ctx);
|
|
13205
13207
|
}else if(filedInfo && filedInfo.type === 'object'){
|
|
13206
|
-
|
|
13208
|
+
columnField = uiSchema.fields[column];
|
|
13207
13209
|
}
|
|
13208
13210
|
} else {
|
|
13209
13211
|
if (uiSchema.fields[column]) {
|
|
13210
|
-
|
|
13212
|
+
columnField = Object.assign({}, uiSchema.fields[column], ctx);
|
|
13211
13213
|
}
|
|
13212
13214
|
else if(ctx.extra){
|
|
13213
13215
|
// 配置列表视图extra_columns时允许字段是hidden的,hidden的字段在uiSchema.fields中不存在
|
|
13214
|
-
|
|
13216
|
+
columnField = {
|
|
13215
13217
|
extra: true,
|
|
13216
13218
|
name: column
|
|
13217
|
-
}
|
|
13219
|
+
};
|
|
13218
13220
|
}
|
|
13219
13221
|
}
|
|
13222
|
+
if(columnField){
|
|
13223
|
+
// 列上的字段不认uiSchema.fields中定义的amis属性
|
|
13224
|
+
columnField = Object.assign({}, columnField, {amis: undefined});
|
|
13225
|
+
fields.push(columnField);
|
|
13226
|
+
}
|
|
13227
|
+
|
|
13220
13228
|
} else if (isObject$1(column)) {
|
|
13229
|
+
let columnField;
|
|
13221
13230
|
if (column.field.indexOf('.') > 0) {
|
|
13222
13231
|
const fieldName = column.field.split('.')[0];
|
|
13223
13232
|
const displayName = column.field.split('.')[1];
|
|
@@ -13225,33 +13234,34 @@ async function convertColumnsToTableFields(columns, uiSchema, ctx = {}) {
|
|
|
13225
13234
|
if (filedInfo && (filedInfo.type === 'lookup' || filedInfo.type === 'master_detail') && isString(filedInfo.reference_to)) {
|
|
13226
13235
|
const rfUiSchema = await getUISchema(filedInfo.reference_to);
|
|
13227
13236
|
const rfFieldInfo = rfUiSchema.fields[displayName];
|
|
13228
|
-
|
|
13237
|
+
columnField = Object.assign({}, rfFieldInfo, ctx,
|
|
13229
13238
|
{ name: `${fieldName}__expand.${displayName}`, expand: true, expandInfo: { fieldName, displayName } },
|
|
13230
13239
|
{
|
|
13231
13240
|
width: column.width,
|
|
13232
|
-
wrap: column.wrap
|
|
13233
|
-
amis: column.amis
|
|
13241
|
+
wrap: column.wrap // wrap = true 是没效果的
|
|
13234
13242
|
}
|
|
13235
|
-
)
|
|
13243
|
+
);
|
|
13236
13244
|
}
|
|
13237
13245
|
} else {
|
|
13238
13246
|
if (uiSchema.fields[column.field]) {
|
|
13239
|
-
fields.
|
|
13240
|
-
|
|
13241
|
-
|
|
13242
|
-
|
|
13243
|
-
amis: column.amis
|
|
13244
|
-
})
|
|
13245
|
-
);
|
|
13247
|
+
columnField = Object.assign({}, uiSchema.fields[column.field], ctx, {
|
|
13248
|
+
width: column.width,
|
|
13249
|
+
wrap: column.wrap // wrap = true 是没效果的
|
|
13250
|
+
});
|
|
13246
13251
|
}
|
|
13247
13252
|
else if(ctx.extra){
|
|
13248
13253
|
// 配置列表视图extra_columns时允许字段是hidden的,hidden的字段在uiSchema.fields中不存在
|
|
13249
|
-
|
|
13254
|
+
columnField = {
|
|
13250
13255
|
extra: true,
|
|
13251
13256
|
name: column.field
|
|
13252
|
-
}
|
|
13257
|
+
};
|
|
13253
13258
|
}
|
|
13254
13259
|
}
|
|
13260
|
+
if(columnField){
|
|
13261
|
+
// 列上的字段不认uiSchema.fields中定义的amis属性,用列上配置的amis覆盖
|
|
13262
|
+
columnField = Object.assign({}, columnField, {amis: column.amis});
|
|
13263
|
+
fields.push(columnField);
|
|
13264
|
+
}
|
|
13255
13265
|
}
|
|
13256
13266
|
}
|
|
13257
13267
|
return fields;
|
|
@@ -14581,7 +14591,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
14581
14591
|
if(refObjectConfig.name === 'organizations'){
|
|
14582
14592
|
labelFieldName = 'name';
|
|
14583
14593
|
}
|
|
14584
|
-
pickerSchema = await getTableSchema$1(tableFields, {
|
|
14594
|
+
pickerSchema = await getTableSchema$1(refObjectConfig, tableFields, {
|
|
14585
14595
|
labelFieldName,
|
|
14586
14596
|
top: top,
|
|
14587
14597
|
isLookup: true,
|
|
@@ -15189,7 +15199,7 @@ async function getIdsPickerSchema(field, readonly, ctx){
|
|
|
15189
15199
|
actions: false
|
|
15190
15200
|
});
|
|
15191
15201
|
}else {
|
|
15192
|
-
pickerSchema = await getTableSchema$1(tableFields, {
|
|
15202
|
+
pickerSchema = await getTableSchema$1(refObjectConfig, tableFields, {
|
|
15193
15203
|
labelFieldName: refObjectConfig.NAME_FIELD_KEY,
|
|
15194
15204
|
top: top,
|
|
15195
15205
|
isLookup: true,
|
|
@@ -16336,15 +16346,15 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
16336
16346
|
/*
|
|
16337
16347
|
* @Author: baozhoutao@steedos.com
|
|
16338
16348
|
* @Date: 2022-05-26 16:02:08
|
|
16339
|
-
* @LastEditors:
|
|
16340
|
-
* @LastEditTime:
|
|
16349
|
+
* @LastEditors: yinlianghui@hotoa.com yinlianghui@hotoa.com
|
|
16350
|
+
* @LastEditTime: 2024-02-25 14:13:10
|
|
16341
16351
|
* @Description:
|
|
16342
16352
|
*/
|
|
16343
16353
|
|
|
16344
16354
|
const getFieldSchemaArray = (formFields, ctx) => {
|
|
16345
16355
|
let fieldSchemaArray = [];
|
|
16346
16356
|
fieldSchemaArray.length = 0;
|
|
16347
|
-
|
|
16357
|
+
ctx && ctx.recordId;
|
|
16348
16358
|
|
|
16349
16359
|
_$1.forEach(formFields, (field) => {
|
|
16350
16360
|
if (!field.group || field.group == 'null' || field.group == '-')
|
|
@@ -16357,9 +16367,7 @@ const getFieldSchemaArray = (formFields, ctx) => {
|
|
|
16357
16367
|
}
|
|
16358
16368
|
|
|
16359
16369
|
let forceHidden = false;
|
|
16360
|
-
if(
|
|
16361
|
-
// 新建记录时,只读字段先隐藏,后续支持显示后,即任务:https://github.com/steedos/steedos-platform/issues/3164 完成后再放开
|
|
16362
|
-
// 表单只读时所有字段都是readonly,设计器中如果forceHidden会造成整个表单在只读的时候显示为空白了,所以要排除掉
|
|
16370
|
+
if(ctx.omitReadonlyFields && field.readonly){
|
|
16363
16371
|
forceHidden = true;
|
|
16364
16372
|
}
|
|
16365
16373
|
|
|
@@ -22386,9 +22394,9 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
22386
22394
|
if (!appId) {
|
|
22387
22395
|
appId = data.context.appId || 'admin';
|
|
22388
22396
|
}
|
|
22389
|
-
badgeText = "${
|
|
22397
|
+
badgeText = "${keyvalues.badge.value | pick:".concat(appId, " | toInt}");
|
|
22390
22398
|
if (appId == "approve_workflow") {
|
|
22391
|
-
badgeText = "${
|
|
22399
|
+
badgeText = "${keyvalues.badge.value | pick:'workflow' | toInt}";
|
|
22392
22400
|
}
|
|
22393
22401
|
if (links) {
|
|
22394
22402
|
return [2 /*return*/, {
|
|
@@ -22405,7 +22413,7 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
22405
22413
|
schemaApi: {
|
|
22406
22414
|
"method": "get",
|
|
22407
22415
|
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus"),
|
|
22408
|
-
"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 },\n \"id\": \"appMenuService\",\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 "),
|
|
22416
|
+
"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 "),
|
|
22409
22417
|
"headers": {
|
|
22410
22418
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
22411
22419
|
}
|
|
@@ -22524,6 +22532,7 @@ var AmisGlobalHeaderToolbar = function (props) { return __awaiter(void 0, void 0
|
|
|
22524
22532
|
},
|
|
22525
22533
|
{
|
|
22526
22534
|
"type": "dropdown-button",
|
|
22535
|
+
"visibleOn": "${window:innerWidth > 768}",
|
|
22527
22536
|
"label": false,
|
|
22528
22537
|
"trigger": "click",
|
|
22529
22538
|
"level": "link",
|