seat-editor 3.6.44 → 3.6.45
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.
|
@@ -4,9 +4,8 @@ import clsx from "clsx";
|
|
|
4
4
|
import LayerView from "../../features/view-only-5";
|
|
5
5
|
import { COLORS_SECTION, data, NODE_PROPERTIES } from "./constant";
|
|
6
6
|
import { Button } from "antd";
|
|
7
|
-
import { useMemo, useState } from "react";
|
|
7
|
+
import { useEffect, useMemo, useState } from "react";
|
|
8
8
|
import { selection } from "./selection";
|
|
9
|
-
import { isEmpty } from "lodash";
|
|
10
9
|
export default function GraphView() {
|
|
11
10
|
const [isConnecting, setIsConnecting] = useState(false);
|
|
12
11
|
const [actionPrivileged, setActionPrivileged] = useState({
|
|
@@ -144,13 +143,16 @@ export default function GraphView() {
|
|
|
144
143
|
setDataDrag(null);
|
|
145
144
|
}
|
|
146
145
|
};
|
|
147
|
-
const [edges, setEdges] = useState(
|
|
148
|
-
|
|
146
|
+
const [edges, setEdges] = useState([]);
|
|
147
|
+
useEffect(() => {
|
|
148
|
+
setEdges(NODE_PROPERTIES);
|
|
149
|
+
}, [NODE_PROPERTIES]);
|
|
149
150
|
return (_jsx("div", { className: "w-full h-screen flex relative", children: _jsxs("div", { className: "flex", children: [_jsx("div", { className: "absolute top-0 left-0 z-10 flex gap-2", children: priviledged.map((item) => (_jsx(Button, { type: actionPrivileged[item.key] ? "primary" : "default", htmlType: "button", onClick: () => {
|
|
150
151
|
setActionPrivileged((prev) => (Object.assign(Object.assign({}, prev), { [item.key]: !prev[item.key] })));
|
|
151
152
|
}, children: item.name }, item.key))) }), _jsx(LayerView, { componentProps: componentSection, statusKey: "section", defaultBackground: "#1e2d4a", mappingKey: "properties", keyNode: "nodes", onEdgesChange: (edgesd) => {
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
console.log({ edgesd });
|
|
154
|
+
setEdges(edgesd);
|
|
155
|
+
}, initialEdges: edges, isConnectEdge: isConnecting, isSelectNode: isSelectNode, connectionMatchKey: {
|
|
154
156
|
key: "use_checking_availability",
|
|
155
157
|
value: 0,
|
|
156
158
|
}, onTableMainConnection: (e) => {
|
|
@@ -3,9 +3,8 @@ import clsx from "clsx";
|
|
|
3
3
|
import LayerView from "../../features/view-only-5";
|
|
4
4
|
import { COLORS_SECTION, data, NODE_PROPERTIES } from "./constant";
|
|
5
5
|
import { Button } from "antd";
|
|
6
|
-
import { useMemo, useState } from "react";
|
|
6
|
+
import { useEffect, useMemo, useState } from "react";
|
|
7
7
|
import { selection } from "./selection";
|
|
8
|
-
import { isEmpty } from "lodash";
|
|
9
8
|
export default function GraphView() {
|
|
10
9
|
const [isConnecting, setIsConnecting] = useState(false);
|
|
11
10
|
const [actionPrivileged, setActionPrivileged] = useState({
|
|
@@ -143,8 +142,10 @@ export default function GraphView() {
|
|
|
143
142
|
setDataDrag(null);
|
|
144
143
|
}
|
|
145
144
|
};
|
|
146
|
-
const [edges, setEdges] = useState(
|
|
147
|
-
|
|
145
|
+
const [edges, setEdges] = useState([]);
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
setEdges(NODE_PROPERTIES);
|
|
148
|
+
}, [NODE_PROPERTIES]);
|
|
148
149
|
return (<div className="w-full h-screen flex relative">
|
|
149
150
|
<div className="flex">
|
|
150
151
|
<div className="absolute top-0 left-0 z-10 flex gap-2">
|
|
@@ -155,8 +156,9 @@ export default function GraphView() {
|
|
|
155
156
|
</Button>))}
|
|
156
157
|
</div>
|
|
157
158
|
<LayerView componentProps={componentSection} statusKey="section" defaultBackground="#1e2d4a" mappingKey="properties" keyNode="nodes" onEdgesChange={(edgesd) => {
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
console.log({ edgesd });
|
|
160
|
+
setEdges(edgesd);
|
|
161
|
+
}} initialEdges={edges} isConnectEdge={isConnecting} isSelectNode={isSelectNode} connectionMatchKey={{
|
|
160
162
|
key: "use_checking_availability",
|
|
161
163
|
value: 0,
|
|
162
164
|
}} onTableMainConnection={(e) => {
|
|
@@ -651,7 +651,7 @@ const LayerView = (props) => {
|
|
|
651
651
|
tableMatchKey,
|
|
652
652
|
statusKey,
|
|
653
653
|
initialEdges: props === null || props === void 0 ? void 0 : props.initialEdges,
|
|
654
|
-
onTableMainConnection
|
|
654
|
+
onTableMainConnection,
|
|
655
655
|
groupSelection
|
|
656
656
|
});
|
|
657
657
|
// ─── Render ───────────────────────────────────────────────────────────────
|
|
@@ -650,7 +650,7 @@ const LayerView = (props) => {
|
|
|
650
650
|
tableMatchKey,
|
|
651
651
|
statusKey,
|
|
652
652
|
initialEdges: props === null || props === void 0 ? void 0 : props.initialEdges,
|
|
653
|
-
onTableMainConnection
|
|
653
|
+
onTableMainConnection,
|
|
654
654
|
groupSelection
|
|
655
655
|
});
|
|
656
656
|
// ─── Render ───────────────────────────────────────────────────────────────
|
|
@@ -32,6 +32,7 @@ export const useConnectionGraph = ({ svgRef, onEdgesChange, keyNode, mappingKey,
|
|
|
32
32
|
const endConnect = useCallback((toId, toPos) => {
|
|
33
33
|
if (!connecting || connecting.fromId === toId) {
|
|
34
34
|
setConnecting(null);
|
|
35
|
+
onTableMainConnection(null);
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
38
|
setEdges((prev) => {
|
|
@@ -54,7 +55,10 @@ export const useConnectionGraph = ({ svgRef, onEdgesChange, keyNode, mappingKey,
|
|
|
54
55
|
});
|
|
55
56
|
// setConnecting(null);
|
|
56
57
|
}, [connecting]);
|
|
57
|
-
const cancelConnect = useCallback(() =>
|
|
58
|
+
const cancelConnect = useCallback(() => {
|
|
59
|
+
onTableMainConnection(null);
|
|
60
|
+
setConnecting(null);
|
|
61
|
+
}, []);
|
|
58
62
|
// ── Drag endpoint ────────────────────────────────────────────────
|
|
59
63
|
const startDragAnchor = useCallback((e, edgeId, side) => {
|
|
60
64
|
e.stopPropagation();
|