@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.cjs.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.cjs.js
CHANGED
|
@@ -4834,7 +4834,8 @@ instance
|
|
|
4834
4834
|
}
|
|
4835
4835
|
});
|
|
4836
4836
|
|
|
4837
|
-
async function getQuickEditSchema(
|
|
4837
|
+
async function getQuickEditSchema(object, columnField, options){
|
|
4838
|
+
let field = object.fields[columnField.name];
|
|
4838
4839
|
//判断在amis3.2以上环境下,放开批量编辑与lookup的单元格编辑
|
|
4839
4840
|
let isAmisVersionforBatchEdit = false;
|
|
4840
4841
|
if(window.amisRequire && window.amisRequire('amis')){
|
|
@@ -5302,7 +5303,7 @@ function getFieldWidth(width){
|
|
|
5302
5303
|
}
|
|
5303
5304
|
}
|
|
5304
5305
|
|
|
5305
|
-
async function getTableColumns$1(fields, options){
|
|
5306
|
+
async function getTableColumns$1(object, fields, options){
|
|
5306
5307
|
const columns = [];
|
|
5307
5308
|
if(!options.isLookup && !options.isInputTable){
|
|
5308
5309
|
if(!options.enable_tree){
|
|
@@ -5316,7 +5317,7 @@ async function getTableColumns$1(fields, options){
|
|
|
5316
5317
|
continue;
|
|
5317
5318
|
}
|
|
5318
5319
|
//增加quickEdit属性,实现快速编辑
|
|
5319
|
-
const quickEditSchema = allowEdit ? await getQuickEditSchema(field, options) : allowEdit;
|
|
5320
|
+
const quickEditSchema = allowEdit ? await getQuickEditSchema(object, field, options) : allowEdit;
|
|
5320
5321
|
let className = "";
|
|
5321
5322
|
const bowserType = getBowserType();
|
|
5322
5323
|
if(bowserType === "Safari"){
|
|
@@ -5888,7 +5889,7 @@ async function getDefaultCrudCard(columns, options) {
|
|
|
5888
5889
|
return card;
|
|
5889
5890
|
}
|
|
5890
5891
|
|
|
5891
|
-
async function getTableSchema$1(fields, options){
|
|
5892
|
+
async function getTableSchema$1(object, fields, options){
|
|
5892
5893
|
if(!options){
|
|
5893
5894
|
options = {};
|
|
5894
5895
|
}
|
|
@@ -5910,7 +5911,7 @@ async function getTableSchema$1(fields, options){
|
|
|
5910
5911
|
columns = await getMobileTableColumns(fields, options);
|
|
5911
5912
|
}
|
|
5912
5913
|
else {
|
|
5913
|
-
columns = await getTableColumns$1(fields, options);
|
|
5914
|
+
columns = await getTableColumns$1(object, fields, options);
|
|
5914
5915
|
|
|
5915
5916
|
if(listSchema.mode === "cards"){
|
|
5916
5917
|
let card = listSchema.card;
|
|
@@ -11998,7 +11999,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
11998
11999
|
crudId: listSchema.id || id, enable_tree: objectSchema.enable_tree
|
|
11999
12000
|
}, options);
|
|
12000
12001
|
tableOptions.amisData = createObject(options.amisData || {}, {});
|
|
12001
|
-
const table = await getTableSchema$1(fields, tableOptions);
|
|
12002
|
+
const table = await getTableSchema$1(objectSchema, fields, tableOptions);
|
|
12002
12003
|
// delete table.mode;
|
|
12003
12004
|
//image与avatar需要在提交修改时特别处理
|
|
12004
12005
|
const imageNames = _$1__default["default"].compact(_$1__default["default"].map(_$1__default["default"].filter(fields, (field) => ["image","avatar"].includes(field.type)), 'name'));
|
|
@@ -12265,7 +12266,7 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
12265
12266
|
body: {
|
|
12266
12267
|
type: 'wrapper',
|
|
12267
12268
|
className: 'p-0 m-0',
|
|
12268
|
-
body: await getFormBody(fields, formFields, Object.assign({}, ctx, {fieldGroups: objectSchema.field_groups})),
|
|
12269
|
+
body: await getFormBody(fields, formFields, Object.assign({}, ctx, {fieldGroups: objectSchema.field_groups, omitReadonlyFields: true})),
|
|
12269
12270
|
hiddenOn: "${editFormInited != true}",
|
|
12270
12271
|
},
|
|
12271
12272
|
panelClassName:'m-0 sm:rounded-lg shadow-none border-none',
|
|
@@ -12873,8 +12874,8 @@ async function getObjectRelatedListsMiniSchema(objectApiName){
|
|
|
12873
12874
|
/*
|
|
12874
12875
|
* @Author: baozhoutao@steedos.com
|
|
12875
12876
|
* @Date: 2022-07-05 15:55:39
|
|
12876
|
-
* @LastEditors:
|
|
12877
|
-
* @LastEditTime: 2024-02-
|
|
12877
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
12878
|
+
* @LastEditTime: 2024-02-23 16:37:06
|
|
12878
12879
|
* @Description:
|
|
12879
12880
|
*/
|
|
12880
12881
|
|
|
@@ -13222,6 +13223,7 @@ async function convertColumnsToTableFields(columns, uiSchema, ctx = {}) {
|
|
|
13222
13223
|
let fields = [];
|
|
13223
13224
|
for (const column of columns) {
|
|
13224
13225
|
if (_$1.isString(column)) {
|
|
13226
|
+
let columnField;
|
|
13225
13227
|
if (column.indexOf('.') > 0) {
|
|
13226
13228
|
const fieldName = column.split('.')[0];
|
|
13227
13229
|
const displayName = column.split('.')[1];
|
|
@@ -13229,23 +13231,30 @@ async function convertColumnsToTableFields(columns, uiSchema, ctx = {}) {
|
|
|
13229
13231
|
if (filedInfo && (filedInfo.type === 'lookup' || filedInfo.type === 'master_detail') && _$1.isString(filedInfo.reference_to)) {
|
|
13230
13232
|
const rfUiSchema = await getUISchema(filedInfo.reference_to);
|
|
13231
13233
|
const rfFieldInfo = rfUiSchema.fields[displayName];
|
|
13232
|
-
|
|
13234
|
+
columnField = Object.assign({}, rfFieldInfo, { name: `${fieldName}__expand.${displayName}`, expand: true, expandInfo: { fieldName, displayName } }, ctx);
|
|
13233
13235
|
}else if(filedInfo && filedInfo.type === 'object'){
|
|
13234
|
-
|
|
13236
|
+
columnField = uiSchema.fields[column];
|
|
13235
13237
|
}
|
|
13236
13238
|
} else {
|
|
13237
13239
|
if (uiSchema.fields[column]) {
|
|
13238
|
-
|
|
13240
|
+
columnField = Object.assign({}, uiSchema.fields[column], ctx);
|
|
13239
13241
|
}
|
|
13240
13242
|
else if(ctx.extra){
|
|
13241
13243
|
// 配置列表视图extra_columns时允许字段是hidden的,hidden的字段在uiSchema.fields中不存在
|
|
13242
|
-
|
|
13244
|
+
columnField = {
|
|
13243
13245
|
extra: true,
|
|
13244
13246
|
name: column
|
|
13245
|
-
}
|
|
13247
|
+
};
|
|
13246
13248
|
}
|
|
13247
13249
|
}
|
|
13250
|
+
if(columnField){
|
|
13251
|
+
// 列上的字段不认uiSchema.fields中定义的amis属性
|
|
13252
|
+
columnField = Object.assign({}, columnField, {amis: undefined});
|
|
13253
|
+
fields.push(columnField);
|
|
13254
|
+
}
|
|
13255
|
+
|
|
13248
13256
|
} else if (_$1.isObject(column)) {
|
|
13257
|
+
let columnField;
|
|
13249
13258
|
if (column.field.indexOf('.') > 0) {
|
|
13250
13259
|
const fieldName = column.field.split('.')[0];
|
|
13251
13260
|
const displayName = column.field.split('.')[1];
|
|
@@ -13253,33 +13262,34 @@ async function convertColumnsToTableFields(columns, uiSchema, ctx = {}) {
|
|
|
13253
13262
|
if (filedInfo && (filedInfo.type === 'lookup' || filedInfo.type === 'master_detail') && _$1.isString(filedInfo.reference_to)) {
|
|
13254
13263
|
const rfUiSchema = await getUISchema(filedInfo.reference_to);
|
|
13255
13264
|
const rfFieldInfo = rfUiSchema.fields[displayName];
|
|
13256
|
-
|
|
13265
|
+
columnField = Object.assign({}, rfFieldInfo, ctx,
|
|
13257
13266
|
{ name: `${fieldName}__expand.${displayName}`, expand: true, expandInfo: { fieldName, displayName } },
|
|
13258
13267
|
{
|
|
13259
13268
|
width: column.width,
|
|
13260
|
-
wrap: column.wrap
|
|
13261
|
-
amis: column.amis
|
|
13269
|
+
wrap: column.wrap // wrap = true 是没效果的
|
|
13262
13270
|
}
|
|
13263
|
-
)
|
|
13271
|
+
);
|
|
13264
13272
|
}
|
|
13265
13273
|
} else {
|
|
13266
13274
|
if (uiSchema.fields[column.field]) {
|
|
13267
|
-
fields.
|
|
13268
|
-
|
|
13269
|
-
|
|
13270
|
-
|
|
13271
|
-
amis: column.amis
|
|
13272
|
-
})
|
|
13273
|
-
);
|
|
13275
|
+
columnField = Object.assign({}, uiSchema.fields[column.field], ctx, {
|
|
13276
|
+
width: column.width,
|
|
13277
|
+
wrap: column.wrap // wrap = true 是没效果的
|
|
13278
|
+
});
|
|
13274
13279
|
}
|
|
13275
13280
|
else if(ctx.extra){
|
|
13276
13281
|
// 配置列表视图extra_columns时允许字段是hidden的,hidden的字段在uiSchema.fields中不存在
|
|
13277
|
-
|
|
13282
|
+
columnField = {
|
|
13278
13283
|
extra: true,
|
|
13279
13284
|
name: column.field
|
|
13280
|
-
}
|
|
13285
|
+
};
|
|
13281
13286
|
}
|
|
13282
13287
|
}
|
|
13288
|
+
if(columnField){
|
|
13289
|
+
// 列上的字段不认uiSchema.fields中定义的amis属性,用列上配置的amis覆盖
|
|
13290
|
+
columnField = Object.assign({}, columnField, {amis: column.amis});
|
|
13291
|
+
fields.push(columnField);
|
|
13292
|
+
}
|
|
13283
13293
|
}
|
|
13284
13294
|
}
|
|
13285
13295
|
return fields;
|
|
@@ -14609,7 +14619,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
14609
14619
|
if(refObjectConfig.name === 'organizations'){
|
|
14610
14620
|
labelFieldName = 'name';
|
|
14611
14621
|
}
|
|
14612
|
-
pickerSchema = await getTableSchema$1(tableFields, {
|
|
14622
|
+
pickerSchema = await getTableSchema$1(refObjectConfig, tableFields, {
|
|
14613
14623
|
labelFieldName,
|
|
14614
14624
|
top: top,
|
|
14615
14625
|
isLookup: true,
|
|
@@ -15217,7 +15227,7 @@ async function getIdsPickerSchema(field, readonly, ctx){
|
|
|
15217
15227
|
actions: false
|
|
15218
15228
|
});
|
|
15219
15229
|
}else {
|
|
15220
|
-
pickerSchema = await getTableSchema$1(tableFields, {
|
|
15230
|
+
pickerSchema = await getTableSchema$1(refObjectConfig, tableFields, {
|
|
15221
15231
|
labelFieldName: refObjectConfig.NAME_FIELD_KEY,
|
|
15222
15232
|
top: top,
|
|
15223
15233
|
isLookup: true,
|
|
@@ -16364,15 +16374,15 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
16364
16374
|
/*
|
|
16365
16375
|
* @Author: baozhoutao@steedos.com
|
|
16366
16376
|
* @Date: 2022-05-26 16:02:08
|
|
16367
|
-
* @LastEditors:
|
|
16368
|
-
* @LastEditTime:
|
|
16377
|
+
* @LastEditors: yinlianghui@hotoa.com yinlianghui@hotoa.com
|
|
16378
|
+
* @LastEditTime: 2024-02-25 14:13:10
|
|
16369
16379
|
* @Description:
|
|
16370
16380
|
*/
|
|
16371
16381
|
|
|
16372
16382
|
const getFieldSchemaArray = (formFields, ctx) => {
|
|
16373
16383
|
let fieldSchemaArray = [];
|
|
16374
16384
|
fieldSchemaArray.length = 0;
|
|
16375
|
-
|
|
16385
|
+
ctx && ctx.recordId;
|
|
16376
16386
|
|
|
16377
16387
|
_$1__namespace.forEach(formFields, (field) => {
|
|
16378
16388
|
if (!field.group || field.group == 'null' || field.group == '-')
|
|
@@ -16385,9 +16395,7 @@ const getFieldSchemaArray = (formFields, ctx) => {
|
|
|
16385
16395
|
}
|
|
16386
16396
|
|
|
16387
16397
|
let forceHidden = false;
|
|
16388
|
-
if(
|
|
16389
|
-
// 新建记录时,只读字段先隐藏,后续支持显示后,即任务:https://github.com/steedos/steedos-platform/issues/3164 完成后再放开
|
|
16390
|
-
// 表单只读时所有字段都是readonly,设计器中如果forceHidden会造成整个表单在只读的时候显示为空白了,所以要排除掉
|
|
16398
|
+
if(ctx.omitReadonlyFields && field.readonly){
|
|
16391
16399
|
forceHidden = true;
|
|
16392
16400
|
}
|
|
16393
16401
|
|
|
@@ -22414,9 +22422,9 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
22414
22422
|
if (!appId) {
|
|
22415
22423
|
appId = data.context.appId || 'admin';
|
|
22416
22424
|
}
|
|
22417
|
-
badgeText = "${
|
|
22425
|
+
badgeText = "${keyvalues.badge.value | pick:".concat(appId, " | toInt}");
|
|
22418
22426
|
if (appId == "approve_workflow") {
|
|
22419
|
-
badgeText = "${
|
|
22427
|
+
badgeText = "${keyvalues.badge.value | pick:'workflow' | toInt}";
|
|
22420
22428
|
}
|
|
22421
22429
|
if (links) {
|
|
22422
22430
|
return [2 /*return*/, {
|
|
@@ -22433,7 +22441,7 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
22433
22441
|
schemaApi: {
|
|
22434
22442
|
"method": "get",
|
|
22435
22443
|
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus"),
|
|
22436
|
-
"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 "),
|
|
22444
|
+
"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 "),
|
|
22437
22445
|
"headers": {
|
|
22438
22446
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
22439
22447
|
}
|
|
@@ -22552,6 +22560,7 @@ var AmisGlobalHeaderToolbar = function (props) { return __awaiter(void 0, void 0
|
|
|
22552
22560
|
},
|
|
22553
22561
|
{
|
|
22554
22562
|
"type": "dropdown-button",
|
|
22563
|
+
"visibleOn": "${window:innerWidth > 768}",
|
|
22555
22564
|
"label": false,
|
|
22556
22565
|
"trigger": "click",
|
|
22557
22566
|
"level": "link",
|