jch-config-editor 0.1.2 → 0.1.4

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.
@@ -1,29 +1,29 @@
1
- import { jsxs as d, jsx as e, Fragment as ge } from "react/jsx-runtime";
2
- import oe, { useState as j, useRef as ue, useMemo as Pt, useCallback as G, useEffect as ae } from "react";
3
- import { Typography as vt, Upload as Tt, Button as Y, Collapse as se, List as fe, Empty as K, Tag as Q, Image as $t, Space as ee, Tooltip as pe, Modal as Qe, Form as b, Input as B, Divider as he, Select as ce, InputNumber as U, Tabs as yt, Switch as je, message as Me, ConfigProvider as _t, Layout as Je } from "antd";
4
- import { UploadOutlined as bt, EditOutlined as et, DeleteOutlined as Ue, UndoOutlined as Ot, RedoOutlined as Yt, GroupOutlined as zt, AlignLeftOutlined as At, AlignRightOutlined as Rt, VerticalAlignTopOutlined as Xt, VerticalAlignBottomOutlined as jt, ExperimentOutlined as Ft, ZoomInOutlined as Wt, ZoomOutOutlined as Ut, SelectOutlined as qt, DragOutlined as Gt, EyeOutlined as Bt, PlusOutlined as xt, ArrowUpOutlined as wt, ArrowDownOutlined as St, CopyOutlined as Vt, DownloadOutlined as Ht } from "@ant-design/icons";
5
- import { create as Zt } from "zustand";
6
- import { produce as Jt } from "immer";
7
- import { nanoid as $ } from "nanoid";
8
- import { TransformWrapper as Kt, TransformComponent as Qt } from "react-zoom-pan-pinch";
9
- function en(n) {
1
+ import { jsxs as c, jsx as e, Fragment as Se } from "react/jsx-runtime";
2
+ import de, { useState as q, useRef as ue, useMemo as xt, useCallback as G, useEffect as se } from "react";
3
+ import { Typography as wt, Upload as Ot, Button as j, Collapse as he, List as xe, Empty as ne, Tag as le, Image as Xt, Space as ae, Tooltip as we, Modal as tt, Form as v, Input as J, Divider as ye, Select as me, InputNumber as V, Tabs as St, Switch as Fe, message as De, ConfigProvider as zt, Layout as Qe } from "antd";
4
+ import { UploadOutlined as Ct, EditOutlined as nt, DeleteOutlined as qe, UndoOutlined as Rt, RedoOutlined as At, GroupOutlined as at, AlignLeftOutlined as jt, AlignRightOutlined as Ft, VerticalAlignTopOutlined as Wt, VerticalAlignBottomOutlined as Ut, ExperimentOutlined as qt, ZoomInOutlined as Gt, ZoomOutOutlined as Bt, SelectOutlined as Vt, DragOutlined as Ht, EyeOutlined as Zt, PlusOutlined as Nt, ArrowUpOutlined as It, ArrowDownOutlined as kt, CopyOutlined as Jt, DownloadOutlined as Kt } from "@ant-design/icons";
5
+ import { create as Qt } from "zustand";
6
+ import { produce as en } from "immer";
7
+ import { nanoid as z } from "nanoid";
8
+ import { TransformWrapper as tn, TransformComponent as nn } from "react-zoom-pan-pinch";
9
+ function ln(n) {
10
10
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
11
11
  }
12
- var Le = {}, Ve = { exports: {} }, lt;
13
- function tt() {
14
- return lt || (lt = 1, (function(n) {
15
- function h(t) {
12
+ var Le = {}, Ze = { exports: {} }, it;
13
+ function lt() {
14
+ return it || (it = 1, (function(n) {
15
+ function f(t) {
16
16
  return t && t.__esModule ? t : {
17
17
  default: t
18
18
  };
19
19
  }
20
- n.exports = h, n.exports.__esModule = !0, n.exports.default = n.exports;
21
- })(Ve)), Ve.exports;
20
+ n.exports = f, n.exports.__esModule = !0, n.exports.default = n.exports;
21
+ })(Ze)), Ze.exports;
22
22
  }
23
- var Pe = {}, rt;
24
- function tn() {
25
- if (rt) return Pe;
26
- rt = 1, Object.defineProperty(Pe, "__esModule", {
23
+ var Pe = {}, ot;
24
+ function rn() {
25
+ if (ot) return Pe;
26
+ ot = 1, Object.defineProperty(Pe, "__esModule", {
27
27
  value: !0
28
28
  }), Pe.default = void 0;
29
29
  const n = {
@@ -43,69 +43,69 @@ function tn() {
43
43
  };
44
44
  return Pe.default = n, Pe;
45
45
  }
46
- var Te = {}, $e = {}, _e = {}, Oe = {}, at;
47
- function nn() {
48
- return at || (at = 1, Object.defineProperty(Oe, "__esModule", {
46
+ var Te = {}, $e = {}, _e = {}, Ye = {}, st;
47
+ function an() {
48
+ return st || (st = 1, Object.defineProperty(Ye, "__esModule", {
49
49
  value: !0
50
- }), Oe.commonLocale = void 0, Oe.commonLocale = {
50
+ }), Ye.commonLocale = void 0, Ye.commonLocale = {
51
51
  yearFormat: "YYYY",
52
52
  dayFormat: "D",
53
53
  cellMeridiemFormat: "A",
54
54
  monthBeforeYear: !0
55
- }), Oe;
55
+ }), Ye;
56
56
  }
57
- var it;
58
- function ln() {
59
- if (it) return _e;
60
- it = 1, Object.defineProperty(_e, "__esModule", {
57
+ var ct;
58
+ function on() {
59
+ if (ct) return _e;
60
+ ct = 1, Object.defineProperty(_e, "__esModule", {
61
61
  value: !0
62
62
  }), _e.default = void 0;
63
- var n = nn();
64
- function h(p) {
63
+ var n = an();
64
+ function f(h) {
65
65
  "@babel/helpers - typeof";
66
- return h = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(f) {
67
- return typeof f;
68
- } : function(f) {
69
- return f && typeof Symbol == "function" && f.constructor === Symbol && f !== Symbol.prototype ? "symbol" : typeof f;
70
- }, h(p);
66
+ return f = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(p) {
67
+ return typeof p;
68
+ } : function(p) {
69
+ return p && typeof Symbol == "function" && p.constructor === Symbol && p !== Symbol.prototype ? "symbol" : typeof p;
70
+ }, f(h);
71
71
  }
72
- function t(p, f) {
73
- var u = Object.keys(p);
72
+ function t(h, p) {
73
+ var u = Object.keys(h);
74
74
  if (Object.getOwnPropertySymbols) {
75
- var w = Object.getOwnPropertySymbols(p);
76
- f && (w = w.filter(function(s) {
77
- return Object.getOwnPropertyDescriptor(p, s).enumerable;
78
- })), u.push.apply(u, w);
75
+ var b = Object.getOwnPropertySymbols(h);
76
+ p && (b = b.filter(function(s) {
77
+ return Object.getOwnPropertyDescriptor(h, s).enumerable;
78
+ })), u.push.apply(u, b);
79
79
  }
80
80
  return u;
81
81
  }
82
- function r(p) {
83
- for (var f = 1; f < arguments.length; f++) {
84
- var u = arguments[f] != null ? arguments[f] : {};
85
- f % 2 ? t(Object(u), !0).forEach(function(w) {
86
- c(p, w, u[w]);
87
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(p, Object.getOwnPropertyDescriptors(u)) : t(Object(u)).forEach(function(w) {
88
- Object.defineProperty(p, w, Object.getOwnPropertyDescriptor(u, w));
82
+ function r(h) {
83
+ for (var p = 1; p < arguments.length; p++) {
84
+ var u = arguments[p] != null ? arguments[p] : {};
85
+ p % 2 ? t(Object(u), !0).forEach(function(b) {
86
+ d(h, b, u[b]);
87
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(h, Object.getOwnPropertyDescriptors(u)) : t(Object(u)).forEach(function(b) {
88
+ Object.defineProperty(h, b, Object.getOwnPropertyDescriptor(u, b));
89
89
  });
90
90
  }
91
- return p;
91
+ return h;
92
92
  }
93
- function c(p, f, u) {
94
- return f = l(f), f in p ? Object.defineProperty(p, f, { value: u, enumerable: !0, configurable: !0, writable: !0 }) : p[f] = u, p;
93
+ function d(h, p, u) {
94
+ return p = l(p), p in h ? Object.defineProperty(h, p, { value: u, enumerable: !0, configurable: !0, writable: !0 }) : h[p] = u, h;
95
95
  }
96
- function l(p) {
97
- var f = a(p, "string");
98
- return h(f) == "symbol" ? f : String(f);
96
+ function l(h) {
97
+ var p = a(h, "string");
98
+ return f(p) == "symbol" ? p : String(p);
99
99
  }
100
- function a(p, f) {
101
- if (h(p) != "object" || !p) return p;
102
- var u = p[Symbol.toPrimitive];
100
+ function a(h, p) {
101
+ if (f(h) != "object" || !h) return h;
102
+ var u = h[Symbol.toPrimitive];
103
103
  if (u !== void 0) {
104
- var w = u.call(p, f);
105
- if (h(w) != "object") return w;
104
+ var b = u.call(h, p);
105
+ if (f(b) != "object") return b;
106
106
  throw new TypeError("@@toPrimitive must return a primitive value.");
107
107
  }
108
- return (f === "string" ? String : Number)(p);
108
+ return (p === "string" ? String : Number)(h);
109
109
  }
110
110
  var o = r(r({}, n.commonLocale), {}, {
111
111
  locale: "zh_CN",
@@ -137,27 +137,27 @@ function ln() {
137
137
  });
138
138
  return _e.default = o, _e;
139
139
  }
140
- var Ye = {}, ot;
141
- function Ct() {
142
- if (ot) return Ye;
143
- ot = 1, Object.defineProperty(Ye, "__esModule", {
140
+ var Oe = {}, dt;
141
+ function Et() {
142
+ if (dt) return Oe;
143
+ dt = 1, Object.defineProperty(Oe, "__esModule", {
144
144
  value: !0
145
- }), Ye.default = void 0;
145
+ }), Oe.default = void 0;
146
146
  const n = {
147
147
  placeholder: "请选择时间",
148
148
  rangePlaceholder: ["开始时间", "结束时间"]
149
149
  };
150
- return Ye.default = n, Ye;
150
+ return Oe.default = n, Oe;
151
151
  }
152
- var st;
153
- function Nt() {
154
- if (st) return $e;
155
- st = 1;
156
- var n = tt().default;
152
+ var ut;
153
+ function Mt() {
154
+ if (ut) return $e;
155
+ ut = 1;
156
+ var n = lt().default;
157
157
  Object.defineProperty($e, "__esModule", {
158
158
  value: !0
159
159
  }), $e.default = void 0;
160
- var h = n(ln()), t = n(/* @__PURE__ */ Ct());
160
+ var f = n(on()), t = n(/* @__PURE__ */ Et());
161
161
  const r = {
162
162
  lang: {
163
163
  placeholder: "请选择日期",
@@ -170,7 +170,7 @@ function Nt() {
170
170
  rangeMonthPlaceholder: ["开始月份", "结束月份"],
171
171
  rangeQuarterPlaceholder: ["开始季度", "结束季度"],
172
172
  rangeWeekPlaceholder: ["开始周", "结束周"],
173
- ...h.default
173
+ ...f.default
174
174
  },
175
175
  timePickerLocale: {
176
176
  ...t.default
@@ -178,31 +178,31 @@ function Nt() {
178
178
  };
179
179
  return r.lang.ok = "确定", $e.default = r, $e;
180
180
  }
181
- var ct;
182
- function rn() {
183
- if (ct) return Te;
184
- ct = 1;
185
- var n = tt().default;
181
+ var ht;
182
+ function sn() {
183
+ if (ht) return Te;
184
+ ht = 1;
185
+ var n = lt().default;
186
186
  Object.defineProperty(Te, "__esModule", {
187
187
  value: !0
188
188
  }), Te.default = void 0;
189
- var h = n(/* @__PURE__ */ Nt());
190
- return Te.default = h.default, Te;
189
+ var f = n(/* @__PURE__ */ Mt());
190
+ return Te.default = f.default, Te;
191
191
  }
192
- var dt;
193
- function an() {
194
- if (dt) return Le;
195
- dt = 1;
196
- var n = tt().default;
192
+ var mt;
193
+ function cn() {
194
+ if (mt) return Le;
195
+ mt = 1;
196
+ var n = lt().default;
197
197
  Object.defineProperty(Le, "__esModule", {
198
198
  value: !0
199
199
  }), Le.default = void 0;
200
- var h = n(tn()), t = n(/* @__PURE__ */ rn()), r = n(/* @__PURE__ */ Nt()), c = n(/* @__PURE__ */ Ct());
200
+ var f = n(rn()), t = n(/* @__PURE__ */ sn()), r = n(/* @__PURE__ */ Mt()), d = n(/* @__PURE__ */ Et());
201
201
  const l = "${label}不是一个有效的${type}", a = {
202
202
  locale: "zh-cn",
203
- Pagination: h.default,
203
+ Pagination: f.default,
204
204
  DatePicker: r.default,
205
- TimePicker: c.default,
205
+ TimePicker: d.default,
206
206
  Calendar: t.default,
207
207
  // locales for all components
208
208
  global: {
@@ -340,15 +340,15 @@ function an() {
340
340
  };
341
341
  return Le.default = a, Le;
342
342
  }
343
- var He, ut;
344
- function on() {
345
- return ut || (ut = 1, He = /* @__PURE__ */ an()), He;
343
+ var Je, ft;
344
+ function dn() {
345
+ return ft || (ft = 1, Je = /* @__PURE__ */ cn()), Je;
346
346
  }
347
- var sn = /* @__PURE__ */ on();
348
- const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l, ...a) => {
349
- const o = typeof c == "function" ? Jt(c) : c;
350
- return h(o, l, ...a);
351
- }, n(r.setState, t, r)), un = dn, ht = {
347
+ var un = /* @__PURE__ */ dn();
348
+ const hn = /* @__PURE__ */ ln(un), mn = (n) => (f, t, r) => (r.setState = (d, l, ...a) => {
349
+ const o = typeof d == "function" ? en(d) : d;
350
+ return f(o, l, ...a);
351
+ }, n(r.setState, t, r)), fn = mn, pt = {
352
352
  nodes: [],
353
353
  materials: [],
354
354
  selectedNodeId: null,
@@ -369,86 +369,86 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
369
369
  startPoint: null,
370
370
  endPoint: null
371
371
  }
372
- }, ie = (n, h, t) => ({
373
- id: $(),
372
+ }, ce = (n, f, t) => ({
373
+ id: z(),
374
374
  type: n,
375
- targetId: h,
375
+ targetId: f,
376
376
  payload: t,
377
377
  timestamp: Date.now()
378
- }), xe = Zt()(
379
- un((n, h) => ({
380
- ...ht,
378
+ }), Ie = Qt()(
379
+ fn((n, f) => ({
380
+ ...pt,
381
381
  // ========== 节点操作 ==========
382
382
  addNode: (t, r = !0) => {
383
- n((c) => {
383
+ n((d) => {
384
384
  const l = {
385
385
  ...t,
386
- id: $()
386
+ id: z()
387
387
  };
388
- c.nodes.push(l), r && (c.selectedNodeId = l.id, c.history.past.push(ie("NODE_SELECT", l.id)));
388
+ d.nodes.push(l), r && (d.selectedNodeId = l.id, d.history.past.push(ce("NODE_SELECT", l.id)));
389
389
  });
390
390
  },
391
391
  updateNode: (t, r) => {
392
- n((c) => {
393
- const l = c.nodes.find((a) => a.id === t);
394
- l && (Object.assign(l, r), c.history.past.push(ie("PROPERTY_CHANGE", t, r)));
392
+ n((d) => {
393
+ const l = d.nodes.find((a) => a.id === t);
394
+ l && (Object.assign(l, r), d.history.past.push(ce("PROPERTY_CHANGE", t, r)));
395
395
  });
396
396
  },
397
397
  updateNodeStyle: (t, r) => {
398
- n((c) => {
399
- const l = c.nodes.find((a) => a.id === t);
400
- l && (Object.assign(l.normalStyle, r), c.history.past.push(ie("PROPERTY_CHANGE", t, { normalStyle: r })));
398
+ n((d) => {
399
+ const l = d.nodes.find((a) => a.id === t);
400
+ l && (Object.assign(l.normalStyle, r), d.history.past.push(ce("PROPERTY_CHANGE", t, { normalStyle: r })));
401
401
  });
402
402
  },
403
403
  updateNodeContent: (t, r) => {
404
- n((c) => {
405
- const l = c.nodes.find((a) => a.id === t);
406
- l && (Object.assign(l.contentInfo, r), c.history.past.push(ie("PROPERTY_CHANGE", t, { contentInfo: r })));
404
+ n((d) => {
405
+ const l = d.nodes.find((a) => a.id === t);
406
+ l && (l.contentInfo = { ...l.contentInfo, ...r }, d.history.past.push(ce("PROPERTY_CHANGE", t, { contentInfo: r })));
407
407
  });
408
408
  },
409
409
  updateNodeControl: (t, r) => {
410
- n((c) => {
411
- const l = c.nodes.find((a) => a.id === t);
412
- l && (Object.assign(l.controlInfo, r), c.history.past.push(ie("PROPERTY_CHANGE", t, { controlInfo: r })));
410
+ n((d) => {
411
+ const l = d.nodes.find((a) => a.id === t);
412
+ l && (Object.assign(l.controlInfo, r), d.history.past.push(ce("PROPERTY_CHANGE", t, { controlInfo: r })));
413
413
  });
414
414
  },
415
415
  removeNode: (t) => {
416
416
  n((r) => {
417
- const c = r.nodes.findIndex((l) => l.id === t);
418
- c !== -1 && (r.nodes.splice(c, 1), r.selectedNodeId === t && (r.selectedNodeId = null, r.selectedStatusId = null), r.history.past.push(ie("NODE_DELETE", t)));
417
+ const d = r.nodes.findIndex((l) => l.id === t);
418
+ d !== -1 && (r.nodes.splice(d, 1), r.selectedNodeId === t && (r.selectedNodeId = null, r.selectedStatusId = null), r.history.past.push(ce("NODE_DELETE", t)));
419
419
  });
420
420
  },
421
421
  selectNode: (t) => {
422
422
  n((r) => {
423
- r.selectedNodeId = t, r.selectedStatusId = null, t && r.history.past.push(ie("NODE_SELECT", t));
423
+ r.selectedNodeId = t, r.selectedStatusId = null, t && r.history.past.push(ce("NODE_SELECT", t));
424
424
  });
425
425
  },
426
426
  // ========== 状态操作 ==========
427
427
  addStatus: (t, r) => {
428
- n((c) => {
429
- const l = c.nodes.find((o) => o.id === t);
428
+ n((d) => {
429
+ const l = d.nodes.find((o) => o.id === t);
430
430
  if (!l) return;
431
431
  const a = {
432
432
  ...r,
433
- id: $()
433
+ id: z()
434
434
  };
435
- l.contentInfo.statusList.push(a), c.history.past.push(ie("MATERIAL_STATUS_CHANGE", t, { statusId: a.id }));
435
+ l.contentInfo.statusList.push(a), d.history.past.push(ce("MATERIAL_STATUS_CHANGE", t, { statusId: a.id }));
436
436
  });
437
437
  },
438
438
  removeStatus: (t, r) => {
439
- n((c) => {
440
- const l = c.nodes.find((o) => o.id === t);
439
+ n((d) => {
440
+ const l = d.nodes.find((o) => o.id === t);
441
441
  if (!l) return;
442
442
  const a = l.contentInfo.statusList.findIndex((o) => o.id === r);
443
- a !== -1 && (l.contentInfo.statusList.splice(a, 1), l.contentInfo.currentStatusId === r && (l.contentInfo.currentStatusId = void 0), c.selectedStatusId === r && (c.selectedStatusId = null));
443
+ a !== -1 && (l.contentInfo.statusList.splice(a, 1), l.contentInfo.currentStatusId === r && (l.contentInfo.currentStatusId = void 0), d.selectedStatusId === r && (d.selectedStatusId = null));
444
444
  });
445
445
  },
446
- updateStatus: (t, r, c) => {
446
+ updateStatus: (t, r, d) => {
447
447
  n((l) => {
448
- const a = l.nodes.find((p) => p.id === t);
448
+ const a = l.nodes.find((h) => h.id === t);
449
449
  if (!a) return;
450
- const o = a.contentInfo.statusList.find((p) => p.id === r);
451
- o && Object.assign(o, c);
450
+ const o = a.contentInfo.statusList.find((h) => h.id === r);
451
+ o && Object.assign(o, d);
452
452
  });
453
453
  },
454
454
  selectStatus: (t) => {
@@ -457,7 +457,7 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
457
457
  });
458
458
  },
459
459
  evaluateCurrentStatus: (t, r) => {
460
- const l = h().nodes.find((a) => a.id === t);
460
+ const l = f().nodes.find((a) => a.id === t);
461
461
  if (l)
462
462
  for (const a of l.contentInfo.statusList)
463
463
  try {
@@ -470,23 +470,23 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
470
470
  // ========== 物料库操作 ==========
471
471
  addMaterial: (t) => {
472
472
  n((r) => {
473
- const c = {
473
+ const d = {
474
474
  ...t,
475
- id: $()
475
+ id: z()
476
476
  };
477
- r.materials.push(c), r.history.past.push(ie("MATERIAL_ADD", c.id));
477
+ r.materials.push(d), r.history.past.push(ce("MATERIAL_ADD", d.id));
478
478
  });
479
479
  },
480
480
  updateMaterial: (t, r) => {
481
- n((c) => {
482
- const l = c.materials.find((a) => a.id === t);
481
+ n((d) => {
482
+ const l = d.materials.find((a) => a.id === t);
483
483
  l && Object.assign(l, r);
484
484
  });
485
485
  },
486
486
  removeMaterial: (t) => {
487
487
  n((r) => {
488
- const c = r.materials.findIndex((l) => l.id === t);
489
- c !== -1 && r.materials.splice(c, 1);
488
+ const d = r.materials.findIndex((l) => l.id === t);
489
+ d !== -1 && r.materials.splice(d, 1);
490
490
  });
491
491
  },
492
492
  // ========== 视口操作 ==========
@@ -557,7 +557,7 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
557
557
  },
558
558
  // ========== 导入导出 ==========
559
559
  exportScheme: () => {
560
- const t = h();
560
+ const t = f();
561
561
  return {
562
562
  version: "1.1.0",
563
563
  nodes: t.nodes,
@@ -573,52 +573,52 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
573
573
  },
574
574
  importScheme: (t) => {
575
575
  n((r) => {
576
- r.nodes = t.nodes || [], r.materials = t.materials || [], r.viewport = t.viewport || ht.viewport, r.selectedNodeId = null, r.selectedStatusId = null, r.history = { past: [], future: [] };
576
+ r.nodes = t.nodes || [], r.materials = t.materials || [], r.viewport = t.viewport || pt.viewport, r.selectedNodeId = null, r.selectedStatusId = null, r.history = { past: [], future: [] };
577
577
  });
578
578
  }
579
579
  }))
580
- ), hn = [
580
+ ), pn = [
581
581
  // 基础形状
582
582
  {
583
- id: $(),
583
+ id: z(),
584
584
  name: "矩形",
585
585
  type: "IMAGE",
586
586
  src: `data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="100" height="60"><rect width="100" height="60" fill="#1890ff" rx="4"/></svg>')}`
587
587
  },
588
588
  {
589
- id: $(),
589
+ id: z(),
590
590
  name: "圆形",
591
591
  type: "IMAGE",
592
592
  src: `data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80"><circle cx="40" cy="40" r="38" fill="#52c41a"/></svg>')}`
593
593
  },
594
594
  {
595
- id: $(),
595
+ id: z(),
596
596
  name: "圆角矩形",
597
597
  type: "IMAGE",
598
598
  src: `data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="100" height="60"><rect width="100" height="60" fill="#faad14" rx="20"/></svg>')}`
599
599
  },
600
600
  // 设备图标
601
601
  {
602
- id: $(),
602
+ id: z(),
603
603
  name: "阀门",
604
604
  type: "IMAGE",
605
605
  src: `data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60"><path d="M10 20 L30 10 L50 20 L50 40 L30 50 L10 40 Z" fill="#bfbfbf" stroke="#595959" stroke-width="2"/><circle cx="30" cy="30" r="8" fill="#1890ff"/></svg>')}`
606
606
  },
607
607
  {
608
- id: $(),
608
+ id: z(),
609
609
  name: "泵",
610
610
  type: "IMAGE",
611
611
  src: `data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60"><circle cx="30" cy="35" r="20" fill="#bfbfbf" stroke="#595959" stroke-width="2"/><rect x="25" y="5" width="10" height="15" fill="#595959"/><path d="M30 20 L30 35 M20 30 Q30 45 40 30" stroke="#595959" stroke-width="2" fill="none"/></svg>')}`
612
612
  },
613
613
  {
614
- id: $(),
614
+ id: z(),
615
615
  name: "罐体",
616
616
  type: "IMAGE",
617
617
  src: `data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="60" height="80"><ellipse cx="30" cy="10" rx="25" ry="10" fill="#d9d9d9" stroke="#595959" stroke-width="2"/><rect x="5" y="10" width="50" height="60" fill="#f0f0f0" stroke="#595959" stroke-width="2"/><ellipse cx="30" cy="70" rx="25" ry="10" fill="#d9d9d9" stroke="#595959" stroke-width="2"/></svg>')}`
618
618
  },
619
619
  // 文本
620
620
  {
621
- id: $(),
621
+ id: z(),
622
622
  name: "文本标签",
623
623
  type: "TEXT",
624
624
  content: {
@@ -640,7 +640,7 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
640
640
  },
641
641
  // 线条 - 通用线条物料,通过属性配置实现不同线型
642
642
  {
643
- id: $(),
643
+ id: z(),
644
644
  name: "线条",
645
645
  type: "LINE",
646
646
  config: {
@@ -650,43 +650,43 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
650
650
  lineType: "solid"
651
651
  }
652
652
  }
653
- ], It = (n) => ({
654
- id: $(),
653
+ ], Dt = (n) => ({
654
+ id: z(),
655
655
  name: "默认状态",
656
656
  expression: "return true;",
657
- material: { ...n, id: $() },
657
+ material: { ...n, id: z() },
658
658
  bindCodes: []
659
- }), mn = (n, h, t) => {
659
+ }), gn = (n, f, t) => {
660
660
  if (t?.type === "CUSTOM" && t.config?.nodes) {
661
- const r = t.config.nodes.map((f) => ({
662
- ...f,
663
- id: $()
661
+ const r = t.config.nodes.map((p) => ({
662
+ ...p,
663
+ id: z()
664
664
  // 重新生成子节点ID
665
665
  }));
666
- let c = 1 / 0, l = 1 / 0, a = -1 / 0, o = -1 / 0;
667
- r.forEach((f) => {
668
- const u = f.normalStyle.x || 0, w = f.normalStyle.y || 0, s = f.normalStyle.width || 0, x = f.normalStyle.height || 0;
669
- c = Math.min(c, u), l = Math.min(l, w), a = Math.max(a, u + s), o = Math.max(o, w + x);
666
+ let d = 1 / 0, l = 1 / 0, a = -1 / 0, o = -1 / 0;
667
+ r.forEach((p) => {
668
+ const u = p.normalStyle.x || 0, b = p.normalStyle.y || 0, s = p.normalStyle.width || 0, x = p.normalStyle.height || 0;
669
+ d = Math.min(d, u), l = Math.min(l, b), a = Math.max(a, u + s), o = Math.max(o, b + x);
670
670
  });
671
- const p = r.map((f) => ({
672
- ...f,
671
+ const h = r.map((p) => ({
672
+ ...p,
673
673
  normalStyle: {
674
- ...f.normalStyle,
675
- x: (f.normalStyle.x || 0) - c,
676
- y: (f.normalStyle.y || 0) - l,
674
+ ...p.normalStyle,
675
+ x: (p.normalStyle.x || 0) - d,
676
+ y: (p.normalStyle.y || 0) - l,
677
677
  scale: void 0
678
678
  // 移除 scale,由父级容器统一控制
679
679
  }
680
680
  }));
681
681
  return {
682
- id: $(),
682
+ id: z(),
683
683
  name: t.name || "群组节点",
684
684
  type: "group",
685
685
  normalStyle: {
686
- width: a - c,
686
+ width: a - d,
687
687
  height: o - l,
688
688
  x: n,
689
- y: h
689
+ y: f
690
690
  // 不设置背景和边框,由 NodeRenderer 控制
691
691
  },
692
692
  contentInfo: {
@@ -699,23 +699,23 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
699
699
  isResizable: !0,
700
700
  isSelectable: !0
701
701
  },
702
- children: p
702
+ children: h
703
703
  };
704
704
  }
705
705
  return {
706
- id: $(),
706
+ id: z(),
707
707
  name: "新节点",
708
708
  type: "normal",
709
709
  normalStyle: {
710
710
  width: 120,
711
711
  height: 100,
712
712
  x: n,
713
- y: h,
713
+ y: f,
714
714
  background: "transparent",
715
715
  padding: 8
716
716
  },
717
717
  contentInfo: {
718
- statusList: t ? [It(t)] : [],
718
+ statusList: t ? [Dt(t)] : [],
719
719
  currentStatusId: void 0
720
720
  },
721
721
  controlInfo: {
@@ -725,32 +725,32 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
725
725
  isSelectable: !0
726
726
  }
727
727
  };
728
- }, { Panel: be } = se, { Text: Fe } = vt, fn = () => {
728
+ }, { Panel: Ne } = he, { Text: We } = wt, yn = () => {
729
729
  const {
730
730
  materials: n,
731
- addMaterial: h,
731
+ addMaterial: f,
732
732
  removeMaterial: t,
733
733
  selectedStatusId: r,
734
- selectStatus: c,
734
+ selectStatus: d,
735
735
  mode: l,
736
736
  lineDrawing: a,
737
737
  startLineDrawing: o,
738
- cancelLineDrawing: p
739
- } = xe(), [f, u] = j([
738
+ cancelLineDrawing: h
739
+ } = Ie(), [p, u] = q([
740
740
  "basic",
741
741
  "device",
742
742
  "text",
743
743
  "line"
744
- ]), w = (m) => {
745
- const _ = new FileReader();
746
- return _.onload = (P) => {
747
- const D = P.target?.result;
748
- h({
744
+ ]), b = (m) => {
745
+ const A = new FileReader();
746
+ return A.onload = (Y) => {
747
+ const D = Y.target?.result;
748
+ f({
749
749
  name: m.name.replace(".svg", ""),
750
750
  type: "IMAGE",
751
751
  src: D
752
752
  });
753
- }, _.readAsDataURL(m), !1;
753
+ }, A.readAsDataURL(m), !1;
754
754
  }, s = {
755
755
  basic: n.filter(
756
756
  (m) => ["矩形", "圆形", "圆角矩形"].includes(m.name)
@@ -764,59 +764,59 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
764
764
  custom: n.filter(
765
765
  (m) => m.type === "CUSTOM" && !m.config?.nodes || m.type === "IMAGE" && !["矩形", "圆形", "圆角矩形", "阀门", "泵", "罐体"].includes(m.name)
766
766
  )
767
- }, x = (m, _) => {
768
- m.dataTransfer.effectAllowed = "copy", m.dataTransfer.setData("application/json", JSON.stringify(_));
769
- const P = m.currentTarget.querySelector(
767
+ }, x = (m, A) => {
768
+ m.dataTransfer.effectAllowed = "copy", m.dataTransfer.setData("application/json", JSON.stringify(A));
769
+ const Y = m.currentTarget.querySelector(
770
770
  ".material-preview"
771
771
  );
772
- P && m.dataTransfer.setDragImage(P, 20, 20);
773
- }, g = (m) => {
772
+ Y && m.dataTransfer.setDragImage(Y, 20, 20);
773
+ }, y = (m) => {
774
774
  m.type === "LINE" && o(m);
775
- }, C = (m, _ = !1) => {
776
- const P = _ === !0, D = l === "line-draw" && P && a.material?.id === m.id;
775
+ }, E = (m, A = !1) => {
776
+ const Y = A === !0, D = l === "line-draw" && Y && a.material?.id === m.id;
777
777
  return /* @__PURE__ */ e(
778
- fe.Item,
778
+ xe.Item,
779
779
  {
780
- draggable: !P,
781
- onDragStart: (E) => x(E, m),
782
- onClick: () => P && g(m),
780
+ draggable: !Y,
781
+ onDragStart: (L) => x(L, m),
782
+ onClick: () => Y && y(m),
783
783
  className: `
784
784
  rounded-lg transition-all duration-200 select-none
785
- ${P ? "cursor-pointer" : "cursor-move"}
785
+ ${Y ? "cursor-pointer" : "cursor-move"}
786
786
  hover:bg-gray-100
787
787
  ${D ? "bg-blue-50 ring-2 ring-blue-400" : ""}
788
788
  `,
789
789
  actions: [
790
- P ? /* @__PURE__ */ e(
791
- Y,
790
+ Y ? /* @__PURE__ */ e(
791
+ j,
792
792
  {
793
793
  type: "text",
794
794
  size: "small",
795
- icon: /* @__PURE__ */ e(et, {}),
796
- onClick: (E) => {
797
- E.stopPropagation(), g(m);
795
+ icon: /* @__PURE__ */ e(nt, {}),
796
+ onClick: (L) => {
797
+ L.stopPropagation(), y(m);
798
798
  },
799
799
  children: "绘制"
800
800
  },
801
801
  "draw"
802
802
  ) : null,
803
803
  /* @__PURE__ */ e(
804
- Y,
804
+ j,
805
805
  {
806
806
  type: "text",
807
807
  size: "small",
808
808
  danger: !0,
809
- icon: /* @__PURE__ */ e(Ue, {}),
810
- onClick: (E) => {
811
- E.stopPropagation(), t(m.id);
809
+ icon: /* @__PURE__ */ e(qe, {}),
810
+ onClick: (L) => {
811
+ L.stopPropagation(), t(m.id);
812
812
  }
813
813
  },
814
814
  "delete"
815
815
  )
816
816
  ].filter(Boolean),
817
- children: /* @__PURE__ */ d("div", { className: `flex items-center gap-3 w-full py-2 ${P ? "" : "pointer-events-none"}`, children: [
817
+ children: /* @__PURE__ */ c("div", { className: `flex items-center gap-3 w-full py-2 ${Y ? "" : "pointer-events-none"}`, children: [
818
818
  /* @__PURE__ */ e("div", { className: "material-preview w-12 h-12 flex items-center justify-center bg-white rounded border border-gray-200", children: m.type === "IMAGE" && m.src ? /* @__PURE__ */ e(
819
- $t,
819
+ Xt,
820
820
  {
821
821
  src: m.src,
822
822
  alt: m.name,
@@ -825,11 +825,11 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
825
825
  preview: !1
826
826
  }
827
827
  ) : m.type === "TEXT" ? /* @__PURE__ */ e("span", { className: "text-xs text-gray-500", children: "T" }) : m.type === "LINE" ? /* @__PURE__ */ e("div", { className: "w-8 h-0.5 bg-gray-400" }) : m.type === "CUSTOM" && m.config?.nodes ? /* @__PURE__ */ e("span", { className: "text-xs text-blue-500 font-bold", children: "G" }) : /* @__PURE__ */ e("span", { className: "text-xs text-gray-500", children: "?" }) }),
828
- /* @__PURE__ */ d("div", { className: "flex-1 min-w-0", children: [
829
- /* @__PURE__ */ e(Fe, { strong: !0, className: "block truncate", children: m.name }),
830
- /* @__PURE__ */ d("div", { className: "flex items-center gap-1", children: [
831
- /* @__PURE__ */ e(Fe, { type: "secondary", className: "text-xs", children: m.type }),
832
- D && /* @__PURE__ */ e(Q, { color: "blue", className: "text-xs", children: "绘制中" })
828
+ /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
829
+ /* @__PURE__ */ e(We, { strong: !0, className: "block truncate", children: m.name }),
830
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-1", children: [
831
+ /* @__PURE__ */ e(We, { type: "secondary", className: "text-xs", children: m.type }),
832
+ D && /* @__PURE__ */ e(le, { color: "blue", className: "text-xs", children: "绘制中" })
833
833
  ] })
834
834
  ] })
835
835
  ] })
@@ -837,101 +837,101 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
837
837
  m.id
838
838
  );
839
839
  };
840
- return /* @__PURE__ */ d("div", { className: "h-full flex flex-col bg-white border-r border-gray-200", children: [
841
- /* @__PURE__ */ d("div", { className: "p-4 border-b border-gray-200", children: [
840
+ return /* @__PURE__ */ c("div", { className: "h-full flex flex-col bg-white border-r border-gray-200", children: [
841
+ /* @__PURE__ */ c("div", { className: "p-4 border-b border-gray-200", children: [
842
842
  /* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-gray-800", children: "物料库" }),
843
- /* @__PURE__ */ e(Fe, { type: "secondary", className: "text-sm", children: "拖拽物料到画布创建节点" })
843
+ /* @__PURE__ */ e(We, { type: "secondary", className: "text-sm", children: "拖拽物料到画布创建节点" })
844
844
  ] }),
845
845
  /* @__PURE__ */ e("div", { className: "p-3 border-b border-gray-200", children: /* @__PURE__ */ e(
846
- Tt,
846
+ Ot,
847
847
  {
848
848
  accept: ".svg",
849
- beforeUpload: w,
849
+ beforeUpload: b,
850
850
  showUploadList: !1,
851
- children: /* @__PURE__ */ e(Y, { icon: /* @__PURE__ */ e(bt, {}), block: !0, type: "dashed", children: "上传 SVG" })
851
+ children: /* @__PURE__ */ e(j, { icon: /* @__PURE__ */ e(Ct, {}), block: !0, type: "dashed", children: "上传 SVG" })
852
852
  }
853
853
  ) }),
854
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-2", children: /* @__PURE__ */ d(
855
- se,
854
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-2", children: /* @__PURE__ */ c(
855
+ he,
856
856
  {
857
- activeKey: f,
857
+ activeKey: p,
858
858
  onChange: (m) => u(m),
859
859
  ghost: !0,
860
860
  expandIconPosition: "end",
861
861
  children: [
862
- /* @__PURE__ */ e(be, { header: "基础形状", children: /* @__PURE__ */ e(
863
- fe,
862
+ /* @__PURE__ */ e(Ne, { header: "基础形状", children: /* @__PURE__ */ e(
863
+ xe,
864
864
  {
865
865
  dataSource: s.basic,
866
- renderItem: (m) => C(m, !1),
866
+ renderItem: (m) => E(m, !1),
867
867
  locale: {
868
868
  emptyText: /* @__PURE__ */ e(
869
- K,
869
+ ne,
870
870
  {
871
871
  description: "暂无物料",
872
- image: K.PRESENTED_IMAGE_SIMPLE
872
+ image: ne.PRESENTED_IMAGE_SIMPLE
873
873
  }
874
874
  )
875
875
  }
876
876
  }
877
877
  ) }, "basic"),
878
- /* @__PURE__ */ e(be, { header: "设备图标", children: /* @__PURE__ */ e(
879
- fe,
878
+ /* @__PURE__ */ e(Ne, { header: "设备图标", children: /* @__PURE__ */ e(
879
+ xe,
880
880
  {
881
881
  dataSource: s.device,
882
- renderItem: (m) => C(m, !1),
882
+ renderItem: (m) => E(m, !1),
883
883
  locale: {
884
884
  emptyText: /* @__PURE__ */ e(
885
- K,
885
+ ne,
886
886
  {
887
887
  description: "暂无物料",
888
- image: K.PRESENTED_IMAGE_SIMPLE
888
+ image: ne.PRESENTED_IMAGE_SIMPLE
889
889
  }
890
890
  )
891
891
  }
892
892
  }
893
893
  ) }, "device"),
894
- /* @__PURE__ */ e(be, { header: "文本", children: /* @__PURE__ */ e(
895
- fe,
894
+ /* @__PURE__ */ e(Ne, { header: "文本", children: /* @__PURE__ */ e(
895
+ xe,
896
896
  {
897
897
  dataSource: s.text,
898
- renderItem: (m) => C(m, !1),
898
+ renderItem: (m) => E(m, !1),
899
899
  locale: {
900
900
  emptyText: /* @__PURE__ */ e(
901
- K,
901
+ ne,
902
902
  {
903
903
  description: "暂无物料",
904
- image: K.PRESENTED_IMAGE_SIMPLE
904
+ image: ne.PRESENTED_IMAGE_SIMPLE
905
905
  }
906
906
  )
907
907
  }
908
908
  }
909
909
  ) }, "text"),
910
- /* @__PURE__ */ d(
911
- be,
910
+ /* @__PURE__ */ c(
911
+ Ne,
912
912
  {
913
- header: /* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
913
+ header: /* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [
914
914
  /* @__PURE__ */ e("span", { children: "线条" }),
915
- l === "line-draw" && /* @__PURE__ */ e(Q, { color: "blue", className: "text-xs", children: "绘制模式" })
915
+ l === "line-draw" && /* @__PURE__ */ e(le, { color: "blue", className: "text-xs", children: "绘制模式" })
916
916
  ] }),
917
917
  children: [
918
918
  /* @__PURE__ */ e(
919
- fe,
919
+ xe,
920
920
  {
921
921
  dataSource: s.line,
922
- renderItem: (m) => C(m, !0),
922
+ renderItem: (m) => E(m, !0),
923
923
  locale: {
924
924
  emptyText: /* @__PURE__ */ e(
925
- K,
925
+ ne,
926
926
  {
927
927
  description: "暂无物料",
928
- image: K.PRESENTED_IMAGE_SIMPLE
928
+ image: ne.PRESENTED_IMAGE_SIMPLE
929
929
  }
930
930
  )
931
931
  }
932
932
  }
933
933
  ),
934
- l === "line-draw" && /* @__PURE__ */ d("div", { className: "mt-2 p-2 bg-blue-50 rounded text-xs text-blue-600", children: [
934
+ l === "line-draw" && /* @__PURE__ */ c("div", { className: "mt-2 p-2 bg-blue-50 rounded text-xs text-blue-600", children: [
935
935
  /* @__PURE__ */ e("div", { children: "点击线条物料开始绘制" }),
936
936
  /* @__PURE__ */ e("div", { children: "点击画布确定起点和终点" })
937
937
  ] })
@@ -939,33 +939,33 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
939
939
  },
940
940
  "line"
941
941
  ),
942
- s.group.length > 0 && /* @__PURE__ */ e(be, { header: "群组", children: /* @__PURE__ */ e(
943
- fe,
942
+ s.group.length > 0 && /* @__PURE__ */ e(Ne, { header: "群组", children: /* @__PURE__ */ e(
943
+ xe,
944
944
  {
945
945
  dataSource: s.group,
946
- renderItem: (m) => C(m, !1),
946
+ renderItem: (m) => E(m, !1),
947
947
  locale: {
948
948
  emptyText: /* @__PURE__ */ e(
949
- K,
949
+ ne,
950
950
  {
951
951
  description: "暂无物料",
952
- image: K.PRESENTED_IMAGE_SIMPLE
952
+ image: ne.PRESENTED_IMAGE_SIMPLE
953
953
  }
954
954
  )
955
955
  }
956
956
  }
957
957
  ) }, "group"),
958
- s.custom.length > 0 && /* @__PURE__ */ e(be, { header: "自定义", children: /* @__PURE__ */ e(
959
- fe,
958
+ s.custom.length > 0 && /* @__PURE__ */ e(Ne, { header: "自定义", children: /* @__PURE__ */ e(
959
+ xe,
960
960
  {
961
961
  dataSource: s.custom,
962
- renderItem: (m) => C(m, !1),
962
+ renderItem: (m) => E(m, !1),
963
963
  locale: {
964
964
  emptyText: /* @__PURE__ */ e(
965
- K,
965
+ ne,
966
966
  {
967
967
  description: "暂无物料",
968
- image: K.PRESENTED_IMAGE_SIMPLE
968
+ image: ne.PRESENTED_IMAGE_SIMPLE
969
969
  }
970
970
  )
971
971
  }
@@ -974,58 +974,58 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
974
974
  ]
975
975
  }
976
976
  ) }),
977
- /* @__PURE__ */ e("div", { className: "p-3 border-t border-gray-200 bg-gray-50", children: /* @__PURE__ */ e(Fe, { type: "secondary", className: "text-xs", children: l === "line-draw" ? /* @__PURE__ */ e(ge, { children: "💡 提示:点击绘制线段,可连续绘制多段线,双击结束绘制,ESC 取消" }) : /* @__PURE__ */ e(ge, { children: "💡 提示:拖拽物料到画布创建节点,点击线条物料进入绘制模式" }) }) })
977
+ /* @__PURE__ */ e("div", { className: "p-3 border-t border-gray-200 bg-gray-50", children: /* @__PURE__ */ e(We, { type: "secondary", className: "text-xs", children: l === "line-draw" ? /* @__PURE__ */ e(Se, { children: "💡 提示:点击绘制线段,可连续绘制多段线,双击结束绘制,ESC 取消" }) : /* @__PURE__ */ e(Se, { children: "💡 提示:拖拽物料到画布创建节点,点击线条物料进入绘制模式" }) }) })
978
978
  ] });
979
- }, { Text: mt } = vt, pn = (n, h) => {
979
+ }, { Text: gt } = wt, vn = (n, f) => {
980
980
  try {
981
- const t = h && Array.isArray(h) ? h.map((l, a) => l.paramsName) : ["A"], c = new Function(...t, n.expression)(...h.map((l) => l.value));
981
+ const t = f && Array.isArray(f) ? f.map((l, a) => l.paramsName) : ["A"], d = new Function(...t, n.expression)(...f.map((l) => l.value));
982
982
  return console.log(
983
983
  `Evaluating status [${n.name}] with data:`,
984
- h,
984
+ f,
985
985
  "Result:",
986
- c
987
- ), c === !0;
986
+ d
987
+ ), d === !0;
988
988
  } catch (t) {
989
989
  return console.warn(`状态表达式执行失败 [${n.name}]:`, t), !1;
990
990
  }
991
- }, gn = (n, h) => {
991
+ }, bn = (n, f) => {
992
992
  for (const t of n) {
993
993
  console.log(t, "status");
994
994
  let r = [];
995
- if (Array.isArray(h) ? (console.log(t.bindCodes, "bindCodes"), r = h.filter(
996
- (c) => t.bindCodes?.includes(c.paramsCode)
997
- )) : r = h, pn(t, r))
995
+ if (Array.isArray(f) ? (console.log(t.bindCodes, "bindCodes"), r = f.filter(
996
+ (d) => t.bindCodes?.includes(d.paramsCode)
997
+ )) : r = f, vn(t, r))
998
998
  return t;
999
999
  }
1000
- }, vn = (n, h) => {
1001
- if (!h || !n)
1000
+ }, xn = (n, f) => {
1001
+ if (!f || !n)
1002
1002
  return { value: void 0 };
1003
1003
  if (Array.isArray(n)) {
1004
- const t = n.find((r) => r.paramsCode === h);
1004
+ const t = n.find((r) => r.paramsCode === f);
1005
1005
  if (t)
1006
1006
  return {
1007
1007
  value: t.value,
1008
1008
  unit: t.unit
1009
1009
  };
1010
- } else if (typeof n == "object" && h in n)
1010
+ } else if (typeof n == "object" && f in n)
1011
1011
  return {
1012
- value: n[h],
1012
+ value: n[f],
1013
1013
  unit: n.unit
1014
1014
  };
1015
1015
  return { value: void 0 };
1016
- }, yn = (n, h) => {
1016
+ }, wn = (n, f) => {
1017
1017
  if (n == null) return "";
1018
- if (h === -1) return String(n);
1018
+ if (f === -1) return String(n);
1019
1019
  const t = Number(n);
1020
- return isNaN(t) ? String(n) : t.toFixed(h ?? 2);
1021
- }, bn = (n, h, t, r) => {
1020
+ return isNaN(t) ? String(n) : t.toFixed(f ?? 2);
1021
+ }, Sn = (n, f, t, r) => {
1022
1022
  switch (n.type) {
1023
1023
  case "IMAGE":
1024
- const c = n;
1025
- return /* @__PURE__ */ e("div", { className: "w-full h-full flex items-center justify-center overflow-hidden", children: c.src ? /* @__PURE__ */ e(
1024
+ const d = n;
1025
+ return /* @__PURE__ */ e("div", { className: "w-full h-full flex items-center justify-center overflow-hidden", children: d.src ? /* @__PURE__ */ e(
1026
1026
  "img",
1027
1027
  {
1028
- src: c.src,
1028
+ src: d.src,
1029
1029
  alt: n.name,
1030
1030
  style: {
1031
1031
  width: "100%",
@@ -1038,34 +1038,34 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1038
1038
  const l = n, {
1039
1039
  label: a,
1040
1040
  value: o,
1041
- valueSourceCode: p,
1042
- unit: f,
1041
+ valueSourceCode: h,
1042
+ unit: p,
1043
1043
  decimals: u,
1044
- labelStyle: w,
1044
+ labelStyle: b,
1045
1045
  valueStyle: s,
1046
1046
  customStyle: x
1047
- } = l.content || {}, { value: g, unit: C } = p ? vn(h, p) : { value: void 0, unit: void 0 }, _ = yn(g !== void 0 ? g : o, u), P = f || C || "";
1048
- return /* @__PURE__ */ d(
1047
+ } = l.content || {}, { value: y, unit: E } = h ? xn(f, h) : { value: void 0, unit: void 0 }, A = wn(y !== void 0 ? y : o, u), Y = p || E || "";
1048
+ return /* @__PURE__ */ c(
1049
1049
  "div",
1050
1050
  {
1051
1051
  className: "w-full h-full flex flex-col justify-center gap-1",
1052
1052
  style: { ...x },
1053
1053
  children: [
1054
1054
  a && /* @__PURE__ */ e(
1055
- mt,
1055
+ gt,
1056
1056
  {
1057
1057
  style: {
1058
1058
  fontSize: 14,
1059
1059
  fontWeight: "bold",
1060
1060
  color: "#262626",
1061
1061
  textAlign: "left",
1062
- ...w
1062
+ ...b
1063
1063
  },
1064
1064
  children: a
1065
1065
  }
1066
1066
  ),
1067
- _ != null && /* @__PURE__ */ d(
1068
- mt,
1067
+ A != null && /* @__PURE__ */ c(
1068
+ gt,
1069
1069
  {
1070
1070
  style: {
1071
1071
  fontSize: 14,
@@ -1074,8 +1074,8 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1074
1074
  ...s
1075
1075
  },
1076
1076
  children: [
1077
- _,
1078
- P ? ` ${P}` : ""
1077
+ A,
1078
+ Y ? ` ${Y}` : ""
1079
1079
  ]
1080
1080
  }
1081
1081
  )
@@ -1084,36 +1084,36 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1084
1084
  );
1085
1085
  case "LINE":
1086
1086
  const D = n, {
1087
- thickness: E = 2,
1087
+ thickness: L = 2,
1088
1088
  color: O = "#d9d9d9",
1089
- dashed: V = !1,
1090
- lineType: H = V ? "dashed" : "solid",
1091
- lineWeight: F = E,
1089
+ dashed: ie = !1,
1090
+ lineType: H = ie ? "dashed" : "solid",
1091
+ lineWeight: Q = L,
1092
1092
  // 起点和终点的相对坐标
1093
- startX: W = 0,
1094
- startY: S = 0,
1095
- endX: A = 100,
1096
- endY: R = 0
1097
- } = D.config || {}, i = ((k) => {
1098
- const L = Math.max(F, 1);
1099
- switch (k) {
1093
+ startX: F = 0,
1094
+ startY: P = 0,
1095
+ endX: T = 100,
1096
+ endY: B = 0
1097
+ } = D.config || {}, i = ((w) => {
1098
+ const M = Math.max(Q, 1);
1099
+ switch (w) {
1100
1100
  case "solid":
1101
1101
  return "";
1102
1102
  case "dashed":
1103
- return `${L * 8},${L * 4}`;
1103
+ return `${M * 8},${M * 4}`;
1104
1104
  case "center":
1105
- return `${L * 12},${L * 3},${L * 2},${L * 3}`;
1105
+ return `${M * 12},${M * 3},${M * 2},${M * 3}`;
1106
1106
  case "phantom":
1107
- return `${L * 12},${L * 3},${L * 2},${L * 3},${L * 2},${L * 3}`;
1107
+ return `${M * 12},${M * 3},${M * 2},${M * 3},${M * 2},${M * 3}`;
1108
1108
  case "dot":
1109
- return `${L},${L * 3}`;
1109
+ return `${M},${M * 3}`;
1110
1110
  case "dash-dot":
1111
- return `${L * 8},${L * 3},${L},${L * 3}`;
1111
+ return `${M * 8},${M * 3},${M},${M * 3}`;
1112
1112
  default:
1113
1113
  return "";
1114
1114
  }
1115
- })(H), T = t ? "#1890ff" : O;
1116
- return /* @__PURE__ */ e("div", { className: "w-full h-full relative", style: { overflow: "visible" }, children: /* @__PURE__ */ d(
1115
+ })(H), k = t ? "#1890ff" : O;
1116
+ return /* @__PURE__ */ e("div", { className: "w-full h-full relative", style: { overflow: "visible" }, children: /* @__PURE__ */ c(
1117
1117
  "svg",
1118
1118
  {
1119
1119
  className: "absolute top-0 left-0",
@@ -1124,31 +1124,31 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1124
1124
  /* @__PURE__ */ e(
1125
1125
  "line",
1126
1126
  {
1127
- x1: W,
1128
- y1: S,
1129
- x2: A,
1130
- y2: R,
1127
+ x1: F,
1128
+ y1: P,
1129
+ x2: T,
1130
+ y2: B,
1131
1131
  stroke: "transparent",
1132
- strokeWidth: Math.max(F, 10),
1132
+ strokeWidth: Math.max(Q, 10),
1133
1133
  strokeLinecap: "round",
1134
1134
  strokeLinejoin: "round",
1135
1135
  style: { pointerEvents: "stroke", cursor: "pointer" },
1136
- onClick: (k) => {
1137
- k.stopPropagation();
1138
- const L = k.target.closest("[data-node-id]");
1139
- L && L.click();
1136
+ onClick: (w) => {
1137
+ w.stopPropagation();
1138
+ const M = w.target.closest("[data-node-id]");
1139
+ M && M.click();
1140
1140
  }
1141
1141
  }
1142
1142
  ),
1143
1143
  /* @__PURE__ */ e(
1144
1144
  "line",
1145
1145
  {
1146
- x1: W,
1147
- y1: S,
1148
- x2: A,
1149
- y2: R,
1150
- stroke: T,
1151
- strokeWidth: F,
1146
+ x1: F,
1147
+ y1: P,
1148
+ x2: T,
1149
+ y2: B,
1150
+ stroke: k,
1151
+ strokeWidth: Q,
1152
1152
  strokeDasharray: i,
1153
1153
  strokeLinecap: "round",
1154
1154
  strokeLinejoin: "round",
@@ -1159,130 +1159,130 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1159
1159
  }
1160
1160
  ) });
1161
1161
  case "CUSTOM":
1162
- const v = n;
1163
- return v.render ? v.render({}) : /* @__PURE__ */ e("div", { className: "w-full h-full flex items-center justify-center bg-gray-100", children: /* @__PURE__ */ e("span", { className: "text-gray-400 text-xs", children: "自定义组件" }) });
1162
+ const S = n;
1163
+ return S.render ? S.render({}) : /* @__PURE__ */ e("div", { className: "w-full h-full flex items-center justify-center bg-gray-100", children: /* @__PURE__ */ e("span", { className: "text-gray-400 text-xs", children: "自定义组件" }) });
1164
1164
  default:
1165
1165
  return /* @__PURE__ */ e("div", { className: "w-full h-full flex items-center justify-center bg-gray-100", children: /* @__PURE__ */ e("span", { className: "text-gray-400 text-xs", children: "未知类型" }) });
1166
1166
  }
1167
- }, xn = ({
1167
+ }, Cn = ({
1168
1168
  node: n,
1169
- isSelected: h = !1,
1169
+ isSelected: f = !1,
1170
1170
  onClick: t,
1171
1171
  onMouseDown: r,
1172
- data: c,
1172
+ data: d,
1173
1173
  onUpdateNode: l,
1174
1174
  scale: a = 1
1175
1175
  }) => {
1176
- const { normalStyle: o, contentInfo: p, controlInfo: f } = n, { statusList: u } = p, { isClickable: w, isDraggable: s } = f, [x, g] = j(null), [C, m] = j({ x: 0, y: 0 }), _ = ue(null), P = Pt(() => {
1176
+ const { normalStyle: o, contentInfo: h, controlInfo: p } = n, { statusList: u } = h, { isClickable: b, isDraggable: s } = p, [x, y] = q(null), [E, m] = q({ x: 0, y: 0 }), A = ue(null), Y = xt(() => {
1177
1177
  if (u.length === 0) return;
1178
- const i = gn(u, c);
1178
+ const i = bn(u, d);
1179
1179
  return i || u[0];
1180
- }, [u, c]), D = P?.material, E = D?.type === "LINE", O = E ? D.config : null, V = o.scale ?? 1, H = (o.width || 100) * V, F = (o.height || 100) * V, W = G((i, T) => {
1181
- i.stopPropagation(), i.preventDefault(), g(T), m({ x: i.clientX, y: i.clientY });
1180
+ }, [u, d]), D = Y?.material, L = D?.type === "LINE", O = L ? D.config : null, ie = o.scale ?? 1, H = (o.width || 100) * ie, Q = (o.height || 100) * ie, F = G((i, k) => {
1181
+ i.stopPropagation(), i.preventDefault(), y(k), m({ x: i.clientX, y: i.clientY });
1182
1182
  }, []);
1183
- ae(() => {
1184
- if (!x || !E || !O || !l) return;
1185
- const i = (v) => {
1186
- const k = (v.clientX - C.x) / a, L = (v.clientY - C.y) / a, we = O.startX || 0, ze = O.startY || 0, Ae = O.endX || 0, te = O.endY || 0;
1187
- let Z = we, ne = ze, le = Ae, re = te, Se = o.x || 0, Ce = o.y || 0;
1188
- x === "start" ? (Z = we + k, ne = ze + L, Z < 0 && (Se += Z, le -= Z, Z = 0), ne < 0 && (Ce += ne, re -= ne, ne = 0)) : (le = Ae + k, re = te + L, le < 0 && (Se += le, Z -= le, le = 0), re < 0 && (Ce += re, ne -= re, re = 0));
1189
- const Re = Math.max((O.lineWeight || 2) * 2, 4), qe = Math.max(Z, le), Ge = Math.max(ne, re), ve = Math.max(qe, Re), Be = Math.max(Ge, Re);
1183
+ se(() => {
1184
+ if (!x || !L || !O || !l) return;
1185
+ const i = (S) => {
1186
+ const w = (S.clientX - E.x) / a, M = (S.clientY - E.y) / a, Xe = O.startX || 0, Ce = O.startY || 0, ze = O.endX || 0, Re = O.endY || 0;
1187
+ let Z = Xe, ee = Ce, te = ze, oe = Re, ke = o.x || 0, Ee = o.y || 0;
1188
+ x === "start" ? (Z = Xe + w, ee = Ce + M, Z < 0 && (ke += Z, te -= Z, Z = 0), ee < 0 && (Ee += ee, oe -= ee, ee = 0)) : (te = ze + w, oe = Re + M, te < 0 && (ke += te, Z -= te, te = 0), oe < 0 && (Ee += oe, ee -= oe, oe = 0));
1189
+ const Ae = Math.max((O.lineWeight || 2) * 2, 4), Ge = Math.max(Z, te), Be = Math.max(ee, oe), Ve = Math.max(Ge, Ae), He = Math.max(Be, Ae);
1190
1190
  l(n.id, {
1191
1191
  normalStyle: {
1192
1192
  ...o,
1193
- x: Se,
1194
- y: Ce,
1195
- width: ve,
1196
- height: Be
1193
+ x: ke,
1194
+ y: Ee,
1195
+ width: Ve,
1196
+ height: He
1197
1197
  },
1198
1198
  contentInfo: {
1199
- ...p,
1200
- statusList: u.map((ye) => ({
1201
- ...ye,
1202
- material: ye.material.type === "LINE" ? {
1203
- ...ye.material,
1199
+ ...h,
1200
+ statusList: u.map((ve) => ({
1201
+ ...ve,
1202
+ material: ve.material.type === "LINE" ? {
1203
+ ...ve.material,
1204
1204
  config: {
1205
1205
  ...O,
1206
1206
  startX: Z,
1207
- startY: ne,
1208
- endX: le,
1209
- endY: re
1207
+ startY: ee,
1208
+ endX: te,
1209
+ endY: oe
1210
1210
  }
1211
- } : ye.material
1211
+ } : ve.material
1212
1212
  }))
1213
1213
  }
1214
- }), m({ x: v.clientX, y: v.clientY });
1215
- }, T = () => {
1216
- g(null);
1214
+ }), m({ x: S.clientX, y: S.clientY });
1215
+ }, k = () => {
1216
+ y(null);
1217
1217
  };
1218
- return window.addEventListener("mousemove", i), window.addEventListener("mouseup", T), () => {
1219
- window.removeEventListener("mousemove", i), window.removeEventListener("mouseup", T);
1218
+ return window.addEventListener("mousemove", i), window.addEventListener("mouseup", k), () => {
1219
+ window.removeEventListener("mousemove", i), window.removeEventListener("mouseup", k);
1220
1220
  };
1221
- }, [x, C, E, O, n.id, o, p, u, l, a]);
1222
- const S = n.type === "group", A = {
1221
+ }, [x, E, L, O, n.id, o, h, u, l, a]);
1222
+ const P = n.type === "group", T = {
1223
1223
  position: "absolute",
1224
1224
  left: o.x || 0,
1225
1225
  top: o.y || 0,
1226
1226
  width: H,
1227
- height: F,
1227
+ height: Q,
1228
1228
  // 群组节点不显示背景和边框,只作为容器
1229
- background: S ? "transparent" : o.background || "transparent",
1230
- backgroundImage: S ? void 0 : o.backgroundImage ? `url(${o.backgroundImage})` : void 0,
1229
+ background: P ? "transparent" : o.background || "transparent",
1230
+ backgroundImage: P ? void 0 : o.backgroundImage ? `url(${o.backgroundImage})` : void 0,
1231
1231
  backgroundSize: "cover",
1232
1232
  backgroundPosition: "center",
1233
1233
  padding: Array.isArray(o.padding) ? o.padding.join("px ") + "px" : o.padding,
1234
1234
  margin: Array.isArray(o.margin) ? o.margin.join("px ") + "px" : o.margin,
1235
- borderRadius: S ? void 0 : o.borderRadius,
1235
+ borderRadius: P ? void 0 : o.borderRadius,
1236
1236
  // 线条物料选中时不显示边框,而是通过高亮线条颜色来表示
1237
1237
  // 群组节点选中时显示边框,平时不显示
1238
- border: h && !E ? "2px solid #1890ff" : E || S ? "none" : o.border || "1px dashed transparent",
1238
+ border: f && !L ? "2px solid #1890ff" : L || P ? "none" : o.border || "1px dashed transparent",
1239
1239
  // 线条节点需要捕获点击事件,但由内部 SVG 的透明线处理具体点击区域
1240
1240
  pointerEvents: "auto",
1241
1241
  opacity: o.opacity ?? 1,
1242
1242
  transform: o.transform,
1243
- zIndex: h ? 1e3 : o.zIndex ?? 1,
1244
- cursor: s && !x ? "move" : w ? "pointer" : "default",
1243
+ zIndex: f ? 1e3 : o.zIndex ?? 1,
1244
+ cursor: s && !x ? "move" : b ? "pointer" : "default",
1245
1245
  boxSizing: "border-box",
1246
1246
  // 线条和群组节点使用 visible overflow,避免裁剪子节点
1247
- overflow: E || S ? "visible" : "hidden"
1248
- }, R = O ? { x: O.startX || 0, y: O.startY || 0 } : { x: 0, y: 0 }, q = O ? { x: O.endX || 0, y: O.endY || 0 } : { x: 0, y: 0 };
1249
- return /* @__PURE__ */ d(
1247
+ overflow: L || P ? "visible" : "hidden"
1248
+ }, B = O ? { x: O.startX || 0, y: O.startY || 0 } : { x: 0, y: 0 }, R = O ? { x: O.endX || 0, y: O.endY || 0 } : { x: 0, y: 0 };
1249
+ return /* @__PURE__ */ c(
1250
1250
  "div",
1251
1251
  {
1252
- ref: _,
1252
+ ref: A,
1253
1253
  "data-node-id": n.id,
1254
- style: A,
1254
+ style: T,
1255
1255
  onClick: (i) => {
1256
- i.stopPropagation(), w && t && !x && t(i);
1256
+ i.stopPropagation(), b && t && !x && t(i);
1257
1257
  },
1258
1258
  onMouseDown: (i) => {
1259
1259
  s && r && !x && r(i);
1260
1260
  },
1261
1261
  children: [
1262
- h && !E && /* @__PURE__ */ d(ge, { children: [
1263
- !S && /* @__PURE__ */ d(ge, { children: [
1262
+ f && !L && /* @__PURE__ */ c(Se, { children: [
1263
+ !P && /* @__PURE__ */ c(Se, { children: [
1264
1264
  /* @__PURE__ */ e("div", { className: "absolute -top-1 -left-1 w-2 h-2 bg-white border border-blue-500 rounded-full" }),
1265
1265
  /* @__PURE__ */ e("div", { className: "absolute -top-1 -right-1 w-2 h-2 bg-white border border-blue-500 rounded-full" }),
1266
1266
  /* @__PURE__ */ e("div", { className: "absolute -bottom-1 -left-1 w-2 h-2 bg-white border border-blue-500 rounded-full" }),
1267
1267
  /* @__PURE__ */ e("div", { className: "absolute -bottom-1 -right-1 w-2 h-2 bg-white border border-blue-500 rounded-full" })
1268
1268
  ] }),
1269
- /* @__PURE__ */ d("div", { className: "absolute -top-6 left-0 bg-blue-500 text-white text-xs px-2 py-0.5 rounded whitespace-nowrap", children: [
1269
+ /* @__PURE__ */ c("div", { className: "absolute -top-6 left-0 bg-blue-500 text-white text-xs px-2 py-0.5 rounded whitespace-nowrap", children: [
1270
1270
  n.name,
1271
1271
  " ",
1272
- P ? `(${P.name})` : ""
1272
+ Y ? `(${Y.name})` : ""
1273
1273
  ] })
1274
1274
  ] }),
1275
- h && E && O && l && /* @__PURE__ */ d(ge, { children: [
1275
+ f && L && O && l && /* @__PURE__ */ c(Se, { children: [
1276
1276
  /* @__PURE__ */ e(
1277
1277
  "div",
1278
1278
  {
1279
1279
  className: "absolute w-3 h-3 bg-blue-500 border-2 border-white rounded-full cursor-move z-50",
1280
1280
  style: {
1281
- left: R.x - 6,
1282
- top: R.y - 6,
1281
+ left: B.x - 6,
1282
+ top: B.y - 6,
1283
1283
  boxShadow: "0 0 4px rgba(0,0,0,0.3)"
1284
1284
  },
1285
- onMouseDown: (i) => W(i, "start"),
1285
+ onMouseDown: (i) => F(i, "start"),
1286
1286
  title: "拖拽调整起点"
1287
1287
  }
1288
1288
  ),
@@ -1291,26 +1291,26 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1291
1291
  {
1292
1292
  className: "absolute w-3 h-3 bg-blue-500 border-2 border-white rounded-full cursor-move z-50",
1293
1293
  style: {
1294
- left: q.x - 6,
1295
- top: q.y - 6,
1294
+ left: R.x - 6,
1295
+ top: R.y - 6,
1296
1296
  boxShadow: "0 0 4px rgba(0,0,0,0.3)"
1297
1297
  },
1298
- onMouseDown: (i) => W(i, "end"),
1298
+ onMouseDown: (i) => F(i, "end"),
1299
1299
  title: "拖拽调整终点"
1300
1300
  }
1301
1301
  ),
1302
1302
  /* @__PURE__ */ e("div", { className: "absolute -top-6 left-0 bg-blue-500 text-white text-xs px-2 py-0.5 rounded whitespace-nowrap", children: n.name })
1303
1303
  ] }),
1304
- /* @__PURE__ */ e("div", { className: "w-full h-full relative", children: D ? /* @__PURE__ */ e("div", { className: "w-full h-full", children: bn(D, c, h) }) : S ? null : (
1304
+ /* @__PURE__ */ e("div", { className: "w-full h-full relative", children: D ? /* @__PURE__ */ e("div", { className: "w-full h-full", children: Sn(D, d, f) }) : P ? null : (
1305
1305
  // 只有非群组节点才显示"无状态"
1306
1306
  /* @__PURE__ */ e("div", { className: "w-full h-full flex items-center justify-center text-gray-300 text-xs", children: "无状态" })
1307
1307
  ) }),
1308
1308
  n.type === "group" && n.children && /* @__PURE__ */ e("div", { className: "absolute inset-0 pointer-events-none", children: n.children.map((i) => /* @__PURE__ */ e("div", { className: "pointer-events-auto", children: /* @__PURE__ */ e(
1309
- kt,
1309
+ Lt,
1310
1310
  {
1311
1311
  node: i,
1312
1312
  isSelected: !1,
1313
- data: c,
1313
+ data: d,
1314
1314
  onUpdateNode: l,
1315
1315
  scale: a
1316
1316
  }
@@ -1318,62 +1318,67 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1318
1318
  ]
1319
1319
  }
1320
1320
  );
1321
- }, kt = oe.memo(xn, (n, h) => {
1322
- const t = n.node, r = h.node, c = t.id === r.id && t.normalStyle.x === r.normalStyle.x && t.normalStyle.y === r.normalStyle.y && t.normalStyle.width === r.normalStyle.width && t.normalStyle.height === r.normalStyle.height, l = n.isSelected === h.isSelected && n.scale === h.scale;
1323
- return c && l;
1324
- }), { TextArea: wn } = B, Sn = ({ defaultTestData: n }) => {
1325
- const h = ue(null), t = ue(null), {
1326
- nodes: r,
1327
- selectedNodeId: c,
1328
- mode: l,
1329
- lineDrawing: a,
1330
- viewport: o,
1321
+ }, Lt = de.memo(Cn, (n, f) => {
1322
+ const t = n.node, r = f.node, d = t.id === r.id && t.normalStyle.x === r.normalStyle.x && t.normalStyle.y === r.normalStyle.y && t.normalStyle.width === r.normalStyle.width && t.normalStyle.height === r.normalStyle.height, l = t.contentInfo === r.contentInfo, a = n.isSelected === f.isSelected && n.scale === f.scale;
1323
+ return d && l && a;
1324
+ }), { TextArea: Nn } = J, In = ({ defaultTestData: n }) => {
1325
+ const f = ue(null), t = ue(null), r = ue(null), {
1326
+ nodes: d,
1327
+ selectedNodeId: l,
1328
+ mode: a,
1329
+ lineDrawing: o,
1330
+ viewport: h,
1331
1331
  setViewport: p,
1332
- addNode: f,
1333
- selectNode: u,
1334
- updateNode: w,
1335
- removeNode: s,
1336
- undo: x,
1337
- redo: g,
1338
- setMode: C,
1339
- startLineDrawing: m,
1340
- endLineDrawing: _,
1341
- cancelLineDrawing: P
1342
- } = xe(), [D, E] = j(!1), [, O] = j({}), V = ue(!1), H = ue({ x: 0, y: 0 }), F = ue({ x: 0, y: 0, newX: 0, newY: 0 }), W = ue(null), [S, A] = j({ start: null, end: null, isDrawing: !1 }), [R, q] = j(!1), [i, T] = j({ start: null, end: null }), [v, k] = j([]), [L, we] = j(!1), [ze, Ae] = j(
1332
+ addNode: u,
1333
+ selectNode: b,
1334
+ updateNode: s,
1335
+ removeNode: x,
1336
+ undo: y,
1337
+ redo: E,
1338
+ setMode: m,
1339
+ startLineDrawing: A,
1340
+ endLineDrawing: Y,
1341
+ cancelLineDrawing: D
1342
+ } = Ie(), [L, O] = q(!1), [, ie] = q({}), H = ue(!1), Q = ue({ x: 0, y: 0 }), F = ue({ x: 0, y: 0, newX: 0, newY: 0 }), P = ue(null), [T, B] = q({ start: null, end: null, isDrawing: !1 }), [R, i] = q(!1), [k, S] = q({ start: null, end: null }), [w, M] = q([]), [Xe, Ce] = q(!1), [ze, Re] = q(
1343
1343
  JSON.stringify(n, null, 2)
1344
- ), te = G((y, M) => {
1344
+ ), Z = G((g, I) => {
1345
1345
  if (!t.current) return { x: 0, y: 0 };
1346
- const X = t.current.getBoundingClientRect(), I = y - X.left, N = M - X.top, z = I * (1920 / X.width), J = N * (1080 / X.height);
1347
- return { x: Math.round(z), y: Math.round(J) };
1348
- }, []), Z = G(
1349
- (y, M, X = !0) => {
1350
- if (!a.material) return;
1351
- const I = a.material, N = I.config || {}, z = N.lineWeight || N.thickness || 2, J = Math.min(y.x, M.x), me = Math.min(y.y, M.y), Ne = Math.round(y.x - J), Ie = Math.round(y.y - me), ke = Math.round(M.x - J), Xe = Math.round(M.y - me), Ee = Math.max(z * 2, 4), De = Math.max(Math.abs(y.x - M.x), Ee), Dt = Math.max(Math.abs(y.y - M.y), Ee), Mt = {
1352
- ...I,
1353
- id: $(),
1346
+ const X = t.current.getBoundingClientRect(), C = f.current?.state, N = C?.scale ?? h.scale, _ = C?.positionX ?? h.positionX, U = C?.positionY ?? h.positionY, $ = g - X.left, W = I - X.top, K = ($ - _) / N, re = (W - U) / N;
1347
+ return { x: Math.round(K), y: Math.round(re) };
1348
+ }, [h.scale, h.positionX, h.positionY]), ee = G((g, I) => {
1349
+ const X = t.current;
1350
+ if (!X) return { x: 0, y: 0 };
1351
+ const C = X.getBoundingClientRect(), _ = f.current?.state?.scale ?? 1, U = g - C.left, $ = I - C.top, W = U / _, K = $ / _;
1352
+ return { x: Math.round(W), y: Math.round(K) };
1353
+ }, []), te = G(
1354
+ (g, I, X = !0) => {
1355
+ if (!o.material) return;
1356
+ const C = o.material, N = C.config || {}, _ = N.lineWeight || N.thickness || 2, U = Math.min(g.x, I.x), $ = Math.min(g.y, I.y), W = Math.round(g.x - U), K = Math.round(g.y - $), re = Math.round(I.x - U), fe = Math.round(I.y - $), be = Math.max(_ * 2, 4), pe = Math.max(Math.abs(g.x - I.x), be), je = Math.max(Math.abs(g.y - I.y), be), _t = {
1357
+ ...C,
1358
+ id: z(),
1354
1359
  config: {
1355
1360
  color: N.color,
1356
- lineWeight: z,
1357
- thickness: z,
1361
+ lineWeight: _,
1362
+ thickness: _,
1358
1363
  lineType: N.lineType,
1359
- startX: Ne,
1360
- startY: Ie,
1361
- endX: ke,
1362
- endY: Xe
1364
+ startX: W,
1365
+ startY: K,
1366
+ endX: re,
1367
+ endY: fe
1363
1368
  }
1364
- }, Lt = {
1365
- id: $(),
1366
- name: `${I.name}_${Date.now()}`,
1369
+ }, Yt = {
1370
+ id: z(),
1371
+ name: `${C.name}_${Date.now()}`,
1367
1372
  type: "normal",
1368
1373
  normalStyle: {
1369
- width: De,
1370
- height: Dt,
1371
- x: J,
1372
- y: me,
1374
+ width: pe,
1375
+ height: je,
1376
+ x: U,
1377
+ y: $,
1373
1378
  background: "transparent"
1374
1379
  },
1375
1380
  contentInfo: {
1376
- statusList: [It(Mt)],
1381
+ statusList: [Dt(_t)],
1377
1382
  currentStatusId: void 0
1378
1383
  },
1379
1384
  controlInfo: {
@@ -1383,297 +1388,377 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1383
1388
  isSelectable: !0
1384
1389
  }
1385
1390
  };
1386
- if (f(Lt, !1), X) {
1387
- const nt = { x: M.x, y: M.y };
1388
- A({
1389
- start: nt,
1390
- end: { ...nt },
1391
+ if (u(Yt, !1), X) {
1392
+ const rt = { x: I.x, y: I.y };
1393
+ B({
1394
+ start: rt,
1395
+ end: { ...rt },
1391
1396
  isDrawing: !0
1392
1397
  });
1393
1398
  } else
1394
- A({ start: null, end: null, isDrawing: !1 }), _();
1399
+ B({ start: null, end: null, isDrawing: !1 }), Y();
1395
1400
  },
1396
- [a.material, f, _]
1397
- ), ne = G(() => {
1398
- const y = h.current?.state;
1399
- y && p({
1400
- scale: y.scale,
1401
- positionX: y.positionX,
1402
- positionY: y.positionY
1401
+ [o.material, u, Y]
1402
+ ), oe = G(() => {
1403
+ const g = f.current?.state;
1404
+ g && p({
1405
+ scale: g.scale,
1406
+ positionX: g.positionX,
1407
+ positionY: g.positionY
1403
1408
  });
1404
- }, [p]), le = G(
1405
- (y) => {
1406
- V.current || R && i.start || (y.target === t.current || y.target.dataset?.canvas === "true") && (u(null), k([]));
1409
+ }, [p]), ke = G(
1410
+ (g) => {
1411
+ H.current || R || (g.target === t.current || g.target.dataset?.canvas === "true") && (b(null), M([]));
1407
1412
  },
1408
- [u, R, i.start]
1409
- ), re = G(
1410
- (y) => {
1411
- if (y.button !== 0 || l !== "line-draw" || !a.material) return;
1412
- const M = te(y.clientX, y.clientY);
1413
- S.isDrawing ? S.start && Z(S.start, M, !0) : A({ start: M, end: M, isDrawing: !0 });
1413
+ [b, R]
1414
+ ), Ee = G(
1415
+ (g) => {
1416
+ if (g.button === 0) {
1417
+ if (a === "line-draw" && o.material) {
1418
+ const I = Z(g.clientX, g.clientY);
1419
+ T.isDrawing ? T.start && te(T.start, I, !0) : B({ start: I, end: I, isDrawing: !0 });
1420
+ return;
1421
+ }
1422
+ if (R) {
1423
+ const I = ee(g.clientX, g.clientY);
1424
+ S({ start: I, end: I }), M([]), g.preventDefault(), g.stopPropagation();
1425
+ }
1426
+ }
1414
1427
  },
1415
- [l, a.material, S.isDrawing, S.start, Z, te]
1416
- ), Se = G(
1417
- (y) => {
1418
- if (!(l !== "line-draw" || !a.material) && S.isDrawing && S.start) {
1419
- const M = te(y.clientX, y.clientY);
1420
- Z(S.start, M, !1);
1428
+ [a, o.material, T.isDrawing, T.start, R, te, Z, ee]
1429
+ ), Ae = G(
1430
+ (g) => {
1431
+ if (!(a !== "line-draw" || !o.material) && T.isDrawing && T.start) {
1432
+ const I = Z(g.clientX, g.clientY);
1433
+ te(T.start, I, !1);
1421
1434
  }
1422
1435
  },
1423
- [l, a.material, S.isDrawing, S.start, Z, te]
1424
- ), Ce = G((y) => {
1425
- y.preventDefault(), y.dataTransfer.dropEffect = "copy", E(!0);
1426
- }, []), Re = G((y) => {
1427
- y.preventDefault(), E(!1);
1428
- }, []), qe = G(
1429
- (y) => {
1430
- if (y.preventDefault(), E(!1), !(!t.current || l !== "select"))
1436
+ [a, o.material, T.isDrawing, T.start, te, Z]
1437
+ ), Ge = G((g) => {
1438
+ g.preventDefault(), g.dataTransfer.dropEffect = "copy", O(!0);
1439
+ }, []), Be = G((g) => {
1440
+ g.preventDefault(), O(!1);
1441
+ }, []), Ve = G(
1442
+ (g) => {
1443
+ if (g.preventDefault(), O(!1), !(!t.current || a !== "select"))
1431
1444
  try {
1432
- const M = y.dataTransfer.getData("application/json");
1433
- if (!M) return;
1434
- const X = JSON.parse(M), I = t.current.getBoundingClientRect(), N = h.current?.state, z = N?.scale ?? o.scale, J = N?.positionX ?? o.positionX, me = N?.positionY ?? o.positionY, Ne = (y.clientX - I.left - J) / z - 50, Ie = (y.clientY - I.top - me) / z - 50, ke = mn(Ne, Ie, X);
1435
- f(ke);
1436
- } catch (M) {
1437
- console.error("Failed to parse dropped material:", M);
1445
+ const I = g.dataTransfer.getData("application/json");
1446
+ if (!I) return;
1447
+ const X = JSON.parse(I), C = t.current.getBoundingClientRect(), N = f.current?.state, _ = N?.scale ?? h.scale, U = N?.positionX ?? h.positionX, $ = N?.positionY ?? h.positionY, W = (g.clientX - C.left - U) / _ - 50, K = (g.clientY - C.top - $) / _ - 50, re = gn(W, K, X);
1448
+ u(re);
1449
+ } catch (I) {
1450
+ console.error("Failed to parse dropped material:", I);
1438
1451
  }
1439
1452
  },
1440
- [l, o, f]
1441
- ), Ge = G(
1442
- (y, M) => {
1443
- l !== "select" || !M.controlInfo.isDraggable || (y.stopPropagation(), u(M.id), V.current = !0, H.current = { x: y.clientX, y: y.clientY }, F.current = {
1444
- x: M.normalStyle.x || 0,
1445
- y: M.normalStyle.y || 0,
1446
- newX: M.normalStyle.x || 0,
1447
- newY: M.normalStyle.y || 0
1448
- }, W.current = M, y.preventDefault());
1453
+ [a, h, u]
1454
+ ), He = G(
1455
+ (g, I) => {
1456
+ a !== "select" || !I.controlInfo.isDraggable || (g.stopPropagation(), b(I.id), H.current = !0, Q.current = { x: g.clientX, y: g.clientY }, F.current = {
1457
+ x: I.normalStyle.x || 0,
1458
+ y: I.normalStyle.y || 0,
1459
+ newX: I.normalStyle.x || 0,
1460
+ newY: I.normalStyle.y || 0
1461
+ }, P.current = I, g.preventDefault());
1449
1462
  },
1450
- [l, u]
1463
+ [a, b]
1451
1464
  );
1452
- ae(() => {
1453
- const y = (I) => {
1454
- if (V.current && c && W.current) {
1465
+ se(() => {
1466
+ const g = (C) => {
1467
+ if (H.current && l && P.current) {
1455
1468
  if (!t.current) return;
1456
- const N = t.current.getBoundingClientRect(), z = 1920 / N.width, J = 1080 / N.height, me = I.clientX - H.current.x, Ne = I.clientY - H.current.y, Ie = me * z, ke = Ne * J, Xe = F.current.x + Ie, Ee = F.current.y + ke, De = document.querySelector(
1457
- `[data-node-id="${c}"]`
1469
+ const N = t.current.getBoundingClientRect(), _ = 1920 / N.width, U = 1080 / N.height, $ = C.clientX - Q.current.x, W = C.clientY - Q.current.y, K = $ * _, re = W * U, fe = F.current.x + K, be = F.current.y + re, pe = document.querySelector(
1470
+ `[data-node-id="${l}"]`
1458
1471
  );
1459
- De && (De.style.left = `${Xe}px`, De.style.top = `${Ee}px`), F.current.newX = Xe, F.current.newY = Ee;
1472
+ pe && (pe.style.left = `${fe}px`, pe.style.top = `${be}px`), F.current.newX = fe, F.current.newY = be;
1460
1473
  }
1461
- if (R && i.start) {
1462
- const N = te(I.clientX, I.clientY);
1463
- T((z) => ({ ...z, end: N }));
1474
+ if (R && k.start) {
1475
+ const N = ee(C.clientX, C.clientY);
1476
+ S((_) => ({ ..._, end: N }));
1464
1477
  }
1465
- if (l === "line-draw" && S.isDrawing) {
1466
- const N = te(I.clientX, I.clientY);
1467
- A((z) => ({ ...z, end: N }));
1478
+ if (a === "line-draw" && T.isDrawing) {
1479
+ const N = Z(C.clientX, C.clientY);
1480
+ B((_) => ({ ..._, end: N }));
1468
1481
  }
1469
- }, M = () => {
1470
- if (V.current && c && W.current) {
1471
- const I = xe.getState(), N = F.current.newX ?? F.current.x, z = F.current.newY ?? F.current.y;
1472
- I.updateNode(c, {
1482
+ }, I = () => {
1483
+ if (H.current && l && P.current) {
1484
+ const C = Ie.getState(), N = F.current.newX ?? F.current.x, _ = F.current.newY ?? F.current.y;
1485
+ C.updateNode(l, {
1473
1486
  normalStyle: {
1474
- ...W.current.normalStyle,
1487
+ ...P.current.normalStyle,
1475
1488
  x: N,
1476
- y: z
1489
+ y: _
1477
1490
  }
1478
1491
  });
1479
1492
  }
1480
- V.current = !1, W.current = null, O({}), R && T({ start: null, end: null });
1481
- }, X = (I) => {
1482
- I.key === "Escape" && l === "line-draw" && (A({ start: null, end: null, isDrawing: !1 }), P()), I.key === "Delete" && (c ? s(c) : v.length > 0 && (v.forEach((N) => s(N)), k([]))), I.ctrlKey && I.key === "z" && (I.preventDefault(), x()), I.ctrlKey && I.key === "y" && (I.preventDefault(), g());
1493
+ if (H.current = !1, P.current = null, ie({}), R && k.start && k.end) {
1494
+ const C = Math.min(k.start.x, k.end.x), N = Math.max(k.start.x, k.end.x), _ = Math.min(k.start.y, k.end.y), U = Math.max(k.start.y, k.end.y), $ = d.filter((W) => {
1495
+ const K = W.normalStyle.x || 0, re = W.normalStyle.y || 0, fe = W.normalStyle.width || 0, be = W.normalStyle.height || 0, pe = K + fe / 2, je = re + be / 2;
1496
+ return pe >= C && pe <= N && je >= _ && je <= U;
1497
+ }).map((W) => W.id);
1498
+ M($), S({ start: null, end: null });
1499
+ }
1500
+ }, X = (C) => {
1501
+ C.key === "Escape" && a === "line-draw" && (B({ start: null, end: null, isDrawing: !1 }), D()), C.key === "Delete" && (l ? x(l) : w.length > 0 && (w.forEach((N) => x(N)), M([]))), C.ctrlKey && C.key === "z" && (C.preventDefault(), y()), C.ctrlKey && C.key === "y" && (C.preventDefault(), E());
1483
1502
  };
1484
- return window.addEventListener("mousemove", y), window.addEventListener("mouseup", M), window.addEventListener("keydown", X), () => {
1485
- window.removeEventListener("mousemove", y), window.removeEventListener("mouseup", M), window.removeEventListener("keydown", X);
1503
+ return window.addEventListener("mousemove", g), window.addEventListener("mouseup", I), window.addEventListener("keydown", X), () => {
1504
+ window.removeEventListener("mousemove", g), window.removeEventListener("mouseup", I), window.removeEventListener("keydown", X);
1486
1505
  };
1487
1506
  }, [
1488
- c,
1489
- R,
1490
- i.start,
1491
1507
  l,
1492
- S.isDrawing,
1493
- v,
1494
- s,
1508
+ R,
1509
+ k,
1510
+ a,
1511
+ T.isDrawing,
1512
+ w,
1513
+ d,
1495
1514
  x,
1496
- g,
1497
- P,
1498
- te
1515
+ y,
1516
+ E,
1517
+ D,
1518
+ Z,
1519
+ ee,
1520
+ M
1499
1521
  ]);
1500
- const ve = G(
1501
- (y) => {
1502
- if (v.length < 2) return;
1503
- const M = xe.getState(), X = v.map((N) => r.find((z) => z.id === N)).filter((N) => !!N && N.type !== "group");
1522
+ const ve = G(() => {
1523
+ if (w.length < 2) return;
1524
+ const g = w.map(($) => d.find((W) => W.id === $)).filter(($) => !!$ && $.type !== "group");
1525
+ if (g.length < 2) return;
1526
+ let I = 1 / 0, X = 1 / 0, C = -1 / 0, N = -1 / 0;
1527
+ g.forEach(($) => {
1528
+ const W = $.normalStyle.x || 0, K = $.normalStyle.y || 0, re = $.normalStyle.width || 0, fe = $.normalStyle.height || 0;
1529
+ I = Math.min(I, W), X = Math.min(X, K), C = Math.max(C, W + re), N = Math.max(N, K + fe);
1530
+ });
1531
+ const _ = g.map(($) => ({
1532
+ ...$,
1533
+ normalStyle: {
1534
+ ...$.normalStyle,
1535
+ x: ($.normalStyle.x || 0) - I,
1536
+ y: ($.normalStyle.y || 0) - X
1537
+ }
1538
+ })), U = {
1539
+ id: z(),
1540
+ name: `群组_${Date.now()}`,
1541
+ type: "group",
1542
+ normalStyle: {
1543
+ x: I,
1544
+ y: X,
1545
+ width: C - I,
1546
+ height: N - X,
1547
+ background: "transparent"
1548
+ },
1549
+ contentInfo: {
1550
+ statusList: [],
1551
+ currentStatusId: void 0
1552
+ },
1553
+ controlInfo: {
1554
+ isDraggable: !0,
1555
+ isClickable: !0,
1556
+ isResizable: !0,
1557
+ isSelectable: !0
1558
+ },
1559
+ children: _
1560
+ };
1561
+ w.forEach(($) => x($)), u(U), M([]), b(U.id);
1562
+ }, [w, d, x, u, b]), Me = G(
1563
+ (g) => {
1564
+ if (w.length < 2) return;
1565
+ const I = Ie.getState(), X = w.map((N) => d.find((_) => _.id === N)).filter((N) => !!N && N.type !== "group");
1504
1566
  if (X.length < 2) return;
1505
- let I = 0;
1506
- switch (y) {
1567
+ let C = 0;
1568
+ switch (g) {
1507
1569
  case "left":
1508
- I = Math.min(...X.map((N) => N.normalStyle.x || 0));
1570
+ C = Math.min(...X.map((N) => N.normalStyle.x || 0));
1509
1571
  break;
1510
1572
  case "right":
1511
- I = Math.max(
1573
+ C = Math.max(
1512
1574
  ...X.map((N) => (N.normalStyle.x || 0) + (N.normalStyle.width || 0))
1513
1575
  );
1514
1576
  break;
1515
1577
  case "top":
1516
- I = Math.min(...X.map((N) => N.normalStyle.y || 0));
1578
+ C = Math.min(...X.map((N) => N.normalStyle.y || 0));
1517
1579
  break;
1518
1580
  case "bottom":
1519
- I = Math.max(
1581
+ C = Math.max(
1520
1582
  ...X.map((N) => (N.normalStyle.y || 0) + (N.normalStyle.height || 0))
1521
1583
  );
1522
1584
  break;
1523
1585
  }
1524
1586
  X.forEach((N) => {
1525
- let z = N.normalStyle.x || 0, J = N.normalStyle.y || 0;
1526
- switch (y) {
1587
+ let _ = N.normalStyle.x || 0, U = N.normalStyle.y || 0;
1588
+ switch (g) {
1527
1589
  case "left":
1528
- z = I;
1590
+ _ = C;
1529
1591
  break;
1530
1592
  case "right":
1531
- z = I - (N.normalStyle.width || 0);
1593
+ _ = C - (N.normalStyle.width || 0);
1532
1594
  break;
1533
1595
  case "top":
1534
- J = I;
1596
+ U = C;
1535
1597
  break;
1536
1598
  case "bottom":
1537
- J = I - (N.normalStyle.height || 0);
1599
+ U = C - (N.normalStyle.height || 0);
1538
1600
  break;
1539
1601
  }
1540
- M.updateNode(N.id, {
1541
- normalStyle: { ...N.normalStyle, x: z, y: J }
1602
+ I.updateNode(N.id, {
1603
+ normalStyle: { ...N.normalStyle, x: _, y: U }
1542
1604
  });
1543
1605
  });
1544
1606
  },
1545
- [v, r]
1546
- ), Be = [
1607
+ [w, d]
1608
+ ), Tt = [
1547
1609
  {
1548
- icon: /* @__PURE__ */ e(qt, {}),
1610
+ icon: /* @__PURE__ */ e(Vt, {}),
1549
1611
  title: "选择模式",
1550
- active: l === "select" && !R,
1612
+ active: a === "select" && !R,
1551
1613
  onClick: () => {
1552
- C("select"), q(!1);
1614
+ m("select"), i(!1);
1553
1615
  }
1554
1616
  },
1555
1617
  {
1556
- icon: /* @__PURE__ */ e(Gt, {}),
1618
+ icon: /* @__PURE__ */ e(Ht, {}),
1557
1619
  title: "拖拽模式",
1558
- active: l === "drag",
1620
+ active: a === "drag",
1559
1621
  onClick: () => {
1560
- C("drag"), q(!1);
1622
+ m("drag"), i(!1);
1561
1623
  }
1562
1624
  },
1563
1625
  {
1564
- icon: /* @__PURE__ */ e(et, {}),
1626
+ icon: /* @__PURE__ */ e(nt, {}),
1565
1627
  title: "线条绘制",
1566
- active: l === "line-draw",
1628
+ active: a === "line-draw",
1567
1629
  onClick: () => {
1568
- C("line-draw"), q(!1);
1630
+ m("line-draw"), i(!1);
1569
1631
  }
1570
1632
  },
1571
1633
  {
1572
- icon: /* @__PURE__ */ e(Bt, {}),
1634
+ icon: /* @__PURE__ */ e(Zt, {}),
1573
1635
  title: "预览模式",
1574
- active: l === "preview",
1636
+ active: a === "preview",
1575
1637
  onClick: () => {
1576
- C("preview"), q(!1);
1638
+ m("preview"), i(!1);
1577
1639
  }
1578
1640
  }
1579
- ], ye = [
1580
- { icon: /* @__PURE__ */ e(Ot, {}), title: "撤销 (Ctrl+Z)", onClick: x },
1581
- { icon: /* @__PURE__ */ e(Yt, {}), title: "重做 (Ctrl+Y)", onClick: g },
1582
- {
1583
- icon: /* @__PURE__ */ e(zt, {}),
1584
- title: "框选模式",
1585
- active: R,
1586
- onClick: () => {
1587
- q(!R), C("select"), k([]);
1588
- }
1589
- },
1590
- {
1591
- icon: /* @__PURE__ */ e(At, {}),
1592
- title: "左对齐",
1593
- disabled: v.length < 2,
1594
- onClick: () => ve("left")
1595
- },
1596
- {
1597
- icon: /* @__PURE__ */ e(Rt, {}),
1598
- title: "右对齐",
1599
- disabled: v.length < 2,
1600
- onClick: () => ve("right")
1601
- },
1602
- {
1603
- icon: /* @__PURE__ */ e(Xt, {}),
1604
- title: "上对齐",
1605
- disabled: v.length < 2,
1606
- onClick: () => ve("top")
1607
- },
1608
- {
1609
- icon: /* @__PURE__ */ e(jt, {}),
1610
- title: "下对齐",
1611
- disabled: v.length < 2,
1612
- onClick: () => ve("bottom")
1613
- },
1614
- {
1615
- icon: /* @__PURE__ */ e(Ft, {}),
1616
- title: "数据模拟",
1617
- type: "primary",
1618
- onClick: () => we(!0)
1619
- },
1620
- {
1621
- icon: /* @__PURE__ */ e(Ue, {}),
1622
- title: "删除选中 (Delete)",
1623
- disabled: !c && v.length === 0,
1624
- onClick: () => {
1625
- c ? s(c) : v.length > 0 && (v.forEach((y) => s(y)), k([]));
1641
+ ], $t = xt(
1642
+ () => [
1643
+ { icon: /* @__PURE__ */ e(Rt, {}), title: "撤销 (Ctrl+Z)", onClick: y },
1644
+ { icon: /* @__PURE__ */ e(At, {}), title: "重做 (Ctrl+Y)", onClick: E },
1645
+ {
1646
+ icon: /* @__PURE__ */ e(at, {}),
1647
+ title: "框选模式",
1648
+ active: R,
1649
+ onClick: () => {
1650
+ const g = !R;
1651
+ i(g), m("select"), g && M([]);
1652
+ }
1653
+ },
1654
+ {
1655
+ icon: /* @__PURE__ */ e(at, {}),
1656
+ title: "组合选中节点",
1657
+ disabled: w.length < 2,
1658
+ onClick: ve
1659
+ },
1660
+ {
1661
+ icon: /* @__PURE__ */ e(jt, {}),
1662
+ title: "左对齐",
1663
+ disabled: w.length < 2,
1664
+ onClick: () => Me("left")
1665
+ },
1666
+ {
1667
+ icon: /* @__PURE__ */ e(Ft, {}),
1668
+ title: "右对齐",
1669
+ disabled: w.length < 2,
1670
+ onClick: () => Me("right")
1671
+ },
1672
+ {
1673
+ icon: /* @__PURE__ */ e(Wt, {}),
1674
+ title: "上对齐",
1675
+ disabled: w.length < 2,
1676
+ onClick: () => Me("top")
1677
+ },
1678
+ {
1679
+ icon: /* @__PURE__ */ e(Ut, {}),
1680
+ title: "下对齐",
1681
+ disabled: w.length < 2,
1682
+ onClick: () => Me("bottom")
1683
+ },
1684
+ {
1685
+ icon: /* @__PURE__ */ e(qt, {}),
1686
+ title: "数据模拟",
1687
+ type: "primary",
1688
+ onClick: () => Ce(!0)
1689
+ },
1690
+ {
1691
+ icon: /* @__PURE__ */ e(qe, {}),
1692
+ title: "删除选中 (Delete)",
1693
+ disabled: !l && w.length === 0,
1694
+ onClick: () => {
1695
+ l ? x(l) : w.length > 0 && (w.forEach((g) => x(g)), M([]));
1696
+ }
1626
1697
  }
1627
- }
1628
- ];
1629
- return /* @__PURE__ */ d("div", { className: "flex-1 flex flex-col h-full bg-gray-100", children: [
1630
- /* @__PURE__ */ d("div", { className: "h-12 bg-white border-b border-gray-200 flex items-center justify-between px-4", children: [
1631
- /* @__PURE__ */ e(ee, { children: Be.map((y) => /* @__PURE__ */ e(pe, { title: y.title, children: /* @__PURE__ */ e(
1632
- Y,
1698
+ ],
1699
+ [
1700
+ y,
1701
+ E,
1702
+ R,
1703
+ i,
1704
+ m,
1705
+ M,
1706
+ w,
1707
+ ve,
1708
+ Me,
1709
+ Ce,
1710
+ l,
1711
+ x
1712
+ ]
1713
+ );
1714
+ return /* @__PURE__ */ c("div", { className: "flex-1 flex flex-col h-full bg-gray-100", children: [
1715
+ /* @__PURE__ */ c("div", { className: "h-12 bg-white border-b border-gray-200 flex items-center justify-between px-4", children: [
1716
+ /* @__PURE__ */ e(ae, { children: Tt.map((g) => /* @__PURE__ */ e(we, { title: g.title, children: /* @__PURE__ */ e(
1717
+ j,
1633
1718
  {
1634
- type: y.active ? "primary" : "default",
1635
- icon: y.icon,
1636
- onClick: y.onClick
1719
+ type: g.active ? "primary" : "default",
1720
+ icon: g.icon,
1721
+ onClick: g.onClick
1637
1722
  }
1638
- ) }, y.title)) }),
1639
- /* @__PURE__ */ e(ee, { children: ye.map((y) => /* @__PURE__ */ e(pe, { title: y.title, children: /* @__PURE__ */ e(
1640
- Y,
1723
+ ) }, g.title)) }),
1724
+ /* @__PURE__ */ e(ae, { children: $t.map((g) => /* @__PURE__ */ e(we, { title: g.title, children: /* @__PURE__ */ e(
1725
+ j,
1641
1726
  {
1642
- type: y.type || "default",
1643
- icon: y.icon,
1644
- onClick: y.onClick,
1645
- disabled: y.disabled
1727
+ type: g.active ? "primary" : g.type || "default",
1728
+ icon: g.icon,
1729
+ onClick: g.onClick,
1730
+ disabled: g.disabled
1646
1731
  }
1647
- ) }, y.title)) })
1732
+ ) }, g.title)) })
1648
1733
  ] }),
1649
- /* @__PURE__ */ e("div", { className: "flex-1 relative", children: /* @__PURE__ */ e(
1650
- Kt,
1734
+ /* @__PURE__ */ e("div", { ref: r, className: "flex-1 relative", children: /* @__PURE__ */ e(
1735
+ tn,
1651
1736
  {
1652
- ref: h,
1737
+ ref: f,
1653
1738
  initialScale: 1,
1654
1739
  initialPositionX: 0,
1655
1740
  initialPositionY: 0,
1656
1741
  minScale: 0.5,
1657
1742
  maxScale: 5,
1658
- onTransformed: ne,
1743
+ onTransformed: oe,
1659
1744
  limitToBounds: !1,
1660
1745
  centerZoomedOut: !1,
1661
- panning: { disabled: !1, velocityDisabled: !0 },
1746
+ panning: { disabled: R, velocityDisabled: !0 },
1662
1747
  wheel: { disabled: !1, step: 0.1 },
1663
1748
  pinch: { disabled: !1 },
1664
1749
  doubleClick: { disabled: !0 },
1665
- children: ({ zoomIn: y, zoomOut: M, resetTransform: X }) => /* @__PURE__ */ d(ge, { children: [
1666
- /* @__PURE__ */ e("div", { className: "absolute bottom-4 right-4 z-10 bg-white rounded-lg shadow-lg p-2", children: /* @__PURE__ */ d(ee, { direction: "vertical", children: [
1667
- /* @__PURE__ */ e(pe, { title: "放大", children: /* @__PURE__ */ e(Y, { icon: /* @__PURE__ */ e(Wt, {}), onClick: () => y() }) }),
1668
- /* @__PURE__ */ e(pe, { title: "缩小", children: /* @__PURE__ */ e(Y, { icon: /* @__PURE__ */ e(Ut, {}), onClick: () => M() }) }),
1669
- /* @__PURE__ */ e(pe, { title: "重置视图", children: /* @__PURE__ */ e(Y, { onClick: () => X(), children: "100%" }) }),
1670
- /* @__PURE__ */ d("div", { className: "text-center text-xs text-gray-500", children: [
1671
- Math.round(o.scale * 100),
1750
+ children: ({ zoomIn: g, zoomOut: I, resetTransform: X }) => /* @__PURE__ */ c(Se, { children: [
1751
+ /* @__PURE__ */ e("div", { className: "absolute bottom-4 right-4 z-10 bg-white rounded-lg shadow-lg p-2", children: /* @__PURE__ */ c(ae, { direction: "vertical", children: [
1752
+ /* @__PURE__ */ e(we, { title: "放大", children: /* @__PURE__ */ e(j, { icon: /* @__PURE__ */ e(Gt, {}), onClick: () => g() }) }),
1753
+ /* @__PURE__ */ e(we, { title: "缩小", children: /* @__PURE__ */ e(j, { icon: /* @__PURE__ */ e(Bt, {}), onClick: () => I() }) }),
1754
+ /* @__PURE__ */ e(we, { title: "重置视图", children: /* @__PURE__ */ e(j, { onClick: () => X(), children: "100%" }) }),
1755
+ /* @__PURE__ */ c("div", { className: "text-center text-xs text-gray-500", children: [
1756
+ Math.round(h.scale * 100),
1672
1757
  "%"
1673
1758
  ] })
1674
1759
  ] }) }),
1675
1760
  /* @__PURE__ */ e(
1676
- Qt,
1761
+ nn,
1677
1762
  {
1678
1763
  wrapperStyle: { width: "100%", height: "100%", position: "relative" },
1679
1764
  contentStyle: {
@@ -1683,42 +1768,42 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1683
1768
  alignItems: "center",
1684
1769
  justifyContent: "center"
1685
1770
  },
1686
- children: /* @__PURE__ */ d(
1771
+ children: /* @__PURE__ */ c(
1687
1772
  "div",
1688
1773
  {
1689
1774
  ref: t,
1690
1775
  "data-canvas": "true",
1691
- className: `relative bg-white ${D ? "ring-4 ring-blue-400 ring-opacity-50" : ""} ${l === "line-draw" ? "cursor-crosshair" : ""}`,
1776
+ className: `relative bg-white ${L ? "ring-4 ring-blue-400 ring-opacity-50" : ""} ${a === "line-draw" ? "cursor-crosshair" : ""}`,
1692
1777
  style: { width: 1920, height: 1080, flexShrink: 0 },
1693
- onClick: le,
1694
- onMouseDown: re,
1695
- onDoubleClick: Se,
1696
- onDragOver: Ce,
1697
- onDragLeave: Re,
1698
- onDrop: qe,
1778
+ onClick: ke,
1779
+ onMouseDown: Ee,
1780
+ onDoubleClick: Ae,
1781
+ onDragOver: Ge,
1782
+ onDragLeave: Be,
1783
+ onDrop: Ve,
1699
1784
  children: [
1700
- /* @__PURE__ */ d("svg", { className: "absolute top-0 left-0 pointer-events-none", width: "1920", height: "1080", children: [
1785
+ /* @__PURE__ */ c("svg", { className: "absolute top-0 left-0 pointer-events-none", width: "1920", height: "1080", children: [
1701
1786
  /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ e("pattern", { id: "grid", width: "20", height: "20", patternUnits: "userSpaceOnUse", children: /* @__PURE__ */ e("path", { d: "M 20 0 L 0 0 0 20", fill: "none", stroke: "#f0f0f0", strokeWidth: "1" }) }) }),
1702
1787
  /* @__PURE__ */ e("rect", { width: "100%", height: "100%", fill: "url(#grid)" })
1703
1788
  ] }),
1704
- r.map((I) => /* @__PURE__ */ e(
1705
- kt,
1789
+ d.map((C) => /* @__PURE__ */ e(
1790
+ Lt,
1706
1791
  {
1707
- node: I,
1708
- isSelected: c === I.id || v.includes(I.id),
1792
+ node: C,
1793
+ isSelected: l === C.id || w.includes(C.id),
1709
1794
  data: n,
1710
- onClick: () => u(I.id),
1711
- onMouseDown: (N) => Ge(N, I)
1795
+ onClick: () => b(C.id),
1796
+ onMouseDown: (N) => He(N, C)
1712
1797
  },
1713
- I.id
1798
+ C.id
1714
1799
  )),
1715
- l === "line-draw" && S.isDrawing && S.start && S.end && /* @__PURE__ */ e("svg", { className: "absolute top-0 left-0 pointer-events-none", width: "1920", height: "1080", children: /* @__PURE__ */ e(
1800
+ a === "line-draw" && T.isDrawing && T.start && T.end && /* @__PURE__ */ e("svg", { className: "absolute top-0 left-0 pointer-events-none", width: "1920", height: "1080", children: /* @__PURE__ */ e(
1716
1801
  "line",
1717
1802
  {
1718
- x1: S.start.x,
1719
- y1: S.start.y,
1720
- x2: S.end.x,
1721
- y2: S.end.y,
1803
+ x1: T.start.x,
1804
+ y1: T.start.y,
1805
+ x2: T.end.x,
1806
+ y2: T.end.y,
1722
1807
  stroke: "#1890ff",
1723
1808
  strokeWidth: "2",
1724
1809
  strokeDasharray: "5,5",
@@ -1726,15 +1811,16 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1726
1811
  strokeLinejoin: "round"
1727
1812
  }
1728
1813
  ) }),
1729
- R && i.start && i.end && /* @__PURE__ */ e(
1814
+ R && k.start && k.end && /* @__PURE__ */ e(
1730
1815
  "div",
1731
1816
  {
1732
1817
  className: "absolute border-2 border-blue-500 bg-blue-500/10 pointer-events-none",
1733
1818
  style: {
1734
- left: Math.min(i.start.x, i.end.x),
1735
- top: Math.min(i.start.y, i.end.y),
1736
- width: Math.abs(i.end.x - i.start.x),
1737
- height: Math.abs(i.end.y - i.start.y)
1819
+ left: Math.min(k.start.x, k.end.x),
1820
+ top: Math.min(k.start.y, k.end.y),
1821
+ width: Math.abs(k.end.x - k.start.x),
1822
+ height: Math.abs(k.end.y - k.start.y),
1823
+ zIndex: 9999
1738
1824
  }
1739
1825
  }
1740
1826
  )
@@ -1747,17 +1833,17 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1747
1833
  }
1748
1834
  ) }),
1749
1835
  /* @__PURE__ */ e(
1750
- Qe,
1836
+ tt,
1751
1837
  {
1752
1838
  title: "数据模拟",
1753
- open: L,
1754
- onCancel: () => we(!1),
1839
+ open: Xe,
1840
+ onCancel: () => Ce(!1),
1755
1841
  footer: null,
1756
- children: /* @__PURE__ */ e(b, { layout: "vertical", children: /* @__PURE__ */ e(b.Item, { label: "测试数据 (JSON)", children: /* @__PURE__ */ e(
1757
- wn,
1842
+ children: /* @__PURE__ */ e(v, { layout: "vertical", children: /* @__PURE__ */ e(v.Item, { label: "测试数据 (JSON)", children: /* @__PURE__ */ e(
1843
+ Nn,
1758
1844
  {
1759
1845
  value: ze,
1760
- onChange: (y) => Ae(y.target.value),
1846
+ onChange: (g) => Re(g.target.value),
1761
1847
  rows: 10,
1762
1848
  placeholder: "输入 JSON 格式的测试数据"
1763
1849
  }
@@ -1765,7 +1851,7 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1765
1851
  }
1766
1852
  )
1767
1853
  ] });
1768
- }, Cn = [
1854
+ }, kn = [
1769
1855
  "#1890ff",
1770
1856
  "#52c41a",
1771
1857
  "#faad14",
@@ -1782,28 +1868,28 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1782
1868
  "#000000",
1783
1869
  "#ff4d4f",
1784
1870
  "#73d13d"
1785
- ], Ke = ({
1871
+ ], et = ({
1786
1872
  value: n = "#1890ff",
1787
- onChange: h,
1873
+ onChange: f,
1788
1874
  onChangeComplete: t
1789
1875
  }) => {
1790
- const [r, c] = j(!1), [l, a] = j(n), o = ue(null);
1791
- ae(() => {
1876
+ const [r, d] = q(!1), [l, a] = q(n), o = ue(null);
1877
+ se(() => {
1792
1878
  a(n);
1793
- }, [n]), ae(() => {
1794
- const f = (u) => {
1795
- o.current && !o.current.contains(u.target) && (c(!1), t?.({ toHexString: () => l }));
1879
+ }, [n]), se(() => {
1880
+ const p = (u) => {
1881
+ o.current && !o.current.contains(u.target) && (d(!1), t?.({ toHexString: () => l }));
1796
1882
  };
1797
- return r && document.addEventListener("mousedown", f), () => document.removeEventListener("mousedown", f);
1883
+ return r && document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
1798
1884
  }, [r, t, l]);
1799
- const p = (f) => {
1800
- a(f), h?.({ toHexString: () => f });
1885
+ const h = (p) => {
1886
+ a(p), f?.({ toHexString: () => p });
1801
1887
  };
1802
- return /* @__PURE__ */ d("div", { ref: o, style: { position: "relative", display: "inline-block" }, children: [
1888
+ return /* @__PURE__ */ c("div", { ref: o, style: { position: "relative", display: "inline-block" }, children: [
1803
1889
  /* @__PURE__ */ e(
1804
1890
  "div",
1805
1891
  {
1806
- onClick: () => c(!r),
1892
+ onClick: () => d(!r),
1807
1893
  style: {
1808
1894
  width: 28,
1809
1895
  height: 28,
@@ -1814,7 +1900,7 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1814
1900
  }
1815
1901
  }
1816
1902
  ),
1817
- r && /* @__PURE__ */ d(
1903
+ r && /* @__PURE__ */ c(
1818
1904
  "div",
1819
1905
  {
1820
1906
  style: {
@@ -1829,29 +1915,29 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1829
1915
  border: "1px solid #f0f0f0"
1830
1916
  },
1831
1917
  children: [
1832
- /* @__PURE__ */ e("div", { style: { display: "grid", gridTemplateColumns: "repeat(8, 1fr)", gap: 4 }, children: Cn.map((f) => /* @__PURE__ */ e(
1918
+ /* @__PURE__ */ e("div", { style: { display: "grid", gridTemplateColumns: "repeat(8, 1fr)", gap: 4 }, children: kn.map((p) => /* @__PURE__ */ e(
1833
1919
  "div",
1834
1920
  {
1835
1921
  onClick: () => {
1836
- p(f), c(!1), t?.({ toHexString: () => f });
1922
+ h(p), d(!1), t?.({ toHexString: () => p });
1837
1923
  },
1838
1924
  style: {
1839
1925
  width: 20,
1840
1926
  height: 20,
1841
- backgroundColor: f,
1842
- border: l === f ? "2px solid #1890ff" : "1px solid #d9d9d9",
1927
+ backgroundColor: p,
1928
+ border: l === p ? "2px solid #1890ff" : "1px solid #d9d9d9",
1843
1929
  borderRadius: 2,
1844
1930
  cursor: "pointer"
1845
1931
  }
1846
1932
  },
1847
- f
1933
+ p
1848
1934
  )) }),
1849
1935
  /* @__PURE__ */ e(
1850
1936
  "input",
1851
1937
  {
1852
1938
  type: "color",
1853
1939
  value: l,
1854
- onChange: (f) => p(f.target.value),
1940
+ onChange: (p) => h(p.target.value),
1855
1941
  onBlur: () => t?.({ toHexString: () => l }),
1856
1942
  style: {
1857
1943
  width: "100%",
@@ -1866,13 +1952,13 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1866
1952
  }
1867
1953
  )
1868
1954
  ] });
1869
- }, { Option: We } = ce, Nn = ({
1955
+ }, { Option: Ue } = me, En = ({
1870
1956
  material: n,
1871
- onSave: h,
1957
+ onSave: f,
1872
1958
  bindCodes: t = [],
1873
1959
  dataOptions: r = []
1874
1960
  }) => {
1875
- const l = n.content || {}, [a, o] = j({
1961
+ const l = n.content || {}, [a, o] = q({
1876
1962
  label: l.label || "",
1877
1963
  value: l.value || "",
1878
1964
  valueSourceCode: l.valueSourceCode || "",
@@ -1885,7 +1971,7 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1885
1971
  valueFontWeight: l.valueStyle?.fontWeight || "normal",
1886
1972
  valueColor: l.valueStyle?.color || "#1890ff"
1887
1973
  });
1888
- ae(() => {
1974
+ se(() => {
1889
1975
  o({
1890
1976
  label: l.label || "",
1891
1977
  value: l.value || "",
@@ -1900,27 +1986,27 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1900
1986
  valueColor: l.valueStyle?.color || "#1890ff"
1901
1987
  });
1902
1988
  }, [n.id]);
1903
- const p = (s, x) => {
1904
- o((g) => ({ ...g, [s]: x }));
1905
- }, f = (s) => {
1906
- const x = r.find((C) => C.paramsCode === s), g = x?.unit || "";
1907
- o((C) => ({
1908
- ...C,
1989
+ const h = (s, x) => {
1990
+ o((y) => ({ ...y, [s]: x }));
1991
+ }, p = (s) => {
1992
+ const x = r.find((E) => E.paramsCode === s), y = x?.unit || "";
1993
+ o((E) => ({
1994
+ ...E,
1909
1995
  valueSourceCode: s,
1910
- unit: g,
1996
+ unit: y,
1911
1997
  value: String(x?.value || "")
1912
1998
  })), setTimeout(() => {
1913
- h({
1999
+ f({
1914
2000
  content: {
1915
2001
  ...l,
1916
2002
  valueSourceCode: s,
1917
2003
  value: String(x?.value || ""),
1918
- unit: g
2004
+ unit: y
1919
2005
  }
1920
2006
  });
1921
2007
  }, 0);
1922
2008
  }, u = () => {
1923
- h({
2009
+ f({
1924
2010
  content: {
1925
2011
  ...l,
1926
2012
  label: a.label,
@@ -1940,31 +2026,31 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1940
2026
  }
1941
2027
  }
1942
2028
  });
1943
- }, w = r.filter(
2029
+ }, b = r.filter(
1944
2030
  (s) => t.includes(s.paramsCode)
1945
2031
  );
1946
- return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
1947
- /* @__PURE__ */ e(he, { style: { marginTop: 0 }, children: "文本内容" }),
1948
- /* @__PURE__ */ d(b, { layout: "vertical", children: [
1949
- /* @__PURE__ */ e(b.Item, { label: "标签文本 (label)", children: /* @__PURE__ */ e(
1950
- B,
2032
+ return /* @__PURE__ */ c("div", { className: "space-y-4", children: [
2033
+ /* @__PURE__ */ e(ye, { style: { marginTop: 0 }, children: "文本内容" }),
2034
+ /* @__PURE__ */ c(v, { layout: "vertical", children: [
2035
+ /* @__PURE__ */ e(v.Item, { label: "标签文本 (label)", children: /* @__PURE__ */ e(
2036
+ J,
1951
2037
  {
1952
2038
  value: a.label,
1953
- onChange: (s) => p("label", s.target.value),
2039
+ onChange: (s) => h("label", s.target.value),
1954
2040
  onBlur: u,
1955
2041
  placeholder: "输入标签文本"
1956
2042
  }
1957
2043
  ) }),
1958
2044
  /* @__PURE__ */ e(
1959
- b.Item,
2045
+ v.Item,
1960
2046
  {
1961
2047
  label: "值来源",
1962
2048
  help: "从绑定的数据中选择字段,优先级高于手动输入的值",
1963
2049
  children: /* @__PURE__ */ e(
1964
- ce,
2050
+ me,
1965
2051
  {
1966
2052
  value: a.valueSourceCode || void 0,
1967
- onChange: f,
2053
+ onChange: p,
1968
2054
  placeholder: "选择数据字段(可选)",
1969
2055
  allowClear: !0,
1970
2056
  style: { width: "100%" },
@@ -1972,21 +2058,21 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1972
2058
  value: "paramsCode",
1973
2059
  label: "paramsName"
1974
2060
  },
1975
- options: w
2061
+ options: b
1976
2062
  }
1977
2063
  )
1978
2064
  }
1979
2065
  ),
1980
2066
  /* @__PURE__ */ e(
1981
- b.Item,
2067
+ v.Item,
1982
2068
  {
1983
2069
  label: a.valueSourceCode ? "默认值(备用)" : "值文本",
1984
2070
  help: a.valueSourceCode ? "已绑定数据源,实际值将来自数据字段,此处仅设置无数据时的备用显示" : "手动输入显示的值",
1985
2071
  children: /* @__PURE__ */ e(
1986
- B,
2072
+ J,
1987
2073
  {
1988
2074
  value: a.value,
1989
- onChange: (s) => p("value", s.target.value),
2075
+ onChange: (s) => h("value", s.target.value),
1990
2076
  onBlur: u,
1991
2077
  placeholder: a.valueSourceCode ? "数据字段无值时显示此备用值" : "输入值文本",
1992
2078
  disabled: !!a.valueSourceCode,
@@ -1995,26 +2081,26 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
1995
2081
  )
1996
2082
  }
1997
2083
  ),
1998
- /* @__PURE__ */ e(b.Item, { label: "单位", help: "优先从绑定数据自动获取,也可手动输入", children: /* @__PURE__ */ e(
1999
- B,
2084
+ /* @__PURE__ */ e(v.Item, { label: "单位", help: "优先从绑定数据自动获取,也可手动输入", children: /* @__PURE__ */ e(
2085
+ J,
2000
2086
  {
2001
2087
  value: a.unit,
2002
- onChange: (s) => p("unit", s.target.value),
2088
+ onChange: (s) => h("unit", s.target.value),
2003
2089
  onBlur: u,
2004
2090
  placeholder: "单位(如°C、%、MPa等)",
2005
- suffix: a.valueSourceCode && w.length > 0 ? /* @__PURE__ */ e(Q, { color: "blue", style: { marginRight: -8 }, children: "自动" }) : null
2091
+ suffix: a.valueSourceCode && b.length > 0 ? /* @__PURE__ */ e(le, { color: "blue", style: { marginRight: -8 }, children: "自动" }) : null
2006
2092
  }
2007
2093
  ) }),
2008
2094
  /* @__PURE__ */ e(
2009
- b.Item,
2095
+ v.Item,
2010
2096
  {
2011
2097
  label: "保留小数位",
2012
2098
  help: "数值格式化时保留的小数位数,-1表示不格式化",
2013
2099
  children: /* @__PURE__ */ e(
2014
- U,
2100
+ V,
2015
2101
  {
2016
2102
  value: a.decimals,
2017
- onChange: (s) => p("decimals", s ?? 2),
2103
+ onChange: (s) => h("decimals", s ?? 2),
2018
2104
  onBlur: u,
2019
2105
  min: -1,
2020
2106
  max: 10,
@@ -2024,44 +2110,44 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
2024
2110
  }
2025
2111
  )
2026
2112
  ] }),
2027
- /* @__PURE__ */ e(he, { children: "标签样式" }),
2028
- /* @__PURE__ */ d(b, { layout: "vertical", children: [
2029
- /* @__PURE__ */ d(ee, { children: [
2030
- /* @__PURE__ */ e(b.Item, { label: "字体大小", children: /* @__PURE__ */ e(
2031
- U,
2113
+ /* @__PURE__ */ e(ye, { children: "标签样式" }),
2114
+ /* @__PURE__ */ c(v, { layout: "vertical", children: [
2115
+ /* @__PURE__ */ c(ae, { children: [
2116
+ /* @__PURE__ */ e(v.Item, { label: "字体大小", children: /* @__PURE__ */ e(
2117
+ V,
2032
2118
  {
2033
2119
  value: a.labelFontSize,
2034
- onChange: (s) => p("labelFontSize", s || 14),
2120
+ onChange: (s) => h("labelFontSize", s || 14),
2035
2121
  onBlur: u,
2036
2122
  min: 8,
2037
2123
  max: 72
2038
2124
  }
2039
2125
  ) }),
2040
- /* @__PURE__ */ e(b.Item, { label: "字体粗细", children: /* @__PURE__ */ d(
2041
- ce,
2126
+ /* @__PURE__ */ e(v.Item, { label: "字体粗细", children: /* @__PURE__ */ c(
2127
+ me,
2042
2128
  {
2043
2129
  value: a.labelFontWeight,
2044
2130
  onChange: (s) => {
2045
- p("labelFontWeight", s), setTimeout(u, 0);
2131
+ h("labelFontWeight", s), setTimeout(u, 0);
2046
2132
  },
2047
2133
  style: { width: 100 },
2048
2134
  children: [
2049
- /* @__PURE__ */ e(We, { value: "normal", children: "正常" }),
2050
- /* @__PURE__ */ e(We, { value: "bold", children: "粗体" })
2135
+ /* @__PURE__ */ e(Ue, { value: "normal", children: "正常" }),
2136
+ /* @__PURE__ */ e(Ue, { value: "bold", children: "粗体" })
2051
2137
  ]
2052
2138
  }
2053
2139
  ) })
2054
2140
  ] }),
2055
- /* @__PURE__ */ e(b.Item, { label: "文字颜色", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
2141
+ /* @__PURE__ */ e(v.Item, { label: "文字颜色", children: /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
2056
2142
  /* @__PURE__ */ e(
2057
- Ke,
2143
+ et,
2058
2144
  {
2059
2145
  value: a.labelColor || "#262626",
2060
2146
  onChange: (s) => {
2061
- p("labelColor", s.toHexString());
2147
+ h("labelColor", s.toHexString());
2062
2148
  },
2063
2149
  onChangeComplete: (s) => {
2064
- h({
2150
+ f({
2065
2151
  content: {
2066
2152
  ...l,
2067
2153
  label: a.label,
@@ -2085,10 +2171,10 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
2085
2171
  }
2086
2172
  ),
2087
2173
  /* @__PURE__ */ e(
2088
- B,
2174
+ J,
2089
2175
  {
2090
2176
  value: a.labelColor,
2091
- onChange: (s) => p("labelColor", s.target.value),
2177
+ onChange: (s) => h("labelColor", s.target.value),
2092
2178
  onBlur: u,
2093
2179
  placeholder: "#262626",
2094
2180
  style: { width: 100 }
@@ -2096,44 +2182,44 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
2096
2182
  )
2097
2183
  ] }) })
2098
2184
  ] }),
2099
- /* @__PURE__ */ e(he, { children: "值样式" }),
2100
- /* @__PURE__ */ d(b, { layout: "vertical", children: [
2101
- /* @__PURE__ */ d(ee, { children: [
2102
- /* @__PURE__ */ e(b.Item, { label: "字体大小", children: /* @__PURE__ */ e(
2103
- U,
2185
+ /* @__PURE__ */ e(ye, { children: "值样式" }),
2186
+ /* @__PURE__ */ c(v, { layout: "vertical", children: [
2187
+ /* @__PURE__ */ c(ae, { children: [
2188
+ /* @__PURE__ */ e(v.Item, { label: "字体大小", children: /* @__PURE__ */ e(
2189
+ V,
2104
2190
  {
2105
2191
  value: a.valueFontSize,
2106
- onChange: (s) => p("valueFontSize", s || 14),
2192
+ onChange: (s) => h("valueFontSize", s || 14),
2107
2193
  onBlur: u,
2108
2194
  min: 8,
2109
2195
  max: 72
2110
2196
  }
2111
2197
  ) }),
2112
- /* @__PURE__ */ e(b.Item, { label: "字体粗细", children: /* @__PURE__ */ d(
2113
- ce,
2198
+ /* @__PURE__ */ e(v.Item, { label: "字体粗细", children: /* @__PURE__ */ c(
2199
+ me,
2114
2200
  {
2115
2201
  value: a.valueFontWeight,
2116
2202
  onChange: (s) => {
2117
- p("valueFontWeight", s), setTimeout(u, 0);
2203
+ h("valueFontWeight", s), setTimeout(u, 0);
2118
2204
  },
2119
2205
  style: { width: 100 },
2120
2206
  children: [
2121
- /* @__PURE__ */ e(We, { value: "normal", children: "正常" }),
2122
- /* @__PURE__ */ e(We, { value: "bold", children: "粗体" })
2207
+ /* @__PURE__ */ e(Ue, { value: "normal", children: "正常" }),
2208
+ /* @__PURE__ */ e(Ue, { value: "bold", children: "粗体" })
2123
2209
  ]
2124
2210
  }
2125
2211
  ) })
2126
2212
  ] }),
2127
- /* @__PURE__ */ e(b.Item, { label: "文字颜色", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
2213
+ /* @__PURE__ */ e(v.Item, { label: "文字颜色", children: /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
2128
2214
  /* @__PURE__ */ e(
2129
- Ke,
2215
+ et,
2130
2216
  {
2131
2217
  value: a.valueColor || "#1890ff",
2132
2218
  onChange: (s) => {
2133
- p("valueColor", s.toHexString());
2219
+ h("valueColor", s.toHexString());
2134
2220
  },
2135
2221
  onChangeComplete: (s) => {
2136
- h({
2222
+ f({
2137
2223
  content: {
2138
2224
  ...l,
2139
2225
  label: a.label,
@@ -2157,10 +2243,10 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
2157
2243
  }
2158
2244
  ),
2159
2245
  /* @__PURE__ */ e(
2160
- B,
2246
+ J,
2161
2247
  {
2162
2248
  value: a.valueColor,
2163
- onChange: (s) => p("valueColor", s.target.value),
2249
+ onChange: (s) => h("valueColor", s.target.value),
2164
2250
  onBlur: u,
2165
2251
  placeholder: "#1890ff",
2166
2252
  style: { width: 100 }
@@ -2169,41 +2255,41 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
2169
2255
  ] }) })
2170
2256
  ] })
2171
2257
  ] });
2172
- }, In = ({
2258
+ }, Mn = ({
2173
2259
  material: n,
2174
- onSave: h
2260
+ onSave: f
2175
2261
  }) => {
2176
- const t = n, [r, c] = j({
2262
+ const t = n, [r, d] = q({
2177
2263
  name: n.name,
2178
2264
  src: t.src || ""
2179
2265
  });
2180
- ae(() => {
2181
- c({
2266
+ se(() => {
2267
+ d({
2182
2268
  name: n.name,
2183
2269
  src: t.src || ""
2184
2270
  });
2185
2271
  }, [n.id]);
2186
- const l = (o, p) => {
2187
- c((f) => ({ ...f, [o]: p }));
2272
+ const l = (o, h) => {
2273
+ d((p) => ({ ...p, [o]: h }));
2188
2274
  }, a = () => {
2189
- h({
2275
+ f({
2190
2276
  name: r.name,
2191
2277
  src: r.src
2192
2278
  });
2193
2279
  };
2194
- return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
2195
- /* @__PURE__ */ e(he, { style: { marginTop: 0 }, children: "图片属性" }),
2196
- /* @__PURE__ */ d(b, { layout: "vertical", children: [
2197
- /* @__PURE__ */ e(b.Item, { label: "图片名称", children: /* @__PURE__ */ e(
2198
- B,
2280
+ return /* @__PURE__ */ c("div", { className: "space-y-4", children: [
2281
+ /* @__PURE__ */ e(ye, { style: { marginTop: 0 }, children: "图片属性" }),
2282
+ /* @__PURE__ */ c(v, { layout: "vertical", children: [
2283
+ /* @__PURE__ */ e(v.Item, { label: "图片名称", children: /* @__PURE__ */ e(
2284
+ J,
2199
2285
  {
2200
2286
  value: r.name,
2201
2287
  onChange: (o) => l("name", o.target.value),
2202
2288
  onBlur: a
2203
2289
  }
2204
2290
  ) }),
2205
- /* @__PURE__ */ e(b.Item, { label: "图片地址 (src)", children: /* @__PURE__ */ e(
2206
- B.TextArea,
2291
+ /* @__PURE__ */ e(v.Item, { label: "图片地址 (src)", children: /* @__PURE__ */ e(
2292
+ J.TextArea,
2207
2293
  {
2208
2294
  value: r.src,
2209
2295
  onChange: (o) => l("src", o.target.value),
@@ -2214,11 +2300,11 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
2214
2300
  ) })
2215
2301
  ] })
2216
2302
  ] });
2217
- }, { Option: kn } = ce, En = ({
2303
+ }, { Option: Dn } = me, Ln = ({
2218
2304
  material: n,
2219
- onSave: h
2305
+ onSave: f
2220
2306
  }) => {
2221
- const t = n.config || {}, [r, c] = j({
2307
+ const t = n.config || {}, [r, d] = q({
2222
2308
  lineWeight: t.lineWeight || t.thickness || 2,
2223
2309
  color: t.color || "#262626",
2224
2310
  lineType: t.lineType || "solid",
@@ -2227,8 +2313,8 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
2227
2313
  endX: t.endX ?? 100,
2228
2314
  endY: t.endY ?? 0
2229
2315
  });
2230
- ae(() => {
2231
- c({
2316
+ se(() => {
2317
+ d({
2232
2318
  lineWeight: t.lineWeight || t.thickness || 2,
2233
2319
  color: t.color || "#262626",
2234
2320
  lineType: t.lineType || "solid",
@@ -2239,18 +2325,18 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
2239
2325
  });
2240
2326
  }, [n.id]);
2241
2327
  const l = (o) => {
2242
- const p = { ...r, ...o };
2243
- c(p), h({
2328
+ const h = { ...r, ...o };
2329
+ d(h), f({
2244
2330
  config: {
2245
2331
  ...t,
2246
- thickness: p.lineWeight,
2247
- lineWeight: p.lineWeight,
2248
- color: p.color,
2249
- lineType: p.lineType,
2250
- startX: p.startX,
2251
- startY: p.startY,
2252
- endX: p.endX,
2253
- endY: p.endY
2332
+ thickness: h.lineWeight,
2333
+ lineWeight: h.lineWeight,
2334
+ color: h.color,
2335
+ lineType: h.lineType,
2336
+ startX: h.startX,
2337
+ startY: h.startY,
2338
+ endX: h.endX,
2339
+ endY: h.endY
2254
2340
  }
2255
2341
  });
2256
2342
  }, a = [
@@ -2261,22 +2347,22 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
2261
2347
  { value: "dot", label: "点线", desc: "密集点状" },
2262
2348
  { value: "dash-dot", label: "画点线", desc: "长划-点交替" }
2263
2349
  ];
2264
- return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
2265
- /* @__PURE__ */ e(he, { style: { marginTop: 0 }, children: "线条属性" }),
2266
- /* @__PURE__ */ d(b, { layout: "vertical", children: [
2267
- /* @__PURE__ */ e(b.Item, { label: "线型", help: "选择线条样式", children: /* @__PURE__ */ e(
2268
- ce,
2350
+ return /* @__PURE__ */ c("div", { className: "space-y-4", children: [
2351
+ /* @__PURE__ */ e(ye, { style: { marginTop: 0 }, children: "线条属性" }),
2352
+ /* @__PURE__ */ c(v, { layout: "vertical", children: [
2353
+ /* @__PURE__ */ e(v.Item, { label: "线型", help: "选择线条样式", children: /* @__PURE__ */ e(
2354
+ me,
2269
2355
  {
2270
2356
  value: r.lineType,
2271
2357
  onChange: (o) => l({ lineType: o }),
2272
- children: a.map((o) => /* @__PURE__ */ e(kn, { value: o.value, children: /* @__PURE__ */ d("div", { className: "flex flex-col", children: [
2358
+ children: a.map((o) => /* @__PURE__ */ e(Dn, { value: o.value, children: /* @__PURE__ */ c("div", { className: "flex flex-col", children: [
2273
2359
  /* @__PURE__ */ e("span", { children: o.label }),
2274
2360
  /* @__PURE__ */ e("span", { className: "text-xs text-gray-400", children: o.desc })
2275
2361
  ] }) }, o.value))
2276
2362
  }
2277
2363
  ) }),
2278
- /* @__PURE__ */ e(b.Item, { label: "线宽(像素)", children: /* @__PURE__ */ e(
2279
- U,
2364
+ /* @__PURE__ */ e(v.Item, { label: "线宽(像素)", children: /* @__PURE__ */ e(
2365
+ V,
2280
2366
  {
2281
2367
  value: r.lineWeight,
2282
2368
  onChange: (o) => l({ lineWeight: o || 2 }),
@@ -2285,16 +2371,16 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
2285
2371
  style: { width: 120 }
2286
2372
  }
2287
2373
  ) }),
2288
- /* @__PURE__ */ e(b.Item, { label: "颜色", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
2374
+ /* @__PURE__ */ e(v.Item, { label: "颜色", children: /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
2289
2375
  /* @__PURE__ */ e(
2290
- Ke,
2376
+ et,
2291
2377
  {
2292
2378
  value: r.color || "#d9d9d9",
2293
2379
  onChange: (o) => l({ color: o.toHexString() })
2294
2380
  }
2295
2381
  ),
2296
2382
  /* @__PURE__ */ e(
2297
- B,
2383
+ J,
2298
2384
  {
2299
2385
  value: r.color,
2300
2386
  onChange: (o) => l({ color: o.target.value }),
@@ -2304,35 +2390,35 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
2304
2390
  )
2305
2391
  ] }) })
2306
2392
  ] }),
2307
- /* @__PURE__ */ e(he, { children: "起止位置(相对节点)" }),
2308
- /* @__PURE__ */ d(b, { layout: "vertical", children: [
2309
- /* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-2", children: [
2310
- /* @__PURE__ */ e(b.Item, { label: "起点 X", className: "mb-2", children: /* @__PURE__ */ e(
2311
- U,
2393
+ /* @__PURE__ */ e(ye, { children: "起止位置(相对节点)" }),
2394
+ /* @__PURE__ */ c(v, { layout: "vertical", children: [
2395
+ /* @__PURE__ */ c("div", { className: "grid grid-cols-2 gap-2", children: [
2396
+ /* @__PURE__ */ e(v.Item, { label: "起点 X", className: "mb-2", children: /* @__PURE__ */ e(
2397
+ V,
2312
2398
  {
2313
2399
  value: r.startX,
2314
2400
  onChange: (o) => l({ startX: o ?? 0 }),
2315
2401
  style: { width: "100%" }
2316
2402
  }
2317
2403
  ) }),
2318
- /* @__PURE__ */ e(b.Item, { label: "起点 Y", className: "mb-2", children: /* @__PURE__ */ e(
2319
- U,
2404
+ /* @__PURE__ */ e(v.Item, { label: "起点 Y", className: "mb-2", children: /* @__PURE__ */ e(
2405
+ V,
2320
2406
  {
2321
2407
  value: r.startY,
2322
2408
  onChange: (o) => l({ startY: o ?? 0 }),
2323
2409
  style: { width: "100%" }
2324
2410
  }
2325
2411
  ) }),
2326
- /* @__PURE__ */ e(b.Item, { label: "终点 X", className: "mb-2", children: /* @__PURE__ */ e(
2327
- U,
2412
+ /* @__PURE__ */ e(v.Item, { label: "终点 X", className: "mb-2", children: /* @__PURE__ */ e(
2413
+ V,
2328
2414
  {
2329
2415
  value: r.endX,
2330
2416
  onChange: (o) => l({ endX: o ?? 100 }),
2331
2417
  style: { width: "100%" }
2332
2418
  }
2333
2419
  ) }),
2334
- /* @__PURE__ */ e(b.Item, { label: "终点 Y", className: "mb-2", children: /* @__PURE__ */ e(
2335
- U,
2420
+ /* @__PURE__ */ e(v.Item, { label: "终点 Y", className: "mb-2", children: /* @__PURE__ */ e(
2421
+ V,
2336
2422
  {
2337
2423
  value: r.endY,
2338
2424
  onChange: (o) => l({ endY: o ?? 0 }),
@@ -2340,39 +2426,42 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
2340
2426
  }
2341
2427
  ) })
2342
2428
  ] }),
2343
- /* @__PURE__ */ e(b.Item, { label: "快速对齐", className: "mt-4", children: /* @__PURE__ */ d(ee, { children: [
2429
+ /* @__PURE__ */ e(v.Item, { label: "快速对齐", className: "mt-4", children: /* @__PURE__ */ c(ae, { children: [
2344
2430
  /* @__PURE__ */ e(
2345
- Y,
2431
+ j,
2346
2432
  {
2347
2433
  size: "small",
2348
2434
  onClick: () => {
2349
- l({ endY: r.startY });
2435
+ const o = t.startY ?? r.startY;
2436
+ l({ endY: o });
2350
2437
  },
2351
2438
  title: "将线条变为水平线",
2352
2439
  children: "水平"
2353
2440
  }
2354
2441
  ),
2355
2442
  /* @__PURE__ */ e(
2356
- Y,
2443
+ j,
2357
2444
  {
2358
2445
  size: "small",
2359
2446
  onClick: () => {
2360
- l({ endX: r.startX });
2447
+ const o = t.startX ?? r.startX;
2448
+ l({ endX: o });
2361
2449
  },
2362
2450
  title: "将线条变为垂直线",
2363
2451
  children: "垂直"
2364
2452
  }
2365
2453
  ),
2366
2454
  /* @__PURE__ */ e(
2367
- Y,
2455
+ j,
2368
2456
  {
2369
2457
  size: "small",
2370
2458
  onClick: () => {
2459
+ const o = t.startX ?? r.startX, h = t.startY ?? r.startY, p = t.endX ?? r.endX, u = t.endY ?? r.endY;
2371
2460
  l({
2372
- startX: r.endX,
2373
- startY: r.endY,
2374
- endX: r.startX,
2375
- endY: r.startY
2461
+ startX: p,
2462
+ startY: u,
2463
+ endX: o,
2464
+ endY: h
2376
2465
  });
2377
2466
  },
2378
2467
  title: "交换起点和终点",
@@ -2382,223 +2471,223 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
2382
2471
  ] }) })
2383
2472
  ] })
2384
2473
  ] });
2385
- }, Et = ({
2474
+ }, Pt = ({
2386
2475
  material: n,
2387
- onSave: h,
2476
+ onSave: f,
2388
2477
  bindCodes: t,
2389
2478
  dataOptions: r
2390
2479
  }) => {
2391
2480
  switch (n.type) {
2392
2481
  case "TEXT":
2393
2482
  return /* @__PURE__ */ e(
2394
- Nn,
2483
+ En,
2395
2484
  {
2396
2485
  material: n,
2397
- onSave: h,
2486
+ onSave: f,
2398
2487
  bindCodes: t,
2399
2488
  dataOptions: r
2400
2489
  }
2401
2490
  );
2402
2491
  case "IMAGE":
2403
- return /* @__PURE__ */ e(In, { material: n, onSave: h });
2492
+ return /* @__PURE__ */ e(Mn, { material: n, onSave: f });
2404
2493
  case "LINE":
2405
- return /* @__PURE__ */ e(En, { material: n, onSave: h });
2494
+ return /* @__PURE__ */ e(Ln, { material: n, onSave: f });
2406
2495
  default:
2407
2496
  return /* @__PURE__ */ e("div", { className: "text-center text-gray-400 py-8", children: "暂不支持编辑此类型的物料" });
2408
2497
  }
2409
- }, { Panel: ft } = se, { TextArea: Dn } = B, Mn = ({
2498
+ }, { Panel: yt } = he, { TextArea: Pn } = J, Tn = ({
2410
2499
  node: n,
2411
- updateNode: h,
2500
+ updateNode: f,
2412
2501
  materials: t
2413
2502
  }) => {
2414
- const r = t.filter((u) => u.type !== "CUSTOM" || !u.config?.nodes), c = (u, w) => {
2503
+ const r = t.filter((u) => u.type !== "CUSTOM" || !u.config?.nodes), d = (u, b) => {
2415
2504
  const s = n.children?.map((x) => x.id === u ? {
2416
2505
  ...x,
2417
2506
  contentInfo: {
2418
2507
  ...x.contentInfo,
2419
- statusList: w
2508
+ statusList: b
2420
2509
  }
2421
2510
  } : x);
2422
- h(n.id, {
2511
+ f(n.id, {
2423
2512
  children: s
2424
2513
  });
2425
2514
  }, l = (u) => {
2426
- const w = n.children?.find((x) => x.id === u);
2427
- if (!w) return;
2515
+ const b = n.children?.find((x) => x.id === u);
2516
+ if (!b) return;
2428
2517
  const s = {
2429
- id: $(),
2430
- name: `状态${w.contentInfo.statusList.length + 1}`,
2431
- expression: w.contentInfo.statusList.length === 0 ? "return true;" : "return false;",
2432
- material: { ...r[0], id: $() },
2518
+ id: z(),
2519
+ name: `状态${b.contentInfo.statusList.length + 1}`,
2520
+ expression: b.contentInfo.statusList.length === 0 ? "return true;" : "return false;",
2521
+ material: { ...r[0], id: z() },
2433
2522
  bindCodes: []
2434
2523
  };
2435
- c(u, [...w.contentInfo.statusList, s]);
2436
- }, a = (u, w) => {
2437
- const s = n.children?.find((g) => g.id === u);
2524
+ d(u, [...b.contentInfo.statusList, s]);
2525
+ }, a = (u, b) => {
2526
+ const s = n.children?.find((y) => y.id === u);
2438
2527
  if (!s) return;
2439
- const x = s.contentInfo.statusList.filter((g) => g.id !== w);
2440
- c(u, x);
2441
- }, o = (u, w, s) => {
2442
- const x = n.children?.find((C) => C.id === u);
2528
+ const x = s.contentInfo.statusList.filter((y) => y.id !== b);
2529
+ d(u, x);
2530
+ }, o = (u, b, s) => {
2531
+ const x = n.children?.find((E) => E.id === u);
2443
2532
  if (!x) return;
2444
- const g = x.contentInfo.statusList.map((C) => C.id === w ? { ...C, ...s } : C);
2445
- c(u, g);
2446
- }, p = (u, w, s) => {
2533
+ const y = x.contentInfo.statusList.map((E) => E.id === b ? { ...E, ...s } : E);
2534
+ d(u, y);
2535
+ }, h = (u, b, s) => {
2447
2536
  const x = n.children?.find((m) => m.id === u);
2448
2537
  if (!x) return;
2449
- const g = x.contentInfo.statusList.findIndex((m) => m.id === w);
2450
- if (g === -1) return;
2451
- const C = [...x.contentInfo.statusList];
2452
- s === "up" && g > 0 ? [C[g], C[g - 1]] = [C[g - 1], C[g]] : s === "down" && g < C.length - 1 && ([C[g], C[g + 1]] = [C[g + 1], C[g]]), c(u, C);
2453
- }, f = (u, w, s) => {
2454
- const x = t.find((g) => g.id === s);
2455
- x && o(u, w, {
2456
- material: { ...x, id: $() }
2538
+ const y = x.contentInfo.statusList.findIndex((m) => m.id === b);
2539
+ if (y === -1) return;
2540
+ const E = [...x.contentInfo.statusList];
2541
+ s === "up" && y > 0 ? [E[y], E[y - 1]] = [E[y - 1], E[y]] : s === "down" && y < E.length - 1 && ([E[y], E[y + 1]] = [E[y + 1], E[y]]), d(u, E);
2542
+ }, p = (u, b, s) => {
2543
+ const x = t.find((y) => y.id === s);
2544
+ x && o(u, b, {
2545
+ material: { ...x, id: z() }
2457
2546
  });
2458
2547
  };
2459
- return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
2460
- /* @__PURE__ */ e("div", { className: "p-3 bg-blue-50 border border-blue-200 rounded-lg mb-4", children: /* @__PURE__ */ d("div", { className: "text-sm text-blue-700", children: [
2548
+ return /* @__PURE__ */ c("div", { className: "space-y-4", children: [
2549
+ /* @__PURE__ */ e("div", { className: "p-3 bg-blue-50 border border-blue-200 rounded-lg mb-4", children: /* @__PURE__ */ c("div", { className: "text-sm text-blue-700", children: [
2461
2550
  /* @__PURE__ */ e("strong", { children: "群组节点" }),
2462
2551
  ":为每个子节点配置多个状态和绑定"
2463
2552
  ] }) }),
2464
- /* @__PURE__ */ e(se, { ghost: !0, children: n.children?.map((u, w) => /* @__PURE__ */ e(
2465
- ft,
2553
+ /* @__PURE__ */ e(he, { ghost: !0, children: n.children?.map((u, b) => /* @__PURE__ */ e(
2554
+ yt,
2466
2555
  {
2467
- header: /* @__PURE__ */ d("div", { className: "flex items-center justify-between w-full pr-4", children: [
2468
- /* @__PURE__ */ d("span", { className: "font-medium text-sm", children: [
2556
+ header: /* @__PURE__ */ c("div", { className: "flex items-center justify-between w-full pr-4", children: [
2557
+ /* @__PURE__ */ c("span", { className: "font-medium text-sm", children: [
2469
2558
  "子节点 ",
2470
- w + 1
2559
+ b + 1
2471
2560
  ] }),
2472
- /* @__PURE__ */ d(Q, { color: "blue", style: { fontSize: "12px", padding: "0 4px" }, children: [
2561
+ /* @__PURE__ */ c(le, { color: "blue", style: { fontSize: "12px", padding: "0 4px" }, children: [
2473
2562
  u.contentInfo.statusList.length,
2474
2563
  " 个状态"
2475
2564
  ] })
2476
2565
  ] }),
2477
- children: /* @__PURE__ */ d("div", { className: "space-y-3", children: [
2478
- /* @__PURE__ */ d("div", { className: "flex justify-between items-center mb-3", children: [
2566
+ children: /* @__PURE__ */ c("div", { className: "space-y-3", children: [
2567
+ /* @__PURE__ */ c("div", { className: "flex justify-between items-center mb-3", children: [
2479
2568
  /* @__PURE__ */ e("span", { className: "text-sm text-gray-600", children: "状态列表" }),
2480
2569
  /* @__PURE__ */ e(
2481
- Y,
2570
+ j,
2482
2571
  {
2483
2572
  type: "primary",
2484
2573
  size: "small",
2485
- icon: /* @__PURE__ */ e(xt, {}),
2574
+ icon: /* @__PURE__ */ e(Nt, {}),
2486
2575
  onClick: () => l(u.id),
2487
2576
  children: "添加状态"
2488
2577
  }
2489
2578
  )
2490
2579
  ] }),
2491
- u.contentInfo.statusList.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center text-gray-400 py-4 bg-gray-50 rounded-lg", children: "暂无状态,点击上方按钮添加" }) : /* @__PURE__ */ e(se, { ghost: !0, children: u.contentInfo.statusList.map((s, x) => /* @__PURE__ */ e(
2492
- ft,
2580
+ u.contentInfo.statusList.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center text-gray-400 py-4 bg-gray-50 rounded-lg", children: "暂无状态,点击上方按钮添加" }) : /* @__PURE__ */ e(he, { ghost: !0, children: u.contentInfo.statusList.map((s, x) => /* @__PURE__ */ e(
2581
+ yt,
2493
2582
  {
2494
- header: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
2583
+ header: /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
2495
2584
  /* @__PURE__ */ e("span", { className: "text-xs text-gray-400 w-5", children: x + 1 }),
2496
2585
  /* @__PURE__ */ e("span", { className: "font-medium", children: s.name }),
2497
- /* @__PURE__ */ e(Q, { color: "default", className: "text-xs", children: s.material.type })
2586
+ /* @__PURE__ */ e(le, { color: "default", className: "text-xs", children: s.material.type })
2498
2587
  ] }),
2499
- extra: /* @__PURE__ */ d(ee, { size: "small", onClick: (g) => g.stopPropagation(), children: [
2588
+ extra: /* @__PURE__ */ c(ae, { size: "small", onClick: (y) => y.stopPropagation(), children: [
2500
2589
  /* @__PURE__ */ e(
2501
- Y,
2590
+ j,
2502
2591
  {
2503
2592
  type: "text",
2504
2593
  size: "small",
2505
- icon: /* @__PURE__ */ e(wt, {}),
2594
+ icon: /* @__PURE__ */ e(It, {}),
2506
2595
  disabled: x === 0,
2507
- onClick: (g) => {
2508
- g.stopPropagation(), p(u.id, s.id, "up");
2596
+ onClick: (y) => {
2597
+ y.stopPropagation(), h(u.id, s.id, "up");
2509
2598
  }
2510
2599
  }
2511
2600
  ),
2512
2601
  /* @__PURE__ */ e(
2513
- Y,
2602
+ j,
2514
2603
  {
2515
2604
  type: "text",
2516
2605
  size: "small",
2517
- icon: /* @__PURE__ */ e(St, {}),
2606
+ icon: /* @__PURE__ */ e(kt, {}),
2518
2607
  disabled: x === u.contentInfo.statusList.length - 1,
2519
- onClick: (g) => {
2520
- g.stopPropagation(), p(u.id, s.id, "down");
2608
+ onClick: (y) => {
2609
+ y.stopPropagation(), h(u.id, s.id, "down");
2521
2610
  }
2522
2611
  }
2523
2612
  ),
2524
2613
  /* @__PURE__ */ e(
2525
- Y,
2614
+ j,
2526
2615
  {
2527
2616
  type: "text",
2528
2617
  size: "small",
2529
2618
  danger: !0,
2530
- icon: /* @__PURE__ */ e(Ue, {}),
2531
- onClick: (g) => {
2532
- g.stopPropagation(), a(u.id, s.id);
2619
+ icon: /* @__PURE__ */ e(qe, {}),
2620
+ onClick: (y) => {
2621
+ y.stopPropagation(), a(u.id, s.id);
2533
2622
  }
2534
2623
  }
2535
2624
  )
2536
2625
  ] }),
2537
- children: /* @__PURE__ */ d(b, { layout: "vertical", children: [
2538
- /* @__PURE__ */ e(b.Item, { label: "状态名称", children: /* @__PURE__ */ e(
2539
- B,
2626
+ children: /* @__PURE__ */ c(v, { layout: "vertical", children: [
2627
+ /* @__PURE__ */ e(v.Item, { label: "状态名称", children: /* @__PURE__ */ e(
2628
+ J,
2540
2629
  {
2541
2630
  value: s.name,
2542
- onChange: (g) => o(u.id, s.id, { name: g.target.value }),
2631
+ onChange: (y) => o(u.id, s.id, { name: y.target.value }),
2543
2632
  placeholder: "输入状态名称"
2544
2633
  }
2545
2634
  ) }),
2546
2635
  /* @__PURE__ */ e(
2547
- b.Item,
2636
+ v.Item,
2548
2637
  {
2549
2638
  label: "执行表达式",
2550
2639
  help: "返回 true 时激活此状态,可使用 data 变量访问绑定数据",
2551
2640
  children: /* @__PURE__ */ e(
2552
- Dn,
2641
+ Pn,
2553
2642
  {
2554
2643
  value: s.expression,
2555
- onChange: (g) => o(u.id, s.id, { expression: g.target.value }),
2644
+ onChange: (y) => o(u.id, s.id, { expression: y.target.value }),
2556
2645
  rows: 3,
2557
2646
  placeholder: "return true;"
2558
2647
  }
2559
2648
  )
2560
2649
  }
2561
2650
  ),
2562
- /* @__PURE__ */ e(b.Item, { label: "绑定数据源 (bindCodes)", children: /* @__PURE__ */ e(
2563
- ce,
2651
+ /* @__PURE__ */ e(v.Item, { label: "绑定数据源 (bindCodes)", children: /* @__PURE__ */ e(
2652
+ me,
2564
2653
  {
2565
2654
  mode: "tags",
2566
2655
  value: s.bindCodes || [],
2567
- onChange: (g) => o(u.id, s.id, { bindCodes: g }),
2656
+ onChange: (y) => o(u.id, s.id, { bindCodes: y }),
2568
2657
  placeholder: "输入数据源 code",
2569
2658
  tokenSeparators: [",", " "]
2570
2659
  }
2571
2660
  ) }),
2572
- /* @__PURE__ */ e(b.Item, { label: "更换物料", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
2573
- /* @__PURE__ */ e(Q, { color: "blue", children: s.material.name }),
2574
- /* @__PURE__ */ e(Q, { color: "default", children: s.material.type }),
2661
+ /* @__PURE__ */ e(v.Item, { label: "更换物料", children: /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
2662
+ /* @__PURE__ */ e(le, { color: "blue", children: s.material.name }),
2663
+ /* @__PURE__ */ e(le, { color: "default", children: s.material.type }),
2575
2664
  /* @__PURE__ */ e(
2576
- ce,
2665
+ me,
2577
2666
  {
2578
2667
  placeholder: "选择新物料",
2579
2668
  style: { width: 150 },
2580
2669
  value: void 0,
2581
- onChange: (g) => g && f(u.id, s.id, g),
2582
- options: r.map((g) => ({
2583
- value: g.id,
2584
- label: `${g.name} (${g.type})`
2670
+ onChange: (y) => y && p(u.id, s.id, y),
2671
+ options: r.map((y) => ({
2672
+ value: y.id,
2673
+ label: `${y.name} (${y.type})`
2585
2674
  }))
2586
2675
  }
2587
2676
  )
2588
2677
  ] }) }),
2589
- /* @__PURE__ */ e(he, { style: { margin: "12px 0" } }),
2590
- /* @__PURE__ */ d("div", { className: "bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
2591
- /* @__PURE__ */ d("div", { className: "flex items-center justify-between mb-2", children: [
2678
+ /* @__PURE__ */ e(ye, { style: { margin: "12px 0" } }),
2679
+ /* @__PURE__ */ c("div", { className: "bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
2680
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-2", children: [
2592
2681
  /* @__PURE__ */ e("span", { className: "text-sm font-medium", children: "物料属性" }),
2593
- /* @__PURE__ */ e(Q, { children: s.material.name })
2682
+ /* @__PURE__ */ e(le, { children: s.material.name })
2594
2683
  ] }),
2595
2684
  /* @__PURE__ */ e(
2596
- Et,
2685
+ Pt,
2597
2686
  {
2598
2687
  material: s.material,
2599
- onSave: (g) => {
2600
- const C = { ...s.material, ...g };
2601
- o(u.id, s.id, { material: C });
2688
+ onSave: (y) => {
2689
+ const E = { ...s.material, ...y };
2690
+ o(u.id, s.id, { material: E });
2602
2691
  }
2603
2692
  }
2604
2693
  )
@@ -2612,23 +2701,23 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
2612
2701
  u.id
2613
2702
  )) })
2614
2703
  ] });
2615
- }, { Panel: de } = se, { TabPane: Ze } = yt, { TextArea: Ln } = B, Pn = ({
2704
+ }, { Panel: ge } = he, { TabPane: Ke } = St, { TextArea: $n } = J, _n = ({
2616
2705
  defaultTestData: n
2617
2706
  }) => {
2618
2707
  const {
2619
- nodes: h,
2708
+ nodes: f,
2620
2709
  selectedNodeId: t,
2621
2710
  updateNode: r,
2622
- updateNodeStyle: c,
2711
+ updateNodeStyle: d,
2623
2712
  updateNodeControl: l,
2624
2713
  updateNodeContent: a,
2625
2714
  materials: o,
2626
- selectedStatusId: p,
2627
- selectStatus: f
2628
- } = xe(), [u] = b.useForm(), [w, s] = j("basic"), [x, g] = j(!1), [C, m] = j(null), [_, P] = j({}), D = oe.useMemo(() => h.find((i) => i.id === t), [h, t]), E = D?.contentInfo.statusList || [], O = (i) => {
2629
- t && (i.normalStyle && c(t, i.normalStyle), i.name !== void 0 && r(t, { name: i.name }), i.controlInfo && l(t, i.controlInfo));
2715
+ selectedStatusId: h,
2716
+ selectStatus: p
2717
+ } = Ie(), [u] = v.useForm(), [b, s] = q("basic"), [x, y] = q(!1), [E, m] = q(null), [A, Y] = q({}), D = de.useMemo(() => f.find((i) => i.id === t), [f, t]), L = D?.contentInfo.statusList || [], O = (i) => {
2718
+ t && (i.normalStyle && d(t, i.normalStyle), i.name !== void 0 && r(t, { name: i.name }), i.controlInfo && l(t, i.controlInfo));
2630
2719
  };
2631
- ae(() => {
2720
+ se(() => {
2632
2721
  D && (u.setFieldsValue({
2633
2722
  name: D.name,
2634
2723
  normalStyle: {
@@ -2649,222 +2738,222 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
2649
2738
  isSelectable: !0,
2650
2739
  ...D.controlInfo
2651
2740
  }
2652
- }), f(null));
2653
- }, [D?.id, u, f]);
2654
- const V = () => {
2655
- !t || !D || (m("new"), g(!0));
2741
+ }), p(null));
2742
+ }, [D?.id, u, p]);
2743
+ const ie = () => {
2744
+ !t || !D || (m("new"), y(!0));
2656
2745
  }, H = (i) => {
2657
2746
  if (!t || !D) return;
2658
- const T = {
2659
- id: $(),
2660
- name: `${i.name}_状态${E.length + 1}`,
2661
- expression: E.length === 0 ? "return true;" : "return false;",
2662
- material: { ...i, id: $() },
2747
+ const k = {
2748
+ id: z(),
2749
+ name: `${i.name}_状态${L.length + 1}`,
2750
+ expression: L.length === 0 ? "return true;" : "return false;",
2751
+ material: { ...i, id: z() },
2663
2752
  bindCodes: []
2664
2753
  };
2665
- if (C === "new") {
2666
- const v = [...E, T];
2667
- a(t, { statusList: v });
2668
- } else if (C) {
2669
- const v = E.map((k) => k.id === C ? { ...k, material: { ...i, id: $() } } : k);
2670
- a(t, { statusList: v });
2754
+ if (E === "new") {
2755
+ const S = [...L, k];
2756
+ a(t, { statusList: S });
2757
+ } else if (E) {
2758
+ const S = L.map((w) => w.id === E ? { ...w, material: { ...i, id: z() } } : w);
2759
+ a(t, { statusList: S });
2671
2760
  }
2672
- g(!1), m(null);
2673
- }, F = (i) => {
2761
+ y(!1), m(null);
2762
+ }, Q = (i) => {
2674
2763
  if (!t || !D) return;
2675
- const T = D.contentInfo.statusList?.filter((v) => v.id !== i) || [];
2676
- a(t, { statusList: T }), p === i && f(null);
2677
- }, W = (i, T) => {
2764
+ const k = D.contentInfo.statusList?.filter((S) => S.id !== i) || [];
2765
+ a(t, { statusList: k }), h === i && p(null);
2766
+ }, F = (i, k) => {
2678
2767
  if (!t || !D) return;
2679
- const v = D.contentInfo.statusList?.map((k) => k.id === i ? { ...k, ...T } : k) || [];
2680
- a(t, { statusList: v });
2681
- }, S = (i) => {
2768
+ const S = D.contentInfo.statusList?.map((w) => w.id === i ? { ...w, ...k } : w) || [];
2769
+ a(t, { statusList: S });
2770
+ }, P = (i) => {
2682
2771
  if (!t || !D) return;
2683
- const T = {
2772
+ const k = {
2684
2773
  ...i,
2685
- id: $(),
2774
+ id: z(),
2686
2775
  name: `${i.name}_复制`,
2687
2776
  expression: "return false;"
2688
- }, v = [...E, T];
2689
- a(t, { statusList: v });
2690
- }, A = (i, T) => {
2777
+ }, S = [...L, k];
2778
+ a(t, { statusList: S });
2779
+ }, T = (i, k) => {
2691
2780
  if (!t || !D) return;
2692
- const v = E.findIndex((L) => L.id === i);
2693
- if (v === -1) return;
2694
- const k = [...E];
2695
- T === "up" && v > 0 ? [k[v], k[v - 1]] = [
2696
- k[v - 1],
2697
- k[v]
2698
- ] : T === "down" && v < k.length - 1 && ([k[v], k[v + 1]] = [
2699
- k[v + 1],
2700
- k[v]
2701
- ]), a(t, { statusList: k });
2702
- }, R = (i) => {
2703
- m(i), g(!0);
2704
- }, q = (i, T) => {
2781
+ const S = L.findIndex((M) => M.id === i);
2782
+ if (S === -1) return;
2783
+ const w = [...L];
2784
+ k === "up" && S > 0 ? [w[S], w[S - 1]] = [
2785
+ w[S - 1],
2786
+ w[S]
2787
+ ] : k === "down" && S < w.length - 1 && ([w[S], w[S + 1]] = [
2788
+ w[S + 1],
2789
+ w[S]
2790
+ ]), a(t, { statusList: w });
2791
+ }, B = (i) => {
2792
+ m(i), y(!0);
2793
+ }, R = (i, k) => {
2705
2794
  if (!t || !D) return;
2706
- const v = E.map((k) => k.id === i ? {
2707
- ...k,
2708
- material: { ...k.material, ...T }
2709
- } : k);
2710
- a(t, { statusList: v });
2795
+ const S = L.map((w) => w.id === i ? {
2796
+ ...w,
2797
+ material: { ...w.material, ...k }
2798
+ } : w);
2799
+ a(t, { statusList: S });
2711
2800
  };
2712
- return D ? /* @__PURE__ */ d("div", { className: "h-full flex flex-col bg-white border-l border-gray-200", children: [
2713
- /* @__PURE__ */ d("div", { className: "p-4 border-b border-gray-200", children: [
2801
+ return D ? /* @__PURE__ */ c("div", { className: "h-full flex flex-col bg-white border-l border-gray-200", children: [
2802
+ /* @__PURE__ */ c("div", { className: "p-4 border-b border-gray-200", children: [
2714
2803
  /* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-gray-800", children: "属性面板" }),
2715
2804
  /* @__PURE__ */ e("p", { className: "text-sm text-gray-500", children: "编辑选中节点的属性" })
2716
2805
  ] }),
2717
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4", children: /* @__PURE__ */ d(yt, { activeKey: w, onChange: s, children: [
2718
- /* @__PURE__ */ e(Ze, { tab: "基础", children: /* @__PURE__ */ d(
2719
- b,
2806
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4", children: /* @__PURE__ */ c(St, { activeKey: b, onChange: s, children: [
2807
+ /* @__PURE__ */ e(Ke, { tab: "基础", children: /* @__PURE__ */ c(
2808
+ v,
2720
2809
  {
2721
2810
  form: u,
2722
2811
  layout: "vertical",
2723
2812
  onValuesChange: O,
2724
2813
  initialValues: { name: D.name },
2725
2814
  children: [
2726
- /* @__PURE__ */ e(b.Item, { label: "节点名称", name: "name", children: /* @__PURE__ */ e(B, { placeholder: "输入节点名称" }) }),
2727
- /* @__PURE__ */ d(se, { ghost: !0, defaultActiveKey: ["position", "size", "style"], children: [
2728
- /* @__PURE__ */ e(de, { header: "位置", children: /* @__PURE__ */ d(ee, { children: [
2729
- /* @__PURE__ */ e(b.Item, { label: "X", name: ["normalStyle", "x"], children: /* @__PURE__ */ e(U, {}) }),
2730
- /* @__PURE__ */ e(b.Item, { label: "Y", name: ["normalStyle", "y"], children: /* @__PURE__ */ e(U, {}) })
2815
+ /* @__PURE__ */ e(v.Item, { label: "节点名称", name: "name", children: /* @__PURE__ */ e(J, { placeholder: "输入节点名称" }) }),
2816
+ /* @__PURE__ */ c(he, { ghost: !0, defaultActiveKey: ["position", "size", "style"], children: [
2817
+ /* @__PURE__ */ e(ge, { header: "位置", children: /* @__PURE__ */ c(ae, { children: [
2818
+ /* @__PURE__ */ e(v.Item, { label: "X", name: ["normalStyle", "x"], children: /* @__PURE__ */ e(V, {}) }),
2819
+ /* @__PURE__ */ e(v.Item, { label: "Y", name: ["normalStyle", "y"], children: /* @__PURE__ */ e(V, {}) })
2731
2820
  ] }) }, "position"),
2732
- /* @__PURE__ */ e(de, { header: "尺寸", children: /* @__PURE__ */ d(ee, { children: [
2733
- /* @__PURE__ */ e(b.Item, { label: "宽度", name: ["normalStyle", "width"], children: /* @__PURE__ */ e(U, { min: 10 }) }),
2734
- /* @__PURE__ */ e(b.Item, { label: "高度", name: ["normalStyle", "height"], children: /* @__PURE__ */ e(U, { min: 10 }) })
2821
+ /* @__PURE__ */ e(ge, { header: "尺寸", children: /* @__PURE__ */ c(ae, { children: [
2822
+ /* @__PURE__ */ e(v.Item, { label: "宽度", name: ["normalStyle", "width"], children: /* @__PURE__ */ e(V, { min: 10 }) }),
2823
+ /* @__PURE__ */ e(v.Item, { label: "高度", name: ["normalStyle", "height"], children: /* @__PURE__ */ e(V, { min: 10 }) })
2735
2824
  ] }) }, "size"),
2736
- /* @__PURE__ */ d(de, { header: "样式", children: [
2737
- /* @__PURE__ */ e(b.Item, { label: "背景色", name: ["normalStyle", "background"], children: /* @__PURE__ */ e(B, { placeholder: "transparent, #fff, url(...)" }) }),
2738
- /* @__PURE__ */ e(b.Item, { label: "内边距", name: ["normalStyle", "padding"], children: /* @__PURE__ */ e(U, { min: 0 }) }),
2739
- /* @__PURE__ */ e(b.Item, { label: "圆角", name: ["normalStyle", "borderRadius"], children: /* @__PURE__ */ e(U, { min: 0 }) }),
2825
+ /* @__PURE__ */ c(ge, { header: "样式", children: [
2826
+ /* @__PURE__ */ e(v.Item, { label: "背景色", name: ["normalStyle", "background"], children: /* @__PURE__ */ e(J, { placeholder: "transparent, #fff, url(...)" }) }),
2827
+ /* @__PURE__ */ e(v.Item, { label: "内边距", name: ["normalStyle", "padding"], children: /* @__PURE__ */ e(V, { min: 0 }) }),
2828
+ /* @__PURE__ */ e(v.Item, { label: "圆角", name: ["normalStyle", "borderRadius"], children: /* @__PURE__ */ e(V, { min: 0 }) }),
2740
2829
  /* @__PURE__ */ e(
2741
- b.Item,
2830
+ v.Item,
2742
2831
  {
2743
2832
  label: "缩放比例",
2744
2833
  name: ["normalStyle", "scale"],
2745
2834
  help: "等比缩放节点的宽高",
2746
- children: /* @__PURE__ */ e(U, { min: 0.1, max: 5, step: 0.1 })
2835
+ children: /* @__PURE__ */ e(V, { min: 0.1, max: 5, step: 0.1 })
2747
2836
  }
2748
2837
  ),
2749
- /* @__PURE__ */ e(b.Item, { label: "透明度", name: ["normalStyle", "opacity"], children: /* @__PURE__ */ e(U, { min: 0, max: 1, step: 0.1 }) }),
2750
- /* @__PURE__ */ e(b.Item, { label: "层级", name: ["normalStyle", "zIndex"], children: /* @__PURE__ */ e(U, {}) })
2838
+ /* @__PURE__ */ e(v.Item, { label: "透明度", name: ["normalStyle", "opacity"], children: /* @__PURE__ */ e(V, { min: 0, max: 1, step: 0.1 }) }),
2839
+ /* @__PURE__ */ e(v.Item, { label: "层级", name: ["normalStyle", "zIndex"], children: /* @__PURE__ */ e(V, {}) })
2751
2840
  ] }, "style")
2752
2841
  ] })
2753
2842
  ]
2754
2843
  }
2755
2844
  ) }, "basic"),
2756
- /* @__PURE__ */ e(Ze, { tab: "状态", children: D.type === "group" && D.children ? /* @__PURE__ */ e(
2757
- Mn,
2845
+ /* @__PURE__ */ e(Ke, { tab: "状态", children: D.type === "group" && D.children ? /* @__PURE__ */ e(
2846
+ Tn,
2758
2847
  {
2759
2848
  node: D,
2760
2849
  updateNode: r,
2761
2850
  materials: o
2762
2851
  }
2763
- ) : /* @__PURE__ */ d("div", { className: "mb-4", children: [
2764
- /* @__PURE__ */ d("div", { className: "flex items-center justify-between mb-2", children: [
2765
- /* @__PURE__ */ d("span", { className: "font-medium", children: [
2852
+ ) : /* @__PURE__ */ c("div", { className: "mb-4", children: [
2853
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-2", children: [
2854
+ /* @__PURE__ */ c("span", { className: "font-medium", children: [
2766
2855
  "状态列表",
2767
- /* @__PURE__ */ e(Q, { color: "blue", className: "ml-2", children: E.length })
2856
+ /* @__PURE__ */ e(le, { color: "blue", className: "ml-2", children: L.length })
2768
2857
  ] }),
2769
2858
  /* @__PURE__ */ e(
2770
- Y,
2859
+ j,
2771
2860
  {
2772
2861
  type: "primary",
2773
2862
  size: "small",
2774
- icon: /* @__PURE__ */ e(xt, {}),
2775
- onClick: V,
2863
+ icon: /* @__PURE__ */ e(Nt, {}),
2864
+ onClick: ie,
2776
2865
  children: "添加状态"
2777
2866
  }
2778
2867
  )
2779
2868
  ] }),
2780
2869
  /* @__PURE__ */ e("p", { className: "text-xs text-gray-500 mb-3", children: "节点根据状态表达式计算结果显示对应物料,第一个返回 true 的状态为当前状态" }),
2781
- E.length > 0 && /* @__PURE__ */ e("div", { className: "mb-4 p-3 bg-blue-50 border border-blue-200 rounded-lg", children: /* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ d("div", { children: [
2870
+ L.length > 0 && /* @__PURE__ */ e("div", { className: "mb-4 p-3 bg-blue-50 border border-blue-200 rounded-lg", children: /* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ c("div", { children: [
2782
2871
  /* @__PURE__ */ e("span", { className: "text-sm text-gray-600", children: "当前状态:" }),
2783
2872
  /* @__PURE__ */ e("span", { className: "ml-2 text-sm font-medium text-blue-600", children: "由表达式自动计算" })
2784
2873
  ] }) }) }),
2785
- E.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center text-gray-400 py-4 bg-gray-50 rounded-lg", children: "暂无状态,点击上方按钮添加" }) : /* @__PURE__ */ e(se, { ghost: !0, children: E.map((i, T) => /* @__PURE__ */ e(
2786
- de,
2874
+ L.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center text-gray-400 py-4 bg-gray-50 rounded-lg", children: "暂无状态,点击上方按钮添加" }) : /* @__PURE__ */ e(he, { ghost: !0, children: L.map((i, k) => /* @__PURE__ */ e(
2875
+ ge,
2787
2876
  {
2788
- header: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
2789
- /* @__PURE__ */ e("span", { className: "text-xs text-gray-400 w-5", children: T + 1 }),
2877
+ header: /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
2878
+ /* @__PURE__ */ e("span", { className: "text-xs text-gray-400 w-5", children: k + 1 }),
2790
2879
  /* @__PURE__ */ e("span", { className: "font-medium", children: i.name }),
2791
- /* @__PURE__ */ e(Q, { color: "default", className: "text-xs", children: i.material.type })
2880
+ /* @__PURE__ */ e(le, { color: "default", className: "text-xs", children: i.material.type })
2792
2881
  ] }),
2793
- extra: /* @__PURE__ */ d(ee, { size: "small", onClick: (v) => v.stopPropagation(), children: [
2882
+ extra: /* @__PURE__ */ c(ae, { size: "small", onClick: (S) => S.stopPropagation(), children: [
2794
2883
  /* @__PURE__ */ e(
2795
- Y,
2884
+ j,
2796
2885
  {
2797
2886
  type: "text",
2798
2887
  size: "small",
2799
- icon: /* @__PURE__ */ e(wt, {}),
2800
- disabled: T === 0,
2801
- onClick: (v) => {
2802
- v.stopPropagation(), A(i.id, "up");
2888
+ icon: /* @__PURE__ */ e(It, {}),
2889
+ disabled: k === 0,
2890
+ onClick: (S) => {
2891
+ S.stopPropagation(), T(i.id, "up");
2803
2892
  }
2804
2893
  }
2805
2894
  ),
2806
2895
  /* @__PURE__ */ e(
2807
- Y,
2896
+ j,
2808
2897
  {
2809
2898
  type: "text",
2810
2899
  size: "small",
2811
- icon: /* @__PURE__ */ e(St, {}),
2812
- disabled: T === E.length - 1,
2813
- onClick: (v) => {
2814
- v.stopPropagation(), A(i.id, "down");
2900
+ icon: /* @__PURE__ */ e(kt, {}),
2901
+ disabled: k === L.length - 1,
2902
+ onClick: (S) => {
2903
+ S.stopPropagation(), T(i.id, "down");
2815
2904
  }
2816
2905
  }
2817
2906
  ),
2818
2907
  /* @__PURE__ */ e(
2819
- Y,
2908
+ j,
2820
2909
  {
2821
2910
  type: "text",
2822
2911
  size: "small",
2823
- icon: /* @__PURE__ */ e(Vt, {}),
2824
- onClick: (v) => {
2825
- v.stopPropagation(), S(i);
2912
+ icon: /* @__PURE__ */ e(Jt, {}),
2913
+ onClick: (S) => {
2914
+ S.stopPropagation(), P(i);
2826
2915
  }
2827
2916
  }
2828
2917
  ),
2829
2918
  /* @__PURE__ */ e(
2830
- Y,
2919
+ j,
2831
2920
  {
2832
2921
  type: "text",
2833
2922
  size: "small",
2834
2923
  danger: !0,
2835
- icon: /* @__PURE__ */ e(Ue, {}),
2836
- onClick: (v) => {
2837
- v.stopPropagation(), F(i.id);
2924
+ icon: /* @__PURE__ */ e(qe, {}),
2925
+ onClick: (S) => {
2926
+ S.stopPropagation(), Q(i.id);
2838
2927
  }
2839
2928
  }
2840
2929
  )
2841
2930
  ] }),
2842
- children: /* @__PURE__ */ d(b, { layout: "vertical", children: [
2843
- /* @__PURE__ */ e(b.Item, { label: "状态名称", children: /* @__PURE__ */ e(
2844
- B,
2931
+ children: /* @__PURE__ */ c(v, { layout: "vertical", children: [
2932
+ /* @__PURE__ */ e(v.Item, { label: "状态名称", children: /* @__PURE__ */ e(
2933
+ J,
2845
2934
  {
2846
2935
  value: i.name,
2847
- onChange: (v) => W(i.id, { name: v.target.value }),
2936
+ onChange: (S) => F(i.id, { name: S.target.value }),
2848
2937
  placeholder: "输入状态名称"
2849
2938
  }
2850
2939
  ) }),
2851
2940
  /* @__PURE__ */ e(
2852
- b.Item,
2941
+ v.Item,
2853
2942
  {
2854
2943
  label: "执行表达式",
2855
2944
  help: "返回 true 时激活此状态,可使用 data 变量访问绑定数据",
2856
2945
  children: /* @__PURE__ */ e(
2857
- Ln,
2946
+ $n,
2858
2947
  {
2859
- value: _[i.id] ?? i.expression,
2860
- onChange: (v) => P((k) => ({
2861
- ...k,
2862
- [i.id]: v.target.value
2948
+ value: A[i.id] ?? i.expression,
2949
+ onChange: (S) => Y((w) => ({
2950
+ ...w,
2951
+ [i.id]: S.target.value
2863
2952
  })),
2864
- onBlur: (v) => {
2865
- W(i.id, { expression: v.target.value }), P((k) => {
2866
- const L = { ...k };
2867
- return delete L[i.id], L;
2953
+ onBlur: (S) => {
2954
+ F(i.id, { expression: S.target.value }), Y((w) => {
2955
+ const M = { ...w };
2956
+ return delete M[i.id], M;
2868
2957
  });
2869
2958
  },
2870
2959
  rows: 3,
@@ -2873,41 +2962,41 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
2873
2962
  )
2874
2963
  }
2875
2964
  ),
2876
- /* @__PURE__ */ e(b.Item, { label: "绑定数据源 (bindCodes)", children: /* @__PURE__ */ e(
2877
- ce,
2965
+ /* @__PURE__ */ e(v.Item, { label: "绑定数据源 (bindCodes)", children: /* @__PURE__ */ e(
2966
+ me,
2878
2967
  {
2879
2968
  mode: "tags",
2880
2969
  value: i.bindCodes || [],
2881
- onChange: (v) => W(i.id, { bindCodes: v }),
2970
+ onChange: (S) => F(i.id, { bindCodes: S }),
2882
2971
  placeholder: "输入数据源 code",
2883
2972
  tokenSeparators: [",", " "]
2884
2973
  }
2885
2974
  ) }),
2886
- /* @__PURE__ */ e(b.Item, { label: "绑定物料", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
2887
- /* @__PURE__ */ e(Q, { color: "blue", children: i.material.name }),
2888
- /* @__PURE__ */ e(Q, { color: "default", children: i.material.type }),
2975
+ /* @__PURE__ */ e(v.Item, { label: "绑定物料", children: /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
2976
+ /* @__PURE__ */ e(le, { color: "blue", children: i.material.name }),
2977
+ /* @__PURE__ */ e(le, { color: "default", children: i.material.type }),
2889
2978
  /* @__PURE__ */ e(
2890
- Y,
2979
+ j,
2891
2980
  {
2892
2981
  type: "link",
2893
2982
  size: "small",
2894
- icon: /* @__PURE__ */ e(et, {}),
2895
- onClick: () => R(i.id),
2983
+ icon: /* @__PURE__ */ e(nt, {}),
2984
+ onClick: () => B(i.id),
2896
2985
  children: "更换物料"
2897
2986
  }
2898
2987
  )
2899
2988
  ] }) }),
2900
- /* @__PURE__ */ e(he, { style: { margin: "12px 0" } }),
2901
- /* @__PURE__ */ d("div", { className: "bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
2902
- /* @__PURE__ */ d("div", { className: "flex items-center justify-between mb-2", children: [
2989
+ /* @__PURE__ */ e(ye, { style: { margin: "12px 0" } }),
2990
+ /* @__PURE__ */ c("div", { className: "bg-gray-50 rounded-lg p-3 border border-gray-200", children: [
2991
+ /* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-2", children: [
2903
2992
  /* @__PURE__ */ e("span", { className: "text-sm font-medium", children: "物料属性" }),
2904
- /* @__PURE__ */ e(Q, { children: i.material.name })
2993
+ /* @__PURE__ */ e(le, { children: i.material.name })
2905
2994
  ] }),
2906
2995
  /* @__PURE__ */ e(
2907
- Et,
2996
+ Pt,
2908
2997
  {
2909
2998
  material: i.material,
2910
- onSave: (v) => q(i.id, v),
2999
+ onSave: (S) => R(i.id, S),
2911
3000
  bindCodes: i.bindCodes || [],
2912
3001
  dataOptions: n || []
2913
3002
  }
@@ -2918,94 +3007,94 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
2918
3007
  i.id
2919
3008
  )) })
2920
3009
  ] }) }, "status"),
2921
- /* @__PURE__ */ e(Ze, { tab: "控制", children: /* @__PURE__ */ d(
2922
- b,
3010
+ /* @__PURE__ */ e(Ke, { tab: "控制", children: /* @__PURE__ */ c(
3011
+ v,
2923
3012
  {
2924
3013
  form: u,
2925
3014
  layout: "vertical",
2926
3015
  onValuesChange: O,
2927
3016
  children: [
2928
3017
  /* @__PURE__ */ e(
2929
- b.Item,
3018
+ v.Item,
2930
3019
  {
2931
3020
  label: "可拖拽",
2932
3021
  name: ["controlInfo", "isDraggable"],
2933
3022
  valuePropName: "checked",
2934
- children: /* @__PURE__ */ e(je, {})
3023
+ children: /* @__PURE__ */ e(Fe, {})
2935
3024
  }
2936
3025
  ),
2937
3026
  /* @__PURE__ */ e(
2938
- b.Item,
3027
+ v.Item,
2939
3028
  {
2940
3029
  label: "可点击",
2941
3030
  name: ["controlInfo", "isClickable"],
2942
3031
  valuePropName: "checked",
2943
- children: /* @__PURE__ */ e(je, {})
3032
+ children: /* @__PURE__ */ e(Fe, {})
2944
3033
  }
2945
3034
  ),
2946
3035
  /* @__PURE__ */ e(
2947
- b.Item,
3036
+ v.Item,
2948
3037
  {
2949
3038
  label: "可调整大小",
2950
3039
  name: ["controlInfo", "isResizable"],
2951
3040
  valuePropName: "checked",
2952
- children: /* @__PURE__ */ e(je, {})
3041
+ children: /* @__PURE__ */ e(Fe, {})
2953
3042
  }
2954
3043
  ),
2955
3044
  /* @__PURE__ */ e(
2956
- b.Item,
3045
+ v.Item,
2957
3046
  {
2958
3047
  label: "可选中",
2959
3048
  name: ["controlInfo", "isSelectable"],
2960
3049
  valuePropName: "checked",
2961
- children: /* @__PURE__ */ e(je, {})
3050
+ children: /* @__PURE__ */ e(Fe, {})
2962
3051
  }
2963
3052
  )
2964
3053
  ]
2965
3054
  }
2966
3055
  ) }, "control")
2967
3056
  ] }) }),
2968
- /* @__PURE__ */ e("div", { className: "p-3 border-t border-gray-200 bg-gray-50", children: /* @__PURE__ */ d("div", { className: "text-xs text-gray-500", children: [
2969
- /* @__PURE__ */ d("div", { children: [
3057
+ /* @__PURE__ */ e("div", { className: "p-3 border-t border-gray-200 bg-gray-50", children: /* @__PURE__ */ c("div", { className: "text-xs text-gray-500", children: [
3058
+ /* @__PURE__ */ c("div", { children: [
2970
3059
  "节点 ID: ",
2971
3060
  D.id.slice(0, 8),
2972
3061
  "..."
2973
3062
  ] }),
2974
- /* @__PURE__ */ d("div", { children: [
3063
+ /* @__PURE__ */ c("div", { children: [
2975
3064
  "状态数: ",
2976
- E.length
3065
+ L.length
2977
3066
  ] })
2978
3067
  ] }) }),
2979
3068
  /* @__PURE__ */ e(
2980
- Qe,
3069
+ tt,
2981
3070
  {
2982
3071
  title: "选择物料",
2983
3072
  open: x,
2984
3073
  onCancel: () => {
2985
- g(!1), m(null);
3074
+ y(!1), m(null);
2986
3075
  },
2987
3076
  footer: null,
2988
3077
  width: 600,
2989
- children: /* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-y-auto", children: /* @__PURE__ */ d(se, { ghost: !0, defaultActiveKey: ["basic", "device", "text", "line"], children: [
2990
- /* @__PURE__ */ e(de, { header: "基础形状", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-2", children: o.filter((i) => ["矩形", "圆形", "圆角矩形"].includes(i.name)).map((i) => /* @__PURE__ */ e(
2991
- pt,
3078
+ children: /* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-y-auto", children: /* @__PURE__ */ c(he, { ghost: !0, defaultActiveKey: ["basic", "device", "text", "line"], children: [
3079
+ /* @__PURE__ */ e(ge, { header: "基础形状", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-2", children: o.filter((i) => ["矩形", "圆形", "圆角矩形"].includes(i.name)).map((i) => /* @__PURE__ */ e(
3080
+ vt,
2992
3081
  {
2993
3082
  material: i,
2994
3083
  onClick: () => H(i)
2995
3084
  },
2996
3085
  i.id
2997
3086
  )) }) }, "basic"),
2998
- /* @__PURE__ */ e(de, { header: "设备图标", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-2", children: o.filter(
3087
+ /* @__PURE__ */ e(ge, { header: "设备图标", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-2", children: o.filter(
2999
3088
  (i) => ["阀门", "泵", "罐体"].includes(i.name) || i.type === "IMAGE" && !["矩形", "圆形", "圆角矩形"].includes(i.name)
3000
3089
  ).map((i) => /* @__PURE__ */ e(
3001
- pt,
3090
+ vt,
3002
3091
  {
3003
3092
  material: i,
3004
3093
  onClick: () => H(i)
3005
3094
  },
3006
3095
  i.id
3007
3096
  )) }) }, "device"),
3008
- /* @__PURE__ */ e(de, { header: "文本", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-2", children: o.filter((i) => i.type === "TEXT").map((i) => /* @__PURE__ */ d(
3097
+ /* @__PURE__ */ e(ge, { header: "文本", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-2", children: o.filter((i) => i.type === "TEXT").map((i) => /* @__PURE__ */ c(
3009
3098
  "div",
3010
3099
  {
3011
3100
  className: "border rounded-lg p-2 cursor-pointer hover:border-blue-500 hover:bg-blue-50 transition-all text-center",
@@ -3017,7 +3106,7 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
3017
3106
  },
3018
3107
  i.id
3019
3108
  )) }) }, "text"),
3020
- /* @__PURE__ */ e(de, { header: "线条", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-2", children: o.filter((i) => i.type === "LINE").map((i) => /* @__PURE__ */ d(
3109
+ /* @__PURE__ */ e(ge, { header: "线条", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-2", children: o.filter((i) => i.type === "LINE").map((i) => /* @__PURE__ */ c(
3021
3110
  "div",
3022
3111
  {
3023
3112
  className: "border rounded-lg p-2 cursor-pointer hover:border-blue-500 hover:bg-blue-50 transition-all text-center",
@@ -3032,35 +3121,35 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
3032
3121
  ] }) })
3033
3122
  }
3034
3123
  )
3035
- ] }) : /* @__PURE__ */ e("div", { className: "h-full flex items-center justify-center bg-white border-l border-gray-200", children: /* @__PURE__ */ e(K, { description: "请选择一个节点" }) });
3036
- }, pt = ({ material: n, onClick: h }) => {
3124
+ ] }) : /* @__PURE__ */ e("div", { className: "h-full flex items-center justify-center bg-white border-l border-gray-200", children: /* @__PURE__ */ e(ne, { description: "请选择一个节点" }) });
3125
+ }, vt = ({ material: n, onClick: f }) => {
3037
3126
  const t = n.type === "IMAGE" ? n.src : void 0;
3038
- return /* @__PURE__ */ d(
3127
+ return /* @__PURE__ */ c(
3039
3128
  "div",
3040
3129
  {
3041
3130
  className: "border rounded-lg p-2 cursor-pointer hover:border-blue-500 hover:bg-blue-50 transition-all text-center",
3042
- onClick: h,
3131
+ onClick: f,
3043
3132
  children: [
3044
3133
  /* @__PURE__ */ e("div", { className: "w-12 h-12 mx-auto mb-1 flex items-center justify-center", children: t ? /* @__PURE__ */ e("img", { src: t, alt: n.name, className: "w-10 h-10 object-contain" }) : /* @__PURE__ */ e("span", { className: "text-xs", children: n.name[0] }) }),
3045
3134
  /* @__PURE__ */ e("span", { className: "text-xs", children: n.name })
3046
3135
  ]
3047
3136
  }
3048
3137
  );
3049
- }, Tn = "ConfigEditor-module__configEditor__dinNG", $n = {
3050
- configEditor: Tn
3051
- }, { Header: _n, Sider: gt, Content: On } = Je, Un = ({
3138
+ }, Yn = "ConfigEditor-module__configEditor__dinNG", On = {
3139
+ configEditor: Yn
3140
+ }, { Header: Xn, Sider: bt, Content: zn } = Qe, Bn = ({
3052
3141
  initialScheme: n,
3053
- onChange: h,
3142
+ onChange: f,
3054
3143
  readonly: t = !1,
3055
3144
  headerExtra: r,
3056
- className: c = "",
3145
+ className: d = "",
3057
3146
  style: l,
3058
3147
  showHeader: a = !0,
3059
3148
  showMaterialPanel: o = !0,
3060
- showPropertyPanel: p = !0,
3061
- customMaterials: f
3149
+ showPropertyPanel: h = !0,
3150
+ customMaterials: p
3062
3151
  }) => {
3063
- const [u, w] = oe.useState(!1), [s, x] = oe.useState(""), [g, C] = oe.useState([
3152
+ const [u, b] = de.useState(!1), [s, x] = de.useState(""), [y, E] = de.useState([
3064
3153
  {
3065
3154
  paramsCode: "001",
3066
3155
  paramsName: "通频速度有效值",
@@ -3073,103 +3162,103 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
3073
3162
  value: 1.5,
3074
3163
  paramsUnit: "m/s²"
3075
3164
  }
3076
- ]), { exportScheme: m, importScheme: _, nodes: P, materials: D, addMaterial: E } = xe();
3077
- oe.useRef(null);
3078
- const O = oe.useRef(!1);
3079
- ae(() => {
3080
- O.current || (O.current = !0, D.length === 0 && hn.forEach((S) => E(S)), f && f.length > 0 && f.forEach((S) => E(S)), n && _(n));
3081
- }, []), ae(() => {
3082
- if (h) {
3083
- const S = m();
3084
- h(S);
3165
+ ]), { exportScheme: m, importScheme: A, nodes: Y, materials: D, addMaterial: L } = Ie();
3166
+ de.useRef(null);
3167
+ const O = de.useRef(!1);
3168
+ se(() => {
3169
+ O.current || (O.current = !0, D.length === 0 && pn.forEach((P) => L(P)), p && p.length > 0 && p.forEach((P) => L(P)), n && A(n));
3170
+ }, []), se(() => {
3171
+ if (f) {
3172
+ const P = m();
3173
+ f(P);
3085
3174
  }
3086
- }, [P, h]);
3087
- const V = G(() => {
3088
- const S = m(), A = JSON.stringify(S, null, 2), R = "data:application/json;charset=utf-8," + encodeURIComponent(A), q = `scheme_${Date.now()}.json`, i = document.createElement("a");
3089
- i.setAttribute("href", R), i.setAttribute("download", q), i.click(), Me.success("导出成功!");
3175
+ }, [Y, f]);
3176
+ const ie = G(() => {
3177
+ const P = m(), T = JSON.stringify(P, null, 2), B = "data:application/json;charset=utf-8," + encodeURIComponent(T), R = `scheme_${Date.now()}.json`, i = document.createElement("a");
3178
+ i.setAttribute("href", B), i.setAttribute("download", R), i.click(), De.success("导出成功!");
3090
3179
  }, [m]), H = G(() => {
3091
3180
  try {
3092
- const S = JSON.parse(s);
3093
- _(S), w(!1), x(""), Me.success("导入成功!");
3181
+ const P = JSON.parse(s);
3182
+ A(P), b(!1), x(""), De.success("导入成功!");
3094
3183
  } catch {
3095
- Me.error("JSON 格式错误,请检查输入");
3184
+ De.error("JSON 格式错误,请检查输入");
3096
3185
  }
3097
- }, [s, _]), F = G(
3098
- (S) => {
3099
- const A = new FileReader();
3100
- return A.onload = (R) => {
3186
+ }, [s, A]), Q = G(
3187
+ (P) => {
3188
+ const T = new FileReader();
3189
+ return T.onload = (B) => {
3101
3190
  try {
3102
- const q = R.target?.result, i = JSON.parse(q);
3103
- _(i), Me.success("导入成功!");
3191
+ const R = B.target?.result, i = JSON.parse(R);
3192
+ A(i), De.success("导入成功!");
3104
3193
  } catch {
3105
- Me.error("文件格式错误");
3194
+ De.error("文件格式错误");
3106
3195
  }
3107
- }, A.readAsText(S), !1;
3196
+ }, T.readAsText(P), !1;
3108
3197
  },
3109
- [_]
3110
- ), W = G(() => m(), [m]);
3111
- return oe.useImperativeHandle(
3112
- oe.useRef?.(),
3198
+ [A]
3199
+ ), F = G(() => m(), [m]);
3200
+ return de.useImperativeHandle(
3201
+ de.useRef?.(),
3113
3202
  () => ({
3114
- getScheme: W,
3203
+ getScheme: F,
3115
3204
  exportScheme: m,
3116
- importScheme: _
3205
+ importScheme: A
3117
3206
  }),
3118
- [W, m, _]
3119
- ), /* @__PURE__ */ e(_t, { locale: cn, children: /* @__PURE__ */ e("div", { className: $n.configEditor, style: l, children: /* @__PURE__ */ d(
3120
- Je,
3207
+ [F, m, A]
3208
+ ), /* @__PURE__ */ e(zt, { locale: hn, children: /* @__PURE__ */ e("div", { className: On.configEditor, style: l, children: /* @__PURE__ */ c(
3209
+ Qe,
3121
3210
  {
3122
- className: `h-full w-full overflow-hidden ${c}`,
3211
+ className: `h-full w-full overflow-hidden ${d}`,
3123
3212
  children: [
3124
- a && /* @__PURE__ */ d(_n, { className: "bg-white border-b border-gray-200 px-4 flex items-center justify-between flex-shrink-0", children: [
3125
- /* @__PURE__ */ d("div", { className: "flex items-center gap-4", children: [
3213
+ a && /* @__PURE__ */ c(Xn, { className: "bg-white border-b border-gray-200 px-4 flex items-center justify-between flex-shrink-0", children: [
3214
+ /* @__PURE__ */ c("div", { className: "flex items-center gap-4", children: [
3126
3215
  /* @__PURE__ */ e("div", { className: "text-xl font-bold text-blue-600", children: "组态编辑器" }),
3127
- /* @__PURE__ */ d("div", { className: "text-sm text-gray-500", children: [
3128
- P.length,
3216
+ /* @__PURE__ */ c("div", { className: "text-sm text-gray-500", children: [
3217
+ Y.length,
3129
3218
  " 个节点"
3130
3219
  ] })
3131
3220
  ] }),
3132
- /* @__PURE__ */ d(ee, { children: [
3221
+ /* @__PURE__ */ c(ae, { children: [
3133
3222
  r,
3134
- !t && /* @__PURE__ */ d(ge, { children: [
3135
- /* @__PURE__ */ e(pe, { title: "导出 JSON", children: /* @__PURE__ */ e(Y, { icon: /* @__PURE__ */ e(Ht, {}), onClick: V, children: "导出" }) }),
3136
- /* @__PURE__ */ e(pe, { title: "导入 JSON", children: /* @__PURE__ */ e(
3137
- Y,
3223
+ !t && /* @__PURE__ */ c(Se, { children: [
3224
+ /* @__PURE__ */ e(we, { title: "导出 JSON", children: /* @__PURE__ */ e(j, { icon: /* @__PURE__ */ e(Kt, {}), onClick: ie, children: "导出" }) }),
3225
+ /* @__PURE__ */ e(we, { title: "导入 JSON", children: /* @__PURE__ */ e(
3226
+ j,
3138
3227
  {
3139
- icon: /* @__PURE__ */ e(bt, {}),
3140
- onClick: () => w(!0),
3228
+ icon: /* @__PURE__ */ e(Ct, {}),
3229
+ onClick: () => b(!0),
3141
3230
  children: "导入"
3142
3231
  }
3143
3232
  ) })
3144
3233
  ] })
3145
3234
  ] })
3146
3235
  ] }),
3147
- /* @__PURE__ */ d(Je, { children: [
3148
- o && !t && /* @__PURE__ */ e(gt, { width: 280, className: "bg-white", theme: "light", children: /* @__PURE__ */ e(fn, {}) }),
3149
- /* @__PURE__ */ e(On, { className: "bg-gray-100 relative", children: /* @__PURE__ */ e(Sn, { defaultTestData: g }) }),
3150
- p && !t && /* @__PURE__ */ e(gt, { width: 360, className: "bg-white", theme: "light", children: /* @__PURE__ */ e(Pn, { defaultTestData: g }) })
3236
+ /* @__PURE__ */ c(Qe, { children: [
3237
+ o && !t && /* @__PURE__ */ e(bt, { width: 280, className: "bg-white", theme: "light", children: /* @__PURE__ */ e(yn, {}) }),
3238
+ /* @__PURE__ */ e(zn, { className: "bg-gray-100 relative", children: /* @__PURE__ */ e(In, { defaultTestData: y }) }),
3239
+ h && !t && /* @__PURE__ */ e(bt, { width: 360, className: "bg-white", theme: "light", children: /* @__PURE__ */ e(_n, { defaultTestData: y }) })
3151
3240
  ] }),
3152
3241
  /* @__PURE__ */ e(
3153
- Qe,
3242
+ tt,
3154
3243
  {
3155
3244
  title: "导入组态方案",
3156
3245
  open: u,
3157
3246
  onOk: H,
3158
3247
  onCancel: () => {
3159
- w(!1), x("");
3248
+ b(!1), x("");
3160
3249
  },
3161
3250
  width: 600,
3162
- children: /* @__PURE__ */ d("div", { className: "space-y-4", children: [
3163
- /* @__PURE__ */ d("div", { children: [
3251
+ children: /* @__PURE__ */ c("div", { className: "space-y-4", children: [
3252
+ /* @__PURE__ */ c("div", { children: [
3164
3253
  /* @__PURE__ */ e("p", { className: "mb-2", children: "选择 JSON 文件导入:" }),
3165
3254
  /* @__PURE__ */ e(
3166
3255
  "input",
3167
3256
  {
3168
3257
  type: "file",
3169
3258
  accept: ".json",
3170
- onChange: (S) => {
3171
- const A = S.target.files?.[0];
3172
- A && F(A);
3259
+ onChange: (P) => {
3260
+ const T = P.target.files?.[0];
3261
+ T && Q(T);
3173
3262
  },
3174
3263
  className: `block w-full text-sm text-gray-500
3175
3264
  file:mr-4 file:py-2 file:px-4
@@ -3181,13 +3270,13 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
3181
3270
  )
3182
3271
  ] }),
3183
3272
  /* @__PURE__ */ e("div", { className: "text-center text-gray-400", children: "或" }),
3184
- /* @__PURE__ */ d("div", { children: [
3273
+ /* @__PURE__ */ c("div", { children: [
3185
3274
  /* @__PURE__ */ e("p", { className: "mb-2", children: "粘贴 JSON 内容:" }),
3186
3275
  /* @__PURE__ */ e(
3187
3276
  "textarea",
3188
3277
  {
3189
3278
  value: s,
3190
- onChange: (S) => x(S.target.value),
3279
+ onChange: (P) => x(P.target.value),
3191
3280
  placeholder: "粘贴 JSON 内容...",
3192
3281
  className: "w-full h-48 p-3 border border-gray-300 rounded-lg font-mono text-sm resize-none focus:outline-none focus:ring-2 focus:ring-blue-500"
3193
3282
  }
@@ -3201,14 +3290,14 @@ const cn = /* @__PURE__ */ en(sn), dn = (n) => (h, t, r) => (r.setState = (c, l,
3201
3290
  ) }) });
3202
3291
  };
3203
3292
  export {
3204
- Sn as Canvas,
3205
- Un as ConfigEditor,
3206
- fn as MaterialPanel,
3207
- kt as NodeRenderer,
3208
- Pn as PropertyPanel,
3209
- mn as createDefaultNode,
3210
- It as createDefaultStatus,
3211
- hn as initMaterials,
3212
- xe as useEditorStore
3293
+ In as Canvas,
3294
+ Bn as ConfigEditor,
3295
+ yn as MaterialPanel,
3296
+ Lt as NodeRenderer,
3297
+ _n as PropertyPanel,
3298
+ gn as createDefaultNode,
3299
+ Dt as createDefaultStatus,
3300
+ pn as initMaterials,
3301
+ Ie as useEditorStore
3213
3302
  };
3214
3303
  //# sourceMappingURL=config-editor.es.js.map