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,231 @@
|
|
|
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 { useEffect, useState, useRef } from 'react';
|
|
13
|
+
import { message } from 'antd';
|
|
14
|
+
import { queryToObject } from "../../utils";
|
|
15
|
+
import { GetProductConfiguration } from "../../services/product/Product";
|
|
16
|
+
import { GetDeviceConfiguration } from "../../services/gateway/Device";
|
|
17
|
+
import { GetCompanyConfigurationPage } from "../../services/gateway/CompanyConfiguration";
|
|
18
|
+
import { setRequestENV } from "../../services/request";
|
|
19
|
+
import Player from "./Player";
|
|
20
|
+
import ScadaEmpty from "./components/Empty";
|
|
21
|
+
import styles from "./index.css";
|
|
22
|
+
var Display = function Display(_ref) {
|
|
23
|
+
var query_ = _ref.query_;
|
|
24
|
+
var _useState = useState(),
|
|
25
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
+
jsonConfig = _useState2[0],
|
|
27
|
+
setJsonConfig = _useState2[1];
|
|
28
|
+
var _useState3 = useState(true),
|
|
29
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
30
|
+
loading = _useState4[0],
|
|
31
|
+
setLoading = _useState4[1];
|
|
32
|
+
var queryRef = useRef(query_ || queryToObject(window.location.href));
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
if (query_) {
|
|
35
|
+
// 被当成组件使用时(非 iframe ),设置接口请求的 prefix
|
|
36
|
+
setRequestENV((query_ === null || query_ === void 0 ? void 0 : query_.env) || 'prod');
|
|
37
|
+
}
|
|
38
|
+
}, [query_]);
|
|
39
|
+
|
|
40
|
+
// 获取组态配置
|
|
41
|
+
useEffect(function () {
|
|
42
|
+
var query = queryRef.current;
|
|
43
|
+
if (!query) return;
|
|
44
|
+
if (query.scene === 'product') {
|
|
45
|
+
var fetchProductScadaConfig = /*#__PURE__*/function () {
|
|
46
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
47
|
+
var _yield$GetProductConf, data, success, activeConfig;
|
|
48
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
49
|
+
while (1) switch (_context.prev = _context.next) {
|
|
50
|
+
case 0:
|
|
51
|
+
_context.prev = 0;
|
|
52
|
+
setLoading(true);
|
|
53
|
+
_context.next = 4;
|
|
54
|
+
return GetProductConfiguration({
|
|
55
|
+
productId: Number(query.productId),
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
productConfigurationType: Number(query.scadaType),
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
productVersionId: query.productVersionId || undefined
|
|
60
|
+
});
|
|
61
|
+
case 4:
|
|
62
|
+
_yield$GetProductConf = _context.sent;
|
|
63
|
+
data = _yield$GetProductConf.data;
|
|
64
|
+
success = _yield$GetProductConf.success;
|
|
65
|
+
if (success) {
|
|
66
|
+
_context.next = 10;
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
message.error('组态配置获取失败');
|
|
70
|
+
return _context.abrupt("return");
|
|
71
|
+
case 10:
|
|
72
|
+
if (data === null || data === void 0 ? void 0 : data.length) {
|
|
73
|
+
activeConfig = data.find(function (v) {
|
|
74
|
+
return v.productConfigurationType === Number(query.scadaType);
|
|
75
|
+
});
|
|
76
|
+
if (activeConfig) {
|
|
77
|
+
setJsonConfig(JSON.parse(activeConfig.config || '{}'));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
_context.next = 17;
|
|
81
|
+
break;
|
|
82
|
+
case 13:
|
|
83
|
+
_context.prev = 13;
|
|
84
|
+
_context.t0 = _context["catch"](0);
|
|
85
|
+
console.error(_context.t0);
|
|
86
|
+
message.error('组态配置获取失败');
|
|
87
|
+
case 17:
|
|
88
|
+
_context.prev = 17;
|
|
89
|
+
setLoading(false);
|
|
90
|
+
return _context.finish(17);
|
|
91
|
+
case 20:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context.stop();
|
|
94
|
+
}
|
|
95
|
+
}, _callee, null, [[0, 13, 17, 20]]);
|
|
96
|
+
}));
|
|
97
|
+
return function fetchProductScadaConfig() {
|
|
98
|
+
return _ref2.apply(this, arguments);
|
|
99
|
+
};
|
|
100
|
+
}();
|
|
101
|
+
fetchProductScadaConfig();
|
|
102
|
+
}
|
|
103
|
+
if (query.scene === 'device') {
|
|
104
|
+
var fetchDeviceScadaConfig = /*#__PURE__*/function () {
|
|
105
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
106
|
+
var _yield$GetDeviceConfi, success, data, activeScada;
|
|
107
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
108
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
109
|
+
case 0:
|
|
110
|
+
_context2.prev = 0;
|
|
111
|
+
setLoading(true);
|
|
112
|
+
_context2.next = 4;
|
|
113
|
+
return GetDeviceConfiguration({
|
|
114
|
+
deviceConfigurationType: Number(query.scadaType),
|
|
115
|
+
deviceId: Number(query.deviceId)
|
|
116
|
+
});
|
|
117
|
+
case 4:
|
|
118
|
+
_yield$GetDeviceConfi = _context2.sent;
|
|
119
|
+
success = _yield$GetDeviceConfi.success;
|
|
120
|
+
data = _yield$GetDeviceConfi.data;
|
|
121
|
+
if (success) {
|
|
122
|
+
_context2.next = 10;
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
message.error('组态配置获取失败');
|
|
126
|
+
return _context2.abrupt("return");
|
|
127
|
+
case 10:
|
|
128
|
+
activeScada = data === null || data === void 0 ? void 0 : data.find(function (v) {
|
|
129
|
+
return v.deviceConfigurationType === Number(query.scadaType);
|
|
130
|
+
});
|
|
131
|
+
if (activeScada) {
|
|
132
|
+
setJsonConfig(JSON.parse(activeScada.config || '{}'));
|
|
133
|
+
}
|
|
134
|
+
_context2.next = 18;
|
|
135
|
+
break;
|
|
136
|
+
case 14:
|
|
137
|
+
_context2.prev = 14;
|
|
138
|
+
_context2.t0 = _context2["catch"](0);
|
|
139
|
+
console.error(_context2.t0);
|
|
140
|
+
message.error('组态配置获取失败');
|
|
141
|
+
case 18:
|
|
142
|
+
_context2.prev = 18;
|
|
143
|
+
setLoading(false);
|
|
144
|
+
return _context2.finish(18);
|
|
145
|
+
case 21:
|
|
146
|
+
case "end":
|
|
147
|
+
return _context2.stop();
|
|
148
|
+
}
|
|
149
|
+
}, _callee2, null, [[0, 14, 18, 21]]);
|
|
150
|
+
}));
|
|
151
|
+
return function fetchDeviceScadaConfig() {
|
|
152
|
+
return _ref3.apply(this, arguments);
|
|
153
|
+
};
|
|
154
|
+
}();
|
|
155
|
+
fetchDeviceScadaConfig();
|
|
156
|
+
}
|
|
157
|
+
if (query.scene === 'freedom') {
|
|
158
|
+
var _fetchDeviceScadaConfig = /*#__PURE__*/function () {
|
|
159
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
160
|
+
var _data$list, _yield$GetCompanyConf, success, data, scadaConfig;
|
|
161
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
162
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
163
|
+
case 0:
|
|
164
|
+
_context3.prev = 0;
|
|
165
|
+
setLoading(true);
|
|
166
|
+
_context3.next = 4;
|
|
167
|
+
return GetCompanyConfigurationPage({
|
|
168
|
+
companyConfigurationId: Number(query.scadaId),
|
|
169
|
+
isGetConfig: true,
|
|
170
|
+
companyId: Number(query.companyId)
|
|
171
|
+
});
|
|
172
|
+
case 4:
|
|
173
|
+
_yield$GetCompanyConf = _context3.sent;
|
|
174
|
+
success = _yield$GetCompanyConf.success;
|
|
175
|
+
data = _yield$GetCompanyConf.data;
|
|
176
|
+
if (!(!success || !(data === null || data === void 0 ? void 0 : (_data$list = data.list) === null || _data$list === void 0 ? void 0 : _data$list.length))) {
|
|
177
|
+
_context3.next = 10;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
message.error('组态配置获取失败');
|
|
181
|
+
return _context3.abrupt("return");
|
|
182
|
+
case 10:
|
|
183
|
+
scadaConfig = data.list[0].config;
|
|
184
|
+
if (scadaConfig) {
|
|
185
|
+
setJsonConfig(JSON.parse(scadaConfig || '{}'));
|
|
186
|
+
}
|
|
187
|
+
_context3.next = 18;
|
|
188
|
+
break;
|
|
189
|
+
case 14:
|
|
190
|
+
_context3.prev = 14;
|
|
191
|
+
_context3.t0 = _context3["catch"](0);
|
|
192
|
+
console.error(_context3.t0);
|
|
193
|
+
message.error('组态配置获取失败');
|
|
194
|
+
case 18:
|
|
195
|
+
_context3.prev = 18;
|
|
196
|
+
setLoading(false);
|
|
197
|
+
return _context3.finish(18);
|
|
198
|
+
case 21:
|
|
199
|
+
case "end":
|
|
200
|
+
return _context3.stop();
|
|
201
|
+
}
|
|
202
|
+
}, _callee3, null, [[0, 14, 18, 21]]);
|
|
203
|
+
}));
|
|
204
|
+
return function _fetchDeviceScadaConfig() {
|
|
205
|
+
return _ref4.apply(this, arguments);
|
|
206
|
+
};
|
|
207
|
+
}();
|
|
208
|
+
_fetchDeviceScadaConfig();
|
|
209
|
+
}
|
|
210
|
+
}, []);
|
|
211
|
+
useEffect(function () {
|
|
212
|
+
window.addEventListener('message', function (e) {
|
|
213
|
+
var data = e.data;
|
|
214
|
+
if (data.event === 'product-scada-config-change') {
|
|
215
|
+
try {
|
|
216
|
+
setJsonConfig(JSON.parse(data.payload.data));
|
|
217
|
+
setLoading(false);
|
|
218
|
+
} catch (err) {
|
|
219
|
+
console.error(err);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
}, []);
|
|
224
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
225
|
+
className: styles.wrap
|
|
226
|
+
}, !!queryRef.current && /*#__PURE__*/React.createElement(Player, {
|
|
227
|
+
jsonConfig: jsonConfig,
|
|
228
|
+
query: queryRef.current
|
|
229
|
+
}), !loading && !jsonConfig && /*#__PURE__*/React.createElement(ScadaEmpty, null));
|
|
230
|
+
};
|
|
231
|
+
export default Display;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en" style="overflow: hidden;">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
+
<meta
|
|
7
|
+
name="keywords"
|
|
8
|
+
content=""
|
|
9
|
+
/>
|
|
10
|
+
<meta
|
|
11
|
+
name="description"
|
|
12
|
+
content="组态"
|
|
13
|
+
/>
|
|
14
|
+
<meta
|
|
15
|
+
name="viewport"
|
|
16
|
+
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
|
|
17
|
+
/>
|
|
18
|
+
<title>组态 CoolCare</title>
|
|
19
|
+
<link rel="icon" href="https://front-end-assets.oss-cn-shanghai.aliyuncs.com/images/coolcarelitelogo/logo_light3.png" type="image/x-icon" />
|
|
20
|
+
</head>
|
|
21
|
+
<body>
|
|
22
|
+
<noscript>请允许浏览器使用 Javascript</noscript>
|
|
23
|
+
<div id="root">
|
|
24
|
+
<style>
|
|
25
|
+
.indicator {
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: 50%;
|
|
28
|
+
left: 50%;
|
|
29
|
+
transform: translate(-50%, -50%) scale(1.5);
|
|
30
|
+
}
|
|
31
|
+
.indicator svg polyline {
|
|
32
|
+
fill: none;
|
|
33
|
+
stroke-width: 2;
|
|
34
|
+
stroke-linecap: round;
|
|
35
|
+
stroke-linejoin: round;
|
|
36
|
+
}
|
|
37
|
+
.indicator svg polyline#back {
|
|
38
|
+
stroke: rgba(24,144,255,0.3);
|
|
39
|
+
}
|
|
40
|
+
.indicator svg polyline#front {
|
|
41
|
+
stroke: #1890ff;
|
|
42
|
+
stroke-dasharray: 12, 36;
|
|
43
|
+
stroke-dashoffset: 48;
|
|
44
|
+
animation: dash 1s linear infinite;
|
|
45
|
+
}
|
|
46
|
+
@keyframes dash {
|
|
47
|
+
62.5% {
|
|
48
|
+
opacity: 0;
|
|
49
|
+
}
|
|
50
|
+
to {
|
|
51
|
+
stroke-dashoffset: 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
55
|
+
<div
|
|
56
|
+
style="
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
position: fixed;
|
|
61
|
+
top: 0;
|
|
62
|
+
bottom: 0;
|
|
63
|
+
left: 0;
|
|
64
|
+
right: 0;
|
|
65
|
+
background: 'rgba(0, 0, 0, 0.03)';
|
|
66
|
+
"
|
|
67
|
+
>
|
|
68
|
+
<div class="indicator">
|
|
69
|
+
<svg width="32px" height="24px" viewBox="0 0 16 12">
|
|
70
|
+
<polyline id="back" points="1 6 4 6 6 11 10 1 12 6 15 6"></polyline>
|
|
71
|
+
<polyline id="front" points="1 6 4 6 6 11 10 1 12 6 15 6"></polyline>
|
|
72
|
+
</svg>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</body>
|
|
77
|
+
</html>
|
|
@@ -0,0 +1,178 @@
|
|
|
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 { Menu, Dropdown, Typography } from 'antd';
|
|
9
|
+
import { useEffect, useState, useRef } from 'react';
|
|
10
|
+
import { useCMDKey } from "../../../../hooks";
|
|
11
|
+
import emitter from "../../../../utils/events";
|
|
12
|
+
import styles from "./index.css";
|
|
13
|
+
var Text = Typography.Text;
|
|
14
|
+
var PaletteDropdown = function PaletteDropdown(_ref) {
|
|
15
|
+
var children = _ref.children;
|
|
16
|
+
var _useState = useState('graph'),
|
|
17
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
+
contextMenuType = _useState2[0],
|
|
19
|
+
setContextMenuType = _useState2[1];
|
|
20
|
+
var CMDKey = useCMDKey();
|
|
21
|
+
var activeCellRef = useRef(null);
|
|
22
|
+
useEffect(function () {
|
|
23
|
+
var handleBlackContextmenu = function handleBlackContextmenu() {
|
|
24
|
+
var _window$graph;
|
|
25
|
+
setContextMenuType('graph');
|
|
26
|
+
(_window$graph = window.graph) === null || _window$graph === void 0 ? void 0 : _window$graph.cleanSelection();
|
|
27
|
+
};
|
|
28
|
+
var handleNodeContextmenu = function handleNodeContextmenu(node) {
|
|
29
|
+
setContextMenuType('node');
|
|
30
|
+
activeCellRef.current = node;
|
|
31
|
+
};
|
|
32
|
+
var handleEdgeContextmenu = function handleEdgeContextmenu(edge) {
|
|
33
|
+
var _window$graph2;
|
|
34
|
+
setContextMenuType('edge');
|
|
35
|
+
(_window$graph2 = window.graph) === null || _window$graph2 === void 0 ? void 0 : _window$graph2.cleanSelection();
|
|
36
|
+
activeCellRef.current = edge;
|
|
37
|
+
};
|
|
38
|
+
var handleNodeClick = function handleNodeClick() {
|
|
39
|
+
setContextMenuType('node');
|
|
40
|
+
};
|
|
41
|
+
emitter.on('graphCore-initialized', function (graph) {
|
|
42
|
+
graph.on('blank:contextmenu', handleBlackContextmenu);
|
|
43
|
+
graph.on('node:contextmenu', function (e) {
|
|
44
|
+
return handleNodeContextmenu(e.node);
|
|
45
|
+
});
|
|
46
|
+
graph.on('edge:contextmenu', function (e) {
|
|
47
|
+
return handleEdgeContextmenu(e.edge);
|
|
48
|
+
});
|
|
49
|
+
graph.on('node:click', handleNodeClick);
|
|
50
|
+
});
|
|
51
|
+
return function () {
|
|
52
|
+
var _window$graph3, _window$graph4, _window$graph5, _window$graph6;
|
|
53
|
+
(_window$graph3 = window.graph) === null || _window$graph3 === void 0 ? void 0 : _window$graph3.off('blank:contextmenu', handleBlackContextmenu);
|
|
54
|
+
(_window$graph4 = window.graph) === null || _window$graph4 === void 0 ? void 0 : _window$graph4.off('node:contextmenu', handleNodeContextmenu);
|
|
55
|
+
(_window$graph5 = window.graph) === null || _window$graph5 === void 0 ? void 0 : _window$graph5.off('edge:contextmenu', handleEdgeContextmenu);
|
|
56
|
+
(_window$graph6 = window.graph) === null || _window$graph6 === void 0 ? void 0 : _window$graph6.off('node:click', handleNodeClick);
|
|
57
|
+
};
|
|
58
|
+
}, []);
|
|
59
|
+
|
|
60
|
+
/** 全选 */
|
|
61
|
+
var handleSelectAll = function handleSelectAll() {
|
|
62
|
+
var _window$graph7;
|
|
63
|
+
var nodes = (_window$graph7 = window.graph) === null || _window$graph7 === void 0 ? void 0 : _window$graph7.getNodes();
|
|
64
|
+
if (nodes) {
|
|
65
|
+
var _window$graph8;
|
|
66
|
+
(_window$graph8 = window.graph) === null || _window$graph8 === void 0 ? void 0 : _window$graph8.select(nodes);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/** 删除 */
|
|
71
|
+
var handleDelete = function handleDelete() {
|
|
72
|
+
var cell = activeCellRef.current;
|
|
73
|
+
if (cell) {
|
|
74
|
+
var _window$graph9;
|
|
75
|
+
(_window$graph9 = window.graph) === null || _window$graph9 === void 0 ? void 0 : _window$graph9.removeCell(cell);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/** 复制 */
|
|
80
|
+
var handleCopy = function handleCopy() {
|
|
81
|
+
var cell = activeCellRef.current;
|
|
82
|
+
var _window = window,
|
|
83
|
+
graph = _window.graph;
|
|
84
|
+
if (cell && graph) {
|
|
85
|
+
graph.copy([cell]);
|
|
86
|
+
|
|
87
|
+
// ??? 这里必须改成异步的,要不 useModel 会报错
|
|
88
|
+
setTimeout(function () {
|
|
89
|
+
if (!graph.isClipboardEmpty()) {
|
|
90
|
+
var cells = graph.paste({
|
|
91
|
+
offset: 36
|
|
92
|
+
});
|
|
93
|
+
graph.cleanSelection();
|
|
94
|
+
graph.select(cells);
|
|
95
|
+
}
|
|
96
|
+
}, 0);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
var toFront = function toFront() {
|
|
100
|
+
var node = activeCellRef.current;
|
|
101
|
+
if (node) {
|
|
102
|
+
node.toFront();
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
var toBack = function toBack() {
|
|
106
|
+
var node = activeCellRef.current;
|
|
107
|
+
if (node) {
|
|
108
|
+
node.setZIndex(1);
|
|
109
|
+
var _window2 = window,
|
|
110
|
+
graph = _window2.graph;
|
|
111
|
+
graph.cleanSelection();
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
var menu;
|
|
115
|
+
switch (contextMenuType) {
|
|
116
|
+
case 'node':
|
|
117
|
+
menu = /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(Menu.Item, {
|
|
118
|
+
onClick: toFront,
|
|
119
|
+
key: "1"
|
|
120
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
121
|
+
className: styles['menu-item']
|
|
122
|
+
}, "\u7F6E\u4E8E\u9876\u5C42", /*#__PURE__*/React.createElement(Text, {
|
|
123
|
+
type: "secondary",
|
|
124
|
+
className: styles['hot-key-desc']
|
|
125
|
+
}, CMDKey, "+Shift+\u2191"))), /*#__PURE__*/React.createElement(Menu.Item, {
|
|
126
|
+
onClick: toBack,
|
|
127
|
+
key: "2"
|
|
128
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
129
|
+
className: styles['menu-item']
|
|
130
|
+
}, "\u7F6E\u4E8E\u5E95\u5C42", /*#__PURE__*/React.createElement(Text, {
|
|
131
|
+
type: "secondary",
|
|
132
|
+
className: styles['hot-key-desc']
|
|
133
|
+
}, CMDKey, "+Shift+\u2193"))), /*#__PURE__*/React.createElement(Menu.Divider, null), /*#__PURE__*/React.createElement(Menu.Item, {
|
|
134
|
+
onClick: handleDelete,
|
|
135
|
+
key: "5"
|
|
136
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
137
|
+
className: styles['menu-item']
|
|
138
|
+
}, "\u5220\u9664", /*#__PURE__*/React.createElement(Text, {
|
|
139
|
+
type: "secondary",
|
|
140
|
+
className: styles['hot-key-desc']
|
|
141
|
+
}, "Delete"))), /*#__PURE__*/React.createElement(Menu.Item, {
|
|
142
|
+
// disabled={curElementIndex === -1}
|
|
143
|
+
onClick: handleCopy,
|
|
144
|
+
key: "6"
|
|
145
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
146
|
+
className: styles['menu-item']
|
|
147
|
+
}, "\u590D\u5236")));
|
|
148
|
+
break;
|
|
149
|
+
case 'edge':
|
|
150
|
+
menu = /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(Menu.Item, {
|
|
151
|
+
// disabled={curElementIndex === -1}
|
|
152
|
+
onClick: handleDelete,
|
|
153
|
+
key: "1"
|
|
154
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
155
|
+
className: styles['menu-item']
|
|
156
|
+
}, "\u5220\u9664", /*#__PURE__*/React.createElement(Text, {
|
|
157
|
+
type: "secondary",
|
|
158
|
+
className: styles['hot-key-desc']
|
|
159
|
+
}, "Delete"))));
|
|
160
|
+
break;
|
|
161
|
+
default:
|
|
162
|
+
menu = /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(Menu.Item, {
|
|
163
|
+
// disabled={curElementIndex === -1}
|
|
164
|
+
onClick: handleSelectAll,
|
|
165
|
+
key: "1"
|
|
166
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
167
|
+
className: styles['menu-item']
|
|
168
|
+
}, "\u5168\u9009", /*#__PURE__*/React.createElement(Text, {
|
|
169
|
+
type: "secondary",
|
|
170
|
+
className: styles['hot-key-desc']
|
|
171
|
+
}, CMDKey, " + A"))));
|
|
172
|
+
}
|
|
173
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
174
|
+
overlay: menu,
|
|
175
|
+
trigger: ['contextMenu']
|
|
176
|
+
}, children);
|
|
177
|
+
};
|
|
178
|
+
export default PaletteDropdown;
|
|
@@ -0,0 +1,86 @@
|
|
|
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 { useCallback } from 'react';
|
|
9
|
+
import { useModel } from 'umi';
|
|
10
|
+
import PaletteDropdown from "./PaletteDropdown";
|
|
11
|
+
import styles from "./index.css";
|
|
12
|
+
import { message } from 'antd';
|
|
13
|
+
var Palette = function Palette() {
|
|
14
|
+
var _useModel = useModel('useEditor', function (model) {
|
|
15
|
+
return {
|
|
16
|
+
graphCoreRef: model.graphCoreRef
|
|
17
|
+
};
|
|
18
|
+
}),
|
|
19
|
+
graphCoreRef = _useModel.graphCoreRef;
|
|
20
|
+
var handleDrop = useCallback(function (e) {
|
|
21
|
+
var _graphCoreRef$current;
|
|
22
|
+
var graph = (_graphCoreRef$current = graphCoreRef.current) === null || _graphCoreRef$current === void 0 ? void 0 : _graphCoreRef$current.graph;
|
|
23
|
+
if (graph) {
|
|
24
|
+
try {
|
|
25
|
+
var _payload$shape;
|
|
26
|
+
var payload = JSON.parse(e.dataTransfer.getData('payload'));
|
|
27
|
+
var _graph$clientToLocal = graph.clientToLocal(e.clientX, e.clientY),
|
|
28
|
+
x = _graph$clientToLocal.x,
|
|
29
|
+
y = _graph$clientToLocal.y;
|
|
30
|
+
if (payload === null || payload === void 0 ? void 0 : (_payload$shape = payload.shape) === null || _payload$shape === void 0 ? void 0 : _payload$shape.startsWith('edge')) {
|
|
31
|
+
// 边
|
|
32
|
+
graph.addEdge({
|
|
33
|
+
shape: payload.shape,
|
|
34
|
+
source: {
|
|
35
|
+
x: x,
|
|
36
|
+
y: y
|
|
37
|
+
},
|
|
38
|
+
target: {
|
|
39
|
+
x: x,
|
|
40
|
+
y: y + 60
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
var node = graph.addNode(_objectSpread(_objectSpread({}, payload), {}, {
|
|
46
|
+
x: x,
|
|
47
|
+
y: y
|
|
48
|
+
}));
|
|
49
|
+
|
|
50
|
+
// ??? 这里必须改成异步的,要不 useModel 会报错
|
|
51
|
+
setTimeout(function () {
|
|
52
|
+
// // 清空选中的节点后选中当前新加的节点
|
|
53
|
+
graph.cleanSelection();
|
|
54
|
+
graph.select(node);
|
|
55
|
+
}, 0);
|
|
56
|
+
} catch (err) {
|
|
57
|
+
message.info('oops, 发生未知错误');
|
|
58
|
+
console.error(err);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}, [graphCoreRef]);
|
|
62
|
+
var handleDragOver = function handleDragOver(e) {
|
|
63
|
+
if (e.dataTransfer) {
|
|
64
|
+
e.dataTransfer.dropEffect = 'copy';
|
|
65
|
+
}
|
|
66
|
+
e.stopPropagation();
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
return true;
|
|
69
|
+
};
|
|
70
|
+
return /*#__PURE__*/React.createElement(PaletteDropdown, null, /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
onDragOver: handleDragOver,
|
|
72
|
+
onDrop: handleDrop,
|
|
73
|
+
style: {
|
|
74
|
+
height: '100%',
|
|
75
|
+
width: '100%',
|
|
76
|
+
position: 'relative'
|
|
77
|
+
}
|
|
78
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
id: "palette-wrap",
|
|
80
|
+
className: styles['palette-wrap']
|
|
81
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
82
|
+
id: "palette-minimap",
|
|
83
|
+
className: styles['palette-minimap']
|
|
84
|
+
})));
|
|
85
|
+
};
|
|
86
|
+
export default Palette;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { elementList } from "./listData";
|
|
3
|
+
var MetaEleList = function MetaEleList(_ref) {
|
|
4
|
+
var handleDragStart = _ref.handleDragStart,
|
|
5
|
+
handleDragEnd = _ref.handleDragEnd;
|
|
6
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
+
className: "element-wrap"
|
|
8
|
+
}, elementList.map(function (item) {
|
|
9
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
10
|
+
key: item.url,
|
|
11
|
+
title: item.label,
|
|
12
|
+
onDragStart: function onDragStart(e) {
|
|
13
|
+
return handleDragStart(e, item.payload);
|
|
14
|
+
},
|
|
15
|
+
draggable: true,
|
|
16
|
+
onDragEnd: handleDragEnd,
|
|
17
|
+
className: "element-item"
|
|
18
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
className: "element-img-wrap"
|
|
20
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
21
|
+
draggable: false,
|
|
22
|
+
style: {
|
|
23
|
+
width: item.width ? "".concat(item.width, "px") : undefined
|
|
24
|
+
// height: item.height ? `${item.height}px` : undefined,
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
src: item.url,
|
|
28
|
+
alt: ""
|
|
29
|
+
})));
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
export default MetaEleList;
|