@steedos-widgets/amis-object 6.10.1-beta.19 → 6.10.1-beta.21

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.
@@ -2634,7 +2634,7 @@ return[2/*return*/,{}];});});};/*
2634
2634
  * @LastEditors: baozhoutao@steedos.com
2635
2635
  * @LastEditTime: 2025-02-15 11:25:39
2636
2636
  * @Description:
2637
- */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,"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 hover:bg-[#1589EE1A]","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","visibleOn":"${app_items.length > 9}","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, icon: context.icon}; return api;","adaptor":"window.location.href=Steedos.getRelativeUrl('/app/' + payload.code);return {}","messages":{}},"body":[{"type":"input-text","name":"code","label":"应用唯一标识","value":"a_\${UUID(6)}","required":true,"validateOnChange":true,"validations":{"isVariableName":/^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/}},{"name":"name","type":"input-text","label":"显示名称","required":true},{"type":"steedos-field","label":"图标","config":{"label":"图标","type":"lookup","required":true,"sort_no":30,"optionsFunction":"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }","name":"icon","inlineHelpText":"","description":"","hidden":false,"readonly":false,"disabled":false}}]}]}}],"clearValueOnHidden":false,"visible":true,"messages":{},"api":{"method":"get","cache":"10000","url":"${context.rootUrl}/service/api/apps/menus?mobile="+isMobile,"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;}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/${appId}/menus","sendOn":"!!appId","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 let collapsed = false;\n\n const data = { nav: [] };\n const stacked = ".concat(stacked,";\n let 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(context.appId == context.app.id){\n collapsed = _.includes(document.body.classList, 'sidebar-open') != true;\n }\n // console.log('collapsed', collapsed, document.body.classList, context.appId == context.app.id)\n if(collapsed){\n showIcon = false;\n }\n\n if(payload.allowEditApp && collapsed != true){\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 no-underline group items-center rounded-md'><svg class=\"slds-icon_container slds-icon fill-gray-700 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 \"tabIcon\": tab.icon\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 items-center rounded-md'><svg class=\"slds-icon_container slds-icon fill-gray-700 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 \"tabIcon\": tab.icon\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 no-underline group items-center 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 \"tabIcon\": tab.icon\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 if(allowEditApp){\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\n if(collapsed){\n const collapsedNav = [];\n for(const item of data.nav){\n if(item.isGroup){\n if(collapsedNav.length > 0){\n collapsedNav.push({\n \"mode\": \"divider\"\n })\n }\n for(const childrenItem of item.children){\n collapsedNav.push(Object.assign({}, childrenItem, {\n disabledTip: true,\n label: {\n \"type\": \"tooltip-wrapper\",\n \"content\": childrenItem.label,\n \"placement\": \"right\",\n \"disabled\": true,\n \"body\": [\n {\n 'type': 'tpl',\n 'tpl': '<svg class=\"slds-icon_container slds-icon fill-gray-700 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#' + (childrenItem.tabIcon || 'account') + '\"></use></svg>'\n }\n ]\n }\n \n \n // label: false, \n // icon: '/assets/icons/standard-sprite/svg/symbols.svg#' + (childrenItem.tabIcon || 'account')\n }));\n }\n }else{\n collapsedNav.push(Object.assign({}, item, {\n disabledTip: true,\n label: {\n \"type\": \"tooltip-wrapper\",\n \"content\": childrenItem.label,\n \"placement\": \"right\",\n \"disabled\": true,\n \"body\": [\n {\n 'type': 'tpl',\n 'tpl': '<svg class=\"slds-icon_container slds-icon fill-gray-700 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#' + (item.tabIcon || 'account') + '\"></use></svg>'\n }\n ]\n }\n // label: false, \n // icon: '/assets/icons/standard-sprite/svg/symbols.svg#' + (item.tabIcon || 'account')\n }));\n }\n }\n data.nav = collapsedNav;\n }\n\n let editAppSearch = [];\n if(allowEditApp){\n editAppSearch = [{\n \"type\": \"grid\",\n \"className\": \"ml-3 mr-0\",\n \"columns\": [\n {\n \"md\": 10,\n \"columnClassName\": \"p-0\",\n \"body\": [\n // {\n // \"type\": \"search-box\",\n // \"name\": \"keywords\",\n // \"className\": \"!w-full\",\n // \"placeholder\": \"\u641C\u7D22\u83DC\u5355\",\n // \"autoFocus\": false,\n // \"searchImediately\": true,\n // \"clearable\": true,\n // \"clearAndSubmit\": true,\n // \"id\": \"s01\"\n // }\n {\n \"type\": \"button\",\n \"className\": \"toggle-sidebar\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"document.body.classList.toggle('sidebar-open')\",\n },\n {\n \"actionType\": \"rebuild\",\n \"componentId\": \"u:app-menu\",\n \"args\": {\n \"toggleSidebar\": true\n }\n }\n ]\n }\n },\n \"body\": [\n {\n \"type\": \"steedos-icon\",\n \"category\": \"utility\",\n \"name\": \"rows\",\n \"colorVariant\": \"default\",\n \"id\": \"u:afc3a08e8cf3\",\n \"className\": \"slds-button_icon slds-global-header__icon\"\n }\n ]\n }\n ]\n },\n {\n \"md\": 2,\n \"columnClassName\": \"p0 pl-2 steedos-app-menu-plus\",\n \"body\": [\n {\n \"type\": \"dropdown-button\",\n \"level\": \"link\",\n \"btnClassName\": \"text-gray-700 px-1\",\n \"icon\": \"fa fa-ellipsis-h\",\n \"size\": \"md\",\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 \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\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(Steedos.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=Steedos.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, 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\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 \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\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(Steedos.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=Steedos.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 \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n \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(Steedos.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 \"type\": \"divider\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\u5E94\u7528\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const apps = payload.data.apps; if(apps && apps.length > 0){ return {data: apps[0]} }; return {data: null};\",\n \"requestAdaptor\": \"api.data={query: '{ apps(filters: [\\\"code\\\", \\\"=\\\", ' + context.appId + ']) { _id name}}'}; return api;\"\n }\n },\n {\n \"actionType\": \"drawer\",\n \"drawer\": {\n \"type\": \"drawer\",\n \"title\": \"&nbsp;\",\n \"headerClassName\": \"hidden\",\n \"size\": \"lg\",\n \"width\": window.drawerWidth || \"70%\",\n \"bodyClassName\": \"p-0 m-0 bg-gray-100\",\n \"closeOnEsc\": true,\n \"closeOnOutside\": true,\n \"resizable\": true,\n \"actions\": [],\n \"body\": {\n \"type\": \"service\",\n \"id\": \"u:1678e148c8d2\",\n \"messages\": {},\n \"schemaApi\": {\n \"url\": \"/api/pageSchema/app?objectApiName=apps&formFactor=LARGE&formFactor=LARGE\",\n \"method\": \"get\",\n \"adaptor\": \"const schema = {type: 'steedos-record-detail'}; schema.data={objectName: 'apps', _inDrawer: true, recordLoaded: false}; schema.objectApiName='apps'; schema.recordId=context.responseData._id; console.log('schema', schema); return {data: schema};\"\n }\n },\n \"className\": \"steedos-record-detail-drawer app-popover\",\n \"id\": \"u:fc5f055afa8c\"\n },\n \"preventDefault\": true\n }\n ]\n }\n }\n }\n ]\n }\n ]\n }\n ]\n }]\n }else{\n editAppSearch = [{\n \"type\": \"button\",\n \"className\": \"toggle-sidebar text-center w-[60px]\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"document.body.classList.toggle('sidebar-open')\",\n },\n {\n \"actionType\": \"rebuild\",\n \"componentId\": \"u:app-menu\",\n \"args\": {\n \"toggleSidebar\": true\n }\n }\n ]\n }\n },\n \"body\": [\n {\n \"type\": \"steedos-icon\",\n \"category\": \"utility\",\n \"name\": \"rows\",\n \"colorVariant\": \"default\",\n \"id\": \"u:afc3a08e8cf3\",\n \"className\": \"slds-button_icon slds-global-header__icon\"\n }\n ]\n }]\n }\n\n let menuItems = data.nav;\n\n if(context.keywords){\n // \u5982\u679CmenuItem\u7684children, children\u662F\u6570\u7EC4\u7ED3\u6784, \u6BCF\u4E00\u9879\u7684searchKey\u5305\u542Bcontext.keywords, \u5219\u663E\u793AmenuItem\u53CA\u5176\u7B26\u5408\u6761\u4EF6\u7684children;\n menuItems = _.filter(menuItems, (menuItem)=>{\n if(menuItem.children){\n const children = _.filter(menuItem.children, (child)=>{\n return _.includes(child.searchKey, context.keywords);\n });\n\n if(children.length > 0){\n menuItem.children = children;\n }\n\n return children.length > 0;\n }\n })\n };\n\n if(!menuItems || menuItems.length == 0){\n menuItems = data.nav;\n }\n\n payload.data = {\n \"type\":\"service\",\n \"className\": \"steedos-app-service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": menuItems,\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 \"expandPosition\": \"after\",\n \"collapsed\": collapsed,\n \"searchable\": false,\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 \"btnClassName\": \"!text-gray-700\",\n \"visibleOn\": \"!!allowEditApp\",\n \"className\": \"hidden hover-inline-flex px-1\",\n \"buttons\": [\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"visibleOn\": \"!!this.isGroup\",\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 \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\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(Steedos.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=Steedos.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, 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\u5FAE\u9875\u9762\",\n \"visibleOn\": \"!!this.isGroup\",\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 \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\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(Steedos.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=Steedos.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 \"visibleOn\": \"!!this.isGroup\",\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 \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\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(Steedos.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 \"visibleOn\": \"!!this.isGroup\",\n },\n {\n \"type\": \"button\",\n \"label\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"visibleOn\": \"!!this.isGroup\",\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 \"type\": \"divider\",\n \"visibleOn\": \"!!this.isGroup\",\n },\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=Steedos.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + event.data.id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href)\",\n \"expression\": \"${false}\"\n },\n {\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const objects = payload.data.objects; if(objects && objects.length > 0){ return {data: objects[0]} }; return {data: null};\",\n \"requestAdaptor\": \"api.data={query: '{ objects(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id name}}'}; return api;\"\n }\n },\n {\n \"actionType\": \"drawer\",\n \"drawer\": {\n \"type\": \"drawer\",\n \"title\": \"&nbsp;\",\n \"headerClassName\": \"hidden\",\n \"size\": \"lg\",\n \"width\": window.drawerWidth || \"70%\",\n \"bodyClassName\": \"p-0 m-0 bg-gray-100\",\n \"closeOnEsc\": true,\n \"closeOnOutside\": true,\n \"resizable\": true,\n \"actions\": [],\n \"body\": {\n \"type\": \"service\",\n \"id\": \"u:1678e148c8d2\",\n \"messages\": {},\n \"schemaApi\": {\n \"url\": \"/api/pageSchema/record?objectApiName=objects&formFactor=LARGE\",\n \"method\": \"get\",\n \"adaptor\": \"const schema = JSON.parse(payload.schema); schema.data={objectName: 'objects', _inDrawer: true, recordLoaded: false}; schema.objectApiName='objects'; schema.recordId=context.responseData._id; return {data: schema};\"\n }\n },\n \"className\": \"steedos-record-detail-drawer app-popover\",\n \"id\": \"u:fc5f055afa8c\"\n },\n \"preventDefault\": true\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"expression\": \"${false}\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const objects = payload.data.objects; if(objects && objects.length > 0){ try{const objectId = objects[0]._id; navigate('/app/admin/objects/view/'+objectId+'?side_object=objects&side_listview_id=all')}catch(e){payload.error=e.message;} }; return payload;\",\n \"requestAdaptor\": \"api.data={query: '{ objects(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id name}}'}; return api;\",\n \"messages\": {}\n }\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=Steedos.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(Steedos.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 \"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 setTimeout(function(){\n $(\"[name='keywords']\").focus();\n }, 300);\n // console.log('AmisAppMenu AmisAppMenu=====>', payload)\n return payload;\n ")}};// console.log(`AmisAppMenu schema=====>`, schema)
2637
+ */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,"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 hover:bg-[#1589EE1A]","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","visibleOn":"${app_items.length > 9}","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, icon: context.icon}; return api;","adaptor":"window.location.href=Steedos.getRelativeUrl('/app/' + payload.code);return {}","messages":{}},"body":[{"type":"input-text","name":"code","label":"应用唯一标识","value":"a_\${UUID(6)}","required":true,"validateOnChange":true,"validations":{"isVariableName":/^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/}},{"name":"name","type":"input-text","label":"显示名称","required":true},{"type":"steedos-field","label":"图标","config":{"label":"图标","type":"lookup","required":true,"sort_no":30,"optionsFunction":"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }","name":"icon","inlineHelpText":"","description":"","hidden":false,"readonly":false,"disabled":false}}]}]}}],"clearValueOnHidden":false,"visible":true,"messages":{},"api":{"method":"get","cache":"10000","url":"${context.rootUrl}/service/api/apps/menus?mobile="+isMobile,"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),visibleOn:'${!!appId}'}],__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),visibleOn:'${!!appId}'}],__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;}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/${appId}/menus","sendOn":"!!appId","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 let collapsed = false;\n\n const data = { nav: [] };\n const stacked = ".concat(stacked,";\n let 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(context.appId == context.app.id){\n collapsed = _.includes(document.body.classList, 'sidebar-open') != true;\n }\n // console.log('collapsed', collapsed, document.body.classList, context.appId == context.app.id)\n if(collapsed){\n showIcon = false;\n }\n\n if(payload.allowEditApp && collapsed != true){\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 no-underline group items-center rounded-md'><svg class=\"slds-icon_container slds-icon fill-gray-700 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 \"tabIcon\": tab.icon\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 items-center rounded-md'><svg class=\"slds-icon_container slds-icon fill-gray-700 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 \"tabIcon\": tab.icon\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 no-underline group items-center 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 \"tabIcon\": tab.icon\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 if(allowEditApp){\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\n if(collapsed){\n const collapsedNav = [];\n for(const item of data.nav){\n if(item.isGroup){\n if(collapsedNav.length > 0){\n collapsedNav.push({\n \"mode\": \"divider\"\n })\n }\n for(const childrenItem of item.children){\n collapsedNav.push(Object.assign({}, childrenItem, {\n disabledTip: true,\n label: {\n \"type\": \"tooltip-wrapper\",\n \"content\": childrenItem.label,\n \"placement\": \"right\",\n \"disabled\": true,\n \"body\": [\n {\n 'type': 'tpl',\n 'tpl': '<svg class=\"slds-icon_container slds-icon fill-gray-700 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#' + (childrenItem.tabIcon || 'account') + '\"></use></svg>'\n }\n ]\n }\n \n \n // label: false, \n // icon: '/assets/icons/standard-sprite/svg/symbols.svg#' + (childrenItem.tabIcon || 'account')\n }));\n }\n }else{\n collapsedNav.push(Object.assign({}, item, {\n disabledTip: true,\n label: {\n \"type\": \"tooltip-wrapper\",\n \"content\": childrenItem.label,\n \"placement\": \"right\",\n \"disabled\": true,\n \"body\": [\n {\n 'type': 'tpl',\n 'tpl': '<svg class=\"slds-icon_container slds-icon fill-gray-700 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#' + (item.tabIcon || 'account') + '\"></use></svg>'\n }\n ]\n }\n // label: false, \n // icon: '/assets/icons/standard-sprite/svg/symbols.svg#' + (item.tabIcon || 'account')\n }));\n }\n }\n data.nav = collapsedNav;\n }\n\n let editAppSearch = [];\n if(allowEditApp){\n editAppSearch = [{\n \"type\": \"grid\",\n \"className\": \"ml-3 mr-0\",\n \"columns\": [\n {\n \"md\": 10,\n \"columnClassName\": \"p-0\",\n \"body\": [\n // {\n // \"type\": \"search-box\",\n // \"name\": \"keywords\",\n // \"className\": \"!w-full\",\n // \"placeholder\": \"\u641C\u7D22\u83DC\u5355\",\n // \"autoFocus\": false,\n // \"searchImediately\": true,\n // \"clearable\": true,\n // \"clearAndSubmit\": true,\n // \"id\": \"s01\"\n // }\n {\n \"type\": \"button\",\n \"className\": \"toggle-sidebar\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"document.body.classList.toggle('sidebar-open')\",\n },\n {\n \"actionType\": \"rebuild\",\n \"componentId\": \"u:app-menu\",\n \"args\": {\n \"toggleSidebar\": true\n }\n }\n ]\n }\n },\n \"body\": [\n {\n \"type\": \"steedos-icon\",\n \"category\": \"utility\",\n \"name\": \"rows\",\n \"colorVariant\": \"default\",\n \"id\": \"u:afc3a08e8cf3\",\n \"className\": \"slds-button_icon slds-global-header__icon\"\n }\n ]\n }\n ]\n },\n {\n \"md\": 2,\n \"columnClassName\": \"p0 pl-2 steedos-app-menu-plus\",\n \"body\": [\n {\n \"type\": \"dropdown-button\",\n \"level\": \"link\",\n \"btnClassName\": \"text-gray-700 px-1\",\n \"icon\": \"fa fa-ellipsis-h\",\n \"size\": \"md\",\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 \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\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(Steedos.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=Steedos.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, 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\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 \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\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(Steedos.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=Steedos.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 \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n \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(Steedos.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 \"type\": \"divider\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\u5E94\u7528\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const apps = payload.data.apps; if(apps && apps.length > 0){ return {data: apps[0]} }; return {data: null};\",\n \"requestAdaptor\": \"api.data={query: '{ apps(filters: [\\\"code\\\", \\\"=\\\", ' + context.appId + ']) { _id name}}'}; return api;\"\n }\n },\n {\n \"actionType\": \"drawer\",\n \"drawer\": {\n \"type\": \"drawer\",\n \"title\": \"&nbsp;\",\n \"headerClassName\": \"hidden\",\n \"size\": \"lg\",\n \"width\": window.drawerWidth || \"70%\",\n \"bodyClassName\": \"p-0 m-0 bg-gray-100\",\n \"closeOnEsc\": true,\n \"closeOnOutside\": true,\n \"resizable\": true,\n \"actions\": [],\n \"body\": {\n \"type\": \"service\",\n \"id\": \"u:1678e148c8d2\",\n \"messages\": {},\n \"schemaApi\": {\n \"url\": \"/api/pageSchema/app?objectApiName=apps&formFactor=LARGE&formFactor=LARGE\",\n \"method\": \"get\",\n \"adaptor\": \"const schema = {type: 'steedos-record-detail'}; schema.data={objectName: 'apps', _inDrawer: true, recordLoaded: false}; schema.objectApiName='apps'; schema.recordId=context.responseData._id; console.log('schema', schema); return {data: schema};\"\n }\n },\n \"className\": \"steedos-record-detail-drawer app-popover\",\n \"id\": \"u:fc5f055afa8c\"\n },\n \"preventDefault\": true\n }\n ]\n }\n }\n }\n ]\n }\n ]\n }\n ]\n }]\n }else if(stacked){\n editAppSearch = [{\n \"type\": \"button\",\n \"className\": \"toggle-sidebar text-center w-[60px]\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"document.body.classList.toggle('sidebar-open')\",\n },\n {\n \"actionType\": \"rebuild\",\n \"componentId\": \"u:app-menu\",\n \"args\": {\n \"toggleSidebar\": true\n }\n }\n ]\n }\n },\n \"body\": [\n {\n \"type\": \"steedos-icon\",\n \"category\": \"utility\",\n \"name\": \"rows\",\n \"colorVariant\": \"default\",\n \"id\": \"u:afc3a08e8cf3\",\n \"className\": \"slds-button_icon slds-global-header__icon\"\n }\n ]\n }]\n }\n\n let menuItems = data.nav;\n\n if(context.keywords){\n // \u5982\u679CmenuItem\u7684children, children\u662F\u6570\u7EC4\u7ED3\u6784, \u6BCF\u4E00\u9879\u7684searchKey\u5305\u542Bcontext.keywords, \u5219\u663E\u793AmenuItem\u53CA\u5176\u7B26\u5408\u6761\u4EF6\u7684children;\n menuItems = _.filter(menuItems, (menuItem)=>{\n if(menuItem.children){\n const children = _.filter(menuItem.children, (child)=>{\n return _.includes(child.searchKey, context.keywords);\n });\n\n if(children.length > 0){\n menuItem.children = children;\n }\n\n return children.length > 0;\n }\n })\n };\n\n if(!menuItems || menuItems.length == 0){\n menuItems = data.nav;\n }\n\n payload.data = {\n \"type\":\"service\",\n \"className\": \"steedos-app-service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": menuItems,\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 \"expandPosition\": \"after\",\n \"collapsed\": collapsed,\n \"searchable\": false,\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 \"btnClassName\": \"!text-gray-700\",\n \"visibleOn\": \"!!allowEditApp\",\n \"className\": \"hidden hover-inline-flex px-1\",\n \"buttons\": [\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"visibleOn\": \"!!this.isGroup\",\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 \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\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(Steedos.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=Steedos.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, 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\u5FAE\u9875\u9762\",\n \"visibleOn\": \"!!this.isGroup\",\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 \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\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(Steedos.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=Steedos.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 \"visibleOn\": \"!!this.isGroup\",\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 \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\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(Steedos.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 \"visibleOn\": \"!!this.isGroup\",\n },\n {\n \"type\": \"button\",\n \"label\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"visibleOn\": \"!!this.isGroup\",\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 \"type\": \"divider\",\n \"visibleOn\": \"!!this.isGroup\",\n },\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=Steedos.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + event.data.id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href)\",\n \"expression\": \"${false}\"\n },\n {\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const objects = payload.data.objects; if(objects && objects.length > 0){ return {data: objects[0]} }; return {data: null};\",\n \"requestAdaptor\": \"api.data={query: '{ objects(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id name}}'}; return api;\"\n }\n },\n {\n \"actionType\": \"drawer\",\n \"drawer\": {\n \"type\": \"drawer\",\n \"title\": \"&nbsp;\",\n \"headerClassName\": \"hidden\",\n \"size\": \"lg\",\n \"width\": window.drawerWidth || \"70%\",\n \"bodyClassName\": \"p-0 m-0 bg-gray-100\",\n \"closeOnEsc\": true,\n \"closeOnOutside\": true,\n \"resizable\": true,\n \"actions\": [],\n \"body\": {\n \"type\": \"service\",\n \"id\": \"u:1678e148c8d2\",\n \"messages\": {},\n \"schemaApi\": {\n \"url\": \"/api/pageSchema/record?objectApiName=objects&formFactor=LARGE\",\n \"method\": \"get\",\n \"adaptor\": \"const schema = JSON.parse(payload.schema); schema.data={objectName: 'objects', _inDrawer: true, recordLoaded: false}; schema.objectApiName='objects'; schema.recordId=context.responseData._id; return {data: schema};\"\n }\n },\n \"className\": \"steedos-record-detail-drawer app-popover\",\n \"id\": \"u:fc5f055afa8c\"\n },\n \"preventDefault\": true\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"expression\": \"${false}\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const objects = payload.data.objects; if(objects && objects.length > 0){ try{const objectId = objects[0]._id; navigate('/app/admin/objects/view/'+objectId+'?side_object=objects&side_listview_id=all')}catch(e){payload.error=e.message;} }; return payload;\",\n \"requestAdaptor\": \"api.data={query: '{ objects(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id name}}'}; return api;\",\n \"messages\": {}\n }\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=Steedos.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(Steedos.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 \"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 setTimeout(function(){\n $(\"[name='keywords']\").focus();\n }, 300);\n // console.log('AmisAppMenu AmisAppMenu=====>', payload)\n return payload;\n ")}};// console.log(`AmisAppMenu schema=====>`, schema)
2638
2638
  return[2/*return*/,schema];});});};/*
2639
2639
  * @Author: baozhoutao@steedos.com
2640
2640
  * @Date: 2022-09-01 14:44:57
@@ -2668,7 +2668,7 @@ return[2/*return*/,schema];});});};/*
2668
2668
  * @LastEditTime: 2025-03-03 09:13:37
2669
2669
  * @Description:
2670
2670
  */var AmisGlobalHeader=function AmisGlobalHeader(props){return __awaiter(void 0,void 0,void 0,function(){var logoSrc,customButtons,className,isMobile,schema;return __generator(this,function(_a){logoSrc=props.logoSrc,customButtons=props.customButtons,className=props.className;isMobile=window.innerWidth<=768;schema={"type":"wrapper","className":'p-0'+(className?" ".concat(className):''),body:[{"type":"wrapper","className":"bg-white sticky p-0 top-0 z-40 w-full flex-none backdrop-blur transition-colors duration-500 lg:z-[1000] border-b-[3px] border-sky-500 border-solid steedos-header-container",body:[{"type":"wrapper","className":'flex w-full px-4 h-[50px] p-0 justify-between items-center steedos-header-container-line-one',"body":[{type:"service",className:'p-0 flex flex-1 items-center',"onEvent":{"@history_paths.changed":{"actions":[{"actionType":"reload",// amis 3.6需要传入data来触发下面的window:historyPaths重新计算
2671
- "data":{}}]}},body:[{"type":"button","className":"toggle-sidebar flex items-center pr-4","hiddenOn":"true","onEvent":{"click":{"actions":[{"actionType":"custom","script":"document.body.classList.toggle('sidebar-open')"}]}},"body":[{"type":"steedos-icon","category":"utility","name":"rows","colorVariant":"default","id":"u:afc3a08e8cf3","className":"slds-button_icon slds-global-header__icon"}]},{"type":"button","visibleOn":"${window:innerWidth < 768 && (window:historyPaths.length > 1 || window:historyPaths[0].params.record_id)}","className":"flex","onEvent":{"click":{"actions":[{"actionType":"custom","script":"window.goBack()"}]}},"body":[{"type":"steedos-icon","category":"utility","name":"chevronleft","colorVariant":"default","className":"slds-button_icon slds-global-header__icon"}]},{"className":'block h-10 w-auto mr-4',"type":"tpl","tpl":"<a href='/app' class='flex items-center '><img class='block h-10 w-auto' src='".concat(logoSrc,"'></a>"),"hiddenOn":"${window:innerWidth < 768 && (window:historyPaths.length > 1 || window:historyPaths[0].params.record_id)}"}]},{"type":"steedos-global-header-toolbar","label":"Global Header",className:'flex flex-nowrap gap-x-3 items-center',logoutScript:"window.signOut();",customButtons:customButtons}]},{"type":"grid","className":'steedos-context-bar flex flex-nowrap h-10 leading-5 pl-5 mb-[-3px] steedos-header-container-line-two',"hiddenOn":"${"+isMobile+"}","columns":[{"columnClassName":"items-center flex pb-0","body":[{"type":"steedos-app-launcher","showAppName":true,"appId":"${app.id}"}],"md":"auto","valign":"middle"},{"columnClassName":"flex overflow-hidden","hiddenOn":"${app.showSidebar === true}","body":[{"visibleOn":"${AND(!app.showSidebar,!"+isMobile+")}","type":"steedos-app-menu","stacked":false,showIcon:false,"appId":"${app.id}",overflow:{enable:false,itemWidth:80},"id":"u:77851eb4aa89"}],"id":"u:5367229505d8","md":"","valign":"middle"}]}]},{"type":"button","className":'p-0 absolute inset-0 mt-[50px] sm:mt-[90px]',hiddenOn:"${OR(app.showSidebar != true,isMobile)}",body:[{type:"wrapper",className:'sidebar-wrapper px-0 py-3 pb-16 fixed z-20 h-full h-fill ease-in-out duration-300 flex flex-col border-r overflow-y-auto bg-gray-100 border-gray-300 block -translate-x-0 sm:w-[220px] w-64',body:[{"type":"steedos-app-launcher","className":"px-4 pb-4","visibleOn":"${isMobile}","showAppName":true},{"type":"steedos-app-menu","stacked":true,"appId":"${app.id}"}]},{"type":"wrapper","className":'sidebar-overlay',"hiddenOn":"${!isMobile}"}],"onEvent":{"click":{"actions":[{"actionType":"custom","script":"if(window.innerWidth < 768){ document.body.classList.remove('sidebar-open'); }"}]}}}]};return[2/*return*/,schema];});});};var defaultImageValue="data:image/svg+xml,%3C%3Fxml version='1.0' standalone='no'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg t='1631083237695' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='2420' xmlns:xlink='http://www.w3.org/1999/xlink' width='1024' height='1024'%3E%3Cdefs%3E%3Cstyle type='text/css'%3E%3C/style%3E%3C/defs%3E%3Cpath d='M959.872 128c0.032 0.032 0.096 0.064 0.128 0.128v767.776c-0.032 0.032-0.064 0.096-0.128 0.128H64.096c-0.032-0.032-0.096-0.064-0.128-0.128V128.128c0.032-0.032 0.064-0.096 0.128-0.128h895.776zM960 64H64C28.8 64 0 92.8 0 128v768c0 35.2 28.8 64 64 64h896c35.2 0 64-28.8 64-64V128c0-35.2-28.8-64-64-64z' p-id='2421' fill='%23bfbfbf'%3E%3C/path%3E%3Cpath d='M832 288c0 53.024-42.976 96-96 96s-96-42.976-96-96 42.976-96 96-96 96 42.976 96 96zM896 832H128V704l224-384 256 320h64l224-192z' p-id='2422' fill='%23bfbfbf'%3E%3C/path%3E%3C/svg%3E";var AmisFormInputs=['text','date',// 'file',
2671
+ "data":{}}]}},body:[{"type":"button","className":"toggle-sidebar flex items-center pr-4","hiddenOn":"true","onEvent":{"click":{"actions":[{"actionType":"custom","script":"document.body.classList.toggle('sidebar-open')"}]}},"body":[{"type":"steedos-icon","category":"utility","name":"rows","colorVariant":"default","id":"u:afc3a08e8cf3","className":"slds-button_icon slds-global-header__icon"}]},{"type":"button","visibleOn":"${window:innerWidth < 768 && (window:historyPaths.length > 1 || window:historyPaths[0].params.record_id)}","className":"flex","onEvent":{"click":{"actions":[{"actionType":"custom","script":"window.goBack()"}]}},"body":[{"type":"steedos-icon","category":"utility","name":"chevronleft","colorVariant":"default","className":"slds-button_icon slds-global-header__icon"}]},{"className":'block h-10 w-auto mr-4',"type":"tpl","tpl":"<a href='/app' class='flex items-center '><img class='block h-10 w-auto' src='".concat(logoSrc,"'></a>"),"hiddenOn":"${window:innerWidth < 768 && (window:historyPaths.length > 1 || window:historyPaths[0].params.record_id)}"}]},{"type":"steedos-global-header-toolbar","label":"Global Header",className:'flex flex-nowrap gap-x-3 items-center',logoutScript:"window.signOut();",customButtons:customButtons}]},{"type":"grid","className":'steedos-context-bar flex flex-nowrap h-10 leading-5 pl-5 mb-[-3px] steedos-header-container-line-two',"hiddenOn":"${"+isMobile+"}","columns":[{"columnClassName":"items-center flex pb-0","body":[{"type":"steedos-app-launcher","showAppName":true,"appId":"${app.id}"}],"md":"auto","valign":"middle"},{"columnClassName":"flex overflow-hidden","hiddenOn":"${app.showSidebar === true}","body":[{"visibleOn":"${AND(!app.showSidebar,!"+isMobile+")}","type":"steedos-app-menu","stacked":false,showIcon:false,"appId":"${app.id}",overflow:{enable:false,itemWidth:80},"id":"u:77851eb4aa89"}],"id":"u:5367229505d8","md":"","valign":"middle"}]}]},{"type":"button","className":'p-0 absolute inset-0 mt-[50px] sm:mt-[90px]',hiddenOn:"${OR(app.showSidebar != true,isMobile)}",body:[{type:"wrapper",className:'sidebar-wrapper px-0 py-3 pb-16 fixed z-20 h-full h-fill ease-in-out duration-300 flex flex-col border-r overflow-y-auto bg-gray-100 border-gray-300 block -translate-x-0 sm:w-[220px] w-64',visibleOn:'${!!appId}',body:[{"type":"steedos-app-launcher","className":"px-4 pb-4","visibleOn":"${isMobile}","showAppName":true},{"type":"steedos-app-menu","stacked":true,"appId":"${app.id}"}]},{"type":"wrapper","className":'sidebar-overlay',"hiddenOn":"${!isMobile}"}],"onEvent":{"click":{"actions":[{"actionType":"custom","script":"if(window.innerWidth < 768){ document.body.classList.remove('sidebar-open'); }"}]}}}]};return[2/*return*/,schema];});});};var defaultImageValue="data:image/svg+xml,%3C%3Fxml version='1.0' standalone='no'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg t='1631083237695' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='2420' xmlns:xlink='http://www.w3.org/1999/xlink' width='1024' height='1024'%3E%3Cdefs%3E%3Cstyle type='text/css'%3E%3C/style%3E%3C/defs%3E%3Cpath d='M959.872 128c0.032 0.032 0.096 0.064 0.128 0.128v767.776c-0.032 0.032-0.064 0.096-0.128 0.128H64.096c-0.032-0.032-0.096-0.064-0.128-0.128V128.128c0.032-0.032 0.064-0.096 0.128-0.128h895.776zM960 64H64C28.8 64 0 92.8 0 128v768c0 35.2 28.8 64 64 64h896c35.2 0 64-28.8 64-64V128c0-35.2-28.8-64-64-64z' p-id='2421' fill='%23bfbfbf'%3E%3C/path%3E%3Cpath d='M832 288c0 53.024-42.976 96-96 96s-96-42.976-96-96 42.976-96 96-96 96 42.976 96 96zM896 832H128V704l224-384 256 320h64l224-192z' p-id='2422' fill='%23bfbfbf'%3E%3C/path%3E%3C/svg%3E";var AmisFormInputs=['text','date',// 'file',
2672
2672
  // "avatar",
2673
2673
  // 'image',
2674
2674
  'datetime','time','number',// 'password',
@@ -2685,7 +2685,7 @@ if(typeof props.label==="string"||props.label===false){// 始终优先取组件
2685
2685
  steedosField.label=props.label;}if(!fStatic&&steedosField.readonly&&!props.data.hasOwnProperty("_display")){// 字段配置为只读,强制走fStatic模式,加上_display判断是为了不影响历史代码,比如直接在ObjectForm中调用steedos-field组件
2686
2686
  fStatic=true;}_6.label=1;case 1:_6.trys.push([1,22,,23]);if(!(fStatic&&(steedosField.type==='lookup'||steedosField.type==='master_detail')))return[3/*break*/,16];lookupATagClick='onclick="return false;"';if(window.innerWidth<768){lookupATagClick="";}defaultSource={"method":"post","url":"${context.rootUrl}/graphql","requestAdaptor":"\n var steedosField = ".concat(JSON.stringify(steedosField),";\n // console.log('defaultSource====>steedosField', steedosField);\n var objectName, filters, valueFieldKey, labelFieldKey;\n if(_.isString(steedosField.reference_to)){\n // reference_to\u4E3A\u5355\u9009\n const referenceTo = getReferenceToSync(steedosField);\n const referenceToField = steedosField.reference_to_field || '_id';\n\n objectName = referenceTo.objectName\n valueFieldKey = referenceTo && referenceTo.valueField?.name || '_id' ;\n labelFieldKey = referenceTo && referenceTo.labelField?.name || 'name';\n let value = _.get(api.data, steedosField.name);\n if(_.isString(value)){\n value = [value]\n }\n filters = [referenceToField, \"in\", value || []];\n if(objectName == \"object_fields\" || objectName == \"object_actions\"){\n //\u5BF9\u8C61\u4E3Aobject_fields\u65F6\uFF0C\u5FC5\u987B\u52A0\u4E0Aobject\u7684\u8FC7\u6EE4\u6761\u4EF6\n const filtersFunction = ").concat(steedosField.filtersFunction||steedosField._filtersFunction,";\n if(filtersFunction){\n const _filters = filtersFunction(filters, api.data);\n if(_filters && _filters.length > 0){\n filters = [filters,_filters]\n }\n }\n }\n }else{\n // reference_to\u4E3A\u591A\u9009\n const _steedosField = {\n ...steedosField,\n reference_to: api.data[steedosField.name].o\n }\n const referenceTo = getReferenceToSync(_steedosField);\n const referenceToField = _steedosField.reference_to_field || '_id';\n\n objectName = referenceTo.objectName\n valueFieldKey = referenceTo && referenceTo.valueField?.name || '_id' ;\n labelFieldKey = referenceTo && referenceTo.labelField?.name || 'name';\n let value = api.data[_steedosField.name] && api.data[_steedosField.name].ids;\n filters = [referenceToField, \"in\", value || []];\n }\n\n // \u989D\u5916\u8FD4\u56DE_id\u5B57\u6BB5\n api.data = {\n query: '{options:' + objectName + '(filters: ' + JSON.stringify(filters) + '){label: ' + labelFieldKey + ',value: ' + valueFieldKey + ', _id}}'\n }\n return api;\n "),"trackExpression":"${"+steedosField.name+"}","cache":3000};if(!steedosField.reference_to){// 兼容lookup字段未配置reference_to属性的情况,当普通下拉框字段用
2687
2687
  defaultSource={"url":"${context.rootUrl}/api/v1/spaces/none",data:{$:"$$"}};if(steedosField.optionsFunction||steedosField._optionsFunction){defaultSource.adaptor="\n var options = eval(".concat(steedosField.optionsFunction||steedosField._optionsFunction,")(api.body.$);\n if(api.body.$term){\n options = _.filter(options, function(o) {\n var label = o.label;\n return label.toLowerCase().indexOf(api.body.$term.toLowerCase()) > -1;\n });\n }\n if(!payload.data){\n payload.data = {};\n }\n payload.data.options = options;\n return payload;\n ");}else if(steedosField.options){defaultSource.adaptor="\n var options = ".concat(JSON.stringify(steedosField.options),"\n if(api.body.$term){\n options = _.filter(options, function(o) {\n var label = o.label;\n return label.toLowerCase().indexOf(api.body.$term.toLowerCase()) > -1;\n });\n }\n if(!payload.data){\n payload.data = {};\n }\n payload.data.options = options;\n return payload;\n ");}}source=((_0=steedosField.amis)===null||_0===void 0?void 0:_0.source)||((_1=steedosField.amis)===null||_1===void 0?void 0:_1.autoComplete)||defaultSource;fieldBaseProps={multiple:steedosField.multiple,name:steedosField.name,label:steedosField.label,"static":true,required:steedosField.required,className:"".concat(className||''," ").concat(((_2=steedosField.amis)===null||_2===void 0?void 0:_2.className)||'')};if(!inInputTable)return[3/*break*/,2];fieldBaseProps=Object.assign({},fieldBaseProps,{type:'select',source:source});return[3/*break*/,15];case 2:referenceTo_1=steedosField.reference_to;if(!referenceTo_1)return[3/*break*/,14];if(_$1.isArray(referenceTo_1)){fieldValue=(_3=props.data)===null||_3===void 0?void 0:_3[steedosField.name];if(fieldValue&&fieldValue.o){referenceTo_1=fieldValue.o;}else{referenceTo_1=referenceTo_1[0];}}steedosField.reference_to_field;if(referenceTo_1==='users'){referenceTo_1='space_users';}return[4/*yield*/,_getUISchema2(referenceTo_1)];case 3:fieldRefObject=_6.sent();if(!(props.data._display&&_$1.has(props.data._display,steedosField.name)))return[3/*break*/,7];_e=(_d=Object).assign;_f=[{},fieldBaseProps];_p={type:'control',name:null};_q={type:'wrapper',className:"steedos-field-lookup-wrapper p-0","wrapWithPanel":false,"actions":[],visibleOn:"${_display.".concat(steedosField.name,"}")};_r={type:'each',placeholder:"",className:"steedos-field-lookup-each flex flex-wrap gap-2",source:"${_display.".concat(steedosField.name,"|asArray}")};_s={type:'static',labelClassName:"hidden",label:false,className:'m-0',tpl:"<a href=\"/app/-/${objectName}/view/${value}\" target=\"_blank\" ".concat(lookupATagClick,">${label}</a>"),popOver:fieldRefObject.compactLayouts&&window.innerWidth>=768?{"trigger":"hover","className":"steedos-record-detail-popover","position":"left-bottom","showIcon":false,"title":false,"offset":{"top":0,"left":20},"body":[{"type":"steedos-record-mini","objectApiName":"${objectName}","recordId":"${value}","showButtons":false,"showBackButton":false,"data":{"objectName":"${objectName}","recordId":"${value}"}}]}:null};if(!(window.innerWidth<768))return[3/*break*/,4];_g=null;return[3/*break*/,6];case 4:return[4/*yield*/,getLookupLinkOnClick(steedosField,{appId:appId,objectName:referenceTo_1,formFactor:formFactor})];case 5:_g=_6.sent();_6.label=6;case 6:fieldBaseProps=_e.apply(_d,_f.concat([(_p.body=[(_q.body=[(_r.items=(// onEvent: window.innerWidth < 768 ? null : REFERENCE_VALUE_ITEM_ONCLICK
2688
- _s.onEvent=_g,_s),_r)],_q),{type:'static',tpl:'-',className:"".concat(fieldBaseProps.className||''," text-muted !border-b-0"),hiddenOn:"${_display.".concat(steedosField.name,"}")},{type:'tpl',tpl:"<span class='antd-TplField antd-Form-description'><span>".concat(steedosField.description,"</span></span>")}],_p)]));return[3/*break*/,13];case 7:return[4/*yield*/,env.fetcher(source,props.data)];case 8:res=_6.sent();valueOptions_1=((_4=res===null||res===void 0?void 0:res.data)===null||_4===void 0?void 0:_4.options)||[];fieldValue=(_5=props.data)===null||_5===void 0?void 0:_5[steedosField.name];values=fieldValue;if(_$1.isString(values)){values=[values];}if(!(values&&values.length>0))return[3/*break*/,12];disPlayValue_1=[];_$1.each(values,function(value){var option=valueOptions_1.find(function(item){return item.value===value;});if(option){disPlayValue_1.push({objectName:referenceTo_1,value:option._id||option.value,label:option.label});}});_j=(_h=Object).assign;_k=[{},fieldBaseProps];_t={type:'control',name:null};_u={type:'form',className:"steedos-field-lookup-wrapper p-0","wrapWithPanel":false,"actions":[],data:(_v={},_v[steedosField.name]=disPlayValue_1,_v)};_w={type:'each',placeholder:"",className:"steedos-field-lookup-each flex flex-wrap gap-2",source:"${".concat(steedosField.name,"}")};_x={type:'static',className:'m-0',tpl:"<a href=\"/app/-/${objectName}/view/${value}\" target=\"_blank\" ".concat(lookupATagClick,">${label}</a>"),popOver:fieldRefObject.compactLayouts&&window.innerWidth>=768?{"trigger":"hover","className":"steedos-record-detail-popover","position":"left-bottom","showIcon":false,"title":false,"offset":{"top":0,"left":20},"body":[{"type":"steedos-record-mini","objectApiName":"${objectName}","recordId":"${value}","showButtons":false,"showBackButton":false,"data":{"objectName":"${objectName}","recordId":"${value}"}}]}:null};if(!(window.innerWidth<768))return[3/*break*/,9];_l=null;return[3/*break*/,11];case 9:return[4/*yield*/,getLookupLinkOnClick(steedosField,{appId:appId,objectName:referenceTo_1,formFactor:formFactor})];case 10:_l=_6.sent();_6.label=11;case 11:fieldBaseProps=_j.apply(_h,_k.concat([(_t.body=(_u.body=[(_w.items=(// onEvent: window.innerWidth < 768 ? null : REFERENCE_VALUE_ITEM_ONCLICK
2688
+ _s.onEvent=_g,_s),_r)],_q),{type:'static',tpl:'-',className:"".concat(fieldBaseProps.className||''," text-muted !border-b-0"),hiddenOn:"${_display.".concat(steedosField.name,"}")},{type:'tpl',tpl:"<span class='antd-TplField antd-Form-description'><span>".concat(steedosField.description,"</span></span>"),hidden:_$1.isEmpty(steedosField.description)?true:false}],_p)]));return[3/*break*/,13];case 7:return[4/*yield*/,env.fetcher(source,props.data)];case 8:res=_6.sent();valueOptions_1=((_4=res===null||res===void 0?void 0:res.data)===null||_4===void 0?void 0:_4.options)||[];fieldValue=(_5=props.data)===null||_5===void 0?void 0:_5[steedosField.name];values=fieldValue;if(_$1.isString(values)){values=[values];}if(!(values&&values.length>0))return[3/*break*/,12];disPlayValue_1=[];_$1.each(values,function(value){var option=valueOptions_1.find(function(item){return item.value===value;});if(option){disPlayValue_1.push({objectName:referenceTo_1,value:option._id||option.value,label:option.label});}});_j=(_h=Object).assign;_k=[{},fieldBaseProps];_t={type:'control',name:null};_u={type:'form',className:"steedos-field-lookup-wrapper p-0","wrapWithPanel":false,"actions":[],data:(_v={},_v[steedosField.name]=disPlayValue_1,_v)};_w={type:'each',placeholder:"",className:"steedos-field-lookup-each flex flex-wrap gap-2",source:"${".concat(steedosField.name,"}")};_x={type:'static',className:'m-0',tpl:"<a href=\"/app/-/${objectName}/view/${value}\" target=\"_blank\" ".concat(lookupATagClick,">${label}</a>"),popOver:fieldRefObject.compactLayouts&&window.innerWidth>=768?{"trigger":"hover","className":"steedos-record-detail-popover","position":"left-bottom","showIcon":false,"title":false,"offset":{"top":0,"left":20},"body":[{"type":"steedos-record-mini","objectApiName":"${objectName}","recordId":"${value}","showButtons":false,"showBackButton":false,"data":{"objectName":"${objectName}","recordId":"${value}"}}]}:null};if(!(window.innerWidth<768))return[3/*break*/,9];_l=null;return[3/*break*/,11];case 9:return[4/*yield*/,getLookupLinkOnClick(steedosField,{appId:appId,objectName:referenceTo_1,formFactor:formFactor})];case 10:_l=_6.sent();_6.label=11;case 11:fieldBaseProps=_j.apply(_h,_k.concat([(_t.body=(_u.body=[(_w.items=(// onEvent: window.innerWidth < 768 ? null : REFERENCE_VALUE_ITEM_ONCLICK
2689
2689
  _x.onEvent=_l,_x),_w)],_u),_t)]));return[3/*break*/,13];case 12:fieldBaseProps=Object.assign({},fieldBaseProps,{type:'static',tpl:'-',className:"".concat(fieldBaseProps.className||''," text-muted")});_6.label=13;case 13:return[3/*break*/,15];case 14:fieldBaseProps=Object.assign({},fieldBaseProps,{type:'select',source:source});_6.label=15;case 15:schema=Object.assign({},fieldBaseProps,_$1.pick(steedosField.amis||{},['className','inline','label','labelAlign','name','labelRemark','description','placeholder','staticClassName','staticLabelClassName','staticInputClassName','staticSchema']));schema.placeholder="";addEditorClass(schema,editorClassName);// console.log(`steedos field [lookup] schema:`, schema)
2690
2690
  return[2/*return*/,schema];case 16:if(!fStatic)return[3/*break*/,19];if(!props.data.hasOwnProperty("_display"))return[3/*break*/,18];return[4/*yield*/,index.convertSFieldToAmisField(steedosField,true,ctx)];case 17:fieldSchema=_6.sent();if(steedosField.type==='file'&&fieldSchema.disabled){fieldValue=fieldSchema.value;if(fieldValue&&fieldValue.length){_$1.forEach(fieldValue,function(item){var fileName=item.name;var match=fileName.match(/\.([^\.]+)$/);match?match[0]:'';});fieldHtml_1="";_$1.forEach(fieldValue,function(item){var fileName=item.name;var fileUrl=item.url;var match=fileName.match(/\.([^\.]+)$/);var fileType=match?match[0]:'';var filePreviewHtml='';if([".pdf",".jpg",".jpeg",".png",".gif"].indexOf(fileType)>-1){var indexOfQuestionMark=fileUrl.indexOf('?');if(indexOfQuestionMark>-1){var filePreviewUrl=fileUrl.substring(0,indexOfQuestionMark);filePreviewHtml="&ensp;<a href=\"".concat(filePreviewUrl,"\" target=\"_blank\" class=\"antd-Link\"><span class=\"antd-TplField\"><span>\u9884\u89C8</span></span></a>");}}var tpl="\n <div class=\"antd-FileControl-itemInfo flex-wrap\">\n <span class=\"antd-FileControl-itemInfoIcon flex justify-center items-center\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 14 16\" class=\"icon icon-file\"><path d=\"M0 0v16h14V4.001L9.939 0H0Zm1 1h8v4h4v10H1V1Zm9 .464 2.575 2.537H10V1.464Z\"></path><path d=\"M4 12h6v-1H4zM4 9h6V8H4z\"></path></svg></span>\n <a class=\"antd-FileControl-itemInfoText\" target=\"_blank\" rel=\"noopener\" href=\"".concat(fileUrl,"\">").concat(fileName,"</a>\n ").concat(filePreviewHtml?filePreviewHtml:'',"\n </div>\n ");fieldHtml_1+=tpl;});return[2/*return*/,{"type":"tpl","tpl":fieldHtml_1}];}}addEditorClass(fieldSchema,editorClassName);return[2/*return*/,fieldSchema];case 18:schema=Object.assign({},steedosField,{type:getAmisStaticFieldType(steedosField.type,steedosField.data_type,steedosField),"static":true,label:steedosField.label});if(steedosField.type==="time"||steedosField.type==="input-time-range"){Object.assign(schema,{inputFormat:'HH:mm',timeFormat:'HH:mm',format:'1970-01-01THH:mm:00.000[Z]'});}else if(steedosField.type==="percent"){Object.assign(schema,{"percent":steedosField.scale?steedosField.scale:true});}else if(steedosField.type==="password"){Object.assign(schema,{"tpl":"******"});}else if(steedosField.type==="select"){map=getSelectMap(steedosField.options);Object.assign(schema,{"placeholder":"","map":map});}else if(steedosField.type==="color"){Object.assign(schema,{"defaultColor":null});}else if(steedosField.type==="number"||steedosField.type==='currency'){// amis input-number和number组件中的precision表示小数位数,并不是魔方平台的精度概念,要转换下,否则小数点后会显示很多的0
2691
2691
  Object.assign(schema,{"precision":steedosField.scale||0,"kilobitSeparator":steedosField.enable_thousands//识别enable_thousands,控制千分位分隔符