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

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.
@@ -26192,7 +26192,7 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
26192
26192
  "method": "get",
26193
26193
  "url": "${context.rootUrl}/service/api/apps/${appId}/menus",
26194
26194
  "sendOn": "!!appId",
26195
- "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 ")
26195
+ "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 pt-0 text-base\",\n \"icon\": \"fa fa-cog\",\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 ")
26196
26196
  }
26197
26197
  };
26198
26198
  // console.log(`AmisAppMenu schema=====>`, schema)