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,60 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import { Tooltip } from 'antd';
|
|
4
|
+
import { getValueByExpression, reactShapeNodeAreEqual } from "../utils";
|
|
5
|
+
import { usePointWatch, useEleEventHandle } from "../../hooks";
|
|
6
|
+
import styles from "./index.css";
|
|
7
|
+
function getImageSrc(defaultSrc, val, expressions) {
|
|
8
|
+
var imgSrc = defaultSrc;
|
|
9
|
+
if (window.scadaMode === 'edit' && (expressions === null || expressions === void 0 ? void 0 : expressions.length)) {
|
|
10
|
+
imgSrc = expressions[0].value;
|
|
11
|
+
return imgSrc;
|
|
12
|
+
}
|
|
13
|
+
if (window.scadaMode === 'player') {
|
|
14
|
+
var value = getValueByExpression(val, expressions);
|
|
15
|
+
if (value && typeof value !== 'number') {
|
|
16
|
+
// 说明没有匹配到图片 src
|
|
17
|
+
imgSrc = value;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return imgSrc;
|
|
21
|
+
}
|
|
22
|
+
var ElePointImageComponent = function ElePointImageComponent(_ref) {
|
|
23
|
+
var _payload$pointList, _payload$mittMeta$nam, _payload$mittMeta, _payload$mittMeta2;
|
|
24
|
+
var node = _ref.node;
|
|
25
|
+
var payload = node === null || node === void 0 ? void 0 : node.getData();
|
|
26
|
+
var configPoint = payload === null || payload === void 0 ? void 0 : (_payload$pointList = payload.pointList) === null || _payload$pointList === void 0 ? void 0 : _payload$pointList[0];
|
|
27
|
+
var eventHandles = useEleEventHandle({
|
|
28
|
+
events: payload === null || payload === void 0 ? void 0 : payload.events,
|
|
29
|
+
payload: {
|
|
30
|
+
points: [{
|
|
31
|
+
identifierName: configPoint === null || configPoint === void 0 ? void 0 : configPoint.identifierName,
|
|
32
|
+
deviceId: configPoint && 'deviceId' in configPoint ? configPoint.deviceId : undefined
|
|
33
|
+
}],
|
|
34
|
+
namespace: (_payload$mittMeta$nam = payload === null || payload === void 0 ? void 0 : (_payload$mittMeta = payload.mittMeta) === null || _payload$mittMeta === void 0 ? void 0 : _payload$mittMeta.namespace) !== null && _payload$mittMeta$nam !== void 0 ? _payload$mittMeta$nam : 0
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
var pointData = usePointWatch(configPoint, payload === null || payload === void 0 ? void 0 : (_payload$mittMeta2 = payload.mittMeta) === null || _payload$mittMeta2 === void 0 ? void 0 : _payload$mittMeta2.namespace);
|
|
38
|
+
var tooltipTitle = null;
|
|
39
|
+
if (!configPoint) {
|
|
40
|
+
tooltipTitle = '未绑定点位';
|
|
41
|
+
} else {
|
|
42
|
+
var _pointData$value, _pointData$unit;
|
|
43
|
+
tooltipTitle = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "\u70B9\u4F4D\u540D\u79F0\uFF1A", (pointData === null || pointData === void 0 ? void 0 : pointData.pointName) || '-'), /*#__PURE__*/React.createElement("div", null, "\u70B9\u4F4D\u503C\uFF1A", (_pointData$value = pointData === null || pointData === void 0 ? void 0 : pointData.value) !== null && _pointData$value !== void 0 ? _pointData$value : '-', " ", (_pointData$unit = pointData === null || pointData === void 0 ? void 0 : pointData.unit) !== null && _pointData$unit !== void 0 ? _pointData$unit : '-'), /*#__PURE__*/React.createElement("div", null, "\u66F4\u65B0\u65F6\u95F4\uFF1A", (pointData === null || pointData === void 0 ? void 0 : pointData.updateTime) || '-'));
|
|
44
|
+
}
|
|
45
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
46
|
+
title: tooltipTitle
|
|
47
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
onClick: eventHandles.onClick,
|
|
49
|
+
onContextMenu: eventHandles.onContextMenu,
|
|
50
|
+
onMouseEnter: eventHandles.onMouseEnter,
|
|
51
|
+
onMouseLeave: eventHandles.onMouseLeave,
|
|
52
|
+
className: styles.wrap
|
|
53
|
+
}, (payload === null || payload === void 0 ? void 0 : payload.imgSrc) ? /*#__PURE__*/React.createElement("img", {
|
|
54
|
+
className: styles.img,
|
|
55
|
+
src: getImageSrc(payload.imgSrc, pointData === null || pointData === void 0 ? void 0 : pointData.value, configPoint === null || configPoint === void 0 ? void 0 : configPoint.expressions),
|
|
56
|
+
draggable: false,
|
|
57
|
+
alt: ""
|
|
58
|
+
}) : null));
|
|
59
|
+
};
|
|
60
|
+
export default /*#__PURE__*/memo(ElePointImageComponent, reactShapeNodeAreEqual);
|
|
@@ -0,0 +1,84 @@
|
|
|
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
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; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import React from "react";
|
|
14
|
+
import { Form } from 'antd';
|
|
15
|
+
import { useState } from 'react';
|
|
16
|
+
import { useModel } from 'umi';
|
|
17
|
+
import DialogExpression from "../../../../components/DialogExpression";
|
|
18
|
+
import ExpressionFormat from "../../../../components/ExpressionFormat";
|
|
19
|
+
import ImagePicker from "../../../../components/DialogExpression/ImagePicker";
|
|
20
|
+
import TranslateButton from "../../../../components/TranslateButton";
|
|
21
|
+
import { useForceUpdate } from "../../../../hooks";
|
|
22
|
+
var OtherDataSet = function OtherDataSet() {
|
|
23
|
+
var _payload$pointList;
|
|
24
|
+
var forceUpdate = useForceUpdate();
|
|
25
|
+
var _useState = useState(false),
|
|
26
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
27
|
+
visibleDialogExpression = _useState2[0],
|
|
28
|
+
setVisibleDialogExpression = _useState2[1];
|
|
29
|
+
var _useModel = useModel('useEditor', function (model) {
|
|
30
|
+
return {
|
|
31
|
+
activeNode: model.activeNode
|
|
32
|
+
};
|
|
33
|
+
}),
|
|
34
|
+
activeNode = _useModel.activeNode;
|
|
35
|
+
var payload = activeNode === null || activeNode === void 0 ? void 0 : activeNode.getData();
|
|
36
|
+
var bindPoint = payload === null || payload === void 0 ? void 0 : (_payload$pointList = payload.pointList) === null || _payload$pointList === void 0 ? void 0 : _payload$pointList[0];
|
|
37
|
+
var handleExpressionChange = function handleExpressionChange(expressions) {
|
|
38
|
+
activeNode === null || activeNode === void 0 ? void 0 : activeNode.setData({
|
|
39
|
+
pointList: [_objectSpread(_objectSpread({}, bindPoint), {}, {
|
|
40
|
+
expressions: expressions
|
|
41
|
+
})]
|
|
42
|
+
}, {
|
|
43
|
+
deep: false
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
var handleDefaultImgChange = function handleDefaultImgChange(val) {
|
|
47
|
+
activeNode === null || activeNode === void 0 ? void 0 : activeNode.setData({
|
|
48
|
+
imgSrc: val
|
|
49
|
+
}, {
|
|
50
|
+
deep: false
|
|
51
|
+
});
|
|
52
|
+
forceUpdate();
|
|
53
|
+
};
|
|
54
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form, {
|
|
55
|
+
size: "small",
|
|
56
|
+
labelCol: {
|
|
57
|
+
span: 8
|
|
58
|
+
},
|
|
59
|
+
autoComplete: "off"
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
61
|
+
label: "\u9ED8\u8BA4\u56FE\u7247"
|
|
62
|
+
}, /*#__PURE__*/React.createElement(ImagePicker, {
|
|
63
|
+
value: payload.imgSrc,
|
|
64
|
+
onChange: handleDefaultImgChange
|
|
65
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
66
|
+
label: "\u503C\u7FFB\u8BD1"
|
|
67
|
+
}, /*#__PURE__*/React.createElement(TranslateButton, {
|
|
68
|
+
onClick: function onClick() {
|
|
69
|
+
setVisibleDialogExpression(true);
|
|
70
|
+
}
|
|
71
|
+
}), !!bindPoint && /*#__PURE__*/React.createElement(ExpressionFormat, {
|
|
72
|
+
expressions: bindPoint.expressions || [],
|
|
73
|
+
valueType: "image"
|
|
74
|
+
}))), /*#__PURE__*/React.createElement(DialogExpression, {
|
|
75
|
+
valueType: "image",
|
|
76
|
+
visible: visibleDialogExpression,
|
|
77
|
+
expressions: (bindPoint === null || bindPoint === void 0 ? void 0 : bindPoint.expressions) || [],
|
|
78
|
+
onCancel: function onCancel() {
|
|
79
|
+
setVisibleDialogExpression(false);
|
|
80
|
+
},
|
|
81
|
+
onChange: handleExpressionChange
|
|
82
|
+
}));
|
|
83
|
+
};
|
|
84
|
+
export default OtherDataSet;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Collapse } from 'antd';
|
|
3
|
+
import { CaretRightOutlined } from '@ant-design/icons';
|
|
4
|
+
import FormBindPoint from "../../../components/FormBindPoint";
|
|
5
|
+
import ImagePropsSet from "./ImagePropsSet";
|
|
6
|
+
import { useForceUpdate } from "../../../hooks";
|
|
7
|
+
var Panel = Collapse.Panel;
|
|
8
|
+
var PropsSet = function PropsSet() {
|
|
9
|
+
var forceUpdate = useForceUpdate();
|
|
10
|
+
return /*#__PURE__*/React.createElement(Collapse, {
|
|
11
|
+
defaultActiveKey: ['1', '2'],
|
|
12
|
+
ghost: true,
|
|
13
|
+
expandIcon: function expandIcon(_ref) {
|
|
14
|
+
var isActive = _ref.isActive;
|
|
15
|
+
return /*#__PURE__*/React.createElement(CaretRightOutlined, {
|
|
16
|
+
rotate: isActive ? 90 : 0
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}, /*#__PURE__*/React.createElement(Panel, {
|
|
20
|
+
header: "\u7ED1\u5B9A\u70B9\u4F4D",
|
|
21
|
+
key: "1"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(FormBindPoint, {
|
|
23
|
+
onChange: forceUpdate
|
|
24
|
+
})), /*#__PURE__*/React.createElement(Panel, {
|
|
25
|
+
header: "\u56FE\u7247",
|
|
26
|
+
key: "2"
|
|
27
|
+
}, /*#__PURE__*/React.createElement(ImagePropsSet, null)));
|
|
28
|
+
};
|
|
29
|
+
export default PropsSet;
|
|
@@ -0,0 +1,58 @@
|
|
|
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 _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
5
|
+
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); }
|
|
6
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
|
+
import React from "react";
|
|
15
|
+
import { Graph } from '@antv/x6';
|
|
16
|
+
import ElePointImageComponent from "./Component";
|
|
17
|
+
import { ReactShapeBase } from "../reactShapeBase";
|
|
18
|
+
export var shapeName = 'ele-point-image';
|
|
19
|
+
var ElePointImage = /*#__PURE__*/function (_ReactShapeBase) {
|
|
20
|
+
_inherits(ElePointImage, _ReactShapeBase);
|
|
21
|
+
var _super = _createSuper(ElePointImage);
|
|
22
|
+
function ElePointImage() {
|
|
23
|
+
var _this;
|
|
24
|
+
_classCallCheck(this, ElePointImage);
|
|
25
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
|
+
args[_key] = arguments[_key];
|
|
27
|
+
}
|
|
28
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
29
|
+
_this.shapeName = shapeName;
|
|
30
|
+
return _this;
|
|
31
|
+
}
|
|
32
|
+
return _createClass(ElePointImage);
|
|
33
|
+
}(ReactShapeBase);
|
|
34
|
+
ElePointImage.shapeName = shapeName;
|
|
35
|
+
/** 注册的 react 组件名称 */
|
|
36
|
+
var registerComponentName = "".concat(ElePointImage.shapeName, "-component");
|
|
37
|
+
export var defaultConfig = {
|
|
38
|
+
shape: ElePointImage.shapeName,
|
|
39
|
+
width: 36,
|
|
40
|
+
height: 29,
|
|
41
|
+
data: {
|
|
42
|
+
imgSrc: 'https://cdn.sinocold.net/%E5%B9%B3%E9%9D%A2%E5%9B%BE/%E5%85%83%E7%B4%A0%E5%9B%BE%E7%89%87/%E5%9B%BE%E7%89%87.svg',
|
|
43
|
+
pointList: [],
|
|
44
|
+
pointListLimit: 1,
|
|
45
|
+
keepRatio: true,
|
|
46
|
+
events: [{
|
|
47
|
+
type: 'click',
|
|
48
|
+
action: 'show-point-history'
|
|
49
|
+
}]
|
|
50
|
+
},
|
|
51
|
+
component: registerComponentName
|
|
52
|
+
};
|
|
53
|
+
ElePointImage.config(defaultConfig);
|
|
54
|
+
|
|
55
|
+
// 注册 react 组件
|
|
56
|
+
Graph.registerReactComponent(registerComponentName, /*#__PURE__*/React.createElement(ElePointImageComponent, null));
|
|
57
|
+
export { ElePointImageComponent as EleImageComponent };
|
|
58
|
+
export default ElePointImage;
|
|
@@ -0,0 +1,142 @@
|
|
|
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
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; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import React from "react";
|
|
14
|
+
import { memo, useState, useEffect, useRef } from 'react';
|
|
15
|
+
import { Tooltip } from 'antd';
|
|
16
|
+
import emitter from "../../utils/events";
|
|
17
|
+
import { reactShapeNodeAreEqual, handleEleEvent } from "../utils";
|
|
18
|
+
import styles from "./index.css";
|
|
19
|
+
var PointTooltipTitle = function PointTooltipTitle(_ref) {
|
|
20
|
+
var _point$value, _point$unit;
|
|
21
|
+
var point = _ref.point;
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "\u70B9\u4F4D\u540D\u79F0\uFF1A", (point === null || point === void 0 ? void 0 : point.pointName) || '-'), /*#__PURE__*/React.createElement("div", null, "\u70B9\u4F4D\u503C\uFF1A", (_point$value = point === null || point === void 0 ? void 0 : point.value) !== null && _point$value !== void 0 ? _point$value : '-', " ", (_point$unit = point === null || point === void 0 ? void 0 : point.unit) !== null && _point$unit !== void 0 ? _point$unit : '-'), /*#__PURE__*/React.createElement("div", null, "\u66F4\u65B0\u65F6\u95F4\uFF1A", (point === null || point === void 0 ? void 0 : point.updateTime) || '-'));
|
|
23
|
+
};
|
|
24
|
+
var ElePointPanelComponent = function ElePointPanelComponent(_ref2) {
|
|
25
|
+
var node = _ref2.node;
|
|
26
|
+
var _useState = useState([]),
|
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
+
pointList = _useState2[0],
|
|
29
|
+
setPointList = _useState2[1];
|
|
30
|
+
var eventHandlerListRef = useRef([]);
|
|
31
|
+
var fontStylesRef = useRef();
|
|
32
|
+
var borderStyleRef = useRef();
|
|
33
|
+
var fillStyleRef = useRef();
|
|
34
|
+
var payload = node === null || node === void 0 ? void 0 : node.getData();
|
|
35
|
+
if (window.scadaMode === 'edit') {
|
|
36
|
+
fontStylesRef.current = payload === null || payload === void 0 ? void 0 : payload.fontStyles;
|
|
37
|
+
borderStyleRef.current = payload === null || payload === void 0 ? void 0 : payload.borderStyles;
|
|
38
|
+
fillStyleRef.current = payload === null || payload === void 0 ? void 0 : payload.fillStyles;
|
|
39
|
+
}
|
|
40
|
+
useEffect(function () {
|
|
41
|
+
if (!node) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
var list = node.getData().pointList;
|
|
45
|
+
setPointList(list);
|
|
46
|
+
}, [node]);
|
|
47
|
+
useEffect(function () {
|
|
48
|
+
var payload = node === null || node === void 0 ? void 0 : node.getData();
|
|
49
|
+
fontStylesRef.current = payload === null || payload === void 0 ? void 0 : payload.fontStyles;
|
|
50
|
+
borderStyleRef.current = payload === null || payload === void 0 ? void 0 : payload.borderStyles;
|
|
51
|
+
fillStyleRef.current = payload === null || payload === void 0 ? void 0 : payload.fillStyles;
|
|
52
|
+
}, [node]);
|
|
53
|
+
useEffect(function () {
|
|
54
|
+
var _node$getData;
|
|
55
|
+
if (window.scadaMode === 'edit') {
|
|
56
|
+
return function () {};
|
|
57
|
+
}
|
|
58
|
+
var pointList = node === null || node === void 0 ? void 0 : (_node$getData = node.getData()) === null || _node$getData === void 0 ? void 0 : _node$getData.pointList;
|
|
59
|
+
var mittMeta = node === null || node === void 0 ? void 0 : node.getData().mittMeta;
|
|
60
|
+
pointList === null || pointList === void 0 ? void 0 : pointList.forEach(function (point) {
|
|
61
|
+
var _mittMeta$namespace;
|
|
62
|
+
var eventHandler = function eventHandler(pointData) {
|
|
63
|
+
setPointList(function (prev) {
|
|
64
|
+
return prev.map(function (v) {
|
|
65
|
+
if (v.identifierName === point.identifierName) {
|
|
66
|
+
return _objectSpread(_objectSpread({}, v), pointData);
|
|
67
|
+
}
|
|
68
|
+
return v;
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
var eventName = "point-update-".concat('pointId' in point ? point.pointId : point.identifierName, "-").concat((_mittMeta$namespace = mittMeta === null || mittMeta === void 0 ? void 0 : mittMeta.namespace) !== null && _mittMeta$namespace !== void 0 ? _mittMeta$namespace : 0);
|
|
73
|
+
emitter.on(eventName, eventHandler);
|
|
74
|
+
eventHandlerListRef.current.push({
|
|
75
|
+
eventName: eventName,
|
|
76
|
+
eventHandler: eventHandler
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
var eventHandlerList = eventHandlerListRef.current;
|
|
80
|
+
return function () {
|
|
81
|
+
// // 卸载组件的时候,删除事件监听
|
|
82
|
+
eventHandlerList.forEach(function (v) {
|
|
83
|
+
emitter.off(v.eventName, v.eventHandler);
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
}, [node]);
|
|
87
|
+
var handleClickPointItem = function handleClickPointItem(e, point) {
|
|
88
|
+
var _payload$mittMeta$nam, _payload$mittMeta;
|
|
89
|
+
handleEleEvent((payload === null || payload === void 0 ? void 0 : payload.events) || [], 'click', e, {
|
|
90
|
+
points: [{
|
|
91
|
+
identifierName: point.identifierName,
|
|
92
|
+
deviceId: point.deviceId
|
|
93
|
+
}],
|
|
94
|
+
namespace: (_payload$mittMeta$nam = payload === null || payload === void 0 ? void 0 : (_payload$mittMeta = payload.mittMeta) === null || _payload$mittMeta === void 0 ? void 0 : _payload$mittMeta.namespace) !== null && _payload$mittMeta$nam !== void 0 ? _payload$mittMeta$nam : 0
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
var handleContextMenuItem = function handleContextMenuItem(e, point) {
|
|
98
|
+
var _payload$mittMeta$nam2, _payload$mittMeta2;
|
|
99
|
+
handleEleEvent((payload === null || payload === void 0 ? void 0 : payload.events) || [], 'contextmenu', e, {
|
|
100
|
+
points: [{
|
|
101
|
+
identifierName: point.identifierName,
|
|
102
|
+
deviceId: point.deviceId
|
|
103
|
+
}],
|
|
104
|
+
namespace: (_payload$mittMeta$nam2 = payload === null || payload === void 0 ? void 0 : (_payload$mittMeta2 = payload.mittMeta) === null || _payload$mittMeta2 === void 0 ? void 0 : _payload$mittMeta2.namespace) !== null && _payload$mittMeta$nam2 !== void 0 ? _payload$mittMeta$nam2 : 0
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
108
|
+
className: styles.wrap,
|
|
109
|
+
style: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, fontStylesRef.current), borderStyleRef.current), fillStyleRef.current), payload === null || payload === void 0 ? void 0 : payload.margin_padding)
|
|
110
|
+
}, window.scadaMode === 'player' && pointList.map(function (point) {
|
|
111
|
+
var _point$pointName, _ref3;
|
|
112
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
113
|
+
key: point.identifierName,
|
|
114
|
+
title: /*#__PURE__*/React.createElement(PointTooltipTitle, {
|
|
115
|
+
point: point
|
|
116
|
+
})
|
|
117
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
key: point.identifierName,
|
|
119
|
+
onClick: function onClick(e) {
|
|
120
|
+
return handleClickPointItem(e, point);
|
|
121
|
+
},
|
|
122
|
+
onContextMenu: function onContextMenu(e) {
|
|
123
|
+
return handleContextMenuItem(e, point);
|
|
124
|
+
},
|
|
125
|
+
className: styles.item
|
|
126
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
127
|
+
className: styles.name
|
|
128
|
+
}, (_point$pointName = point.pointName) !== null && _point$pointName !== void 0 ? _point$pointName : '-'), /*#__PURE__*/React.createElement("span", {
|
|
129
|
+
className: styles.value
|
|
130
|
+
}, (_ref3 = point.pointEnumItemKey || point.value) !== null && _ref3 !== void 0 ? _ref3 : '-')));
|
|
131
|
+
}), (window.scadaMode === 'edit' || !pointList.length) && /*#__PURE__*/React.createElement("div", {
|
|
132
|
+
className: styles.item
|
|
133
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
134
|
+
className: styles.name
|
|
135
|
+
}, "-"), /*#__PURE__*/React.createElement("span", {
|
|
136
|
+
style: {
|
|
137
|
+
color: 'normal'
|
|
138
|
+
},
|
|
139
|
+
className: styles.value
|
|
140
|
+
}, "-")));
|
|
141
|
+
};
|
|
142
|
+
export default /*#__PURE__*/memo(ElePointPanelComponent, reactShapeNodeAreEqual);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Collapse } from 'antd';
|
|
3
|
+
import { CaretRightOutlined } from '@ant-design/icons';
|
|
4
|
+
import FormBindPoint from "../../../components/FormBindPoint";
|
|
5
|
+
import { useForceUpdate } from "../../../hooks";
|
|
6
|
+
var Panel = Collapse.Panel;
|
|
7
|
+
var PropsSet = function PropsSet() {
|
|
8
|
+
var forceUpdate = useForceUpdate();
|
|
9
|
+
return /*#__PURE__*/React.createElement(Collapse, {
|
|
10
|
+
defaultActiveKey: ['1', '2'],
|
|
11
|
+
ghost: true,
|
|
12
|
+
expandIcon: function expandIcon(_ref) {
|
|
13
|
+
var isActive = _ref.isActive;
|
|
14
|
+
return /*#__PURE__*/React.createElement(CaretRightOutlined, {
|
|
15
|
+
rotate: isActive ? 90 : 0
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}, /*#__PURE__*/React.createElement(Panel, {
|
|
19
|
+
header: "\u7ED1\u5B9A\u70B9\u4F4D",
|
|
20
|
+
key: "1"
|
|
21
|
+
}, /*#__PURE__*/React.createElement(FormBindPoint, {
|
|
22
|
+
onChange: forceUpdate
|
|
23
|
+
})));
|
|
24
|
+
};
|
|
25
|
+
export default PropsSet;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.wrap {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
width: auto;
|
|
4
|
+
height: auto;
|
|
5
|
+
padding: 6px 10px;
|
|
6
|
+
user-select: none;
|
|
7
|
+
}
|
|
8
|
+
.item {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
line-height: 20px;
|
|
13
|
+
white-space: nowrap;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
}
|
|
16
|
+
.name {
|
|
17
|
+
margin-right: 10px;
|
|
18
|
+
color: #fff;
|
|
19
|
+
}
|
|
20
|
+
.value {
|
|
21
|
+
color: #fff;
|
|
22
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
5
|
+
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); }
|
|
6
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
|
+
import React from "react";
|
|
15
|
+
import { Graph } from '@antv/x6';
|
|
16
|
+
import ElePointListComponent from "./Component";
|
|
17
|
+
import { ReactShapeBase } from "../reactShapeBase";
|
|
18
|
+
export var shapeName = 'ele-point-panel';
|
|
19
|
+
var ElePointList = /*#__PURE__*/function (_ReactShapeBase) {
|
|
20
|
+
_inherits(ElePointList, _ReactShapeBase);
|
|
21
|
+
var _super = _createSuper(ElePointList);
|
|
22
|
+
function ElePointList() {
|
|
23
|
+
var _this;
|
|
24
|
+
_classCallCheck(this, ElePointList);
|
|
25
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
|
+
args[_key] = arguments[_key];
|
|
27
|
+
}
|
|
28
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
29
|
+
_this.shapeName = shapeName;
|
|
30
|
+
_this.disableResize = true;
|
|
31
|
+
_this.disableRotate = true;
|
|
32
|
+
return _this;
|
|
33
|
+
}
|
|
34
|
+
return _createClass(ElePointList);
|
|
35
|
+
}(ReactShapeBase);
|
|
36
|
+
ElePointList.shapeName = shapeName;
|
|
37
|
+
/** 注册的 react 组件名称 */
|
|
38
|
+
var registerComponentName = "".concat(ElePointList.shapeName, "-component");
|
|
39
|
+
export var defaultConfig = {
|
|
40
|
+
shape: ElePointList.shapeName,
|
|
41
|
+
width: 40,
|
|
42
|
+
height: 30,
|
|
43
|
+
data: {
|
|
44
|
+
pointList: [],
|
|
45
|
+
fontStyles: {
|
|
46
|
+
fontSize: 12
|
|
47
|
+
},
|
|
48
|
+
borderStyles: {
|
|
49
|
+
borderRadius: 2,
|
|
50
|
+
boxShadow: '0px 5px 10px -2px rgba(0,0,0,0.32)'
|
|
51
|
+
},
|
|
52
|
+
fillStyles: {
|
|
53
|
+
backgroundColor: '#394c67'
|
|
54
|
+
},
|
|
55
|
+
events: [{
|
|
56
|
+
type: 'click',
|
|
57
|
+
action: 'show-point-history'
|
|
58
|
+
}]
|
|
59
|
+
},
|
|
60
|
+
component: registerComponentName
|
|
61
|
+
};
|
|
62
|
+
ElePointList.config(defaultConfig);
|
|
63
|
+
|
|
64
|
+
// 注册 react 组件
|
|
65
|
+
Graph.registerReactComponent(registerComponentName, /*#__PURE__*/React.createElement(ElePointListComponent, null));
|
|
66
|
+
export { ElePointListComponent as ElePointPanelComponent };
|
|
67
|
+
export default ElePointList;
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
import React from "react";
|
|
8
|
+
import { memo } from 'react';
|
|
9
|
+
import { Tooltip } from 'antd';
|
|
10
|
+
import Icon from "../../components/Icon";
|
|
11
|
+
import { usePointWatch, useEleEventHandle } from "../../hooks";
|
|
12
|
+
import { reactShapeNodeAreEqual, getValueByExpression } from "../utils";
|
|
13
|
+
import styles from "./index.css";
|
|
14
|
+
var defaultIconColor = '#fff';
|
|
15
|
+
export var defaultIconName = 'zhileng';
|
|
16
|
+
var ElePointStateComponent = function ElePointStateComponent(_ref) {
|
|
17
|
+
var _payload$pointList, _payload$mittMeta$nam, _payload$mittMeta, _payload$mittMeta2, _payload$fillStyles, _payload$fillStyles2;
|
|
18
|
+
var node = _ref.node;
|
|
19
|
+
var payload = node === null || node === void 0 ? void 0 : node.getData();
|
|
20
|
+
/** 元件上绑定的点位 */
|
|
21
|
+
var configPoint = payload === null || payload === void 0 ? void 0 : (_payload$pointList = payload.pointList) === null || _payload$pointList === void 0 ? void 0 : _payload$pointList[0];
|
|
22
|
+
var eventHandles = useEleEventHandle({
|
|
23
|
+
events: payload === null || payload === void 0 ? void 0 : payload.events,
|
|
24
|
+
payload: {
|
|
25
|
+
points: [{
|
|
26
|
+
identifierName: configPoint === null || configPoint === void 0 ? void 0 : configPoint.identifierName,
|
|
27
|
+
deviceId: configPoint && 'deviceId' in configPoint ? configPoint.deviceId : undefined
|
|
28
|
+
}],
|
|
29
|
+
namespace: (_payload$mittMeta$nam = payload === null || payload === void 0 ? void 0 : (_payload$mittMeta = payload.mittMeta) === null || _payload$mittMeta === void 0 ? void 0 : _payload$mittMeta.namespace) !== null && _payload$mittMeta$nam !== void 0 ? _payload$mittMeta$nam : 0
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
var pointData = usePointWatch(configPoint, payload === null || payload === void 0 ? void 0 : (_payload$mittMeta2 = payload.mittMeta) === null || _payload$mittMeta2 === void 0 ? void 0 : _payload$mittMeta2.namespace);
|
|
33
|
+
var tooltipTitle = null;
|
|
34
|
+
if (!configPoint) {
|
|
35
|
+
tooltipTitle = '未绑定点位';
|
|
36
|
+
} else {
|
|
37
|
+
var _pointData$value, _pointData$unit;
|
|
38
|
+
tooltipTitle = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "\u70B9\u4F4D\u540D\u79F0\uFF1A", (pointData === null || pointData === void 0 ? void 0 : pointData.pointName) || '-'), /*#__PURE__*/React.createElement("div", null, "\u70B9\u4F4D\u503C\uFF1A", (_pointData$value = pointData === null || pointData === void 0 ? void 0 : pointData.value) !== null && _pointData$value !== void 0 ? _pointData$value : '-', " ", (_pointData$unit = pointData === null || pointData === void 0 ? void 0 : pointData.unit) !== null && _pointData$unit !== void 0 ? _pointData$unit : '-'), /*#__PURE__*/React.createElement("div", null, "\u66F4\u65B0\u65F6\u95F4\uFF1A", (pointData === null || pointData === void 0 ? void 0 : pointData.updateTime) || '-'));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** 图标颜色 */
|
|
42
|
+
var iconColor = defaultIconColor;
|
|
43
|
+
if (payload === null || payload === void 0 ? void 0 : payload.iconColorExpressions) {
|
|
44
|
+
var expressionValue = getValueByExpression(pointData === null || pointData === void 0 ? void 0 : pointData.value, payload === null || payload === void 0 ? void 0 : payload.iconColorExpressions);
|
|
45
|
+
if (typeof expressionValue === 'string') {
|
|
46
|
+
iconColor = expressionValue;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** 背景颜色 */
|
|
51
|
+
var bgColor = getValueByExpression(pointData === null || pointData === void 0 ? void 0 : pointData.value, payload === null || payload === void 0 ? void 0 : payload.backgroundColorExpressions);
|
|
52
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
53
|
+
title: tooltipTitle
|
|
54
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: styles.wrap,
|
|
56
|
+
onClick: eventHandles.onClick,
|
|
57
|
+
onContextMenu: eventHandles.onContextMenu,
|
|
58
|
+
onMouseEnter: eventHandles.onMouseEnter,
|
|
59
|
+
onMouseLeave: eventHandles.onMouseLeave,
|
|
60
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, payload === null || payload === void 0 ? void 0 : payload.borderStyles), payload === null || payload === void 0 ? void 0 : payload.fillStyles), {}, {
|
|
61
|
+
background: typeof bgColor === 'string' ? bgColor : (payload === null || payload === void 0 ? void 0 : (_payload$fillStyles = payload.fillStyles) === null || _payload$fillStyles === void 0 ? void 0 : _payload$fillStyles.backgroundColor) ? payload === null || payload === void 0 ? void 0 : (_payload$fillStyles2 = payload.fillStyles) === null || _payload$fillStyles2 === void 0 ? void 0 : _payload$fillStyles2.backgroundColor : 'invalid-value'
|
|
62
|
+
})
|
|
63
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
64
|
+
type: "icon-".concat((payload === null || payload === void 0 ? void 0 : payload.iconName) || defaultIconName),
|
|
65
|
+
style: {
|
|
66
|
+
fontSize: "".concat((payload === null || payload === void 0 ? void 0 : payload.iconSize) || 22, "px"),
|
|
67
|
+
color: iconColor
|
|
68
|
+
}
|
|
69
|
+
})));
|
|
70
|
+
};
|
|
71
|
+
export default /*#__PURE__*/memo(ElePointStateComponent, reactShapeNodeAreEqual);
|