kn-cli 1.0.90 → 1.0.92

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 (271) hide show
  1. package/package.json +1 -1
  2. package/readme.md +7 -0
  3. package/src/create.js +22 -2
  4. package/src/utils/index.js +1 -1
  5. package/templates/template_admin/cli.config.js +1 -1
  6. package/templates/template_admin/jsconfig.json +5 -1
  7. package/templates/template_admin/package.json +1 -1
  8. package/templates/template_admin/public/index.html +2 -2
  9. package/templates/template_admin/public/src/components/{Auth → auth}/index.jsx +21 -3
  10. package/templates/template_admin/public/src/components/{IconFont → iconFont}/index.jsx +10 -0
  11. package/templates/template_admin/public/src/components/{Layout/Basic → layout/basic}/index.jsx +13 -3
  12. package/templates/template_admin/public/src/components/layout/centerBody/index.jsx +25 -0
  13. package/templates/template_admin/public/src/components/{Layout → layout}/index.jsx +15 -6
  14. package/templates/template_admin/public/src/components/layout/provider/index.jsx +19 -0
  15. package/templates/{template_app/public/src/components/Link → template_admin/public/src/components/link}/index.jsx +15 -0
  16. package/templates/template_admin/public/src/components/{Menu → menu}/index.jsx +15 -8
  17. package/templates/{template_app/public/src/components/Page/PageLoading → template_admin/public/src/components/page/pageLoading}/index.jsx +25 -4
  18. package/templates/{template_app/public/src/components/Popup → template_admin/public/src/components/popup}/index.jsx +13 -0
  19. package/templates/template_admin/public/src/components/{Toast → toast}/index.jsx +20 -1
  20. package/templates/template_admin/public/src/components/{TopMenu → topMenu}/index.jsx +13 -8
  21. package/templates/template_admin/public/src/dictionary/index.js +8 -3
  22. package/templates/template_admin/public/src/hooks/index.jsx +1 -0
  23. package/templates/template_admin/public/src/hooks/useDelay.jsx +5 -0
  24. package/templates/template_admin/public/src/hooks/useImageLoader.jsx +1 -2
  25. package/templates/template_admin/public/src/hooks/useLoading.jsx +5 -1
  26. package/templates/template_admin/public/src/hooks/usePreload.jsx +2 -1
  27. package/templates/template_admin/public/src/hooks/useScrollTop.jsx +12 -0
  28. package/templates/template_admin/public/src/hooks/useSearch.jsx +28 -2
  29. package/templates/template_admin/public/src/hooks/useUpdate.jsx +5 -0
  30. package/templates/template_admin/public/src/index.jsx +16 -2
  31. package/templates/template_admin/public/src/pages/material/index.jsx +2 -1
  32. package/templates/template_admin/public/src/pages/user/index.jsx +7 -2
  33. package/templates/template_admin/public/src/provider/app.jsx +39 -4
  34. package/templates/template_admin/public/src/provider/menu.jsx +4 -1
  35. package/templates/template_admin/public/src/route.jsx +8 -5
  36. package/templates/template_admin/public/src/services/index.js +38 -4
  37. package/templates/template_admin/public/src/services/user.js +3 -3
  38. package/templates/template_admin/public/src/type.js +48 -0
  39. package/templates/template_admin/public/src/utils/index.js +34 -18
  40. package/templates/template_app/cli.config.js +1 -1
  41. package/templates/template_app/jsconfig.json +5 -1
  42. package/templates/template_app/package.json +1 -1
  43. package/templates/template_app/public/src/components/{Auth → auth}/index.jsx +20 -2
  44. package/templates/template_app/public/src/components/{Header → header}/index.jsx +25 -1
  45. package/templates/{template_oa_jwt/public/src/components/IconFont → template_app/public/src/components/iconFont}/index.jsx +10 -0
  46. package/templates/template_app/public/src/components/{Layout/App → layout/app}/index.jsx +12 -2
  47. package/templates/template_app/public/src/components/layout/index.jsx +6 -0
  48. package/templates/{template_admin/public/src/components/Layout/Provider → template_app/public/src/components/layout/provider}/index.jsx +3 -0
  49. package/templates/template_app/public/src/components/link/index.jsx +39 -0
  50. package/templates/template_app/public/src/components/{Marquee → marquee}/index.jsx +11 -2
  51. package/templates/{template_oa/public/src/components/Page/PageLoading → template_app/public/src/components/page/pageLoading}/index.jsx +23 -3
  52. package/templates/{template_oa_jwt/public/src/components/Popup → template_app/public/src/components/popup}/index.jsx +13 -0
  53. package/templates/{template_oa_jwt/public/src/components/Toast → template_app/public/src/components/toast}/index.jsx +21 -1
  54. package/templates/template_app/public/src/dictionary/index.js +7 -3
  55. package/templates/template_app/public/src/hooks/index.jsx +1 -0
  56. package/templates/template_app/public/src/hooks/useDelay.jsx +5 -0
  57. package/templates/template_app/public/src/hooks/useImageLoader.jsx +1 -2
  58. package/templates/template_app/public/src/hooks/useLoading.jsx +5 -1
  59. package/templates/template_app/public/src/hooks/usePreload.jsx +2 -1
  60. package/templates/template_app/public/src/hooks/useScrollTop.jsx +12 -0
  61. package/templates/template_app/public/src/index.jsx +22 -5
  62. package/templates/template_app/public/src/pages/dictionary/index.jsx +9 -1
  63. package/templates/template_app/public/src/pages/index.jsx +16 -4
  64. package/templates/template_app/public/src/pages/list/index.jsx +7 -1
  65. package/templates/template_app/public/src/pages/login/index.jsx +10 -4
  66. package/templates/template_app/public/src/pages/user/index.jsx +7 -2
  67. package/templates/template_app/public/src/provider/app.jsx +5 -3
  68. package/templates/template_app/public/src/route.jsx +5 -2
  69. package/templates/template_app/public/src/services/index.js +10 -8
  70. package/templates/template_app/public/src/services/user.js +4 -4
  71. package/templates/template_app/public/src/type.js +27 -0
  72. package/templates/template_app/public/src/utils/index.js +6 -0
  73. package/templates/template_oa/cli.config.js +1 -1
  74. package/templates/template_oa/jsconfig.json +5 -1
  75. package/templates/template_oa/package.json +1 -1
  76. package/templates/template_oa/public/src/components/dialog/index.jsx +237 -0
  77. package/templates/{template_oa_jwt/public/src/components/Empty → template_oa/public/src/components/empty}/index.jsx +9 -0
  78. package/templates/{template_oa_jwt/public/src/components/FormRow → template_oa/public/src/components/formRow}/index.jsx +25 -3
  79. package/templates/{template_oa_jwt/public/src/components/FormTable → template_oa/public/src/components/formTable}/index.jsx +39 -1
  80. package/templates/template_oa/public/src/components/iconFont/index.jsx +22 -0
  81. package/templates/template_oa/public/src/components/{IFrame → iframe}/index.jsx +18 -4
  82. package/templates/template_oa/public/src/components/{Layout/Basic → layout/basic}/index.jsx +7 -1
  83. package/templates/template_oa/public/src/components/{Layout/CenterBody → layout/centerBody}/index.jsx +2 -0
  84. package/templates/template_oa/public/src/components/{Layout/FormBlock → layout/formBlock}/index.jsx +3 -1
  85. package/templates/{template_oa_jwt/public/src/components/Layout → template_oa/public/src/components/layout}/index.jsx +12 -6
  86. package/templates/{template_oa_jwt/public/src/components/Layout/Provider → template_oa/public/src/components/layout/provider}/index.jsx +4 -0
  87. package/templates/{template_offcial/public/src/components/Link → template_oa/public/src/components/link}/index.jsx +16 -0
  88. package/templates/template_oa/public/src/components/{Nav → nav}/index.jsx +8 -2
  89. package/templates/{template_admin/public/src/components/Page/PageLoading → template_oa/public/src/components/page/pageLoading}/index.jsx +25 -4
  90. package/templates/{template_admin/public/src/components/Popup → template_oa/public/src/components/popup}/index.jsx +13 -0
  91. package/templates/{template_oa_jwt/public/src/components/Select/DepSelect → template_oa/public/src/components/select/depSelect}/index.jsx +15 -0
  92. package/templates/template_oa/public/src/components/{Select/StaffSelect → select/staffSelect}/index.jsx +27 -0
  93. package/templates/template_oa/public/src/components/title/index.jsx +3 -0
  94. package/templates/template_oa/public/src/components/{Toast → toast}/index.jsx +21 -1
  95. package/templates/template_oa/public/src/components/{Upload → upload}/index.jsx +41 -3
  96. package/templates/template_oa/public/src/hooks/index.jsx +1 -0
  97. package/templates/template_oa/public/src/hooks/useDelay.jsx +5 -0
  98. package/templates/template_oa/public/src/hooks/useImageLoader.jsx +1 -2
  99. package/templates/template_oa/public/src/hooks/useLoading.jsx +5 -1
  100. package/templates/template_oa/public/src/hooks/usePreload.jsx +2 -1
  101. package/templates/template_oa/public/src/hooks/useScrollTop.jsx +12 -0
  102. package/templates/template_oa/public/src/hooks/useSearch.jsx +28 -2
  103. package/templates/template_oa/public/src/hooks/useUpdate.jsx +5 -0
  104. package/templates/template_oa/public/src/index.jsx +15 -1
  105. package/templates/template_oa/public/src/pages/video/index.jsx +17 -13
  106. package/templates/template_oa/public/src/provider/app.jsx +33 -2
  107. package/templates/template_oa/public/src/route.jsx +4 -2
  108. package/templates/template_oa/public/src/services/common.js +11 -0
  109. package/templates/template_oa/public/src/services/index.js +44 -2
  110. package/templates/template_oa/public/src/type.js +48 -0
  111. package/templates/template_oa/public/src/utils/index.js +34 -17
  112. package/templates/template_oa_jwt/cli.config.js +1 -1
  113. package/templates/template_oa_jwt/jsconfig.json +5 -1
  114. package/templates/template_oa_jwt/package.json +1 -1
  115. package/templates/template_oa_jwt/public/src/components/dialog/index.jsx +237 -0
  116. package/templates/{template_oa/public/src/components/Empty → template_oa_jwt/public/src/components/empty}/index.jsx +9 -0
  117. package/templates/{template_oa/public/src/components/FormRow → template_oa_jwt/public/src/components/formRow}/index.jsx +25 -3
  118. package/templates/{template_oa/public/src/components/FormTable → template_oa_jwt/public/src/components/formTable}/index.jsx +41 -2
  119. package/templates/template_oa_jwt/public/src/components/formTable/index.less +18 -0
  120. package/templates/template_oa_jwt/public/src/components/iconFont/index.jsx +22 -0
  121. package/templates/template_oa_jwt/public/src/components/{IFrame → iframe}/index.jsx +15 -0
  122. package/templates/template_oa_jwt/public/src/components/{Layout/Basic → layout/basic}/index.jsx +11 -6
  123. package/templates/template_oa_jwt/public/src/components/{Layout/CenterBody → layout/centerBody}/index.jsx +2 -0
  124. package/templates/template_oa_jwt/public/src/components/{Layout/FormBlock → layout/formBlock}/index.jsx +3 -1
  125. package/templates/{template_oa/public/src/components/Layout → template_oa_jwt/public/src/components/layout}/index.jsx +10 -4
  126. package/templates/{template_oa/public/src/components/Layout/Provider → template_oa_jwt/public/src/components/layout/provider}/index.jsx +4 -0
  127. package/templates/template_oa_jwt/public/src/components/{Link → link}/index.jsx +16 -0
  128. package/templates/template_oa_jwt/public/src/components/{Nav → nav}/index.jsx +11 -5
  129. package/templates/template_oa_jwt/public/src/components/{Page/PageLoading → page/pageLoading}/index.jsx +25 -4
  130. package/templates/{template_oa/public/src/components/Popup → template_oa_jwt/public/src/components/popup}/index.jsx +13 -0
  131. package/templates/{template_oa/public/src/components/Select/DepSelect → template_oa_jwt/public/src/components/select/depSelect}/index.jsx +15 -0
  132. package/templates/template_oa_jwt/public/src/components/{Select/StaffSelect → select/staffSelect}/index.jsx +27 -0
  133. package/templates/template_oa_jwt/public/src/components/title/index.jsx +3 -0
  134. package/templates/template_oa_jwt/public/src/components/toast/index.jsx +80 -0
  135. package/templates/template_oa_jwt/public/src/components/{Upload → upload}/index.jsx +41 -3
  136. package/templates/template_oa_jwt/public/src/dictionary/index.js +2 -0
  137. package/templates/template_oa_jwt/public/src/hooks/index.jsx +2 -2
  138. package/templates/template_oa_jwt/public/src/hooks/useDelay.jsx +5 -0
  139. package/templates/template_oa_jwt/public/src/hooks/useImageLoader.jsx +1 -2
  140. package/templates/template_oa_jwt/public/src/hooks/useLoading.jsx +5 -1
  141. package/templates/template_oa_jwt/public/src/hooks/usePreload.jsx +2 -1
  142. package/templates/template_oa_jwt/public/src/hooks/useScrollTop.jsx +12 -0
  143. package/templates/template_oa_jwt/public/src/hooks/useSearch.jsx +28 -2
  144. package/templates/template_oa_jwt/public/src/hooks/useUpdate.jsx +5 -0
  145. package/templates/template_oa_jwt/public/src/pages/demo/index.jsx +17 -11
  146. package/templates/template_oa_jwt/public/src/provider/app.jsx +30 -1
  147. package/templates/template_oa_jwt/public/src/route.jsx +4 -2
  148. package/templates/template_oa_jwt/public/src/services/common.js +13 -1
  149. package/templates/template_oa_jwt/public/src/services/index.js +52 -8
  150. package/templates/template_oa_jwt/public/src/services/token.js +7 -0
  151. package/templates/template_oa_jwt/public/src/utils/index.js +62 -22
  152. package/templates/template_offcial/cli.config.js +1 -1
  153. package/templates/template_offcial/jsconfig.json +5 -1
  154. package/templates/template_offcial/package.json +1 -1
  155. package/templates/template_offcial/public/src/components/{Footer → footer}/index.jsx +15 -1
  156. package/templates/template_offcial/public/src/components/{Header → header}/index.jsx +14 -0
  157. package/templates/{template_app/public/src/components/IconFont → template_offcial/public/src/components/iconFont}/index.jsx +10 -0
  158. package/templates/template_offcial/public/src/components/{Layout → layout}/index.jsx +10 -3
  159. package/templates/{template_app/public/src/components/Layout/Provider → template_offcial/public/src/components/layout/provider}/index.jsx +7 -0
  160. package/templates/template_offcial/public/src/components/link/index.jsx +39 -0
  161. package/templates/template_offcial/public/src/components/page/pageLoading/index.jsx +51 -0
  162. package/templates/template_offcial/public/src/components/popup/index.jsx +35 -0
  163. package/templates/{template_app/public/src/components/Toast → template_offcial/public/src/components/toast}/index.jsx +20 -1
  164. package/templates/template_offcial/public/src/hooks/index.jsx +1 -0
  165. package/templates/template_offcial/public/src/hooks/useImageLoader.jsx +1 -0
  166. package/templates/template_offcial/public/src/hooks/useInToView.jsx +3 -0
  167. package/templates/template_offcial/public/src/hooks/usePreload.jsx +1 -0
  168. package/templates/template_offcial/public/src/hooks/useScroll.jsx +8 -0
  169. package/templates/template_offcial/public/src/index.jsx +15 -2
  170. package/templates/template_offcial/public/src/pages/index.jsx +8 -1
  171. package/templates/template_offcial/public/src/pages/pc/index.jsx +4 -2
  172. package/templates/template_offcial/public/src/provider/app.jsx +28 -2
  173. package/templates/template_offcial/public/src/route.jsx +4 -2
  174. package/templates/template_offcial/public/src/services/index.js +38 -2
  175. package/templates/template_offcial/public/src/services/user.js +3 -3
  176. package/templates/template_offcial/public/src/type.js +47 -0
  177. package/templates/template_admin/public/src/components/Alert/index.jsx +0 -0
  178. package/templates/template_admin/public/src/components/Alert/index.less +0 -0
  179. package/templates/template_admin/public/src/components/Header/index.jsx +0 -57
  180. package/templates/template_admin/public/src/components/Layout/CenterBody/index.jsx +0 -15
  181. package/templates/template_admin/public/src/components/Link/index.jsx +0 -24
  182. package/templates/template_admin/public/src/components/Loading/index.jsx +0 -14
  183. package/templates/template_admin/public/src/components/Loading/index.less +0 -85
  184. package/templates/template_admin/public/src/components/mask/index.jsx +0 -47
  185. package/templates/template_admin/public/src/components/mask/index.less +0 -32
  186. package/templates/template_admin/public/src/hooks/useLogin.jsx +0 -33
  187. package/templates/template_app/public/src/components/Header/index.less +0 -57
  188. package/templates/template_app/public/src/components/Layout/index.jsx +0 -4
  189. package/templates/template_app/public/src/hooks/useLogin.jsx +0 -33
  190. package/templates/template_oa/public/src/components/Alert/index.jsx +0 -0
  191. package/templates/template_oa/public/src/components/Alert/index.less +0 -0
  192. package/templates/template_oa/public/src/components/Auth/index.jsx +0 -44
  193. package/templates/template_oa/public/src/components/Dialog/index.jsx +0 -150
  194. package/templates/template_oa/public/src/components/Footer/index.jsx +0 -17
  195. package/templates/template_oa/public/src/components/Footer/index.less +0 -28
  196. package/templates/template_oa/public/src/components/IconFont/index.jsx +0 -10
  197. package/templates/template_oa/public/src/components/Link/index.jsx +0 -24
  198. package/templates/template_oa/public/src/components/Loading/index.jsx +0 -14
  199. package/templates/template_oa/public/src/components/Loading/index.less +0 -85
  200. package/templates/template_oa_jwt/public/src/components/Alert/index.jsx +0 -0
  201. package/templates/template_oa_jwt/public/src/components/Alert/index.less +0 -0
  202. package/templates/template_oa_jwt/public/src/components/Auth/index.jsx +0 -44
  203. package/templates/template_oa_jwt/public/src/components/Dialog/index.jsx +0 -150
  204. package/templates/template_oa_jwt/public/src/components/Footer/index.jsx +0 -17
  205. package/templates/template_oa_jwt/public/src/components/Footer/index.less +0 -28
  206. package/templates/template_oa_jwt/public/src/components/Loading/index.jsx +0 -16
  207. package/templates/template_oa_jwt/public/src/components/Loading/index.less +0 -96
  208. package/templates/template_offcial/public/src/components/Alert/index.jsx +0 -0
  209. package/templates/template_offcial/public/src/components/Alert/index.less +0 -0
  210. package/templates/template_offcial/public/src/components/IconFont/index.jsx +0 -10
  211. package/templates/template_offcial/public/src/components/Layout/Provider/index.jsx +0 -12
  212. package/templates/template_offcial/public/src/components/Page/PageLoading/index.jsx +0 -30
  213. package/templates/template_offcial/public/src/components/Popup/index.jsx +0 -22
  214. package/templates/template_offcial/public/src/components/Toast/index.jsx +0 -60
  215. /package/templates/template_admin/public/src/components/{IconFont → iconFont}/index.less +0 -0
  216. /package/templates/template_admin/public/src/components/{Layout/Basic → layout/basic}/index.less +0 -0
  217. /package/templates/template_admin/public/src/components/{Layout/CenterBody → layout/centerBody}/index.less +0 -0
  218. /package/templates/template_admin/public/src/components/{Layout → layout}/index.less +0 -0
  219. /package/templates/template_admin/public/src/components/{Link → link}/index.less +0 -0
  220. /package/templates/template_admin/public/src/components/{Menu → menu}/index.less +0 -0
  221. /package/templates/template_admin/public/src/components/{Page/PageLoading → page/pageLoading}/index.less +0 -0
  222. /package/templates/template_admin/public/src/components/{Popup → popup}/index.less +0 -0
  223. /package/templates/template_admin/public/src/components/{Toast → toast}/index.less +0 -0
  224. /package/templates/template_admin/public/src/components/{TopMenu → topMenu}/index.less +0 -0
  225. /package/templates/{template_admin/public/src/components/Header → template_app/public/src/components/header}/index.less +0 -0
  226. /package/templates/template_app/public/src/components/{IconFont → iconFont}/index.less +0 -0
  227. /package/templates/template_app/public/src/components/{Layout/App → layout/app}/index.less +0 -0
  228. /package/templates/template_app/public/src/components/{Link → link}/index.less +0 -0
  229. /package/templates/template_app/public/src/components/{Marquee → marquee}/index.less +0 -0
  230. /package/templates/template_app/public/src/components/{Page/PageLoading → page/pageLoading}/index.less +0 -0
  231. /package/templates/template_app/public/src/components/{Popup → popup}/index.less +0 -0
  232. /package/templates/template_app/public/src/components/{Toast → toast}/index.less +0 -0
  233. /package/templates/template_oa/public/src/components/{Dialog → dialog}/index.less +0 -0
  234. /package/templates/template_oa/public/src/components/{Empty → empty}/index.less +0 -0
  235. /package/templates/template_oa/public/src/components/{FormRow → formRow}/index.less +0 -0
  236. /package/templates/{template_oa_jwt/public/src/components/FormTable → template_oa/public/src/components/formTable}/index.less +0 -0
  237. /package/templates/template_oa/public/src/components/{IconFont → iconFont}/index.less +0 -0
  238. /package/templates/template_oa/public/src/components/{IFrame → iframe}/index.less +0 -0
  239. /package/templates/template_oa/public/src/components/{Layout/Basic → layout/basic}/index.less +0 -0
  240. /package/templates/template_oa/public/src/components/{Layout/CenterBody → layout/centerBody}/index.less +0 -0
  241. /package/templates/template_oa/public/src/components/{Layout/FormBlock → layout/formBlock}/index.less +0 -0
  242. /package/templates/template_oa/public/src/components/{Layout → layout}/index.less +0 -0
  243. /package/templates/template_oa/public/src/components/{Link → link}/index.less +0 -0
  244. /package/templates/template_oa/public/src/components/{Nav → nav}/index.less +0 -0
  245. /package/templates/template_oa/public/src/components/{Page/PageLoading → page/pageLoading}/index.less +0 -0
  246. /package/templates/template_oa/public/src/components/{Popup → popup}/index.less +0 -0
  247. /package/templates/template_oa/public/src/components/{Select/StaffSelect → select/staffSelect}/index.less +0 -0
  248. /package/templates/template_oa/public/src/components/{Toast → toast}/index.less +0 -0
  249. /package/templates/template_oa_jwt/public/src/components/{Dialog → dialog}/index.less +0 -0
  250. /package/templates/template_oa_jwt/public/src/components/{Empty → empty}/index.less +0 -0
  251. /package/templates/template_oa_jwt/public/src/components/{FormRow → formRow}/index.less +0 -0
  252. /package/templates/template_oa_jwt/public/src/components/{IconFont → iconFont}/index.less +0 -0
  253. /package/templates/template_oa_jwt/public/src/components/{IFrame → iframe}/index.less +0 -0
  254. /package/templates/template_oa_jwt/public/src/components/{Layout/Basic → layout/basic}/index.less +0 -0
  255. /package/templates/template_oa_jwt/public/src/components/{Layout/CenterBody → layout/centerBody}/index.less +0 -0
  256. /package/templates/template_oa_jwt/public/src/components/{Layout/FormBlock → layout/formBlock}/index.less +0 -0
  257. /package/templates/template_oa_jwt/public/src/components/{Layout → layout}/index.less +0 -0
  258. /package/templates/template_oa_jwt/public/src/components/{Link → link}/index.less +0 -0
  259. /package/templates/template_oa_jwt/public/src/components/{Nav → nav}/index.less +0 -0
  260. /package/templates/template_oa_jwt/public/src/components/{Page/PageLoading → page/pageLoading}/index.less +0 -0
  261. /package/templates/template_oa_jwt/public/src/components/{Popup → popup}/index.less +0 -0
  262. /package/templates/template_oa_jwt/public/src/components/{Select/StaffSelect → select/staffSelect}/index.less +0 -0
  263. /package/templates/template_oa_jwt/public/src/components/{Toast → toast}/index.less +0 -0
  264. /package/templates/template_offcial/public/src/components/{Footer → footer}/index.less +0 -0
  265. /package/templates/template_offcial/public/src/components/{Header → header}/index.less +0 -0
  266. /package/templates/template_offcial/public/src/components/{IconFont → iconFont}/index.less +0 -0
  267. /package/templates/template_offcial/public/src/components/{Layout → layout}/index.less +0 -0
  268. /package/templates/template_offcial/public/src/components/{Link → link}/index.less +0 -0
  269. /package/templates/template_offcial/public/src/components/{Page/PageLoading → page/pageLoading}/index.less +0 -0
  270. /package/templates/template_offcial/public/src/components/{Popup → popup}/index.less +0 -0
  271. /package/templates/template_offcial/public/src/components/{Toast → toast}/index.less +0 -0
@@ -0,0 +1,39 @@
1
+ // @ts-ignore
2
+ import React from 'react';
3
+
4
+ import { openLink } from '@/utils';
5
+
6
+ // @ts-ignore
7
+ import styles from './index.less';
8
+
9
+ /**
10
+ * 超链接组件
11
+ * @param {object} [props]
12
+ * @param {JSX.Element|string} [props.children] - 子组件
13
+ * @param {string} [props.className] - 扩展类样式名称
14
+ * @param {Function} [props.onClick] - 点击链接的回调
15
+ * @param {string} [props.href] - 跳转链接
16
+ * @param {string} [props.target] - 当target='_blank'时代表新窗口打开
17
+ *
18
+ * @returns {JSX.Element}
19
+ */
20
+ const Link=(props)=>{
21
+ const {children,className='',onClick,href='',target=''} = props;
22
+
23
+ const onLink=()=>{
24
+ if(href){
25
+ if(target=='_blank'){
26
+ openLink(href);
27
+ // window.open(href);
28
+ }else{
29
+ location.href=href;
30
+ }
31
+ return;
32
+ }
33
+ if(onClick)onClick();
34
+ }
35
+ return (
36
+ <span onClick={onLink} className={`${styles.linkWrap} ${className}`}>{children}</span>
37
+ )
38
+ }
39
+ export default React.memo(Link);
@@ -0,0 +1,51 @@
1
+ // @ts-ignore
2
+ import React from 'react';
3
+ // @ts-ignore
4
+ import ReactDOM from 'react-dom';
5
+
6
+ import Popup from '@/components/popup';
7
+
8
+ // @ts-ignore
9
+ import imgLoading from '@/assets/images/loading.svg';
10
+
11
+ // @ts-ignore
12
+ import CSS from './index.less';
13
+
14
+ /**
15
+ * 页面Loading状态
16
+ * @param {object} [props]
17
+ * @param {boolean} [props.visible=true] - 是否显示状态
18
+ *
19
+ * @returns {JSX.Element}
20
+ */
21
+ const PageLoading = (props) => {
22
+ const {visible=true} = props;
23
+ if(!visible){
24
+ return <></>;
25
+ }
26
+ return (
27
+ <div className={CSS.wrap } >
28
+ <div className={CSS.box} data-show={visible}>
29
+ <img src={imgLoading} />
30
+ </div>
31
+ </div>
32
+ );
33
+ };
34
+
35
+ /**
36
+ * 全屏置顶显示一个页面loading组件
37
+ * @param {object} [props]
38
+ * @param {boolean} [props.canTouch=false] - 是否允许用户点击屏幕穿透到下面的组件
39
+ *
40
+ * @returns {(string)=>void}
41
+ */
42
+ export const ShowPageLoading=(props={canTouch:false})=>{
43
+ let popup = Popup(()=>{},{cantouch:props.canTouch});
44
+ ReactDOM.render(
45
+ <PageLoading visible={true} />,
46
+ popup.dom
47
+ );
48
+ return popup.destory;
49
+ }
50
+
51
+ export default React.memo(PageLoading);
@@ -0,0 +1,35 @@
1
+ // @ts-ignore
2
+ import React from 'react';
3
+ // @ts-ignore
4
+ import ReactDOM from 'react-dom';
5
+
6
+ // @ts-ignore
7
+ import styles from './index.less';
8
+ styles;
9
+
10
+ /**
11
+ * 一个全屏置顶的遮罩层
12
+ * @param {(result)=>void} reslove - 遮罩层的关闭回调
13
+ * @param {Object} [options] - 参数
14
+ * @param {boolean} [options.cantouch=false] - 是否允许被点击穿透
15
+ * @param {boolean} [options.transparent=false] - 是否遮罩层完全透明
16
+ *
17
+ * @returns { {dom:HTMLElement,destory:()=>void} }
18
+ */
19
+ const Popup = (reslove,options) => {
20
+ let rootDom = document.createElement('div');
21
+ rootDom.className='popup-box';
22
+ if(options&&options.cantouch)rootDom.setAttribute('data-can-touch','1');
23
+ if(options&&options.transparent)rootDom.setAttribute('data-transparent','1');
24
+
25
+ let destory = (result) => {
26
+ ReactDOM.unmountComponentAtNode(rootDom);
27
+ rootDom.parentNode.removeChild(rootDom);
28
+ if (reslove) reslove(result);
29
+ };
30
+ document.body.appendChild(rootDom);
31
+ return { dom: rootDom, destory };
32
+ };
33
+
34
+
35
+ export default Popup;
@@ -1,7 +1,13 @@
1
+ // @ts-ignore
1
2
  import React,{useEffect} from 'react';
3
+ // @ts-ignore
2
4
  import ReactDOM from 'react-dom';
5
+
6
+ // @ts-ignore
7
+ import Popup from '@/components/popup';
8
+
9
+ // @ts-ignore
3
10
  import styles from './index.less';
4
- import Popup from '@/components/Popup/index.jsx';
5
11
 
6
12
  const toastList=[];
7
13
  const runNext=()=>{
@@ -43,12 +49,25 @@ const Toast=props=>{
43
49
  )
44
50
  }
45
51
 
52
+ /**
53
+ * @typedef {object} ToastOptions
54
+ * @property {string} message - 吐司文案内容
55
+ * @property {number} [delay=2000] - 持续时间,毫秒
56
+ * @property {string} [position] - 显示位置,center|top|bottom
57
+ * @property {Function} [resolve] - 显示完毕的回调
58
+ */
46
59
 
60
+ /**
61
+ * 显示一个吐司信息
62
+ * @param {ToastOptions|string} [props] - 文案内容或一个配置参数
63
+ * @returns { Promise }
64
+ */
47
65
  const ShowToast=props=>{
48
66
  if(typeof props === 'string'){
49
67
  props = {message:props}
50
68
  }
51
69
  return new Promise((resolve) => {
70
+ // @ts-ignore
52
71
  props.resolve = resolve;
53
72
  toastList.push(props);
54
73
  if(toastList.length===1){
@@ -2,6 +2,7 @@
2
2
 
3
3
  import useImageLoader from './useImageLoader';
4
4
  import usePreload from './usePreload';
5
+ // @ts-ignore
5
6
  import {usePagination,usePaginationWithForm} from 'kn-hooks';
6
7
 
7
8
  export {
@@ -1,3 +1,4 @@
1
+ // @ts-ignore
1
2
  import React, { useEffect,useState,useMemo } from 'react';
2
3
 
3
4
 
@@ -1,3 +1,4 @@
1
+ // @ts-ignore
1
2
  import React, { useEffect,useState,useMemo,useRef,useCallback } from 'react';
2
3
 
3
4
 
@@ -9,6 +10,7 @@ const useInToView=(props)=>{
9
10
 
10
11
  const destory=()=>{
11
12
  if(refObserver.current){
13
+ // @ts-ignore
12
14
  refObserver.current=disconnect();
13
15
  refObserver.current=null;
14
16
  }
@@ -34,6 +36,7 @@ const useInToView=(props)=>{
34
36
  setVisibled(true);
35
37
  });
36
38
  observe.observe(refDom.current);
39
+ // @ts-ignore
37
40
  refObserver.current=observe;
38
41
  }
39
42
  const setDom=(dom)=>{
@@ -1,3 +1,4 @@
1
+ // @ts-ignore
1
2
  import React, { useEffect,useState,useMemo,useRef,useCallback } from 'react';
2
3
 
3
4
  const usePreload=(files)=>{
@@ -1,3 +1,4 @@
1
+ // @ts-ignore
1
2
  import React, { useEffect, useState, useRef } from 'react';
2
3
 
3
4
 
@@ -12,7 +13,9 @@ const useScroll=(targetDom='#appLayout')=>{
12
13
  const refScrollDom = useRef();
13
14
  const refSetIsScroll = useRef();
14
15
  const refIsScroll = useRef();
16
+ // @ts-ignore
15
17
  refIsScroll.current= isScroll;
18
+ // @ts-ignore
16
19
  refSetIsScroll.current= setIsScroll;
17
20
 
18
21
  useEffect(()=>{
@@ -22,15 +25,18 @@ const useScroll=(targetDom='#appLayout')=>{
22
25
  refScrollDom.current = targetDom;
23
26
  }
24
27
  let dom = refScrollDom.current;
28
+ // @ts-ignore
25
29
  setHeight(dom.clientHeight)
26
30
 
27
31
  const fn=(e)=>{
28
32
  if(e.target.scrollTop>0){
29
33
  if(!refIsScroll.current){
34
+ // @ts-ignore
30
35
  refSetIsScroll.current(true);
31
36
  }
32
37
  }else{
33
38
  if(refIsScroll.current){
39
+ // @ts-ignore
34
40
  refSetIsScroll.current(false);
35
41
  }
36
42
  }
@@ -38,8 +44,10 @@ const useScroll=(targetDom='#appLayout')=>{
38
44
  fn(e.target.scrollTop);
39
45
  })
40
46
  }
47
+ // @ts-ignore
41
48
  dom.addEventListener('scroll',fn);
42
49
  return ()=>{
50
+ // @ts-ignore
43
51
  dom.removeEventListener('scroll',fn);
44
52
  }
45
53
  },[]);
@@ -1,5 +1,8 @@
1
+ // @ts-ignore
1
2
  import React from 'react';
3
+ // @ts-ignore
2
4
  import ReactDOM from 'react-dom';
5
+ // @ts-ignore
3
6
  import {HashRouter} from 'react-router-dom';
4
7
  // import {createRoot} from 'react-dom/client';
5
8
  // import { createHashRouter,RouterProvider } from 'react-router-dom';
@@ -7,33 +10,43 @@ import './_antd.less';
7
10
  import './_reset.less';
8
11
  import {RouteList} from './route';
9
12
 
10
-
13
+ // @ts-ignore
11
14
  if(MOCK){
12
15
  let mock = require('@/mock');
13
16
  mock;
14
17
  }
15
-
18
+ // @ts-ignore
16
19
  window.appLog=(txt)=>{
17
20
  console.log(txt);
18
21
  }
19
22
 
20
23
  /* eslint-disable */
24
+ // @ts-ignore
21
25
  if(BUILD_ENV!='prod'){
26
+ // @ts-ignore
22
27
  let VConsole = require('vconsole');
28
+ // @ts-ignore
23
29
  const vConsole = new VConsole();
24
30
  setTimeout(() => {
25
31
  vConsole.setSwitchPosition(70, 10);
26
32
  }, 2000);
27
33
  }
28
34
 
35
+ // @ts-ignore
29
36
  if(BUILD_ENV){
37
+ // @ts-ignore
30
38
  window.appLog(`代码环境类型:${BUILD_ENV}`);
31
39
  }
40
+ // @ts-ignore
32
41
  if (VERSION_HASH) {
42
+ // @ts-ignore
33
43
  window.appLog(`VERSION_HASH:${VERSION_HASH}`);
34
44
  }
45
+ // @ts-ignore
35
46
  window.appLog(`log init`);
47
+ // @ts-ignore
36
48
  window.appLog(`${location.href}`);
49
+ // @ts-ignore
37
50
  window.appLog(`ua:${navigator.userAgent}`);
38
51
  /* eslint-enable */
39
52
 
@@ -1,10 +1,17 @@
1
+ // @ts-ignore
1
2
  import React, { useState, useEffect } from 'react';
2
- import { isMobile } from '@/utils';
3
+ // @ts-ignore
3
4
  import { useNavigate } from 'react-router-dom';
4
5
 
6
+ import { isMobile } from '@/utils';
7
+
5
8
 
6
9
 
7
10
 
11
+ /**
12
+ *
13
+ * @returns {JSX.Element}
14
+ */
8
15
  const Home = () => {
9
16
  console.log('🌹🌹🌹 Home 🌹🌹🌹')
10
17
  const navigate = useNavigate();
@@ -1,8 +1,10 @@
1
1
 
2
2
  import React, { useState, useEffect } from 'react';
3
- import Header from '@/components/Header';
3
+ import Header from '@/components/header';
4
+
5
+ // @ts-ignore
4
6
  import styles from './index.less';
5
- import Footer from '@/components/Footer';
7
+ import Footer from '@/components/footer';
6
8
  import useInToView from '@/hooks/useInToView';
7
9
 
8
10
  const PcHome=()=>{
@@ -1,7 +1,28 @@
1
- import { useState,useMemo, useEffect } from 'react';
2
- import { useSearchParams,useNavigate } from 'react-router-dom';
1
+ // @ts-ignore
2
+ import { useState,useMemo } from 'react';
3
+ // @ts-ignore
4
+ import { useNavigate } from 'react-router-dom';
5
+ // @ts-ignore
3
6
  import { createContainer } from "unstated-next"
4
7
 
8
+
9
+
10
+ /**
11
+ * @typedef AppContaniner
12
+ * @property {boolean} loading - 当前是否是加载状态
13
+ * @property {(open:boolean)=>void} setLoading - 设置加载状态
14
+ * @property {object} nav - 导航栏配置
15
+ * @property {(option:object)=>void} setNav - 设置导航栏配置
16
+ *
17
+ */
18
+
19
+ /**
20
+ * @typedef {object} AppProvider
21
+ * @property {function():AppContaniner} useContainer
22
+ * @property {React.ComponentType<any>} Provider
23
+ */
24
+
25
+
5
26
  const useApp=() =>{
6
27
  const navigate= useNavigate();
7
28
  const [loading,setLoading] = useState(true);
@@ -21,6 +42,11 @@ const useApp=() =>{
21
42
  return action
22
43
  }
23
44
 
45
+
46
+
47
+ /**
48
+ * @type {AppProvider}
49
+ */
24
50
  const App = createContainer(useApp);
25
51
 
26
52
  export default App;
@@ -1,8 +1,10 @@
1
+ // @ts-ignore
1
2
  import React,{Suspense} from 'react';
3
+ // @ts-ignore
2
4
  import { Routes, Route } from 'react-router-dom';
3
5
 
4
- import {Layout} from '@/components/Layout';
5
- import PageLoading from '@/components/Page/PageLoading';
6
+ import {Layout} from '@/components/layout';
7
+ import PageLoading from '@/components/page/pageLoading';
6
8
 
7
9
  import Home from '@/pages/index.jsx';
8
10
 
@@ -1,9 +1,16 @@
1
+ // @ts-ignore
1
2
  import Axios from 'axios';
3
+ // @ts-ignore
2
4
  import qs from 'qs';
5
+ // @ts-ignore
3
6
  import { message } from 'antd';
7
+
8
+
4
9
  const axios = Axios.create();
10
+ // @ts-ignore
5
11
  console.log(`========API_ROOT:${API_HOST}========`);
6
12
 
13
+ // @ts-ignore
7
14
  export const API_ROOT = API_HOST;
8
15
 
9
16
  const tokenMode='header';//header,cookie
@@ -29,6 +36,7 @@ export const setJwt = (value) => {
29
36
  jwt = value;
30
37
  };
31
38
 
39
+ // @ts-ignore
32
40
  window.setJwt=setJwt;
33
41
  export const setLogout=(fn)=>{
34
42
  logout=fn;
@@ -96,6 +104,13 @@ axios.interceptors.response.use(
96
104
 
97
105
 
98
106
  let buffer = {};
107
+ /**
108
+ * GET请求
109
+ * @param {string} url - 接口地址
110
+ * @param {Object} [param] - 接口参数
111
+ * @param {Object} [options] - 扩展参数
112
+ * @returns Promise<ServicesResponse>
113
+ */
99
114
  export async function GET_DEFAULT(url, param, options) {
100
115
  if (param) param = qs.stringify(param, { arrayFormat: 'indices' });
101
116
  let now = Date.now();
@@ -128,6 +143,12 @@ export async function GET_DEFAULT(url, param, options) {
128
143
  return response && response.data ? response.data : null;
129
144
  }
130
145
 
146
+ /**
147
+ * GET请求
148
+ * @param {string} url - 接口地址
149
+ * @param {Object} [param] - 接口参数
150
+ * @returns Promise<ServicesResponse>
151
+ */
131
152
  export async function GET_DEFAULT_CROSS(url, param) {
132
153
  if (param) param = qs.stringify(param, { arrayFormat: 'indices' });
133
154
 
@@ -141,7 +162,15 @@ export async function GET_DEFAULT_CROSS(url, param) {
141
162
  return response && response.data ? response.data : null;
142
163
  }
143
164
 
144
- export async function POST_DEFAULT(url, params, method, options) {
165
+ /**
166
+ * POST请求
167
+ * @param {string} url - 接口地址
168
+ * @param {Object} [params] - 接口参数
169
+ * @param {Object} [options] - 特殊参数
170
+ *
171
+ * @returns Promise<ServicesResponse>
172
+ */
173
+ export async function POST_DEFAULT(url, params, options) {
145
174
  let data = params;
146
175
  // if (params) params = qs.stringify(params, { arrayFormat: 'indices' });
147
176
  // if (typeof params === 'string') {
@@ -151,7 +180,7 @@ export async function POST_DEFAULT(url, params, method, options) {
151
180
  // }
152
181
 
153
182
  let response = await axios({
154
- method: method || 'POST',
183
+ method: 'POST',
155
184
  url: url,
156
185
  data,
157
186
  ...options,
@@ -160,6 +189,13 @@ export async function POST_DEFAULT(url, params, method, options) {
160
189
  return response && response.data ? response.data : null;
161
190
  }
162
191
 
192
+ /**
193
+ * POST请求
194
+ * @param {string} url - 接口地址
195
+ * @param {Object} [params] - 接口参数
196
+ *
197
+ * @returns Promise<ServicesResponse>
198
+ */
163
199
  export async function POST_DEFAULT_CROSS(url, params) {
164
200
  let data = {};
165
201
  // if (params) params = qs.stringify(params, { arrayFormat: 'indices' });
@@ -1,16 +1,16 @@
1
- import {GET_DEFAULT,PUT_DEFAULT,POST_DEFAULT,API_ROOT} from './index.js';
1
+ import {GET_DEFAULT,POST_DEFAULT,API_ROOT} from './index.js';
2
2
 
3
3
 
4
4
 
5
5
  export function GET_USER(){
6
- return GET_DEFAULT(`${HOST}/user`);
6
+ return GET_DEFAULT(`${API_ROOT}/user`);
7
7
  }
8
8
 
9
9
  export function SET_USER(params={
10
10
  name:'',
11
11
  age:''
12
12
  }){
13
- return POST_DEFAULT(`${HOST}/user`,params)
13
+ return POST_DEFAULT(`${API_ROOT}/user`,params)
14
14
  }
15
15
 
16
16
 
@@ -0,0 +1,47 @@
1
+
2
+ /**
3
+ * 可自行扩展任意数量的属性
4
+ * @typedef {Object<string, any>} OtherAny
5
+ */
6
+
7
+ /**
8
+ * 指向DOM节点的ref
9
+ * @typedef {object} RefDomElement
10
+ * @property {HTMLElement} current - DOM节点
11
+ */
12
+
13
+
14
+
15
+ /**
16
+ * @typedef {object} FormDataInfo
17
+ * @property {string} btnControl
18
+ */
19
+
20
+ /**
21
+ * @typedef {[FormDataInfo,Function]} UseStateFormData
22
+ */
23
+
24
+
25
+ /**
26
+ * @typedef {FormDataInfo & OtherAny} TableContentData
27
+ */
28
+
29
+
30
+ /**
31
+ * 分页
32
+ * @typedef {object} Pagination
33
+ * @property {number} current - 当前页码,1~N
34
+ * @property {number} pageSize=10 - 分页大小
35
+ * @property {number} total - 总记录条数
36
+ * @property {number} startIdx - 当前页面第一条的数据索引起始值
37
+ *
38
+ */
39
+
40
+
41
+ /**
42
+ * 接口response数据
43
+ * @typedef {object} ServicesResponse
44
+ * @property {number} code - 接口处理结果,0为成功
45
+ * @property {object} data - 接口返回的数据
46
+ *
47
+ */
@@ -1,57 +0,0 @@
1
- import React, { useEffect } from 'react';
2
- import IconFont from '../IconFont';
3
- import styles from './index.less';
4
-
5
- const Header=(props)=>{
6
- const {
7
- visible=true,
8
- className='',
9
- title='标题',
10
- subTitle='',
11
- leftLabel='',
12
- rightLabel='',
13
- left=<IconFont className={styles.leftIcon} icon='arrowBack' />,
14
- right='',
15
- syncDocumentTitle=false
16
- } = props;
17
-
18
- // 同步更新网页标题
19
- useEffect(()=>{
20
- if(syncDocumentTitle){
21
- document.title= title;
22
- }
23
- },[title])
24
- const onLeft=()=>{
25
- window.history.back();
26
- }
27
- const onLeftLabel=()=>{
28
- if(props.onLeftLabel){props.onLeftLabel()}
29
- }
30
- const onRight=()=>{
31
- if(props.onRight){props.onRight()}
32
- }
33
- const onRightLabel=()=>{
34
- if(props.onRightLabel){props.onRightLabel()}
35
- }
36
- const onTitle=()=>{
37
- if(props.onTitle){props.onTitle()}
38
- }
39
- return (
40
- <section className={`${styles.header} ${className}`} data-visible={visible}>
41
- <hgroup className={styles.group}>
42
- {left&&(<section className={styles.left} onClick={onLeft}>{left}</section>)}
43
- {leftLabel&&<span className={styles.leftLabel} onClick={onLeftLabel}>{leftLabel}</span>}
44
- </hgroup>
45
- <section className={styles.center}>
46
- {title&&<span onClick={onTitle}>{title}</span>}
47
- {subTitle&&<span>{subTitle}</span>}
48
- </section>
49
- <hgroup className={styles.group}>
50
- {rightLabel&&<span className={styles.rightLabel} onClick={onRightLabel}>{rightLabel}</span>}
51
- {right&&(<section className={styles.right} onClick={onRight}>{right}</section>)}
52
- </hgroup>
53
-
54
- </section>
55
- )
56
- }
57
- export default Header;
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
-
3
- import styles from './index.less';
4
-
5
-
6
- const LayoutCenterBody=(props)=>{
7
- const {className,layout='normal'} = props;
8
-
9
- return (
10
- <section data-layout={layout} className={ className?`${styles.contentBody} ${className}`:styles.contentBody }>
11
- {props.children}
12
- </section>
13
- )
14
- }
15
- export default LayoutCenterBody;
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- import { openLink,jumpUrl } from '@/utils';
3
- import styles from './index.less';
4
-
5
- const Link=(props)=>{
6
- const {children,className='',onClick,href='',target=''} = props;
7
-
8
- const onLink=()=>{
9
- if(href){
10
- if(target=='_blank'){
11
- openLink(href);
12
- // window.open(href);
13
- }else{
14
- jumpUrl(href);
15
- }
16
- return;
17
- }
18
- if(onClick)onClick();
19
- }
20
- return (
21
- <span onClick={onLink} className={`${styles.linkWrap} ${className}`}>{children}</span>
22
- )
23
- }
24
- export default React.memo(Link);
@@ -1,14 +0,0 @@
1
-
2
-
3
- import React,{useMemo} from 'react';
4
- import styles from './index.less';
5
- styles;
6
- export const Loading=()=>{
7
- return (
8
- <div className="ldio-2oha7mxue8v">
9
- <div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
10
- </div>
11
- )
12
- }
13
-
14
- export default React.memo(Loading);