coolcare-lite-scada-component 1.0.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/README.md +21 -0
- package/es/app.js +52 -0
- package/es/componentIndex.js +7 -0
- package/es/components/BoxShadowPicker/index.css +22 -0
- package/es/components/BoxShadowPicker/index.js +114 -0
- package/es/components/BoxShadowPicker/index.less.d.ts +9 -0
- package/es/components/Button/index.js +6 -0
- package/es/components/ColorPalette/index.js +12 -0
- package/es/components/ColorPicker/index.css +38 -0
- package/es/components/ColorPicker/index.js +103 -0
- package/es/components/ColorPicker/util.js +31 -0
- package/es/components/DeviceSelect/DeviceTable.js +320 -0
- package/es/components/DeviceSelect/index.css +6 -0
- package/es/components/DeviceSelect/index.js +112 -0
- package/es/components/DialogExpression/ImagePicker/index.css +13 -0
- package/es/components/DialogExpression/ImagePicker/index.js +44 -0
- package/es/components/DialogExpression/index.css +9 -0
- package/es/components/DialogExpression/index.js +270 -0
- package/es/components/DialogHistory/index.css +10 -0
- package/es/components/DialogHistory/index.js +383 -0
- package/es/components/DialogIconPicker/data.js +179 -0
- package/es/components/DialogIconPicker/index.css +30 -0
- package/es/components/DialogIconPicker/index.js +101 -0
- package/es/components/DialogImagePicker/Gallery/index.css +0 -0
- package/es/components/DialogImagePicker/Gallery/index.js +96 -0
- package/es/components/DialogImagePicker/GroupPanel/index.css +3 -0
- package/es/components/DialogImagePicker/GroupPanel/index.js +89 -0
- package/es/components/DialogImagePicker/index.css +25 -0
- package/es/components/DialogImagePicker/index.js +85 -0
- package/es/components/DialogPointWrite/PointItem.js +91 -0
- package/es/components/DialogPointWrite/index.js +124 -0
- package/es/components/ECharts/index.css +5 -0
- package/es/components/ECharts/index.js +94 -0
- package/es/components/ExpressionFormat/index.css +22 -0
- package/es/components/ExpressionFormat/index.js +50 -0
- package/es/components/FontFamilySelect/index.js +25 -0
- package/es/components/FontFamilySelect/list.js +2194 -0
- package/es/components/FontStyleForm/index.css +3 -0
- package/es/components/FontStyleForm/index.js +170 -0
- package/es/components/FormBindPoint/FreedomScene.js +207 -0
- package/es/components/FormBindPoint/ProductionOrDeviceScene.js +172 -0
- package/es/components/FormBindPoint/index.css +0 -0
- package/es/components/FormBindPoint/index.js +17 -0
- package/es/components/FormIconSelect/index.js +62 -0
- package/es/components/FormNodeData/index.js +82 -0
- package/es/components/FormNodeData/utils/valueUtil.js +8 -0
- package/es/components/Icon/index.js +6 -0
- package/es/components/ImageUploader/index.js +172 -0
- package/es/components/LockBtn/index.css +4 -0
- package/es/components/LockBtn/index.js +45 -0
- package/es/components/Margin_Padding/index.css +3 -0
- package/es/components/Margin_Padding/index.js +155 -0
- package/es/components/MouseTooltip/index.css +7 -0
- package/es/components/MouseTooltip/index.js +57 -0
- package/es/components/NeedBindPointHint/index.css +12 -0
- package/es/components/NeedBindPointHint/index.js +15 -0
- package/es/components/PaddingPicker/index.css +22 -0
- package/es/components/PaddingPicker/index.js +95 -0
- package/es/components/PageLoading/index.css +29 -0
- package/es/components/PageLoading/index.js +30 -0
- package/es/components/PointEnumNameFormat/index.css +4 -0
- package/es/components/PointEnumNameFormat/index.js +9 -0
- package/es/components/PointInfoTip/index.css +3 -0
- package/es/components/PointInfoTip/index.js +193 -0
- package/es/components/PointSelect/DevicePointTable.js +128 -0
- package/es/components/PointSelect/ProductPointTable.js +98 -0
- package/es/components/PointSelect/index.css +9 -0
- package/es/components/PointSelect/index.js +278 -0
- package/es/components/Prompt/index.js +126 -0
- package/es/components/SliderWithInput/index.css +11 -0
- package/es/components/SliderWithInput/index.js +67 -0
- package/es/components/Switch/index.js +69 -0
- package/es/components/TranslateButton/index.js +26 -0
- package/es/constant.js +16 -0
- package/es/edge/EdgeLinePort/PropsSet/Flow.js +173 -0
- package/es/edge/EdgeLinePort/PropsSet/Line.js +73 -0
- package/es/edge/EdgeLinePort/PropsSet/Marker.js +81 -0
- package/es/edge/EdgeLinePort/PropsSet/index.js +25 -0
- package/es/edge/EdgeLinePort/index.js +91 -0
- package/es/edge/EdgePipe/PropsSet/Flow.js +173 -0
- package/es/edge/EdgePipe/PropsSet/Pipe.js +73 -0
- package/es/edge/EdgePipe/PropsSet/index.js +34 -0
- package/es/edge/EdgePipe/index.css +10 -0
- package/es/edge/EdgePipe/index.js +181 -0
- package/es/edge/register.js +6 -0
- package/es/element/BasicShape/Circle/index.js +81 -0
- package/es/element/BasicShape/CommentBox/index.js +77 -0
- package/es/element/BasicShape/CommentBox2/index.js +78 -0
- package/es/element/BasicShape/Ellipse/index.js +80 -0
- package/es/element/BasicShape/Heart/index.js +75 -0
- package/es/element/BasicShape/Lightning/index.js +75 -0
- package/es/element/BasicShape/PropsForm/index.css +0 -0
- package/es/element/BasicShape/PropsForm/index.js +80 -0
- package/es/element/BasicShape/Rectangle/index.js +78 -0
- package/es/element/BasicShape/Star/index.js +75 -0
- package/es/element/BorderBox/BorderBox1/Component.js +74 -0
- package/es/element/BorderBox/BorderBox1/index.css +27 -0
- package/es/element/BorderBox/BorderBox1/index.js +51 -0
- package/es/element/BorderBox/BorderBox10/Component.js +61 -0
- package/es/element/BorderBox/BorderBox10/index.css +28 -0
- package/es/element/BorderBox/BorderBox10/index.js +51 -0
- package/es/element/BorderBox/BorderBox12/Component.js +109 -0
- package/es/element/BorderBox/BorderBox12/index.css +17 -0
- package/es/element/BorderBox/BorderBox12/index.js +51 -0
- package/es/element/BorderBox/BorderBox13/Component.js +55 -0
- package/es/element/BorderBox/BorderBox13/index.css +17 -0
- package/es/element/BorderBox/BorderBox13/index.js +51 -0
- package/es/element/BorderBox/BorderBox2/Component.js +65 -0
- package/es/element/BorderBox/BorderBox2/index.css +21 -0
- package/es/element/BorderBox/BorderBox2/index.js +51 -0
- package/es/element/BorderBox/BorderBox3/Component.js +55 -0
- package/es/element/BorderBox/BorderBox3/index.css +26 -0
- package/es/element/BorderBox/BorderBox3/index.js +51 -0
- package/es/element/BorderBox/BorderBox4/Component.js +81 -0
- package/es/element/BorderBox/BorderBox4/index.css +66 -0
- package/es/element/BorderBox/BorderBox4/index.js +51 -0
- package/es/element/BorderBox/BorderBox5/Component.js +65 -0
- package/es/element/BorderBox/BorderBox5/index.css +35 -0
- package/es/element/BorderBox/BorderBox5/index.js +51 -0
- package/es/element/BorderBox/BorderBox6/Component.js +95 -0
- package/es/element/BorderBox/BorderBox6/index.css +21 -0
- package/es/element/BorderBox/BorderBox6/index.js +51 -0
- package/es/element/BorderBox/BorderBox7/Component.js +70 -0
- package/es/element/BorderBox/BorderBox7/index.css +27 -0
- package/es/element/BorderBox/BorderBox7/index.js +51 -0
- package/es/element/BorderBox/BorderBox8/Component.js +113 -0
- package/es/element/BorderBox/BorderBox8/index.css +17 -0
- package/es/element/BorderBox/BorderBox8/index.js +51 -0
- package/es/element/BorderBox/BorderBox9/Component.js +137 -0
- package/es/element/BorderBox/BorderBox9/index.css +17 -0
- package/es/element/BorderBox/BorderBox9/index.js +51 -0
- package/es/element/BorderBox/PropsSet/ColorSet.js +60 -0
- package/es/element/BorderBox/PropsSet/index.js +21 -0
- package/es/element/BorderBox/util/index.js +7 -0
- package/es/element/BorderBox/util/typings.d.ts +9 -0
- package/es/element/Decoration/Decoration1/Component.js +126 -0
- package/es/element/Decoration/Decoration1/index.css +7 -0
- package/es/element/Decoration/Decoration1/index.js +51 -0
- package/es/element/Decoration/Decoration10/Component.js +171 -0
- package/es/element/Decoration/Decoration10/index.css +5 -0
- package/es/element/Decoration/Decoration10/index.js +51 -0
- package/es/element/Decoration/Decoration2/Component.js +81 -0
- package/es/element/Decoration/Decoration2/index.css +10 -0
- package/es/element/Decoration/Decoration2/index.js +51 -0
- package/es/element/Decoration/Decoration3/Component.js +81 -0
- package/es/element/Decoration/Decoration3/index.css +7 -0
- package/es/element/Decoration/Decoration3/index.js +51 -0
- package/es/element/Decoration/Decoration4/Component.js +54 -0
- package/es/element/Decoration/Decoration4/index.css +43 -0
- package/es/element/Decoration/Decoration4/index.js +51 -0
- package/es/element/Decoration/Decoration5/Component.js +86 -0
- package/es/element/Decoration/Decoration5/index.css +4 -0
- package/es/element/Decoration/Decoration5/index.js +51 -0
- package/es/element/Decoration/Decoration6/Component.js +120 -0
- package/es/element/Decoration/Decoration6/index.css +7 -0
- package/es/element/Decoration/Decoration6/index.js +51 -0
- package/es/element/Decoration/Decoration8/Component.js +62 -0
- package/es/element/Decoration/Decoration8/index.css +5 -0
- package/es/element/Decoration/Decoration8/index.js +51 -0
- package/es/element/Decoration/PropsSet/ColorSet.js +60 -0
- package/es/element/Decoration/PropsSet/index.js +21 -0
- package/es/element/Decoration/util/index.js +33 -0
- package/es/element/Decoration/util/typings.d.ts +9 -0
- package/es/element/EleButton/Component.js +49 -0
- package/es/element/EleButton/PropsSet/TextPropsSet/index.js +27 -0
- package/es/element/EleButton/PropsSet/index.js +25 -0
- package/es/element/EleButton/index.css +15 -0
- package/es/element/EleButton/index.js +66 -0
- package/es/element/EleClock/Component.js +60 -0
- package/es/element/EleClock/PropsSet/index.js +46 -0
- package/es/element/EleClock/index.css +7 -0
- package/es/element/EleClock/index.js +55 -0
- package/es/element/EleContainer/Component.js +22 -0
- package/es/element/EleContainer/PropsSet/OtherPropsSet/index.js +63 -0
- package/es/element/EleContainer/PropsSet/index.js +29 -0
- package/es/element/EleContainer/index.css +4 -0
- package/es/element/EleContainer/index.js +54 -0
- package/es/element/EleDeviceName/Component.js +81 -0
- package/es/element/EleDeviceName/PropsSet/FormBindDevice/index.js +52 -0
- package/es/element/EleDeviceName/PropsSet/index.js +26 -0
- package/es/element/EleDeviceName/index.css +11 -0
- package/es/element/EleDeviceName/index.js +57 -0
- package/es/element/EleDeviceState/Component.js +103 -0
- package/es/element/EleDeviceState/PropsSet/FormBindDevice/index.js +53 -0
- package/es/element/EleDeviceState/PropsSet/index.js +26 -0
- package/es/element/EleDeviceState/index.css +13 -0
- package/es/element/EleDeviceState/index.js +62 -0
- package/es/element/EleDeviceUpdateTime/Component.js +94 -0
- package/es/element/EleDeviceUpdateTime/PropsSet/FormBindDateFormat/index.js +32 -0
- package/es/element/EleDeviceUpdateTime/PropsSet/FormBindDevice/index.js +52 -0
- package/es/element/EleDeviceUpdateTime/PropsSet/index.js +27 -0
- package/es/element/EleDeviceUpdateTime/index.css +9 -0
- package/es/element/EleDeviceUpdateTime/index.js +57 -0
- package/es/element/EleFan/Component.js +74 -0
- package/es/element/EleFan/PropsSet/FormBindDevice/index.js +46 -0
- package/es/element/EleFan/PropsSet/FormBindPoint/FaultQuestion.js +18 -0
- package/es/element/EleFan/PropsSet/FormBindPoint/FrostQuestion.js +18 -0
- package/es/element/EleFan/PropsSet/FormBindPoint/RefrigerationQuestion.js +18 -0
- package/es/element/EleFan/PropsSet/FormBindPoint/SwitchQuestion.js +12 -0
- package/es/element/EleFan/PropsSet/FormBindPoint/index.js +519 -0
- package/es/element/EleFan/PropsSet/index.js +66 -0
- package/es/element/EleFan/Tooltip.js +8 -0
- package/es/element/EleFan/index.css +25 -0
- package/es/element/EleFan/index.js +113 -0
- package/es/element/EleFanBySvg/PropsSet/FormBindPoint/FaultQuestion.js +18 -0
- package/es/element/EleFanBySvg/PropsSet/FormBindPoint/FrostQuestion.js +18 -0
- package/es/element/EleFanBySvg/PropsSet/FormBindPoint/RefrigerationQuestion.js +18 -0
- package/es/element/EleFanBySvg/PropsSet/FormBindPoint/SwitchQuestion.js +12 -0
- package/es/element/EleFanBySvg/PropsSet/FormBindPoint/index.js +473 -0
- package/es/element/EleFanBySvg/PropsSet/index.js +25 -0
- package/es/element/EleFanBySvg/Tooltip.js +8 -0
- package/es/element/EleFanBySvg/index.js +320 -0
- package/es/element/EleGauge/Component.js +128 -0
- package/es/element/EleGauge/PropsSet/OtherPropsSet/index.js +92 -0
- package/es/element/EleGauge/PropsSet/index.js +29 -0
- package/es/element/EleGauge/index.css +7 -0
- package/es/element/EleGauge/index.js +66 -0
- package/es/element/EleIcon/Component.js +53 -0
- package/es/element/EleIcon/PropsSet/IconPropsSet/index.js +105 -0
- package/es/element/EleIcon/PropsSet/index.js +29 -0
- package/es/element/EleIcon/index.css +13 -0
- package/es/element/EleIcon/index.js +58 -0
- package/es/element/EleImage/PropsSet/ImagePropsSet/index.js +56 -0
- package/es/element/EleImage/PropsSet/index.js +21 -0
- package/es/element/EleImage/index.js +61 -0
- package/es/element/EleIndicatorLight/Component.js +57 -0
- package/es/element/EleIndicatorLight/PropsSet/ColorPropsSet/index.js +63 -0
- package/es/element/EleIndicatorLight/PropsSet/index.js +29 -0
- package/es/element/EleIndicatorLight/index.css +4 -0
- package/es/element/EleIndicatorLight/index.js +66 -0
- package/es/element/ElePointImage/Component.js +60 -0
- package/es/element/ElePointImage/PropsSet/ImagePropsSet/index.js +84 -0
- package/es/element/ElePointImage/PropsSet/index.js +29 -0
- package/es/element/ElePointImage/index.css +9 -0
- package/es/element/ElePointImage/index.js +58 -0
- package/es/element/ElePointList/Component.js +142 -0
- package/es/element/ElePointList/PropsSet/index.js +25 -0
- package/es/element/ElePointList/index.css +22 -0
- package/es/element/ElePointList/index.js +67 -0
- package/es/element/ElePointState/Component.js +71 -0
- package/es/element/ElePointState/PropsSet/IconPropsSet/index.js +140 -0
- package/es/element/ElePointState/PropsSet/index.js +29 -0
- package/es/element/ElePointState/index.css +10 -0
- package/es/element/ElePointState/index.js +60 -0
- package/es/element/ElePointValue/Component.js +79 -0
- package/es/element/ElePointValue/PropsSet/GlobalPropSet/index.js +60 -0
- package/es/element/ElePointValue/PropsSet/TitlePropsSet/index.js +42 -0
- package/es/element/ElePointValue/PropsSet/UnitPropsSet/index.js +54 -0
- package/es/element/ElePointValue/PropsSet/ValuePropsSet/index.js +119 -0
- package/es/element/ElePointValue/PropsSet/index.js +41 -0
- package/es/element/ElePointValue/index.css +30 -0
- package/es/element/ElePointValue/index.js +63 -0
- package/es/element/EleShine/Component.js +61 -0
- package/es/element/EleShine/PropsSet/OtherPropsSet/index.js +63 -0
- package/es/element/EleShine/PropsSet/index.js +29 -0
- package/es/element/EleShine/index.css +15 -0
- package/es/element/EleShine/index.js +70 -0
- package/es/element/EleState/Tooltip.js +8 -0
- package/es/element/EleState/index.js +115 -0
- package/es/element/EleSvg/index.js +35 -0
- package/es/element/EleSwitch/Component.js +66 -0
- package/es/element/EleSwitch/PropsSet/OtherPropsSet/index.js +49 -0
- package/es/element/EleSwitch/PropsSet/index.js +25 -0
- package/es/element/EleSwitch/index.css +6 -0
- package/es/element/EleSwitch/index.js +62 -0
- package/es/element/EleText/Component.js +19 -0
- package/es/element/EleText/index.css +6 -0
- package/es/element/EleText/index.js +69 -0
- package/es/element/PipeNodes/NodeBL/index.js +74 -0
- package/es/element/PipeNodes/NodeBR/index.js +75 -0
- package/es/element/PipeNodes/NodeBottom/index.js +82 -0
- package/es/element/PipeNodes/NodeCenter/index.js +89 -0
- package/es/element/PipeNodes/NodeHorizontal/index.js +72 -0
- package/es/element/PipeNodes/NodeLeft/index.js +81 -0
- package/es/element/PipeNodes/NodeRight/index.js +81 -0
- package/es/element/PipeNodes/NodeTL/index.js +74 -0
- package/es/element/PipeNodes/NodeTL.TEMP/index.js +151 -0
- package/es/element/PipeNodes/NodeTR/index.js +74 -0
- package/es/element/PipeNodes/NodeTop/index.js +81 -0
- package/es/element/PipeNodes/NodeVertical/index.js +72 -0
- package/es/element/PipeNodes/portStyle.js +18 -0
- package/es/element/PointCard/PointCard1/Component.js +97 -0
- package/es/element/PointCard/PointCard1/PropsSet/IconPropsSet/index.js +147 -0
- package/es/element/PointCard/PointCard1/PropsSet/PointValuePropsSet/index.js +120 -0
- package/es/element/PointCard/PointCard1/PropsSet/TitlePropsSet/index.js +43 -0
- package/es/element/PointCard/PointCard1/PropsSet/index.js +37 -0
- package/es/element/PointCard/PointCard1/index.css +44 -0
- package/es/element/PointCard/PointCard1/index.js +88 -0
- package/es/element/PointCard/PointCard2/Component/PointItem.js +87 -0
- package/es/element/PointCard/PointCard2/Component/PointItemPlaceholder.js +33 -0
- package/es/element/PointCard/PointCard2/Component/index.css +30 -0
- package/es/element/PointCard/PointCard2/Component/index.js +53 -0
- package/es/element/PointCard/PointCard2/PropsSet/GlobalPropSet/index.js +14 -0
- package/es/element/PointCard/PointCard2/PropsSet/IconPropsSet/index.js +32 -0
- package/es/element/PointCard/PointCard2/PropsSet/PointItemSetDrawer/index.css +7 -0
- package/es/element/PointCard/PointCard2/PropsSet/PointItemSetDrawer/index.js +175 -0
- package/es/element/PointCard/PointCard2/PropsSet/TitlePropsSet/index.js +31 -0
- package/es/element/PointCard/PointCard2/PropsSet/index.js +52 -0
- package/es/element/PointCard/PointCard2/index.js +79 -0
- package/es/element/PointCard/PointCard3/Component.js +107 -0
- package/es/element/PointCard/PointCard3/PropsSet/IconPropsSet/index.js +178 -0
- package/es/element/PointCard/PointCard3/PropsSet/TitlePropsSet/index.js +43 -0
- package/es/element/PointCard/PointCard3/PropsSet/index.js +33 -0
- package/es/element/PointCard/PointCard3/index.css +26 -0
- package/es/element/PointCard/PointCard3/index.js +79 -0
- package/es/element/PointCard/PointListCard/Component.js +169 -0
- package/es/element/PointCard/PointListCard/PropsSet/GlobalPropSet/index.js +14 -0
- package/es/element/PointCard/PointListCard/PropsSet/LabelPropsSet/index.js +31 -0
- package/es/element/PointCard/PointListCard/PropsSet/TitlePropsSet/index.js +43 -0
- package/es/element/PointCard/PointListCard/PropsSet/ValuePropsSet/index.js +31 -0
- package/es/element/PointCard/PointListCard/PropsSet/index.js +41 -0
- package/es/element/PointCard/PointListCard/index.css +24 -0
- package/es/element/PointCard/PointListCard/index.js +87 -0
- package/es/element/PointControl/PointControl1/Component.js +110 -0
- package/es/element/PointControl/PointControl1/PropsSet/GlobalPropsSet/index.js +16 -0
- package/es/element/PointControl/PointControl1/PropsSet/PointValuePropsSet/index.js +31 -0
- package/es/element/PointControl/PointControl1/PropsSet/TitlePropsSet/index.js +43 -0
- package/es/element/PointControl/PointControl1/PropsSet/index.js +33 -0
- package/es/element/PointControl/PointControl1/index.css +21 -0
- package/es/element/PointControl/PointControl1/index.js +83 -0
- package/es/element/PointControl/PointControl3/Component.js +123 -0
- package/es/element/PointControl/PointControl3/PropsSet/IconPropsSet/index.js +147 -0
- package/es/element/PointControl/PointControl3/PropsSet/SubTitlePropsSet/index.js +53 -0
- package/es/element/PointControl/PointControl3/PropsSet/SwitchPropsSet/index.js +49 -0
- package/es/element/PointControl/PointControl3/PropsSet/TitlePropsSet/index.js +43 -0
- package/es/element/PointControl/PointControl3/PropsSet/index.js +41 -0
- package/es/element/PointControl/PointControl3/index.css +8 -0
- package/es/element/PointControl/PointControl3/index.js +94 -0
- package/es/element/nodeBase.js +48 -0
- package/es/element/reactShapeBase.js +47 -0
- package/es/element/register.js +131 -0
- package/es/element/type.d.ts +143 -0
- package/es/element/utils/getValueByExpression.js +22 -0
- package/es/element/utils/handleEleEvent.js +60 -0
- package/es/element/utils/index.js +4 -0
- package/es/element/utils/pointWrite.js +197 -0
- package/es/element/utils/shapeReactComponentShouldUpdate.js +7 -0
- package/es/global.css +162 -0
- package/es/graph/graphCore.js +501 -0
- package/es/graph/tools/ToolTipTool.js +139 -0
- package/es/graph/tools/registerX6Tool.js +1 -0
- package/es/hooks/index.js +7 -0
- package/es/hooks/useCMDKey.js +19 -0
- package/es/hooks/useEleEventHandle.js +36 -0
- package/es/hooks/useFirstMountState.js +9 -0
- package/es/hooks/useForceUpdate.js +23 -0
- package/es/hooks/useMittNamespace.js +7 -0
- package/es/hooks/usePointWatch.js +30 -0
- package/es/hooks/useQuery.js +6 -0
- package/es/models/useEditor.js +185 -0
- package/es/models/useElePanel.js +23 -0
- package/es/pages/display/Player/index.css +15 -0
- package/es/pages/display/Player/index.js +434 -0
- package/es/pages/display/components/Empty/index.css +9 -0
- package/es/pages/display/components/Empty/index.js +22 -0
- package/es/pages/display/components/Tools/index.js +86 -0
- package/es/pages/display/index.css +4 -0
- package/es/pages/display/index.js +231 -0
- package/es/pages/document.ejs +77 -0
- package/es/pages/editor/Palette/PaletteDropdown/index.css +9 -0
- package/es/pages/editor/Palette/PaletteDropdown/index.js +178 -0
- package/es/pages/editor/Palette/index.css +13 -0
- package/es/pages/editor/Palette/index.js +86 -0
- package/es/pages/editor/PanelLeft/BasicShapeList/index.js +32 -0
- package/es/pages/editor/PanelLeft/BasicShapeList/listData.js +63 -0
- package/es/pages/editor/PanelLeft/BorderBoxEleList/index.css +9 -0
- package/es/pages/editor/PanelLeft/BorderBoxEleList/index.js +19 -0
- package/es/pages/editor/PanelLeft/BorderBoxEleList/index.less.d.ts +7 -0
- package/es/pages/editor/PanelLeft/BorderBoxEleList/listData.js +49 -0
- package/es/pages/editor/PanelLeft/DecorationEleList/index.css +12 -0
- package/es/pages/editor/PanelLeft/DecorationEleList/index.js +21 -0
- package/es/pages/editor/PanelLeft/DecorationEleList/index.less.d.ts +7 -0
- package/es/pages/editor/PanelLeft/DecorationEleList/listData.js +65 -0
- package/es/pages/editor/PanelLeft/GroupManageDialog/index.css +32 -0
- package/es/pages/editor/PanelLeft/GroupManageDialog/index.js +300 -0
- package/es/pages/editor/PanelLeft/ImgConfigDialog/index.css +0 -0
- package/es/pages/editor/PanelLeft/ImgConfigDialog/index.js +220 -0
- package/es/pages/editor/PanelLeft/ImgGroup/index.css +62 -0
- package/es/pages/editor/PanelLeft/ImgGroup/index.js +317 -0
- package/es/pages/editor/PanelLeft/MetaEleList/index.js +37 -0
- package/es/pages/editor/PanelLeft/MetaEleList/listData.js +88 -0
- package/es/pages/editor/PanelLeft/MineImgGroup/index.css +0 -0
- package/es/pages/editor/PanelLeft/MineImgGroup/index.js +163 -0
- package/es/pages/editor/PanelLeft/PipeEleList/index.css +0 -0
- package/es/pages/editor/PanelLeft/PipeEleList/index.js +33 -0
- package/es/pages/editor/PanelLeft/PipeEleList/listData.js +69 -0
- package/es/pages/editor/PanelLeft/PointCardEleList/index.js +31 -0
- package/es/pages/editor/PanelLeft/PointCardEleList/listData.js +37 -0
- package/es/pages/editor/PanelLeft/RecommendEleList/index.js +37 -0
- package/es/pages/editor/PanelLeft/RecommendEleList/listData.js +27 -0
- package/es/pages/editor/PanelLeft/SystemImgGroupList/index.css +6 -0
- package/es/pages/editor/PanelLeft/SystemImgGroupList/index.js +119 -0
- package/es/pages/editor/PanelLeft/index.css +100 -0
- package/es/pages/editor/PanelLeft/index.js +200 -0
- package/es/pages/editor/PanelLeft/index.less.d.ts +11 -0
- package/es/pages/editor/PanelRight/components/FormBindEvent/index.js +202 -0
- package/es/pages/editor/PanelRight/components/FormEleBorderStyle/index.js +145 -0
- package/es/pages/editor/PanelRight/components/FormEleLayout/index.css +8 -0
- package/es/pages/editor/PanelRight/components/FormEleLayout/index.js +214 -0
- package/es/pages/editor/PanelRight/components/FormElePadding/index.js +11 -0
- package/es/pages/editor/PanelRight/components/FormFillStyle/index.js +92 -0
- package/es/pages/editor/PanelRight/components/FormFontStyle/index.js +186 -0
- package/es/pages/editor/PanelRight/components/FormLayer/index.js +222 -0
- package/es/pages/editor/PanelRight/index.css +26 -0
- package/es/pages/editor/PanelRight/index.js +164 -0
- package/es/pages/editor/PanelRight/index.less.d.ts +7 -0
- package/es/pages/editor/PanelTop/FullScreen/index.js +31 -0
- package/es/pages/editor/PanelTop/HistoryControl/index.js +78 -0
- package/es/pages/editor/PanelTop/HotKeyDescribe/index.css +35 -0
- package/es/pages/editor/PanelTop/HotKeyDescribe/index.js +114 -0
- package/es/pages/editor/PanelTop/HotKeyDescribe/index.less.d.ts +10 -0
- package/es/pages/editor/PanelTop/Save/index.js +179 -0
- package/es/pages/editor/PanelTop/ZoomControl/index.css +0 -0
- package/es/pages/editor/PanelTop/ZoomControl/index.js +100 -0
- package/es/pages/editor/PanelTop/index.css +57 -0
- package/es/pages/editor/PanelTop/index.js +321 -0
- package/es/pages/editor/index.css +39 -0
- package/es/pages/editor/index.js +298 -0
- package/es/provider/index.js +2 -0
- package/es/provider/mittMeat.js +4 -0
- package/es/services/common/Uploader.js +45 -0
- package/es/services/common/index.js +8 -0
- package/es/services/common/typings.d.ts +15 -0
- package/es/services/gateway/CompanyConfiguration.js +87 -0
- package/es/services/gateway/Device.js +437 -0
- package/es/services/gateway/DeviceAuthorizationApply.js +111 -0
- package/es/services/gateway/DeviceGroup.js +137 -0
- package/es/services/gateway/Gateway.js +442 -0
- package/es/services/gateway/GatewayGroup.js +112 -0
- package/es/services/gateway/Point.js +137 -0
- package/es/services/gateway/UserDevice.js +112 -0
- package/es/services/gateway/index.js +22 -0
- package/es/services/gateway/typings.d.ts +1674 -0
- package/es/services/master/Func.js +33 -0
- package/es/services/master/Role.js +153 -0
- package/es/services/master/User.js +244 -0
- package/es/services/master/index.js +12 -0
- package/es/services/master/typings.d.ts +362 -0
- package/es/services/product/ConfigurationImg.js +87 -0
- package/es/services/product/ConfigurationImgGroup.js +87 -0
- package/es/services/product/DeviceType.js +37 -0
- package/es/services/product/Identifier.js +33 -0
- package/es/services/product/PointEnum.js +87 -0
- package/es/services/product/PointGroup.js +112 -0
- package/es/services/product/Product.js +351 -0
- package/es/services/product/ProductCompany.js +183 -0
- package/es/services/product/index.js +22 -0
- package/es/services/product/typings.d.ts +1045 -0
- package/es/services/project/ProjectGateway.js +62 -0
- package/es/services/project/ProjectResource.js +205 -0
- package/es/services/project/ProjectRole.js +302 -0
- package/es/services/project/ProjectUserPermission.js +217 -0
- package/es/services/project/Subarea.js +236 -0
- package/es/services/project/UserSubarea.js +62 -0
- package/es/services/project/index.js +18 -0
- package/es/services/project/typings.d.ts +1609 -0
- package/es/services/request.js +196 -0
- package/es/shims.x6.d.ts +15 -0
- package/es/typings.d.ts +182 -0
- package/es/utils/auth.js +90 -0
- package/es/utils/cssStyle.js +11 -0
- package/es/utils/decomposeMatrix.js +46 -0
- package/es/utils/events.js +7 -0
- package/es/utils/getMittMeta.js +14 -0
- package/es/utils/index.js +163 -0
- package/es/utils/isInIframe.js +8 -0
- package/es/utils/queryToObject.js +19 -0
- package/es/utils/svg.js +46 -0
- package/es/utils/type.js +3 -0
- package/es/x6Reset.css +36 -0
- package/package.json +84 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
import React from "react";
|
|
12
|
+
import { Input, Popover } from 'antd';
|
|
13
|
+
import { useState, useEffect } from 'react';
|
|
14
|
+
import { DownOutlined } from '@ant-design/icons';
|
|
15
|
+
import { useMount, useRequest } from 'ahooks';
|
|
16
|
+
import { GetProductConfig } from "../../services/product/Product";
|
|
17
|
+
import { GetDevicePoint } from "../../services/gateway/Device";
|
|
18
|
+
import { getInfoFromPointId } from "../../utils";
|
|
19
|
+
import DevicePointTable from "./DevicePointTable";
|
|
20
|
+
import ProductPointTable from "./ProductPointTable";
|
|
21
|
+
import styles from "./index.css";
|
|
22
|
+
var PointSelect = function PointSelect(_ref) {
|
|
23
|
+
var style = _ref.style,
|
|
24
|
+
_ref$size = _ref.size,
|
|
25
|
+
size = _ref$size === void 0 ? 'small' : _ref$size,
|
|
26
|
+
onChange = _ref.onChange,
|
|
27
|
+
value = _ref.value,
|
|
28
|
+
productId = _ref.productId,
|
|
29
|
+
deviceId = _ref.deviceId,
|
|
30
|
+
disabledUnWriteable = _ref.disabledUnWriteable;
|
|
31
|
+
var _useState = useState(),
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
pointInfo = _useState2[0],
|
|
34
|
+
setPointInfo = _useState2[1];
|
|
35
|
+
var _useState3 = useState(false),
|
|
36
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
37
|
+
visible = _useState4[0],
|
|
38
|
+
setVisible = _useState4[1];
|
|
39
|
+
// const [devicePointList, setDevicePointList] = useState<
|
|
40
|
+
// GatewayAPI.DevicePointModel[]
|
|
41
|
+
// >([]);
|
|
42
|
+
var _useState5 = useState([]),
|
|
43
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
44
|
+
productPointList = _useState6[0],
|
|
45
|
+
setProductPointList = _useState6[1];
|
|
46
|
+
var _useState7 = useState(false),
|
|
47
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
48
|
+
loading = _useState8[0],
|
|
49
|
+
setLoading = _useState8[1];
|
|
50
|
+
var handleDevicePointChange = function handleDevicePointChange(val) {
|
|
51
|
+
var _getInfoFromPointId;
|
|
52
|
+
var info = {
|
|
53
|
+
pointId: val.pointId,
|
|
54
|
+
name: val.pointName,
|
|
55
|
+
identifierName: (_getInfoFromPointId = getInfoFromPointId(val === null || val === void 0 ? void 0 : val.pointId)) === null || _getInfoFromPointId === void 0 ? void 0 : _getInfoFromPointId.identifierName
|
|
56
|
+
};
|
|
57
|
+
setPointInfo(info);
|
|
58
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(info);
|
|
59
|
+
setVisible(false);
|
|
60
|
+
};
|
|
61
|
+
var handleProductPointChange = function handleProductPointChange(val) {
|
|
62
|
+
var info = {
|
|
63
|
+
name: val.pointName,
|
|
64
|
+
identifierName: val.identifierName
|
|
65
|
+
};
|
|
66
|
+
setPointInfo(info);
|
|
67
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(info);
|
|
68
|
+
setVisible(false);
|
|
69
|
+
};
|
|
70
|
+
var _useRequest = useRequest( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
71
|
+
var _yield$GetDevicePoint, success, data;
|
|
72
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
73
|
+
while (1) switch (_context.prev = _context.next) {
|
|
74
|
+
case 0:
|
|
75
|
+
if (deviceId) {
|
|
76
|
+
_context.next = 2;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
return _context.abrupt("return", []);
|
|
80
|
+
case 2:
|
|
81
|
+
setLoading(true);
|
|
82
|
+
_context.next = 5;
|
|
83
|
+
return GetDevicePoint({
|
|
84
|
+
deviceIdList: [deviceId]
|
|
85
|
+
});
|
|
86
|
+
case 5:
|
|
87
|
+
_yield$GetDevicePoint = _context.sent;
|
|
88
|
+
success = _yield$GetDevicePoint.success;
|
|
89
|
+
data = _yield$GetDevicePoint.data;
|
|
90
|
+
if (success) {
|
|
91
|
+
_context.next = 10;
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
return _context.abrupt("return", []);
|
|
95
|
+
case 10:
|
|
96
|
+
return _context.abrupt("return", data || []);
|
|
97
|
+
case 11:
|
|
98
|
+
case "end":
|
|
99
|
+
return _context.stop();
|
|
100
|
+
}
|
|
101
|
+
}, _callee);
|
|
102
|
+
})), {
|
|
103
|
+
cacheKey: "device-pointOptions-".concat(deviceId),
|
|
104
|
+
refreshDeps: [deviceId],
|
|
105
|
+
onError: function onError(err) {
|
|
106
|
+
console.error(err);
|
|
107
|
+
},
|
|
108
|
+
onFinally: function onFinally() {
|
|
109
|
+
setLoading(false);
|
|
110
|
+
}
|
|
111
|
+
}),
|
|
112
|
+
devicePointList = _useRequest.data;
|
|
113
|
+
useEffect(function () {
|
|
114
|
+
if (!value && deviceId) {
|
|
115
|
+
setPointInfo(undefined);
|
|
116
|
+
}
|
|
117
|
+
}, [deviceId, value]);
|
|
118
|
+
useEffect(function () {
|
|
119
|
+
var fetchProductPointList = /*#__PURE__*/function () {
|
|
120
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
121
|
+
var _yield$GetProductConf, success, data;
|
|
122
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
123
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
124
|
+
case 0:
|
|
125
|
+
_context2.prev = 0;
|
|
126
|
+
setLoading(true);
|
|
127
|
+
_context2.next = 4;
|
|
128
|
+
return GetProductConfig({
|
|
129
|
+
productId: productId
|
|
130
|
+
});
|
|
131
|
+
case 4:
|
|
132
|
+
_yield$GetProductConf = _context2.sent;
|
|
133
|
+
success = _yield$GetProductConf.success;
|
|
134
|
+
data = _yield$GetProductConf.data;
|
|
135
|
+
if (success) {
|
|
136
|
+
_context2.next = 9;
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
return _context2.abrupt("return");
|
|
140
|
+
case 9:
|
|
141
|
+
setProductPointList((data === null || data === void 0 ? void 0 : data.productPointList) || []);
|
|
142
|
+
_context2.next = 15;
|
|
143
|
+
break;
|
|
144
|
+
case 12:
|
|
145
|
+
_context2.prev = 12;
|
|
146
|
+
_context2.t0 = _context2["catch"](0);
|
|
147
|
+
console.error(_context2.t0);
|
|
148
|
+
case 15:
|
|
149
|
+
_context2.prev = 15;
|
|
150
|
+
setLoading(false);
|
|
151
|
+
return _context2.finish(15);
|
|
152
|
+
case 18:
|
|
153
|
+
case "end":
|
|
154
|
+
return _context2.stop();
|
|
155
|
+
}
|
|
156
|
+
}, _callee2, null, [[0, 12, 15, 18]]);
|
|
157
|
+
}));
|
|
158
|
+
return function fetchProductPointList() {
|
|
159
|
+
return _ref3.apply(this, arguments);
|
|
160
|
+
};
|
|
161
|
+
}();
|
|
162
|
+
if (productId) {
|
|
163
|
+
fetchProductPointList();
|
|
164
|
+
}
|
|
165
|
+
}, [productId, visible]);
|
|
166
|
+
useEffect(function () {
|
|
167
|
+
if (value && productId) {
|
|
168
|
+
var point = productPointList.find(function (item) {
|
|
169
|
+
return item.identifierName === value;
|
|
170
|
+
});
|
|
171
|
+
setPointInfo({
|
|
172
|
+
name: point === null || point === void 0 ? void 0 : point.pointName,
|
|
173
|
+
identifierName: point === null || point === void 0 ? void 0 : point.identifierName
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}, [value, productId, productPointList]);
|
|
177
|
+
useMount(function () {
|
|
178
|
+
var getPointNameWhenInit = /*#__PURE__*/function () {
|
|
179
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
|
|
180
|
+
var _getInfoFromPointId3, _yield$GetDevicePoint2, success, data, point;
|
|
181
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
182
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
183
|
+
case 0:
|
|
184
|
+
_context3.prev = 0;
|
|
185
|
+
setLoading(true);
|
|
186
|
+
_context3.next = 4;
|
|
187
|
+
return GetDevicePoint(params);
|
|
188
|
+
case 4:
|
|
189
|
+
_yield$GetDevicePoint2 = _context3.sent;
|
|
190
|
+
success = _yield$GetDevicePoint2.success;
|
|
191
|
+
data = _yield$GetDevicePoint2.data;
|
|
192
|
+
if (success) {
|
|
193
|
+
_context3.next = 9;
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
return _context3.abrupt("return");
|
|
197
|
+
case 9:
|
|
198
|
+
point = (data || []).find(function (item) {
|
|
199
|
+
var _getInfoFromPointId2;
|
|
200
|
+
return ((_getInfoFromPointId2 = getInfoFromPointId(item.pointId)) === null || _getInfoFromPointId2 === void 0 ? void 0 : _getInfoFromPointId2.identifierName) === value;
|
|
201
|
+
});
|
|
202
|
+
setPointInfo({
|
|
203
|
+
pointId: point === null || point === void 0 ? void 0 : point.pointId,
|
|
204
|
+
name: point === null || point === void 0 ? void 0 : point.pointName,
|
|
205
|
+
identifierName: (_getInfoFromPointId3 = getInfoFromPointId(point === null || point === void 0 ? void 0 : point.pointId)) === null || _getInfoFromPointId3 === void 0 ? void 0 : _getInfoFromPointId3.identifierName
|
|
206
|
+
});
|
|
207
|
+
_context3.next = 16;
|
|
208
|
+
break;
|
|
209
|
+
case 13:
|
|
210
|
+
_context3.prev = 13;
|
|
211
|
+
_context3.t0 = _context3["catch"](0);
|
|
212
|
+
console.error(_context3.t0);
|
|
213
|
+
case 16:
|
|
214
|
+
_context3.prev = 16;
|
|
215
|
+
setLoading(false);
|
|
216
|
+
return _context3.finish(16);
|
|
217
|
+
case 19:
|
|
218
|
+
case "end":
|
|
219
|
+
return _context3.stop();
|
|
220
|
+
}
|
|
221
|
+
}, _callee3, null, [[0, 13, 16, 19]]);
|
|
222
|
+
}));
|
|
223
|
+
return function getPointNameWhenInit(_x2) {
|
|
224
|
+
return _ref4.apply(this, arguments);
|
|
225
|
+
};
|
|
226
|
+
}();
|
|
227
|
+
if (deviceId && value) {
|
|
228
|
+
getPointNameWhenInit({
|
|
229
|
+
deviceIdList: [deviceId],
|
|
230
|
+
pointIdentifierNameList: [value]
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
return /*#__PURE__*/React.createElement(Popover, {
|
|
235
|
+
content: deviceId ? /*#__PURE__*/React.createElement(DevicePointTable, {
|
|
236
|
+
onChange: handleDevicePointChange,
|
|
237
|
+
data: devicePointList || [],
|
|
238
|
+
loading: loading,
|
|
239
|
+
disabledUnWriteable: disabledUnWriteable,
|
|
240
|
+
pointId: pointInfo === null || pointInfo === void 0 ? void 0 : pointInfo.pointId,
|
|
241
|
+
onClose: function onClose() {
|
|
242
|
+
return setVisible(false);
|
|
243
|
+
}
|
|
244
|
+
}) : /*#__PURE__*/React.createElement(ProductPointTable, {
|
|
245
|
+
onChange: handleProductPointChange,
|
|
246
|
+
data: productPointList,
|
|
247
|
+
loading: loading,
|
|
248
|
+
identifierName: pointInfo === null || pointInfo === void 0 ? void 0 : pointInfo.identifierName,
|
|
249
|
+
onClose: function onClose() {
|
|
250
|
+
return setVisible(false);
|
|
251
|
+
}
|
|
252
|
+
}),
|
|
253
|
+
placement: "leftTop",
|
|
254
|
+
trigger: "click",
|
|
255
|
+
visible: visible,
|
|
256
|
+
overlayInnerStyle: {
|
|
257
|
+
width: deviceId ? 620 : 360
|
|
258
|
+
},
|
|
259
|
+
onVisibleChange: setVisible
|
|
260
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
261
|
+
value: pointInfo === null || pointInfo === void 0 ? void 0 : pointInfo.name,
|
|
262
|
+
size: size,
|
|
263
|
+
style: style,
|
|
264
|
+
className: styles['cursor-pointer'],
|
|
265
|
+
onClick: function onClick() {
|
|
266
|
+
return setVisible(true);
|
|
267
|
+
},
|
|
268
|
+
readOnly: true,
|
|
269
|
+
placeholder: "",
|
|
270
|
+
suffix: /*#__PURE__*/React.createElement(DownOutlined, {
|
|
271
|
+
style: {
|
|
272
|
+
color: 'rgba(0,0,0,.25)',
|
|
273
|
+
fontSize: 12
|
|
274
|
+
}
|
|
275
|
+
})
|
|
276
|
+
}));
|
|
277
|
+
};
|
|
278
|
+
export default PointSelect;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
8
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
9
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
10
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
11
|
+
import React from "react";
|
|
12
|
+
import { forwardRef, useImperativeHandle, useRef } from 'react';
|
|
13
|
+
import ReactDOM from 'react-dom';
|
|
14
|
+
import { Modal, Input, Form } from 'antd';
|
|
15
|
+
var PromptForm = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
16
|
+
var rules = _ref.rules,
|
|
17
|
+
placeholder = _ref.placeholder,
|
|
18
|
+
onPressEnter = _ref.onPressEnter;
|
|
19
|
+
var value = useRef();
|
|
20
|
+
useImperativeHandle(ref, function () {
|
|
21
|
+
return {
|
|
22
|
+
getValue: function getValue() {
|
|
23
|
+
return value.current;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
return /*#__PURE__*/React.createElement(Form, {
|
|
28
|
+
onValuesChange: function onValuesChange(_, values) {
|
|
29
|
+
value.current = values.input;
|
|
30
|
+
}
|
|
31
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
32
|
+
name: "input",
|
|
33
|
+
rules: rules
|
|
34
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
35
|
+
placeholder: placeholder,
|
|
36
|
+
onPressEnter: onPressEnter
|
|
37
|
+
})));
|
|
38
|
+
});
|
|
39
|
+
function Prompt(_ref2) {
|
|
40
|
+
var rules = _ref2.rules,
|
|
41
|
+
placeholder = _ref2.placeholder,
|
|
42
|
+
_ref2$modalProps = _ref2.modalProps,
|
|
43
|
+
modalProps = _ref2$modalProps === void 0 ? {} : _ref2$modalProps,
|
|
44
|
+
visible = _ref2.visible,
|
|
45
|
+
close = _ref2.close,
|
|
46
|
+
title = _ref2.title,
|
|
47
|
+
afterClose = _ref2.afterClose;
|
|
48
|
+
var formRef = useRef(null);
|
|
49
|
+
var handleOk = /*#__PURE__*/function () {
|
|
50
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
51
|
+
var _formRef$current, _value;
|
|
52
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
53
|
+
while (1) switch (_context.prev = _context.next) {
|
|
54
|
+
case 0:
|
|
55
|
+
_context.prev = 0;
|
|
56
|
+
_context.next = 3;
|
|
57
|
+
return (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.getValue();
|
|
58
|
+
case 3:
|
|
59
|
+
_value = _context.sent;
|
|
60
|
+
close(_value);
|
|
61
|
+
_context.next = 9;
|
|
62
|
+
break;
|
|
63
|
+
case 7:
|
|
64
|
+
_context.prev = 7;
|
|
65
|
+
_context.t0 = _context["catch"](0);
|
|
66
|
+
case 9:
|
|
67
|
+
case "end":
|
|
68
|
+
return _context.stop();
|
|
69
|
+
}
|
|
70
|
+
}, _callee, null, [[0, 7]]);
|
|
71
|
+
}));
|
|
72
|
+
return function handleOk() {
|
|
73
|
+
return _ref3.apply(this, arguments);
|
|
74
|
+
};
|
|
75
|
+
}();
|
|
76
|
+
return /*#__PURE__*/React.createElement(Modal, _extends({}, modalProps, {
|
|
77
|
+
visible: visible,
|
|
78
|
+
onOk: handleOk,
|
|
79
|
+
onCancel: function onCancel() {
|
|
80
|
+
return close();
|
|
81
|
+
},
|
|
82
|
+
title: title,
|
|
83
|
+
getContainer: false,
|
|
84
|
+
afterClose: afterClose
|
|
85
|
+
}), /*#__PURE__*/React.createElement(PromptForm, {
|
|
86
|
+
ref: formRef,
|
|
87
|
+
rules: rules,
|
|
88
|
+
placeholder: placeholder,
|
|
89
|
+
onPressEnter: handleOk
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
export default function prompt(config) {
|
|
93
|
+
return new Promise(function (resolve, reject) {
|
|
94
|
+
var div = document.createElement('div');
|
|
95
|
+
document.body.appendChild(div);
|
|
96
|
+
// eslint-disable-next-line no-use-before-define
|
|
97
|
+
var currentConfig = _objectSpread(_objectSpread({}, config), {}, {
|
|
98
|
+
close: close,
|
|
99
|
+
visible: true
|
|
100
|
+
});
|
|
101
|
+
var destroy = function destroy(value) {
|
|
102
|
+
var unmountResult = ReactDOM.unmountComponentAtNode(div);
|
|
103
|
+
if (unmountResult && div.parentNode) {
|
|
104
|
+
div.parentNode.removeChild(div);
|
|
105
|
+
}
|
|
106
|
+
if (value !== undefined) {
|
|
107
|
+
resolve(value);
|
|
108
|
+
} else {
|
|
109
|
+
reject(value);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
function render(props) {
|
|
113
|
+
ReactDOM.render( /*#__PURE__*/React.createElement(Prompt, props), div);
|
|
114
|
+
}
|
|
115
|
+
function close(value) {
|
|
116
|
+
currentConfig = _objectSpread(_objectSpread({}, currentConfig), {}, {
|
|
117
|
+
visible: false,
|
|
118
|
+
afterClose: function afterClose() {
|
|
119
|
+
return destroy(value);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
render(currentConfig);
|
|
123
|
+
}
|
|
124
|
+
render(currentConfig);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { useState, useEffect } from 'react';
|
|
9
|
+
import { Slider, InputNumber } from 'antd';
|
|
10
|
+
import styles from "./index.css";
|
|
11
|
+
var SliderWithInput = function SliderWithInput(_ref) {
|
|
12
|
+
var value = _ref.value,
|
|
13
|
+
onChange = _ref.onChange,
|
|
14
|
+
_ref$max = _ref.max,
|
|
15
|
+
max = _ref$max === void 0 ? 100 : _ref$max,
|
|
16
|
+
_ref$min = _ref.min,
|
|
17
|
+
min = _ref$min === void 0 ? 0 : _ref$min,
|
|
18
|
+
_ref$unit = _ref.unit,
|
|
19
|
+
unit = _ref$unit === void 0 ? '' : _ref$unit,
|
|
20
|
+
_ref$disabled = _ref.disabled,
|
|
21
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
|
22
|
+
var _useState = useState(),
|
|
23
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
+
inputValue = _useState2[0],
|
|
25
|
+
setInputValue = _useState2[1];
|
|
26
|
+
var onValueChange = function onValueChange(val) {
|
|
27
|
+
if (typeof val === 'number') {
|
|
28
|
+
setInputValue(val);
|
|
29
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(val);
|
|
30
|
+
} else {
|
|
31
|
+
setInputValue(min);
|
|
32
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(min);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
setInputValue(value);
|
|
37
|
+
}, [value]);
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
className: styles['sliderwithinput-wrap']
|
|
40
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
className: styles['slider-wrap']
|
|
42
|
+
}, /*#__PURE__*/React.createElement(Slider, {
|
|
43
|
+
tipFormatter: function tipFormatter(val) {
|
|
44
|
+
return "".concat(val).concat(unit);
|
|
45
|
+
},
|
|
46
|
+
min: min,
|
|
47
|
+
max: max,
|
|
48
|
+
disabled: disabled,
|
|
49
|
+
value: typeof inputValue === 'number' ? inputValue : min,
|
|
50
|
+
onChange: onValueChange
|
|
51
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: styles['textinput-wrap']
|
|
53
|
+
}, /*#__PURE__*/React.createElement(InputNumber, {
|
|
54
|
+
min: min,
|
|
55
|
+
max: max,
|
|
56
|
+
formatter: function formatter(val) {
|
|
57
|
+
return "".concat(val).concat(unit);
|
|
58
|
+
},
|
|
59
|
+
disabled: disabled,
|
|
60
|
+
style: {
|
|
61
|
+
width: '65px'
|
|
62
|
+
},
|
|
63
|
+
value: inputValue,
|
|
64
|
+
onChange: onValueChange
|
|
65
|
+
})));
|
|
66
|
+
};
|
|
67
|
+
export default SliderWithInput;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var _excluded = ["width", "height", "value", "onChange", "checkedColor", "unCheckedColor"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
import React from "react";
|
|
6
|
+
var Switch = function Switch(_ref) {
|
|
7
|
+
var _ref$width = _ref.width,
|
|
8
|
+
width = _ref$width === void 0 ? '44px' : _ref$width,
|
|
9
|
+
_ref$height = _ref.height,
|
|
10
|
+
height = _ref$height === void 0 ? '22px' : _ref$height,
|
|
11
|
+
_ref$value = _ref.value,
|
|
12
|
+
value = _ref$value === void 0 ? false : _ref$value,
|
|
13
|
+
onChange = _ref.onChange,
|
|
14
|
+
_ref$checkedColor = _ref.checkedColor,
|
|
15
|
+
checkedColor = _ref$checkedColor === void 0 ? '#1890ff' : _ref$checkedColor,
|
|
16
|
+
_ref$unCheckedColor = _ref.unCheckedColor,
|
|
17
|
+
unCheckedColor = _ref$unCheckedColor === void 0 ? '#cccccc' : _ref$unCheckedColor,
|
|
18
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, restProps, {
|
|
20
|
+
onClick: function onClick(e) {
|
|
21
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(!value, e);
|
|
22
|
+
},
|
|
23
|
+
style: {
|
|
24
|
+
width: width,
|
|
25
|
+
height: height
|
|
26
|
+
}
|
|
27
|
+
}), value ? /*#__PURE__*/React.createElement("svg", {
|
|
28
|
+
width: "100%",
|
|
29
|
+
height: "100%",
|
|
30
|
+
viewBox: "0 0 200 102",
|
|
31
|
+
version: "1.1",
|
|
32
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
33
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
|
34
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
35
|
+
id: "\u9875\u9762-1",
|
|
36
|
+
stroke: "none",
|
|
37
|
+
strokeWidth: "1",
|
|
38
|
+
fill: "none",
|
|
39
|
+
fillRule: "evenodd"
|
|
40
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
41
|
+
id: "switch-ON",
|
|
42
|
+
transform: "translate(0.000000, 0.218750)",
|
|
43
|
+
fill: checkedColor,
|
|
44
|
+
fillRule: "nonzero"
|
|
45
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
46
|
+
d: "M149.21875,0 L50.78125,0 C22.734375,0 0,22.734375 0,50.78125 C0,78.828125 22.734375,101.5625 50.78125,101.5625 L149.21875,101.5625 C177.265625,101.5625 200,78.828125 200,50.78125 C200,22.734375 177.265625,0 149.21875,0 Z M149.21875,94.53125 C125.058594,94.53125 105.46875,74.9414063 105.46875,50.78125 C105.46875,26.6210937 125.058594,7.03125 149.21875,7.03125 C173.378906,7.03125 192.96875,26.6210938 192.96875,50.78125 C192.96875,74.9414063 173.378906,94.53125 149.21875,94.53125 Z",
|
|
47
|
+
id: "\u5F62\u72B6"
|
|
48
|
+
})))) : /*#__PURE__*/React.createElement("svg", {
|
|
49
|
+
width: "100%",
|
|
50
|
+
height: "100%",
|
|
51
|
+
viewBox: "0 0 200 102",
|
|
52
|
+
version: "1.1",
|
|
53
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
54
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
|
55
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
56
|
+
stroke: "none",
|
|
57
|
+
strokeWidth: "1",
|
|
58
|
+
fill: "none",
|
|
59
|
+
fillRule: "evenodd"
|
|
60
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
61
|
+
id: "switch-ON",
|
|
62
|
+
transform: "translate(0.000000, 0.218750)",
|
|
63
|
+
fill: unCheckedColor,
|
|
64
|
+
fillRule: "nonzero"
|
|
65
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
66
|
+
d: "M149.21875,0 L50.78125,0 C22.734375,0 0,22.734375 0,50.78125 C0,78.828125 22.734375,101.5625 50.78125,101.5625 L149.21875,101.5625 C177.265625,101.5625 200,78.828125 200,50.78125 C200,22.734375 177.265625,0 149.21875,0 Z M52.21875,94.53125 C28.0585937,94.53125 8.46875,74.9414063 8.46875,50.78125 C8.46875,26.6210937 28.0585937,7.03125 52.21875,7.03125 C76.3789063,7.03125 95.96875,26.6210938 95.96875,50.78125 C95.96875,74.9414063 76.3789063,94.53125 52.21875,94.53125 Z"
|
|
67
|
+
})))));
|
|
68
|
+
};
|
|
69
|
+
export default Switch;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Icon from "../Icon";
|
|
3
|
+
var TranslateButton = function TranslateButton(_ref) {
|
|
4
|
+
var _ref$onClick = _ref.onClick,
|
|
5
|
+
onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
6
|
+
className = _ref.className,
|
|
7
|
+
_ref$disabled = _ref.disabled,
|
|
8
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
|
9
|
+
var handleClick = function handleClick() {
|
|
10
|
+
if (disabled) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
onClick();
|
|
14
|
+
};
|
|
15
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
16
|
+
onClick: handleClick,
|
|
17
|
+
style: {
|
|
18
|
+
padding: 4
|
|
19
|
+
},
|
|
20
|
+
className: "p-4px leading-none rounded-4px hover:bg-[#40576d]/0.1 ".concat(!disabled ? 'cursor-pointer' : 'cursor-not-allowed', " hover:bg-[#40576d] hover:bg-opacity-10 transition-colors ease-linear ").concat(className)
|
|
21
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
22
|
+
type: "icon-tubiao-fanyi",
|
|
23
|
+
className: "text-size-15px top-1px relative"
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
export default TranslateButton;
|
package/es/constant.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** 设备 - PC端 默认大小 */
|
|
2
|
+
export var defaultDevicePCSize = {
|
|
3
|
+
width: 341.5,
|
|
4
|
+
height: 192
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
/** 设备 - 移动端 默认大小 */
|
|
8
|
+
export var defaultDeviceMobileSize = {
|
|
9
|
+
width: 375,
|
|
10
|
+
height: 600
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 主要颜色
|
|
15
|
+
*/
|
|
16
|
+
export var PRIMARY_COLOR = '#1890ff';
|