@maxelms/create-plugin-cli 1.1.0

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.
Files changed (274) hide show
  1. package/README.en.md +36 -0
  2. package/README.md +12 -0
  3. package/bin/build.js +29 -0
  4. package/bin/compress.js +35 -0
  5. package/bin/copy.js +39 -0
  6. package/bin/index.js +53 -0
  7. package/configuration-schema.json +829 -0
  8. package/lib/index.d.ts +21 -0
  9. package/lib/index.js +242 -0
  10. package/lib/utils.d.ts +18 -0
  11. package/lib/utils.js +114 -0
  12. package/package.json +50 -0
  13. package/templates/jQuery-micro-app/package.json.tpl +19 -0
  14. package/templates/jQuery-micro-app/src/README.md +5 -0
  15. package/templates/jQuery-micro-app/src/configuration.json +30 -0
  16. package/templates/jQuery-micro-app/src/index.html +17 -0
  17. package/templates/jQuery-micro-app/src/main.js.tpl +31 -0
  18. package/templates/jQuery-micro-app/src/manifest.json.tpl +9 -0
  19. package/templates/jQuery-micro-app/src/style.css +11 -0
  20. package/templates/maxelms-navigation/.babelrc +7 -0
  21. package/templates/maxelms-navigation/.gitignore.tpl +23 -0
  22. package/templates/maxelms-navigation/README.md +15 -0
  23. package/templates/maxelms-navigation/global.d.ts +2 -0
  24. package/templates/maxelms-navigation/index.html +16 -0
  25. package/templates/maxelms-navigation/package.json +65 -0
  26. package/templates/maxelms-navigation/patches/live2d-widget@3.1.4.patch +4534 -0
  27. package/templates/maxelms-navigation/pnpm-lock.yaml +7993 -0
  28. package/templates/maxelms-navigation/src/App.tsx +47 -0
  29. package/templates/maxelms-navigation/src/components/Actions/ColorPicker.tsx +86 -0
  30. package/templates/maxelms-navigation/src/components/Actions/SwitchApps.tsx +83 -0
  31. package/templates/maxelms-navigation/src/components/Actions/index.tsx +95 -0
  32. package/templates/maxelms-navigation/src/components/Cutie.tsx +24 -0
  33. package/templates/maxelms-navigation/src/components/Enterprises.tsx +46 -0
  34. package/templates/maxelms-navigation/src/components/Logo.tsx +29 -0
  35. package/templates/maxelms-navigation/src/components/Menus/MenuPanel.tsx +55 -0
  36. package/templates/maxelms-navigation/src/components/Menus/index.tsx +50 -0
  37. package/templates/maxelms-navigation/src/components/Search.tsx +77 -0
  38. package/templates/maxelms-navigation/src/imgs/corp-admin.svg +1 -0
  39. package/templates/maxelms-navigation/src/imgs/saas-admin.svg +1 -0
  40. package/templates/maxelms-navigation/src/imgs/skin.svg +1 -0
  41. package/templates/maxelms-navigation/src/imgs/tenant-admin.svg +1 -0
  42. package/templates/maxelms-navigation/src/imgs/user-center.svg +1 -0
  43. package/templates/maxelms-navigation/src/index.tsx +14 -0
  44. package/templates/maxelms-navigation/src/interface.ts +27 -0
  45. package/templates/maxelms-navigation/src/style.less.tpl +278 -0
  46. package/templates/maxelms-navigation/src/utils.ts.tpl +40 -0
  47. package/templates/maxelms-navigation/tsconfig.json +111 -0
  48. package/templates/maxelms-navigation/webpack.config.js +119 -0
  49. package/templates/maxelms-script/.babelrc +5 -0
  50. package/templates/maxelms-script/.gitignore.tpl +23 -0
  51. package/templates/maxelms-script/README.md +0 -0
  52. package/templates/maxelms-script/global.d.ts +2 -0
  53. package/templates/maxelms-script/index.html +10 -0
  54. package/templates/maxelms-script/package.json.tpl +55 -0
  55. package/templates/maxelms-script/pnpm-lock.yaml +7699 -0
  56. package/templates/maxelms-script/src/App.tsx +15 -0
  57. package/templates/maxelms-script/src/index.tsx +15 -0
  58. package/templates/maxelms-script/src/style.less.tpl +8 -0
  59. package/templates/maxelms-script/src/utils.ts.tpl +2 -0
  60. package/templates/maxelms-script/tsconfig.json +111 -0
  61. package/templates/maxelms-script/webpack.config.js +92 -0
  62. package/templates/maxelms-style/.gitignore.tpl +38 -0
  63. package/templates/maxelms-style/README.md +0 -0
  64. package/templates/maxelms-style/index.css +3 -0
  65. package/templates/maxelms-style/index.less +4 -0
  66. package/templates/maxelms-style/package.json.tpl +17 -0
  67. package/templates/playground/dist/main.css +2 -0
  68. package/templates/playground/dist/main.js +2 -0
  69. package/templates/playground/dist/main.js.LICENSE.txt +52 -0
  70. package/templates/playground/dist/playground.html +1 -0
  71. package/templates/playground/dist/react-dom.production.min.js +2 -0
  72. package/templates/playground/dist/react-dom.production.min.js.LICENSE.txt +8 -0
  73. package/templates/playground/dist/react.production.min.js +2 -0
  74. package/templates/playground/dist/react.production.min.js.LICENSE.txt +8 -0
  75. package/templates/playground/dist/zone.umd.min.js +2 -0
  76. package/templates/playground/dist/zone.umd.min.js.LICENSE.txt +29 -0
  77. package/templates/project/package.json +17 -0
  78. package/templates/react-micro-app/.babelrc +6 -0
  79. package/templates/react-micro-app/.gitignore.tpl +23 -0
  80. package/templates/react-micro-app/README.md +5 -0
  81. package/templates/react-micro-app/manifest.json.tpl +21 -0
  82. package/templates/react-micro-app/package.json.tpl +53 -0
  83. package/templates/react-micro-app/public/configuration.json +30 -0
  84. package/templates/react-micro-app/public/index.html +10 -0
  85. package/templates/react-micro-app/src/components/NoMatch.tsx +15 -0
  86. package/templates/react-micro-app/src/context/masterContext.ts +11 -0
  87. package/templates/react-micro-app/src/index.tsx +52 -0
  88. package/templates/react-micro-app/src/layouts/BasicLayout.less +16 -0
  89. package/templates/react-micro-app/src/layouts/BasicLayout.tsx +21 -0
  90. package/templates/react-micro-app/src/pages/Home/index.less +15 -0
  91. package/templates/react-micro-app/src/pages/Home/index.tsx +33 -0
  92. package/templates/react-micro-app/src/pages/List/index.less +12 -0
  93. package/templates/react-micro-app/src/pages/List/index.tsx +12 -0
  94. package/templates/react-micro-app/src/pages/New/index.less +12 -0
  95. package/templates/react-micro-app/src/pages/New/index.tsx +12 -0
  96. package/templates/react-micro-app/src/pages/View/index.less +12 -0
  97. package/templates/react-micro-app/src/pages/View/index.tsx +12 -0
  98. package/templates/react-micro-app/src/public-path.js +4 -0
  99. package/templates/react-micro-app/src/router.tsx +44 -0
  100. package/templates/react-micro-app/tsconfig.json +102 -0
  101. package/templates/react-micro-app/typings.d.ts +11 -0
  102. package/templates/react-micro-app/webpack.config.js.tpl +178 -0
  103. package/templates/react-micro-app-umi/.editorconfig +16 -0
  104. package/templates/react-micro-app-umi/.env +1 -0
  105. package/templates/react-micro-app-umi/.gitignore.tpl +23 -0
  106. package/templates/react-micro-app-umi/.prettierignore +8 -0
  107. package/templates/react-micro-app-umi/.prettierrc +11 -0
  108. package/templates/react-micro-app-umi/.umirc.ts.tpl +31 -0
  109. package/templates/react-micro-app-umi/README.md +5 -0
  110. package/templates/react-micro-app-umi/manifest.json.tpl +21 -0
  111. package/templates/react-micro-app-umi/package.json.tpl +42 -0
  112. package/templates/react-micro-app-umi/public/basicConfiguration.json +30 -0
  113. package/templates/react-micro-app-umi/public/configuration.json +30 -0
  114. package/templates/react-micro-app-umi/src/layout/BasicLayout.tsx +16 -0
  115. package/templates/react-micro-app-umi/src/pages/about.tsx +11 -0
  116. package/templates/react-micro-app-umi/src/pages/home.tsx +19 -0
  117. package/templates/react-micro-app-umi/tsconfig.json +36 -0
  118. package/templates/react-micro-app-umi/typings.d.ts +8 -0
  119. package/templates/react-micro-button/.gitignore.tpl +23 -0
  120. package/templates/react-micro-button/README.md +5 -0
  121. package/templates/react-micro-button/configuration/Configuration.tsx +113 -0
  122. package/templates/react-micro-button/configuration/index.css +8 -0
  123. package/templates/react-micro-button/configuration/index.tsx +6 -0
  124. package/templates/react-micro-button/manifest.json.tpl +3 -0
  125. package/templates/react-micro-button/package.json.tpl +49 -0
  126. package/templates/react-micro-button/postcss.config.js +5 -0
  127. package/templates/react-micro-button/public/basicConfiguration.json +30 -0
  128. package/templates/react-micro-button/public/configuration.html +10 -0
  129. package/templates/react-micro-button/public/configuration.json +30 -0
  130. package/templates/react-micro-button/public/index.html +10 -0
  131. package/templates/react-micro-button/src/App.tsx +41 -0
  132. package/templates/react-micro-button/src/app.less +0 -0
  133. package/templates/react-micro-button/src/index.less +0 -0
  134. package/templates/react-micro-button/src/index.tsx +30 -0
  135. package/templates/react-micro-button/tsconfig.json +11 -0
  136. package/templates/react-micro-button/webpack.config.js.tpl +150 -0
  137. package/templates/react-micro-field/.babelrc +5 -0
  138. package/templates/react-micro-field/.gitignore.tpl +23 -0
  139. package/templates/react-micro-field/README.md +5 -0
  140. package/templates/react-micro-field/configuration/Configuration.tsx +113 -0
  141. package/templates/react-micro-field/configuration/index.css +8 -0
  142. package/templates/react-micro-field/configuration/index.tsx +6 -0
  143. package/templates/react-micro-field/manifest.json.tpl +7 -0
  144. package/templates/react-micro-field/package.json.tpl +50 -0
  145. package/templates/react-micro-field/postcss.config.js +5 -0
  146. package/templates/react-micro-field/public/basicConfiguration.json +30 -0
  147. package/templates/react-micro-field/public/configuration.html +10 -0
  148. package/templates/react-micro-field/public/configuration.json +30 -0
  149. package/templates/react-micro-field/public/index.html +10 -0
  150. package/templates/react-micro-field/src/App.tsx.tpl +51 -0
  151. package/templates/react-micro-field/src/index.tsx +29 -0
  152. package/templates/react-micro-field/src/style.less.tpl +12 -0
  153. package/templates/react-micro-field/tsconfig.json +11 -0
  154. package/templates/react-micro-field/webpack.config.js.tpl +157 -0
  155. package/templates/react-micro-field-umi/.editorconfig +16 -0
  156. package/templates/react-micro-field-umi/.gitignore.tpl +24 -0
  157. package/templates/react-micro-field-umi/.prettierignore +8 -0
  158. package/templates/react-micro-field-umi/.prettierrc +11 -0
  159. package/templates/react-micro-field-umi/README.md +5 -0
  160. package/templates/react-micro-field-umi/config/config.ts.tpl +41 -0
  161. package/templates/react-micro-field-umi/config/plugin.ts +18 -0
  162. package/templates/react-micro-field-umi/manifest.json.tpl +7 -0
  163. package/templates/react-micro-field-umi/package.json.tpl +48 -0
  164. package/templates/react-micro-field-umi/public/basicConfiguration.json +30 -0
  165. package/templates/react-micro-field-umi/public/configuration.json +30 -0
  166. package/templates/react-micro-field-umi/src/app.tsx +46 -0
  167. package/templates/react-micro-field-umi/src/global.tsx +0 -0
  168. package/templates/react-micro-field-umi/src/hooks/masterProps.ts +33 -0
  169. package/templates/react-micro-field-umi/src/layouts/BasicLayout.tsx +17 -0
  170. package/templates/react-micro-field-umi/src/pages/configuration/index.tsx +90 -0
  171. package/templates/react-micro-field-umi/src/pages/index.tsx.tpl +54 -0
  172. package/templates/react-micro-field-umi/src/pages/interface.ts +12 -0
  173. package/templates/react-micro-field-umi/src/pages/style.less.tpl +15 -0
  174. package/templates/react-micro-field-umi/src/public-path.js +5 -0
  175. package/templates/react-micro-field-umi/tsconfig.json +37 -0
  176. package/templates/react-micro-field-umi/typings.d.ts +10 -0
  177. package/templates/react-micro-plugin/.babelrc +5 -0
  178. package/templates/react-micro-plugin/.gitignore.tpl +23 -0
  179. package/templates/react-micro-plugin/README.md +5 -0
  180. package/templates/react-micro-plugin/configuration/Configuration.tsx +114 -0
  181. package/templates/react-micro-plugin/configuration/index.css +8 -0
  182. package/templates/react-micro-plugin/configuration/index.tsx +6 -0
  183. package/templates/react-micro-plugin/manifest.json.tpl +3 -0
  184. package/templates/react-micro-plugin/package.json.tpl +50 -0
  185. package/templates/react-micro-plugin/postcss.config.js +5 -0
  186. package/templates/react-micro-plugin/public/configuration.html +10 -0
  187. package/templates/react-micro-plugin/public/configuration.json +30 -0
  188. package/templates/react-micro-plugin/public/index.html +10 -0
  189. package/templates/react-micro-plugin/src/App.tsx.tpl +32 -0
  190. package/templates/react-micro-plugin/src/index.tsx +29 -0
  191. package/templates/react-micro-plugin/src/style.less.tpl +12 -0
  192. package/templates/react-micro-plugin/tsconfig.json +11 -0
  193. package/templates/react-micro-plugin/webpack.config.js.tpl +156 -0
  194. package/templates/react-micro-plugin-umi/.editorconfig +16 -0
  195. package/templates/react-micro-plugin-umi/.gitignore.tpl +24 -0
  196. package/templates/react-micro-plugin-umi/.prettierignore +8 -0
  197. package/templates/react-micro-plugin-umi/.prettierrc +11 -0
  198. package/templates/react-micro-plugin-umi/README.md +5 -0
  199. package/templates/react-micro-plugin-umi/config/config.ts +29 -0
  200. package/templates/react-micro-plugin-umi/config/plugin.ts +18 -0
  201. package/templates/react-micro-plugin-umi/manifest.json.tpl +3 -0
  202. package/templates/react-micro-plugin-umi/package.json.tpl +48 -0
  203. package/templates/react-micro-plugin-umi/public/configuration.json +30 -0
  204. package/templates/react-micro-plugin-umi/src/app.tsx +46 -0
  205. package/templates/react-micro-plugin-umi/src/global.tsx +0 -0
  206. package/templates/react-micro-plugin-umi/src/hooks/masterProps.ts +34 -0
  207. package/templates/react-micro-plugin-umi/src/layouts/BasicLayout.tsx +17 -0
  208. package/templates/react-micro-plugin-umi/src/pages/configuration/index.tsx +113 -0
  209. package/templates/react-micro-plugin-umi/src/pages/index.tsx +21 -0
  210. package/templates/react-micro-plugin-umi/src/public-path.js +5 -0
  211. package/templates/react-micro-plugin-umi/tsconfig.json +37 -0
  212. package/templates/react-micro-plugin-umi/typings.d.ts +10 -0
  213. package/templates/vue-micro-app/.gitignore.tpl +23 -0
  214. package/templates/vue-micro-app/README.md +5 -0
  215. package/templates/vue-micro-app/babel.config.js +15 -0
  216. package/templates/vue-micro-app/manifest.json.tpl +21 -0
  217. package/templates/vue-micro-app/package.json.tpl +54 -0
  218. package/templates/vue-micro-app/public/configuration.json +30 -0
  219. package/templates/vue-micro-app/public/favicon.ico +0 -0
  220. package/templates/vue-micro-app/public/index.html +10 -0
  221. package/templates/vue-micro-app/src/App.vue +35 -0
  222. package/templates/vue-micro-app/src/assets/logo.png +0 -0
  223. package/templates/vue-micro-app/src/components/HelloWorld.vue +32 -0
  224. package/templates/vue-micro-app/src/main.js +80 -0
  225. package/templates/vue-micro-app/src/public-path.js +5 -0
  226. package/templates/vue-micro-app/src/routes.js +19 -0
  227. package/templates/vue-micro-app/src/views/About.vue +13 -0
  228. package/templates/vue-micro-app/src/views/Home.vue +21 -0
  229. package/templates/vue-micro-app/vue.config.js.tpl +35 -0
  230. package/templates/vue-micro-button/.gitignore.tpl +23 -0
  231. package/templates/vue-micro-button/README.md +5 -0
  232. package/templates/vue-micro-button/babel.config.js +8 -0
  233. package/templates/vue-micro-button/configuration/App.vue +78 -0
  234. package/templates/vue-micro-button/configuration/main.js +11 -0
  235. package/templates/vue-micro-button/manifest.json.tpl +3 -0
  236. package/templates/vue-micro-button/package.json.tpl +51 -0
  237. package/templates/vue-micro-button/public/basicConfiguration.json +30 -0
  238. package/templates/vue-micro-button/public/configuration.html +10 -0
  239. package/templates/vue-micro-button/public/configuration.json +30 -0
  240. package/templates/vue-micro-button/public/index.html +12 -0
  241. package/templates/vue-micro-button/src/App.vue +46 -0
  242. package/templates/vue-micro-button/src/main.js +44 -0
  243. package/templates/vue-micro-button/vue.config.js.tpl +51 -0
  244. package/templates/vue-micro-field/.gitignore.tpl +23 -0
  245. package/templates/vue-micro-field/README.md +5 -0
  246. package/templates/vue-micro-field/babel.config.js +8 -0
  247. package/templates/vue-micro-field/configuration/App.vue +78 -0
  248. package/templates/vue-micro-field/configuration/main.js +11 -0
  249. package/templates/vue-micro-field/manifest.json.tpl +7 -0
  250. package/templates/vue-micro-field/package.json.tpl +53 -0
  251. package/templates/vue-micro-field/public/basicConfiguration.json +30 -0
  252. package/templates/vue-micro-field/public/configuration.html +10 -0
  253. package/templates/vue-micro-field/public/configuration.json +30 -0
  254. package/templates/vue-micro-field/public/index.html +10 -0
  255. package/templates/vue-micro-field/scripts/compress.js +32 -0
  256. package/templates/vue-micro-field/src/App.vue.tpl +55 -0
  257. package/templates/vue-micro-field/src/main.js +38 -0
  258. package/templates/vue-micro-field/src/style.less.tpl +16 -0
  259. package/templates/vue-micro-field/vue.config.js.tpl +51 -0
  260. package/templates/vue-micro-plugin/.gitignore.tpl +23 -0
  261. package/templates/vue-micro-plugin/README.md +24 -0
  262. package/templates/vue-micro-plugin/babel.config.js +8 -0
  263. package/templates/vue-micro-plugin/configuration/App.vue +100 -0
  264. package/templates/vue-micro-plugin/configuration/main.js +11 -0
  265. package/templates/vue-micro-plugin/manifest.json.tpl +3 -0
  266. package/templates/vue-micro-plugin/package.json.tpl +56 -0
  267. package/templates/vue-micro-plugin/public/configuration.html +10 -0
  268. package/templates/vue-micro-plugin/public/configuration.json +30 -0
  269. package/templates/vue-micro-plugin/public/index.html +10 -0
  270. package/templates/vue-micro-plugin/scripts/compress.js +32 -0
  271. package/templates/vue-micro-plugin/src/App.vue.tpl +42 -0
  272. package/templates/vue-micro-plugin/src/main.js +38 -0
  273. package/templates/vue-micro-plugin/src/style.less.tpl +16 -0
  274. package/templates/vue-micro-plugin/vue.config.js.tpl +53 -0
@@ -0,0 +1,47 @@
1
+ import React from 'react'
2
+ import Logo from '@/components/Logo'
3
+ import Menus from '@/components/Menus'
4
+ import Cutie from '@/components/Cutie'
5
+ import Search from '@/components/Search'
6
+ import Actions from '@/components/Actions'
7
+ import Enterprises from '@/components/Enterprises'
8
+ import { prefixCls, MasterPropsContextProvider, gradientColors, trim } from '@/utils'
9
+ import '@/style.less'
10
+
11
+ const App = (props: any) => {
12
+ const { getEnterpriseList, userInfo } = props
13
+ const [enterpriseData, setEnterpriseData] = React.useState({})
14
+ const [layoutColor, setLayoutColor] = React.useState(userInfo?.menuStyleConfig?.layoutColor)
15
+
16
+ React.useEffect(() => {
17
+ if (!getEnterpriseList) return
18
+ getEnterpriseList().then((res: any) => {
19
+ setEnterpriseData(res)
20
+ })
21
+ }, [])
22
+
23
+ const background = React.useMemo(() => {
24
+ if ((trim(layoutColor)).includes('rgba(255,255,255,1)')) {
25
+ return gradientColors[7]
26
+ }
27
+ return layoutColor || gradientColors[7]
28
+ }, [layoutColor])
29
+
30
+ return (
31
+ <MasterPropsContextProvider value={props}>
32
+ <div className={prefixCls}>
33
+ <Cutie />
34
+ <header style={{ background }}>
35
+ <Logo enterpriseData={enterpriseData} />
36
+ <Enterprises enterpriseData={enterpriseData} />
37
+ <Menus />
38
+ <Search />
39
+ <Actions onLayoutColorChange={setLayoutColor} />
40
+ </header>
41
+ <div className={`${prefixCls}-main`}>{props.children}</div>
42
+ </div>
43
+ </MasterPropsContextProvider>
44
+ )
45
+ }
46
+
47
+ export default App
@@ -0,0 +1,86 @@
1
+ import React from 'react'
2
+ import classnames from 'classnames'
3
+ import { CloseOutlined } from '@ant-design/icons'
4
+ import { prefixCls, gradientColors } from '@/utils'
5
+
6
+ const ColorPicker: React.FC<{
7
+ visible: boolean;
8
+ layoutColor: string;
9
+ primaryColor: string;
10
+ onChange(primaryColor: string, layoutColor: string): void;
11
+ onCancel?(): void;
12
+ primaryColors: { id: string; name: string; value: string }[];
13
+ }> = props => {
14
+ const rendered = React.useRef(false)
15
+ const timerRef = React.useRef<NodeJS.Timer>()
16
+ const { visible, layoutColor, primaryColor, onChange, onCancel = () => { }, primaryColors } = props
17
+ const [none, setNode] = React.useState(false)
18
+ React.useEffect(() => {
19
+ clearTimeout(timerRef.current)
20
+ if (visible) {
21
+ setNode(false)
22
+ rendered.current = true
23
+ }
24
+ if (!visible) {
25
+ timerRef.current = setTimeout(() => {
26
+ setNode(true)
27
+ }, 450)
28
+ }
29
+ }, [visible])
30
+
31
+ if (!visible && !rendered.current) return null
32
+ return (
33
+ <div
34
+ className={classnames(`${prefixCls}-color-picker`, {
35
+ none,
36
+ 'fade-out-right': !visible
37
+ })}>
38
+ <div
39
+ style={{"backgroundImage": layoutColor }}
40
+ className="color-picker-body"
41
+ >
42
+ <CloseOutlined className='close-icon' onClick={onCancel} />
43
+ <div className='item-picker'>
44
+ <div className='tip'>皮肤个性化设置</div>
45
+ <div className='gradients-container'>
46
+ {gradientColors.map(color => {
47
+ const selected = layoutColor === color
48
+ return (
49
+ <div
50
+ key={color}
51
+ style={{ "background": color }}
52
+ onClick={() => onChange(primaryColor, color)}
53
+ className={classnames('gradients-item', {
54
+ selected,
55
+ })}
56
+ />
57
+ )
58
+ })}
59
+ </div>
60
+ </div>
61
+ <div className='item-picker'>
62
+ <div className='tip'>主题色个性化设置</div>
63
+ <div className='gradients-container'>
64
+ {primaryColors.map(item => {
65
+ const { id, name, value } = item
66
+ const selected = primaryColor === value
67
+ return (
68
+ <div
69
+ key={id}
70
+ title={name}
71
+ style={{ "background": value }}
72
+ onClick={() => onChange(value, layoutColor)}
73
+ className={classnames('gradients-item', {
74
+ selected,
75
+ })}
76
+ />
77
+ )
78
+ })}
79
+ </div>
80
+ </div>
81
+ </div>
82
+ </div>
83
+ )
84
+ }
85
+
86
+ export default ColorPicker
@@ -0,0 +1,83 @@
1
+
2
+ import React from 'react'
3
+ import corpIcon from '@/imgs/corp-admin.svg'
4
+ import saasIcon from '@/imgs/saas-admin.svg'
5
+ import tenantIcon from '@/imgs/tenant-admin.svg'
6
+ import { MasterPropsContext } from '@/utils'
7
+
8
+ // @ts-ignore
9
+ const { appDomain, corpDomain, saasDomain, appAdminDomain } = window.domainNameConfig || {}
10
+
11
+ const appInfoMap: Record<string, {
12
+ url: string;
13
+ icon: string;
14
+ title: string;
15
+ }> = {
16
+ "-1": {
17
+ url: corpDomain,
18
+ icon: corpIcon,
19
+ title: "企业后台系统",
20
+ },
21
+ "0": {
22
+ url: appDomain,
23
+ icon: '',
24
+ title: "业务前台系统"
25
+ },
26
+ "1": {
27
+ url: saasDomain,
28
+ icon: saasIcon,
29
+ title: "SaaS 后台系统"
30
+ },
31
+ "2": {
32
+ url: appAdminDomain,
33
+ icon: tenantIcon,
34
+ title: "业务后台系统"
35
+ },
36
+ }
37
+
38
+ type App = {
39
+ id: string;
40
+ url: string;
41
+ icon: string;
42
+ title: string;
43
+ }
44
+
45
+ const SwitchApps: React.FC = props => {
46
+ const masterProps = React.useContext(MasterPropsContext)
47
+ const { userInfo } = masterProps || {}
48
+ const { permission, permissions = [] } = userInfo || {}
49
+
50
+ const apps: App[] = React.useMemo(() => {
51
+ return permissions
52
+ .filter((item: string) => item !== permission)
53
+ .map((item: string) => {
54
+ const { url, icon, title } = appInfoMap[item] || {}
55
+ return {
56
+ url,
57
+ icon,
58
+ title,
59
+ id: item,
60
+ }
61
+ })
62
+ }, [])
63
+
64
+ return (
65
+ <div style={{ "display": "flex" }}>
66
+ {apps.map(app => {
67
+ const { id, icon, title, url } = app
68
+ return (
69
+ <a href={`//${url}`} target="_blank">
70
+ <img
71
+ key={id}
72
+ src={icon}
73
+ title={title}
74
+ className='actions-icon'
75
+ />
76
+ </a>
77
+ )
78
+ })}
79
+ </div>
80
+ )
81
+ }
82
+
83
+ export default SwitchApps
@@ -0,0 +1,95 @@
1
+ import React from 'react'
2
+ import { useControllableValue } from 'ahooks'
3
+ import skin from '@/imgs/skin.svg'
4
+ import userCenter from '@/imgs/user-center.svg'
5
+ import SwitchApps from './SwitchApps'
6
+ import { prefixCls, MasterPropsContext } from '@/utils'
7
+ import ColorPicker from './ColorPicker'
8
+
9
+ // @ts-ignore
10
+ const host = window?.domainNameConfig?.fileCdnDomain || ''
11
+
12
+ const Actions: React.FC<{
13
+ onLayoutColorChange(color: string): void;
14
+ }> = props => {
15
+ const { onLayoutColorChange } = props
16
+ const masterProps = React.useContext(MasterPropsContext)
17
+ const { userInfo, onColorChange: onColorChangeProp } = masterProps || {}
18
+ const { userHeadImageUrl, enterpriseName, username, menuStyleConfig } = userInfo || {}
19
+ const { themeColors: primaryColors } = menuStyleConfig || {}
20
+ const [colorVisible, setColorVisible] = React.useState(false)
21
+
22
+ const [color, setColor] = useControllableValue({
23
+ defaultValue: {
24
+ layoutColor: menuStyleConfig?.layoutColor,
25
+ primaryColor: menuStyleConfig?.primaryColor,
26
+ }
27
+ })
28
+
29
+ React.useEffect(() => {
30
+ window.addEventListener('keydown', e => {
31
+ if (e.keyCode === 27) {
32
+ setColorVisible(false)
33
+ }
34
+ })
35
+ }, [])
36
+
37
+ const onColorChange = (primaryColor: string, layoutColor: string) => {
38
+ setColor({
39
+ layoutColor, primaryColor
40
+ })
41
+ const themeColorId = primaryColors.find((item: any) => item.value === primaryColor)?.id
42
+ onColorChangeProp({
43
+ layoutColor,
44
+ primaryColor,
45
+ themeColorId,
46
+ })
47
+ onLayoutColorChange(layoutColor)
48
+ }
49
+
50
+ const goUserCenter = () => {
51
+ if (masterProps?.goUserCenter) {
52
+ masterProps.goUserCenter()
53
+ }
54
+ }
55
+
56
+ const { layoutColor, primaryColor } = color || {}
57
+
58
+ return (
59
+ <div className={`${prefixCls}-actions`}>
60
+ <ColorPicker
61
+ visible={colorVisible}
62
+ onChange={onColorChange}
63
+ onCancel={() => setColorVisible(false)}
64
+ layoutColor={layoutColor}
65
+ primaryColor={primaryColor}
66
+ primaryColors={primaryColors}
67
+ />
68
+ <SwitchApps />
69
+ <img
70
+ src={skin}
71
+ title="色彩设置"
72
+ onClick={() => setColorVisible(!colorVisible)}
73
+ className='actions-icon'
74
+ />
75
+ <img
76
+ src={userCenter}
77
+ title="用户中心"
78
+ onClick={goUserCenter}
79
+ className='actions-icon'
80
+ />
81
+ <div className='user-info'>
82
+ <img
83
+ src={`//${host}/${userHeadImageUrl}`}
84
+ className='user-avatar'
85
+ />
86
+ <div className="user-mess">
87
+ <div className='username' title={username}>{username}</div>
88
+ <div className='enterprise-name' title={enterpriseName}>{enterpriseName}</div>
89
+ </div>
90
+ </div>
91
+ </div>
92
+ )
93
+ }
94
+
95
+ export default Actions
@@ -0,0 +1,24 @@
1
+ import React from 'react'
2
+ // @ts-ignore
3
+ import { L2Dwidget } from 'live2d-widget'
4
+
5
+ const Cutie = () => {
6
+
7
+ React.useEffect(() => {
8
+ L2Dwidget.init({
9
+
10
+ })
11
+
12
+
13
+
14
+ console.log(L2Dwidget)
15
+
16
+ return () => {
17
+ console.log('卸载了')
18
+ }
19
+ }, [])
20
+
21
+ return null
22
+ }
23
+
24
+ export default Cutie
@@ -0,0 +1,46 @@
1
+ import React from 'react'
2
+ import { Dropdown, MenuProps, Menu } from 'antd'
3
+ import { prefixCls, MasterPropsContext } from '@/utils'
4
+
5
+ const Enterprises: React.FC<any> = props => {
6
+ const { enterpriseData } = props
7
+ const masterProps = React.useContext(MasterPropsContext)
8
+ const { userInfo, onEnterpriseChange } = masterProps || {}
9
+ const { enterpriseId, enterpriseName } = userInfo || {}
10
+ const { enterPriseRDTOList } = enterpriseData || {}
11
+
12
+ const toggleEnterprise: MenuProps["onClick"] = e => {
13
+ const enterpriseId = e.key
14
+ onEnterpriseChange && onEnterpriseChange(enterpriseId)
15
+ }
16
+
17
+ const overlay = React.useMemo(() => {
18
+ if (!enterPriseRDTOList) {
19
+ return <></>
20
+ }
21
+ return (
22
+ <Menu activeKey={enterpriseId} onClick={toggleEnterprise}>
23
+ {enterPriseRDTOList.map((item: any) => {
24
+ const { name, id } = item
25
+ return (
26
+ <Menu.Item key={id}>{name}</Menu.Item>
27
+ )
28
+ })}
29
+ </Menu>
30
+ )
31
+
32
+ }, [enterPriseRDTOList])
33
+
34
+ return (
35
+ <div className={`${prefixCls}-enterprises`}>
36
+ <Dropdown
37
+ overlay={overlay}
38
+ placement="bottom"
39
+ >
40
+ <div className='name'>{enterpriseName}</div>
41
+ </Dropdown>
42
+ </div>
43
+ )
44
+ }
45
+
46
+ export default Enterprises
@@ -0,0 +1,29 @@
1
+ import React from 'react'
2
+ import { MasterPropsContext, prefixCls } from '@/utils'
3
+
4
+ const defaultLogo = ''
5
+
6
+ const Logo: React.FC<any> = props => {
7
+ const { enterpriseData } = props
8
+ const masterProps = React.useContext(MasterPropsContext)
9
+ const { userInfo } = masterProps || {}
10
+ const { enterpriseId } = userInfo || {}
11
+ const { enterPriseRDTOList } = enterpriseData || {}
12
+
13
+ const logo = React.useMemo(() => {
14
+ if (!enterPriseRDTOList) return defaultLogo
15
+ const currentEnterprise = enterPriseRDTOList.find((item: any) => {
16
+ return item.id === enterpriseId
17
+ })
18
+ // return currentEnterprise?.bigLogo
19
+ return defaultLogo
20
+ }, [enterpriseId, enterPriseRDTOList])
21
+
22
+ return (
23
+ <div className={`${prefixCls}-logo`}>
24
+ <img src={logo!} />
25
+ </div>
26
+ )
27
+ }
28
+
29
+ export default Logo
@@ -0,0 +1,55 @@
1
+ import React from 'react'
2
+ import { chunk } from 'lodash'
3
+ import { MasterPropsContext, prefixCls, flatMenuTree } from '@/utils'
4
+ import { MenuTree } from '@/interface'
5
+
6
+ const MenuPanel: React.FC<{
7
+ treeData: MenuTree[];
8
+ afterClick?(): void;
9
+ }> = props => {
10
+ const { treeData, afterClick } = props
11
+ const masterProps = React.useContext(MasterPropsContext)
12
+ const { goMenu: goMenuProp } = masterProps || {}
13
+
14
+ const menuRows = React.useMemo(() => {
15
+ const flattenMenus = flatMenuTree(treeData).filter(item => item.menuType !== 'catalogue')
16
+ const completionLength = flattenMenus.length - flattenMenus.length % 8
17
+ const arr = flattenMenus.concat(new Array(completionLength))
18
+ return chunk(arr, 8)
19
+ }, [treeData])
20
+
21
+ const goMenu = (menu: any) => {
22
+ goMenuProp(menu)
23
+ afterClick && afterClick()
24
+ }
25
+
26
+ return (
27
+ <div className={`${prefixCls}-menu-panel`}>
28
+ {menuRows.map(row => {
29
+ return (
30
+ <div>
31
+ {row.map(item => {
32
+ if (!item) return (
33
+ <div className="menu-item" />
34
+ )
35
+ const { name, menuId } = item
36
+ return (
37
+ <div className="menu-item" key={menuId}>
38
+ <span
39
+ title={name}
40
+ onClick={() => goMenu(item)}
41
+ className="menu-item-name"
42
+ >
43
+ {name}
44
+ </span>
45
+ </div>
46
+ )
47
+ })}
48
+ </div>
49
+ )
50
+ })}
51
+ </div>
52
+ )
53
+ }
54
+
55
+ export default MenuPanel
@@ -0,0 +1,50 @@
1
+ import React from 'react'
2
+ import { MasterPropsContext, prefixCls } from '@/utils'
3
+ import { MenuTree } from '@/interface'
4
+ import MenuPanel from './MenuPanel'
5
+
6
+ const Menus: React.FC<{
7
+
8
+ }> = props => {
9
+ const masterProps = React.useContext(MasterPropsContext)
10
+ const { userMenus } = masterProps || {}
11
+
12
+ const [activeTenantId, setActiveTenantId] = React.useState<string>()
13
+
14
+ const { menus = [], historyIds = [], quickMenus = [], selectedIds = [] } = userMenus || {}
15
+
16
+ const onMouseEnter = (tenantId: string) => {
17
+ setActiveTenantId(tenantId)
18
+ }
19
+
20
+ const onMouseLeave = () => {
21
+ setActiveTenantId('')
22
+ }
23
+
24
+ return (
25
+ <div className={`${prefixCls}-menus`}>
26
+ {menus.map((item: MenuTree) => {
27
+ const { tenantName, tenantId, menuTree } = item
28
+ const visible = activeTenantId === tenantId
29
+ return (
30
+ <div
31
+ key={tenantId}
32
+ className='tenant-name'
33
+ onMouseEnter={() => onMouseEnter(tenantId)}
34
+ onMouseLeave={onMouseLeave}
35
+ >
36
+ {tenantName}
37
+ {visible && (
38
+ <MenuPanel
39
+ treeData={menuTree}
40
+ afterClick={onMouseLeave}
41
+ />
42
+ )}
43
+ </div>
44
+ )
45
+ })}
46
+ </div>
47
+ )
48
+ }
49
+
50
+ export default Menus
@@ -0,0 +1,77 @@
1
+ import React from 'react'
2
+ import { useDebounceFn } from 'ahooks'
3
+ import { SearchOutlined } from '@ant-design/icons'
4
+ import { MenuTree } from '@/interface'
5
+ import { MasterPropsContext, prefixCls } from '@/utils'
6
+ import MenuPanel from '@/components/Menus/MenuPanel'
7
+
8
+ interface SearchValueProps extends MenuTree {
9
+ pathChain: string,
10
+ }
11
+
12
+ const Search: React.FC<{
13
+ }> = props => {
14
+ const masterProps = React.useContext(MasterPropsContext)
15
+ const { userMenus } = masterProps || {}
16
+ const inputRef = React.useRef<HTMLInputElement>(null)
17
+ const [searchList, setSearchList] = React.useState<SearchValueProps[]>([])
18
+
19
+ const focus = () => {
20
+ if (!inputRef.current) return
21
+ inputRef.current.focus()
22
+ }
23
+
24
+ const getTarget = (keywords: string, menuTree: MenuTree[], pathChain: string, result: SearchValueProps[]) => {
25
+ menuTree.forEach(item => {
26
+ const { children, name } = item
27
+ if (name.includes(keywords)) {
28
+ result.push({
29
+ ...item,
30
+ pathChain,
31
+ children: []
32
+ })
33
+ }
34
+ getTarget(keywords, children, `${pathChain} / ${name}`, result)
35
+ })
36
+ }
37
+
38
+ const onSearch = (value: string) => {
39
+ if (!value) {
40
+ setSearchList([])
41
+ return
42
+ }
43
+ const result: SearchValueProps[] = []
44
+ userMenus.menus.forEach((item: any) => {
45
+ const { menuTree, tenantName } = item
46
+ getTarget(value, menuTree, tenantName, result)
47
+ })
48
+ setSearchList(result)
49
+ }
50
+
51
+ const { run } = useDebounceFn(onSearch, {
52
+ wait: 500
53
+ })
54
+
55
+ const visible = searchList.length > 0
56
+
57
+ return (
58
+ <div className={`${prefixCls}-search`}>
59
+ <input
60
+ ref={inputRef}
61
+ type="text"
62
+ onChange={e => run(e.target.value)}
63
+ />
64
+ <SearchOutlined
65
+ onClick={focus}
66
+ className="search-icon"
67
+ />
68
+ {visible && (
69
+ <MenuPanel
70
+ treeData={searchList}
71
+ afterClick={() => setSearchList([])}
72
+ />)}
73
+ </div>
74
+ )
75
+ }
76
+
77
+ export default Search
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1670483366500" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12143" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M514.454588 7.529412C234.209882 7.529412 6.219294 235.52 6.219294 515.764706S234.224941 1024 514.454588 1024s508.235294-227.990588 508.235294-508.235294S794.699294 7.529412 514.454588 7.529412zM249.750588 487.860706c0.888471-0.662588 89.268706-67.734588 135.710118-105.848471 12.363294-10.149647 32.662588-29.138824 54.302118-50.763294 40.658824-40.658824 77.402353-87.732706 77.763764-88.199529a14.531765 14.531765 0 0 1 22.91953 17.829647l-3.237647 4.096c24.636235 29.545412 29.605647 34.56 47.73647 52.555294l12.393412 12.318118c4.141176 4.141176 8.749176 8.839529 13.583059 13.733647 12.559059 12.769882 26.804706 27.256471 37.632 37.074823 49.227294 44.604235 119.401412 85.850353 120.094117 86.256941a14.531765 14.531765 0 0 1-14.652235 25.057883c-2.981647-1.746824-73.517176-43.203765-124.943059-89.810824-11.444706-10.375529-25.991529-25.163294-38.821647-38.234353-4.773647-4.848941-9.336471-9.487059-13.417412-13.568l-12.303058-12.242823c-17.618824-17.483294-23.386353-23.235765-46.034824-50.296471-14.848 17.648941-35.719529 41.472-58.172235 63.924706-10.691765 10.691765-37.571765 37.225412-56.410353 52.675765-46.863059 38.460235-135.68 105.863529-136.568471 106.541176a14.531765 14.531765 0 0 1-17.573647-23.100235zM769.837176 752.941176h-508.235294c-8.026353 0-14.516706-7.032471-14.516706-15.058823s6.490353-15.058824 14.516706-15.058824H391.529412V550.912c0-8.026353 7.032471-14.516706 15.058823-14.516706s15.058824 6.490353 15.058824 14.516706V722.823529h105.411765V420.231529c0-8.026353 7.032471-14.516706 15.058823-14.516705s15.058824 6.490353 15.058824 14.516705V527.058824h125.530353c8.026353 0 14.516706 7.032471 14.516705 15.058823s-6.490353 15.058824-14.516705 15.058824H557.176471v165.647058h212.660705c8.026353 0 14.516706 7.032471 14.516706 15.058824s-6.490353 15.058824-14.516706 15.058823z" p-id="12144" fill="#ffffff"></path></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1670483401352" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12820" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M64 768 64 256l448-256 448 256 0 512-448 256L64 768zM512 940.8l371.2-211.2L883.2 294.4 512 83.2 140.8 294.4l0 428.8L512 940.8z" p-id="12821" fill="#ffffff"></path><path d="M435.2 486.4 358.4 358.4 435.2 230.4 582.4 230.4 659.2 358.4 582.4 486.4Z" p-id="12822" fill="#ffffff"></path><path d="M281.6 748.8 211.2 614.4 281.6 486.4 435.2 486.4 512 614.4 435.2 748.8Z" p-id="12823" fill="#ffffff"></path><path d="M582.4 748.8 512 614.4 582.4 486.4 736 486.4 806.4 614.4 736 748.8Z" p-id="12824" fill="#ffffff"></path></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1668786536313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4374" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M916.0192 508.672L760.9856 401.408a64.83456 64.83456 0 0 1-27.9552-53.504l0.4608-188.5696c0.1536-53.76-61.44-84.3264-104.192-51.712L479.3344 221.952A64.76288 64.76288 0 0 1 419.84 231.9872L240.64 173.312c-51.0976-16.7424-99.1744 32.3584-81.408 83.0976l62.4128 177.92c7.0656 20.1216 3.7376 42.4448-8.8064 59.6992l-111.2064 152.2688c-31.6928 43.4176 0.1536 104.2944 53.8624 103.0656l188.5184-4.352c21.3504-0.512 41.5744 9.5232 54.0672 26.8288l110.4384 152.832c31.488 43.5712 99.2768 32.1024 114.688-19.3536l51.9168-173.2608 173.2096 161.8944a38.10816 38.10816 0 0 0 24.32 10.24c10.8032 0.512 21.76-3.584 29.696-12.0832a38.15424 38.15424 0 0 0-1.8432-54.016l-170.9056-159.744 169.4208-54.5792c51.1488-16.4864 61.2352-84.48 16.9984-115.0976zM382.6688 499.8144l-58.624 106.496a38.2208 38.2208 0 0 1-33.536 19.8144c-6.2464 0-12.544-1.536-18.3808-4.7616-18.4832-10.1888-25.2416-33.4336-15.0528-51.9168l54.784-99.5328-26.0608-87.1424c-6.0416-20.224 5.4272-41.5232 25.6512-47.5648 20.224-6.0416 41.5232 5.4272 47.5648 25.6512l28.3136 94.72c4.4544 14.6432 2.7648 30.7712-4.6592 44.2368z" fill="#ffffff" p-id="4375"></path><path d="M788.1216 420.1984l-27.136-18.7904a64.83456 64.83456 0 0 1-27.9552-53.504l0.4608-188.5696c0.1536-53.76-61.44-84.3264-104.192-51.712L479.3344 221.952A64.73728 64.73728 0 0 1 419.84 231.9872L240.64 173.312c-51.0976-16.7424-99.1744 32.3584-81.408 83.0976l62.4128 177.92c7.0656 20.1216 3.7376 42.4448-8.8064 59.6992l-111.2064 152.2688c-31.6928 43.4176 0.1536 104.2944 53.8624 103.0656l188.5184-4.352c21.3504-0.512 41.5744 9.5232 54.0672 26.8288l47.4112 65.6384c178.0736-66.6112 311.3472-224.8192 342.6304-417.28zM382.6688 499.8144l-58.624 106.496a38.2208 38.2208 0 0 1-33.536 19.8144c-6.2464 0-12.544-1.536-18.3808-4.7616-18.4832-10.1888-25.2416-33.4336-15.0528-51.9168l54.784-99.5328-26.0608-87.1424c-6.0416-20.224 5.4272-41.5232 25.6512-47.5648 20.224-6.0416 41.5232 5.4272 47.5648 25.6512l28.3136 94.72c4.4544 14.6432 2.7648 30.7712-4.6592 44.2368z" fill="#ffffff" p-id="4376"></path><path d="M101.632 646.2976c-7.68 10.5472-11.5712 22.0672-12.3904 33.536 6.7584 0.256 13.5168 0.512 20.3264 0.512 297.3184 0 538.368-241.0496 538.368-538.368 0-14.6944-0.768-29.2352-1.8944-43.6736-5.7856 2.2016-11.3664 5.2736-16.7424 9.3184L479.3344 221.952A64.73728 64.73728 0 0 1 419.84 231.9872L240.64 173.312c-51.0976-16.7424-99.1744 32.3584-81.408 83.0976l62.4128 177.92c7.0656 20.1216 3.7376 42.4448-8.8064 59.6992l-111.2064 152.2688z m155.4944-76.8512l54.784-99.5328-26.0608-87.1424c-6.0416-20.224 5.4272-41.5232 25.6512-47.5648 20.224-6.0416 41.5232 5.4272 47.5648 25.6512l28.3136 94.72c4.4032 14.6944 2.6624 30.8224-4.7104 44.2368l-58.624 106.496a38.2208 38.2208 0 0 1-33.536 19.8144c-6.2464 0-12.544-1.536-18.3808-4.7616a38.21056 38.21056 0 0 1-15.0016-51.9168z" fill="#ffffff" p-id="4377"></path><path d="M419.84 231.9872L240.64 173.312c-51.0976-16.7424-99.1744 32.3584-81.408 83.0976l60.9792 173.8752c23.552-12.1344 46.08-25.9584 67.4816-41.2672l-1.8432-6.2464c-6.0416-20.224 5.4272-41.5232 25.6512-47.5648 12.032-3.584 24.4736-0.9216 33.8432 6.0416 33.1776-31.6416 62.4128-67.3792 86.6816-106.5984-4.096-0.5632-8.192-1.3312-12.1856-2.6624z" fill="#ffffff" p-id="4378"></path></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1670482266853" class="icon" viewBox="0 0 1164 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11074" xmlns:xlink="http://www.w3.org/1999/xlink" width="145.5" height="128"><path d="M1047.326501 0 116.366581 0c-64.006392 0-116.366581 52.367007-116.366581 116.366581l0 640.029831c0 64.006392 51.344214 126.642242 114.116436 139.195323l254.375464 50.873729c0 0-218.939092 77.575448-77.568629 77.575448l581.846541 0c141.390919 0-77.568629-77.575448-77.568629-77.575448l254.395919-50.873729c62.751766-12.553081 114.09598-75.18893 114.09598-139.195323L1163.693082 116.366581C1163.693082 52.367007 1111.326075 0 1047.326501 0zM1047.326501 750.580129 116.366581 750.580129 116.366581 104.734014l930.953102 0L1047.319683 750.580129z" p-id="11075" fill="#ffffff"></path></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1668787897363" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11103" xmlns:xlink="http://www.w3.org/1999/xlink" width="128" height="128"><path d="M788.8 288c0 153.6-123.2 276.8-276.8 276.8S235.2 441.6 235.2 288 358.4 12.8 512 12.8 788.8 134.4 788.8 288zM864 1012.8H136c-32 0-46.4-24-46.4-56 0-190.4 139.2-340.8 324.8-340.8h171.2c185.6 0 347.2 152 347.2 342.4v-3.2c1.6 32-36.8 56-68.8 57.6z" fill="#ffffff" p-id="11104"></path></svg>
@@ -0,0 +1,14 @@
1
+
2
+ import React from 'react'
3
+ import ReactDOM from 'react-dom'
4
+ import App from './App'
5
+
6
+ const dev = process.env.NODE_ENV !== 'production';
7
+ const debug = process.env.debugger == 'true';
8
+ const isProduction = process.env.NODE_ENV == 'production';
9
+
10
+ if (dev && !debug && !isProduction) {
11
+ ReactDOM.render(<App />, document.querySelector('#root'))
12
+ }
13
+
14
+ export default App
@@ -0,0 +1,27 @@
1
+
2
+ export interface MenuDataProps {
3
+ menus: Array<MenuProps>;
4
+ historyIds: string[];
5
+ quickMenus: Array<{
6
+ menuRelationId: string;
7
+ standardCollectionId: string;
8
+ }>;
9
+ selectedIds: string[];
10
+ }
11
+
12
+ export interface MenuTree {
13
+ name: string;
14
+ menuType: string;
15
+ parentMenuId: string;
16
+ pid: string;
17
+ children: Array<MenuTree>;
18
+ [key: string]: any;
19
+ }
20
+
21
+ export interface MenuProps {
22
+ companyId: string;
23
+ companyName: string;
24
+ menuTree: Array<MenuTree>;
25
+ tenantId: string;
26
+ tenantName: string;
27
+ }