@steedos-widgets/amis-object 6.3.10 → 6.3.11-beta.3
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/AmisAppLauncher.d.ts +84 -0
- package/dist/amis/AmisAppMenu.d.ts +1 -0
- package/dist/amis-object.cjs.css +15 -0
- package/dist/amis-object.cjs.js +59 -3
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +15 -0
- package/dist/amis-object.esm.js +59 -3
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +15 -0
- package/dist/amis-object.umd.js +2 -2
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +21 -21
- package/package.json +3 -3
package/dist/amis-object.umd.css
CHANGED
|
@@ -636,6 +636,9 @@ fieldset.antd-Collapse > legend{
|
|
|
636
636
|
.m-0 {
|
|
637
637
|
margin: 0px
|
|
638
638
|
}
|
|
639
|
+
.m-1 {
|
|
640
|
+
margin: 0.25rem
|
|
641
|
+
}
|
|
639
642
|
.m-2 {
|
|
640
643
|
margin: 0.5rem
|
|
641
644
|
}
|
|
@@ -2509,6 +2512,18 @@ body.steedos {
|
|
|
2509
2512
|
.steedos-header-container-line-two .ant-dropdown-placement-bottomLeft {
|
|
2510
2513
|
left: -15px !important;
|
|
2511
2514
|
}
|
|
2515
|
+
.antd-Nav-Menu-item-active .hover-inline-flex {
|
|
2516
|
+
display: inline-flex !important;
|
|
2517
|
+
}
|
|
2518
|
+
.antd-Nav-Menu-submenu-active .hover-inline-flex {
|
|
2519
|
+
display: inline-flex !important;
|
|
2520
|
+
}
|
|
2521
|
+
.antd-Nav-Menu-submenu-active .antd-Nav-Menu-item .hover-inline-flex {
|
|
2522
|
+
display: none !important;
|
|
2523
|
+
}
|
|
2524
|
+
.steedos-app-menu-plus .antd-DropDown-menu-root {
|
|
2525
|
+
right: 10px !important;
|
|
2526
|
+
}
|
|
2512
2527
|
|
|
2513
2528
|
#steedosGlobalFooterRoot .steedos-global-footer {
|
|
2514
2529
|
height: 4rem;
|
package/dist/amis-object.umd.js
CHANGED
|
@@ -2620,9 +2620,9 @@ return[2/*return*/,{}];});});};/*
|
|
|
2620
2620
|
* @Author: baozhoutao@steedos.com
|
|
2621
2621
|
* @Date: 2022-09-01 14:44:57
|
|
2622
2622
|
* @LastEditors: baozhoutao@steedos.com
|
|
2623
|
-
* @LastEditTime: 2024-09-09
|
|
2623
|
+
* @LastEditTime: 2024-09-25 09:37:16
|
|
2624
2624
|
* @Description:
|
|
2625
|
-
*/var AmisAppLauncher=function AmisAppLauncher(props){return __awaiter(void 0,void 0,void 0,function(){var app,data,className,_a,showAppName,_b,appNameClassName,_c,customElements,_d,showAppIcon,formFactor,isMobile,on_click_script,mobile_blank_script,convertAppVisibleOnScript,pcInitApiAdaptorScript,mobileInitApiAdaptorScript,dialogSchema,badgeText,overlaySchema;return __generator(this,function(_e){app=props.app,data=props.data,className=props.className,_a=props.showAppName,showAppName=_a===void 0?true:_a,_b=props.appNameClassName,appNameClassName=_b===void 0?'':_b,_c=props.customElements,customElements=_c===void 0?[]:_c,_d=props.showAppIcon,showAppIcon=_d===void 0?true:_d;if(!app){app=data.context.app;}formFactor=window.innerWidth<768?'SMALL':'LARGE';isMobile=formFactor==="SMALL"?true:false;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 ";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 ";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 ";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 ");mobileInitApiAdaptorScript="\n let app_items = payload;\n ".concat(convertAppVisibleOnScript,"\n payload = {\n app_items\n }\n return payload;\n ");dialogSchema={};badgeText="${IF(${id} == 'approve_workflow',${ss:keyvalues.badge.value|pick:'workflow'},${ss:keyvalues.badge.value|pick:${id}}) | toInt}";if(!isMobile){dialogSchema={"type":"service","id":"u:0f6224a0836f","affixFooter":false,"body":[{"type":"collapse-group","activeKey":["1","2"],"body":[{"type":"collapse","key":"1","header":instance.t('frontend_all_apps'),"body":[{"type":"each","name":"app_items","items":[{"type":"button","level":"link","body":[{"type":"tpl","tpl":"<div class='slds-app-launcher__tile slds-text-link_reset'><div class='slds-app-launcher__tile-figure'><svg class='w-12 h-12 slds-icon slds-icon_container slds-icon-standard-${REPLACE(icon, '_', '-')}' aria-hidden='true'><use xlink:href='/assets/icons/standard-sprite/svg/symbols.svg#${icon}'></use></svg><span class='slds-assistive-text'>${name}</span></div><div class='slds-app-launcher__tile-body'><span class='slds-link text-blue-600 text-lg'><span title='${name}'>${name}</span></span><div style='display: -webkit-box; -webkit-line-clamp: 1;-webkit-box-orient: vertical;overflow: hidden;'><span title='${description}'>${description}</span></div></div></div>","badge":{"mode":"text","text":badgeText,"visibleOn":badgeText,"className":"w-full","overflowCount":99,"style":{"top":"20px","left":"37px","height":"20px","border-radius":"10px","line-height":"18px","margin-left":"${"+badgeText+">9?("+badgeText+">99?'-21px':'-11px'):'0'}","right":"auto","font-size":"16px"}}}],"onEvent":{"click":{"actions":[{"actionType":"closeDialog"},{"actionType":"link","args":{"link":"${path}"},"expression":"${AND(!blank , !on_click)}"},{"actionType":"url","args":{"url":"${path}","blank":true},"expression":"${AND(blank , !on_click)}"},{"actionType":"custom","script":on_click_script,"expression":"${!!on_click}"}]}},"inline":true,"style":{},"visibleOn":"${visible_on}","className":"slds-p-horizontal_small slds-size_1-of-1 slds-medium-size_1-of-3"}],"className":"slds-grid slds-wrap slds-grid_pull-padded"}]},{"type":"collapse","key":"2","header":instance.t('frontend_all_projects'),"body":[{"type":"each","name":"object_items","items":{"type":"button","level":"link","body":[{"type":"tpl","wrapperComponent":"span","className":"app-launcher-link slds-text-link--reset slds-app-launcher__tile--small slds-truncate creator-object-nav-${id}","tpl":"<span class=\"slds-truncate slds-text-link\">${name}</span>"}],"onEvent":{"click":{"actions":[{"actionType":"custom","script":"\nconst path = context.props.data.path;\ndoAction({\n actionType: 'link',\n args: {\n \"url\": path,\n \"blank\": false\n }\n});"},{"actionType":"broadcast","args":{"eventName":"@tabId.changed"},"data":{"tabId":"${event.data.id}"}},{"actionType":"closeDialog"}]}},"inline":true,"style":{},"className":"slds-col--padded slds-p-vertical_xx-small slds-size_1-of-5 slds-grow-none oneAppLauncherItem"},"className":"slds-grid slds-wrap"}],"className":""}]}],"className":"steedos-apps-service","visibleOn":"","clearValueOnHidden":false,"visible":true,"messages":{},"onEvent":{"@data.changed.steedos_keyvalues":{"actions":[{"actionType":"reload"}]},"fetchInited":{"actions":[{"actionType":"broadcast","args":{"eventName":"@appsLoaded"},"data":{"apps":"${event.data.app_items}"}}]}},"api":{"method":"get","cache":"10000","url":"${context.rootUrl}/service/api/apps/menus?mobile="+isMobile,"data":null,"headers":{"Authorization":"Bearer ${context.tenantId},${context.authToken}"},"adaptor":pcInitApiAdaptorScript}};}overlaySchema={"type":"service","className":isMobile?"steedos-apps-service":"steedos-apps-service w-96","affixFooter":false,"body":[{"type":"each","source":isMobile?"${app_items}":"${ARRAYFILTER(app_items, (item,index) => index<=8)}","items":{"type":"button","level":"link","body":[{"type":"tpl","tpl":"<div class='flex flex-col justify-center'><div class='text-center'><svg class='w-12 h-12 slds-icon slds-icon_container slds-icon-standard-${REPLACE(icon, '_', '-' )}' aria-hidden='true'><use xlink:href='/assets/icons/standard-sprite/svg/symbols.svg#${icon}'></use></svg></div><div class='text-center text-lg'>${name}</div></div>","badge":{"mode":"text","text":badgeText,"visibleOn":badgeText,"overflowCount":99,"style":{"right":"50%","margin-right":"-23px","height":"20px","border-radius":"10px","font-size":"16px","line-height":"18px"}}}],"onEvent":{"click":{"actions":[{"actionType":"closeDialog"},{"actionType":"link","args":{"link":"${path}"},"expression":"${AND(!blank , !on_click)}"},{"actionType":"custom","script":mobile_blank_script,"expression":"${AND(blank , !on_click)}"},{"actionType":"custom","script":on_click_script,"expression":"${on_click}"}]}},"visibleOn":"${visible_on}","className":"block w-1/3 py-4","style":{"display":"inline-flex","justify-content":"center"}},"className":"flex flex-wrap","id":"u:a98e9f6fb4db"},isMobile?null:{"type":"divider","className":"m-0"},isMobile?null:{"type":"button","level":"link","label":"更多","className":"w-full h-10","actionType":"dialog","dialog":{"size":"xl","title":{"type":"tpl","tpl":instance.t('frontend_application_launcher'),"className":"block text-xl text-center"},"actions":[],"body":[dialogSchema]}}],"clearValueOnHidden":false,"visible":true,"messages":{},"api":{"method":"get","cache":"10000","url":"${context.rootUrl}/service/api/apps/menus?mobile="+isMobile,"headers":{"Authorization":"Bearer ${context.tenantId},${context.authToken}"},"adaptor":mobileInitApiAdaptorScript,"messages":{}},"onEvent":{"@data.changed.steedos_keyvalues":{"actions":[{"actionType":"reload"}]},"fetchInited":{"actions":[{"actionType":"broadcast","args":{"eventName":"@appsLoaded"},"data":{"apps":"${event.data.app_items}"}}]}},"id":"u:2c8bd22d4ea8"};return[2/*return*/,{"type":"service",className:className,"body":[isMobile?{"type":"button","actionType":"dialog","className":"flex items-center","body":__spreadArray([{"type":"tpl","className":"flex items-center","tpl":"<div aria-haspopup='true' title='".concat(instance.t('frontend_open_app_launcher'),"' class='slds-icon-waffle_container slds-context-bar__button' type='button'><span class='slds-icon-waffle'><span class='slds-r1'></span><span class='slds-r2'></span><span class='slds-r3'></span><span class='slds-r4'></span><span class='slds-r5'></span><span class='slds-r6'></span><span class='slds-r7'></span><span class='slds-r8'></span><span class='slds-r9'></span></span></div>"),"badge":{"visibleOn":"${ss:keyvalues.badge.value.workflow | toInt}","offset":[3,-3],"style":{"width":"8px","height":"8px"}},"hiddenOn":"".concat(!showAppIcon)},{type:'tpl',className:"text-xl ml-4 mr-4 text-black nowrap ".concat(appNameClassName," "),tpl:'${app.name}',hiddenOn:"".concat(!!app||!!!showAppName)}],__read(customElements),false),"dialog":{"size":"xl","title":{"type":"tpl","tpl":instance.t('frontend_application_launcher'),"className":"block text-xl text-center"},"actions":[],"body":[overlaySchema]},"id":"u:b5dc095e1c11"}:{"type":"steedos-dropdown","placement":"bottomRight","trigger":["click"],"body":__spreadArray([{"type":"tpl","className":"flex items-center","tpl":"<div aria-haspopup='true' title='".concat(instance.t('frontend_open_app_launcher'),"' class='slds-icon-waffle_container slds-context-bar__button' type='button'><span class='slds-icon-waffle'><span class='slds-r1'></span><span class='slds-r2'></span><span class='slds-r3'></span><span class='slds-r4'></span><span class='slds-r5'></span><span class='slds-r6'></span><span class='slds-r7'></span><span class='slds-r8'></span><span class='slds-r9'></span></span></div>"),"badge":{"visibleOn":"${ss:keyvalues.badge.value.workflow | toInt}","offset":[3,-3],"style":{"width":"8px","height":"8px"}},"hiddenOn":"".concat(!showAppIcon)},{type:'tpl',className:"text-xl ml-4 mr-4 text-black nowrap ".concat(appNameClassName," "),tpl:'${app.name}',hiddenOn:"".concat(!!app||!!!showAppName)}],__read(customElements),false),"overlay":[overlaySchema],"className":"flex items-center","open":false}],"id":"u:06ee48db134a","messages":{},"onEvent":{"@data.changed.steedos_keyvalues":{"actions":[{"actionType":"reload"}]}}}];});});};var AmisLogo=function AmisLogo(props){return __awaiter(void 0,void 0,void 0,function(){var _a,src,className,_b,imgClassName;return __generator(this,function(_c){_a=props.src,src=_a===void 0?'/logo.png':_a,className=props.className,_b=props.imgClassName,imgClassName=_b===void 0?'block h-7 w-auto':_b;return[2/*return*/,{"type":"tpl",className:className,"tpl":"<a href='/app' class='flex items-center '><img class='".concat(imgClassName,"' src='").concat(src,"'></a>"),"id":"u:2a8e7a359dff"}];});});};var AmisAppMenu=function AmisAppMenu(props){return __awaiter(void 0,void 0,void 0,function(){var _a,stacked,overflow,appId,data,_b,links,_c,showIcon,_d,className,_e,indentSize,selectedId,badgeText,schema;return __generator(this,function(_f){_a=props.stacked,stacked=_a===void 0?false:_a,overflow=props.overflow,appId=props.appId,data=props.data,_b=props.links,links=_b===void 0?null:_b,_c=props.showIcon,showIcon=_c===void 0?true:_c,_d=props.className,className=_d===void 0?'':_d,_e=props.indentSize,indentSize=_e===void 0?12:_e,selectedId=props.selectedId;if(!appId){appId=data.context.appId||'admin';}badgeText="${keyvalues.badge.value | pick:".concat(appId," | toInt}");if(appId=="approve_workflow"){badgeText="${keyvalues.badge.value | pick:'workflow' | toInt}";}if(links){return[2/*return*/,{"type":"nav",className:"".concat(className," text-black"),"stacked":stacked,"overflow":overflow,"indentSize":indentSize,"links":links}];}schema={type:'service',schemaApi:{"method":"get","url":"${context.rootUrl}/service/api/apps/".concat(appId,"/menus"),"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 "),"headers":{"Authorization":"Bearer ${context.tenantId},${context.authToken}"}}};// console.log(`schema=====>`, schema)
|
|
2625
|
+
*/var AmisAppLauncher=function AmisAppLauncher(props){return __awaiter(void 0,void 0,void 0,function(){var app,data,className,_a,showAppName,_b,appNameClassName,_c,customElements,_d,showAppIcon,isSpaceAdmin,formFactor,isMobile,on_click_script,mobile_blank_script,convertAppVisibleOnScript,pcInitApiAdaptorScript,mobileInitApiAdaptorScript,dialogSchema,badgeText,overlaySchema;return __generator(this,function(_e){app=props.app,data=props.data,className=props.className,_a=props.showAppName,showAppName=_a===void 0?true:_a,_b=props.appNameClassName,appNameClassName=_b===void 0?'':_b,_c=props.customElements,customElements=_c===void 0?[]:_c,_d=props.showAppIcon,showAppIcon=_d===void 0?true:_d;if(!app){app=data.context.app;}isSpaceAdmin=false;if(data.context.user&&data.context.user.is_space_admin){isSpaceAdmin=true;}formFactor=window.innerWidth<768?'SMALL':'LARGE';isMobile=formFactor==="SMALL"?true:false;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 ";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 ";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 ";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 ");mobileInitApiAdaptorScript="\n let app_items = payload;\n ".concat(convertAppVisibleOnScript,"\n payload = {\n app_items\n }\n return payload;\n ");dialogSchema={};badgeText="${IF(${id} == 'approve_workflow',${ss:keyvalues.badge.value|pick:'workflow'},${ss:keyvalues.badge.value|pick:${id}}) | toInt}";if(!isMobile){dialogSchema={"type":"service","id":"u:0f6224a0836f","affixFooter":false,"body":[{"type":"collapse-group","activeKey":["1","2"],"body":[{"type":"collapse","key":"1","header":instance.t('frontend_all_apps'),"body":[{"type":"each","name":"app_items","items":[{"type":"button","level":"link","body":[{"type":"tpl","tpl":"<div class='slds-app-launcher__tile slds-text-link_reset'><div class='slds-app-launcher__tile-figure'><svg class='w-12 h-12 slds-icon slds-icon_container slds-icon-standard-${REPLACE(icon, '_', '-')}' aria-hidden='true'><use xlink:href='/assets/icons/standard-sprite/svg/symbols.svg#${icon}'></use></svg><span class='slds-assistive-text'>${name}</span></div><div class='slds-app-launcher__tile-body'><span class='slds-link text-blue-600 text-lg'><span title='${name}'>${name}</span></span><div style='display: -webkit-box; -webkit-line-clamp: 1;-webkit-box-orient: vertical;overflow: hidden;'><span title='${description}'>${description}</span></div></div></div>","badge":{"mode":"text","text":badgeText,"visibleOn":badgeText,"className":"w-full","overflowCount":99,"style":{"top":"20px","left":"37px","height":"20px","border-radius":"10px","line-height":"18px","margin-left":"${"+badgeText+">9?("+badgeText+">99?'-21px':'-11px'):'0'}","right":"auto","font-size":"16px"}}}],"onEvent":{"click":{"actions":[{"actionType":"closeDialog"},{"actionType":"link","args":{"link":"${path}"},"expression":"${AND(!blank , !on_click)}"},{"actionType":"url","args":{"url":"${path}","blank":true},"expression":"${AND(blank , !on_click)}"},{"actionType":"custom","script":on_click_script,"expression":"${!!on_click}"}]}},"inline":true,"style":{},"visibleOn":"${visible_on}","className":"slds-p-horizontal_small slds-size_1-of-1 slds-medium-size_1-of-3"}],"className":"slds-grid slds-wrap slds-grid_pull-padded"}]},{"type":"collapse","key":"2","header":instance.t('frontend_all_projects'),"body":[{"type":"each","name":"object_items","items":{"type":"button","level":"link","body":[{"type":"tpl","wrapperComponent":"span","className":"app-launcher-link slds-text-link--reset slds-app-launcher__tile--small slds-truncate creator-object-nav-${id}","tpl":"<span class=\"slds-truncate slds-text-link\">${name}</span>"}],"onEvent":{"click":{"actions":[{"actionType":"custom","script":"\nconst path = context.props.data.path;\ndoAction({\n actionType: 'link',\n args: {\n \"url\": path,\n \"blank\": false\n }\n});"},{"actionType":"broadcast","args":{"eventName":"@tabId.changed"},"data":{"tabId":"${event.data.id}"}},{"actionType":"closeDialog"}]}},"inline":true,"style":{},"className":"slds-col--padded slds-p-vertical_xx-small slds-size_1-of-5 slds-grow-none oneAppLauncherItem"},"className":"slds-grid slds-wrap"}],"className":""}]}],"className":"steedos-apps-service","visibleOn":"","clearValueOnHidden":false,"visible":true,"messages":{},"onEvent":{"@data.changed.steedos_keyvalues":{"actions":[{"actionType":"reload"}]},"fetchInited":{"actions":[{"actionType":"broadcast","args":{"eventName":"@appsLoaded"},"data":{"apps":"${event.data.app_items}"}}]}},"api":{"method":"get","cache":"10000","url":"${context.rootUrl}/service/api/apps/menus?mobile="+isMobile,"data":null,"headers":{"Authorization":"Bearer ${context.tenantId},${context.authToken}"},"adaptor":pcInitApiAdaptorScript}};}overlaySchema={"type":"service","className":isMobile?"steedos-apps-service":"steedos-apps-service w-96","affixFooter":false,"body":[{"type":"each","source":isMobile?"${app_items}":"${ARRAYFILTER(app_items, (item,index) => index<=8)}","items":{"type":"button","level":"link","body":[{"type":"tpl","tpl":"<div class='flex flex-col justify-center'><div class='text-center'><svg class='w-12 h-12 slds-icon slds-icon_container slds-icon-standard-${REPLACE(icon, '_', '-' )}' aria-hidden='true'><use xlink:href='/assets/icons/standard-sprite/svg/symbols.svg#${icon}'></use></svg></div><div class='text-center text-lg'>${name}</div></div>","badge":{"mode":"text","text":badgeText,"visibleOn":badgeText,"overflowCount":99,"style":{"right":"50%","margin-right":"-23px","height":"20px","border-radius":"10px","font-size":"16px","line-height":"18px"}}}],"onEvent":{"click":{"actions":[{"actionType":"closeDialog"},{"actionType":"link","args":{"link":"${path}"},"expression":"${AND(!blank , !on_click)}"},{"actionType":"custom","script":mobile_blank_script,"expression":"${AND(blank , !on_click)}"},{"actionType":"custom","script":on_click_script,"expression":"${on_click}"}]}},"visibleOn":"${visible_on}","className":"block w-1/3 py-4","style":{"display":"inline-flex","justify-content":"center"}},"className":"flex flex-wrap","id":"u:a98e9f6fb4db"},isMobile?null:{"type":"divider","className":"m-0"},isMobile?null:{"type":"button","level":"link","label":"更多","className":"w-full h-10","actionType":"dialog","dialog":{"size":"xl","title":{"type":"tpl","tpl":instance.t('frontend_application_launcher'),"className":"block text-xl text-center"},"actions":[],"body":[dialogSchema]}},isMobile&&isSpaceAdmin?null:{"type":"button","level":"link","label":"+ 新建应用","className":"w-full h-10","actionType":"dialog","dialog":{"title":"新建应用","actions":[{"type":"button","actionType":"cancel","label":"取消","id":"u:21d3cccf4d83"},{"type":"button","actionType":"confirm","label":"确定","primary":true,"id":"u:238e5731a053"}],"body":[{"type":"form","api":{"url":"/service/api/apps/create_by_design","method":"post","requestAdaptor":"api.data={code: context.code, name: context.name}; return api;","adaptor":"window.location.href=Creator.getRelativeUrl('/app/' + payload.code);return {}","messages":{}},"body":[{"type":"input-text","name":"code","label":"应用唯一标识","required":true},{"name":"name","type":"input-text","label":"显示名称","required":true}]}]}}],"clearValueOnHidden":false,"visible":true,"messages":{},"api":{"method":"get","cache":"10000","url":"${context.rootUrl}/service/api/apps/menus?mobile="+isMobile,"headers":{"Authorization":"Bearer ${context.tenantId},${context.authToken}"},"adaptor":mobileInitApiAdaptorScript,"messages":{}},"onEvent":{"@data.changed.steedos_keyvalues":{"actions":[{"actionType":"reload"}]},"fetchInited":{"actions":[{"actionType":"broadcast","args":{"eventName":"@appsLoaded"},"data":{"apps":"${event.data.app_items}"}}]}},"id":"u:2c8bd22d4ea8"};return[2/*return*/,{"type":"service",className:className,"body":[isMobile?{"type":"button","actionType":"dialog","className":"flex items-center","body":__spreadArray([{"type":"tpl","className":"flex items-center","tpl":"<div aria-haspopup='true' title='".concat(instance.t('frontend_open_app_launcher'),"' class='slds-icon-waffle_container slds-context-bar__button' type='button'><span class='slds-icon-waffle'><span class='slds-r1'></span><span class='slds-r2'></span><span class='slds-r3'></span><span class='slds-r4'></span><span class='slds-r5'></span><span class='slds-r6'></span><span class='slds-r7'></span><span class='slds-r8'></span><span class='slds-r9'></span></span></div>"),"badge":{"visibleOn":"${ss:keyvalues.badge.value.workflow | toInt}","offset":[3,-3],"style":{"width":"8px","height":"8px"}},"hiddenOn":"".concat(!showAppIcon)},{type:'tpl',className:"text-xl ml-4 mr-4 text-black nowrap ".concat(appNameClassName," "),tpl:'${app.name}',hiddenOn:"".concat(!!app||!!!showAppName)}],__read(customElements),false),"dialog":{"size":"xl","title":{"type":"tpl","tpl":instance.t('frontend_application_launcher'),"className":"block text-xl text-center"},"actions":[],"body":[overlaySchema]},"id":"u:b5dc095e1c11"}:{"type":"steedos-dropdown","placement":"bottomRight","trigger":["click"],"body":__spreadArray([{"type":"tpl","className":"flex items-center","tpl":"<div aria-haspopup='true' title='".concat(instance.t('frontend_open_app_launcher'),"' class='slds-icon-waffle_container slds-context-bar__button' type='button'><span class='slds-icon-waffle'><span class='slds-r1'></span><span class='slds-r2'></span><span class='slds-r3'></span><span class='slds-r4'></span><span class='slds-r5'></span><span class='slds-r6'></span><span class='slds-r7'></span><span class='slds-r8'></span><span class='slds-r9'></span></span></div>"),"badge":{"visibleOn":"${ss:keyvalues.badge.value.workflow | toInt}","offset":[3,-3],"style":{"width":"8px","height":"8px"}},"hiddenOn":"".concat(!showAppIcon)},{type:'tpl',className:"text-xl ml-4 mr-4 text-black nowrap ".concat(appNameClassName," "),tpl:'${app.name}',hiddenOn:"".concat(!!app||!!!showAppName)}],__read(customElements),false),"overlay":[overlaySchema],"className":"flex items-center","open":false}],"id":"u:06ee48db134a","messages":{},"onEvent":{"@data.changed.steedos_keyvalues":{"actions":[{"actionType":"reload"}]}}}];});});};var AmisLogo=function AmisLogo(props){return __awaiter(void 0,void 0,void 0,function(){var _a,src,className,_b,imgClassName;return __generator(this,function(_c){_a=props.src,src=_a===void 0?'/logo.png':_a,className=props.className,_b=props.imgClassName,imgClassName=_b===void 0?'block h-7 w-auto':_b;return[2/*return*/,{"type":"tpl",className:className,"tpl":"<a href='/app' class='flex items-center '><img class='".concat(imgClassName,"' src='").concat(src,"'></a>"),"id":"u:2a8e7a359dff"}];});});};var AmisAppMenu=function AmisAppMenu(props){return __awaiter(void 0,void 0,void 0,function(){var _a,stacked,overflow,appId,data,_b,links,_c,showIcon,_d,className,_e,indentSize,selectedId,badgeText,schema;return __generator(this,function(_f){_a=props.stacked,stacked=_a===void 0?false:_a,overflow=props.overflow,appId=props.appId,data=props.data,_b=props.links,links=_b===void 0?null:_b,_c=props.showIcon,showIcon=_c===void 0?true:_c,_d=props.className,className=_d===void 0?'':_d,_e=props.indentSize,indentSize=_e===void 0?12:_e,selectedId=props.selectedId;if(!appId){appId=data.context.appId||'admin';}badgeText="${keyvalues.badge.value | pick:".concat(appId," | toInt}");if(appId=="approve_workflow"){badgeText="${keyvalues.badge.value | pick:'workflow' | toInt}";}if(links){return[2/*return*/,{"type":"nav",className:"".concat(className," text-black"),"stacked":stacked,"overflow":overflow,"indentSize":indentSize,"links":links}];}schema={type:'service',id:'u:app-menu',schemaApi:{"method":"get","url":"${context.rootUrl}/service/api/apps/".concat(appId,"/menus"),"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 var usedGroupNames = [];\n let allowEditApp = false;\n if(stacked){\n if(payload.allowEditApp){\n allowEditApp = true;\n }\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 \"tabApiName\": tab.tabApiName,\n \"type\": tab.type,\n // active: selectedId === tab.id,\n })\n })\n } else {\n var tabGroup = _.find(tab_groups, {\"group_name\": groupName});\n usedGroupNames.push(groupName);\n data.nav.push({\n \"label\": groupName,\n 'default_open': tabGroup && tabGroup.default_open != false,\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 \"tabApiName\": tab.tabApiName,\n \"type\": tab.type,\n // active: selectedId === tab.id,\n \"groupName\": groupName\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 \"tabApiName\": tab.tabApiName,\n \"type\": tab.type,\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\n _.each(payload.tab_groups, (group)=>{\n if(!_.includes(usedGroupNames, group.group_name)){\n data.nav.push({\n \"label\": group.group_name,\n 'default_open': group && group.default_open != false,\n \"unfolded\": group && group.default_open != false,\n \"isGroup\": true,\n \"children\": []\n })\n }\n });\n\n let editAppSearch = [];\n if(allowEditApp){\n editAppSearch = [{\n \"type\": \"grid\",\n \"className\": \"m-1\",\n \"columns\": [\n {\n \"md\": 10,\n \"columnClassName\": \"p-1\",\n \"body\": [\n {\n \"type\": \"search-box\",\n \"name\": \"keywords\",\n \"className\": \"!w-full\",\n \"placeholder\": \"\u641C\u7D22\u83DC\u5355\",\n \"id\": \"s01\"\n }\n ]\n },\n {\n \"md\": 2,\n \"columnClassName\": \"p-1 pl-0 steedos-app-menu-plus\",\n \"body\": [\n {\n \"type\": \"dropdown-button\",\n \"level\": \"link\",\n \"icon\": \"fa fa-plus\",\n \"hideCaret\": true,\n \"align\": \"right\",\n \"buttons\": [\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"Api Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"o_${UUID(6)}\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Creator.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/objects/create_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Creator.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', name: context.oName, label: context.oLabel}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"p_${UUID(6)}\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Creator.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/pages/create_page_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Creator.getRelativeUrl('/api/pageDesign?pageId=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"required\": true,\n \"value\": \"t_${UUID(6)}\",\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"fLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u5916\u90E8\u94FE\u63A5\",\n \"name\": \"fUrl\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Creator.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/tabs/create_link_tab_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', name: context.oName, label: context.fLabel, icon: context.icon, url: context.fUrl}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"divider\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"body\": [\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u9009\u9879\u5361\",\n \"config\": {\n \"type\": \"lookup\",\n \"reference_to\": \"tabs\",\n \"reference_to_field\": \"name\",\n \"required\": true,\n \"sort_no\": 30,\n \"name\": \"tabs\",\n \"multiple\": true,\n \"enable_enhanced_lookup\": true,\n \"amis\": {\n \"label\": false,\n \"embed\": true,\n }\n }\n }\n ],\n \"id\": \"u:709fd4d53437\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:ba7b707cddd8\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:2f3e5635b95d\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"size\": \"md\",\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/update_app_tabs_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', addTabNames: context.tabs}; return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"divider\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5206\u7EC4\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5206\u7EC4\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"\u540D\u79F0\",\n \"name\": \"name\",\n \"id\": \"u:e5bd37f6699b\",\n \"placeholder\": \"\u5206\u7EC4\u540D\u79F0\",\n \"required\": true\n },\n {\n \"type\": \"checkbox\",\n \"option\": \"\u662F\u5426\u9ED8\u8BA4\u5C55\u5F00\",\n \"name\": \"defaultOpen\",\n \"id\": \"u:dae5884c1623\",\n \"required\": true\n }\n ],\n \"id\": \"u:304b5b04c573\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d85\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a05b\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/apps/create_app_group_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, name: context.name, defaultOpen: context.defaultOpen}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n },\n }\n ]\n }\n ]\n }\n ]\n }]\n }\n\n payload.data = {\n \"type\":\"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav,\n \"keyvalues\": \"${ss:keyvalues}\",\n \"allowEditApp\": allowEditApp,\n \"tab_groups\": tab_groups\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 ...editAppSearch,\n {\n \"type\": \"nav\",\n \"searchable\": !allowEditApp && ").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 \"draggable\": allowEditApp,\n \"dragOnSameLevel\": true,\n \"saveOrderApi\": {\n \"url\": \"/service/api/apps/update_app_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"\",\n \"requestAdaptor\": \"const menus = context.data;const tab_groups = [];const tab_items = {};_.each(menus, (menu) => { if (menu.isGroup) { tab_groups.push({ group_name: menu.label, default_open: menu.default_open, }); }else{tab_items[menu.tabApiName] = {group:''}}; if (menu.children) { _.each(menu.children, (menu2) => { tab_items[menu2.tabApiName] = { group: menu.label } }) }}); api.data={appId: context.app.id, tab_groups, tab_items}; return api;\",\n \"messages\": {}\n },\n \"itemActions\": [\n {\n \"type\": \"dropdown-button\",\n \"level\": \"link\",\n \"icon\": \"fa fa-ellipsis-h\",\n \"hideCaret\": true,\n \"className\": \"hidden hover-inline-flex\",\n \"visibleOn\": \"!!allowEditApp\",\n \"buttons\": [\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u7F16\u8F91\u5206\u7EC4\",\n \"data\": {\n \"appId\": \"\\${app.id}\",\n \"name\": \"\\${event.data.label}\",\n \"oldName\": \"\\${event.data.label}\",\n \"defaultOpen\": \"\\${event.data.default_open}\"\n },\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"\u540D\u79F0\",\n \"name\": \"name\",\n \"id\": \"u:e5bd37f6699b\",\n \"placeholder\": \"\u5206\u7EC4\u540D\u79F0\",\n \"required\": true\n },\n {\n \"type\": \"checkbox\",\n \"option\": \"\u662F\u5426\u9ED8\u8BA4\u5C55\u5F00\",\n \"name\": \"defaultOpen\",\n \"id\": \"u:dae5884c1623\",\n \"required\": true\n }\n ],\n \"id\": \"u:304b5b04c573\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d85\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a05b\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/apps/update_app_group_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"\",\n \"requestAdaptor\": \"api.data={appId: context.appId, name: context.name, defaultOpen: context.defaultOpen, oldName: context.oldName}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\",\n \"visibleOn\": \"this.type==='object'\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"window.location.href=Creator.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + event.data.id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href)\"\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\",\n \"visibleOn\": \"this.type==='page'\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const tabs = payload.data.tabs; if(tabs && tabs.length > 0){ try{const pageId = tabs[0].page__expand._id; window.location.href=Creator.getRelativeUrl('/api/pageDesign?pageId=' + pageId +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href)}catch(e){payload.error=e.message;} }; return payload;\",\n \"requestAdaptor\": \"api.data={query: '{ tabs(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id name page page__expand { _id } }}'}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\",\n \"visibleOn\": \"this.type==='url'\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"if(payload.data.tabs && payload.data.tabs.length > 0){payload.data=payload.data.tabs[0]}; return payload\",\n \"requestAdaptor\": \"api.data={query: '{ tabs(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id oName:name fLabel:label fUrl:url icon }}'}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u7F16\u8F91\u5916\u90E8\u94FE\u63A5\",\n \"data\": {\n \"appId\": \"\\${app.id}\",\n \"&\": \"\\${event.data.responseResult}\"\n },\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"required\": true,\n \"disabled\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"fLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u5916\u90E8\u94FE\u63A5\",\n \"name\": \"fUrl\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Creator.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/tabs/update_link_tab_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.appId, groupId: context.label, name: context.oName, label: context.fLabel, icon: context.icon, url: context.fUrl}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u79FB\u52A8\",\n \"visibleOn\": \"!!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"event.setData({appId: event.data.app.id, groups: [{label: event.data.app.name, value: 0, children: _.map(event.data.tab_groups, (tGroup)=>{return {label: tGroup.group_name, value: tGroup.group_name}})}] , tabApiName: event.data.tabApiName, groupName: event.data.groupName})\"\n },\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u79FB\u52A8\",\n \"data\": {\n \"appId\": \"\\${event.data.appId}\",\n \"groups\": \"\\${event.data.groups}\",\n \"tabApiName\": \"\\${event.data.tabApiName}\",\n \"groupName\": \"\\${event.data.groupName}\",\n \"oldGroupName\": \"\\${event.data.groupName}\",\n },\n \"body\": [\n {\n \"type\": \"tree-select\",\n \"label\": \"\",\n \"name\": \"groupName\",\n \"id\": \"u:26d0b458ff51\",\n \"multiple\": false,\n \"source\": \"\\${groups}\"\n }\n ],\n \"id\": \"u:d69cbb95089a\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:12261bf51dcb\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:b144775ea124\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/move_app_tab\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.appId, groupName: context.groupName, oldGroupName: context.oldGroupName, tabName: context.tabApiName}; return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u5220\u9664\",\n \"visibleOn\": \"!!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/delete_app_tab\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, tabName: context.tabApiName};return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n },\n \"id\": \"u:e54eed92d13f\",\n \"confirmText\": \"\u786E\u5B9A\u8981\u5220\u9664\u5417?\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u5220\u9664\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"if(event.data.children && event.data.children.length > 0){doAction({'actionType': 'toast','args': { 'msgType': 'warning', 'msg': '\u5206\u7EC4\u4E0B\u6709\u6570\u636E,\u7981\u6B62\u5220\u9664'}});event.stopPropagation();};\"\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/delete_app_group\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupName: context.label};return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n },\n \"id\": \"u:e54eed92d13f\",\n \"confirmText\": \"\u786E\u5B9A\u8981\u5220\u9664\u5417?\"\n }\n ]\n },\n {\n \"type\": \"dropdown-button\",\n \"level\": \"link\",\n \"icon\": \"fa fa-plus\",\n \"hideCaret\": true,\n \"visibleOn\": \"!!allowEditApp && !!this.isGroup\",\n \"className\": \"hidden hover-inline-flex\",\n \"buttons\": [\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"Api Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"o_${UUID(6)}\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Creator.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/objects/create_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Creator.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, name: context.oName, label: context.oLabel}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"p_${UUID(6)}\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Creator.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/pages/create_page_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Creator.getRelativeUrl('/api/pageDesign?pageId=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"required\": true,\n \"value\": \"t_${UUID(6)}\",\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"fLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u5916\u90E8\u94FE\u63A5\",\n \"name\": \"fUrl\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Creator.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/tabs/create_link_tab_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, name: context.oName, label: context.fLabel, icon: context.icon, url: context.fUrl}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"divider\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"body\": [\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u9009\u9879\u5361\",\n \"config\": {\n \"type\": \"lookup\",\n \"reference_to\": \"tabs\",\n \"reference_to_field\": \"name\",\n \"required\": true,\n \"sort_no\": 30,\n \"name\": \"tabs\",\n \"multiple\": true,\n \"enable_enhanced_lookup\": true,\n \"amis\": {\n \"label\": false,\n \"embed\": true,\n }\n }\n }\n ],\n \"id\": \"u:709fd4d53437\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:ba7b707cddd8\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:2f3e5635b95d\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"size\": \"md\",\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/update_app_tabs_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, addTabNames: context.tabs}; return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n }\n ]\n },\n ],\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 };\n } catch (error) {\n console.log(`error`, error)\n }\n // console.log('payload===2==>', payload)\n return payload;\n "),"headers":{"Authorization":"Bearer ${context.tenantId},${context.authToken}"}}};// console.log(`schema=====>`, schema)
|
|
2626
2626
|
return[2/*return*/,schema];});});};/*
|
|
2627
2627
|
* @Author: baozhoutao@steedos.com
|
|
2628
2628
|
* @Date: 2022-09-01 14:44:57
|