@steedos-widgets/amis-object 1.1.9 → 1.1.10

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.
@@ -12757,31 +12757,37 @@ setTimeout(()=>{
12757
12757
  }); };
12758
12758
 
12759
12759
  var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, function () {
12760
- var _a, stacked, overflow, appId, data, _b, links, _c, showIcon, _d, className, _e, indentSize, selectedId;
12760
+ var _a, stacked, overflow, appId, data, _b, links, _c, showIcon, _d, className, _e, indentSize, selectedId, schema;
12761
12761
  return __generator(this, function (_f) {
12762
12762
  _a = props.stacked, stacked = _a === void 0 ? false : _a, overflow = props.overflow, appId = props.appId, data = props.data, _b = props.links, links = _b === void 0 ? null : _b, _c = props.showIcon, showIcon = _c === void 0 ? true : _c, _d = props.className, className = _d === void 0 ? '' : _d, _e = props.indentSize, indentSize = _e === void 0 ? 12 : _e, selectedId = props.selectedId;
12763
12763
  if (!appId) {
12764
12764
  appId = data.context.appId || 'admin';
12765
12765
  }
12766
12766
  // console.log(`AmisAppMenu appId`, appId)
12767
- // console.log(`AmisAppMenu`, props)
12768
- return [2 /*return*/, {
12769
- "type": "nav",
12770
- className: "".concat(className),
12771
- "stacked": stacked,
12772
- "overflow": overflow,
12773
- "indentSize": indentSize,
12774
- "links": links,
12775
- "source": {
12776
- "method": "get",
12777
- "url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus"),
12778
- "adaptor": "\n try {\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n // active: selectedId === tab.id,\n })\n })\n } else {\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": true,\n \"children\": _.map(tabs, (tab) => {\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n // active: selectedId === tab.id,\n }\n })\n }) \n }\n });\n }else{\n _.each(payload.children, (tab)=>{\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n // active: selectedId === tab.id,\n });\n })\n }\n \n payload.data = data.nav;\n } catch (error) {\n console.log(`error`, error)\n }\n return payload;\n "),
12779
- "headers": {
12780
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
12781
- },
12782
- "sendOn": "".concat(!!!links)
12783
- },
12784
- }];
12767
+ console.log("AmisAppMenu", appId, props);
12768
+ if (links) {
12769
+ return [2 /*return*/, {
12770
+ "type": "nav",
12771
+ className: "".concat(className),
12772
+ "stacked": stacked,
12773
+ "overflow": overflow,
12774
+ "indentSize": indentSize,
12775
+ "links": links
12776
+ }];
12777
+ }
12778
+ schema = {
12779
+ type: 'service',
12780
+ schemaApi: {
12781
+ "method": "get",
12782
+ "url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus?try=1111111"),
12783
+ "adaptor": "\n try {\n console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n })\n })\n } else {\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": true,\n \"children\": _.map(tabs, (tab) => {\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n }\n })\n }) \n }\n });\n }else{\n _.each(payload.children, (tab)=>{\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n });\n })\n }\n payload.data = {\n \"type\": \"nav\",\n className: \"").concat(className, "\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"links\": data.nav,\n };\n } catch (error) {\n console.log(`error`, error)\n }\n console.log('payload===2==>', payload)\n return payload;\n "),
12784
+ "headers": {
12785
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
12786
+ }
12787
+ }
12788
+ };
12789
+ console.log("schema=====>", schema);
12790
+ return [2 /*return*/, schema];
12785
12791
  });
12786
12792
  }); };
12787
12793
 
@@ -13033,6 +13039,10 @@ setTimeout(()=>{
13033
13039
  "color": "#FFFFFF"
13034
13040
  },
13035
13041
  size: 30
13042
+ },
13043
+ {
13044
+ "type": "tpl",
13045
+ "tpl": "<span class=\"hidden-xs user-name text-overflow\" style=\"height: 30px;line-height: 30px;font-size: 16px;font-weight: bold;margin-left: 10px;\">${global.user.name}<i class=\"fa fa-angle-down\" style=\"margin-left: 4px;\"></i></span>"
13036
13046
  }
13037
13047
  ],
13038
13048
  "overlay": [