@cloudbase/weda-ui 3.1.9 → 3.2.1
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.
- package/dist/configs/components/chart/bar.json +3 -3
- package/dist/configs/components/chart/line.json +3 -3
- package/dist/configs/components/chart/pie.json +3 -3
- package/dist/configs/components/form/departTreeSelect.json +124 -0
- package/dist/configs/components/form/userTreeSelect.json +128 -0
- package/dist/configs/components/formdetail.json +105 -0
- package/dist/configs/components/listView.json +9 -1
- package/dist/configs/components/lottery.json +1 -1
- package/dist/configs/components/tabs.json +10 -9
- package/dist/configs/components/wxOpenApi/share.json +5 -2
- package/dist/configs/index.d.ts +6 -0
- package/dist/configs/index.js +6 -0
- package/dist/cypress/support/commands.d.ts +1 -0
- package/dist/cypress/support/commands.js +40 -0
- package/dist/cypress/support/e2e.d.ts +24 -0
- package/dist/cypress/support/e2e.js +22 -0
- package/dist/src/configs/actions/showModal.json +48 -0
- package/dist/src/configs/actions/showToast.json +41 -0
- package/dist/src/configs/components/auth.json +16 -0
- package/dist/src/configs/components/button.json +239 -0
- package/dist/src/configs/components/calendar.json +81 -0
- package/dist/src/configs/components/carousel.json +292 -0
- package/dist/src/configs/components/chart/bar.json +954 -0
- package/dist/src/configs/components/chart/line.json +870 -0
- package/dist/src/configs/components/chart/pie.json +677 -0
- package/dist/src/configs/components/chart/statisticsCard.json +376 -0
- package/dist/src/configs/components/container.json +50 -0
- package/dist/src/configs/components/dataView.json +247 -0
- package/dist/src/configs/components/drawer.json +115 -0
- package/dist/src/configs/components/form/checkbox.json +179 -0
- package/dist/src/configs/components/form/departTreeSelect.json +124 -0
- package/dist/src/configs/components/form/form.json +73 -0
- package/dist/src/configs/components/form/input.json +154 -0
- package/dist/src/configs/components/form/location.json +216 -0
- package/dist/src/configs/components/form/radio.json +203 -0
- package/dist/src/configs/components/form/richText.json +133 -0
- package/dist/src/configs/components/form/select.json +449 -0
- package/dist/src/configs/components/form/switch.json +58 -0
- package/dist/src/configs/components/form/textarea.json +116 -0
- package/dist/src/configs/components/form/tips.json +34 -0
- package/dist/src/configs/components/form/uploader.json +171 -0
- package/dist/src/configs/components/form/uploaderFile.json +158 -0
- package/dist/src/configs/components/form/userTreeSelect.json +128 -0
- package/dist/src/configs/components/formdetail.json +105 -0
- package/dist/src/configs/components/graphicCard.json +413 -0
- package/dist/src/configs/components/image.json +187 -0
- package/dist/src/configs/components/link.json +79 -0
- package/dist/src/configs/components/listView.json +378 -0
- package/dist/src/configs/components/lottery.json +163 -0
- package/dist/src/configs/components/modal.json +72 -0
- package/dist/src/configs/components/navLayout.json +368 -0
- package/dist/src/configs/components/navigationBar.json +62 -0
- package/dist/src/configs/components/richtextview.json +26 -0
- package/dist/src/configs/components/scrollVeiw.json +253 -0
- package/dist/src/configs/components/slot.json +17 -0
- package/dist/src/configs/components/swiper.json +90 -0
- package/dist/src/configs/components/tabs.json +122 -0
- package/dist/src/configs/components/text.json +95 -0
- package/dist/src/configs/components/wedaVideo.json +89 -0
- package/dist/src/configs/components/wxOpenApi/phone.json +127 -0
- package/dist/src/configs/components/wxOpenApi/phoneCode.json +109 -0
- package/dist/src/configs/components/wxOpenApi/share.json +160 -0
- package/dist/src/configs/components/wxOpenApi/userInfo.json +156 -0
- package/dist/src/configs/index.d.ts +103 -0
- package/dist/src/configs/index.js +111 -0
- package/dist/src/docs/common/format.d.ts +13 -0
- package/dist/src/docs/common/format.js +122 -0
- package/dist/src/docs/common/tableView.d.ts +30 -0
- package/dist/src/docs/common/tableView.js +156 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +3 -0
- package/dist/src/setupTests.d.ts +2 -0
- package/dist/src/setupTests.js +19 -0
- package/dist/src/web/actions/index.d.ts +2 -0
- package/dist/src/web/actions/index.js +2 -0
- package/dist/src/web/actions/showModal/index.d.ts +4 -0
- package/dist/src/web/actions/showModal/index.js +67 -0
- package/dist/src/web/actions/showToast/index.d.ts +1 -0
- package/dist/src/web/actions/showToast/index.js +3 -0
- package/dist/src/web/components/button/index.d.ts +32 -0
- package/dist/src/web/components/button/index.js +48 -0
- package/dist/src/web/components/calendar/index.d.ts +19 -0
- package/dist/src/web/components/calendar/index.js +189 -0
- package/dist/src/web/components/calendar/util.d.ts +13 -0
- package/dist/src/web/components/calendar/util.js +74 -0
- package/dist/src/web/components/carousel/index.d.ts +41 -0
- package/dist/src/web/components/carousel/index.js +244 -0
- package/dist/src/web/components/chart/bar/index.d.ts +3 -0
- package/dist/src/web/components/chart/bar/index.js +41 -0
- package/dist/src/web/components/chart/bar/index.old.d.ts +40 -0
- package/dist/src/web/components/chart/bar/index.old.js +56 -0
- package/dist/src/web/components/chart/common/Chart.d.ts +9 -0
- package/dist/src/web/components/chart/common/Chart.js +23 -0
- package/dist/src/web/components/chart/common/chart-custom-connector.d.ts +6 -0
- package/dist/src/web/components/chart/common/chart-custom-connector.js +35 -0
- package/dist/src/web/components/chart/common/chart-error.d.ts +2 -0
- package/dist/src/web/components/chart/common/chart-error.js +2 -0
- package/dist/src/web/components/chart/common/config/bar.d.ts +48 -0
- package/dist/src/web/components/chart/common/config/bar.js +49 -0
- package/dist/src/web/components/chart/common/config/global.d.ts +13 -0
- package/dist/src/web/components/chart/common/config/global.js +16 -0
- package/dist/src/web/components/chart/common/config/line.d.ts +46 -0
- package/dist/src/web/components/chart/common/config/line.js +49 -0
- package/dist/src/web/components/chart/common/config/pie.d.ts +29 -0
- package/dist/src/web/components/chart/common/config/pie.js +36 -0
- package/dist/src/web/components/chart/common/core/eChartBar.d.ts +66 -0
- package/dist/src/web/components/chart/common/core/eChartBar.js +201 -0
- package/dist/src/web/components/chart/common/core/eChartBase.d.ts +127 -0
- package/dist/src/web/components/chart/common/core/eChartBase.js +394 -0
- package/dist/src/web/components/chart/common/core/eChartLine.d.ts +60 -0
- package/dist/src/web/components/chart/common/core/eChartLine.js +173 -0
- package/dist/src/web/components/chart/common/core/eChartPie.d.ts +48 -0
- package/dist/src/web/components/chart/common/core/eChartPie.js +135 -0
- package/dist/src/web/components/chart/common/core/type.d.ts +35 -0
- package/dist/src/web/components/chart/common/core/type.js +9 -0
- package/dist/src/web/components/chart/common/data-transform.d.ts +6 -0
- package/dist/src/web/components/chart/common/data-transform.js +246 -0
- package/dist/src/web/components/chart/common/echarts.d.ts +5 -0
- package/dist/src/web/components/chart/common/echarts.js +24 -0
- package/dist/src/web/components/chart/common/error-boundary.d.ts +5 -0
- package/dist/src/web/components/chart/common/error-boundary.js +26 -0
- package/dist/src/web/components/chart/common/useChart.d.ts +8 -0
- package/dist/src/web/components/chart/common/useChart.js +61 -0
- package/dist/src/web/components/chart/line/index.d.ts +3 -0
- package/dist/src/web/components/chart/line/index.js +42 -0
- package/dist/src/web/components/chart/line/index.old.d.ts +38 -0
- package/dist/src/web/components/chart/line/index.old.js +53 -0
- package/dist/src/web/components/chart/pie/index.d.ts +3 -0
- package/dist/src/web/components/chart/pie/index.js +42 -0
- package/dist/src/web/components/chart/pie/index.old.d.ts +27 -0
- package/dist/src/web/components/chart/pie/index.old.js +40 -0
- package/dist/src/web/components/chart/statisticsCard/index.d.ts +85 -0
- package/dist/src/web/components/chart/statisticsCard/index.js +203 -0
- package/dist/src/web/components/chart/statisticsCard/interface.d.ts +13 -0
- package/dist/src/web/components/chart/statisticsCard/interface.js +1 -0
- package/dist/src/web/components/common/portal.d.ts +7 -0
- package/dist/src/web/components/common/portal.js +14 -0
- package/dist/src/web/components/container/index.d.ts +6 -0
- package/dist/src/web/components/container/index.js +6 -0
- package/dist/src/web/components/dataView/index.d.ts +6 -0
- package/dist/src/web/components/dataView/index.js +8 -0
- package/dist/src/web/components/dataView/interface.d.ts +5 -0
- package/dist/src/web/components/dataView/interface.js +1 -0
- package/dist/src/web/components/drawer/index.d.ts +13 -0
- package/dist/src/web/components/drawer/index.js +12 -0
- package/dist/src/web/components/form/checkbox/index.d.ts +13 -0
- package/dist/src/web/components/form/checkbox/index.js +167 -0
- package/dist/src/web/components/form/enumSelect/MultipleSelect.d.ts +78 -0
- package/dist/src/web/components/form/enumSelect/MultipleSelect.js +52 -0
- package/dist/src/web/components/form/enumSelect/NormalSelect.d.ts +83 -0
- package/dist/src/web/components/form/enumSelect/NormalSelect.js +52 -0
- package/dist/src/web/components/form/enumSelect/SelectContainer.d.ts +16 -0
- package/dist/src/web/components/form/enumSelect/SelectContainer.js +30 -0
- package/dist/src/web/components/form/enumSelect/index.d.ts +82 -0
- package/dist/src/web/components/form/enumSelect/index.js +6 -0
- package/dist/src/web/components/form/enumSelect/props/defaultProps.d.ts +34 -0
- package/dist/src/web/components/form/enumSelect/props/defaultProps.js +40 -0
- package/dist/src/web/components/form/enumSelect/props/propsTypes.d.ts +39 -0
- package/dist/src/web/components/form/enumSelect/props/propsTypes.js +47 -0
- package/dist/src/web/components/form/form/index.d.ts +32 -0
- package/dist/src/web/components/form/form/index.js +141 -0
- package/dist/src/web/components/form/formcell/index.d.ts +8 -0
- package/dist/src/web/components/form/formcell/index.js +40 -0
- package/dist/src/web/components/form/input/index.d.ts +14 -0
- package/dist/src/web/components/form/input/index.js +86 -0
- package/dist/src/web/components/form/location/common/mapChoose.d.ts +15 -0
- package/dist/src/web/components/form/location/common/mapChoose.js +495 -0
- package/dist/src/web/components/form/location/common/mapView.d.ts +19 -0
- package/dist/src/web/components/form/location/common/mapView.js +172 -0
- package/dist/src/web/components/form/location/common/propsConfig.d.ts +59 -0
- package/dist/src/web/components/form/location/common/propsConfig.js +50 -0
- package/dist/src/web/components/form/location/common/selectModal.d.ts +21 -0
- package/dist/src/web/components/form/location/common/selectModal.js +44 -0
- package/dist/src/web/components/form/location/common/useLocationInfo.d.ts +36 -0
- package/dist/src/web/components/form/location/common/useLocationInfo.js +104 -0
- package/dist/src/web/components/form/location/components/LocationH5/location.h5.d.ts +8 -0
- package/dist/src/web/components/form/location/components/LocationH5/location.h5.js +325 -0
- package/dist/src/web/components/form/location/components/LocationPC/Header.d.ts +12 -0
- package/dist/src/web/components/form/location/components/LocationPC/Header.js +43 -0
- package/dist/src/web/components/form/location/components/LocationPC/location.PC.d.ts +8 -0
- package/dist/src/web/components/form/location/components/LocationPC/location.PC.js +224 -0
- package/dist/src/web/components/form/location/constants.d.ts +2 -0
- package/dist/src/web/components/form/location/constants.js +3 -0
- package/dist/src/web/components/form/location/index.d.ts +1 -0
- package/dist/src/web/components/form/location/index.js +17 -0
- package/dist/src/web/components/form/radio/index.d.ts +11 -0
- package/dist/src/web/components/form/radio/index.js +115 -0
- package/dist/src/web/components/form/renderDecorator.d.ts +6 -0
- package/dist/src/web/components/form/renderDecorator.js +20 -0
- package/dist/src/web/components/form/select/allTimePicker/calendar.d.ts +13 -0
- package/dist/src/web/components/form/select/allTimePicker/calendar.js +104 -0
- package/dist/src/web/components/form/select/allTimePicker/dataUtils.d.ts +24 -0
- package/dist/src/web/components/form/select/allTimePicker/dataUtils.js +265 -0
- package/dist/src/web/components/form/select/allTimePicker/index.d.ts +14 -0
- package/dist/src/web/components/form/select/allTimePicker/index.js +943 -0
- package/dist/src/web/components/form/select/dropdown-select/ui.d.ts +15 -0
- package/dist/src/web/components/form/select/dropdown-select/ui.js +55 -0
- package/dist/src/web/components/form/select/h5.d.ts +16 -0
- package/dist/src/web/components/form/select/h5.js +452 -0
- package/dist/src/web/components/form/select/index.d.ts +66 -0
- package/dist/src/web/components/form/select/index.js +241 -0
- package/dist/src/web/components/form/select/region/index.d.ts +6 -0
- package/dist/src/web/components/form/select/region/index.js +147 -0
- package/dist/src/web/components/form/select/time.d.ts +9 -0
- package/dist/src/web/components/form/select/time.js +146 -0
- package/dist/src/web/components/form/select/use-options.d.ts +26 -0
- package/dist/src/web/components/form/select/use-options.js +103 -0
- package/dist/src/web/components/form/select/year.d.ts +7 -0
- package/dist/src/web/components/form/select/year.js +72 -0
- package/dist/src/web/components/form/switch/index.d.ts +6 -0
- package/dist/src/web/components/form/switch/index.js +58 -0
- package/dist/src/web/components/form/textarea/index.d.ts +12 -0
- package/dist/src/web/components/form/textarea/index.js +66 -0
- package/dist/src/web/components/form/tips/index.d.ts +8 -0
- package/dist/src/web/components/form/tips/index.js +17 -0
- package/dist/src/web/components/form/uploader/index.d.ts +3 -0
- package/dist/src/web/components/form/uploader/index.js +42 -0
- package/dist/src/web/components/form/uploader/uploader.h5.d.ts +20 -0
- package/dist/src/web/components/form/uploader/uploader.h5.js +199 -0
- package/dist/src/web/components/form/uploader/uploader.pc.d.ts +29 -0
- package/dist/src/web/components/form/uploader/uploader.pc.js +208 -0
- package/dist/src/web/components/form/uploaderFile/index.d.ts +4 -0
- package/dist/src/web/components/form/uploaderFile/index.js +19 -0
- package/dist/src/web/components/form/uploaderFile/uploadFile.h5.d.ts +23 -0
- package/dist/src/web/components/form/uploaderFile/uploadFile.h5.js +328 -0
- package/dist/src/web/components/form/uploaderFile/uploadFile.pc.d.ts +24 -0
- package/dist/src/web/components/form/uploaderFile/uploadFile.pc.js +299 -0
- package/dist/src/web/components/form/userOrgSelect/comTool.d.ts +8 -0
- package/dist/src/web/components/form/userOrgSelect/comTool.js +107 -0
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +19 -0
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +247 -0
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +4 -0
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +158 -0
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.d.ts +2 -0
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.js +17 -0
- package/dist/src/web/components/form/userOrgSelect/index.d.ts +2 -0
- package/dist/src/web/components/form/userOrgSelect/index.js +17 -0
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +26 -0
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.js +258 -0
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +9 -0
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.js +271 -0
- package/dist/src/web/components/form/userOrgSelect/utils.d.ts +35 -0
- package/dist/src/web/components/form/userOrgSelect/utils.js +72 -0
- package/dist/src/web/components/formdetail/index.d.ts +28 -0
- package/dist/src/web/components/formdetail/index.js +170 -0
- package/dist/src/web/components/graphicCard/index.d.ts +46 -0
- package/dist/src/web/components/graphicCard/index.js +179 -0
- package/dist/src/web/components/image/image.d.ts +9 -0
- package/dist/src/web/components/image/image.js +119 -0
- package/dist/src/web/components/image/index.d.ts +13 -0
- package/dist/src/web/components/image/index.js +77 -0
- package/dist/src/web/components/index.d.ts +50 -0
- package/dist/src/web/components/index.js +99 -0
- package/dist/src/web/components/link/index.d.ts +24 -0
- package/dist/src/web/components/link/index.js +71 -0
- package/dist/src/web/components/listView/index.d.ts +7 -0
- package/dist/src/web/components/listView/index.js +296 -0
- package/dist/src/web/components/listView/interface.d.ts +127 -0
- package/dist/src/web/components/listView/interface.js +1 -0
- package/dist/src/web/components/lottery/index.d.ts +22 -0
- package/dist/src/web/components/lottery/index.js +391 -0
- package/dist/src/web/components/lottery/lotteryUtil.d.ts +23 -0
- package/dist/src/web/components/lottery/lotteryUtil.js +181 -0
- package/dist/src/web/components/modal/index.d.ts +17 -0
- package/dist/src/web/components/modal/index.js +11 -0
- package/dist/src/web/components/modal/modal.h5.d.ts +4 -0
- package/dist/src/web/components/modal/modal.h5.js +46 -0
- package/dist/src/web/components/modal/modal.pc.d.ts +3 -0
- package/dist/src/web/components/modal/modal.pc.js +31 -0
- package/dist/src/web/components/navLayout/index.d.ts +61 -0
- package/dist/src/web/components/navLayout/index.js +127 -0
- package/dist/src/web/components/navigationBar/common.d.ts +15 -0
- package/dist/src/web/components/navigationBar/common.js +127 -0
- package/dist/src/web/components/navigationBar/h5Menu.d.ts +14 -0
- package/dist/src/web/components/navigationBar/h5Menu.js +72 -0
- package/dist/src/web/components/navigationBar/horizontalMenu.d.ts +12 -0
- package/dist/src/web/components/navigationBar/horizontalMenu.js +99 -0
- package/dist/src/web/components/navigationBar/index.d.ts +13 -0
- package/dist/src/web/components/navigationBar/index.js +157 -0
- package/dist/src/web/components/navigationBar/verticalMenu.d.ts +13 -0
- package/dist/src/web/components/navigationBar/verticalMenu.js +38 -0
- package/dist/src/web/components/phone/index.d.ts +18 -0
- package/dist/src/web/components/phone/index.js +4 -0
- package/dist/src/web/components/phoneCode/index.d.ts +18 -0
- package/dist/src/web/components/phoneCode/index.js +4 -0
- package/dist/src/web/components/picker/datePicker.d.ts +10 -0
- package/dist/src/web/components/picker/datePicker.js +31 -0
- package/dist/src/web/components/picker/picker.d.ts +6 -0
- package/dist/src/web/components/picker/picker.js +45 -0
- package/dist/src/web/components/picker/timePicker.d.ts +7 -0
- package/dist/src/web/components/picker/timePicker.js +42 -0
- package/dist/src/web/components/richText/const.d.ts +1 -0
- package/dist/src/web/components/richText/const.js +2 -0
- package/dist/src/web/components/richText/index.d.ts +50 -0
- package/dist/src/web/components/richText/index.js +352 -0
- package/dist/src/web/components/richTextView/index.d.ts +7 -0
- package/dist/src/web/components/richTextView/index.js +44 -0
- package/dist/src/web/components/scrollView/index.d.ts +27 -0
- package/dist/src/web/components/scrollView/index.js +95 -0
- package/dist/src/web/components/share/index.d.ts +34 -0
- package/dist/src/web/components/share/index.js +4 -0
- package/dist/src/web/components/slot/index.d.ts +6 -0
- package/dist/src/web/components/slot/index.js +9 -0
- package/dist/src/web/components/swiper/index.d.ts +24 -0
- package/dist/src/web/components/swiper/index.js +153 -0
- package/dist/src/web/components/tabs/index.d.ts +13 -0
- package/dist/src/web/components/tabs/index.js +15 -0
- package/dist/src/web/components/tabs/tabs.h5.d.ts +4 -0
- package/dist/src/web/components/tabs/tabs.h5.js +42 -0
- package/dist/src/web/components/tabs/tabs.pc.d.ts +3 -0
- package/dist/src/web/components/tabs/tabs.pc.js +40 -0
- package/dist/src/web/components/text/index.d.ts +14 -0
- package/dist/src/web/components/text/index.js +17 -0
- package/dist/src/web/components/uploaderFileView/index.d.ts +10 -0
- package/dist/src/web/components/uploaderFileView/index.js +46 -0
- package/dist/src/web/components/uploaderView/index.d.ts +17 -0
- package/dist/src/web/components/uploaderView/index.js +48 -0
- package/dist/src/web/components/userInfo/index.d.ts +26 -0
- package/dist/src/web/components/userInfo/index.js +4 -0
- package/dist/src/web/components/wedaVideo/index.d.ts +17 -0
- package/dist/src/web/components/wedaVideo/index.js +144 -0
- package/dist/src/web/index.d.ts +8 -0
- package/dist/src/web/index.js +4 -0
- package/dist/src/web/utils/classnames.d.ts +2 -0
- package/dist/src/web/utils/classnames.js +37 -0
- package/dist/src/web/utils/constant.d.ts +23 -0
- package/dist/src/web/utils/constant.js +24 -0
- package/dist/src/web/utils/debounce.d.ts +2 -0
- package/dist/src/web/utils/debounce.js +92 -0
- package/dist/src/web/utils/getLocalCounter.d.ts +1 -0
- package/dist/src/web/utils/getLocalCounter.js +4 -0
- package/dist/src/web/utils/getUserService.d.ts +11 -0
- package/dist/src/web/utils/getUserService.js +156 -0
- package/dist/src/web/utils/isObjectEqual.d.ts +2 -0
- package/dist/src/web/utils/isObjectEqual.js +12 -0
- package/dist/src/web/utils/loading-fallback.d.ts +2 -0
- package/dist/src/web/utils/loading-fallback.js +2 -0
- package/dist/src/web/utils/lodash.d.ts +1 -0
- package/dist/src/web/utils/lodash.js +2 -0
- package/dist/src/web/utils/platform.d.ts +18 -0
- package/dist/src/web/utils/platform.js +193 -0
- package/dist/src/web/utils/tcb.d.ts +33 -0
- package/dist/src/web/utils/tcb.js +118 -0
- package/dist/src/web/utils/tmap.d.ts +3 -0
- package/dist/src/web/utils/tmap.js +21 -0
- package/dist/src/web/utils/use-cloud-id-temp-url.d.ts +1 -0
- package/dist/src/web/utils/use-cloud-id-temp-url.js +15 -0
- package/dist/src/web/utils/useSetState.d.ts +1 -0
- package/dist/src/web/utils/useSetState.js +8 -0
- package/dist/src/web/utils/useSyncValue.d.ts +4 -0
- package/dist/src/web/utils/useSyncValue.js +15 -0
- package/dist/src/web/utils/weui.d.ts +1 -0
- package/dist/src/web/utils/weui.js +2 -0
- package/dist/web/components/calendar/index.js +10 -2
- package/dist/web/components/carousel/index.js +4 -0
- package/dist/web/components/chart/common/core/eChartBase.js +8 -2
- package/dist/web/components/form/form/index.js +10 -7
- package/dist/web/components/form/location/common/mapChoose.js +2 -0
- package/dist/web/components/form/location/common/mapView.js +2 -0
- package/dist/web/components/form/location/components/LocationH5/location.h5.js +3 -1
- package/dist/web/components/form/location/components/LocationH5/location.module.css +3 -0
- package/dist/web/components/form/select/allTimePicker/calendar.css +114 -0
- package/dist/web/components/form/select/allTimePicker/index.css +136 -0
- package/dist/web/components/form/select/h5.js +4 -0
- package/dist/web/components/form/select/index.js +2 -8
- package/dist/web/components/form/switch/index.js +3 -2
- package/dist/web/components/form/switch/switch.module.css +7 -0
- package/dist/web/components/form/uploader/uploader.h5.d.ts +1 -0
- package/dist/web/components/form/uploader/uploader.h5.js +14 -10
- package/dist/web/components/form/uploader/uploader.pc.js +1 -1
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +14 -12
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +8 -8
- package/dist/web/components/form/userOrgSelect/comTool.d.ts +7 -0
- package/dist/web/components/form/userOrgSelect/comTool.js +89 -0
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +20 -0
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +259 -0
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +4 -0
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +153 -0
- package/dist/web/components/form/userOrgSelect/departTreeSelect/index.d.ts +2 -0
- package/dist/web/components/form/userOrgSelect/departTreeSelect/index.js +17 -0
- package/dist/web/components/form/userOrgSelect/index.d.ts +2 -0
- package/dist/web/components/form/userOrgSelect/index.js +17 -0
- package/dist/web/components/form/userOrgSelect/userOrgSelect.css +805 -0
- package/dist/web/components/form/userOrgSelect/userOrgSelect.less +643 -0
- package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +24 -0
- package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.js +276 -0
- package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +9 -0
- package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.js +229 -0
- package/dist/web/components/form/userOrgSelect/utils.d.ts +35 -0
- package/dist/web/components/form/userOrgSelect/utils.js +72 -0
- package/dist/web/components/formdetail/index.css +115 -0
- package/dist/web/components/formdetail/index.d.ts +28 -0
- package/dist/web/components/formdetail/index.js +170 -0
- package/dist/web/components/index.d.ts +3 -0
- package/dist/web/components/index.js +3 -0
- package/dist/web/components/listView/index.css +35 -5
- package/dist/web/components/listView/index.js +92 -68
- package/dist/web/components/listView/interface.d.ts +5 -0
- package/dist/web/components/lottery/index.js +2 -1
- package/dist/web/components/lottery/lotteryUtil.js +1 -0
- package/dist/web/components/navigationBar/index.css +21 -29
- package/dist/web/components/richText/index.css +1 -0
- package/dist/web/components/swiper/index.js +5 -1
- package/dist/web/components/wedaVideo/index.js +1 -0
- package/dist/web/utils/getUserService.d.ts +17 -0
- package/dist/web/utils/getUserService.js +148 -0
- package/dist/web/utils/platform.js +2 -0
- package/dist/web/weda-ui.css +9 -0
- package/package.json +27 -13
- package/dist/asset-manifest.json +0 -17
- package/dist/index.html +0 -88
- package/dist/static/js/bundle.js +0 -963
- package/dist/static/js/bundle.js.map +0 -1
- package/dist/static/js/main.chunk.js +0 -8841
- package/dist/static/js/main.chunk.js.map +0 -1
- package/dist/static/js/vendors~main.chunk.js +0 -247885
- package/dist/static/js/vendors~main.chunk.js.map +0 -1
- package/dist/static/media/ef6fa527e24e354765d806b826b41391.fa67580a.svg +0 -627
- package/dist/web/components/auth/index.d.ts +0 -10
- package/dist/web/components/auth/index.js +0 -37
- package/dist/web/utils/events.d.ts +0 -1
- package/dist/web/utils/events.js +0 -2
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import EchartBase from './eChartBase';
|
|
2
|
+
import getConfig from '../config/pie';
|
|
3
|
+
/**
|
|
4
|
+
* 饼状图表
|
|
5
|
+
* @author loonglong
|
|
6
|
+
**/
|
|
7
|
+
class EchartPie extends EchartBase {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
const config = getConfig();
|
|
11
|
+
this.config = { ...this.config, ...config };
|
|
12
|
+
}
|
|
13
|
+
async setSourceData({ dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, }) {
|
|
14
|
+
const { name = '', type = '', methodName = '' } = dataSource;
|
|
15
|
+
if (name !== '') {
|
|
16
|
+
const params = this.createWhere({
|
|
17
|
+
filterData,
|
|
18
|
+
xField,
|
|
19
|
+
xStatistics,
|
|
20
|
+
xIsCountEmpty,
|
|
21
|
+
yField,
|
|
22
|
+
});
|
|
23
|
+
const arrSourData = await this.getSourceData(name, methodName, type, params);
|
|
24
|
+
// 获取 x 轴数据
|
|
25
|
+
if (arrSourData.length > 0) {
|
|
26
|
+
const numPie = arrSourData[0].YLabels.length;
|
|
27
|
+
if (numPie > 0) {
|
|
28
|
+
const arrData = [];
|
|
29
|
+
let i = 0;
|
|
30
|
+
arrSourData.forEach((itemSource) => {
|
|
31
|
+
const numc = setColor ? setColor.length : 0;
|
|
32
|
+
const strColor = numc > 0 ? { color: setColor[i % numc] } : {};
|
|
33
|
+
arrData.push({
|
|
34
|
+
value: itemSource.YLabels[0].Value,
|
|
35
|
+
name: itemSource.XLabel.Value,
|
|
36
|
+
tooltip: {},
|
|
37
|
+
itemStyle: strColor,
|
|
38
|
+
});
|
|
39
|
+
i = i + 1;
|
|
40
|
+
});
|
|
41
|
+
this.config.series[0].data = arrData;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
// this.config['series'][0].data = [];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
setChartType({ chartType }) {
|
|
50
|
+
this.config.series.length > 0 &&
|
|
51
|
+
this.config.series.forEach((itemSeries) => {
|
|
52
|
+
if (chartType === 'pie') {
|
|
53
|
+
itemSeries.radius = '70%';
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
// @ts-ignore no type
|
|
57
|
+
itemSeries.radius = ['40%', '70%'];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
// 显示图表上的数据标签 单位,标签,小数位数,后缀
|
|
62
|
+
setIsSeriesShowSymbol({ isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }) {
|
|
63
|
+
decimalDigits = decimalDigits < 0 ? 0 : decimalDigits;
|
|
64
|
+
let show = false;
|
|
65
|
+
let position = 'inner';
|
|
66
|
+
let formatter = null;
|
|
67
|
+
if (isSeriesShowSymbol || isPercent || isUnit) {
|
|
68
|
+
formatter = '';
|
|
69
|
+
}
|
|
70
|
+
this.config.series[0].label.show = show;
|
|
71
|
+
this.config.series[0].label.position = position;
|
|
72
|
+
if (formatter === null) {
|
|
73
|
+
this.config.series[0].label.normal = null;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
this.config.series[0].label.normal.formatter = (objValue) => {
|
|
77
|
+
let reData = '';
|
|
78
|
+
if (isSeriesShowSymbol) {
|
|
79
|
+
// 显示数值
|
|
80
|
+
reData = objValue.value;
|
|
81
|
+
}
|
|
82
|
+
if (isUnit) {
|
|
83
|
+
// 显示单位
|
|
84
|
+
if (unit) {
|
|
85
|
+
const objNewValue = this.getValueByUnit(objValue.value, unit);
|
|
86
|
+
reData = `${objNewValue.toFixed(decimalDigits)}${suffix}`;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
reData = `${objValue.value.toFixed(decimalDigits)}`;
|
|
90
|
+
}
|
|
91
|
+
this.config.series[0].data.forEach((itemData) => {
|
|
92
|
+
itemData.tooltip.formatter = (objVal) => {
|
|
93
|
+
const objItemData = this.getValueByUnit(objVal.value, unit);
|
|
94
|
+
return `${objItemData.toFixed(decimalDigits)}${suffix}`;
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (isPercent) {
|
|
99
|
+
// 显示百分比
|
|
100
|
+
reData = `${reData}(${objValue.percent}%)`;
|
|
101
|
+
}
|
|
102
|
+
return reData;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async setOptions({ chartType, isTitle, title,
|
|
107
|
+
// titleLocation,
|
|
108
|
+
dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, isLegend, legend,
|
|
109
|
+
// legend2,
|
|
110
|
+
isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }) {
|
|
111
|
+
if (dataSource) {
|
|
112
|
+
await this.setSourceData({
|
|
113
|
+
dataSource,
|
|
114
|
+
filterData,
|
|
115
|
+
setColor,
|
|
116
|
+
xField,
|
|
117
|
+
xStatistics,
|
|
118
|
+
xIsCountEmpty,
|
|
119
|
+
yField,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
this.setChartType({ chartType });
|
|
123
|
+
this.setTitle({ isTitle, title });
|
|
124
|
+
this.setLegend({ isLegend, legend });
|
|
125
|
+
this.setIsSeriesShowSymbol({
|
|
126
|
+
isSeriesShowSymbol,
|
|
127
|
+
isPercent,
|
|
128
|
+
isUnit,
|
|
129
|
+
unit,
|
|
130
|
+
decimalDigits,
|
|
131
|
+
suffix,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
export default EchartPie;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface DataSource {
|
|
2
|
+
name: string;
|
|
3
|
+
type: string;
|
|
4
|
+
subType: string;
|
|
5
|
+
provider?: string;
|
|
6
|
+
methodName: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ObjSource {
|
|
9
|
+
dataSourceName: string;
|
|
10
|
+
dataSourceType: string;
|
|
11
|
+
dataSourceMethodName: string;
|
|
12
|
+
}
|
|
13
|
+
export interface Xfield {
|
|
14
|
+
format: string;
|
|
15
|
+
type: string;
|
|
16
|
+
title: string;
|
|
17
|
+
name: string;
|
|
18
|
+
}
|
|
19
|
+
declare enum CountType {
|
|
20
|
+
'count' = 0,
|
|
21
|
+
'sum' = 1,
|
|
22
|
+
'avg' = 2,
|
|
23
|
+
'max' = 3,
|
|
24
|
+
'min' = 4
|
|
25
|
+
}
|
|
26
|
+
export interface YfieldOne {
|
|
27
|
+
key: string;
|
|
28
|
+
operationType: CountType;
|
|
29
|
+
title?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface Yfield {
|
|
32
|
+
groupKey?: string;
|
|
33
|
+
numValue?: Array<YfieldOne>;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var CountType;
|
|
2
|
+
(function (CountType) {
|
|
3
|
+
CountType[CountType["count"] = 0] = "count";
|
|
4
|
+
CountType[CountType["sum"] = 1] = "sum";
|
|
5
|
+
CountType[CountType["avg"] = 2] = "avg";
|
|
6
|
+
CountType[CountType["max"] = 3] = "max";
|
|
7
|
+
CountType[CountType["min"] = 4] = "min";
|
|
8
|
+
})(CountType || (CountType = {}));
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ECOption } from './echarts';
|
|
2
|
+
import type { IDataInputItem, IChartInput, IPieChartInput, IChartType, PropsType } from './types';
|
|
3
|
+
export declare const checkIsNewData: (props: PropsType) => boolean;
|
|
4
|
+
export declare function transform(chartType: 'pie', dataInput: Readonly<IDataInputItem[]>, chartInput: IPieChartInput): ECOption;
|
|
5
|
+
export declare function transform(chartType: 'bar' | 'line', dataInput: Readonly<IDataInputItem[]>, chartInput: IChartInput): ECOption;
|
|
6
|
+
export declare function transform(chartType: IChartType, dataInput: Readonly<IDataInputItem[]>, chartInput: Readonly<typeof chartType extends 'bar' | 'line' ? IChartInput : typeof chartType extends 'pie' ? IPieChartInput : IPieChartInput & IChartInput>): ECOption;
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { ChartError } from './chart-error';
|
|
2
|
+
export const checkIsNewData = (props) => {
|
|
3
|
+
var _a, _b;
|
|
4
|
+
return (Object.keys((_a = props.dataSource) !== null && _a !== void 0 ? _a : {}).length === 0 &&
|
|
5
|
+
Object.keys((_b = props['dataModel']) !== null && _b !== void 0 ? _b : {}).length > 0);
|
|
6
|
+
};
|
|
7
|
+
export function transform(chartType, dataInput, chartInput) {
|
|
8
|
+
var _a;
|
|
9
|
+
if (!Array.isArray(dataInput)) {
|
|
10
|
+
throw new ChartError('Chart 数据输入应该是数组类型');
|
|
11
|
+
}
|
|
12
|
+
const title = {
|
|
13
|
+
text: chartInput.title,
|
|
14
|
+
show: chartInput.isTitle,
|
|
15
|
+
left: '35%',
|
|
16
|
+
top: '-1%',
|
|
17
|
+
right: null,
|
|
18
|
+
};
|
|
19
|
+
const legend = {
|
|
20
|
+
show: chartInput.isLegend,
|
|
21
|
+
};
|
|
22
|
+
switch (chartInput.legend) {
|
|
23
|
+
case 'top':
|
|
24
|
+
legend.orient = 'horizontal';
|
|
25
|
+
legend.top = '6%';
|
|
26
|
+
break;
|
|
27
|
+
/* istanbul ignore next */
|
|
28
|
+
case 'left':
|
|
29
|
+
legend.orient = 'vertical';
|
|
30
|
+
legend.top = '30%';
|
|
31
|
+
legend.left = '1%';
|
|
32
|
+
break;
|
|
33
|
+
/* istanbul ignore next */
|
|
34
|
+
case 'right':
|
|
35
|
+
legend.orient = 'vertical';
|
|
36
|
+
legend.top = '30%';
|
|
37
|
+
legend.right = '6%';
|
|
38
|
+
break;
|
|
39
|
+
default:
|
|
40
|
+
legend.top = '89%';
|
|
41
|
+
legend.orient = 'horizontal';
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
// const numberOfYAxis = dataInput?.[0]?.YLabels.length ?? 0;
|
|
45
|
+
// const sortedDataInput = dataInput.sort((a, b) => {
|
|
46
|
+
// // if (['datetime', 'date', 'time'].includes(formatType)) {
|
|
47
|
+
// });
|
|
48
|
+
// 自定义连接器或者变量不用前端排序
|
|
49
|
+
// 是否显示空值
|
|
50
|
+
const finalDataInput = (_a = (dataInput !== null && dataInput !== void 0 ? dataInput : [])) === null || _a === void 0 ? void 0 : _a.filter((item) => {
|
|
51
|
+
if (!chartInput.xIsCountEmpty) {
|
|
52
|
+
return (item.XLabel['Value'] !== undefined && item.XLabel['Value'] !== null);
|
|
53
|
+
}
|
|
54
|
+
return true;
|
|
55
|
+
});
|
|
56
|
+
const unitFormatter = (value) => {
|
|
57
|
+
let val = Number(value);
|
|
58
|
+
if (chartInput.isUnit) {
|
|
59
|
+
val = val / chartInput.unit;
|
|
60
|
+
}
|
|
61
|
+
return `${val.toFixed(chartInput.decimalDigits)}${chartInput.suffix}`;
|
|
62
|
+
};
|
|
63
|
+
const series = [];
|
|
64
|
+
const groups = [];
|
|
65
|
+
finalDataInput.forEach((eachAxis) => {
|
|
66
|
+
eachAxis.YLabels.forEach((yLabel) => {
|
|
67
|
+
if (yLabel.Group_Name && groups.indexOf(yLabel.Group_Name) < 0) {
|
|
68
|
+
// 去重且保留顺序
|
|
69
|
+
groups.push(yLabel.Group_Name);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
//
|
|
74
|
+
if (chartType === 'pie' && groups.length > 0) {
|
|
75
|
+
throw new ChartError('饼图不支持分组功能');
|
|
76
|
+
}
|
|
77
|
+
if (groups.length <= 0) {
|
|
78
|
+
finalDataInput.forEach((item) => {
|
|
79
|
+
item.YLabels.forEach((eachYaxis, idx) => {
|
|
80
|
+
var _a, _b, _c;
|
|
81
|
+
if (!series[idx]) {
|
|
82
|
+
series[idx] = {
|
|
83
|
+
type: chartType,
|
|
84
|
+
name: chartType === 'pie'
|
|
85
|
+
? undefined
|
|
86
|
+
: (_a = eachYaxis.Cn_Name) !== null && _a !== void 0 ? _a : eachYaxis.Name,
|
|
87
|
+
stack: chartInput.isPile ? 'pile' : undefined,
|
|
88
|
+
showSymbol: chartType === 'pie' ? undefined : chartInput.isSeriesShowSymbol,
|
|
89
|
+
label: {
|
|
90
|
+
show: chartInput.isSeriesShowSymbol, // 老逻辑这么来的
|
|
91
|
+
},
|
|
92
|
+
itemStyle: chartType === 'pie'
|
|
93
|
+
? undefined
|
|
94
|
+
: {
|
|
95
|
+
color: (_c = (_b = chartInput === null || chartInput === void 0 ? void 0 : chartInput.setColor) === null || _b === void 0 ? void 0 : _b[idx % 6]) !== null && _c !== void 0 ? _c : null,
|
|
96
|
+
},
|
|
97
|
+
data: chartType === 'pie'
|
|
98
|
+
? [
|
|
99
|
+
{
|
|
100
|
+
value: eachYaxis.Value,
|
|
101
|
+
name: item.XLabel.Value.toString(),
|
|
102
|
+
},
|
|
103
|
+
]
|
|
104
|
+
: [eachYaxis.Value],
|
|
105
|
+
};
|
|
106
|
+
if (chartInput.isUnit) {
|
|
107
|
+
series[idx].label.formatter = (params) => unitFormatter(params.value);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
if (chartType === 'pie') {
|
|
112
|
+
series[idx].data.push({
|
|
113
|
+
value: eachYaxis.Value,
|
|
114
|
+
name: item.XLabel.Value.toString(),
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
series[idx].data.push(eachYaxis.Value);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (chartType === 'pie') {
|
|
122
|
+
// series[idx].label.position = 'inner';
|
|
123
|
+
series[idx].label['normal'] = {
|
|
124
|
+
position: 'inner',
|
|
125
|
+
};
|
|
126
|
+
series[idx]['radius'] = '70%';
|
|
127
|
+
series[idx]['emphasis'] = {
|
|
128
|
+
itemStyle: {
|
|
129
|
+
shadowBlur: 10,
|
|
130
|
+
shadowOffsetX: 0,
|
|
131
|
+
shadowColor: 'rgba(0, 0, 0, 0.5)',
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
// 先给每个分组留位置
|
|
140
|
+
groups.forEach((groupName, idx) => {
|
|
141
|
+
var _a, _b;
|
|
142
|
+
series.push({
|
|
143
|
+
type: chartType,
|
|
144
|
+
name: groupName,
|
|
145
|
+
stack: chartInput.isPile ? 'pile' : undefined,
|
|
146
|
+
showSymbol: chartType === 'pie' ? undefined : chartInput.isSeriesShowSymbol,
|
|
147
|
+
label: {
|
|
148
|
+
show: chartInput.isSeriesShowSymbol, // 老逻辑这么来的
|
|
149
|
+
},
|
|
150
|
+
itemStyle: chartType === 'pie'
|
|
151
|
+
? undefined
|
|
152
|
+
: {
|
|
153
|
+
color: (_b = (_a = chartInput === null || chartInput === void 0 ? void 0 : chartInput.setColor) === null || _a === void 0 ? void 0 : _a[idx % 6]) !== null && _b !== void 0 ? _b : null,
|
|
154
|
+
},
|
|
155
|
+
data: [],
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
// 然后再往data里放东西
|
|
159
|
+
finalDataInput.forEach((item) => {
|
|
160
|
+
item.YLabels.forEach((eachYaxis) => {
|
|
161
|
+
var _a;
|
|
162
|
+
if (eachYaxis.Group_Name) {
|
|
163
|
+
series[groups.indexOf(eachYaxis.Group_Name)].data.push({
|
|
164
|
+
value: eachYaxis.Value,
|
|
165
|
+
name: (_a = eachYaxis.Cn_Name) !== null && _a !== void 0 ? _a : eachYaxis.Name,
|
|
166
|
+
});
|
|
167
|
+
for (let i = 0; i < groups.length; i++) {
|
|
168
|
+
if (groups.indexOf(eachYaxis.Group_Name) !== i) {
|
|
169
|
+
series[i].data.push({ value: null });
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
console.log(dataInput, chartInput, 'TRANSFORM');
|
|
177
|
+
if (chartType === 'bar' || chartType === 'line') {
|
|
178
|
+
const xAxis = {
|
|
179
|
+
name: chartInput.isXaxisName ? chartInput.xAxisName : '',
|
|
180
|
+
nameTextStyle: { align: 'center' },
|
|
181
|
+
axisLabel: {
|
|
182
|
+
show: chartInput.isXaxisAxisLabelShow,
|
|
183
|
+
// 禁用默认的小屏幕自适应隐藏列
|
|
184
|
+
interval: 0,
|
|
185
|
+
rotate: chartInput.isXaxisAxisLabelRotate ? 30 : 0,
|
|
186
|
+
},
|
|
187
|
+
axisTick: {
|
|
188
|
+
show: chartInput.isXaxisAxisTickShow,
|
|
189
|
+
},
|
|
190
|
+
// 老逻辑是这样的,但看不懂为啥
|
|
191
|
+
inverse: chartInput.directionType === 'crosswise',
|
|
192
|
+
type: 'category',
|
|
193
|
+
data: [],
|
|
194
|
+
};
|
|
195
|
+
const yAxis = {
|
|
196
|
+
show: chartInput.isYAxisShow,
|
|
197
|
+
name: chartInput.isYAxisName ? chartInput.yAxisName : '',
|
|
198
|
+
splitLine: {
|
|
199
|
+
lineStyle: {
|
|
200
|
+
width: chartInput.isYAxisSplitlineLinestyleWidth ? 1 : 0,
|
|
201
|
+
type: chartInput.yAxisSplitlineLinestyleType,
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
axisLabel: {
|
|
205
|
+
padding: [0, -10, 0, 0],
|
|
206
|
+
formatter: null,
|
|
207
|
+
},
|
|
208
|
+
min: chartInput.yAxisMin || null,
|
|
209
|
+
max: chartInput.yAxisMax || null,
|
|
210
|
+
type: 'value',
|
|
211
|
+
};
|
|
212
|
+
xAxis.data = finalDataInput.map((item) => {
|
|
213
|
+
var _a;
|
|
214
|
+
return (_a = item.XLabel.Value) !== null && _a !== void 0 ? _a : null;
|
|
215
|
+
});
|
|
216
|
+
if (chartInput.isUnit) {
|
|
217
|
+
yAxis.axisLabel.formatter = unitFormatter;
|
|
218
|
+
}
|
|
219
|
+
if (chartInput.directionType === 'crosswise') {
|
|
220
|
+
return {
|
|
221
|
+
title,
|
|
222
|
+
legend,
|
|
223
|
+
xAxis: yAxis,
|
|
224
|
+
yAxis: xAxis,
|
|
225
|
+
series,
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
return {
|
|
229
|
+
title,
|
|
230
|
+
legend,
|
|
231
|
+
xAxis,
|
|
232
|
+
yAxis,
|
|
233
|
+
series,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
if (chartType === 'pie') {
|
|
237
|
+
return {
|
|
238
|
+
title,
|
|
239
|
+
legend,
|
|
240
|
+
series,
|
|
241
|
+
tooltip: {
|
|
242
|
+
trigger: 'item',
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as echarts from 'echarts/core';
|
|
2
|
+
import type { BarSeriesOption, LineSeriesOption, PieSeriesOption } from 'echarts/charts';
|
|
3
|
+
import type { TitleComponentOption, TooltipComponentOption, LegendComponentOption, GridComponentOption } from 'echarts/components';
|
|
4
|
+
export default echarts;
|
|
5
|
+
export declare type ECOption = echarts.ComposeOption<BarSeriesOption | LineSeriesOption | PieSeriesOption | TitleComponentOption | TooltipComponentOption | GridComponentOption | LegendComponentOption>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// 引入 echarts 核心模块,核心模块提供了 echarts 使用必须要的接口。
|
|
2
|
+
import * as echarts from 'echarts/core';
|
|
3
|
+
// 引入图表,图表后缀都为 Chart
|
|
4
|
+
import { BarChart, LineChart, PieChart } from 'echarts/charts';
|
|
5
|
+
//组件,组件后缀都为 Component
|
|
6
|
+
import { TitleComponent, TooltipComponent, LegendComponent, GridComponent, } from 'echarts/components';
|
|
7
|
+
// 标签自动布局,全局过渡动画等特性
|
|
8
|
+
import { LabelLayout, UniversalTransition } from 'echarts/features';
|
|
9
|
+
// 引入 Canvas 渲染器,注意引入 CanvasRenderer 或者 SVGRenderer 是必须的一步
|
|
10
|
+
import { CanvasRenderer } from 'echarts/renderers';
|
|
11
|
+
// 注册必须的组件
|
|
12
|
+
echarts.use([
|
|
13
|
+
TitleComponent,
|
|
14
|
+
TooltipComponent,
|
|
15
|
+
GridComponent,
|
|
16
|
+
LegendComponent,
|
|
17
|
+
LabelLayout,
|
|
18
|
+
UniversalTransition,
|
|
19
|
+
CanvasRenderer,
|
|
20
|
+
BarChart,
|
|
21
|
+
LineChart,
|
|
22
|
+
PieChart,
|
|
23
|
+
]);
|
|
24
|
+
export default echarts;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { ErrorBoundary } from 'react-error-boundary';
|
|
3
|
+
import { ChartError } from './chart-error';
|
|
4
|
+
export const ChartErrorBoundary = (props) => {
|
|
5
|
+
return (React.createElement(ErrorBoundary, { FallbackComponent: ({ error, resetErrorBoundary }) => {
|
|
6
|
+
const errorMsg = useMemo(() => {
|
|
7
|
+
var _a;
|
|
8
|
+
if (error instanceof ChartError) {
|
|
9
|
+
return error.message;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return (_a = error.stack) !== null && _a !== void 0 ? _a : error.message;
|
|
13
|
+
}
|
|
14
|
+
}, [error]);
|
|
15
|
+
return (React.createElement("div", { style: props.style, id: props.id, className: props.className },
|
|
16
|
+
React.createElement("code", null,
|
|
17
|
+
React.createElement("pre", { style: { display: 'inline' } }, errorMsg)),
|
|
18
|
+
React.createElement("a", { href: "#", style: {
|
|
19
|
+
padding: '0 8px',
|
|
20
|
+
textDecoration: 'none',
|
|
21
|
+
}, onClick: (ev) => {
|
|
22
|
+
ev.preventDefault();
|
|
23
|
+
resetErrorBoundary();
|
|
24
|
+
} }, "\u91CD\u8BD5")));
|
|
25
|
+
} }, props.children));
|
|
26
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MutableRefObject, RefObject } from 'react';
|
|
2
|
+
import { IEchartModalBase } from './core/eChartBase';
|
|
3
|
+
import type IEcharts from './echarts';
|
|
4
|
+
export declare function useChart(ref: RefObject<HTMLElement> | MutableRefObject<HTMLElement>): IEcharts.ECharts;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated The method should not be used
|
|
7
|
+
*/
|
|
8
|
+
export declare function useWedaChart(domRef: any, ModalClass: IEchartModalBase, options: IEcharts.EChartsCoreOption): void;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { useAsync, useDeepCompareEffect, useEventListener, useIsMounted, useMountEffect, useResizeObserver, } from '@react-hookz/web';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
export function useChart(ref) {
|
|
4
|
+
const [chartRef, setChartRef] = useState(null);
|
|
5
|
+
const isMounted = useIsMounted();
|
|
6
|
+
useMountEffect(async () => {
|
|
7
|
+
if (!ref.current || !isMounted) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const echarts = (await import(/* webpackChunkName: "echarts" */ './echarts')).default;
|
|
11
|
+
const echartDom = ref.current;
|
|
12
|
+
setChartRef(echarts.init(echartDom));
|
|
13
|
+
return () => {
|
|
14
|
+
chartRef.dispose();
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
useEventListener(window, 'resize', () => {
|
|
18
|
+
chartRef && chartRef.resize();
|
|
19
|
+
});
|
|
20
|
+
useResizeObserver(ref, () => {
|
|
21
|
+
chartRef && chartRef.resize();
|
|
22
|
+
});
|
|
23
|
+
return chartRef;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated The method should not be used
|
|
27
|
+
*/
|
|
28
|
+
export function useWedaChart(domRef, ModalClass, options) {
|
|
29
|
+
const chart = useChart(domRef);
|
|
30
|
+
const getOptions = async () => {
|
|
31
|
+
const chartModal = new ModalClass();
|
|
32
|
+
let finalOptions = await chartModal.setOptions(options);
|
|
33
|
+
if (!finalOptions) {
|
|
34
|
+
finalOptions = chartModal.getOptions();
|
|
35
|
+
}
|
|
36
|
+
return finalOptions;
|
|
37
|
+
};
|
|
38
|
+
const [state, actions] = useAsync(getOptions);
|
|
39
|
+
useMountEffect(() => {
|
|
40
|
+
actions.execute();
|
|
41
|
+
});
|
|
42
|
+
useDeepCompareEffect(() => {
|
|
43
|
+
actions.execute();
|
|
44
|
+
}, [
|
|
45
|
+
// options 变化,包含所有配置项,包括纯前端的配置项变化都会触发setOptions里发请求,但改不动了
|
|
46
|
+
options,
|
|
47
|
+
actions,
|
|
48
|
+
]);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (state.status === 'success' && chart) {
|
|
51
|
+
console.log(ModalClass.name, options, state.result, window.location.href);
|
|
52
|
+
chart.setOption(state.result, true // noMerge 全刷
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
if (state.status === 'error') {
|
|
57
|
+
console.error(state.error);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}, [state]);
|
|
61
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import OldLine from './index.old';
|
|
3
|
+
import { checkIsNewData, transform } from '../common/data-transform';
|
|
4
|
+
import { emptyArray } from '../../../utils/constant';
|
|
5
|
+
import { Chart } from '../common/Chart';
|
|
6
|
+
import { ChartCustomConnector } from '../common/chart-custom-connector';
|
|
7
|
+
import { ChartErrorBoundary } from '../common/error-boundary';
|
|
8
|
+
function LineImpl(props) {
|
|
9
|
+
if (props.dataSourceType === 'data-model') {
|
|
10
|
+
if (checkIsNewData(props)) {
|
|
11
|
+
props.dataSource = {
|
|
12
|
+
name: props['dataModel'].name,
|
|
13
|
+
type: 'database',
|
|
14
|
+
subType: 'database',
|
|
15
|
+
methodName: 'wedaAggregateData',
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const oldLineProps = { ...props };
|
|
19
|
+
oldLineProps['dataModel'] = undefined;
|
|
20
|
+
oldLineProps['datasourceVariable'] = undefined;
|
|
21
|
+
oldLineProps['connectorMethod'] = undefined;
|
|
22
|
+
oldLineProps['connectorParams'] = undefined;
|
|
23
|
+
oldLineProps['connector'] = undefined;
|
|
24
|
+
return React.createElement(OldLine, { ...oldLineProps });
|
|
25
|
+
}
|
|
26
|
+
else if (props.dataSourceType === 'variable') {
|
|
27
|
+
const { datasourceVariable = emptyArray, id, style, className, events, ...rest } = props;
|
|
28
|
+
const chartOptions = transform('line', datasourceVariable, rest);
|
|
29
|
+
return (React.createElement(Chart, { id: id, "data-testid": "line", className: className, style: style, events: events, chartOptions: chartOptions }));
|
|
30
|
+
}
|
|
31
|
+
else if (props.dataSourceType === 'custom-connector') {
|
|
32
|
+
return React.createElement(ChartCustomConnector, { "data-testid": "line", type: "line", ...props });
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
// 老逻辑
|
|
36
|
+
return React.createElement(OldLine, { ...props });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export default function Line(props) {
|
|
40
|
+
return (React.createElement(ChartErrorBoundary, { ...props },
|
|
41
|
+
React.createElement(LineImpl, { ...props })));
|
|
42
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CommonPropsType } from '../../../types';
|
|
3
|
+
import { DataSource, Xfield, Yfield } from '../common/core/type';
|
|
4
|
+
export interface PropsType extends Omit<CommonPropsType, 'children'> {
|
|
5
|
+
chartType?: string;
|
|
6
|
+
isTitle?: boolean;
|
|
7
|
+
title?: string;
|
|
8
|
+
titleLocation?: string;
|
|
9
|
+
dataSource?: DataSource;
|
|
10
|
+
filterData?: string;
|
|
11
|
+
xField?: Xfield;
|
|
12
|
+
groupKey?: Xfield;
|
|
13
|
+
groupKeyTimeSpan?: string;
|
|
14
|
+
xStatistics?: string;
|
|
15
|
+
xIsCountEmpty?: boolean;
|
|
16
|
+
yField?: Yfield;
|
|
17
|
+
isLegend?: boolean;
|
|
18
|
+
legend?: string;
|
|
19
|
+
legend2?: string;
|
|
20
|
+
isXaxisName?: boolean;
|
|
21
|
+
xAxisName?: string;
|
|
22
|
+
isXaxisAxisLabelShow?: boolean;
|
|
23
|
+
isXaxisAxisTickShow?: boolean;
|
|
24
|
+
isXaxisAxisLabelRotate?: boolean;
|
|
25
|
+
isYAxisSplitlineLinestyleWidth?: boolean;
|
|
26
|
+
yAxisSplitlineLinestyleType?: string;
|
|
27
|
+
yAxisMax?: number;
|
|
28
|
+
yAxisMin?: number;
|
|
29
|
+
isYAxisName?: boolean;
|
|
30
|
+
yAxisName?: string;
|
|
31
|
+
isSeriesShowSymbol?: boolean;
|
|
32
|
+
isYAxisShow?: boolean;
|
|
33
|
+
isUnit?: boolean;
|
|
34
|
+
unit?: number;
|
|
35
|
+
decimalDigits?: number;
|
|
36
|
+
suffix?: string;
|
|
37
|
+
}
|
|
38
|
+
export default function Line(opts: PropsType): JSX.Element;
|