header-json.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. function getHeaderJson() {
  2. let headerJson = {
  3. "type": "page",
  4. "initApi": "http://localhost:8081/api/userInfo",
  5. "body": [
  6. {
  7. "type": "flex",
  8. "justify": "flex-end",
  9. "items": [
  10. {
  11. "type": "dropdown-button",
  12. "label": "",
  13. "className": "header-menu",
  14. "buttons": [
  15. {
  16. "type": "button",
  17. "label": "中文",
  18. "id": "u:6911502c8fcc",
  19. "onEvent": {
  20. "click": {
  21. "actions": [
  22. {
  23. "script": "localStorage.setItem('language', 'zh-CN')\nlocation.reload()",
  24. "actionType": "custom",
  25. "args": {
  26. }
  27. }
  28. ],
  29. "weight": 0
  30. }
  31. }
  32. },
  33. {
  34. "type": "button",
  35. "label": "English",
  36. "id": "u:e702685a7a45",
  37. "onEvent": {
  38. "click": {
  39. "actions": [
  40. {
  41. "script": "localStorage.setItem('language', 'en-US')\r\nlocation.reload()",
  42. "actionType": "custom"
  43. }
  44. ],
  45. "weight": 0
  46. }
  47. },
  48. "actionType": "",
  49. "link": "/view/user_info"
  50. }
  51. ],
  52. "id": "u:4fedf7a987bf",
  53. "size": "md",
  54. "level": "default",
  55. "align": "right",
  56. "block": false,
  57. "hideCaret": true,
  58. "trigger": "hover",
  59. "icon": "./public/static/icon/language-change.png",
  60. "btnClassName": "no-border"
  61. },
  62. {
  63. "type": "dropdown-button",
  64. "label": "$userName",
  65. "className": "header-menu",
  66. "buttons": [
  67. {
  68. "type": "button",
  69. "label": "个人信息",
  70. "actionType": "link",
  71. "link": "/view/user_info",
  72. "id": "u:57cf3ed9c568"
  73. },
  74. {
  75. "type": "button",
  76. "actionType": "",
  77. "url": "/login/out",
  78. "blank": false,
  79. "label": "退出登录",
  80. "id": "u:88d8afc464b5",
  81. "api": "http://localhost:8081/api/logout",
  82. "onEvent": {
  83. "click": {
  84. "actions": [
  85. {
  86. "args": {
  87. "options": {
  88. "silent": false
  89. },
  90. "api": {
  91. "url": "http://localhost:8081/api/logout",
  92. "method": "post",
  93. "messages": {
  94. }
  95. }
  96. },
  97. "outputVar": "responseResult",
  98. "actionType": "ajax"
  99. }
  100. ],
  101. "weight": 0
  102. }
  103. }
  104. }
  105. ],
  106. "id": "u:d324269526b9",
  107. "size": "md",
  108. "level": "default",
  109. "align": "right",
  110. "block": true,
  111. "trigger": "hover"
  112. }
  113. ],
  114. "id": "u:e7752d0c1dbe"
  115. }
  116. ],
  117. "id": "u:d16525b6aae6"
  118. }
  119. return headerJson
  120. }