@cloudbase/weda-ui 3.2.0 → 3.3.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 (356) hide show
  1. package/dist/cypress/support/commands.d.ts +1 -0
  2. package/dist/cypress/support/commands.js +40 -0
  3. package/dist/cypress/support/e2e.d.ts +24 -0
  4. package/dist/cypress/support/e2e.js +22 -0
  5. package/dist/src/configs/actions/showModal.json +48 -0
  6. package/dist/src/configs/actions/showToast.json +41 -0
  7. package/dist/src/configs/components/auth.json +16 -0
  8. package/dist/src/configs/components/button.json +239 -0
  9. package/dist/src/configs/components/calendar.json +81 -0
  10. package/dist/src/configs/components/carousel.json +292 -0
  11. package/dist/src/configs/components/chart/bar.json +962 -0
  12. package/dist/src/configs/components/chart/line.json +878 -0
  13. package/dist/src/configs/components/chart/pie.json +685 -0
  14. package/dist/src/configs/components/chart/statisticsCard.json +376 -0
  15. package/dist/src/configs/components/container.json +50 -0
  16. package/dist/src/configs/components/dataView.json +247 -0
  17. package/dist/src/configs/components/drawer.json +115 -0
  18. package/dist/src/configs/components/form/checkbox.json +179 -0
  19. package/dist/src/configs/components/form/departTreeSelect.json +124 -0
  20. package/dist/src/configs/components/form/form.json +73 -0
  21. package/dist/src/configs/components/form/input.json +154 -0
  22. package/dist/src/configs/components/form/location.json +216 -0
  23. package/dist/src/configs/components/form/radio.json +203 -0
  24. package/dist/src/configs/components/form/richText.json +133 -0
  25. package/dist/src/configs/components/form/select.json +449 -0
  26. package/dist/src/configs/components/form/switch.json +58 -0
  27. package/dist/src/configs/components/form/textarea.json +116 -0
  28. package/dist/src/configs/components/form/tips.json +34 -0
  29. package/dist/src/configs/components/form/uploader.json +171 -0
  30. package/dist/src/configs/components/form/uploaderFile.json +158 -0
  31. package/dist/src/configs/components/form/userTreeSelect.json +128 -0
  32. package/dist/src/configs/components/formdetail.json +105 -0
  33. package/dist/src/configs/components/graphicCard.json +413 -0
  34. package/dist/src/configs/components/image.json +187 -0
  35. package/dist/src/configs/components/link.json +79 -0
  36. package/dist/src/configs/components/listView.json +378 -0
  37. package/dist/src/configs/components/lottery.json +163 -0
  38. package/dist/src/configs/components/modal.json +72 -0
  39. package/dist/src/configs/components/navLayout.json +368 -0
  40. package/dist/src/configs/components/navigationBar.json +62 -0
  41. package/dist/src/configs/components/richtextview.json +26 -0
  42. package/dist/src/configs/components/scrollVeiw.json +253 -0
  43. package/dist/src/configs/components/slot.json +17 -0
  44. package/dist/src/configs/components/swiper.json +90 -0
  45. package/dist/src/configs/components/tabs.json +122 -0
  46. package/dist/src/configs/components/text.json +95 -0
  47. package/dist/src/configs/components/wedaVideo.json +89 -0
  48. package/dist/src/configs/components/wxOpenApi/phone.json +127 -0
  49. package/dist/src/configs/components/wxOpenApi/phoneCode.json +109 -0
  50. package/dist/src/configs/components/wxOpenApi/share.json +160 -0
  51. package/dist/src/configs/components/wxOpenApi/userInfo.json +156 -0
  52. package/dist/src/configs/index.d.ts +103 -0
  53. package/dist/src/configs/index.js +111 -0
  54. package/dist/src/docs/common/format.d.ts +13 -0
  55. package/dist/src/docs/common/format.js +122 -0
  56. package/dist/src/docs/common/tableView.d.ts +30 -0
  57. package/dist/src/docs/common/tableView.js +156 -0
  58. package/dist/src/index.d.ts +2 -0
  59. package/dist/src/index.js +3 -0
  60. package/dist/src/setupTests.d.ts +2 -0
  61. package/dist/src/setupTests.js +19 -0
  62. package/dist/src/web/actions/index.d.ts +2 -0
  63. package/dist/src/web/actions/index.js +2 -0
  64. package/dist/src/web/actions/showModal/index.d.ts +4 -0
  65. package/dist/src/web/actions/showModal/index.js +66 -0
  66. package/dist/src/web/actions/showToast/index.d.ts +1 -0
  67. package/dist/src/web/actions/showToast/index.js +3 -0
  68. package/dist/src/web/components/button/index.d.ts +32 -0
  69. package/dist/src/web/components/button/index.js +48 -0
  70. package/dist/src/web/components/calendar/index.d.ts +19 -0
  71. package/dist/src/web/components/calendar/index.js +191 -0
  72. package/dist/src/web/components/calendar/util.d.ts +13 -0
  73. package/dist/src/web/components/calendar/util.js +74 -0
  74. package/dist/src/web/components/carousel/index.d.ts +41 -0
  75. package/dist/src/web/components/carousel/index.js +244 -0
  76. package/dist/src/web/components/chart/bar/index.d.ts +3 -0
  77. package/dist/src/web/components/chart/bar/index.js +45 -0
  78. package/dist/src/web/components/chart/bar/index.old.d.ts +40 -0
  79. package/dist/src/web/components/chart/bar/index.old.js +56 -0
  80. package/dist/src/web/components/chart/common/Chart.d.ts +10 -0
  81. package/dist/src/web/components/chart/common/Chart.js +31 -0
  82. package/dist/src/web/components/chart/common/chart-custom-connector.d.ts +6 -0
  83. package/dist/src/web/components/chart/common/chart-custom-connector.js +35 -0
  84. package/dist/src/web/components/chart/common/chart-error.d.ts +2 -0
  85. package/dist/src/web/components/chart/common/chart-error.js +2 -0
  86. package/dist/src/web/components/chart/common/config/bar.d.ts +48 -0
  87. package/dist/src/web/components/chart/common/config/bar.js +49 -0
  88. package/dist/src/web/components/chart/common/config/global.d.ts +13 -0
  89. package/dist/src/web/components/chart/common/config/global.js +16 -0
  90. package/dist/src/web/components/chart/common/config/line.d.ts +46 -0
  91. package/dist/src/web/components/chart/common/config/line.js +49 -0
  92. package/dist/src/web/components/chart/common/config/pie.d.ts +29 -0
  93. package/dist/src/web/components/chart/common/config/pie.js +36 -0
  94. package/dist/src/web/components/chart/common/core/eChartBar.d.ts +66 -0
  95. package/dist/src/web/components/chart/common/core/eChartBar.js +201 -0
  96. package/dist/src/web/components/chart/common/core/eChartBase.d.ts +127 -0
  97. package/dist/src/web/components/chart/common/core/eChartBase.js +394 -0
  98. package/dist/src/web/components/chart/common/core/eChartLine.d.ts +60 -0
  99. package/dist/src/web/components/chart/common/core/eChartLine.js +173 -0
  100. package/dist/src/web/components/chart/common/core/eChartPie.d.ts +48 -0
  101. package/dist/src/web/components/chart/common/core/eChartPie.js +135 -0
  102. package/dist/src/web/components/chart/common/core/type.d.ts +35 -0
  103. package/dist/src/web/components/chart/common/core/type.js +9 -0
  104. package/dist/src/web/components/chart/common/data-transform.d.ts +6 -0
  105. package/dist/src/web/components/chart/common/data-transform.js +248 -0
  106. package/dist/src/web/components/chart/common/echarts.d.ts +5 -0
  107. package/dist/src/web/components/chart/common/echarts.js +24 -0
  108. package/dist/src/web/components/chart/common/error-boundary.d.ts +5 -0
  109. package/dist/src/web/components/chart/common/error-boundary.js +26 -0
  110. package/dist/src/web/components/chart/common/useChart.d.ts +8 -0
  111. package/dist/src/web/components/chart/common/useChart.js +72 -0
  112. package/dist/src/web/components/chart/line/index.d.ts +3 -0
  113. package/dist/src/web/components/chart/line/index.js +42 -0
  114. package/dist/src/web/components/chart/line/index.old.d.ts +38 -0
  115. package/dist/src/web/components/chart/line/index.old.js +53 -0
  116. package/dist/src/web/components/chart/pie/index.d.ts +3 -0
  117. package/dist/src/web/components/chart/pie/index.js +42 -0
  118. package/dist/src/web/components/chart/pie/index.old.d.ts +27 -0
  119. package/dist/src/web/components/chart/pie/index.old.js +40 -0
  120. package/dist/src/web/components/chart/statisticsCard/index.d.ts +85 -0
  121. package/dist/src/web/components/chart/statisticsCard/index.js +203 -0
  122. package/dist/src/web/components/chart/statisticsCard/interface.d.ts +13 -0
  123. package/dist/src/web/components/chart/statisticsCard/interface.js +1 -0
  124. package/dist/src/web/components/common/error-boundary.d.ts +5 -0
  125. package/dist/src/web/components/common/error-boundary.js +33 -0
  126. package/dist/src/web/components/common/portal.d.ts +7 -0
  127. package/dist/src/web/components/common/portal.js +14 -0
  128. package/dist/src/web/components/common/use-loop-render-detect.d.ts +11 -0
  129. package/dist/src/web/components/common/use-loop-render-detect.js +124 -0
  130. package/dist/src/web/components/container/index.d.ts +6 -0
  131. package/dist/src/web/components/container/index.js +6 -0
  132. package/dist/src/web/components/dataView/index.d.ts +6 -0
  133. package/dist/src/web/components/dataView/index.js +8 -0
  134. package/dist/src/web/components/dataView/interface.d.ts +5 -0
  135. package/dist/src/web/components/dataView/interface.js +1 -0
  136. package/dist/src/web/components/drawer/index.d.ts +13 -0
  137. package/dist/src/web/components/drawer/index.js +12 -0
  138. package/dist/src/web/components/form/checkbox/index.d.ts +13 -0
  139. package/dist/src/web/components/form/checkbox/index.js +167 -0
  140. package/dist/src/web/components/form/enumSelect/MultipleSelect.d.ts +78 -0
  141. package/dist/src/web/components/form/enumSelect/MultipleSelect.js +52 -0
  142. package/dist/src/web/components/form/enumSelect/NormalSelect.d.ts +83 -0
  143. package/dist/src/web/components/form/enumSelect/NormalSelect.js +52 -0
  144. package/dist/src/web/components/form/enumSelect/SelectContainer.d.ts +16 -0
  145. package/dist/src/web/components/form/enumSelect/SelectContainer.js +30 -0
  146. package/dist/src/web/components/form/enumSelect/index.d.ts +82 -0
  147. package/dist/src/web/components/form/enumSelect/index.js +6 -0
  148. package/dist/src/web/components/form/enumSelect/props/defaultProps.d.ts +34 -0
  149. package/dist/src/web/components/form/enumSelect/props/defaultProps.js +40 -0
  150. package/dist/src/web/components/form/enumSelect/props/propsTypes.d.ts +39 -0
  151. package/dist/src/web/components/form/enumSelect/props/propsTypes.js +47 -0
  152. package/dist/src/web/components/form/form/index.d.ts +32 -0
  153. package/dist/src/web/components/form/form/index.js +150 -0
  154. package/dist/src/web/components/form/formcell/index.d.ts +8 -0
  155. package/dist/src/web/components/form/formcell/index.js +40 -0
  156. package/dist/src/web/components/form/input/index.d.ts +14 -0
  157. package/dist/src/web/components/form/input/index.js +94 -0
  158. package/dist/src/web/components/form/location/common/mapChoose.d.ts +15 -0
  159. package/dist/src/web/components/form/location/common/mapChoose.js +496 -0
  160. package/dist/src/web/components/form/location/common/mapView.d.ts +19 -0
  161. package/dist/src/web/components/form/location/common/mapView.js +175 -0
  162. package/dist/src/web/components/form/location/common/propsConfig.d.ts +59 -0
  163. package/dist/src/web/components/form/location/common/propsConfig.js +50 -0
  164. package/dist/src/web/components/form/location/common/selectModal.d.ts +21 -0
  165. package/dist/src/web/components/form/location/common/selectModal.js +44 -0
  166. package/dist/src/web/components/form/location/common/tmap.d.ts +3 -0
  167. package/dist/src/web/components/form/location/common/tmap.js +21 -0
  168. package/dist/src/web/components/form/location/common/useLocationInfo.d.ts +36 -0
  169. package/dist/src/web/components/form/location/common/useLocationInfo.js +105 -0
  170. package/dist/src/web/components/form/location/components/LocationH5/location.h5.d.ts +8 -0
  171. package/dist/src/web/components/form/location/components/LocationH5/location.h5.js +328 -0
  172. package/dist/src/web/components/form/location/components/LocationPC/Header.d.ts +12 -0
  173. package/dist/src/web/components/form/location/components/LocationPC/Header.js +43 -0
  174. package/dist/src/web/components/form/location/components/LocationPC/location.PC.d.ts +8 -0
  175. package/dist/src/web/components/form/location/components/LocationPC/location.PC.js +228 -0
  176. package/dist/src/web/components/form/location/constants.d.ts +2 -0
  177. package/dist/src/web/components/form/location/constants.js +3 -0
  178. package/dist/src/web/components/form/location/index.d.ts +1 -0
  179. package/dist/src/web/components/form/location/index.js +24 -0
  180. package/dist/src/web/components/form/radio/index.d.ts +11 -0
  181. package/dist/src/web/components/form/radio/index.js +115 -0
  182. package/dist/src/web/components/form/renderDecorator.d.ts +6 -0
  183. package/dist/src/web/components/form/renderDecorator.js +20 -0
  184. package/dist/src/web/components/form/select/allTimePicker/calendar.d.ts +13 -0
  185. package/dist/src/web/components/form/select/allTimePicker/calendar.js +104 -0
  186. package/dist/src/web/components/form/select/allTimePicker/dataUtils.d.ts +24 -0
  187. package/dist/src/web/components/form/select/allTimePicker/dataUtils.js +265 -0
  188. package/dist/src/web/components/form/select/allTimePicker/index.d.ts +14 -0
  189. package/dist/src/web/components/form/select/allTimePicker/index.js +944 -0
  190. package/dist/src/web/components/form/select/dropdown-select/ui.d.ts +15 -0
  191. package/dist/src/web/components/form/select/dropdown-select/ui.js +55 -0
  192. package/dist/src/web/components/form/select/h5.d.ts +16 -0
  193. package/dist/src/web/components/form/select/h5.js +466 -0
  194. package/dist/src/web/components/form/select/index.d.ts +66 -0
  195. package/dist/src/web/components/form/select/index.js +255 -0
  196. package/dist/src/web/components/form/select/region/index.d.ts +6 -0
  197. package/dist/src/web/components/form/select/region/index.js +147 -0
  198. package/dist/src/web/components/form/select/time.d.ts +9 -0
  199. package/dist/src/web/components/form/select/time.js +146 -0
  200. package/dist/src/web/components/form/select/use-options.d.ts +26 -0
  201. package/dist/src/web/components/form/select/use-options.js +103 -0
  202. package/dist/src/web/components/form/select/year.d.ts +7 -0
  203. package/dist/src/web/components/form/select/year.js +72 -0
  204. package/dist/src/web/components/form/switch/index.d.ts +6 -0
  205. package/dist/src/web/components/form/switch/index.js +58 -0
  206. package/dist/src/web/components/form/textarea/index.d.ts +12 -0
  207. package/dist/src/web/components/form/textarea/index.js +66 -0
  208. package/dist/src/web/components/form/tips/index.d.ts +8 -0
  209. package/dist/src/web/components/form/tips/index.js +17 -0
  210. package/dist/src/web/components/form/uploader/index.d.ts +3 -0
  211. package/dist/src/web/components/form/uploader/index.js +42 -0
  212. package/dist/src/web/components/form/uploader/uploader.h5.d.ts +20 -0
  213. package/dist/src/web/components/form/uploader/uploader.h5.js +199 -0
  214. package/dist/src/web/components/form/uploader/uploader.pc.d.ts +29 -0
  215. package/dist/src/web/components/form/uploader/uploader.pc.js +208 -0
  216. package/dist/src/web/components/form/uploaderFile/index.d.ts +4 -0
  217. package/dist/src/web/components/form/uploaderFile/index.js +19 -0
  218. package/dist/src/web/components/form/uploaderFile/uploadFile.h5.d.ts +23 -0
  219. package/dist/src/web/components/form/uploaderFile/uploadFile.h5.js +330 -0
  220. package/dist/src/web/components/form/uploaderFile/uploadFile.pc.d.ts +24 -0
  221. package/dist/src/web/components/form/uploaderFile/uploadFile.pc.js +302 -0
  222. package/dist/src/web/components/form/userOrgSelect/comTool.d.ts +8 -0
  223. package/dist/src/web/components/form/userOrgSelect/comTool.js +101 -0
  224. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +19 -0
  225. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +252 -0
  226. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +4 -0
  227. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +157 -0
  228. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.d.ts +2 -0
  229. package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.js +17 -0
  230. package/dist/src/web/components/form/userOrgSelect/getUserService.d.ts +11 -0
  231. package/dist/src/web/components/form/userOrgSelect/getUserService.js +159 -0
  232. package/dist/src/web/components/form/userOrgSelect/index.d.ts +2 -0
  233. package/dist/src/web/components/form/userOrgSelect/index.js +17 -0
  234. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +27 -0
  235. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.js +276 -0
  236. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +9 -0
  237. package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.js +253 -0
  238. package/dist/src/web/components/form/userOrgSelect/utils.d.ts +36 -0
  239. package/dist/src/web/components/form/userOrgSelect/utils.js +80 -0
  240. package/dist/src/web/components/formdetail/index.d.ts +28 -0
  241. package/dist/src/web/components/formdetail/index.js +173 -0
  242. package/dist/src/web/components/graphicCard/index.d.ts +46 -0
  243. package/dist/src/web/components/graphicCard/index.js +178 -0
  244. package/dist/src/web/components/image/image.d.ts +9 -0
  245. package/dist/src/web/components/image/image.js +119 -0
  246. package/dist/src/web/components/image/index.d.ts +13 -0
  247. package/dist/src/web/components/image/index.js +77 -0
  248. package/dist/src/web/components/index.d.ts +50 -0
  249. package/dist/src/web/components/index.js +99 -0
  250. package/dist/src/web/components/link/index.d.ts +24 -0
  251. package/dist/src/web/components/link/index.js +71 -0
  252. package/dist/src/web/components/listView/index.d.ts +7 -0
  253. package/dist/src/web/components/listView/index.js +297 -0
  254. package/dist/src/web/components/listView/interface.d.ts +127 -0
  255. package/dist/src/web/components/listView/interface.js +1 -0
  256. package/dist/src/web/components/lottery/index.d.ts +22 -0
  257. package/dist/src/web/components/lottery/index.js +385 -0
  258. package/dist/src/web/components/lottery/lotteryUtil.d.ts +23 -0
  259. package/dist/src/web/components/lottery/lotteryUtil.js +181 -0
  260. package/dist/src/web/components/modal/index.d.ts +17 -0
  261. package/dist/src/web/components/modal/index.js +11 -0
  262. package/dist/src/web/components/modal/modal.h5.d.ts +4 -0
  263. package/dist/src/web/components/modal/modal.h5.js +46 -0
  264. package/dist/src/web/components/modal/modal.pc.d.ts +3 -0
  265. package/dist/src/web/components/modal/modal.pc.js +31 -0
  266. package/dist/src/web/components/navLayout/index.d.ts +61 -0
  267. package/dist/src/web/components/navLayout/index.js +127 -0
  268. package/dist/src/web/components/navigationBar/common.d.ts +15 -0
  269. package/dist/src/web/components/navigationBar/common.js +127 -0
  270. package/dist/src/web/components/navigationBar/h5Menu.d.ts +14 -0
  271. package/dist/src/web/components/navigationBar/h5Menu.js +72 -0
  272. package/dist/src/web/components/navigationBar/horizontalMenu.d.ts +12 -0
  273. package/dist/src/web/components/navigationBar/horizontalMenu.js +99 -0
  274. package/dist/src/web/components/navigationBar/index.d.ts +13 -0
  275. package/dist/src/web/components/navigationBar/index.js +157 -0
  276. package/dist/src/web/components/navigationBar/verticalMenu.d.ts +13 -0
  277. package/dist/src/web/components/navigationBar/verticalMenu.js +38 -0
  278. package/dist/src/web/components/phone/index.d.ts +18 -0
  279. package/dist/src/web/components/phone/index.js +4 -0
  280. package/dist/src/web/components/phoneCode/index.d.ts +18 -0
  281. package/dist/src/web/components/phoneCode/index.js +4 -0
  282. package/dist/src/web/components/picker/datePicker.d.ts +10 -0
  283. package/dist/src/web/components/picker/datePicker.js +31 -0
  284. package/dist/src/web/components/picker/picker.d.ts +6 -0
  285. package/dist/src/web/components/picker/picker.js +45 -0
  286. package/dist/src/web/components/picker/timePicker.d.ts +7 -0
  287. package/dist/src/web/components/picker/timePicker.js +42 -0
  288. package/dist/src/web/components/richText/const.d.ts +1 -0
  289. package/dist/src/web/components/richText/const.js +2 -0
  290. package/dist/src/web/components/richText/index.d.ts +50 -0
  291. package/dist/src/web/components/richText/index.js +351 -0
  292. package/dist/src/web/components/richTextView/index.d.ts +7 -0
  293. package/dist/src/web/components/richTextView/index.js +46 -0
  294. package/dist/src/web/components/scrollView/index.d.ts +26 -0
  295. package/dist/src/web/components/scrollView/index.js +97 -0
  296. package/dist/src/web/components/share/index.d.ts +34 -0
  297. package/dist/src/web/components/share/index.js +4 -0
  298. package/dist/src/web/components/slot/index.d.ts +6 -0
  299. package/dist/src/web/components/slot/index.js +9 -0
  300. package/dist/src/web/components/swiper/index.d.ts +24 -0
  301. package/dist/src/web/components/swiper/index.js +153 -0
  302. package/dist/src/web/components/tabs/index.d.ts +13 -0
  303. package/dist/src/web/components/tabs/index.js +20 -0
  304. package/dist/src/web/components/tabs/tabs.h5.d.ts +4 -0
  305. package/dist/src/web/components/tabs/tabs.h5.js +44 -0
  306. package/dist/src/web/components/tabs/tabs.pc.d.ts +3 -0
  307. package/dist/src/web/components/tabs/tabs.pc.js +40 -0
  308. package/dist/src/web/components/text/index.d.ts +14 -0
  309. package/dist/src/web/components/text/index.js +19 -0
  310. package/dist/src/web/components/uploaderFileView/index.d.ts +10 -0
  311. package/dist/src/web/components/uploaderFileView/index.js +46 -0
  312. package/dist/src/web/components/uploaderView/index.d.ts +17 -0
  313. package/dist/src/web/components/uploaderView/index.js +48 -0
  314. package/dist/src/web/components/userInfo/index.d.ts +26 -0
  315. package/dist/src/web/components/userInfo/index.js +4 -0
  316. package/dist/src/web/components/wedaVideo/index.d.ts +17 -0
  317. package/dist/src/web/components/wedaVideo/index.js +156 -0
  318. package/dist/src/web/index.d.ts +8 -0
  319. package/dist/src/web/index.js +4 -0
  320. package/dist/src/web/utils/classnames.d.ts +2 -0
  321. package/dist/src/web/utils/classnames.js +37 -0
  322. package/dist/src/web/utils/console.d.ts +3 -0
  323. package/dist/src/web/utils/console.js +26 -0
  324. package/dist/src/web/utils/constant.d.ts +23 -0
  325. package/dist/src/web/utils/constant.js +24 -0
  326. package/dist/src/web/utils/debounce.d.ts +2 -0
  327. package/dist/src/web/utils/debounce.js +92 -0
  328. package/dist/src/web/utils/getLocalCounter.d.ts +1 -0
  329. package/dist/src/web/utils/getLocalCounter.js +4 -0
  330. package/dist/src/web/utils/getUserService.d.ts +11 -0
  331. package/dist/src/web/utils/getUserService.js +156 -0
  332. package/dist/src/web/utils/isObjectEqual.d.ts +2 -0
  333. package/dist/src/web/utils/isObjectEqual.js +12 -0
  334. package/dist/src/web/utils/loading-fallback.d.ts +2 -0
  335. package/dist/src/web/utils/loading-fallback.js +2 -0
  336. package/dist/src/web/utils/lodash.d.ts +1 -0
  337. package/dist/src/web/utils/lodash.js +2 -0
  338. package/dist/src/web/utils/platform.d.ts +18 -0
  339. package/dist/src/web/utils/platform.js +193 -0
  340. package/dist/src/web/utils/tcb.d.ts +33 -0
  341. package/dist/src/web/utils/tcb.js +118 -0
  342. package/dist/src/web/utils/tmap.d.ts +3 -0
  343. package/dist/src/web/utils/tmap.js +21 -0
  344. package/dist/src/web/utils/use-cloud-id-temp-url.d.ts +1 -0
  345. package/dist/src/web/utils/use-cloud-id-temp-url.js +15 -0
  346. package/dist/src/web/utils/useSetState.d.ts +1 -0
  347. package/dist/src/web/utils/useSetState.js +8 -0
  348. package/dist/src/web/utils/useSyncValue.d.ts +4 -0
  349. package/dist/src/web/utils/useSyncValue.js +16 -0
  350. package/dist/src/web/utils/weui.d.ts +1 -0
  351. package/dist/src/web/utils/weui.js +2 -0
  352. package/dist/web/components/form/input/index.css +16 -0
  353. package/dist/web/components/form/select/allTimePicker/calendar.css +114 -0
  354. package/dist/web/components/form/select/allTimePicker/index.css +136 -0
  355. package/dist/web/components/form/userOrgSelect/userOrgSelect.css +809 -0
  356. package/package.json +34 -21
@@ -0,0 +1,252 @@
1
+ import React, { useState, useEffect, useCallback } from 'react';
2
+ import { emptyObject } from '../../../../utils/constant';
3
+ import { renderDecorator } from '../../renderDecorator';
4
+ import { IconFont } from 'tdesign-icons-react';
5
+ import classNames from '../../../../utils/classnames';
6
+ import { getDepartById, defaultRequest } from '../getUserService';
7
+ import { dealOrgData } from '../utils';
8
+ import { Modal, Button, ConfigProvider, Radio, Status } from 'tea-component';
9
+ import isObjectEqual from '../../../../utils/isObjectEqual';
10
+ import '../userOrgSelect.css';
11
+ import { ErrorStatus, ModalSearch } from '../comTool';
12
+ export function DepartTreeSelectH5({ id, className, style, events = emptyObject, label = '部门选择', labelVisible = true, name = 'formDepartTreeSelect', placeholder = '请选择部门', defaultValueType = 'noneDepart', defaultValue = '', confirmValue = '', disabled = false, layout = 'horizontal', requiredFlag = false, size = 'l', decorator, request = defaultRequest, onChange = null, focus: autoFocus = false, }) {
13
+ const cls = classNames({
14
+ 'weda-ui': true,
15
+ 'weda-select-user-dept': true,
16
+ [className]: className,
17
+ });
18
+ const subCls = classNames({
19
+ 'weui-cell': true,
20
+ 'weui-cell_active': true,
21
+ 'weui-cell_form': true,
22
+ 'weui-cell_disabled': disabled,
23
+ });
24
+ // 两次默认值不同, 需要刷新
25
+ const prevDefaultRef = React.useRef(null);
26
+ const prevConfirmRef = React.useRef(null);
27
+ const [value, setValue] = useState(null);
28
+ const [visible, setVisible] = React.useState(false);
29
+ const [isSearch, setIsSearch] = useState(false);
30
+ const [orgsTreeData, setOrgsTreeData] = useState([]);
31
+ const [originalOrgData, setOriginalOrgData] = useState([]);
32
+ const [count, setCount] = useState(1); //计数弹窗显示层级
33
+ const [selectItem, setSelectItem] = useState(null);
34
+ const [searchValue, setSearchValue] = useState('');
35
+ const [loading, setLoading] = useState({ id: null, status: false });
36
+ const [titleText, setTitleText] = useState('');
37
+ const [errorInfo, setErrorInfo] = useState({
38
+ errorStatus: false,
39
+ errorMessage: null,
40
+ });
41
+ // 初始化数据
42
+ const initOrgsData = useCallback(async () => {
43
+ try {
44
+ setTitleText('选择部门');
45
+ const resData = (await request('InitRootOrgs', {})) || [];
46
+ const data = dealOrgData(resData);
47
+ setOrgsTreeData(data);
48
+ setOriginalOrgData([{ index: count, treeData: data, title: '选择部门' }]);
49
+ }
50
+ catch (e) {
51
+ setErrorInfo({ errorStatus: true, errorMessage: e });
52
+ }
53
+ }, [count, request]);
54
+ const handleFocus = (value) => {
55
+ setIsSearch(value);
56
+ };
57
+ const cancleSearch = () => {
58
+ setErrorInfo({ errorStatus: false, errorMessage: null });
59
+ handleFocus(false);
60
+ setSearchValue('');
61
+ initOrgsData();
62
+ };
63
+ const changeSearchValue = async (event) => {
64
+ var _a;
65
+ try {
66
+ setErrorInfo({ errorStatus: false, errorMessage: null });
67
+ const sValue = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value;
68
+ setSearchValue(sValue);
69
+ if (sValue) {
70
+ const { Orgs = [] } = await request('SearchByCondition', {
71
+ KeyWords: sValue.trim(),
72
+ SearchCondition: {
73
+ SearchType: 'SearchByOrg',
74
+ NeedUser: false,
75
+ },
76
+ });
77
+ setOrgsTreeData(dealOrgData(Orgs));
78
+ }
79
+ else {
80
+ setSearchValue('');
81
+ initOrgsData();
82
+ }
83
+ }
84
+ catch (e) {
85
+ setErrorInfo({ errorStatus: true, errorMessage: e });
86
+ }
87
+ };
88
+ const onInputChange = function (e) {
89
+ const text = typeof e === 'string' ? e : e.target.value;
90
+ const newValue = text;
91
+ setValue(newValue);
92
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
93
+ events.change({ value: newValue }, { originEvent: e });
94
+ };
95
+ const onFocus = function () {
96
+ setSearchValue('');
97
+ initOrgsData();
98
+ setVisible(true);
99
+ };
100
+ const onClose = () => {
101
+ setErrorInfo({ errorStatus: false, errorMessage: null });
102
+ setVisible(false);
103
+ initOrgsData();
104
+ };
105
+ const onConfirm = (selectItem) => {
106
+ var _a;
107
+ setErrorInfo({ errorStatus: false, errorMessage: null });
108
+ setValue(selectItem === null || selectItem === void 0 ? void 0 : selectItem.content);
109
+ onChange === null || onChange === void 0 ? void 0 : onChange(selectItem === null || selectItem === void 0 ? void 0 : selectItem.orgId);
110
+ (_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, { value: selectItem === null || selectItem === void 0 ? void 0 : selectItem.orgId, data: selectItem });
111
+ setVisible(false);
112
+ };
113
+ //获取组织结构
114
+ useEffect(() => {
115
+ initOrgsData();
116
+ if ((defaultValue &&
117
+ !isObjectEqual(prevDefaultRef.current !== defaultValue)) ||
118
+ (confirmValue && !isObjectEqual(prevConfirmRef.current !== confirmValue))) {
119
+ const getdefaultUser = async () => {
120
+ var _a;
121
+ try {
122
+ if ((defaultValueType === 'confirmDepart' &&
123
+ confirmValue.length !== 0) ||
124
+ defaultValue.length !== 0) {
125
+ const orgId = confirmValue.length !== 0 ? confirmValue : defaultValue;
126
+ const defaultDepart = await getDepartById({
127
+ _id: orgId,
128
+ });
129
+ setValue(defaultDepart);
130
+ onChange === null || onChange === void 0 ? void 0 : onChange(orgId);
131
+ (_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, {
132
+ value: orgId,
133
+ data: { content: defaultDepart },
134
+ });
135
+ }
136
+ }
137
+ catch (e) {
138
+ setErrorInfo({ errorStatus: true, errorMessage: e });
139
+ }
140
+ };
141
+ getdefaultUser();
142
+ prevDefaultRef.current = defaultValue;
143
+ prevConfirmRef.current = confirmValue;
144
+ }
145
+ // eslint-disable-next-line react-hooks/exhaustive-deps
146
+ }, [defaultValueType, confirmValue, defaultValue, initOrgsData]);
147
+ //点击部门节点,获取子部门节点
148
+ const loadDepartData = async (node, count) => {
149
+ try {
150
+ setLoading({ id: node.orgId, status: true });
151
+ const { Orgs = [] } = await request('LazyDescribeOrgs', {
152
+ OrgId: node.orgId,
153
+ DescribeCondition: {
154
+ NeedUser: true,
155
+ },
156
+ });
157
+ // 如果不存在数据
158
+ if (!(Orgs === null || Orgs === void 0 ? void 0 : Orgs.length)) {
159
+ orgsTreeData.forEach((item, index, orgsTreeData) => {
160
+ if (item.id == node.id) {
161
+ orgsTreeData[index].expandable = false;
162
+ }
163
+ });
164
+ setOrgsTreeData([...orgsTreeData]);
165
+ }
166
+ else {
167
+ const children = dealOrgData(Orgs);
168
+ setTitleText(node === null || node === void 0 ? void 0 : node.content);
169
+ setOrgsTreeData(children);
170
+ originalOrgData.push({ index: count + 1, treeData: children });
171
+ setCount(count + 1);
172
+ setOriginalOrgData(originalOrgData);
173
+ }
174
+ setLoading({ id: null, status: false });
175
+ }
176
+ catch (e) {
177
+ setErrorInfo({ errorStatus: true, errorMessage: e });
178
+ }
179
+ };
180
+ //判断当前页结构为第几层,如首次渲染则添加至orgsTreeData,二次进入刷新index数据
181
+ const retLevel = (count) => {
182
+ const storageOriTreeData = [];
183
+ if (count !== 1) {
184
+ originalOrgData.map((item) => {
185
+ if ((item === null || item === void 0 ? void 0 : item.index) < count) {
186
+ storageOriTreeData.push(item);
187
+ if ((item === null || item === void 0 ? void 0 : item.index) === count - 1) {
188
+ setCount(count - 1);
189
+ setTitleText(item.title);
190
+ setOrgsTreeData((item === null || item === void 0 ? void 0 : item.treeData) || []);
191
+ }
192
+ }
193
+ else {
194
+ return;
195
+ }
196
+ });
197
+ setOriginalOrgData(storageOriTreeData);
198
+ }
199
+ else {
200
+ onClose();
201
+ }
202
+ };
203
+ return renderDecorator(React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
204
+ React.createElement("div", { className: subCls },
205
+ React.createElement("div", { className: "weui-cell__bd weui-flex" },
206
+ React.createElement("input", { className: "weui-input", placeholder: placeholder, value: value, disabled: disabled, name: name, autoFocus: autoFocus, onChange: onInputChange, onClick: onFocus, readOnly: true, role: "input" })),
207
+ React.createElement(Modal, { visible: visible, onClose: onClose, destroyOnClose: true, className: `weda-ui weda-select-user-dept__dialog` },
208
+ React.createElement(Modal.Body, { className: (selectItem === null || selectItem === void 0 ? void 0 : selectItem.userId) ? 'is-selected-value' : '' },
209
+ React.createElement("div", { className: "weda-select-user-dept__dialog-header", id: count.toString() },
210
+ React.createElement("div", { className: count == 1 ? '' : 'arrow-left', onClick: () => retLevel(count) }),
211
+ titleText),
212
+ React.createElement(ModalSearch, { value: searchValue, onChange: changeSearchValue, onCancel: cancleSearch, isSearch: isSearch, onFocus: () => {
213
+ handleFocus(true);
214
+ } }),
215
+ (errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.errorStatus) ? (React.createElement(ErrorStatus, { size: "l", title: "\u63A5\u53E3\u8C03\u7528\u5931\u8D25", description: (errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.errorMessage) || null })) : orgsTreeData && orgsTreeData.length > 0 ? (React.createElement("div", { className: classNames('weda-select-user-dept__dialog-list') }, orgsTreeData.map((item) => (React.createElement("div", { className: "weda-select-user-dept__list-item", key: item === null || item === void 0 ? void 0 : item.id },
216
+ React.createElement("div", { className: "weda-select-user-dept__list-item-wrap" },
217
+ React.createElement(Radio.Group, { value: selectItem === null || selectItem === void 0 ? void 0 : selectItem.orgId, onChange: () => {
218
+ setSelectItem(item);
219
+ }, layout: "column" },
220
+ React.createElement(Radio, { name: item === null || item === void 0 ? void 0 : item.orgId },
221
+ React.createElement("div", { className: "weda-select-user-dept__item-detail" },
222
+ React.createElement("div", { className: "item-name" }, item === null || item === void 0 ? void 0 : item.content),
223
+ (item === null || item === void 0 ? void 0 : item.expandable) && loading.id !== item.orgId && (React.createElement("div", { className: "lcap-icon lcap-icon-chevronright", onClick: () => {
224
+ loadDepartData(item, count);
225
+ } }))))),
226
+ loading.id === item.orgId && (loading === null || loading === void 0 ? void 0 : loading.status) && (React.createElement("div", null,
227
+ React.createElement(IconFont, { name: "loading", className: `weda-grid-navigation__fonticon depart_loading` }))))))))) : (React.createElement(Status, { className: "dim-tree-select--blank", icon: 'blank', size: 's', title: `暂无部门数据` }))),
228
+ React.createElement(Modal.Footer, null,
229
+ React.createElement("div", null,
230
+ selectItem && (React.createElement("div", { className: "weda-select-user-dept__select-result" },
231
+ React.createElement("div", { className: "weda-select-user-dept__select-label" }, "\u5DF2\u9009\u62E9"),
232
+ React.createElement("div", { className: "weda-select-user-dept__result-list" },
233
+ React.createElement("div", { className: "weda-select-user-dept__result-item", onClick: () => {
234
+ setSelectItem(null);
235
+ setSearchValue(null);
236
+ } },
237
+ selectItem.content,
238
+ React.createElement("div", { className: "close" }))))),
239
+ React.createElement("div", { className: "weda-select-user-dept__btn-group" },
240
+ React.createElement(Button, { type: "weak", onClick: onClose }, "\u53D6\u6D88"),
241
+ React.createElement(Button, { type: "primary", onClick: () => onConfirm(selectItem) }, "\u786E\u5B9A"))))))))({
242
+ id,
243
+ className: cls,
244
+ style,
245
+ label: labelVisible ? label : null,
246
+ multiCell: false,
247
+ requiredFlag,
248
+ layout,
249
+ size,
250
+ decorator,
251
+ });
252
+ }
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IDepartTreeSelec } from './departTreeSelect.h5';
3
+ import '../userOrgSelect.css';
4
+ export declare function DepartTreeSelectPC({ id, className, style, events, label, labelVisible, defaultValue, confirmValue, placeholder, defaultValueType, disabled, layout, requiredFlag, size, multiple, onChange, decorator, request, }: IDepartTreeSelec): JSX.Element;
@@ -0,0 +1,157 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import { emptyObject } from '../../../../utils/constant';
3
+ import { renderDecorator } from '../../renderDecorator';
4
+ import classNames from 'classnames';
5
+ import { Dropdown, ConfigProvider, Text } from 'tea-component';
6
+ import { getNode, getRelationData, dealOrgData } from '../utils';
7
+ import { getDepartById, defaultRequest } from '../getUserService';
8
+ import '../userOrgSelect.css';
9
+ import { DimTreeContent } from '../comTool';
10
+ import isObjectEqual from '../../../../utils/isObjectEqual';
11
+ export function DepartTreeSelectPC({ id, className, style, events = emptyObject, label = '人员选择', labelVisible = true, defaultValue = '', confirmValue = '', placeholder = '请选择部门', defaultValueType = 'noneDepart', disabled = false, layout = 'horizontal', requiredFlag = false, size = 'l', multiple = false, onChange = null, decorator, request = defaultRequest, }) {
12
+ // 两次默认值不同, 需要刷新
13
+ const prevDefaultRef = React.useRef(null);
14
+ const prevConfirmRef = React.useRef(null);
15
+ const [selectIds, setSelectIds] = useState([]);
16
+ // 用户单选
17
+ const [curSelectItem, setCurSelectItem] = useState({
18
+ orgId: null,
19
+ content: '',
20
+ });
21
+ const [treeData, setTreeData] = useState([]);
22
+ // 节点高亮
23
+ const [activeIds, setActiveIds] = useState([]);
24
+ //鼠标移入移除输入框
25
+ const [moveIn, setMoveIn] = useState(false);
26
+ const [open, setOpen] = useState(false);
27
+ const [originalTreeData, setOriginalTreeData] = useState([]);
28
+ const [errorInfo, setErrorInfo] = useState({
29
+ errorStatus: false,
30
+ errorMessage: null,
31
+ });
32
+ useEffect(() => {
33
+ // 初始化数据
34
+ const initOrgsData = async () => {
35
+ try {
36
+ setErrorInfo({ errorStatus: false, errorMessage: null });
37
+ const resData = (await request('InitRootOrgs', {})) || [];
38
+ const data = dealOrgData(resData);
39
+ setTreeData(data);
40
+ setOriginalTreeData([...data]);
41
+ }
42
+ catch (e) {
43
+ setErrorInfo({ errorStatus: true, errorMessage: e });
44
+ }
45
+ };
46
+ const getdefaultUser = async () => {
47
+ var _a;
48
+ try {
49
+ if ((defaultValueType === 'confirmDepart' && confirmValue.length !== 0) ||
50
+ defaultValue.length !== 0) {
51
+ const orgId = confirmValue.length !== 0 ? confirmValue : defaultValue;
52
+ const defaultUser = await getDepartById({
53
+ _id: orgId,
54
+ });
55
+ setCurSelectItem({ orgId: orgId, content: defaultUser });
56
+ (_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, { value: orgId, data: { content: defaultUser } });
57
+ }
58
+ }
59
+ catch (e) {
60
+ setErrorInfo({ errorStatus: true, errorMessage: e });
61
+ }
62
+ };
63
+ initOrgsData();
64
+ if ((defaultValue &&
65
+ !isObjectEqual(prevDefaultRef.current !== defaultValue)) ||
66
+ (confirmValue && !isObjectEqual(prevConfirmRef.current !== confirmValue))) {
67
+ getdefaultUser();
68
+ prevDefaultRef.current = defaultValue;
69
+ prevConfirmRef.current = confirmValue;
70
+ }
71
+ // eslint-disable-next-line react-hooks/exhaustive-deps
72
+ }, [defaultValueType, confirmValue, defaultValue, request]);
73
+ useEffect(() => {
74
+ if (open) {
75
+ setErrorInfo({ errorStatus: false, errorMessage: null });
76
+ const orgId = (curSelectItem === null || curSelectItem === void 0 ? void 0 : curSelectItem.orgId) || null;
77
+ const node = getNode(treeData, orgId, 'orgId');
78
+ setActiveIds(node ? [node.id] : []);
79
+ setSelectIds(node ? [node.id] : []);
80
+ }
81
+ }, [curSelectItem === null || curSelectItem === void 0 ? void 0 : curSelectItem.orgId, open, treeData]);
82
+ const reset = (close, value = '') => {
83
+ var _a;
84
+ setSelectIds([]);
85
+ setCurSelectItem({ orgId: null, content: '' });
86
+ setErrorInfo({ errorStatus: false, errorMessage: null });
87
+ setActiveIds([]);
88
+ onChange === null || onChange === void 0 ? void 0 : onChange(value);
89
+ (_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, { value });
90
+ close && setOpen(false);
91
+ };
92
+ // 外层组件类
93
+ const cls = classNames({
94
+ 'weda-ui': true,
95
+ 'weda-user-tree-select': true,
96
+ [className]: className,
97
+ });
98
+ return renderDecorator(React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
99
+ React.createElement("div", { onMouseEnter: () => {
100
+ setMoveIn(true);
101
+ }, onMouseLeave: () => {
102
+ setMoveIn(false);
103
+ } },
104
+ React.createElement(Dropdown, { className: classNames(`department-tree-select`, `size-${size}`), destroyOnClose: false, open: open, onOpenChange: (open) => {
105
+ setOpen(open);
106
+ setErrorInfo({ errorStatus: false, errorMessage: null });
107
+ }, button: React.createElement(SelectViewContainer, { curSelectItem: curSelectItem, multiple: multiple, placeholder: placeholder, moveIn: moveIn, onChange: () => reset(true) }), style: { width: '100%' }, appearance: multiple ? 'pure' : 'button', clickClose: false, disabled: disabled }, () => (React.createElement("div", { className: "dim-tree-select" },
108
+ React.createElement(DimTreeContent, { data: treeData, setTreeData: setTreeData, selectedIds: selectIds, activeIds: activeIds, needUser: false, request: request, errorInfo: errorInfo, searchType: "SearchByOrg", onActive: (ids) => {
109
+ setActiveIds(ids);
110
+ setSelectIds(ids);
111
+ }, onReset: () => setTreeData(originalTreeData), onCancel: () => {
112
+ setOpen(false);
113
+ setErrorInfo({ errorStatus: false, errorMessage: null });
114
+ }, onClear: () => reset(false), onConfirm: () => {
115
+ var _a;
116
+ const selectId = selectIds === null || selectIds === void 0 ? void 0 : selectIds[0];
117
+ if (selectId) {
118
+ const node = getNode(treeData, selectId, 'id');
119
+ if (node) {
120
+ setCurSelectItem(node);
121
+ onChange === null || onChange === void 0 ? void 0 : onChange(node.orgId);
122
+ setOpen(false);
123
+ (_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, { value: node.orgId, data: node });
124
+ }
125
+ }
126
+ } })))))))({
127
+ id,
128
+ className: cls,
129
+ style,
130
+ label: labelVisible ? label : null,
131
+ layout,
132
+ multiCell: false,
133
+ requiredFlag,
134
+ size,
135
+ decorator,
136
+ });
137
+ }
138
+ const SelectViewContainer = (props) => {
139
+ const { curSelectItem, placeholder, onChange, moveIn } = props;
140
+ if (!(curSelectItem === null || curSelectItem === void 0 ? void 0 : curSelectItem.orgId))
141
+ return React.createElement(Text, { className: "placeholder" }, placeholder);
142
+ return (React.createElement(React.Fragment, null,
143
+ React.createElement(ViewCell, { data: curSelectItem, showType: "tree", relation: undefined }),
144
+ moveIn && (React.createElement(React.Fragment, null,
145
+ React.createElement("div", { className: "weda-select-user-dept__dialog-input-clear", onClick: (e) => {
146
+ e.stopPropagation();
147
+ onChange === null || onChange === void 0 ? void 0 : onChange();
148
+ } },
149
+ React.createElement("p", { className: "weda-select-user-dept__dialog-input-clear-close" }))))));
150
+ };
151
+ const ViewCell = ({ data, showType, relation }) => {
152
+ if (showType === 'tree') {
153
+ return React.createElement(Text, { verticalAlign: "middle" }, (data === null || data === void 0 ? void 0 : data.content) || '-');
154
+ }
155
+ const defaultValue = getRelationData(relation);
156
+ return (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.id) ? (React.createElement(Text, { verticalAlign: "middle" }, defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.content)) : (React.createElement(Text, null, "-"));
157
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function DepartTreeSelect(props: any): JSX.Element;
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ import { ConfigProvider } from 'tea-component';
3
+ // import './index.less';
4
+ import { usePlatform } from '../../../../utils/platform';
5
+ import { DepartTreeSelectH5 as DepartSelectH5 } from './departTreeSelect.h5';
6
+ import { DepartTreeSelectPC as DepartSelectPC } from './departTreeSelect.pc';
7
+ export default function DepartTreeSelect(props) {
8
+ const platform = usePlatform();
9
+ if ((props === null || props === void 0 ? void 0 : props.showType) === 'pc') {
10
+ return React.createElement(DepartSelectPC, { ...props });
11
+ }
12
+ if ((props === null || props === void 0 ? void 0 : props.showType) === 'h5') {
13
+ return React.createElement(DepartSelectH5, { ...props });
14
+ }
15
+ return platform === 'h5' ? (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
16
+ React.createElement(DepartSelectH5, { ...props }))) : (React.createElement(DepartSelectPC, { ...props }));
17
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 根据_id查询部门数据
3
+ *
4
+ */
5
+ export function getDepartById(data: any): Promise<any>;
6
+ export function initRootOrgs(data: any): Promise<any>;
7
+ export function getDeparts(data: any): Promise<any>;
8
+ export function searchByCondition(data: any): Promise<any>;
9
+ export function defaultRequest(action: any, params: any, type?: any): Promise<any>;
10
+ export function getDataSourceByName(dbName: any): Promise<any>;
11
+ export function getUserInfo(): Promise<any>;
@@ -0,0 +1,159 @@
1
+ import { callWedaApi, callDataSource } from '../../../utils/tcb';
2
+ /**
3
+ * 默认请求统一处理方法
4
+ * @param {*} action
5
+ * @param {*} params
6
+ * @param {*} type
7
+ * @returns
8
+ */
9
+ export const defaultRequest = async (action, params, type = 'callWedaApi') => {
10
+ try {
11
+ if (type === 'callWedaApi') {
12
+ const res = await callWedaApi({
13
+ action: action,
14
+ data: params,
15
+ });
16
+ return res;
17
+ }
18
+ else if (type === 'callDataSource' && action === 'getUserById') {
19
+ const datasource = await getDataSourceByName('sys_user');
20
+ const userInfoList = [];
21
+ let pageNo = 1;
22
+ const setInitUserDataHandle = async () => {
23
+ const res = await callWedaApi({
24
+ action: 'DescribeWedaUsersRuntime',
25
+ data: {
26
+ pageNo: pageNo,
27
+ pageSize: 200,
28
+ UserIds: (params === null || params === void 0 ? void 0 : params.idList) || [],
29
+ UserType: 'internalUser',
30
+ },
31
+ });
32
+ const resData = ((res === null || res === void 0 ? void 0 : res.UserList) || []).map((item) => {
33
+ const userInfo = JSON.parse(item === null || item === void 0 ? void 0 : item.UserExtend) || {};
34
+ return {
35
+ value: item === null || item === void 0 ? void 0 : item.UserId,
36
+ data: {
37
+ content: (datasource === null || datasource === void 0 ? void 0 : datasource.schema['x-primary-column']) === 'name'
38
+ ? item === null || item === void 0 ? void 0 : item.Name
39
+ : userInfo[datasource === null || datasource === void 0 ? void 0 : datasource.schema['x-primary-column']] ||
40
+ (item === null || item === void 0 ? void 0 : item.UserId),
41
+ },
42
+ orgs: item === null || item === void 0 ? void 0 : item.Orgs,
43
+ };
44
+ });
45
+ userInfoList.push.apply(userInfoList, resData);
46
+ if ((res === null || res === void 0 ? void 0 : res.Total) > pageNo * 100) {
47
+ pageNo += 1;
48
+ await setInitUserDataHandle();
49
+ }
50
+ };
51
+ (params === null || params === void 0 ? void 0 : params.idList.length) > 0 && (await setInitUserDataHandle());
52
+ return userInfoList;
53
+ }
54
+ }
55
+ catch (error) {
56
+ console.error(action + '错误', error);
57
+ throw errorHandle(error, action);
58
+ }
59
+ };
60
+ /**
61
+ * 获取用户表schema
62
+ */
63
+ export const getDataSourceByName = async (dbName) => {
64
+ // dbName 为空时
65
+ if (!dbName)
66
+ return;
67
+ const datasource = await window.app.cloud.getDataSourceProfile(dbName);
68
+ return datasource;
69
+ };
70
+ /**
71
+ * 根据_id查询部门数据
72
+ *
73
+ */
74
+ export async function getDepartById(data) {
75
+ try {
76
+ const datasource = await getDataSourceByName('sys_department');
77
+ const res = await callDataSource({
78
+ dataSourceName: 'sys_department',
79
+ methodName: 'wedaGetItem',
80
+ params: data,
81
+ });
82
+ return res[datasource === null || datasource === void 0 ? void 0 : datasource.schema['x-primary-column']] || (res === null || res === void 0 ? void 0 : res._id);
83
+ }
84
+ catch (error) {
85
+ console.error('错误', error);
86
+ throw errorHandle(error, 'getDepartById');
87
+ }
88
+ }
89
+ /**
90
+ * 获取当前登录人信息
91
+ * */
92
+ export const getUserInfo = () => {
93
+ var _a, _b;
94
+ const userInfo = (_b = (_a = window === null || window === void 0 ? void 0 : window.app) === null || _a === void 0 ? void 0 : _a.auth) === null || _b === void 0 ? void 0 : _b.getUserInfo();
95
+ return Promise.resolve(userInfo);
96
+ };
97
+ /*
98
+ * 初始化加载部门数据
99
+ * @author servernnyu
100
+ */
101
+ export async function initRootOrgs(data) {
102
+ try {
103
+ const res = await callWedaApi({
104
+ action: 'InitRootOrgs',
105
+ data,
106
+ });
107
+ return res;
108
+ }
109
+ catch (error) {
110
+ console.error('错误', error);
111
+ throw errorHandle(error, 'InitRootOrgs');
112
+ }
113
+ }
114
+ /*
115
+ * 懒加载部门数据 LazyDescribeOrgs
116
+ * OrgId:组织架构Id,为根节点就不传了,我就会去查根节点
117
+ * DescribeCondition:查询条件,现在可以传{"Key":"NeedUser","Value": "true"}
118
+ */
119
+ export async function getDeparts(data) {
120
+ try {
121
+ const res = await callWedaApi({
122
+ action: 'LazyDescribeOrgs',
123
+ data,
124
+ });
125
+ return res;
126
+ }
127
+ catch (error) {
128
+ console.error('错误', error);
129
+ throw errorHandle(error, 'LazyDescribeOrgs');
130
+ }
131
+ }
132
+ /*
133
+ SearchByCondition接口
134
+ 入参:
135
+ KeyWords:关键词
136
+ SearchCondition:搜索条件,当前要传俩,一个是是否关联用户同上,一个是SeachType,SearchByRole和SearchByOrg, NeedUser
137
+ */
138
+ export async function searchByCondition(data) {
139
+ try {
140
+ const res = await callWedaApi({
141
+ action: 'SearchByCondition',
142
+ data,
143
+ });
144
+ return res;
145
+ }
146
+ catch (error) {
147
+ console.error('错误', error);
148
+ throw errorHandle(error, 'SearchByCondition');
149
+ }
150
+ }
151
+ const errorHandle = (error, action) => {
152
+ var _a;
153
+ if (error === null || error === void 0 ? void 0 : error.result) {
154
+ return `${(_a = error === null || error === void 0 ? void 0 : error.result) === null || _a === void 0 ? void 0 : _a.message}(${action}${error === null || error === void 0 ? void 0 : error.requestId})`;
155
+ }
156
+ else {
157
+ return `${action}(${error === null || error === void 0 ? void 0 : error.message})`;
158
+ }
159
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function UserTreeSelect(props: any): JSX.Element;
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ import { ConfigProvider } from 'tea-component';
3
+ // import './index.less';
4
+ import { usePlatform } from '../../../utils/platform';
5
+ import { UserTreeSelectH5 as UserSelectH5 } from './userTreeSelect.h5';
6
+ import { UserTreeSelectPC as UserSelectPC } from './userTreeSelect.pc';
7
+ export default function UserTreeSelect(props) {
8
+ const platform = usePlatform();
9
+ if ((props === null || props === void 0 ? void 0 : props.showType) === 'pc') {
10
+ return React.createElement(UserSelectPC, { ...props });
11
+ }
12
+ if ((props === null || props === void 0 ? void 0 : props.showType) === 'h5') {
13
+ return React.createElement(UserSelectH5, { ...props });
14
+ }
15
+ return platform === 'h5' ? (React.createElement(ConfigProvider, { classPrefix: "wedatea2td" },
16
+ React.createElement(UserSelectH5, { ...props }))) : (React.createElement(UserSelectPC, { ...props }));
17
+ }
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import type { CommonFormPropsType } from '../types';
3
+ import './userOrgSelect.css';
4
+ export declare function UserTreeSelectH5({ id, className, style, events, label, labelVisible, name, placeholder, defaultValueType, defaultValue, confirmValue, disabled, layout, requiredFlag, decorator, multiple, //是否多选
5
+ focus: autoFocus, onChange, modelOpen, request, }: IUserTreeSelec): JSX.Element;
6
+ export interface IUserTreeSelec extends CommonFormPropsType {
7
+ defaultValue?: Readonly<string | string[]>;
8
+ confirmValue?: string;
9
+ placeholder?: string;
10
+ modelType?: string;
11
+ defaultValueType?: 'noneUser' | 'confirmUser' | 'loginUser';
12
+ maxLength?: number;
13
+ focus?: boolean;
14
+ size?: 's' | 'm' | 'l' | 'full';
15
+ modelClassName?: string;
16
+ modelStyle?: React.CSSProperties;
17
+ clearable?: boolean;
18
+ multiple?: boolean;
19
+ relation?: object;
20
+ isMuti?: boolean;
21
+ matchButtonWidth?: boolean;
22
+ dropDownStyle?: React.CSSProperties;
23
+ onChange?: (v: any) => void;
24
+ request?: any;
25
+ modelOpen?: boolean;
26
+ getUserByIdRequest?: (v: any) => any;
27
+ }