@cloudbase/weda-ui 3.3.0 → 3.3.2
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 +281 -47
- package/dist/configs/components/chart/line.json +245 -48
- package/dist/configs/components/chart/pie.json +227 -42
- package/dist/configs/components/dataView.json +9 -1
- package/dist/configs/components/form/form.json +4 -0
- package/dist/configs/components/form/select.json +18 -0
- package/dist/docs/common/tableView.js +0 -3
- package/dist/setupTests.d.ts +2 -1
- package/dist/setupTests.js +6 -1
- package/dist/web/actions/showModal/index.js +0 -1
- package/dist/web/components/calendar/index.js +40 -38
- package/dist/web/components/carousel/index.js +62 -62
- package/dist/web/components/chart/bar/index.d.ts +2 -40
- package/dist/web/components/chart/bar/index.js +44 -55
- package/dist/{src/web → web}/components/chart/bar/index.old.d.ts +0 -0
- package/dist/{src/web → web}/components/chart/bar/index.old.js +0 -0
- package/dist/{src/web → web}/components/chart/common/Chart.d.ts +0 -0
- package/dist/{src/web → web}/components/chart/common/Chart.js +0 -0
- package/dist/{src/web → web}/components/chart/common/chart-custom-connector.d.ts +0 -0
- package/dist/{src/web → web}/components/chart/common/chart-custom-connector.js +0 -0
- package/dist/{src/web → web}/components/chart/common/chart-error.d.ts +0 -0
- package/dist/{src/web → web}/components/chart/common/chart-error.js +0 -0
- package/dist/web/components/chart/common/core/eChartBar.d.ts +1 -3
- package/dist/web/components/chart/common/core/eChartBar.js +6 -3
- package/dist/web/components/chart/common/core/eChartBase.d.ts +2 -3
- package/dist/web/components/chart/common/core/eChartBase.js +47 -5
- package/dist/web/components/chart/common/core/eChartLine.d.ts +1 -3
- package/dist/web/components/chart/common/core/eChartLine.js +6 -3
- package/dist/web/components/chart/common/core/eChartPie.d.ts +1 -3
- package/dist/web/components/chart/common/core/eChartPie.js +6 -3
- package/dist/{src/web → web}/components/chart/common/data-transform.d.ts +0 -0
- package/dist/{src/web → web}/components/chart/common/data-transform.js +0 -0
- package/dist/web/components/chart/common/echarts.d.ts +3 -0
- package/dist/web/components/chart/common/useChart.js +23 -11
- package/dist/web/components/chart/line/index.d.ts +2 -38
- package/dist/web/components/chart/line/index.js +41 -52
- package/dist/{src/web → web}/components/chart/line/index.old.d.ts +0 -0
- package/dist/{src/web → web}/components/chart/line/index.old.js +0 -0
- package/dist/web/components/chart/pie/index.d.ts +2 -26
- package/dist/web/components/chart/pie/index.js +41 -39
- package/dist/{src/web → web}/components/chart/pie/index.old.d.ts +0 -0
- package/dist/{src/web → web}/components/chart/pie/index.old.js +0 -0
- package/dist/{src/web → web}/components/common/error-boundary.d.ts +0 -0
- package/dist/{src/web → web}/components/common/error-boundary.js +0 -0
- package/dist/{src/web → web}/components/common/portal.d.ts +0 -0
- package/dist/{src/web → web}/components/common/portal.js +0 -0
- package/dist/{src/web → web}/components/common/use-loop-render-detect.d.ts +0 -0
- package/dist/{src/web → web}/components/common/use-loop-render-detect.js +0 -0
- package/dist/web/components/form/checkbox/index.js +29 -29
- package/dist/web/components/form/enumSelect/MultipleSelect.d.ts +2 -2
- package/dist/web/components/form/enumSelect/NormalSelect.d.ts +2 -2
- package/dist/web/components/form/enumSelect/index.d.ts +2 -2
- package/dist/web/components/form/enumSelect/props/propsTypes.d.ts +2 -2
- package/dist/web/components/form/form/index.js +46 -0
- package/dist/web/components/form/input/index.js +13 -5
- package/dist/web/components/form/location/common/mapChoose.js +7 -6
- package/dist/web/components/form/location/common/mapView.js +9 -6
- package/dist/web/components/form/location/common/propsConfig.d.ts +1 -1
- package/dist/{src/web → web}/components/form/location/common/tmap.d.ts +0 -0
- package/dist/{src/web → web}/components/form/location/common/tmap.js +0 -0
- package/dist/web/components/form/location/common/useLocationInfo.d.ts +1 -1
- package/dist/web/components/form/location/common/useLocationInfo.js +3 -2
- package/dist/web/components/form/location/components/LocationH5/location.h5.js +6 -3
- package/dist/web/components/form/location/components/LocationPC/location.PC.js +5 -1
- package/dist/web/components/form/location/index.js +7 -0
- package/dist/web/components/form/radio/index.js +3 -3
- package/dist/{src/web → web}/components/form/select/allTimePicker/calendar.d.ts +0 -0
- package/dist/{src/web → web}/components/form/select/allTimePicker/calendar.js +0 -0
- package/dist/{src/web → web}/components/form/select/allTimePicker/dataUtils.d.ts +0 -0
- package/dist/{src/web → web}/components/form/select/allTimePicker/dataUtils.js +0 -0
- package/dist/{src/web → web}/components/form/select/allTimePicker/index.d.ts +0 -0
- package/dist/{src/web → web}/components/form/select/allTimePicker/index.js +0 -0
- package/dist/web/components/form/select/h5.d.ts +1 -1
- package/dist/web/components/form/select/h5.js +63 -7
- package/dist/web/components/form/select/index.d.ts +3 -2
- package/dist/web/components/form/select/index.js +25 -2
- package/dist/web/components/form/select/use-options.js +1 -1
- package/dist/web/components/form/select/year.js +1 -1
- package/dist/web/components/form/switch/index.js +2 -2
- package/dist/web/components/form/textarea/index.js +1 -1
- package/dist/web/components/form/uploader/uploader.h5.js +17 -42
- package/dist/web/components/form/uploader/uploader.pc.js +22 -28
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +18 -25
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +12 -23
- package/dist/web/components/form/userOrgSelect/comTool.d.ts +1 -0
- package/dist/web/components/form/userOrgSelect/comTool.js +25 -13
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +2 -3
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +65 -64
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +2 -2
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +41 -37
- package/dist/{src/web → web}/components/form/userOrgSelect/getUserService.d.ts +0 -0
- package/dist/{src/web → web}/components/form/userOrgSelect/getUserService.js +0 -0
- package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +7 -4
- package/dist/web/components/form/userOrgSelect/userTreeSelect.h5.js +62 -58
- package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +4 -4
- package/dist/web/components/form/userOrgSelect/userTreeSelect.pc.js +133 -109
- package/dist/web/components/form/userOrgSelect/utils.d.ts +3 -2
- package/dist/web/components/form/userOrgSelect/utils.js +24 -16
- package/dist/web/components/formdetail/index.js +14 -11
- package/dist/web/components/graphicCard/index.d.ts +16 -1
- package/dist/web/components/graphicCard/index.js +42 -30
- package/dist/web/components/image/index.js +4 -18
- package/dist/web/components/index.js +3 -1
- package/dist/web/components/listView/index.js +20 -9
- package/dist/web/components/lottery/index.js +10 -16
- package/dist/web/components/lottery/lotteryUtil.js +1 -1
- package/dist/web/components/modal/index.js +1 -1
- package/dist/web/components/navLayout/index.d.ts +16 -1
- package/dist/web/components/navLayout/index.js +31 -20
- package/dist/web/components/navigationBar/horizontalMenu.js +1 -1
- package/dist/web/components/navigationBar/index.js +13 -8
- package/dist/web/components/richText/index.js +1 -2
- package/dist/web/components/richTextView/index.js +20 -18
- package/dist/web/components/scrollView/index.d.ts +1 -2
- package/dist/web/components/scrollView/index.js +7 -5
- package/dist/web/components/swiper/index.js +62 -62
- package/dist/web/components/tabs/index.js +6 -1
- package/dist/web/components/tabs/tabs.h5.js +2 -0
- package/dist/web/components/text/index.js +10 -8
- package/dist/web/components/uploaderFileView/index.js +3 -18
- package/dist/web/components/uploaderView/index.js +1 -1
- package/dist/web/components/wedaVideo/index.js +21 -25
- package/dist/{src/web → web}/utils/console.d.ts +0 -0
- package/dist/{src/web → web}/utils/console.js +0 -0
- package/dist/web/utils/platform.js +1 -1
- package/dist/web/utils/tcb.d.ts +12 -6
- package/dist/web/utils/tcb.js +13 -0
- package/dist/web/utils/use-cloud-id-temp-url.js +3 -1
- package/dist/web/utils/useSyncValue.js +1 -0
- package/package.json +1 -1
- package/dist/cypress/support/commands.d.ts +0 -1
- package/dist/cypress/support/commands.js +0 -40
- package/dist/cypress/support/e2e.d.ts +0 -24
- package/dist/cypress/support/e2e.js +0 -22
- package/dist/src/configs/actions/showModal.json +0 -48
- package/dist/src/configs/actions/showToast.json +0 -41
- package/dist/src/configs/components/auth.json +0 -16
- package/dist/src/configs/components/button.json +0 -239
- package/dist/src/configs/components/calendar.json +0 -81
- package/dist/src/configs/components/carousel.json +0 -292
- package/dist/src/configs/components/chart/bar.json +0 -962
- package/dist/src/configs/components/chart/line.json +0 -878
- package/dist/src/configs/components/chart/pie.json +0 -685
- package/dist/src/configs/components/chart/statisticsCard.json +0 -376
- package/dist/src/configs/components/container.json +0 -50
- package/dist/src/configs/components/dataView.json +0 -247
- package/dist/src/configs/components/drawer.json +0 -115
- package/dist/src/configs/components/form/checkbox.json +0 -179
- package/dist/src/configs/components/form/departTreeSelect.json +0 -124
- package/dist/src/configs/components/form/form.json +0 -73
- package/dist/src/configs/components/form/input.json +0 -154
- package/dist/src/configs/components/form/location.json +0 -216
- package/dist/src/configs/components/form/radio.json +0 -203
- package/dist/src/configs/components/form/richText.json +0 -133
- package/dist/src/configs/components/form/select.json +0 -449
- package/dist/src/configs/components/form/switch.json +0 -58
- package/dist/src/configs/components/form/textarea.json +0 -116
- package/dist/src/configs/components/form/tips.json +0 -34
- package/dist/src/configs/components/form/uploader.json +0 -171
- package/dist/src/configs/components/form/uploaderFile.json +0 -158
- package/dist/src/configs/components/form/userTreeSelect.json +0 -128
- package/dist/src/configs/components/formdetail.json +0 -105
- package/dist/src/configs/components/graphicCard.json +0 -413
- package/dist/src/configs/components/image.json +0 -187
- package/dist/src/configs/components/link.json +0 -79
- package/dist/src/configs/components/listView.json +0 -378
- package/dist/src/configs/components/lottery.json +0 -163
- package/dist/src/configs/components/modal.json +0 -72
- package/dist/src/configs/components/navLayout.json +0 -368
- package/dist/src/configs/components/navigationBar.json +0 -62
- package/dist/src/configs/components/richtextview.json +0 -26
- package/dist/src/configs/components/scrollVeiw.json +0 -253
- package/dist/src/configs/components/slot.json +0 -17
- package/dist/src/configs/components/swiper.json +0 -90
- package/dist/src/configs/components/tabs.json +0 -122
- package/dist/src/configs/components/text.json +0 -95
- package/dist/src/configs/components/wedaVideo.json +0 -89
- package/dist/src/configs/components/wxOpenApi/phone.json +0 -127
- package/dist/src/configs/components/wxOpenApi/phoneCode.json +0 -109
- package/dist/src/configs/components/wxOpenApi/share.json +0 -160
- package/dist/src/configs/components/wxOpenApi/userInfo.json +0 -156
- package/dist/src/configs/index.d.ts +0 -103
- package/dist/src/configs/index.js +0 -111
- package/dist/src/docs/common/format.d.ts +0 -13
- package/dist/src/docs/common/format.js +0 -122
- package/dist/src/docs/common/tableView.d.ts +0 -30
- package/dist/src/docs/common/tableView.js +0 -156
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.js +0 -3
- package/dist/src/setupTests.d.ts +0 -2
- package/dist/src/setupTests.js +0 -19
- package/dist/src/web/actions/index.d.ts +0 -2
- package/dist/src/web/actions/index.js +0 -2
- package/dist/src/web/actions/showModal/index.d.ts +0 -4
- package/dist/src/web/actions/showModal/index.js +0 -66
- package/dist/src/web/actions/showToast/index.d.ts +0 -1
- package/dist/src/web/actions/showToast/index.js +0 -3
- package/dist/src/web/components/button/index.d.ts +0 -32
- package/dist/src/web/components/button/index.js +0 -48
- package/dist/src/web/components/calendar/index.d.ts +0 -19
- package/dist/src/web/components/calendar/index.js +0 -191
- package/dist/src/web/components/calendar/util.d.ts +0 -13
- package/dist/src/web/components/calendar/util.js +0 -74
- package/dist/src/web/components/carousel/index.d.ts +0 -41
- package/dist/src/web/components/carousel/index.js +0 -244
- package/dist/src/web/components/chart/bar/index.d.ts +0 -3
- package/dist/src/web/components/chart/bar/index.js +0 -45
- package/dist/src/web/components/chart/common/config/bar.d.ts +0 -48
- package/dist/src/web/components/chart/common/config/bar.js +0 -49
- package/dist/src/web/components/chart/common/config/global.d.ts +0 -13
- package/dist/src/web/components/chart/common/config/global.js +0 -16
- package/dist/src/web/components/chart/common/config/line.d.ts +0 -46
- package/dist/src/web/components/chart/common/config/line.js +0 -49
- package/dist/src/web/components/chart/common/config/pie.d.ts +0 -29
- package/dist/src/web/components/chart/common/config/pie.js +0 -36
- package/dist/src/web/components/chart/common/core/eChartBar.d.ts +0 -66
- package/dist/src/web/components/chart/common/core/eChartBar.js +0 -201
- package/dist/src/web/components/chart/common/core/eChartBase.d.ts +0 -127
- package/dist/src/web/components/chart/common/core/eChartBase.js +0 -394
- package/dist/src/web/components/chart/common/core/eChartLine.d.ts +0 -60
- package/dist/src/web/components/chart/common/core/eChartLine.js +0 -173
- package/dist/src/web/components/chart/common/core/eChartPie.d.ts +0 -48
- package/dist/src/web/components/chart/common/core/eChartPie.js +0 -135
- package/dist/src/web/components/chart/common/core/type.d.ts +0 -35
- package/dist/src/web/components/chart/common/core/type.js +0 -9
- package/dist/src/web/components/chart/common/echarts.d.ts +0 -5
- package/dist/src/web/components/chart/common/echarts.js +0 -24
- 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/src/web/components/chart/common/useChart.d.ts +0 -8
- package/dist/src/web/components/chart/common/useChart.js +0 -72
- package/dist/src/web/components/chart/line/index.d.ts +0 -3
- package/dist/src/web/components/chart/line/index.js +0 -42
- package/dist/src/web/components/chart/pie/index.d.ts +0 -3
- package/dist/src/web/components/chart/pie/index.js +0 -42
- package/dist/src/web/components/chart/statisticsCard/index.d.ts +0 -85
- package/dist/src/web/components/chart/statisticsCard/index.js +0 -203
- package/dist/src/web/components/chart/statisticsCard/interface.d.ts +0 -13
- package/dist/src/web/components/chart/statisticsCard/interface.js +0 -1
- package/dist/src/web/components/container/index.d.ts +0 -6
- package/dist/src/web/components/container/index.js +0 -6
- package/dist/src/web/components/dataView/index.d.ts +0 -6
- package/dist/src/web/components/dataView/index.js +0 -8
- package/dist/src/web/components/dataView/interface.d.ts +0 -5
- package/dist/src/web/components/dataView/interface.js +0 -1
- package/dist/src/web/components/drawer/index.d.ts +0 -13
- package/dist/src/web/components/drawer/index.js +0 -12
- package/dist/src/web/components/form/checkbox/index.d.ts +0 -13
- package/dist/src/web/components/form/checkbox/index.js +0 -167
- package/dist/src/web/components/form/enumSelect/MultipleSelect.d.ts +0 -78
- package/dist/src/web/components/form/enumSelect/MultipleSelect.js +0 -52
- package/dist/src/web/components/form/enumSelect/NormalSelect.d.ts +0 -83
- package/dist/src/web/components/form/enumSelect/NormalSelect.js +0 -52
- package/dist/src/web/components/form/enumSelect/SelectContainer.d.ts +0 -16
- package/dist/src/web/components/form/enumSelect/SelectContainer.js +0 -30
- package/dist/src/web/components/form/enumSelect/index.d.ts +0 -82
- package/dist/src/web/components/form/enumSelect/index.js +0 -6
- package/dist/src/web/components/form/enumSelect/props/defaultProps.d.ts +0 -34
- package/dist/src/web/components/form/enumSelect/props/defaultProps.js +0 -40
- package/dist/src/web/components/form/enumSelect/props/propsTypes.d.ts +0 -39
- package/dist/src/web/components/form/enumSelect/props/propsTypes.js +0 -47
- package/dist/src/web/components/form/form/index.d.ts +0 -32
- package/dist/src/web/components/form/form/index.js +0 -150
- package/dist/src/web/components/form/formcell/index.d.ts +0 -8
- package/dist/src/web/components/form/formcell/index.js +0 -40
- package/dist/src/web/components/form/input/index.d.ts +0 -14
- package/dist/src/web/components/form/input/index.js +0 -94
- package/dist/src/web/components/form/location/common/mapChoose.d.ts +0 -15
- package/dist/src/web/components/form/location/common/mapChoose.js +0 -496
- package/dist/src/web/components/form/location/common/mapView.d.ts +0 -19
- package/dist/src/web/components/form/location/common/mapView.js +0 -175
- package/dist/src/web/components/form/location/common/propsConfig.d.ts +0 -59
- package/dist/src/web/components/form/location/common/propsConfig.js +0 -50
- package/dist/src/web/components/form/location/common/selectModal.d.ts +0 -21
- package/dist/src/web/components/form/location/common/selectModal.js +0 -44
- package/dist/src/web/components/form/location/common/useLocationInfo.d.ts +0 -36
- package/dist/src/web/components/form/location/common/useLocationInfo.js +0 -105
- package/dist/src/web/components/form/location/components/LocationH5/location.h5.d.ts +0 -8
- package/dist/src/web/components/form/location/components/LocationH5/location.h5.js +0 -328
- package/dist/src/web/components/form/location/components/LocationPC/Header.d.ts +0 -12
- package/dist/src/web/components/form/location/components/LocationPC/Header.js +0 -43
- package/dist/src/web/components/form/location/components/LocationPC/location.PC.d.ts +0 -8
- package/dist/src/web/components/form/location/components/LocationPC/location.PC.js +0 -228
- package/dist/src/web/components/form/location/constants.d.ts +0 -2
- package/dist/src/web/components/form/location/constants.js +0 -3
- package/dist/src/web/components/form/location/index.d.ts +0 -1
- package/dist/src/web/components/form/location/index.js +0 -24
- package/dist/src/web/components/form/radio/index.d.ts +0 -11
- package/dist/src/web/components/form/radio/index.js +0 -115
- package/dist/src/web/components/form/renderDecorator.d.ts +0 -6
- package/dist/src/web/components/form/renderDecorator.js +0 -20
- package/dist/src/web/components/form/select/dropdown-select/ui.d.ts +0 -15
- package/dist/src/web/components/form/select/dropdown-select/ui.js +0 -55
- package/dist/src/web/components/form/select/h5.d.ts +0 -16
- package/dist/src/web/components/form/select/h5.js +0 -466
- package/dist/src/web/components/form/select/index.d.ts +0 -66
- package/dist/src/web/components/form/select/index.js +0 -255
- package/dist/src/web/components/form/select/region/index.d.ts +0 -6
- package/dist/src/web/components/form/select/region/index.js +0 -147
- package/dist/src/web/components/form/select/time.d.ts +0 -9
- package/dist/src/web/components/form/select/time.js +0 -146
- package/dist/src/web/components/form/select/use-options.d.ts +0 -26
- package/dist/src/web/components/form/select/use-options.js +0 -103
- package/dist/src/web/components/form/select/year.d.ts +0 -7
- package/dist/src/web/components/form/select/year.js +0 -72
- package/dist/src/web/components/form/switch/index.d.ts +0 -6
- package/dist/src/web/components/form/switch/index.js +0 -58
- package/dist/src/web/components/form/textarea/index.d.ts +0 -12
- package/dist/src/web/components/form/textarea/index.js +0 -66
- package/dist/src/web/components/form/tips/index.d.ts +0 -8
- package/dist/src/web/components/form/tips/index.js +0 -17
- package/dist/src/web/components/form/uploader/index.d.ts +0 -3
- package/dist/src/web/components/form/uploader/index.js +0 -42
- package/dist/src/web/components/form/uploader/uploader.h5.d.ts +0 -20
- package/dist/src/web/components/form/uploader/uploader.h5.js +0 -199
- package/dist/src/web/components/form/uploader/uploader.pc.d.ts +0 -29
- package/dist/src/web/components/form/uploader/uploader.pc.js +0 -208
- package/dist/src/web/components/form/uploaderFile/index.d.ts +0 -4
- package/dist/src/web/components/form/uploaderFile/index.js +0 -19
- package/dist/src/web/components/form/uploaderFile/uploadFile.h5.d.ts +0 -23
- package/dist/src/web/components/form/uploaderFile/uploadFile.h5.js +0 -330
- package/dist/src/web/components/form/uploaderFile/uploadFile.pc.d.ts +0 -24
- package/dist/src/web/components/form/uploaderFile/uploadFile.pc.js +0 -302
- package/dist/src/web/components/form/userOrgSelect/comTool.d.ts +0 -8
- package/dist/src/web/components/form/userOrgSelect/comTool.js +0 -101
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.d.ts +0 -19
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +0 -252
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.d.ts +0 -4
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.pc.js +0 -157
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.d.ts +0 -2
- package/dist/src/web/components/form/userOrgSelect/departTreeSelect/index.js +0 -17
- package/dist/src/web/components/form/userOrgSelect/index.d.ts +0 -2
- package/dist/src/web/components/form/userOrgSelect/index.js +0 -17
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.d.ts +0 -27
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.h5.js +0 -276
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.d.ts +0 -9
- package/dist/src/web/components/form/userOrgSelect/userTreeSelect.pc.js +0 -253
- package/dist/src/web/components/form/userOrgSelect/utils.d.ts +0 -36
- package/dist/src/web/components/form/userOrgSelect/utils.js +0 -80
- package/dist/src/web/components/formdetail/index.d.ts +0 -28
- package/dist/src/web/components/formdetail/index.js +0 -173
- package/dist/src/web/components/graphicCard/index.d.ts +0 -46
- package/dist/src/web/components/graphicCard/index.js +0 -178
- package/dist/src/web/components/image/image.d.ts +0 -9
- package/dist/src/web/components/image/image.js +0 -119
- package/dist/src/web/components/image/index.d.ts +0 -13
- package/dist/src/web/components/image/index.js +0 -77
- package/dist/src/web/components/index.d.ts +0 -50
- package/dist/src/web/components/index.js +0 -99
- package/dist/src/web/components/link/index.d.ts +0 -24
- package/dist/src/web/components/link/index.js +0 -71
- package/dist/src/web/components/listView/index.d.ts +0 -7
- package/dist/src/web/components/listView/index.js +0 -297
- package/dist/src/web/components/listView/interface.d.ts +0 -127
- package/dist/src/web/components/listView/interface.js +0 -1
- package/dist/src/web/components/lottery/index.d.ts +0 -22
- package/dist/src/web/components/lottery/index.js +0 -385
- package/dist/src/web/components/lottery/lotteryUtil.d.ts +0 -23
- package/dist/src/web/components/lottery/lotteryUtil.js +0 -181
- package/dist/src/web/components/modal/index.d.ts +0 -17
- package/dist/src/web/components/modal/index.js +0 -11
- package/dist/src/web/components/modal/modal.h5.d.ts +0 -4
- package/dist/src/web/components/modal/modal.h5.js +0 -46
- package/dist/src/web/components/modal/modal.pc.d.ts +0 -3
- package/dist/src/web/components/modal/modal.pc.js +0 -31
- package/dist/src/web/components/navLayout/index.d.ts +0 -61
- package/dist/src/web/components/navLayout/index.js +0 -127
- package/dist/src/web/components/navigationBar/common.d.ts +0 -15
- package/dist/src/web/components/navigationBar/common.js +0 -127
- package/dist/src/web/components/navigationBar/h5Menu.d.ts +0 -14
- package/dist/src/web/components/navigationBar/h5Menu.js +0 -72
- package/dist/src/web/components/navigationBar/horizontalMenu.d.ts +0 -12
- package/dist/src/web/components/navigationBar/horizontalMenu.js +0 -99
- package/dist/src/web/components/navigationBar/index.d.ts +0 -13
- package/dist/src/web/components/navigationBar/index.js +0 -157
- package/dist/src/web/components/navigationBar/verticalMenu.d.ts +0 -13
- package/dist/src/web/components/navigationBar/verticalMenu.js +0 -38
- package/dist/src/web/components/phone/index.d.ts +0 -18
- package/dist/src/web/components/phone/index.js +0 -4
- package/dist/src/web/components/phoneCode/index.d.ts +0 -18
- package/dist/src/web/components/phoneCode/index.js +0 -4
- package/dist/src/web/components/picker/datePicker.d.ts +0 -10
- package/dist/src/web/components/picker/datePicker.js +0 -31
- package/dist/src/web/components/picker/picker.d.ts +0 -6
- package/dist/src/web/components/picker/picker.js +0 -45
- package/dist/src/web/components/picker/timePicker.d.ts +0 -7
- package/dist/src/web/components/picker/timePicker.js +0 -42
- package/dist/src/web/components/richText/const.d.ts +0 -1
- package/dist/src/web/components/richText/const.js +0 -2
- package/dist/src/web/components/richText/index.d.ts +0 -50
- package/dist/src/web/components/richText/index.js +0 -351
- package/dist/src/web/components/richTextView/index.d.ts +0 -7
- package/dist/src/web/components/richTextView/index.js +0 -46
- package/dist/src/web/components/scrollView/index.d.ts +0 -26
- package/dist/src/web/components/scrollView/index.js +0 -97
- package/dist/src/web/components/share/index.d.ts +0 -34
- package/dist/src/web/components/share/index.js +0 -4
- package/dist/src/web/components/slot/index.d.ts +0 -6
- package/dist/src/web/components/slot/index.js +0 -9
- package/dist/src/web/components/swiper/index.d.ts +0 -24
- package/dist/src/web/components/swiper/index.js +0 -153
- package/dist/src/web/components/tabs/index.d.ts +0 -13
- package/dist/src/web/components/tabs/index.js +0 -20
- package/dist/src/web/components/tabs/tabs.h5.d.ts +0 -4
- package/dist/src/web/components/tabs/tabs.h5.js +0 -44
- package/dist/src/web/components/tabs/tabs.pc.d.ts +0 -3
- package/dist/src/web/components/tabs/tabs.pc.js +0 -40
- package/dist/src/web/components/text/index.d.ts +0 -14
- package/dist/src/web/components/text/index.js +0 -19
- package/dist/src/web/components/uploaderFileView/index.d.ts +0 -10
- package/dist/src/web/components/uploaderFileView/index.js +0 -46
- package/dist/src/web/components/uploaderView/index.d.ts +0 -17
- package/dist/src/web/components/uploaderView/index.js +0 -48
- package/dist/src/web/components/userInfo/index.d.ts +0 -26
- package/dist/src/web/components/userInfo/index.js +0 -4
- package/dist/src/web/components/wedaVideo/index.d.ts +0 -17
- package/dist/src/web/components/wedaVideo/index.js +0 -156
- package/dist/src/web/index.d.ts +0 -8
- package/dist/src/web/index.js +0 -4
- package/dist/src/web/utils/classnames.d.ts +0 -2
- package/dist/src/web/utils/classnames.js +0 -37
- package/dist/src/web/utils/constant.d.ts +0 -23
- package/dist/src/web/utils/constant.js +0 -24
- package/dist/src/web/utils/debounce.d.ts +0 -2
- package/dist/src/web/utils/debounce.js +0 -92
- package/dist/src/web/utils/getLocalCounter.d.ts +0 -1
- package/dist/src/web/utils/getLocalCounter.js +0 -4
- package/dist/src/web/utils/getUserService.d.ts +0 -11
- package/dist/src/web/utils/getUserService.js +0 -156
- package/dist/src/web/utils/isObjectEqual.d.ts +0 -2
- package/dist/src/web/utils/isObjectEqual.js +0 -12
- package/dist/src/web/utils/loading-fallback.d.ts +0 -2
- package/dist/src/web/utils/loading-fallback.js +0 -2
- package/dist/src/web/utils/lodash.d.ts +0 -1
- package/dist/src/web/utils/lodash.js +0 -2
- package/dist/src/web/utils/platform.d.ts +0 -18
- package/dist/src/web/utils/platform.js +0 -193
- package/dist/src/web/utils/tcb.d.ts +0 -33
- package/dist/src/web/utils/tcb.js +0 -118
- package/dist/src/web/utils/tmap.d.ts +0 -3
- package/dist/src/web/utils/tmap.js +0 -21
- package/dist/src/web/utils/use-cloud-id-temp-url.d.ts +0 -1
- package/dist/src/web/utils/use-cloud-id-temp-url.js +0 -15
- package/dist/src/web/utils/useSetState.d.ts +0 -1
- package/dist/src/web/utils/useSetState.js +0 -8
- package/dist/src/web/utils/useSyncValue.d.ts +0 -4
- package/dist/src/web/utils/useSyncValue.js +0 -16
- package/dist/src/web/utils/weui.d.ts +0 -1
- package/dist/src/web/utils/weui.js +0 -2
- package/dist/web/components/form/userOrgSelect/userOrgSelect.less +0 -643
- package/dist/web/utils/getUserService.d.ts +0 -17
- package/dist/web/utils/getUserService.js +0 -148
- package/dist/web/utils/tmap.d.ts +0 -3
- package/dist/web/utils/tmap.js +0 -21
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
1
|
+
import React, { useState, useEffect, useCallback } from 'react';
|
|
2
2
|
import { emptyObject } from '../../../../utils/constant';
|
|
3
3
|
import { renderDecorator } from '../../renderDecorator';
|
|
4
4
|
import { IconFont } from 'tdesign-icons-react';
|
|
5
5
|
import classNames from '../../../../utils/classnames';
|
|
6
|
-
import { getDepartById, defaultRequest
|
|
6
|
+
import { getDepartById, defaultRequest } from '../getUserService';
|
|
7
7
|
import { dealOrgData } from '../utils';
|
|
8
8
|
import { Modal, Button, ConfigProvider, Radio, Status } from 'tea-component';
|
|
9
9
|
import isObjectEqual from '../../../../utils/isObjectEqual';
|
|
10
|
-
import '../userOrgSelect.
|
|
11
|
-
import { ErrorStatus } from '../comTool';
|
|
12
|
-
export function DepartTreeSelectH5({ id, className, style, events = emptyObject, label = '部门选择', labelVisible = true, name = 'formDepartTreeSelect', placeholder = '请选择部门', defaultValueType = 'noneDepart', defaultValue = '', confirmValue = '', disabled = false, layout = 'horizontal', requiredFlag = false, size = 'l', decorator, request = defaultRequest,
|
|
10
|
+
import '../userOrgSelect.css';
|
|
11
|
+
import { ErrorStatus, ModalSearch } from '../comTool';
|
|
12
|
+
export function DepartTreeSelectH5({ id, className, style, events = emptyObject, label = '部门选择', labelVisible = true, name = 'formDepartTreeSelect', placeholder = '请选择部门', defaultValueType = 'noneDepart', defaultValue = '', confirmValue = '', disabled = false, layout = 'horizontal', requiredFlag = false, size = 'l', decorator, request = defaultRequest, onChange = null, focus: autoFocus = false, }) {
|
|
13
13
|
const cls = classNames({
|
|
14
14
|
'weda-ui': true,
|
|
15
15
|
'weda-select-user-dept': true,
|
|
@@ -33,10 +33,26 @@ export function DepartTreeSelectH5({ id, className, style, events = emptyObject,
|
|
|
33
33
|
const [selectItem, setSelectItem] = useState(null);
|
|
34
34
|
const [searchValue, setSearchValue] = useState('');
|
|
35
35
|
const [loading, setLoading] = useState({ id: null, status: false });
|
|
36
|
+
const [titleText, setTitleText] = useState('');
|
|
36
37
|
const [errorInfo, setErrorInfo] = useState({
|
|
37
38
|
errorStatus: false,
|
|
38
39
|
errorMessage: null,
|
|
39
40
|
});
|
|
41
|
+
// 初始化数据
|
|
42
|
+
const initOrgsData = useCallback(async () => {
|
|
43
|
+
try {
|
|
44
|
+
setTitleText('选择部门');
|
|
45
|
+
const resData = (await request('InitRootOrgs', {})) || [];
|
|
46
|
+
const data = dealOrgData(resData);
|
|
47
|
+
//初始化数据时,默认返回第一层组织结构
|
|
48
|
+
setCount(1);
|
|
49
|
+
setOrgsTreeData(data);
|
|
50
|
+
setOriginalOrgData([{ index: 1, treeData: data, title: '选择部门' }]);
|
|
51
|
+
}
|
|
52
|
+
catch (e) {
|
|
53
|
+
setErrorInfo({ errorStatus: true, errorMessage: e });
|
|
54
|
+
}
|
|
55
|
+
}, [request]);
|
|
40
56
|
const handleFocus = (value) => {
|
|
41
57
|
setIsSearch(value);
|
|
42
58
|
};
|
|
@@ -53,7 +69,7 @@ export function DepartTreeSelectH5({ id, className, style, events = emptyObject,
|
|
|
53
69
|
const sValue = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value;
|
|
54
70
|
setSearchValue(sValue);
|
|
55
71
|
if (sValue) {
|
|
56
|
-
const {
|
|
72
|
+
const { Orgs = [] } = await request('SearchByCondition', {
|
|
57
73
|
KeyWords: sValue.trim(),
|
|
58
74
|
SearchCondition: {
|
|
59
75
|
SearchType: 'SearchByOrg',
|
|
@@ -86,12 +102,14 @@ export function DepartTreeSelectH5({ id, className, style, events = emptyObject,
|
|
|
86
102
|
const onClose = () => {
|
|
87
103
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
88
104
|
setVisible(false);
|
|
105
|
+
setOrgsTreeData([]);
|
|
89
106
|
initOrgsData();
|
|
90
107
|
};
|
|
91
108
|
const onConfirm = (selectItem) => {
|
|
92
109
|
var _a;
|
|
93
110
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
94
111
|
setValue(selectItem === null || selectItem === void 0 ? void 0 : selectItem.content);
|
|
112
|
+
setOrgsTreeData([]);
|
|
95
113
|
onChange === null || onChange === void 0 ? void 0 : onChange(selectItem === null || selectItem === void 0 ? void 0 : selectItem.orgId);
|
|
96
114
|
(_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, { value: selectItem === null || selectItem === void 0 ? void 0 : selectItem.orgId, data: selectItem });
|
|
97
115
|
setVisible(false);
|
|
@@ -102,46 +120,39 @@ export function DepartTreeSelectH5({ id, className, style, events = emptyObject,
|
|
|
102
120
|
if ((defaultValue &&
|
|
103
121
|
!isObjectEqual(prevDefaultRef.current !== defaultValue)) ||
|
|
104
122
|
(confirmValue && !isObjectEqual(prevConfirmRef.current !== confirmValue))) {
|
|
123
|
+
const getdefaultUser = async () => {
|
|
124
|
+
var _a;
|
|
125
|
+
try {
|
|
126
|
+
if ((defaultValueType === 'confirmDepart' &&
|
|
127
|
+
confirmValue.length !== 0) ||
|
|
128
|
+
defaultValue.length !== 0) {
|
|
129
|
+
const orgId = confirmValue.length !== 0 ? confirmValue : defaultValue;
|
|
130
|
+
const defaultDepart = await getDepartById({
|
|
131
|
+
_id: orgId,
|
|
132
|
+
});
|
|
133
|
+
setValue(defaultDepart);
|
|
134
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(orgId);
|
|
135
|
+
(_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, {
|
|
136
|
+
value: orgId,
|
|
137
|
+
data: { content: defaultDepart },
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
catch (e) {
|
|
142
|
+
setErrorInfo({ errorStatus: true, errorMessage: e });
|
|
143
|
+
}
|
|
144
|
+
};
|
|
105
145
|
getdefaultUser();
|
|
106
146
|
prevDefaultRef.current = defaultValue;
|
|
107
147
|
prevConfirmRef.current = confirmValue;
|
|
108
148
|
}
|
|
149
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
109
150
|
}, [defaultValueType, confirmValue, defaultValue]);
|
|
110
|
-
const getdefaultUser = async () => {
|
|
111
|
-
var _a;
|
|
112
|
-
try {
|
|
113
|
-
if ((defaultValueType === 'confirmDepart' && confirmValue.length !== 0) ||
|
|
114
|
-
defaultValue.length !== 0) {
|
|
115
|
-
const orgId = confirmValue.length !== 0 ? confirmValue : defaultValue;
|
|
116
|
-
const defaultDepart = await getDepartById({
|
|
117
|
-
_id: orgId,
|
|
118
|
-
});
|
|
119
|
-
setValue(defaultDepart);
|
|
120
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(orgId);
|
|
121
|
-
(_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, { value: orgId, data: { content: defaultDepart } });
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
catch (e) {
|
|
125
|
-
setErrorInfo({ errorStatus: true, errorMessage: e });
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
// 初始化数据
|
|
129
|
-
const initOrgsData = async () => {
|
|
130
|
-
try {
|
|
131
|
-
const resData = (await request('InitRootOrgs', {})) || [];
|
|
132
|
-
const data = dealOrgData(resData);
|
|
133
|
-
setOrgsTreeData(data);
|
|
134
|
-
setOriginalOrgData([{ index: count, treeData: data }]);
|
|
135
|
-
}
|
|
136
|
-
catch (e) {
|
|
137
|
-
setErrorInfo({ errorStatus: true, errorMessage: e });
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
151
|
//点击部门节点,获取子部门节点
|
|
141
152
|
const loadDepartData = async (node, count) => {
|
|
142
153
|
try {
|
|
143
154
|
setLoading({ id: node.orgId, status: true });
|
|
144
|
-
const { Orgs = []
|
|
155
|
+
const { Orgs = [] } = await request('LazyDescribeOrgs', {
|
|
145
156
|
OrgId: node.orgId,
|
|
146
157
|
DescribeCondition: {
|
|
147
158
|
NeedUser: true,
|
|
@@ -158,8 +169,13 @@ export function DepartTreeSelectH5({ id, className, style, events = emptyObject,
|
|
|
158
169
|
}
|
|
159
170
|
else {
|
|
160
171
|
const children = dealOrgData(Orgs);
|
|
172
|
+
setTitleText(node === null || node === void 0 ? void 0 : node.content);
|
|
161
173
|
setOrgsTreeData(children);
|
|
162
|
-
originalOrgData.push({
|
|
174
|
+
originalOrgData.push({
|
|
175
|
+
index: count + 1,
|
|
176
|
+
treeData: children,
|
|
177
|
+
title: node === null || node === void 0 ? void 0 : node.content,
|
|
178
|
+
});
|
|
163
179
|
setCount(count + 1);
|
|
164
180
|
setOriginalOrgData(originalOrgData);
|
|
165
181
|
}
|
|
@@ -178,6 +194,7 @@ export function DepartTreeSelectH5({ id, className, style, events = emptyObject,
|
|
|
178
194
|
storageOriTreeData.push(item);
|
|
179
195
|
if ((item === null || item === void 0 ? void 0 : item.index) === count - 1) {
|
|
180
196
|
setCount(count - 1);
|
|
197
|
+
setTitleText(item.title);
|
|
181
198
|
setOrgsTreeData((item === null || item === void 0 ? void 0 : item.treeData) || []);
|
|
182
199
|
}
|
|
183
200
|
}
|
|
@@ -199,37 +216,21 @@ export function DepartTreeSelectH5({ id, className, style, events = emptyObject,
|
|
|
199
216
|
React.createElement(Modal.Body, { className: (selectItem === null || selectItem === void 0 ? void 0 : selectItem.userId) ? 'is-selected-value' : '' },
|
|
200
217
|
React.createElement("div", { className: "weda-select-user-dept__dialog-header", id: count.toString() },
|
|
201
218
|
React.createElement("div", { className: count == 1 ? '' : 'arrow-left', onClick: () => retLevel(count) }),
|
|
202
|
-
|
|
203
|
-
React.createElement(
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
React.createElement("div", { className: "weda-select-user-dept__dialog-search-box" },
|
|
208
|
-
React.createElement("input", { type: "text", onFocus: () => {
|
|
209
|
-
handleFocus(true);
|
|
210
|
-
}, value: searchValue, onClick: (e) => {
|
|
211
|
-
e.stopPropagation();
|
|
212
|
-
}, onChange: changeSearchValue, className: "weda-select-user-dept__dialog-search-input" }),
|
|
213
|
-
React.createElement("div", { className: classNames({
|
|
214
|
-
'weda-select-user-dept__dialog-label': true,
|
|
215
|
-
'weda-select-user-dept__dialog-label-value': searchValue,
|
|
216
|
-
}) },
|
|
217
|
-
React.createElement("span", { className: "search-icon" }),
|
|
218
|
-
React.createElement("span", { className: "search-placeholder" }, "\u641C\u7D22")),
|
|
219
|
-
searchValue && searchValue.length > 0 && (React.createElement("div", { className: "weda-select-user-dept__dialog-input-clear", onClick: changeSearchValue },
|
|
220
|
-
React.createElement("p", { className: "weda-select-user-dept__dialog-input-clear-close" })))),
|
|
221
|
-
React.createElement("span", { className: "weda-select-user-dept__dialog-search-cancel", onClick: cancleSearch }, "\u53D6\u6D88")),
|
|
222
|
-
(errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.errorStatus) ? (React.createElement(ErrorStatus, { size: "l", title: "\u63A5\u53E3\u8C03\u7528\u5931\u8D25", description: (errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.errorMessage) || null })) : orgsTreeData && orgsTreeData.length > 0 ? (React.createElement("div", { className: classNames('weda-select-user-dept__dialog-list') }, orgsTreeData.map((item, index) => (React.createElement("div", { className: "weda-select-user-dept__list-item", key: item === null || item === void 0 ? void 0 : item.id },
|
|
219
|
+
titleText),
|
|
220
|
+
React.createElement(ModalSearch, { value: searchValue, onChange: changeSearchValue, onCancel: cancleSearch, isSearch: isSearch, onFocus: () => {
|
|
221
|
+
handleFocus(true);
|
|
222
|
+
} }),
|
|
223
|
+
(errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.errorStatus) ? (React.createElement(ErrorStatus, { size: "l", title: "\u63A5\u53E3\u8C03\u7528\u5931\u8D25", description: (errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.errorMessage) || null })) : orgsTreeData && orgsTreeData.length > 0 ? (React.createElement("div", { className: classNames('weda-select-user-dept__dialog-list') }, orgsTreeData.map((item) => (React.createElement("div", { className: "weda-select-user-dept__list-item", key: item === null || item === void 0 ? void 0 : item.id },
|
|
223
224
|
React.createElement("div", { className: "weda-select-user-dept__list-item-wrap" },
|
|
224
|
-
React.createElement(Radio.Group, { value: selectItem === null || selectItem === void 0 ? void 0 : selectItem.orgId, onChange: (
|
|
225
|
+
React.createElement(Radio.Group, { value: selectItem === null || selectItem === void 0 ? void 0 : selectItem.orgId, onChange: () => {
|
|
225
226
|
setSelectItem(item);
|
|
226
227
|
}, layout: "column" },
|
|
227
228
|
React.createElement(Radio, { name: item === null || item === void 0 ? void 0 : item.orgId },
|
|
228
229
|
React.createElement("div", { className: "weda-select-user-dept__item-detail" },
|
|
229
|
-
React.createElement("div", { className: "item-name" }, item === null || item === void 0 ? void 0 : item.content)
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
React.createElement("div", { className: "item-name" }, item === null || item === void 0 ? void 0 : item.content),
|
|
231
|
+
(item === null || item === void 0 ? void 0 : item.expandable) && loading.id !== item.orgId && (React.createElement("div", { className: "lcap-icon lcap-icon-chevronright", onClick: () => {
|
|
232
|
+
loadDepartData(item, count);
|
|
233
|
+
} }))))),
|
|
233
234
|
loading.id === item.orgId && (loading === null || loading === void 0 ? void 0 : loading.status) && (React.createElement("div", null,
|
|
234
235
|
React.createElement(IconFont, { name: "loading", className: `weda-grid-navigation__fonticon depart_loading` }))))))))) : (React.createElement(Status, { className: "dim-tree-select--blank", icon: 'blank', size: 's', title: `暂无部门数据` }))),
|
|
235
236
|
React.createElement(Modal.Footer, null,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IDepartTreeSelec } from './departTreeSelect.h5';
|
|
3
|
-
import '../userOrgSelect.
|
|
4
|
-
export declare function DepartTreeSelectPC({ id, className, style, events, label, labelVisible,
|
|
3
|
+
import '../userOrgSelect.css';
|
|
4
|
+
export declare function DepartTreeSelectPC({ id, className, style, events, label, labelVisible, defaultValue, confirmValue, placeholder, defaultValueType, disabled, layout, requiredFlag, size, multiple, onChange, decorator, request, }: IDepartTreeSelec): JSX.Element;
|
|
@@ -4,11 +4,11 @@ import { renderDecorator } from '../../renderDecorator';
|
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { Dropdown, ConfigProvider, Text } from 'tea-component';
|
|
6
6
|
import { getNode, getRelationData, dealOrgData } from '../utils';
|
|
7
|
-
import { getDepartById, defaultRequest
|
|
8
|
-
import '../userOrgSelect.
|
|
7
|
+
import { getDepartById, defaultRequest } from '../getUserService';
|
|
8
|
+
import '../userOrgSelect.css';
|
|
9
9
|
import { DimTreeContent } from '../comTool';
|
|
10
10
|
import isObjectEqual from '../../../../utils/isObjectEqual';
|
|
11
|
-
export function DepartTreeSelectPC({ id, className, style, events = emptyObject, label = '人员选择', labelVisible = true,
|
|
11
|
+
export function DepartTreeSelectPC({ id, className, style, events = emptyObject, label = '人员选择', labelVisible = true, defaultValue = '', confirmValue = '', placeholder = '请选择部门', defaultValueType = 'noneDepart', disabled = false, layout = 'horizontal', requiredFlag = false, size = 'l', multiple = false, onChange = null, decorator, request = defaultRequest, }) {
|
|
12
12
|
// 两次默认值不同, 需要刷新
|
|
13
13
|
const prevDefaultRef = React.useRef(null);
|
|
14
14
|
const prevConfirmRef = React.useRef(null);
|
|
@@ -30,6 +30,36 @@ export function DepartTreeSelectPC({ id, className, style, events = emptyObject,
|
|
|
30
30
|
errorMessage: null,
|
|
31
31
|
});
|
|
32
32
|
useEffect(() => {
|
|
33
|
+
// 初始化数据
|
|
34
|
+
const initOrgsData = async () => {
|
|
35
|
+
try {
|
|
36
|
+
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
37
|
+
const resData = (await request('InitRootOrgs', {})) || [];
|
|
38
|
+
const data = dealOrgData(resData);
|
|
39
|
+
setTreeData(data);
|
|
40
|
+
setOriginalTreeData([...data]);
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
setErrorInfo({ errorStatus: true, errorMessage: e });
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const getdefaultUser = async () => {
|
|
47
|
+
var _a;
|
|
48
|
+
try {
|
|
49
|
+
if ((defaultValueType === 'confirmDepart' && confirmValue.length !== 0) ||
|
|
50
|
+
defaultValue.length !== 0) {
|
|
51
|
+
const orgId = confirmValue.length !== 0 ? confirmValue : defaultValue;
|
|
52
|
+
const defaultUser = await getDepartById({
|
|
53
|
+
_id: orgId,
|
|
54
|
+
});
|
|
55
|
+
setCurSelectItem({ orgId: orgId, content: defaultUser });
|
|
56
|
+
(_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, { value: orgId, data: { content: defaultUser } });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
catch (e) {
|
|
60
|
+
setErrorInfo({ errorStatus: true, errorMessage: e });
|
|
61
|
+
}
|
|
62
|
+
};
|
|
33
63
|
initOrgsData();
|
|
34
64
|
if ((defaultValue &&
|
|
35
65
|
!isObjectEqual(prevDefaultRef.current !== defaultValue)) ||
|
|
@@ -38,7 +68,8 @@ export function DepartTreeSelectPC({ id, className, style, events = emptyObject,
|
|
|
38
68
|
prevDefaultRef.current = defaultValue;
|
|
39
69
|
prevConfirmRef.current = confirmValue;
|
|
40
70
|
}
|
|
41
|
-
|
|
71
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
72
|
+
}, [defaultValueType, confirmValue, defaultValue, request]);
|
|
42
73
|
useEffect(() => {
|
|
43
74
|
if (open) {
|
|
44
75
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
@@ -47,43 +78,15 @@ export function DepartTreeSelectPC({ id, className, style, events = emptyObject,
|
|
|
47
78
|
setActiveIds(node ? [node.id] : []);
|
|
48
79
|
setSelectIds(node ? [node.id] : []);
|
|
49
80
|
}
|
|
50
|
-
}, [open, treeData]);
|
|
51
|
-
|
|
52
|
-
const initOrgsData = async () => {
|
|
53
|
-
try {
|
|
54
|
-
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
55
|
-
const resData = (await request('InitRootOrgs', {})) || [];
|
|
56
|
-
const data = dealOrgData(resData);
|
|
57
|
-
setTreeData(data);
|
|
58
|
-
setOriginalTreeData([...data]);
|
|
59
|
-
}
|
|
60
|
-
catch (e) {
|
|
61
|
-
setErrorInfo({ errorStatus: true, errorMessage: e });
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
const getdefaultUser = async () => {
|
|
81
|
+
}, [curSelectItem === null || curSelectItem === void 0 ? void 0 : curSelectItem.orgId, open, treeData]);
|
|
82
|
+
const reset = (close, value = '') => {
|
|
65
83
|
var _a;
|
|
66
|
-
try {
|
|
67
|
-
if ((defaultValueType === 'confirmDepart' && confirmValue.length !== 0) ||
|
|
68
|
-
defaultValue.length !== 0) {
|
|
69
|
-
const orgId = confirmValue.length !== 0 ? confirmValue : defaultValue;
|
|
70
|
-
const defaultUser = await getDepartByIdRequest({
|
|
71
|
-
_id: orgId,
|
|
72
|
-
});
|
|
73
|
-
setCurSelectItem({ orgId: orgId, content: defaultUser });
|
|
74
|
-
(_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, { value: orgId, data: { content: defaultUser } });
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
catch (e) {
|
|
78
|
-
setErrorInfo({ errorStatus: true, errorMessage: e });
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
const reset = (close) => {
|
|
82
84
|
setSelectIds([]);
|
|
83
85
|
setCurSelectItem({ orgId: null, content: '' });
|
|
84
86
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
85
87
|
setActiveIds([]);
|
|
86
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(
|
|
88
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
89
|
+
(_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, { value });
|
|
87
90
|
close && setOpen(false);
|
|
88
91
|
};
|
|
89
92
|
// 外层组件类
|
|
@@ -101,7 +104,7 @@ export function DepartTreeSelectPC({ id, className, style, events = emptyObject,
|
|
|
101
104
|
React.createElement(Dropdown, { className: classNames(`department-tree-select`, `size-${size}`), destroyOnClose: false, open: open, onOpenChange: (open) => {
|
|
102
105
|
setOpen(open);
|
|
103
106
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
104
|
-
}, button: React.createElement(SelectViewContainer, { curSelectItem: curSelectItem, multiple: multiple, placeholder:
|
|
107
|
+
}, button: React.createElement(SelectViewContainer, { curSelectItem: curSelectItem, multiple: multiple, placeholder: placeholder, moveIn: moveIn, onChange: () => reset(true) }), style: { width: '100%' }, appearance: multiple ? 'pure' : 'button', clickClose: false, disabled: disabled }, () => (React.createElement("div", { className: "dim-tree-select" },
|
|
105
108
|
React.createElement(DimTreeContent, { data: treeData, setTreeData: setTreeData, selectedIds: selectIds, activeIds: activeIds, needUser: false, request: request, errorInfo: errorInfo, searchType: "SearchByOrg", onActive: (ids) => {
|
|
106
109
|
setActiveIds(ids);
|
|
107
110
|
setSelectIds(ids);
|
|
@@ -129,6 +132,7 @@ export function DepartTreeSelectPC({ id, className, style, events = emptyObject,
|
|
|
129
132
|
multiCell: false,
|
|
130
133
|
requiredFlag,
|
|
131
134
|
size,
|
|
135
|
+
decorator,
|
|
132
136
|
});
|
|
133
137
|
}
|
|
134
138
|
const SelectViewContainer = (props) => {
|
|
File without changes
|
|
File without changes
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { CommonFormPropsType } from '../types';
|
|
3
|
-
import './userOrgSelect.
|
|
4
|
-
export declare function UserTreeSelectH5({ id, className,
|
|
5
|
-
focus: autoFocus, onChange,
|
|
3
|
+
import './userOrgSelect.css';
|
|
4
|
+
export declare function UserTreeSelectH5({ id, className, style, events, label, labelVisible, name, placeholder, defaultValueType, defaultValue, confirmValue, disabled, layout, requiredFlag, decorator, multiple, //是否多选
|
|
5
|
+
focus: autoFocus, onChange, modelOpen, request, }: IUserTreeSelec): JSX.Element;
|
|
6
6
|
export interface IUserTreeSelec extends CommonFormPropsType {
|
|
7
7
|
defaultValue?: Readonly<string | string[]>;
|
|
8
8
|
confirmValue?: string;
|
|
9
9
|
placeholder?: string;
|
|
10
|
+
modelType?: string;
|
|
10
11
|
defaultValueType?: 'noneUser' | 'confirmUser' | 'loginUser';
|
|
11
12
|
maxLength?: number;
|
|
12
13
|
focus?: boolean;
|
|
@@ -17,8 +18,10 @@ export interface IUserTreeSelec extends CommonFormPropsType {
|
|
|
17
18
|
multiple?: boolean;
|
|
18
19
|
relation?: object;
|
|
19
20
|
isMuti?: boolean;
|
|
21
|
+
matchButtonWidth?: boolean;
|
|
22
|
+
dropDownStyle?: React.CSSProperties;
|
|
20
23
|
onChange?: (v: any) => void;
|
|
21
|
-
initOrgRequest?: (action?: string, params?: object) => any;
|
|
22
24
|
request?: any;
|
|
25
|
+
modelOpen?: boolean;
|
|
23
26
|
getUserByIdRequest?: (v: any) => any;
|
|
24
27
|
}
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
1
|
+
import React, { useState, useEffect, useCallback } from 'react';
|
|
2
2
|
import { emptyObject, emptyArray } from '../../../utils/constant';
|
|
3
3
|
import { renderDecorator } from '../renderDecorator';
|
|
4
4
|
import { IconFont } from 'tdesign-icons-react';
|
|
5
5
|
import classNames from '../../../utils/classnames';
|
|
6
|
-
import {
|
|
6
|
+
import { getUserInfo, defaultRequest } from './getUserService';
|
|
7
7
|
import { dealOrgData, dealUserData } from './utils';
|
|
8
8
|
import { Modal, Button, ConfigProvider, Radio, Status } from 'tea-component';
|
|
9
9
|
import { isInIde, filterStrList } from '../../../utils/platform';
|
|
10
|
-
import './userOrgSelect.
|
|
10
|
+
import './userOrgSelect.css';
|
|
11
11
|
import isObjectEqual from '../../../utils/isObjectEqual';
|
|
12
12
|
import destr from 'destr';
|
|
13
|
-
import { ErrorStatus } from './comTool';
|
|
14
|
-
export function UserTreeSelectH5({ id, className,
|
|
15
|
-
focus: autoFocus = false, onChange = null,
|
|
13
|
+
import { ErrorStatus, ModalSearch } from './comTool';
|
|
14
|
+
export function UserTreeSelectH5({ id, className, style, events = emptyObject, label = '成员选择', labelVisible = true, name = 'formUserTreeSelect', placeholder = '请选择成员', defaultValueType = 'noneUser', defaultValue = emptyArray, confirmValue = '', disabled = false, layout = 'horizontal', requiredFlag = false, decorator, multiple = false, //是否多选
|
|
15
|
+
focus: autoFocus = false, onChange = null, modelOpen = false, request = defaultRequest, }) {
|
|
16
16
|
var _a;
|
|
17
17
|
const cls = classNames({
|
|
18
18
|
'weda-ui': true,
|
|
19
19
|
'weda-select-user-dept': true,
|
|
20
20
|
[className]: className,
|
|
21
21
|
});
|
|
22
|
-
const modelCls = classNames({
|
|
23
|
-
[className]: modelClassName,
|
|
24
|
-
});
|
|
25
22
|
const subCls = classNames({
|
|
26
23
|
'weui-cell': true,
|
|
27
24
|
'weui-cell_active': true,
|
|
@@ -37,8 +34,6 @@ focus: autoFocus = false, onChange = null, initOrgRequest = null, request = defa
|
|
|
37
34
|
const [orgsTreeData, setOrgsTreeData] = useState([]);
|
|
38
35
|
const [originalOrgData, setOriginalOrgData] = useState([]);
|
|
39
36
|
const [count, setCount] = useState(1); //计数弹窗显示层级
|
|
40
|
-
// 用户单选
|
|
41
|
-
const [curSelectItem, setCurSelectItem] = useState({});
|
|
42
37
|
const [errorInfo, setErrorInfo] = useState({
|
|
43
38
|
errorStatus: false,
|
|
44
39
|
errorMessage: null,
|
|
@@ -57,7 +52,7 @@ focus: autoFocus = false, onChange = null, initOrgRequest = null, request = defa
|
|
|
57
52
|
const sValue = (_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value;
|
|
58
53
|
if (sValue) {
|
|
59
54
|
setSearchValue(multiple ? [...searchValue, sValue] : [sValue]);
|
|
60
|
-
const { Users = []
|
|
55
|
+
const { Users = [] } = await request('SearchByCondition', {
|
|
61
56
|
KeyWords: sValue.trim(),
|
|
62
57
|
SearchCondition: {
|
|
63
58
|
SearchType: 'SearchByRole',
|
|
@@ -78,25 +73,34 @@ focus: autoFocus = false, onChange = null, initOrgRequest = null, request = defa
|
|
|
78
73
|
const [selectItem, setSelectItem] = useState([]);
|
|
79
74
|
const [searchValue, setSearchValue] = useState([]);
|
|
80
75
|
const [loading, setLoading] = useState({ id: null, status: false });
|
|
76
|
+
const [titleText, setTitleText] = useState('');
|
|
81
77
|
const onFocus = function () {
|
|
82
78
|
setSearchValue([]);
|
|
83
79
|
setVisible(true);
|
|
84
80
|
};
|
|
85
81
|
const onClose = () => {
|
|
82
|
+
setOrgsTreeData([]);
|
|
86
83
|
initOrgsData();
|
|
87
84
|
setErrorInfo({ errorStatus: false, errorMessage: null });
|
|
88
85
|
setVisible(false);
|
|
89
86
|
};
|
|
90
87
|
const onConfirm = (selectItem = []) => {
|
|
91
|
-
var _a, _b, _c
|
|
88
|
+
var _a, _b, _c;
|
|
92
89
|
const contentList = selectItem.map((e) => e === null || e === void 0 ? void 0 : e.content);
|
|
93
90
|
setValue([...contentList]);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
const idList = selectItem.map((e) => e === null || e === void 0 ? void 0 : e.userId);
|
|
92
|
+
prevDefaultRef.current = [...idList];
|
|
93
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(multiple ? idList : (_a = selectItem[0]) === null || _a === void 0 ? void 0 : _a.userId);
|
|
94
|
+
(_b = events === null || events === void 0 ? void 0 : events.change) === null || _b === void 0 ? void 0 : _b.call(events, multiple
|
|
95
|
+
? { value: idList, data: selectItem }
|
|
96
|
+
: { value: (_c = selectItem[0]) === null || _c === void 0 ? void 0 : _c.userId, data: selectItem });
|
|
97
|
+
setOrgsTreeData([]);
|
|
97
98
|
initOrgsData();
|
|
98
99
|
setVisible(false);
|
|
99
100
|
};
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
setVisible(modelOpen);
|
|
103
|
+
}, [modelOpen]);
|
|
100
104
|
useEffect(() => {
|
|
101
105
|
initOrgsData();
|
|
102
106
|
if ((defaultValue &&
|
|
@@ -108,8 +112,9 @@ focus: autoFocus = false, onChange = null, initOrgRequest = null, request = defa
|
|
|
108
112
|
prevDefaultRef.current = defaultValue;
|
|
109
113
|
prevConfirmRef.current = confirmValue;
|
|
110
114
|
}
|
|
115
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
111
116
|
}, [defaultValueType, confirmValue, defaultValue]);
|
|
112
|
-
const getDefaultUser = async () => {
|
|
117
|
+
const getDefaultUser = useCallback(async () => {
|
|
113
118
|
var _a;
|
|
114
119
|
try {
|
|
115
120
|
//默认显示登录用户时
|
|
@@ -131,34 +136,45 @@ focus: autoFocus = false, onChange = null, initOrgRequest = null, request = defa
|
|
|
131
136
|
else if ((defaultValueType === 'confirmUser' && confirmValue.length !== 0) ||
|
|
132
137
|
defaultValue.length !== 0) {
|
|
133
138
|
const userIdList = filterStrList(confirmValue.length !== 0 ? confirmValue : defaultValue);
|
|
134
|
-
const userSelectList =
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
});
|
|
139
|
+
const userSelectList = await request('getUserById', {
|
|
140
|
+
idList: userIdList || [],
|
|
141
|
+
}, 'callDataSource');
|
|
142
|
+
setValue(userSelectList.map((list) => { var _a; return (_a = list === null || list === void 0 ? void 0 : list.data) === null || _a === void 0 ? void 0 : _a.content; }));
|
|
143
|
+
setSelectItem(userSelectList.map((list) => {
|
|
144
|
+
var _a;
|
|
145
|
+
return { userId: list === null || list === void 0 ? void 0 : list.value, content: (_a = list === null || list === void 0 ? void 0 : list.data) === null || _a === void 0 ? void 0 : _a.content };
|
|
146
|
+
}));
|
|
142
147
|
}
|
|
143
148
|
}
|
|
144
149
|
catch (e) {
|
|
145
150
|
setErrorInfo({ errorStatus: true, errorMessage: e });
|
|
146
151
|
}
|
|
147
|
-
};
|
|
152
|
+
}, [confirmValue, defaultValue, defaultValueType, request, events, onChange]);
|
|
148
153
|
// 初始化数据
|
|
149
|
-
const initOrgsData = async () => {
|
|
154
|
+
const initOrgsData = useCallback(async () => {
|
|
150
155
|
try {
|
|
151
156
|
const resData = (await request('InitRootOrgs', {})) || [];
|
|
152
|
-
const
|
|
157
|
+
const pageNo = 1;
|
|
158
|
+
const noOrgUserData = await request('DescribeWedaUsersRuntime', {
|
|
159
|
+
pageNo: pageNo,
|
|
160
|
+
pageSize: 200,
|
|
161
|
+
IsNoRelatedOrgFlag: true,
|
|
162
|
+
UserType: 'internalUser',
|
|
163
|
+
});
|
|
164
|
+
const data = dealOrgData(resData).concat(dealUserData(noOrgUserData === null || noOrgUserData === void 0 ? void 0 : noOrgUserData.UserList));
|
|
165
|
+
//关闭弹窗时,默认返回第一层组织结构
|
|
166
|
+
setCount(1);
|
|
167
|
+
setTitleText('选择成员');
|
|
153
168
|
setOrgsTreeData(destr(data));
|
|
154
|
-
setOriginalOrgData([{ index:
|
|
169
|
+
setOriginalOrgData([{ index: 1, treeData: data, title: '选择成员' }]);
|
|
155
170
|
}
|
|
156
171
|
catch (e) {
|
|
157
172
|
setErrorInfo({ errorStatus: true, errorMessage: e });
|
|
158
173
|
}
|
|
159
|
-
};
|
|
174
|
+
}, [request]);
|
|
160
175
|
//点击部门节点,获取子部门节点
|
|
161
176
|
const loadDepartData = async (node, count) => {
|
|
177
|
+
setTitleText(node === null || node === void 0 ? void 0 : node.content);
|
|
162
178
|
setLoading({ id: node.orgId, status: true });
|
|
163
179
|
const { Orgs = [], Users = [] } = await request('LazyDescribeOrgs', {
|
|
164
180
|
OrgId: node.orgId,
|
|
@@ -170,7 +186,11 @@ focus: autoFocus = false, onChange = null, initOrgRequest = null, request = defa
|
|
|
170
186
|
//@ts-ignore jsx
|
|
171
187
|
const children = dealOrgData(Orgs).concat(dealUserData(Users));
|
|
172
188
|
setOrgsTreeData(destr(children));
|
|
173
|
-
originalOrgData.push({
|
|
189
|
+
originalOrgData.push({
|
|
190
|
+
index: count + 1,
|
|
191
|
+
treeData: children,
|
|
192
|
+
title: node === null || node === void 0 ? void 0 : node.content,
|
|
193
|
+
});
|
|
174
194
|
setCount(count + 1);
|
|
175
195
|
setOriginalOrgData(originalOrgData);
|
|
176
196
|
setLoading({ id: null, status: false });
|
|
@@ -178,13 +198,13 @@ focus: autoFocus = false, onChange = null, initOrgRequest = null, request = defa
|
|
|
178
198
|
//判断当前页结构为第几层,如首次渲染则添加至orgsTreeData,二次进入刷新index数据
|
|
179
199
|
const retLevel = (count) => {
|
|
180
200
|
const storageOriTreeData = [];
|
|
181
|
-
const storageOrgShowData = [];
|
|
182
201
|
if (count !== 1) {
|
|
183
202
|
originalOrgData.map((item) => {
|
|
184
203
|
if ((item === null || item === void 0 ? void 0 : item.index) < count) {
|
|
185
204
|
storageOriTreeData.push(item);
|
|
186
205
|
if ((item === null || item === void 0 ? void 0 : item.index) === count - 1) {
|
|
187
206
|
setCount(count - 1);
|
|
207
|
+
setTitleText(item === null || item === void 0 ? void 0 : item.title);
|
|
188
208
|
setOrgsTreeData(destr((item === null || item === void 0 ? void 0 : item.treeData) || []));
|
|
189
209
|
}
|
|
190
210
|
}
|
|
@@ -206,36 +226,20 @@ focus: autoFocus = false, onChange = null, initOrgRequest = null, request = defa
|
|
|
206
226
|
React.createElement(Modal.Body, { className: ((_a = selectItem[0]) === null || _a === void 0 ? void 0 : _a.userId) ? 'is-selected-value' : '' },
|
|
207
227
|
React.createElement("div", { className: "weda-select-user-dept__dialog-header", id: count.toString() },
|
|
208
228
|
React.createElement("div", { className: count == 1 ? '' : 'arrow-left', onClick: () => retLevel(count) }),
|
|
209
|
-
|
|
210
|
-
React.createElement(
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}) },
|
|
214
|
-
React.createElement("div", { className: "weda-select-user-dept__dialog-search-box" },
|
|
215
|
-
React.createElement("input", { type: "text", onFocus: () => {
|
|
216
|
-
handleFocus(true);
|
|
217
|
-
}, onClick: (e) => {
|
|
218
|
-
e.stopPropagation();
|
|
219
|
-
}, value: searchValue.join(), onChange: changeSearchValue, className: "weda-select-user-dept__dialog-search-input" }),
|
|
220
|
-
React.createElement("div", { className: classNames({
|
|
221
|
-
'weda-select-user-dept__dialog-label': true,
|
|
222
|
-
'weda-select-user-dept__dialog-label-value': searchValue[0],
|
|
223
|
-
}) },
|
|
224
|
-
React.createElement("span", { className: "search-icon" }),
|
|
225
|
-
React.createElement("span", { className: "search-placeholder" }, "\u641C\u7D22")),
|
|
226
|
-
searchValue && searchValue.length > 0 && (React.createElement("div", { className: "weda-select-user-dept__dialog-input-clear", onClick: cancleSearch },
|
|
227
|
-
React.createElement("p", { className: "weda-select-user-dept__dialog-input-clear-close" })))),
|
|
228
|
-
React.createElement("span", { className: "weda-select-user-dept__dialog-search-cancel", onClick: cancleSearch }, "\u53D6\u6D88")),
|
|
229
|
+
titleText),
|
|
230
|
+
React.createElement(ModalSearch, { value: searchValue.join(), onChange: changeSearchValue, onCancel: cancleSearch, isSearch: isSearch, onFocus: () => {
|
|
231
|
+
handleFocus(true);
|
|
232
|
+
} }),
|
|
229
233
|
(errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.errorStatus) ? (React.createElement(ErrorStatus, { size: "l", title: "\u63A5\u53E3\u8C03\u7528\u5931\u8D25", description: (errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.errorMessage) || null })) : orgsTreeData && orgsTreeData.length > 0 ? (React.createElement("div", { className: classNames('weda-select-user-dept__dialog-list') }, orgsTreeData.map((item, index) => {
|
|
230
234
|
var _a;
|
|
231
235
|
return (React.createElement("div", { className: "weda-select-user-dept__list-item", key: index + (item === null || item === void 0 ? void 0 : item.id), onClick: () => {
|
|
232
236
|
!(item === null || item === void 0 ? void 0 : item.isUser) ? loadDepartData(item, count) : null;
|
|
233
237
|
} },
|
|
234
238
|
React.createElement("div", { className: "weda-select-user-dept__list-item-wrap" },
|
|
235
|
-
(item === null || item === void 0 ? void 0 : item.isUser) && (React.createElement(Radio.Group, { value: (_a = selectItem.filter((e) => (e === null || e === void 0 ? void 0 : e.userId) === (item === null || item === void 0 ? void 0 : item.userId))[0]) === null || _a === void 0 ? void 0 : _a.userId, onChange: (value
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
+
(item === null || item === void 0 ? void 0 : item.isUser) && (React.createElement(Radio.Group, { value: (_a = selectItem.filter((e) => (e === null || e === void 0 ? void 0 : e.userId) === (item === null || item === void 0 ? void 0 : item.userId))[0]) === null || _a === void 0 ? void 0 : _a.userId, onChange: (value) => {
|
|
240
|
+
const ids = selectItem.map((item) => item === null || item === void 0 ? void 0 : item.userId);
|
|
241
|
+
// 多选情况,取消选中某元素时
|
|
242
|
+
if (ids.indexOf(value) !== -1) {
|
|
239
243
|
setSelectItem(selectItem.filter((e) => e.userId !== value));
|
|
240
244
|
}
|
|
241
245
|
else {
|
|
@@ -256,9 +260,8 @@ focus: autoFocus = false, onChange = null, initOrgRequest = null, request = defa
|
|
|
256
260
|
React.createElement("div", null,
|
|
257
261
|
selectItem.length > 0 && (React.createElement("div", { className: "weda-select-user-dept__select-result" },
|
|
258
262
|
React.createElement("div", { className: "weda-select-user-dept__select-label" }, "\u5DF2\u9009\u62E9"),
|
|
259
|
-
React.createElement("div", { className: "weda-select-user-dept__result-list" }, selectItem.map((d) => (React.createElement("div", { key: d === null || d === void 0 ? void 0 : d.userId, className: "weda-select-user-dept__result-item", onClick: () => {
|
|
263
|
+
React.createElement("div", { className: "weda-select-user-dept__result-list" }, selectItem.map((d) => (React.createElement("div", { key: (d === null || d === void 0 ? void 0 : d.userId) || (d === null || d === void 0 ? void 0 : d.value), className: "weda-select-user-dept__result-item", onClick: () => {
|
|
260
264
|
setSelectItem(selectItem.filter((e) => (e === null || e === void 0 ? void 0 : e.userId) !== (d === null || d === void 0 ? void 0 : d.userId)));
|
|
261
|
-
const valueList = searchValue.filter((e) => e !== (d === null || d === void 0 ? void 0 : d.userId));
|
|
262
265
|
} }, d === null || d === void 0 ? void 0 :
|
|
263
266
|
d.content,
|
|
264
267
|
React.createElement("div", { className: "close" }))))))),
|
|
@@ -272,5 +275,6 @@ focus: autoFocus = false, onChange = null, initOrgRequest = null, request = defa
|
|
|
272
275
|
multiCell: false,
|
|
273
276
|
requiredFlag,
|
|
274
277
|
layout,
|
|
278
|
+
decorator,
|
|
275
279
|
});
|
|
276
280
|
}
|