@cloudbase/weda-ui 3.2.1 → 3.3.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/src/configs/components/chart/bar.json +9 -1
- package/dist/src/configs/components/chart/line.json +8 -0
- package/dist/src/configs/components/chart/pie.json +8 -0
- package/dist/src/web/actions/showModal/index.js +0 -1
- package/dist/src/web/components/calendar/index.js +39 -37
- package/dist/src/web/components/carousel/index.js +62 -62
- package/dist/src/web/components/chart/bar/index.js +6 -2
- package/dist/src/web/components/chart/common/Chart.d.ts +1 -0
- package/dist/src/web/components/chart/common/Chart.js +9 -1
- package/dist/src/web/components/chart/common/chart-custom-connector.js +1 -1
- package/dist/src/web/components/chart/common/core/eChartBase.js +1 -1
- package/dist/src/web/components/chart/common/data-transform.js +3 -1
- package/dist/src/web/components/chart/common/useChart.js +13 -2
- package/dist/src/web/components/chart/line/index.js +2 -2
- package/dist/src/web/components/chart/pie/index.js +2 -2
- package/dist/src/web/components/common/error-boundary.d.ts +5 -0
- package/dist/src/web/components/common/error-boundary.js +33 -0
- package/dist/src/web/components/common/use-loop-render-detect.d.ts +11 -0
- package/dist/src/web/components/common/use-loop-render-detect.js +124 -0
- package/dist/src/web/components/form/checkbox/index.js +29 -29
- package/dist/src/web/components/form/form/index.js +39 -26
- package/dist/src/web/components/form/input/index.js +11 -3
- package/dist/src/web/components/form/location/common/mapChoose.js +6 -5
- package/dist/src/web/components/form/location/common/mapView.js +9 -6
- package/dist/src/web/{utils → components/form/location/common}/tmap.d.ts +0 -0
- package/dist/src/web/{utils → components/form/location/common}/tmap.js +0 -0
- package/dist/src/web/components/form/location/common/useLocationInfo.js +3 -2
- package/dist/src/web/components/form/location/components/LocationH5/location.h5.js +6 -3
- package/dist/src/web/components/form/location/components/LocationPC/location.PC.js +5 -1
- package/dist/src/web/components/form/location/index.js +7 -0
- package/dist/src/web/components/form/radio/index.js +3 -3
- package/dist/src/web/components/form/select/allTimePicker/index.js +1 -0
- package/dist/src/web/components/form/select/h5.js +18 -4
- package/dist/src/web/components/form/select/index.js +15 -1
- package/dist/src/web/components/form/select/use-options.js +1 -1
- package/dist/src/web/components/form/uploader/uploader.h5.js +2 -2
- package/dist/src/web/components/form/uploader/uploader.pc.js +1 -1
- package/dist/src/web/components/form/uploaderFile/uploadFile.h5.js +9 -7
- package/dist/src/web/components/form/uploaderFile/uploadFile.pc.js +9 -6
- package/dist/src/web/components/form/userOrgSelect/comTool.js +3 -9
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +47 -34
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +1 -1
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +35 -36
- package/dist/src/web/{utils → components/form/userOrgSelect}/getUserService.d.ts +0 -0
- package/dist/src/web/{utils → components/form/userOrgSelect}/getUserService.js +8 -5
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +3 -2
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.js +42 -20
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +1 -1
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.js +111 -129
- package/dist/src/web/components/form/userOrgSelect/utils.d.ts +3 -2
- package/dist/src/web/components/form/userOrgSelect/utils.js +24 -16
- package/dist/src/web/components/formdetail/index.js +14 -11
- package/dist/src/web/components/graphicCard/index.js +5 -6
- package/dist/src/web/components/image/index.js +1 -1
- package/dist/src/web/components/listView/index.js +1 -0
- package/dist/src/web/components/lottery/index.js +10 -16
- package/dist/src/web/components/navLayout/index.js +1 -1
- package/dist/src/web/components/navigationBar/horizontalMenu.js +1 -1
- package/dist/src/web/components/navigationBar/index.js +13 -8
- package/dist/src/web/components/richText/index.js +1 -2
- package/dist/src/web/components/richTextView/index.js +20 -18
- package/dist/src/web/components/scrollView/index.d.ts +1 -2
- package/dist/src/web/components/scrollView/index.js +7 -5
- package/dist/src/web/components/swiper/index.js +62 -62
- package/dist/src/web/components/tabs/index.js +6 -1
- package/dist/src/web/components/tabs/tabs.h5.js +2 -0
- package/dist/src/web/components/text/index.js +10 -8
- package/dist/src/web/components/uploaderFileView/index.js +1 -1
- package/dist/src/web/components/uploaderView/index.js +1 -1
- package/dist/src/web/components/wedaVideo/index.js +15 -3
- package/dist/src/web/utils/console.d.ts +3 -0
- package/dist/src/web/utils/console.js +26 -0
- package/dist/src/web/utils/platform.js +1 -1
- package/dist/src/web/utils/tcb.js +1 -1
- package/dist/src/web/utils/useSyncValue.js +1 -0
- package/dist/web/components/form/input/index.css +16 -0
- package/dist/web/components/form/userOrgSelect/userOrgSelect.css +4 -0
- package/package.json +22 -22
- package/dist/configs/actions/showModal.json +0 -48
- package/dist/configs/actions/showToast.json +0 -41
- package/dist/configs/components/auth.json +0 -16
- package/dist/configs/components/button.json +0 -239
- package/dist/configs/components/calendar.json +0 -81
- package/dist/configs/components/carousel.json +0 -292
- package/dist/configs/components/chart/bar.json +0 -728
- package/dist/configs/components/chart/line.json +0 -681
- package/dist/configs/components/chart/pie.json +0 -500
- package/dist/configs/components/chart/statisticsCard.json +0 -376
- package/dist/configs/components/container.json +0 -50
- package/dist/configs/components/dataView.json +0 -239
- package/dist/configs/components/drawer.json +0 -115
- package/dist/configs/components/form/checkbox.json +0 -179
- package/dist/configs/components/form/departTreeSelect.json +0 -124
- package/dist/configs/components/form/form.json +0 -69
- package/dist/configs/components/form/input.json +0 -154
- package/dist/configs/components/form/location.json +0 -216
- package/dist/configs/components/form/radio.json +0 -203
- package/dist/configs/components/form/richText.json +0 -133
- package/dist/configs/components/form/select.json +0 -431
- package/dist/configs/components/form/switch.json +0 -58
- package/dist/configs/components/form/textarea.json +0 -116
- package/dist/configs/components/form/tips.json +0 -34
- package/dist/configs/components/form/uploader.json +0 -171
- package/dist/configs/components/form/uploaderFile.json +0 -158
- package/dist/configs/components/form/userTreeSelect.json +0 -128
- package/dist/configs/components/formdetail.json +0 -105
- package/dist/configs/components/graphicCard.json +0 -413
- package/dist/configs/components/image.json +0 -187
- package/dist/configs/components/link.json +0 -79
- package/dist/configs/components/listView.json +0 -378
- package/dist/configs/components/lottery.json +0 -163
- package/dist/configs/components/modal.json +0 -72
- package/dist/configs/components/navLayout.json +0 -368
- package/dist/configs/components/navigationBar.json +0 -62
- package/dist/configs/components/richtextview.json +0 -26
- package/dist/configs/components/scrollVeiw.json +0 -253
- package/dist/configs/components/slot.json +0 -17
- package/dist/configs/components/swiper.json +0 -90
- package/dist/configs/components/tabs.json +0 -122
- package/dist/configs/components/text.json +0 -95
- package/dist/configs/components/wedaVideo.json +0 -89
- package/dist/configs/components/wxOpenApi/phone.json +0 -127
- package/dist/configs/components/wxOpenApi/phoneCode.json +0 -109
- package/dist/configs/components/wxOpenApi/share.json +0 -160
- package/dist/configs/components/wxOpenApi/userInfo.json +0 -156
- package/dist/configs/index.d.ts +0 -103
- package/dist/configs/index.js +0 -111
- package/dist/docs/common/format.d.ts +0 -13
- package/dist/docs/common/format.js +0 -122
- package/dist/docs/common/tableView.d.ts +0 -30
- package/dist/docs/common/tableView.js +0 -159
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -3
- package/dist/setupTests.d.ts +0 -1
- package/dist/setupTests.js +0 -14
- package/dist/src/web/components/chart/common/error-boundary.d.ts +0 -5
- package/dist/src/web/components/chart/common/error-boundary.js +0 -26
- package/dist/web/actions/index.d.ts +0 -2
- package/dist/web/actions/index.js +0 -2
- package/dist/web/actions/showModal/index.d.ts +0 -4
- package/dist/web/actions/showModal/index.js +0 -67
- package/dist/web/actions/showToast/index.d.ts +0 -1
- package/dist/web/actions/showToast/index.js +0 -3
- package/dist/web/components/button/index.d.ts +0 -32
- package/dist/web/components/button/index.js +0 -48
- package/dist/web/components/calendar/index.d.ts +0 -19
- package/dist/web/components/calendar/index.js +0 -189
- package/dist/web/components/calendar/util.d.ts +0 -13
- package/dist/web/components/calendar/util.js +0 -74
- package/dist/web/components/carousel/index.d.ts +0 -41
- package/dist/web/components/carousel/index.js +0 -244
- package/dist/web/components/chart/bar/index.d.ts +0 -41
- package/dist/web/components/chart/bar/index.js +0 -56
- package/dist/web/components/chart/common/config/bar.d.ts +0 -48
- package/dist/web/components/chart/common/config/bar.js +0 -49
- package/dist/web/components/chart/common/config/global.d.ts +0 -13
- package/dist/web/components/chart/common/config/global.js +0 -16
- package/dist/web/components/chart/common/config/line.d.ts +0 -46
- package/dist/web/components/chart/common/config/line.js +0 -49
- package/dist/web/components/chart/common/config/pie.d.ts +0 -29
- package/dist/web/components/chart/common/config/pie.js +0 -36
- package/dist/web/components/chart/common/core/eChartBar.d.ts +0 -68
- package/dist/web/components/chart/common/core/eChartBar.js +0 -198
- package/dist/web/components/chart/common/core/eChartBase.d.ts +0 -128
- package/dist/web/components/chart/common/core/eChartBase.js +0 -352
- package/dist/web/components/chart/common/core/eChartLine.d.ts +0 -62
- package/dist/web/components/chart/common/core/eChartLine.js +0 -170
- package/dist/web/components/chart/common/core/eChartPie.d.ts +0 -50
- package/dist/web/components/chart/common/core/eChartPie.js +0 -132
- package/dist/web/components/chart/common/core/type.d.ts +0 -35
- package/dist/web/components/chart/common/core/type.js +0 -9
- package/dist/web/components/chart/common/echarts.d.ts +0 -2
- package/dist/web/components/chart/common/echarts.js +0 -24
- package/dist/web/components/chart/common/useChart.d.ts +0 -8
- package/dist/web/components/chart/common/useChart.js +0 -60
- package/dist/web/components/chart/line/index.d.ts +0 -39
- package/dist/web/components/chart/line/index.js +0 -53
- package/dist/web/components/chart/pie/index.d.ts +0 -27
- package/dist/web/components/chart/pie/index.js +0 -40
- package/dist/web/components/chart/statisticsCard/index.d.ts +0 -85
- package/dist/web/components/chart/statisticsCard/index.js +0 -203
- package/dist/web/components/chart/statisticsCard/interface.d.ts +0 -13
- package/dist/web/components/chart/statisticsCard/interface.js +0 -1
- package/dist/web/components/container/index.d.ts +0 -6
- package/dist/web/components/container/index.js +0 -6
- package/dist/web/components/dataView/index.d.ts +0 -6
- package/dist/web/components/dataView/index.js +0 -8
- package/dist/web/components/dataView/interface.d.ts +0 -5
- package/dist/web/components/dataView/interface.js +0 -1
- package/dist/web/components/drawer/index.d.ts +0 -13
- package/dist/web/components/drawer/index.js +0 -12
- package/dist/web/components/form/checkbox/index.d.ts +0 -13
- package/dist/web/components/form/checkbox/index.js +0 -167
- package/dist/web/components/form/enumSelect/MultipleSelect.d.ts +0 -78
- package/dist/web/components/form/enumSelect/MultipleSelect.js +0 -52
- package/dist/web/components/form/enumSelect/NormalSelect.d.ts +0 -83
- package/dist/web/components/form/enumSelect/NormalSelect.js +0 -52
- package/dist/web/components/form/enumSelect/SelectContainer.d.ts +0 -16
- package/dist/web/components/form/enumSelect/SelectContainer.js +0 -30
- package/dist/web/components/form/enumSelect/index.d.ts +0 -82
- package/dist/web/components/form/enumSelect/index.js +0 -6
- package/dist/web/components/form/enumSelect/props/defaultProps.d.ts +0 -34
- package/dist/web/components/form/enumSelect/props/defaultProps.js +0 -40
- package/dist/web/components/form/enumSelect/props/propsTypes.d.ts +0 -39
- package/dist/web/components/form/enumSelect/props/propsTypes.js +0 -47
- package/dist/web/components/form/form/index.d.ts +0 -32
- package/dist/web/components/form/form/index.js +0 -108
- package/dist/web/components/form/formcell/index.d.ts +0 -8
- package/dist/web/components/form/formcell/index.js +0 -40
- package/dist/web/components/form/input/index.d.ts +0 -14
- package/dist/web/components/form/input/index.js +0 -86
- package/dist/web/components/form/location/common/mapChoose.d.ts +0 -15
- package/dist/web/components/form/location/common/mapChoose.js +0 -495
- package/dist/web/components/form/location/common/mapView.d.ts +0 -19
- package/dist/web/components/form/location/common/mapView.js +0 -172
- package/dist/web/components/form/location/common/propsConfig.d.ts +0 -59
- package/dist/web/components/form/location/common/propsConfig.js +0 -50
- package/dist/web/components/form/location/common/selectModal.d.ts +0 -21
- package/dist/web/components/form/location/common/selectModal.js +0 -44
- package/dist/web/components/form/location/common/useLocationInfo.d.ts +0 -36
- package/dist/web/components/form/location/common/useLocationInfo.js +0 -104
- package/dist/web/components/form/location/components/LocationH5/location.h5.d.ts +0 -8
- package/dist/web/components/form/location/components/LocationH5/location.h5.js +0 -325
- package/dist/web/components/form/location/components/LocationPC/Header.d.ts +0 -12
- package/dist/web/components/form/location/components/LocationPC/Header.js +0 -43
- package/dist/web/components/form/location/components/LocationPC/location.PC.d.ts +0 -8
- package/dist/web/components/form/location/components/LocationPC/location.PC.js +0 -224
- package/dist/web/components/form/location/constants.d.ts +0 -2
- package/dist/web/components/form/location/constants.js +0 -3
- package/dist/web/components/form/location/index.d.ts +0 -1
- package/dist/web/components/form/location/index.js +0 -17
- package/dist/web/components/form/radio/index.d.ts +0 -11
- package/dist/web/components/form/radio/index.js +0 -115
- package/dist/web/components/form/renderDecorator.d.ts +0 -6
- package/dist/web/components/form/renderDecorator.js +0 -20
- package/dist/web/components/form/select/dropdown-select/ui.d.ts +0 -15
- package/dist/web/components/form/select/dropdown-select/ui.js +0 -55
- package/dist/web/components/form/select/h5.d.ts +0 -16
- package/dist/web/components/form/select/h5.js +0 -410
- package/dist/web/components/form/select/index.d.ts +0 -65
- package/dist/web/components/form/select/index.js +0 -232
- package/dist/web/components/form/select/region/index.d.ts +0 -6
- package/dist/web/components/form/select/region/index.js +0 -147
- package/dist/web/components/form/select/time.d.ts +0 -9
- package/dist/web/components/form/select/time.js +0 -146
- package/dist/web/components/form/select/use-options.d.ts +0 -26
- package/dist/web/components/form/select/use-options.js +0 -103
- package/dist/web/components/form/select/year.d.ts +0 -7
- package/dist/web/components/form/select/year.js +0 -72
- package/dist/web/components/form/switch/index.d.ts +0 -6
- package/dist/web/components/form/switch/index.js +0 -58
- package/dist/web/components/form/textarea/index.d.ts +0 -12
- package/dist/web/components/form/textarea/index.js +0 -66
- package/dist/web/components/form/tips/index.d.ts +0 -8
- package/dist/web/components/form/tips/index.js +0 -17
- package/dist/web/components/form/uploader/index.d.ts +0 -3
- package/dist/web/components/form/uploader/index.js +0 -42
- package/dist/web/components/form/uploader/uploader.h5.d.ts +0 -20
- package/dist/web/components/form/uploader/uploader.h5.js +0 -224
- package/dist/web/components/form/uploader/uploader.pc.d.ts +0 -29
- package/dist/web/components/form/uploader/uploader.pc.js +0 -214
- package/dist/web/components/form/uploaderFile/index.d.ts +0 -4
- package/dist/web/components/form/uploaderFile/index.js +0 -19
- package/dist/web/components/form/uploaderFile/uploadFile.h5.d.ts +0 -23
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +0 -337
- package/dist/web/components/form/uploaderFile/uploadFile.pc.d.ts +0 -24
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +0 -313
- package/dist/web/components/form/userOrgSelect/comTool.d.ts +0 -7
- package/dist/web/components/form/userOrgSelect/comTool.js +0 -89
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +0 -20
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +0 -259
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +0 -4
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +0 -153
- package/dist/web/components/form/userOrgSelect/departTreeSelect/index.d.ts +0 -2
- package/dist/web/components/form/userOrgSelect/departTreeSelect/index.js +0 -17
- package/dist/web/components/form/userOrgSelect/index.d.ts +0 -2
- package/dist/web/components/form/userOrgSelect/index.js +0 -17
- package/dist/web/components/form/userOrgSelect/userOrgSelect.less +0 -643
- package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +0 -24
- package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.js +0 -276
- package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +0 -9
- package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.js +0 -229
- package/dist/web/components/form/userOrgSelect/utils.d.ts +0 -35
- package/dist/web/components/form/userOrgSelect/utils.js +0 -72
- package/dist/web/components/formdetail/index.d.ts +0 -28
- package/dist/web/components/formdetail/index.js +0 -170
- package/dist/web/components/graphicCard/index.d.ts +0 -31
- package/dist/web/components/graphicCard/index.js +0 -166
- package/dist/web/components/image/image.d.ts +0 -9
- package/dist/web/components/image/image.js +0 -119
- package/dist/web/components/image/index.d.ts +0 -13
- package/dist/web/components/image/index.js +0 -91
- package/dist/web/components/index.d.ts +0 -50
- package/dist/web/components/index.js +0 -97
- package/dist/web/components/link/index.d.ts +0 -24
- package/dist/web/components/link/index.js +0 -71
- package/dist/web/components/listView/index.d.ts +0 -7
- package/dist/web/components/listView/index.js +0 -286
- package/dist/web/components/listView/interface.d.ts +0 -127
- package/dist/web/components/listView/interface.js +0 -1
- package/dist/web/components/lottery/index.d.ts +0 -22
- package/dist/web/components/lottery/index.js +0 -391
- package/dist/web/components/lottery/lotteryUtil.d.ts +0 -23
- package/dist/web/components/lottery/lotteryUtil.js +0 -181
- package/dist/web/components/modal/index.d.ts +0 -17
- package/dist/web/components/modal/index.js +0 -11
- package/dist/web/components/modal/modal.h5.d.ts +0 -4
- package/dist/web/components/modal/modal.h5.js +0 -46
- package/dist/web/components/modal/modal.pc.d.ts +0 -3
- package/dist/web/components/modal/modal.pc.js +0 -31
- package/dist/web/components/navLayout/index.d.ts +0 -46
- package/dist/web/components/navLayout/index.js +0 -116
- package/dist/web/components/navigationBar/common.d.ts +0 -15
- package/dist/web/components/navigationBar/common.js +0 -127
- package/dist/web/components/navigationBar/h5Menu.d.ts +0 -14
- package/dist/web/components/navigationBar/h5Menu.js +0 -72
- package/dist/web/components/navigationBar/horizontalMenu.d.ts +0 -12
- package/dist/web/components/navigationBar/horizontalMenu.js +0 -99
- package/dist/web/components/navigationBar/index.d.ts +0 -13
- package/dist/web/components/navigationBar/index.js +0 -157
- package/dist/web/components/navigationBar/verticalMenu.d.ts +0 -13
- package/dist/web/components/navigationBar/verticalMenu.js +0 -38
- package/dist/web/components/phone/index.d.ts +0 -18
- package/dist/web/components/phone/index.js +0 -4
- package/dist/web/components/phoneCode/index.d.ts +0 -18
- package/dist/web/components/phoneCode/index.js +0 -4
- package/dist/web/components/picker/datePicker.d.ts +0 -10
- package/dist/web/components/picker/datePicker.js +0 -31
- package/dist/web/components/picker/picker.d.ts +0 -6
- package/dist/web/components/picker/picker.js +0 -45
- package/dist/web/components/picker/timePicker.d.ts +0 -7
- package/dist/web/components/picker/timePicker.js +0 -42
- package/dist/web/components/richText/const.d.ts +0 -1
- package/dist/web/components/richText/const.js +0 -2
- package/dist/web/components/richText/index.d.ts +0 -50
- package/dist/web/components/richText/index.js +0 -352
- package/dist/web/components/richTextView/index.d.ts +0 -7
- package/dist/web/components/richTextView/index.js +0 -44
- package/dist/web/components/scrollView/index.d.ts +0 -27
- package/dist/web/components/scrollView/index.js +0 -95
- package/dist/web/components/share/index.d.ts +0 -34
- package/dist/web/components/share/index.js +0 -4
- package/dist/web/components/slot/index.d.ts +0 -6
- package/dist/web/components/slot/index.js +0 -9
- package/dist/web/components/swiper/index.d.ts +0 -24
- package/dist/web/components/swiper/index.js +0 -153
- package/dist/web/components/tabs/index.d.ts +0 -13
- package/dist/web/components/tabs/index.js +0 -15
- package/dist/web/components/tabs/tabs.h5.d.ts +0 -4
- package/dist/web/components/tabs/tabs.h5.js +0 -42
- package/dist/web/components/tabs/tabs.pc.d.ts +0 -3
- package/dist/web/components/tabs/tabs.pc.js +0 -40
- package/dist/web/components/text/index.d.ts +0 -14
- package/dist/web/components/text/index.js +0 -17
- package/dist/web/components/uploaderFileView/index.d.ts +0 -10
- package/dist/web/components/uploaderFileView/index.js +0 -61
- package/dist/web/components/uploaderView/index.d.ts +0 -17
- package/dist/web/components/uploaderView/index.js +0 -48
- package/dist/web/components/userInfo/index.d.ts +0 -26
- package/dist/web/components/userInfo/index.js +0 -4
- package/dist/web/components/wedaVideo/index.d.ts +0 -17
- package/dist/web/components/wedaVideo/index.js +0 -160
- package/dist/web/index.d.ts +0 -8
- package/dist/web/index.js +0 -4
- package/dist/web/utils/classnames.d.ts +0 -2
- package/dist/web/utils/classnames.js +0 -37
- package/dist/web/utils/constant.d.ts +0 -23
- package/dist/web/utils/constant.js +0 -24
- package/dist/web/utils/debounce.d.ts +0 -2
- package/dist/web/utils/debounce.js +0 -92
- package/dist/web/utils/getLocalCounter.d.ts +0 -1
- package/dist/web/utils/getLocalCounter.js +0 -4
- package/dist/web/utils/getUserService.d.ts +0 -17
- package/dist/web/utils/getUserService.js +0 -148
- package/dist/web/utils/isObjectEqual.d.ts +0 -2
- package/dist/web/utils/isObjectEqual.js +0 -12
- package/dist/web/utils/loading-fallback.d.ts +0 -2
- package/dist/web/utils/loading-fallback.js +0 -2
- package/dist/web/utils/lodash.d.ts +0 -1
- package/dist/web/utils/lodash.js +0 -2
- package/dist/web/utils/platform.d.ts +0 -18
- package/dist/web/utils/platform.js +0 -193
- package/dist/web/utils/tcb.d.ts +0 -27
- package/dist/web/utils/tcb.js +0 -105
- package/dist/web/utils/tmap.d.ts +0 -3
- package/dist/web/utils/tmap.js +0 -21
- package/dist/web/utils/use-cloud-id-temp-url.d.ts +0 -1
- package/dist/web/utils/use-cloud-id-temp-url.js +0 -13
- package/dist/web/utils/useSetState.d.ts +0 -1
- package/dist/web/utils/useSetState.js +0 -8
- package/dist/web/utils/useSyncValue.d.ts +0 -4
- package/dist/web/utils/useSyncValue.js +0 -15
- package/dist/web/utils/weui.d.ts +0 -1
- package/dist/web/utils/weui.js +0 -2
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import EchartBase from './eChartBase';
|
|
2
|
-
import getConfig from '../config/line';
|
|
3
|
-
/**
|
|
4
|
-
* 折线图表
|
|
5
|
-
* @author loonglong
|
|
6
|
-
**/
|
|
7
|
-
class EchartLine extends EchartBase {
|
|
8
|
-
constructor() {
|
|
9
|
-
super();
|
|
10
|
-
const config = getConfig();
|
|
11
|
-
this.config = { ...this.config, ...config };
|
|
12
|
-
}
|
|
13
|
-
async setSourceData({ dataSource, filterData, xField, xStatistics, xIsCountEmpty, yField, groupKey, groupKeyTimeSpan, }) {
|
|
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
|
-
groupKey,
|
|
23
|
-
groupKeyTimeSpan,
|
|
24
|
-
});
|
|
25
|
-
const arrSourData = await this.getSourceData(name, methodName, type, params);
|
|
26
|
-
// 获取 x 轴数据
|
|
27
|
-
const sortedXAxisData = this.sortXAxisData(arrSourData, xField.format);
|
|
28
|
-
const arrXaxisData = this.setXaxis(sortedXAxisData, xField.format);
|
|
29
|
-
const arrXisCountEmptyIndex = []; // 记录空值的key
|
|
30
|
-
if (Object.keys(groupKey !== null && groupKey !== void 0 ? groupKey : {}).length === 0) {
|
|
31
|
-
const numLine = sortedXAxisData[0].YLabels.length;
|
|
32
|
-
if (numLine > 0) {
|
|
33
|
-
for (let j = 0; j < numLine; j++) {
|
|
34
|
-
this.config.series[j] = {
|
|
35
|
-
type: 'line',
|
|
36
|
-
smooth: true,
|
|
37
|
-
name: '',
|
|
38
|
-
connectNulls: true,
|
|
39
|
-
showSymbol: true,
|
|
40
|
-
label: {
|
|
41
|
-
show: true,
|
|
42
|
-
},
|
|
43
|
-
data: [],
|
|
44
|
-
};
|
|
45
|
-
sortedXAxisData.forEach((itemSource, index) => {
|
|
46
|
-
var _a, _b;
|
|
47
|
-
this.config.series[j].name =
|
|
48
|
-
(_b = (_a = itemSource.YLabels[j]) === null || _a === void 0 ? void 0 : _a.Cn_Name) !== null && _b !== void 0 ? _b : itemSource.YLabels[j].Name;
|
|
49
|
-
if ((itemSource.YLabels[j].Value === undefined ||
|
|
50
|
-
itemSource.YLabels[j].Value === null) &&
|
|
51
|
-
!xIsCountEmpty) {
|
|
52
|
-
arrXisCountEmptyIndex.push(index);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
const value = itemSource.YLabels[j].Value
|
|
56
|
-
? itemSource.YLabels[j].Value
|
|
57
|
-
: 0;
|
|
58
|
-
this.config.series[j].data.push(value);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
// 处理显示空值问题
|
|
64
|
-
this.setEmptyValue(xIsCountEmpty);
|
|
65
|
-
}
|
|
66
|
-
else if (groupKey) {
|
|
67
|
-
// 如果是分组,则这里需要特殊处理
|
|
68
|
-
// 按groupKey分组存放数据值
|
|
69
|
-
const objGroupKey = {}; // {'分组字段':[{value:'统计的值', dimensionality:'维度名', name:'统计的数值字段名'}]}
|
|
70
|
-
sortedXAxisData.forEach((itemSourData) => {
|
|
71
|
-
itemSourData.YLabels.forEach((yLabel) => {
|
|
72
|
-
if (!objGroupKey[yLabel.Group_Name]) {
|
|
73
|
-
objGroupKey[yLabel.Group_Name] = [];
|
|
74
|
-
}
|
|
75
|
-
objGroupKey[yLabel.Group_Name].push({
|
|
76
|
-
value: yLabel.Value,
|
|
77
|
-
dimensionality: itemSourData.XLabel.Value,
|
|
78
|
-
name: yLabel.Cn_Name,
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
// 组装图表需要的数据
|
|
83
|
-
const groupNames = Object.keys(objGroupKey);
|
|
84
|
-
this.config.series = groupNames.map((groupKey) => {
|
|
85
|
-
// groupKey分组字段中文名
|
|
86
|
-
const serie = {
|
|
87
|
-
name: groupKey,
|
|
88
|
-
connectNulls: true,
|
|
89
|
-
data: this.getSeriesDataGroup(arrXaxisData, objGroupKey[groupKey]),
|
|
90
|
-
type: 'line',
|
|
91
|
-
smooth: true,
|
|
92
|
-
showSymbol: true,
|
|
93
|
-
label: {
|
|
94
|
-
show: true, // 显示线条上的数据
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
return serie;
|
|
98
|
-
});
|
|
99
|
-
this.config.tooltip.formatter = (params) => `${params.data.dimensionality}\r\n${params.data.name}\r\n${params.seriesName}:${params.value}`;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
setChartType({ chartType }) {
|
|
104
|
-
this.config.series.length > 0 &&
|
|
105
|
-
this.config.series.forEach((itemSeries) => {
|
|
106
|
-
itemSeries.smooth = chartType !== 'line';
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
// 显示图表上的数据标签 单位,标签,小数位数,后缀
|
|
110
|
-
setIsSeriesShowSymbol({ isSeriesShowSymbol, isUnit, unit, decimalDigits, suffix, }) {
|
|
111
|
-
decimalDigits = decimalDigits < 0 ? 0 : decimalDigits;
|
|
112
|
-
this.config.series.length > 0 &&
|
|
113
|
-
this.config.series.forEach((itemSeries) => {
|
|
114
|
-
itemSeries.showSymbol = isSeriesShowSymbol;
|
|
115
|
-
itemSeries.label.show = isSeriesShowSymbol;
|
|
116
|
-
if (isUnit) {
|
|
117
|
-
itemSeries.label.formatter = (params) => {
|
|
118
|
-
const objNewValue = this.getValueByUnit(params.value, unit);
|
|
119
|
-
return `${objNewValue.toFixed(decimalDigits)}${suffix}`;
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
if (isUnit) {
|
|
124
|
-
this.config.yAxis.axisLabel.formatter = (value) => {
|
|
125
|
-
const objNewValue = this.getValueByUnit(value, unit);
|
|
126
|
-
return `${objNewValue.toFixed(decimalDigits)}${suffix}`;
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
this.config.yAxis.axisLabel.formatter = null;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
async setOptions({ chartType, isTitle, title, titleLocation, dataSource, filterData, xField, xStatistics, groupKey, groupKeyTimeSpan, xIsCountEmpty, yField, isLegend, legend, legend2, isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, }) {
|
|
134
|
-
if (dataSource) {
|
|
135
|
-
await this.setSourceData({
|
|
136
|
-
dataSource,
|
|
137
|
-
filterData,
|
|
138
|
-
xField,
|
|
139
|
-
xStatistics,
|
|
140
|
-
xIsCountEmpty,
|
|
141
|
-
yField,
|
|
142
|
-
groupKey,
|
|
143
|
-
groupKeyTimeSpan,
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
legend = document.body.clientWidth < 1024 ? legend : legend2;
|
|
147
|
-
this.setChartType({ chartType });
|
|
148
|
-
this.setTitle({ isTitle, title, titleLocation });
|
|
149
|
-
this.setLegend({ isLegend, legend });
|
|
150
|
-
this.setIsXaxisAxisLabelShow({ isXaxisAxisLabelShow });
|
|
151
|
-
this.setIsXaxisName({ isXaxisName, xAxisName });
|
|
152
|
-
this.setIsXaxisAxisTickShow({ isXaxisAxisTickShow });
|
|
153
|
-
this.setIsXaxisAxisLabelRotate({ isXaxisAxisLabelRotate, xStatistics });
|
|
154
|
-
this.setIsYAxisSplitlineLinestyleWidth({
|
|
155
|
-
isYAxisSplitlineLinestyleWidth,
|
|
156
|
-
yAxisSplitlineLinestyleType,
|
|
157
|
-
});
|
|
158
|
-
this.setYAxisMaxMin({ yAxisMax, yAxisMin });
|
|
159
|
-
this.setIsYAxisName({ isYAxisName, yAxisName });
|
|
160
|
-
this.setIsYAxisShow({ isYAxisShow });
|
|
161
|
-
this.setIsSeriesShowSymbol({
|
|
162
|
-
isSeriesShowSymbol,
|
|
163
|
-
isUnit,
|
|
164
|
-
unit,
|
|
165
|
-
decimalDigits,
|
|
166
|
-
suffix,
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
export default EchartLine;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export default EchartPie;
|
|
2
|
-
/**
|
|
3
|
-
* 饼状图表
|
|
4
|
-
* @author loonglong
|
|
5
|
-
**/
|
|
6
|
-
declare class EchartPie extends EchartBase {
|
|
7
|
-
setSourceData({ dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, }: {
|
|
8
|
-
dataSource: any;
|
|
9
|
-
filterData: any;
|
|
10
|
-
setColor: any;
|
|
11
|
-
xField: any;
|
|
12
|
-
xStatistics: any;
|
|
13
|
-
xIsCountEmpty: any;
|
|
14
|
-
yField: any;
|
|
15
|
-
}): Promise<void>;
|
|
16
|
-
setChartType({ chartType }: {
|
|
17
|
-
chartType: any;
|
|
18
|
-
}): void;
|
|
19
|
-
setIsSeriesShowSymbol({ isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }: {
|
|
20
|
-
isSeriesShowSymbol: any;
|
|
21
|
-
isPercent: any;
|
|
22
|
-
isUnit: any;
|
|
23
|
-
unit: any;
|
|
24
|
-
decimalDigits: any;
|
|
25
|
-
suffix: any;
|
|
26
|
-
}): void;
|
|
27
|
-
setOptions({ chartType, isTitle, title, titleLocation, dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, isLegend, legend, legend2, isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }: {
|
|
28
|
-
chartType: any;
|
|
29
|
-
isTitle: any;
|
|
30
|
-
title: any;
|
|
31
|
-
titleLocation: any;
|
|
32
|
-
dataSource: any;
|
|
33
|
-
filterData: any;
|
|
34
|
-
setColor: any;
|
|
35
|
-
xField: any;
|
|
36
|
-
xStatistics: any;
|
|
37
|
-
xIsCountEmpty: any;
|
|
38
|
-
yField: any;
|
|
39
|
-
isLegend: any;
|
|
40
|
-
legend: any;
|
|
41
|
-
legend2: any;
|
|
42
|
-
isSeriesShowSymbol: any;
|
|
43
|
-
isPercent: any;
|
|
44
|
-
isUnit: any;
|
|
45
|
-
unit: any;
|
|
46
|
-
decimalDigits: any;
|
|
47
|
-
suffix: any;
|
|
48
|
-
}): Promise<void>;
|
|
49
|
-
}
|
|
50
|
-
import EchartBase from "./eChartBase";
|
|
@@ -1,132 +0,0 @@
|
|
|
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, titleLocation, dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, isLegend, legend, legend2, isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }) {
|
|
107
|
-
legend = document.body.clientWidth < 1024 ? legend : legend2;
|
|
108
|
-
if (dataSource) {
|
|
109
|
-
await this.setSourceData({
|
|
110
|
-
dataSource,
|
|
111
|
-
filterData,
|
|
112
|
-
setColor,
|
|
113
|
-
xField,
|
|
114
|
-
xStatistics,
|
|
115
|
-
xIsCountEmpty,
|
|
116
|
-
yField,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
this.setChartType({ chartType });
|
|
120
|
-
this.setTitle({ isTitle, title, titleLocation });
|
|
121
|
-
this.setLegend({ isLegend, legend });
|
|
122
|
-
this.setIsSeriesShowSymbol({
|
|
123
|
-
isSeriesShowSymbol,
|
|
124
|
-
isPercent,
|
|
125
|
-
isUnit,
|
|
126
|
-
unit,
|
|
127
|
-
decimalDigits,
|
|
128
|
-
suffix,
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
export default EchartPie;
|
|
@@ -1,35 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,9 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,24 +0,0 @@
|
|
|
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;
|
|
@@ -1,8 +0,0 @@
|
|
|
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;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { useAsync, useDeepCompareEffect, useEventListener, useIsMounted, useMountEffect, } from '@react-hookz/web';
|
|
2
|
-
import { useEffect, useRef, } from 'react';
|
|
3
|
-
export function useChart(ref) {
|
|
4
|
-
const chartRef = useRef();
|
|
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
|
-
const chart = echarts.init(echartDom);
|
|
13
|
-
chartRef.current = chart;
|
|
14
|
-
return () => {
|
|
15
|
-
chart.dispose();
|
|
16
|
-
chartRef.current = null;
|
|
17
|
-
};
|
|
18
|
-
});
|
|
19
|
-
useEventListener(window, 'resize', () => {
|
|
20
|
-
chartRef.current && chartRef.current.resize();
|
|
21
|
-
});
|
|
22
|
-
return chartRef.current;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @deprecated The method should not be used
|
|
26
|
-
*/
|
|
27
|
-
export function useWedaChart(domRef, ModalClass, options) {
|
|
28
|
-
const chart = useChart(domRef);
|
|
29
|
-
const getOptions = async () => {
|
|
30
|
-
const chartModal = new ModalClass();
|
|
31
|
-
let finalOptions = await chartModal.setOptions(options);
|
|
32
|
-
if (!finalOptions) {
|
|
33
|
-
finalOptions = chartModal.getOptions();
|
|
34
|
-
}
|
|
35
|
-
return finalOptions;
|
|
36
|
-
};
|
|
37
|
-
const [state, actions] = useAsync(getOptions);
|
|
38
|
-
useMountEffect(() => {
|
|
39
|
-
actions.execute();
|
|
40
|
-
});
|
|
41
|
-
useDeepCompareEffect(() => {
|
|
42
|
-
actions.execute();
|
|
43
|
-
}, [
|
|
44
|
-
// options 变化,包含所有配置项,包括纯前端的配置项变化都会触发setOptions里发请求,但改不动了
|
|
45
|
-
options,
|
|
46
|
-
actions,
|
|
47
|
-
]);
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
if (state.status === 'success' && chart) {
|
|
50
|
-
console.log(ModalClass.name, options, state.result, window.location.href);
|
|
51
|
-
chart.setOption(state.result, true // noMerge 全刷
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
if (state.status === 'error') {
|
|
56
|
-
console.error(state.error);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}, [state]);
|
|
60
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { CommonPropsType } from '../../../types';
|
|
3
|
-
import { DataSource, Xfield, Yfield } from '../common/core/type';
|
|
4
|
-
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?: string;
|
|
35
|
-
decimalDigits?: number;
|
|
36
|
-
suffix?: string;
|
|
37
|
-
}
|
|
38
|
-
export default function Line(opts: PropsType): JSX.Element;
|
|
39
|
-
export {};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import React, { useRef } from 'react';
|
|
2
|
-
import EChartLine from '../common/core/eChartLine';
|
|
3
|
-
import classNames from '../../../utils/classnames';
|
|
4
|
-
import { useWedaChart } from '../common/useChart';
|
|
5
|
-
export default function Line(opts) {
|
|
6
|
-
const { id, style, className, chartType, isTitle, title, titleLocation, dataSource, filterData, xField, xStatistics, xIsCountEmpty, yField, groupKey, groupKeyTimeSpan, isLegend, legend, legend2, isXaxisName, xAxisName, isXaxisAxisLabelShow, isXaxisAxisTickShow, isXaxisAxisLabelRotate, isYAxisSplitlineLinestyleWidth, yAxisSplitlineLinestyleType, yAxisMax, yAxisMin, isYAxisName, yAxisName, isSeriesShowSymbol, isYAxisShow, isUnit, unit, decimalDigits, suffix, } = opts;
|
|
7
|
-
const domRef = useRef();
|
|
8
|
-
useWedaChart(domRef, EChartLine, {
|
|
9
|
-
chartType,
|
|
10
|
-
isTitle,
|
|
11
|
-
title,
|
|
12
|
-
titleLocation,
|
|
13
|
-
dataSource,
|
|
14
|
-
filterData,
|
|
15
|
-
xField,
|
|
16
|
-
xStatistics,
|
|
17
|
-
xIsCountEmpty,
|
|
18
|
-
yField,
|
|
19
|
-
groupKey,
|
|
20
|
-
groupKeyTimeSpan,
|
|
21
|
-
isLegend,
|
|
22
|
-
legend,
|
|
23
|
-
legend2,
|
|
24
|
-
isXaxisName,
|
|
25
|
-
xAxisName,
|
|
26
|
-
isXaxisAxisLabelShow,
|
|
27
|
-
isXaxisAxisTickShow,
|
|
28
|
-
isXaxisAxisLabelRotate,
|
|
29
|
-
isYAxisSplitlineLinestyleWidth,
|
|
30
|
-
yAxisSplitlineLinestyleType,
|
|
31
|
-
yAxisMax,
|
|
32
|
-
yAxisMin,
|
|
33
|
-
isYAxisName,
|
|
34
|
-
yAxisName,
|
|
35
|
-
isSeriesShowSymbol,
|
|
36
|
-
isYAxisShow,
|
|
37
|
-
isUnit,
|
|
38
|
-
unit,
|
|
39
|
-
decimalDigits,
|
|
40
|
-
suffix,
|
|
41
|
-
});
|
|
42
|
-
const inlineStyle = {
|
|
43
|
-
height: '380px',
|
|
44
|
-
width: '100%',
|
|
45
|
-
backgroundColor: '#ffffff',
|
|
46
|
-
...style,
|
|
47
|
-
};
|
|
48
|
-
return (React.createElement("div", { id: id, ref: domRef, "data-testid": "line", style: inlineStyle, className: classNames({
|
|
49
|
-
'echart-wrapper-canvas': true,
|
|
50
|
-
'echart-dark-body': true,
|
|
51
|
-
[className]: className,
|
|
52
|
-
}) }));
|
|
53
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { CommonPropsType } from '../../../types';
|
|
3
|
-
import { DataSource, Xfield, Yfield } from '../common/core/type';
|
|
4
|
-
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
|
-
setColor?: Array<string>;
|
|
12
|
-
xField?: Xfield;
|
|
13
|
-
xStatistics?: string;
|
|
14
|
-
xIsCountEmpty?: boolean;
|
|
15
|
-
yField?: Yfield;
|
|
16
|
-
isLegend?: boolean;
|
|
17
|
-
legend?: string;
|
|
18
|
-
legend2?: string;
|
|
19
|
-
isSeriesShowSymbol?: boolean;
|
|
20
|
-
isPercent?: boolean;
|
|
21
|
-
isUnit?: boolean;
|
|
22
|
-
unit?: string;
|
|
23
|
-
decimalDigits?: number;
|
|
24
|
-
suffix?: string;
|
|
25
|
-
}
|
|
26
|
-
export default function Line({ id, style, className, chartType, isTitle, title, titleLocation, dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, isLegend, legend, legend2, isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }: PropsType): JSX.Element;
|
|
27
|
-
export {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React, { useRef } from 'react';
|
|
2
|
-
import EchartPie from '../common/core/eChartPie';
|
|
3
|
-
import { useWedaChart } from '../common/useChart';
|
|
4
|
-
import classNames from '../../../utils/classnames';
|
|
5
|
-
export default function Line({ id, style, className, chartType, isTitle, title, titleLocation, dataSource, filterData, setColor, xField, xStatistics, xIsCountEmpty, yField, isLegend, legend, legend2, isSeriesShowSymbol, isPercent, isUnit, unit, decimalDigits, suffix, }) {
|
|
6
|
-
const domRef = useRef();
|
|
7
|
-
useWedaChart(domRef, EchartPie, {
|
|
8
|
-
chartType,
|
|
9
|
-
isTitle,
|
|
10
|
-
title,
|
|
11
|
-
titleLocation,
|
|
12
|
-
dataSource,
|
|
13
|
-
filterData,
|
|
14
|
-
setColor,
|
|
15
|
-
xField,
|
|
16
|
-
xStatistics,
|
|
17
|
-
xIsCountEmpty,
|
|
18
|
-
yField,
|
|
19
|
-
isLegend,
|
|
20
|
-
legend,
|
|
21
|
-
legend2,
|
|
22
|
-
isSeriesShowSymbol,
|
|
23
|
-
isPercent,
|
|
24
|
-
isUnit,
|
|
25
|
-
unit,
|
|
26
|
-
decimalDigits,
|
|
27
|
-
suffix,
|
|
28
|
-
});
|
|
29
|
-
const inlineStyle = {
|
|
30
|
-
height: '380px',
|
|
31
|
-
width: '100%',
|
|
32
|
-
backgroundColor: '#ffffff',
|
|
33
|
-
...style,
|
|
34
|
-
};
|
|
35
|
-
return (React.createElement("div", { id: id, "data-testid": "pie", ref: domRef, style: inlineStyle, className: classNames({
|
|
36
|
-
'echart-wrapper-canvas': true,
|
|
37
|
-
'echart-dark-body': true,
|
|
38
|
-
[className]: className,
|
|
39
|
-
}) }));
|
|
40
|
-
}
|