@cloudbase/weda-ui 2.0.28 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +12 -13
- package/src/configs/actions/showModal.json +0 -48
- package/src/configs/actions/showToast.json +0 -41
- package/src/configs/components/auth.json +0 -16
- package/src/configs/components/button.json +0 -239
- package/src/configs/components/calendar.json +0 -81
- package/src/configs/components/carousel.json +0 -292
- package/src/configs/components/chart/bar.json +0 -721
- package/src/configs/components/chart/line.json +0 -674
- package/src/configs/components/chart/pie.json +0 -494
- package/src/configs/components/chart/statisticsCard.json +0 -376
- package/src/configs/components/container.json +0 -50
- package/src/configs/components/dataView.json +0 -151
- package/src/configs/components/drawer.json +0 -115
- package/src/configs/components/form/checkbox.json +0 -173
- package/src/configs/components/form/form.json +0 -45
- package/src/configs/components/form/input.json +0 -154
- package/src/configs/components/form/label.json +0 -22
- package/src/configs/components/form/location.json +0 -155
- package/src/configs/components/form/radio.json +0 -203
- package/src/configs/components/form/richText.json +0 -125
- package/src/configs/components/form/select.json +0 -411
- package/src/configs/components/form/switch.json +0 -58
- package/src/configs/components/form/textarea.json +0 -116
- package/src/configs/components/form/tips.json +0 -34
- package/src/configs/components/form/uploader.json +0 -169
- package/src/configs/components/form/uploaderFile.json +0 -158
- package/src/configs/components/graphicCard.json +0 -413
- package/src/configs/components/image.json +0 -179
- package/src/configs/components/link.json +0 -79
- package/src/configs/components/listView.json +0 -281
- package/src/configs/components/lottery.json +0 -157
- package/src/configs/components/modal.json +0 -83
- package/src/configs/components/navLayout.json +0 -368
- package/src/configs/components/navigationBar.json +0 -62
- package/src/configs/components/picker/datePicker.json +0 -33
- package/src/configs/components/picker/picker.json +0 -18
- package/src/configs/components/picker/timePicker.json +0 -23
- package/src/configs/components/richtextview.json +0 -26
- package/src/configs/components/scrollVeiw.json +0 -253
- package/src/configs/components/slot.json +0 -17
- package/src/configs/components/swiper.json +0 -90
- package/src/configs/components/tabs.json +0 -121
- package/src/configs/components/text.json +0 -95
- package/src/configs/components/wedaVideo.json +0 -89
- package/src/configs/components/wxOpenApi/phone.json +0 -127
- package/src/configs/components/wxOpenApi/phoneCode.json +0 -109
- package/src/configs/components/wxOpenApi/share.json +0 -157
- package/src/configs/components/wxOpenApi/userInfo.json +0 -156
- package/src/configs/index.js +0 -111
- package/src/index.js +0 -4
- package/src/mp/README.md +0 -1
- package/src/mp/actions/showModal/index.js +0 -3
- package/src/mp/actions/showToast/index.js +0 -3
- package/src/mp/components/button/index.js +0 -91
- package/src/mp/components/button/index.json +0 -4
- package/src/mp/components/button/index.wxml +0 -22
- package/src/mp/components/button/index.wxss +0 -13
- package/src/mp/components/calendar/arrowright--line.svg +0 -11
- package/src/mp/components/calendar/index.js +0 -268
- package/src/mp/components/calendar/index.json +0 -5
- package/src/mp/components/calendar/index.wxml +0 -35
- package/src/mp/components/calendar/index.wxss +0 -179
- package/src/mp/components/carousel/index.js +0 -88
- package/src/mp/components/carousel/index.json +0 -7
- package/src/mp/components/carousel/index.wxml +0 -6
- package/src/mp/components/chart/bar/index.js +0 -257
- package/src/mp/components/chart/bar/index.json +0 -6
- package/src/mp/components/chart/bar/index.wxml +0 -3
- package/src/mp/components/chart/bar/index.wxss +0 -9
- package/src/mp/components/chart/common/config/bar.js +0 -50
- package/src/mp/components/chart/common/config/global.js +0 -16
- package/src/mp/components/chart/common/config/line.js +0 -48
- package/src/mp/components/chart/common/config/pie.js +0 -36
- package/src/mp/components/chart/common/core/eChartBar.js +0 -258
- package/src/mp/components/chart/common/core/eChartBase.js +0 -389
- package/src/mp/components/chart/common/core/eChartLine.js +0 -223
- package/src/mp/components/chart/common/core/eChartPie.js +0 -169
- package/src/mp/components/chart/common/lib/echarts.min.js +0 -18
- package/src/mp/components/chart/ec-canvas/ec-canvas.js +0 -277
- package/src/mp/components/chart/ec-canvas/ec-canvas.json +0 -4
- package/src/mp/components/chart/ec-canvas/ec-canvas.wxml +0 -4
- package/src/mp/components/chart/ec-canvas/ec-canvas.wxss +0 -4
- package/src/mp/components/chart/ec-canvas/wx-canvas.js +0 -109
- package/src/mp/components/chart/line/index.js +0 -247
- package/src/mp/components/chart/line/index.json +0 -6
- package/src/mp/components/chart/line/index.wxml +0 -3
- package/src/mp/components/chart/line/index.wxss +0 -9
- package/src/mp/components/chart/pie/index.js +0 -182
- package/src/mp/components/chart/pie/index.json +0 -6
- package/src/mp/components/chart/pie/index.wxml +0 -3
- package/src/mp/components/chart/pie/index.wxss +0 -9
- package/src/mp/components/chart/statisticsCard/index.js +0 -253
- package/src/mp/components/chart/statisticsCard/index.json +0 -4
- package/src/mp/components/chart/statisticsCard/index.wxml +0 -9
- package/src/mp/components/chart/statisticsCard/index.wxss +0 -42
- package/src/mp/components/container/index.js +0 -20
- package/src/mp/components/container/index.json +0 -4
- package/src/mp/components/container/index.wxml +0 -3
- package/src/mp/components/dataView/index.js +0 -34
- package/src/mp/components/dataView/index.json +0 -7
- package/src/mp/components/dataView/index.wxml +0 -3
- package/src/mp/components/dataView/index.wxss +0 -0
- package/src/mp/components/form/checkbox/index.js +0 -124
- package/src/mp/components/form/checkbox/index.json +0 -7
- package/src/mp/components/form/checkbox/index.wxml +0 -13
- package/src/mp/components/form/checkbox/index.wxss +0 -1
- package/src/mp/components/form/form/index.js +0 -18
- package/src/mp/components/form/form/index.json +0 -4
- package/src/mp/components/form/form/index.wxml +0 -5
- package/src/mp/components/form/form/index.wxss +0 -1
- package/src/mp/components/form/formcell/index.js +0 -54
- package/src/mp/components/form/formcell/index.json +0 -4
- package/src/mp/components/form/formcell/index.wxml +0 -11
- package/src/mp/components/form/formcell/index.wxss +0 -31
- package/src/mp/components/form/input/index.js +0 -110
- package/src/mp/components/form/input/index.json +0 -7
- package/src/mp/components/form/input/index.wxml +0 -24
- package/src/mp/components/form/input/index.wxss +0 -22
- package/src/mp/components/form/location/components/mapChoose/index.js +0 -201
- package/src/mp/components/form/location/components/mapChoose/index.json +0 -4
- package/src/mp/components/form/location/components/mapChoose/index.wxml +0 -42
- package/src/mp/components/form/location/components/mapChoose/index.wxss +0 -188
- package/src/mp/components/form/location/index.js +0 -388
- package/src/mp/components/form/location/index.json +0 -6
- package/src/mp/components/form/location/index.wxml +0 -21
- package/src/mp/components/form/location/index.wxss +0 -89
- package/src/mp/components/form/radio/index.js +0 -124
- package/src/mp/components/form/radio/index.json +0 -7
- package/src/mp/components/form/radio/index.wxml +0 -13
- package/src/mp/components/form/radio/index.wxss +0 -1
- package/src/mp/components/form/select/index.js +0 -677
- package/src/mp/components/form/select/index.json +0 -7
- package/src/mp/components/form/select/index.wxml +0 -12
- package/src/mp/components/form/select/index.wxss +0 -16
- package/src/mp/components/form/select/region/index.js +0 -107
- package/src/mp/components/form/switch/index.js +0 -75
- package/src/mp/components/form/switch/index.json +0 -7
- package/src/mp/components/form/switch/index.wxml +0 -11
- package/src/mp/components/form/switch/index.wxss +0 -1
- package/src/mp/components/form/textarea/index.js +0 -90
- package/src/mp/components/form/textarea/index.json +0 -7
- package/src/mp/components/form/textarea/index.wxml +0 -8
- package/src/mp/components/form/textarea/index.wxss +0 -10
- package/src/mp/components/form/tips/index.js +0 -41
- package/src/mp/components/form/tips/index.json +0 -4
- package/src/mp/components/form/tips/index.wxml +0 -1
- package/src/mp/components/form/tips/index.wxss +0 -1
- package/src/mp/components/form/uploader/index.js +0 -158
- package/src/mp/components/form/uploader/index.json +0 -10
- package/src/mp/components/form/uploader/index.wxml +0 -14
- package/src/mp/components/form/uploader/index.wxss +0 -36
- package/src/mp/components/form/uploader/weui-uploader.js +0 -219
- package/src/mp/components/form/uploader/weui-uploader.json +0 -7
- package/src/mp/components/form/uploader/weui-uploader.wxml +0 -45
- package/src/mp/components/form/uploader/weui-uploader.wxss +0 -1
- package/src/mp/components/form/uploaderFile/index.js +0 -313
- package/src/mp/components/form/uploaderFile/index.json +0 -9
- package/src/mp/components/form/uploaderFile/index.wxml +0 -45
- package/src/mp/components/form/uploaderFile/index.wxss +0 -105
- package/src/mp/components/graphicCard/chevron-right.svg +0 -3
- package/src/mp/components/graphicCard/index.js +0 -203
- package/src/mp/components/graphicCard/index.json +0 -4
- package/src/mp/components/graphicCard/index.wxml +0 -25
- package/src/mp/components/graphicCard/index.wxss +0 -157
- package/src/mp/components/image/index.js +0 -182
- package/src/mp/components/image/index.json +0 -7
- package/src/mp/components/image/index.wxml +0 -9
- package/src/mp/components/image/index.wxss +0 -49
- package/src/mp/components/listView/arrow-right-line.svg +0 -3
- package/src/mp/components/listView/index.js +0 -274
- package/src/mp/components/listView/index.json +0 -4
- package/src/mp/components/listView/index.wxml +0 -38
- package/src/mp/components/listView/index.wxss +0 -155
- package/src/mp/components/listView/more-line.svg +0 -3
- package/src/mp/components/lottery/index.js +0 -270
- package/src/mp/components/lottery/index.json +0 -4
- package/src/mp/components/lottery/index.wxml +0 -41
- package/src/mp/components/lottery/index.wxss +0 -323
- package/src/mp/components/modal/index.js +0 -39
- package/src/mp/components/modal/index.json +0 -4
- package/src/mp/components/modal/index.wxml +0 -1
- package/src/mp/components/navLayout/index.js +0 -120
- package/src/mp/components/navLayout/index.json +0 -7
- package/src/mp/components/navLayout/index.wxml +0 -23
- package/src/mp/components/navLayout/index.wxss +0 -1193
- package/src/mp/components/navigationBar/index.js +0 -204
- package/src/mp/components/navigationBar/index.json +0 -5
- package/src/mp/components/navigationBar/index.wxml +0 -80
- package/src/mp/components/navigationBar/index.wxss +0 -1257
- package/src/mp/components/richText/index.js +0 -67
- package/src/mp/components/richText/index.json +0 -4
- package/src/mp/components/richText/index.wxml +0 -3
- package/src/mp/components/richText/index.wxss +0 -27
- package/src/mp/components/scrollView/index.js +0 -119
- package/src/mp/components/scrollView/index.json +0 -4
- package/src/mp/components/scrollView/index.wxml +0 -38
- package/src/mp/components/slot/index.js +0 -20
- package/src/mp/components/slot/index.json +0 -4
- package/src/mp/components/slot/index.wxml +0 -3
- package/src/mp/components/swiper/index.js +0 -65
- package/src/mp/components/swiper/index.json +0 -4
- package/src/mp/components/swiper/index.wxml +0 -3
- package/src/mp/components/tabs/index.js +0 -59
- package/src/mp/components/tabs/index.json +0 -4
- package/src/mp/components/tabs/index.wxml +0 -12
- package/src/mp/components/tabs/index.wxss +0 -57
- package/src/mp/components/text/index.js +0 -40
- package/src/mp/components/text/index.json +0 -4
- package/src/mp/components/text/index.wxml +0 -1
- package/src/mp/components/text/index.wxss +0 -26
- package/src/mp/components/wedaVideo/index.js +0 -86
- package/src/mp/components/wedaVideo/index.json +0 -4
- package/src/mp/components/wedaVideo/index.wxml +0 -4
- package/src/mp/components/wedaVideo/index.wxss +0 -20
- package/src/mp/components/wxOpenApi/phone/index.js +0 -109
- package/src/mp/components/wxOpenApi/phone/index.json +0 -4
- package/src/mp/components/wxOpenApi/phone/index.wxml +0 -4
- package/src/mp/components/wxOpenApi/phone/index.wxss +0 -22
- package/src/mp/components/wxOpenApi/phoneCode/index.js +0 -89
- package/src/mp/components/wxOpenApi/phoneCode/index.json +0 -4
- package/src/mp/components/wxOpenApi/phoneCode/index.wxml +0 -4
- package/src/mp/components/wxOpenApi/phoneCode/index.wxss +0 -22
- package/src/mp/components/wxOpenApi/share/index.js +0 -117
- package/src/mp/components/wxOpenApi/share/index.json +0 -4
- package/src/mp/components/wxOpenApi/share/index.wxml +0 -4
- package/src/mp/components/wxOpenApi/share/index.wxss +0 -22
- package/src/mp/components/wxOpenApi/userInfo/index.js +0 -88
- package/src/mp/components/wxOpenApi/userInfo/index.json +0 -4
- package/src/mp/components/wxOpenApi/userInfo/index.wxml +0 -4
- package/src/mp/components/wxOpenApi/userInfo/index.wxss +0 -22
- package/src/mp/index.json +0 -52
- package/src/mp/package.json +0 -6
- package/src/mp/style/weda-ui.wxss +0 -71
- package/src/mp/utils/classnames.js +0 -39
- package/src/mp/utils/constant.js +0 -20
- package/src/mp/utils/dayjs.min.js +0 -1
- package/src/mp/utils/debounce.js +0 -133
- package/src/mp/utils/deepEqual.js +0 -42
- package/src/mp/utils/destr.js +0 -49
- package/src/mp/utils/dr_square_point.js +0 -29
- package/src/mp/utils/handleEvents.js +0 -32
- package/src/mp/utils/lodash.js +0 -2
- package/src/mp/utils/platform.js +0 -45
- package/src/mp/utils/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.js +0 -1336
- package/src/mp/utils/spark-md5.js +0 -776
- package/src/mp/utils/tcb.js +0 -90
- package/src/setupTests.js +0 -14
- package/src/web/actions/index.js +0 -2
- package/src/web/actions/showModal/index.tsx +0 -118
- package/src/web/actions/showToast/index.js +0 -3
- package/src/web/components/auth/index.css +0 -0
- package/src/web/components/auth/index.js +0 -66
- package/src/web/components/button/index.css +0 -27
- package/src/web/components/button/index.tsx +0 -119
- package/src/web/components/calendar/index.css +0 -416
- package/src/web/components/calendar/index.jsx +0 -312
- package/src/web/components/calendar/util.js +0 -90
- package/src/web/components/carousel/index.css +0 -119
- package/src/web/components/carousel/index.tsx +0 -417
- package/src/web/components/chart/bar/index.tsx +0 -140
- package/src/web/components/chart/common/config/bar.js +0 -49
- package/src/web/components/chart/common/config/global.js +0 -16
- package/src/web/components/chart/common/config/line.js +0 -50
- package/src/web/components/chart/common/config/pie.js +0 -37
- package/src/web/components/chart/common/core/eChartBar.js +0 -259
- package/src/web/components/chart/common/core/eChartBase.ts +0 -396
- package/src/web/components/chart/common/core/eChartLine.js +0 -225
- package/src/web/components/chart/common/core/eChartPie.js +0 -173
- package/src/web/components/chart/common/core/type.ts +0 -34
- package/src/web/components/chart/common/echart.css +0 -106
- package/src/web/components/chart/common/echarts.ts +0 -31
- package/src/web/components/chart/common/useChart.tsx +0 -87
- package/src/web/components/chart/line/index.tsx +0 -136
- package/src/web/components/chart/pie/index.tsx +0 -99
- package/src/web/components/chart/statisticsCard/index.css +0 -63
- package/src/web/components/chart/statisticsCard/index.tsx +0 -307
- package/src/web/components/chart/statisticsCard/interface.ts +0 -14
- package/src/web/components/container/index.tsx +0 -34
- package/src/web/components/dataView/index.tsx +0 -20
- package/src/web/components/dataView/interface.ts +0 -6
- package/src/web/components/drawer/index.tsx +0 -68
- package/src/web/components/form/checkbox/index.tsx +0 -210
- package/src/web/components/form/enumSelect/MultipleSelect.jsx +0 -89
- package/src/web/components/form/enumSelect/NormalSelect.tsx +0 -92
- package/src/web/components/form/enumSelect/SelectContainer.jsx +0 -43
- package/src/web/components/form/enumSelect/index.jsx +0 -9
- package/src/web/components/form/enumSelect/props/defaultProps.js +0 -39
- package/src/web/components/form/enumSelect/props/propsTypes.js +0 -50
- package/src/web/components/form/form/index.css +0 -9
- package/src/web/components/form/form/index.tsx +0 -51
- package/src/web/components/form/formcell/index.css +0 -85
- package/src/web/components/form/formcell/index.tsx +0 -85
- package/src/web/components/form/input/index.css +0 -40
- package/src/web/components/form/input/index.tsx +0 -166
- package/src/web/components/form/location/common/mapChoose.css +0 -180
- package/src/web/components/form/location/common/mapChoose.jsx +0 -343
- package/src/web/components/form/location/common/mapView.jsx +0 -190
- package/src/web/components/form/location/common/propsConfig.js +0 -54
- package/src/web/components/form/location/common/selectModal.css +0 -44
- package/src/web/components/form/location/common/selectModal.jsx +0 -73
- package/src/web/components/form/location/common/useLocationInfo.js +0 -104
- package/src/web/components/form/location/components/LocationH5/index.css +0 -239
- package/src/web/components/form/location/components/LocationH5/location.h5.jsx +0 -413
- package/src/web/components/form/location/components/LocationPC/Header.jsx +0 -96
- package/src/web/components/form/location/components/LocationPC/index.css +0 -44
- package/src/web/components/form/location/components/LocationPC/location.PC.jsx +0 -332
- package/src/web/components/form/location/constants.js +0 -4
- package/src/web/components/form/location/index.css +0 -0
- package/src/web/components/form/location/index.jsx +0 -25
- package/src/web/components/form/radio/index.css +0 -12
- package/src/web/components/form/radio/index.tsx +0 -179
- package/src/web/components/form/renderDecorator.tsx +0 -28
- package/src/web/components/form/select/h5.tsx +0 -602
- package/src/web/components/form/select/index.css +0 -27
- package/src/web/components/form/select/index.tsx +0 -510
- package/src/web/components/form/select/region/index.ts +0 -152
- package/src/web/components/form/select/time.jsx +0 -145
- package/src/web/components/form/select/year.tsx +0 -172
- package/src/web/components/form/switch/index.tsx +0 -100
- package/src/web/components/form/textarea/index.css +0 -11
- package/src/web/components/form/textarea/index.tsx +0 -127
- package/src/web/components/form/tips/index.css +0 -4
- package/src/web/components/form/tips/index.tsx +0 -34
- package/src/web/components/form/types.d.ts +0 -12
- package/src/web/components/form/uploader/index.css +0 -118
- package/src/web/components/form/uploader/index.tsx +0 -65
- package/src/web/components/form/uploader/uploader.h5.tsx +0 -290
- package/src/web/components/form/uploader/uploader.pc.tsx +0 -287
- package/src/web/components/form/uploaderFile/fail.svg +0 -12
- package/src/web/components/form/uploaderFile/index.css +0 -422
- package/src/web/components/form/uploaderFile/index.jsx +0 -25
- package/src/web/components/form/uploaderFile/pending.svg +0 -18
- package/src/web/components/form/uploaderFile/success.svg +0 -12
- package/src/web/components/form/uploaderFile/uploadFile.h5.tsx +0 -606
- package/src/web/components/form/uploaderFile/uploadFile.pc.tsx +0 -520
- package/src/web/components/graphicCard/index.css +0 -159
- package/src/web/components/graphicCard/index.tsx +0 -310
- package/src/web/components/image/image.tsx +0 -187
- package/src/web/components/image/index.css +0 -54
- package/src/web/components/image/index.tsx +0 -121
- package/src/web/components/index.js +0 -95
- package/src/web/components/link/index.css +0 -8
- package/src/web/components/link/index.tsx +0 -119
- package/src/web/components/listView/arrow-right-line.svg +0 -3
- package/src/web/components/listView/index.css +0 -143
- package/src/web/components/listView/index.tsx +0 -346
- package/src/web/components/listView/interface.ts +0 -98
- package/src/web/components/lottery/index.css +0 -333
- package/src/web/components/lottery/index.tsx +0 -567
- package/src/web/components/lottery/lotteryUtil.ts +0 -130
- package/src/web/components/modal/index.tsx +0 -60
- package/src/web/components/navLayout/index.css +0 -332
- package/src/web/components/navLayout/index.tsx +0 -247
- package/src/web/components/navigationBar/chevron-right--double.svg +0 -3
- package/src/web/components/navigationBar/common.tsx +0 -203
- package/src/web/components/navigationBar/h5Menu.tsx +0 -179
- package/src/web/components/navigationBar/horizontalMenu.tsx +0 -201
- package/src/web/components/navigationBar/index.css +0 -762
- package/src/web/components/navigationBar/index.tsx +0 -231
- package/src/web/components/navigationBar/type.d.ts +0 -118
- package/src/web/components/navigationBar/verticalMenu.tsx +0 -81
- package/src/web/components/phone/index.css +0 -0
- package/src/web/components/phone/index.tsx +0 -22
- package/src/web/components/phoneCode/index.css +0 -0
- package/src/web/components/phoneCode/index.tsx +0 -22
- package/src/web/components/picker/datePicker.tsx +0 -48
- package/src/web/components/picker/picker.tsx +0 -59
- package/src/web/components/picker/timePicker.tsx +0 -56
- package/src/web/components/richText/const.ts +0 -3
- package/src/web/components/richText/index.css +0 -93
- package/src/web/components/richText/index.jsx +0 -473
- package/src/web/components/richTextView/index.css +0 -63
- package/src/web/components/richTextView/index.tsx +0 -63
- package/src/web/components/scrollView/index.tsx +0 -148
- package/src/web/components/share/index.css +0 -0
- package/src/web/components/share/index.tsx +0 -38
- package/src/web/components/slot/index.tsx +0 -19
- package/src/web/components/swiper/index.css +0 -106
- package/src/web/components/swiper/index.tsx +0 -291
- package/src/web/components/tabs/index.css +0 -64
- package/src/web/components/tabs/index.tsx +0 -35
- package/src/web/components/tabs/tabs.h5.tsx +0 -84
- package/src/web/components/tabs/tabs.pc.tsx +0 -74
- package/src/web/components/text/index.css +0 -26
- package/src/web/components/text/index.tsx +0 -60
- package/src/web/components/uploaderFileView/index.css +0 -11
- package/src/web/components/uploaderFileView/index.jsx +0 -84
- package/src/web/components/uploaderView/index.css +0 -31
- package/src/web/components/uploaderView/index.tsx +0 -92
- package/src/web/components/userInfo/index.css +0 -0
- package/src/web/components/userInfo/index.tsx +0 -30
- package/src/web/components/wedaVideo/index.css +0 -42
- package/src/web/components/wedaVideo/index.tsx +0 -208
- package/src/web/index.js +0 -4
- package/src/web/types.d.ts +0 -21
- package/src/web/utils/classnames.js +0 -39
- package/src/web/utils/constant.ts +0 -23
- package/src/web/utils/debounce.js +0 -98
- package/src/web/utils/events.js +0 -2
- package/src/web/utils/getLocalCounter.js +0 -5
- package/src/web/utils/isObjectEqual.js +0 -15
- package/src/web/utils/loading-fallback.tsx +0 -2
- package/src/web/utils/lodash.ts +0 -2
- package/src/web/utils/platform.js +0 -170
- package/src/web/utils/tcb.js +0 -86
- package/src/web/utils/tmap.js +0 -4
- package/src/web/utils/useSetState.ts +0 -18
- package/src/web/utils/useSyncValue.ts +0 -17
- package/src/web/utils/weui.js +0 -3
- package/src/web/weda-ui.css +0 -90
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
import WxCanvas from './wx-canvas';
|
|
2
|
-
import * as echarts from '../common/lib/echarts.min';
|
|
3
|
-
|
|
4
|
-
let ctx;
|
|
5
|
-
|
|
6
|
-
function compareVersion(v1, v2) {
|
|
7
|
-
v1 = v1.split('.');
|
|
8
|
-
v2 = v2.split('.');
|
|
9
|
-
const len = Math.max(v1.length, v2.length);
|
|
10
|
-
|
|
11
|
-
while (v1.length < len) {
|
|
12
|
-
v1.push('0');
|
|
13
|
-
}
|
|
14
|
-
while (v2.length < len) {
|
|
15
|
-
v2.push('0');
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
for (let i = 0; i < len; i++) {
|
|
19
|
-
const num1 = parseInt(v1[i]);
|
|
20
|
-
const num2 = parseInt(v2[i]);
|
|
21
|
-
|
|
22
|
-
if (num1 > num2) {
|
|
23
|
-
return 1;
|
|
24
|
-
} else if (num1 < num2) {
|
|
25
|
-
return -1;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
Component({
|
|
32
|
-
properties: {
|
|
33
|
-
canvasId: {
|
|
34
|
-
type: String,
|
|
35
|
-
value: 'ec-canvas',
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
ec: {
|
|
39
|
-
type: Object,
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
forceUseOldCanvas: {
|
|
43
|
-
type: Boolean,
|
|
44
|
-
value: false,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
data: {
|
|
49
|
-
isUseNewCanvas: false,
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
ready: function () {
|
|
53
|
-
// Disable prograssive because drawImage doesn't support DOM as parameter
|
|
54
|
-
// See https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.drawImage.html
|
|
55
|
-
echarts.registerPreprocessor((option) => {
|
|
56
|
-
if (option && option.series) {
|
|
57
|
-
if (option.series.length > 0) {
|
|
58
|
-
option.series.forEach((series) => {
|
|
59
|
-
series.progressive = 0;
|
|
60
|
-
});
|
|
61
|
-
} else if (typeof option.series === 'object') {
|
|
62
|
-
option.series.progressive = 0;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
if (!this.data.ec) {
|
|
68
|
-
console.warn(
|
|
69
|
-
'组件需绑定 ec 变量,例:<ec-canvas id="mychart-dom-bar" ' +
|
|
70
|
-
'canvas-id="mychart-bar" ec="{{ ec }}"></ec-canvas>'
|
|
71
|
-
);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (!this.data.ec.lazyLoad) {
|
|
76
|
-
this.init();
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
methods: {
|
|
81
|
-
init: function (callback) {
|
|
82
|
-
const version = wx.getSystemInfoSync().SDKVersion;
|
|
83
|
-
|
|
84
|
-
const canUseNewCanvas = compareVersion(version, '2.9.0') >= 0;
|
|
85
|
-
const forceUseOldCanvas = this.data.forceUseOldCanvas;
|
|
86
|
-
const isUseNewCanvas = canUseNewCanvas && !forceUseOldCanvas;
|
|
87
|
-
this.setData({ isUseNewCanvas });
|
|
88
|
-
|
|
89
|
-
if (forceUseOldCanvas && canUseNewCanvas) {
|
|
90
|
-
console.warn('开发者强制使用旧canvas,建议关闭');
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (isUseNewCanvas) {
|
|
94
|
-
// console.log('微信基础库版本大于2.9.0,开始使用<canvas type="2d"/>');
|
|
95
|
-
// 2.9.0 可以使用 <canvas type="2d"></canvas>
|
|
96
|
-
this.initByNewWay(callback);
|
|
97
|
-
} else {
|
|
98
|
-
const isValid = compareVersion(version, '1.9.91') >= 0;
|
|
99
|
-
if (!isValid) {
|
|
100
|
-
console.error(
|
|
101
|
-
'微信基础库版本过低,需大于等于 1.9.91。' +
|
|
102
|
-
'参见:https://github.com/ecomfe/echarts-for-weixin' +
|
|
103
|
-
'#%E5%BE%AE%E4%BF%A1%E7%89%88%E6%9C%AC%E8%A6%81%E6%B1%82'
|
|
104
|
-
);
|
|
105
|
-
return;
|
|
106
|
-
} else {
|
|
107
|
-
console.warn(
|
|
108
|
-
'建议将微信基础库调整大于等于2.9.0版本。升级后绘图将有更好性能'
|
|
109
|
-
);
|
|
110
|
-
this.initByOldWay(callback);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
initByOldWay(callback) {
|
|
116
|
-
// 1.9.91 <= version < 2.9.0:原来的方式初始化
|
|
117
|
-
ctx = wx.createCanvasContext(this.data.canvasId, this);
|
|
118
|
-
const canvas = new WxCanvas(ctx, this.data.canvasId, false);
|
|
119
|
-
|
|
120
|
-
echarts.setCanvasCreator(() => {
|
|
121
|
-
return canvas;
|
|
122
|
-
});
|
|
123
|
-
// const canvasDpr = wx.getSystemInfoSync().pixelRatio // 微信旧的canvas不能传入dpr
|
|
124
|
-
const canvasDpr = 1;
|
|
125
|
-
var query = wx.createSelectorQuery().in(this);
|
|
126
|
-
query
|
|
127
|
-
.select('.ec-canvas')
|
|
128
|
-
.boundingClientRect(async (res) => {
|
|
129
|
-
if (typeof callback === 'function') {
|
|
130
|
-
this.chart = callback(canvas, res.width, res.height, canvasDpr);
|
|
131
|
-
} else if (
|
|
132
|
-
this.data.ec &&
|
|
133
|
-
typeof this.data.ec.onInit === 'function'
|
|
134
|
-
) {
|
|
135
|
-
this.chart = await this.data.ec.onInit(
|
|
136
|
-
canvas,
|
|
137
|
-
res.width,
|
|
138
|
-
res.height,
|
|
139
|
-
canvasDpr
|
|
140
|
-
);
|
|
141
|
-
} else {
|
|
142
|
-
this.triggerEvent('init', {
|
|
143
|
-
canvas: canvas,
|
|
144
|
-
width: res.width,
|
|
145
|
-
height: res.height,
|
|
146
|
-
canvasDpr: canvasDpr, // 增加了dpr,可方便外面echarts.init
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
})
|
|
150
|
-
.exec();
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
initByNewWay(callback) {
|
|
154
|
-
// version >= 2.9.0:使用新的方式初始化
|
|
155
|
-
const query = wx.createSelectorQuery().in(this);
|
|
156
|
-
query
|
|
157
|
-
.select('.ec-canvas')
|
|
158
|
-
.fields({ node: true, size: true })
|
|
159
|
-
.exec(async (res) => {
|
|
160
|
-
const canvasNode = res[0].node;
|
|
161
|
-
this.canvasNode = canvasNode;
|
|
162
|
-
|
|
163
|
-
const canvasDpr = wx.getSystemInfoSync().pixelRatio;
|
|
164
|
-
const canvasWidth = res[0].width;
|
|
165
|
-
const canvasHeight = res[0].height;
|
|
166
|
-
|
|
167
|
-
const ctx = canvasNode.getContext('2d');
|
|
168
|
-
|
|
169
|
-
const canvas = new WxCanvas(
|
|
170
|
-
ctx,
|
|
171
|
-
this.data.canvasId,
|
|
172
|
-
true,
|
|
173
|
-
canvasNode
|
|
174
|
-
);
|
|
175
|
-
echarts.setCanvasCreator(() => {
|
|
176
|
-
return canvas;
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
if (typeof callback === 'function') {
|
|
180
|
-
this.chart = callback(canvas, canvasWidth, canvasHeight, canvasDpr);
|
|
181
|
-
} else if (
|
|
182
|
-
this.data.ec &&
|
|
183
|
-
typeof this.data.ec.onInit === 'function'
|
|
184
|
-
) {
|
|
185
|
-
this.chart = await this.data.ec.onInit(
|
|
186
|
-
canvas,
|
|
187
|
-
canvasWidth,
|
|
188
|
-
canvasHeight,
|
|
189
|
-
canvasDpr
|
|
190
|
-
);
|
|
191
|
-
} else {
|
|
192
|
-
this.triggerEvent('init', {
|
|
193
|
-
canvas: canvas,
|
|
194
|
-
width: canvasWidth,
|
|
195
|
-
height: canvasHeight,
|
|
196
|
-
dpr: canvasDpr,
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
},
|
|
201
|
-
canvasToTempFilePath(opt) {
|
|
202
|
-
if (this.data.isUseNewCanvas) {
|
|
203
|
-
// 新版
|
|
204
|
-
const query = wx.createSelectorQuery().in(this);
|
|
205
|
-
query
|
|
206
|
-
.select('.ec-canvas')
|
|
207
|
-
.fields({ node: true, size: true })
|
|
208
|
-
.exec((res) => {
|
|
209
|
-
const canvasNode = res[0].node;
|
|
210
|
-
opt.canvas = canvasNode;
|
|
211
|
-
wx.canvasToTempFilePath(opt);
|
|
212
|
-
});
|
|
213
|
-
} else {
|
|
214
|
-
// 旧的
|
|
215
|
-
if (!opt.canvasId) {
|
|
216
|
-
opt.canvasId = this.data.canvasId;
|
|
217
|
-
}
|
|
218
|
-
ctx.draw(true, () => {
|
|
219
|
-
wx.canvasToTempFilePath(opt, this);
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
|
-
|
|
224
|
-
touchStart(e) {
|
|
225
|
-
if (this.chart && e.touches.length > 0) {
|
|
226
|
-
var touch = e.touches[0];
|
|
227
|
-
var handler = this.chart.getZr().handler;
|
|
228
|
-
handler.dispatch('mousedown', {
|
|
229
|
-
zrX: touch.x,
|
|
230
|
-
zrY: touch.y,
|
|
231
|
-
});
|
|
232
|
-
handler.dispatch('mousemove', {
|
|
233
|
-
zrX: touch.x,
|
|
234
|
-
zrY: touch.y,
|
|
235
|
-
});
|
|
236
|
-
handler.processGesture(wrapTouch(e), 'start');
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
|
|
240
|
-
touchMove(e) {
|
|
241
|
-
if (this.chart && e.touches.length > 0) {
|
|
242
|
-
var touch = e.touches[0];
|
|
243
|
-
var handler = this.chart.getZr().handler;
|
|
244
|
-
handler.dispatch('mousemove', {
|
|
245
|
-
zrX: touch.x,
|
|
246
|
-
zrY: touch.y,
|
|
247
|
-
});
|
|
248
|
-
handler.processGesture(wrapTouch(e), 'change');
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
touchEnd(e) {
|
|
253
|
-
if (this.chart) {
|
|
254
|
-
const touch = e.changedTouches ? e.changedTouches[0] : {};
|
|
255
|
-
var handler = this.chart.getZr().handler;
|
|
256
|
-
handler.dispatch('mouseup', {
|
|
257
|
-
zrX: touch.x,
|
|
258
|
-
zrY: touch.y,
|
|
259
|
-
});
|
|
260
|
-
handler.dispatch('click', {
|
|
261
|
-
zrX: touch.x,
|
|
262
|
-
zrY: touch.y,
|
|
263
|
-
});
|
|
264
|
-
handler.processGesture(wrapTouch(e), 'end');
|
|
265
|
-
}
|
|
266
|
-
},
|
|
267
|
-
},
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
function wrapTouch(event) {
|
|
271
|
-
for (let i = 0; i < event.touches.length; ++i) {
|
|
272
|
-
const touch = event.touches[i];
|
|
273
|
-
touch.offsetX = touch.x;
|
|
274
|
-
touch.offsetY = touch.y;
|
|
275
|
-
}
|
|
276
|
-
return event;
|
|
277
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<!-- 新的:接口对齐了H5 -->
|
|
2
|
-
<canvas wx:if="{{isUseNewCanvas}}" type="2d" class="ec-canvas" canvas-id="{{ canvasId }}" bindinit="init" bindtouchstart="{{ ec.disableTouch ? '' : 'touchStart' }}" bindtouchmove="{{ ec.disableTouch ? '' : 'touchMove' }}" bindtouchend="{{ ec.disableTouch ? '' : 'touchEnd' }}"></canvas>
|
|
3
|
-
<!-- 旧的 -->
|
|
4
|
-
<canvas wx:else class="ec-canvas" canvas-id="{{ canvasId }}" bindinit="init" bindtouchstart="{{ ec.disableTouch ? '' : 'touchStart' }}" bindtouchmove="{{ ec.disableTouch ? '' : 'touchMove' }}" bindtouchend="{{ ec.disableTouch ? '' : 'touchEnd' }}"></canvas>
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
class WxCanvas {
|
|
2
|
-
constructor(ctx, canvasId, isNew, canvasNode) {
|
|
3
|
-
this.ctx = ctx;
|
|
4
|
-
this.canvasId = canvasId;
|
|
5
|
-
this.chart = null;
|
|
6
|
-
this.isNew = isNew;
|
|
7
|
-
if (isNew) {
|
|
8
|
-
this.canvasNode = canvasNode;
|
|
9
|
-
} else {
|
|
10
|
-
this._initStyle(ctx);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// this._initCanvas(zrender, ctx);
|
|
14
|
-
|
|
15
|
-
this._initEvent();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
getContext(contextType) {
|
|
19
|
-
if (contextType === '2d') {
|
|
20
|
-
return this.ctx;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// canvasToTempFilePath(opt) {
|
|
25
|
-
// if (!opt.canvasId) {
|
|
26
|
-
// opt.canvasId = this.canvasId;
|
|
27
|
-
// }
|
|
28
|
-
// return wx.canvasToTempFilePath(opt, this);
|
|
29
|
-
// }
|
|
30
|
-
|
|
31
|
-
setChart(chart) {
|
|
32
|
-
this.chart = chart;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
attachEvent() {
|
|
36
|
-
// noop
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
detachEvent() {
|
|
40
|
-
// noop
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
_initCanvas(zrender, ctx) {
|
|
44
|
-
zrender.util.getContext = function () {
|
|
45
|
-
return ctx;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
zrender.util.$override('measureText', function (text, font) {
|
|
49
|
-
ctx.font = font || '12px sans-serif';
|
|
50
|
-
return ctx.measureText(text);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
_initStyle(ctx) {
|
|
55
|
-
ctx.createRadialGradient = () => {
|
|
56
|
-
return ctx.createCircularGradient(arguments);
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
_initEvent() {
|
|
61
|
-
this.event = {};
|
|
62
|
-
const eventNames = [
|
|
63
|
-
{
|
|
64
|
-
wxName: 'touchStart',
|
|
65
|
-
ecName: 'mousedown',
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
wxName: 'touchMove',
|
|
69
|
-
ecName: 'mousemove',
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
wxName: 'touchEnd',
|
|
73
|
-
ecName: 'mouseup',
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
wxName: 'touchEnd',
|
|
77
|
-
ecName: 'click',
|
|
78
|
-
},
|
|
79
|
-
];
|
|
80
|
-
|
|
81
|
-
eventNames.forEach((name) => {
|
|
82
|
-
this.event[name.wxName] = (e) => {
|
|
83
|
-
const touch = e.touches[0];
|
|
84
|
-
this.chart.getZr().handler.dispatch(name.ecName, {
|
|
85
|
-
zrX: name.wxName === 'tap' ? touch.clientX : touch.x,
|
|
86
|
-
zrY: name.wxName === 'tap' ? touch.clientY : touch.y,
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
set width(w) {
|
|
93
|
-
if (this.canvasNode) this.canvasNode.width = w;
|
|
94
|
-
}
|
|
95
|
-
set height(h) {
|
|
96
|
-
if (this.canvasNode) this.canvasNode.height = h;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
get width() {
|
|
100
|
-
if (this.canvasNode) return this.canvasNode.width;
|
|
101
|
-
return 0;
|
|
102
|
-
}
|
|
103
|
-
get height() {
|
|
104
|
-
if (this.canvasNode) return this.canvasNode.height;
|
|
105
|
-
return 0;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export default WxCanvas;
|
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import * as echarts from '../common/lib/echarts.min';
|
|
2
|
-
import EchartLine from '../common/core/eChartLine';
|
|
3
|
-
Component({
|
|
4
|
-
options: {
|
|
5
|
-
virtualHost: true,
|
|
6
|
-
multipleSlots: true,
|
|
7
|
-
},
|
|
8
|
-
properties: {
|
|
9
|
-
id: {
|
|
10
|
-
type: String,
|
|
11
|
-
value: '',
|
|
12
|
-
},
|
|
13
|
-
className: {
|
|
14
|
-
type: String,
|
|
15
|
-
value: '',
|
|
16
|
-
},
|
|
17
|
-
style: {
|
|
18
|
-
type: String,
|
|
19
|
-
value: '',
|
|
20
|
-
},
|
|
21
|
-
chartType: {
|
|
22
|
-
// 线条类型
|
|
23
|
-
type: String,
|
|
24
|
-
value: 'bight',
|
|
25
|
-
},
|
|
26
|
-
title: {
|
|
27
|
-
// 图表标题
|
|
28
|
-
type: String,
|
|
29
|
-
},
|
|
30
|
-
isTitle: {
|
|
31
|
-
// 是否显示标题
|
|
32
|
-
type: Boolean,
|
|
33
|
-
value: false,
|
|
34
|
-
},
|
|
35
|
-
titleLocation: {
|
|
36
|
-
type: String,
|
|
37
|
-
value: 'top',
|
|
38
|
-
},
|
|
39
|
-
dataSource: {
|
|
40
|
-
// 数据源
|
|
41
|
-
type: Object,
|
|
42
|
-
},
|
|
43
|
-
filterData: {
|
|
44
|
-
// 数据筛选
|
|
45
|
-
type: Array,
|
|
46
|
-
value: [],
|
|
47
|
-
},
|
|
48
|
-
xField: {
|
|
49
|
-
// x轴字段选择
|
|
50
|
-
type: Object,
|
|
51
|
-
value: {
|
|
52
|
-
format: '',
|
|
53
|
-
type: '', // 数据源字段 类型
|
|
54
|
-
title: '', // 字段名中文
|
|
55
|
-
name: '', // 字段名英文
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
xStatistics: {
|
|
59
|
-
// x轴统计维度
|
|
60
|
-
type: String,
|
|
61
|
-
value: '', // 统计纬度, 只有选择时间类型才有,y 年,m月,d 日,w周,h时,min 分,s秒
|
|
62
|
-
},
|
|
63
|
-
groupKey: {
|
|
64
|
-
// x轴字段选择
|
|
65
|
-
type: Object,
|
|
66
|
-
value: {
|
|
67
|
-
format: '',
|
|
68
|
-
type: '', // 数据源字段 类型
|
|
69
|
-
title: '', // 字段名中文
|
|
70
|
-
name: '', // 字段名英文
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
groupKeyTimeSpan: {
|
|
74
|
-
// x轴统计维度
|
|
75
|
-
type: String,
|
|
76
|
-
value: '', // 统计纬度, 只有选择时间类型才有,y 年,m月,d 日,w周,h时,min 分,s秒
|
|
77
|
-
},
|
|
78
|
-
xIsCountEmpty: {
|
|
79
|
-
// x轴 是否统计空值
|
|
80
|
-
type: Boolean,
|
|
81
|
-
value: false,
|
|
82
|
-
},
|
|
83
|
-
yField: {
|
|
84
|
-
// Y轴字段,分组字段,是否分组
|
|
85
|
-
type: Object,
|
|
86
|
-
value: {
|
|
87
|
-
numValue: [{ key: '', operationType: '' }],
|
|
88
|
-
groupKey: '',
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
isLegend: {
|
|
92
|
-
// 是否显示图例
|
|
93
|
-
type: Boolean,
|
|
94
|
-
value: false,
|
|
95
|
-
},
|
|
96
|
-
legend: {
|
|
97
|
-
// 图例
|
|
98
|
-
type: String,
|
|
99
|
-
value: 'bottom', // 左 left 右right, 上top,下 bottom
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
// 高级属性
|
|
103
|
-
isXaxisName: {
|
|
104
|
-
// 是否显示坐标轴名称
|
|
105
|
-
type: Boolean,
|
|
106
|
-
value: true,
|
|
107
|
-
},
|
|
108
|
-
xAxisName: {
|
|
109
|
-
// 是否显示坐标轴名称
|
|
110
|
-
type: String,
|
|
111
|
-
value: '',
|
|
112
|
-
},
|
|
113
|
-
isXaxisAxisLabelShow: {
|
|
114
|
-
// 是否显示标签
|
|
115
|
-
type: Boolean,
|
|
116
|
-
value: true,
|
|
117
|
-
},
|
|
118
|
-
isXaxisAxisTickShow: {
|
|
119
|
-
// 显示X轴刻度线
|
|
120
|
-
type: Boolean,
|
|
121
|
-
value: true,
|
|
122
|
-
},
|
|
123
|
-
isXaxisAxisLabelRotate: {
|
|
124
|
-
// 文字自动倾斜
|
|
125
|
-
type: Boolean,
|
|
126
|
-
value: false,
|
|
127
|
-
},
|
|
128
|
-
isYAxisShow: {
|
|
129
|
-
// 是否显示 Y 轴刻度线
|
|
130
|
-
type: Boolean,
|
|
131
|
-
value: true,
|
|
132
|
-
},
|
|
133
|
-
isYAxisName: {
|
|
134
|
-
// 是否显示 Y坐标轴名称
|
|
135
|
-
type: Boolean,
|
|
136
|
-
value: true,
|
|
137
|
-
},
|
|
138
|
-
isYAxisSplitlineLinestyleWidth: {
|
|
139
|
-
// 是否显示网格线 ,yAxis.splitLine.lineStyle.width设置为0
|
|
140
|
-
type: Boolean,
|
|
141
|
-
value: true,
|
|
142
|
-
},
|
|
143
|
-
yAxisSplitlineLinestyleType: {
|
|
144
|
-
// 网格线线条类型 solid,dashed,dotted
|
|
145
|
-
type: String,
|
|
146
|
-
value: 'dashed',
|
|
147
|
-
},
|
|
148
|
-
yAxisName: {
|
|
149
|
-
// Y坐标轴名称 显示名称后需要设置居中,轴线距离属性 yAxis.nameLocation='middle' yAxis.nameGap =20
|
|
150
|
-
type: String,
|
|
151
|
-
value: '',
|
|
152
|
-
},
|
|
153
|
-
yAxisMin: {
|
|
154
|
-
// Y轴刻度最小值
|
|
155
|
-
type: Number,
|
|
156
|
-
value: 0,
|
|
157
|
-
},
|
|
158
|
-
yAxisMax: {
|
|
159
|
-
// Y轴刻度最大值, 切记如果为0时,则不设置
|
|
160
|
-
type: Number,
|
|
161
|
-
value: 0,
|
|
162
|
-
},
|
|
163
|
-
isSeriesShowSymbol: {
|
|
164
|
-
// 是否显示数据标签 开启后 属性 series.label.show 要同时设置为true
|
|
165
|
-
type: Boolean,
|
|
166
|
-
value: true,
|
|
167
|
-
},
|
|
168
|
-
isUnit: {
|
|
169
|
-
// 显示单位
|
|
170
|
-
type: Boolean,
|
|
171
|
-
value: false,
|
|
172
|
-
},
|
|
173
|
-
unit: {
|
|
174
|
-
// 数字显示的单位 百分比,千分比,千,万,百万,亿,十亿
|
|
175
|
-
type: String,
|
|
176
|
-
value: '%',
|
|
177
|
-
},
|
|
178
|
-
decimalDigits: {
|
|
179
|
-
// 小数位数
|
|
180
|
-
type: Number,
|
|
181
|
-
value: 0,
|
|
182
|
-
},
|
|
183
|
-
suffix: {
|
|
184
|
-
// 后缀
|
|
185
|
-
type: String,
|
|
186
|
-
value: '',
|
|
187
|
-
},
|
|
188
|
-
},
|
|
189
|
-
data: {
|
|
190
|
-
ec: {},
|
|
191
|
-
canvas_id: {
|
|
192
|
-
type: String,
|
|
193
|
-
value: `canvas_line_${Date.now()}_${Math.random() * 100}`,
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
lifetimes: {
|
|
197
|
-
attached() {
|
|
198
|
-
// 在组件实例进入页面节点树时执行
|
|
199
|
-
this.initData();
|
|
200
|
-
},
|
|
201
|
-
detached() {
|
|
202
|
-
// 在组件实例被从页面节点树移除时执行
|
|
203
|
-
},
|
|
204
|
-
},
|
|
205
|
-
// 以下是旧式的定义方式,可以保持对 <2.2.3 版本基础库的兼容
|
|
206
|
-
attached() {
|
|
207
|
-
// 在组件实例进入页面节点树时执行
|
|
208
|
-
this.initData();
|
|
209
|
-
},
|
|
210
|
-
detached() {
|
|
211
|
-
// 在组件实例被从页面节点树移除时执行
|
|
212
|
-
},
|
|
213
|
-
methods: {
|
|
214
|
-
initData() {
|
|
215
|
-
this.setData({
|
|
216
|
-
ec: {
|
|
217
|
-
onInit: this.initChart.bind(this),
|
|
218
|
-
},
|
|
219
|
-
});
|
|
220
|
-
},
|
|
221
|
-
async initChart(canvas, width, height, dpr) {
|
|
222
|
-
const objEchart = echarts.init(canvas, null, {
|
|
223
|
-
width,
|
|
224
|
-
height,
|
|
225
|
-
devicePixelRatio: dpr,
|
|
226
|
-
});
|
|
227
|
-
canvas.setChart(objEchart);
|
|
228
|
-
const objEChartLine = new EchartLine();
|
|
229
|
-
await objEChartLine.setOptions(this.properties);
|
|
230
|
-
const options = await objEChartLine.getOptions();
|
|
231
|
-
// objEchart.clear();
|
|
232
|
-
console.log('设置前参数line', options);
|
|
233
|
-
objEchart.setOption(options);
|
|
234
|
-
this._chart = objEchart;
|
|
235
|
-
return objEchart;
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
observers: {
|
|
239
|
-
// 当参数变化时
|
|
240
|
-
'**': async function () {
|
|
241
|
-
const objEChartLine = new EchartLine();
|
|
242
|
-
await objEChartLine.setOptions(this.properties);
|
|
243
|
-
const options = objEChartLine.getOptions();
|
|
244
|
-
this._chart && this._chart.setOption(options);
|
|
245
|
-
},
|
|
246
|
-
},
|
|
247
|
-
});
|