@opentiny/tiny-engine-plugin-model-manager 2.9.0 → 2.10.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,21 +1,21 @@
1
1
  import "./style.css";
2
- import { ref as E, watch as Z, createElementBlock as v, openBlock as m, createVNode as n, unref as o, withCtx as u, createElementVNode as p, computed as ee, resolveComponent as k, createTextVNode as B, createCommentVNode as O, Fragment as T, renderList as G, createBlock as te, toDisplayString as D, withModifiers as K, nextTick as j, reactive as ae, provide as oe, onMounted as ie, normalizeClass as se } from "vue";
3
- import { Form as de, FormItem as q, TinyInput as $, TinyButton as z, TinyGrid as re, TinyGridColumn as I, TinySelect as W, TinyOption as N, TinyCheckbox as X, CollapseItem as ue, Collapse as ce, Button as pe, TinySearch as me, Modal as fe } from "@opentiny/vue";
2
+ import { ref as E, watch as Z, createElementBlock as f, openBlock as p, createVNode as n, unref as a, withCtx as r, createElementVNode as m, computed as ee, resolveComponent as k, createTextVNode as B, createCommentVNode as O, Fragment as T, renderList as G, createBlock as le, toDisplayString as I, withModifiers as K, nextTick as j, reactive as ae, provide as oe, onMounted as ie, normalizeClass as de } from "vue";
3
+ import { Form as se, FormItem as q, TinyInput as R, TinyButton as z, TinyGrid as ue, TinyGridColumn as S, TinySelect as W, TinyOption as w, TinyCheckbox as X, CollapseItem as re, Collapse as ce, Button as pe, TinySearch as me, Modal as fe } from "@opentiny/vue";
4
4
  import { IconSearch as ve } from "@opentiny/vue-icon";
5
5
  import { ButtonGroup as ge, SvgButton as H, PluginSetting as _e, PluginPanel as ye, SearchEmpty as he } from "@opentiny/tiny-engine-common";
6
- import { getMetaApi as A, META_SERVICE as F, useLayout as le } from "@opentiny/tiny-engine-meta-register";
6
+ import { getMetaApi as A, META_SERVICE as F, useLayout as te } from "@opentiny/tiny-engine-meta-register";
7
7
  const P = (c, g) => {
8
- const x = c.__vccOpts || c;
9
- for (const [i, f] of g)
10
- x[i] = f;
11
- return x;
12
- }, Ce = { class: "section" }, xe = { class: "form-item" }, Ve = { class: "form-item" }, Me = { class: "form-item" }, be = { class: "form-item" }, Ee = { class: "form-item" }, ke = {
8
+ const C = c.__vccOpts || c;
9
+ for (const [i, v] of g)
10
+ C[i] = v;
11
+ return C;
12
+ }, Ve = { class: "section" }, Ce = { class: "form-item" }, xe = { class: "form-item" }, Me = { class: "form-item" }, be = { class: "form-item" }, Ee = { class: "form-item" }, ke = {
13
13
  __name: "ModelBasicForm",
14
14
  props: {
15
15
  model: { type: Object, required: !0 }
16
16
  },
17
17
  setup(c, { expose: g }) {
18
- const x = c, i = E(x.model), f = E(), y = E({
18
+ const C = c, i = E({ modelUrl: "undefined/platform-center/api/model-data", ...C.model }), v = E(), y = E({
19
19
  nameCn: [
20
20
  { required: !0, message: "必填", trigger: "blur" },
21
21
  { min: 1, max: 32, message: "长度在1-32之间", trigger: "blur" }
@@ -25,99 +25,96 @@ const P = (c, g) => {
25
25
  { min: 1, max: 32, message: "长度在1-32之间", trigger: "blur" }
26
26
  ],
27
27
  version: [{ required: !0, message: "必填", trigger: "blur" }],
28
- modelUrl: [
29
- { required: !0, message: "必填", trigger: "blur" },
30
- { min: 1, max: 200, message: "长度在1-200之间", trigger: "blur" }
31
- ]
28
+ modelUrl: [{ min: 1, max: 200, message: "长度在1-200之间", trigger: "blur" }]
32
29
  });
33
30
  return Z(
34
- () => x.model,
31
+ () => C.model,
35
32
  (b) => {
36
33
  i.value = b;
37
34
  },
38
35
  { deep: !0 }
39
36
  ), g({
40
37
  getLocalValue: () => i.value,
41
- validate: () => f.value.validate()
42
- }), (b, h) => (m(), v("div", Ce, [
43
- n(o(de), {
38
+ validate: () => v.value.validate()
39
+ }), (b, h) => (p(), f("div", Ve, [
40
+ n(a(se), {
44
41
  ref_key: "ruleFormRef",
45
- ref: f,
42
+ ref: v,
46
43
  model: i.value,
47
44
  rules: y.value
48
45
  }, {
49
- default: u(() => [
50
- p("div", xe, [
51
- n(o(q), {
46
+ default: r(() => [
47
+ m("div", Ce, [
48
+ n(a(q), {
52
49
  label: "中文名称",
53
50
  prop: "nameCn"
54
51
  }, {
55
- default: u(() => [
56
- n(o($), {
52
+ default: r(() => [
53
+ n(a(R), {
57
54
  modelValue: i.value.nameCn,
58
- "onUpdate:modelValue": h[0] || (h[0] = (C) => i.value.nameCn = C),
55
+ "onUpdate:modelValue": h[0] || (h[0] = (V) => i.value.nameCn = V),
59
56
  placeholder: "请输入模型中文名称"
60
57
  }, null, 8, ["modelValue"])
61
58
  ]),
62
59
  _: 1
63
60
  })
64
61
  ]),
65
- p("div", Ve, [
66
- n(o(q), {
62
+ m("div", xe, [
63
+ n(a(q), {
67
64
  label: "英文名称",
68
65
  prop: "nameEn"
69
66
  }, {
70
- default: u(() => [
71
- n(o($), {
67
+ default: r(() => [
68
+ n(a(R), {
72
69
  modelValue: i.value.nameEn,
73
- "onUpdate:modelValue": h[1] || (h[1] = (C) => i.value.nameEn = C),
70
+ "onUpdate:modelValue": h[1] || (h[1] = (V) => i.value.nameEn = V),
74
71
  placeholder: "请输入模型英文名称"
75
72
  }, null, 8, ["modelValue"])
76
73
  ]),
77
74
  _: 1
78
75
  })
79
76
  ]),
80
- p("div", Me, [
81
- n(o(q), {
77
+ m("div", Me, [
78
+ n(a(q), {
82
79
  label: "版本号",
83
80
  prop: "version"
84
81
  }, {
85
- default: u(() => [
86
- n(o($), {
82
+ default: r(() => [
83
+ n(a(R), {
87
84
  modelValue: i.value.version,
88
- "onUpdate:modelValue": h[2] || (h[2] = (C) => i.value.version = C),
85
+ "onUpdate:modelValue": h[2] || (h[2] = (V) => i.value.version = V),
89
86
  placeholder: "1.0.0"
90
87
  }, null, 8, ["modelValue"])
91
88
  ]),
92
89
  _: 1
93
90
  })
94
91
  ]),
95
- p("div", be, [
96
- n(o(q), {
92
+ m("div", be, [
93
+ n(a(q), {
97
94
  label: "模型地址",
98
95
  prop: "modelUrl"
99
96
  }, {
100
- default: u(() => [
101
- n(o($), {
97
+ default: r(() => [
98
+ n(a(R), {
102
99
  modelValue: i.value.modelUrl,
103
- "onUpdate:modelValue": h[3] || (h[3] = (C) => i.value.modelUrl = C),
100
+ "onUpdate:modelValue": h[3] || (h[3] = (V) => i.value.modelUrl = V),
104
101
  placeholder: "请输入模型地址,如:https://api.example.com/model"
105
102
  }, null, 8, ["modelValue"])
106
103
  ]),
107
104
  _: 1
108
105
  })
109
106
  ]),
110
- p("div", Ee, [
111
- n(o(q), {
107
+ m("div", Ee, [
108
+ n(a(q), {
112
109
  label: "描述",
113
110
  prop: "description"
114
111
  }, {
115
- default: u(() => [
116
- n(o($), {
112
+ default: r(() => [
113
+ n(a(R), {
117
114
  type: "textarea",
118
115
  rows: 3,
119
116
  modelValue: i.value.description,
120
- "onUpdate:modelValue": h[4] || (h[4] = (C) => i.value.description = C),
117
+ "onUpdate:modelValue": h[4] || (h[4] = (V) => i.value.description = V),
121
118
  placeholder: "请输入模型描述"
122
119
  }, null, 8, ["modelValue"])
123
120
  ]),
@@ -129,13 +126,13 @@ const P = (c, g) => {
129
126
  }, 8, ["model", "rules"])
130
127
  ]));
131
128
  }
132
- }, Re = /* @__PURE__ */ P(ke, [["__scopeId", "data-v-1f80f91c"]]), $e = { class: "section" }, Ue = { class: "field-table" }, Se = {
129
+ }, Re = /* @__PURE__ */ P(ke, [["__scopeId", "data-v-c29b7783"]]), Ue = { class: "section" }, $e = { class: "field-table" }, Se = {
133
130
  key: 0,
134
131
  class: "expand-content"
135
- }, we = { class: "expand-section" }, Ie = { class: "enum-values" }, Ne = {
132
+ }, Ie = { class: "expand-section" }, Ne = { class: "enum-values" }, De = {
136
133
  key: 1,
137
134
  class: "expand-content"
138
- }, De = { class: "expand-section" }, Ae = { class: "model-ref-section" }, Fe = {
135
+ }, we = { class: "expand-section" }, Ae = { class: "model-ref-section" }, Fe = {
139
136
  key: 0,
140
137
  class: "model-ref-info"
141
138
  }, Le = {
@@ -162,7 +159,13 @@ const P = (c, g) => {
162
159
  }, Ge = {
163
160
  key: 1,
164
161
  class: "readonly-cell"
165
- }, Ke = { class: "field-actions" }, je = ["onClick"], He = ["onClick"], Je = {
162
+ }, Ke = {
163
+ key: 0,
164
+ class: "editing-cell"
165
+ }, je = {
166
+ key: 1,
167
+ class: "readonly-cell"
168
+ }, He = { class: "field-actions" }, Je = ["onClick"], Qe = ["onClick"], We = {
166
169
  __name: "FieldManager",
167
170
  props: {
168
171
  model: { type: Object, required: !0 },
@@ -171,80 +174,81 @@ const P = (c, g) => {
171
174
  },
172
175
  emits: ["insert-enum-after", "remove-enum"],
173
176
  setup(c, { expose: g }) {
174
- const x = c, i = E(null), f = E(x.model), y = ee(() => x.availableModels.filter((e) => e.id !== x.model.id)), V = () => {
175
- var e, a;
176
- return ((a = (e = i.value) == null ? void 0 : e.getData) == null ? void 0 : a.call(e)) || [];
177
- }, b = (e) => {
178
- const a = y.value.find((_) => _.id === e);
179
- return a ? `${a.nameCn} (${a.nameEn})` : "未知模型";
180
- }, h = (e) => {
181
- var a, _;
182
- if (e.type === "Enum" || e.type === "ModelRef")
183
- e.isExpanded = !0, e.type === "Enum" && (!Array.isArray(e.options) || e.options.length === 0) && (e.options = [{ value: "", label: "" }]), e.type === "ModelRef" && (e.isModel = !0, e.defaultValue = e.defaultValue || null), j(() => {
184
- var l, s;
185
- (((s = (l = i.value) == null ? void 0 : l.getGridData) == null ? void 0 : s.call(l)) || []).forEach((r) => {
186
- r.id === e.id && !expandConfig.value.expandRowKeys.includes(r._RID) && expandConfig.value.expandRowKeys.push(r._RID);
177
+ const C = c, i = E(null), v = E(C.model), y = ee(() => C.availableModels.filter((l) => l.id !== C.model.id)), x = () => {
178
+ var l, o;
179
+ return ((o = (l = i.value) == null ? void 0 : l.getData) == null ? void 0 : o.call(l)) || [];
180
+ }, b = (l) => {
181
+ const o = y.value.find((_) => _.id === l);
182
+ return o ? `${o.nameCn} (${o.nameEn})` : "未知模型";
183
+ }, h = (l) => {
184
+ var o, _;
185
+ if (l.type === "Enum" || l.type === "ModelRef")
186
+ l.isExpanded = !0, l.type === "Enum" && (!Array.isArray(l.options) || l.options.length === 0) && (l.options = [{ value: "", label: "" }]), l.type === "ModelRef" && (l.isModel = !0, l.defaultValue = l.defaultValue || null), j(() => {
187
+ var t, d;
188
+ (((d = (t = i.value) == null ? void 0 : t.getGridData) == null ? void 0 : d.call(t)) || []).forEach((u) => {
189
+ u.id === l.id && !expandConfig.value.expandRowKeys.includes(u._RID) && expandConfig.value.expandRowKeys.push(u._RID);
187
190
  });
188
191
  });
189
192
  else {
190
- e.isExpanded = !1;
191
- const l = (((_ = (a = i.value) == null ? void 0 : a.getGridData) == null ? void 0 : _.call(a)) || []).find((s) => s.id === e.id);
192
- if (l) {
193
- const s = expandConfig.value.expandRowKeys.indexOf(l._RID);
194
- s > -1 && expandConfig.value.expandRowKeys.splice(s, 1);
193
+ l.isExpanded = !1;
194
+ const t = (((_ = (o = i.value) == null ? void 0 : o.getGridData) == null ? void 0 : _.call(o)) || []).find((d) => d.id === l.id);
195
+ if (t) {
196
+ const d = expandConfig.value.expandRowKeys.indexOf(t._RID);
197
+ d > -1 && expandConfig.value.expandRowKeys.splice(d, 1);
195
198
  }
196
199
  }
197
200
  j(() => {
198
- f.value && f.value.parameters && (f.value.parameters = [...f.value.parameters]);
201
+ v.value && v.value.parameters && (v.value.parameters = [...v.value.parameters]);
199
202
  });
200
- }, C = (e) => ({
203
+ }, V = (l) => ({
201
204
  String: "字符串",
202
205
  Number: "数字",
203
206
  Boolean: "布尔值",
204
207
  Date: "日期",
205
208
  Enum: "枚举值",
206
209
  ModelRef: "模型引用"
207
- })[e] || e, U = (e) => {
208
- var a;
209
- e._editCache = { ...e }, e.isEditing = !0, (e.type === "Enum" || e.type === "ModelRef") && (e.isExpanded = !0, e.type === "Enum" && (!Array.isArray(e.options) || e.options.length === 0) && (e.options = [{ value: "", label: "" }]), e.type === "ModelRef" && (e.isModel = !0, e.defaultValue = e.defaultValue || null), (((a = i.value) == null ? void 0 : a.getGridData()) || []).forEach((t) => {
210
- t.id === e.id && !expandConfig.value.expandRowKeys.includes(t._RID) && expandConfig.value.expandRowKeys.push(t._RID);
210
+ })[l] || l, $ = (l) => {
211
+ var o;
212
+ l._editCache = { ...l }, l.isEditing = !0, (l.type === "Enum" || l.type === "ModelRef") && (l.isExpanded = !0, l.type === "Enum" && (!Array.isArray(l.options) || l.options.length === 0) && (l.options = [{ value: "", label: "" }]), l.type === "ModelRef" && (l.isModel = !0, l.defaultValue = l.defaultValue || null), (((o = i.value) == null ? void 0 : o.getGridData()) || []).forEach((e) => {
213
+ e.id === l.id && !expandConfig.value.expandRowKeys.includes(e._RID) && expandConfig.value.expandRowKeys.push(e._RID);
211
214
  }));
212
- }, d = (e) => {
213
- e.isEditing = !1, e.isExpanded = !1, e._editCache && JSON.stringify(e._editCache) !== JSON.stringify(e) && (e._editCache = null), e.isNew && delete e.isNew;
214
- }, M = (e) => {
215
- var t, l;
216
- e.isEditing = !1, e.isExpanded = !1;
217
- const _ = (((l = (t = i.value) == null ? void 0 : t.getGridData) == null ? void 0 : l.call(t)) || []).find((s) => s.id === e.id);
215
+ }, s = (l) => {
216
+ l.isEditing = !1, l.isExpanded = !1, l._editCache && JSON.stringify(l._editCache) !== JSON.stringify(l) && (l._editCache = null), l.isNew && delete l.isNew;
217
+ }, M = (l) => {
218
+ var e, t;
219
+ l.isEditing = !1, l.isExpanded = !1;
220
+ const _ = (((t = (e = i.value) == null ? void 0 : e.getGridData) == null ? void 0 : t.call(e)) || []).find((d) => d.id === l.id);
218
221
  if (_) {
219
- const s = expandConfig.value.expandRowKeys.indexOf(_._RID);
220
- s > -1 && expandConfig.value.expandRowKeys.splice(s, 1);
222
+ const d = expandConfig.value.expandRowKeys.indexOf(_._RID);
223
+ d > -1 && expandConfig.value.expandRowKeys.splice(d, 1);
221
224
  }
222
- if (e._editCache && (Object.assign(e, e._editCache), e._editCache = null), e.isNew) {
223
- const s = f.value.parameters.findIndex((r) => r.id === e.id);
224
- s > -1 && f.value.parameters.splice(s, 1);
225
+ if (l._editCache && (Object.assign(l, l._editCache), l._editCache = null), l.isNew) {
226
+ const d = v.value.parameters.findIndex((u) => u.id === l.id);
227
+ d > -1 && v.value.parameters.splice(d, 1);
225
228
  }
226
- }, S = (e) => {
227
- const a = f.value.parameters.findIndex((_) => _.prop === e.prop);
228
- a > -1 && f.value.parameters.splice(a, 1);
229
+ }, N = (l) => {
230
+ const o = v.value.parameters.findIndex((_) => _.prop === l.prop);
231
+ o > -1 && v.value.parameters.splice(o, 1);
229
232
  };
230
233
  return g({
231
234
  fieldGrid: i,
232
- getGridData: V
233
- }), (e, a) => {
235
+ getGridData: x
236
+ }), (l, o) => {
234
237
  const _ = k("svg-icon");
235
- return m(), v("div", $e, [
236
- n(o(z), {
238
+ return p(), f("div", Ue, [
239
+ n(a(z), {
240
+ class: "add-field-btn",
237
241
  size: "mini",
238
- onClick: a[0] || (a[0] = (t) => e.$emit("add-field"))
242
+ onClick: o[0] || (o[0] = (e) => l.$emit("add-field"))
239
243
  }, {
240
- default: u(() => [
244
+ default: r(() => [
241
245
  n(_, { name: "add" }),
242
- a[1] || (a[1] = B(" 添加字段 ", -1))
246
+ o[1] || (o[1] = B(" 添加字段 ", -1))
243
247
  ]),
244
248
  _: 1
245
249
  }),
246
- p("div", Ue, [
247
- n(o(re), {
250
+ m("div", $e, [
251
+ n(a(ue), {
248
252
  data: c.model.parameters,
249
253
  "header-fixed": !0,
250
254
  scrollable: { y: !0 },
@@ -253,55 +257,55 @@ const P = (c, g) => {
253
257
  ref: i,
254
258
  style: { height: "100%" }
255
259
  }, {
256
- default: u(() => [
257
- n(o(I), {
260
+ default: r(() => [
261
+ n(a(S), {
258
262
  type: "index",
259
263
  width: "60",
260
264
  title: "序号"
261
265
  }),
262
- n(o(I), {
266
+ n(a(S), {
263
267
  type: "expand",
264
268
  width: "20"
265
269
  }, {
266
- default: u(({ row: t }) => [
267
- t.type === "Enum" ? (m(), v("div", Se, [
268
- p("div", we, [
269
- a[4] || (a[4] = p("h4", null, "默认选项(下拉框)", -1)),
270
- p("div", Ie, [
271
- (m(!0), v(T, null, G(t.options || [], (l, s) => (m(), v("div", {
272
- key: s,
270
+ default: r(({ row: e }) => [
271
+ e.type === "Enum" ? (p(), f("div", Se, [
272
+ m("div", Ie, [
273
+ o[4] || (o[4] = m("h4", null, "默认选项(下拉框)", -1)),
274
+ m("div", Ne, [
275
+ (p(!0), f(T, null, G(e.options || [], (t, d) => (p(), f("div", {
276
+ key: d,
273
277
  class: "enum-item"
274
278
  }, [
275
- n(o($), {
276
- modelValue: l.value,
277
- "onUpdate:modelValue": (r) => l.value = r,
279
+ n(a(R), {
280
+ modelValue: t.value,
281
+ "onUpdate:modelValue": (u) => t.value = u,
278
282
  placeholder: "值",
279
283
  size: "small",
280
284
  style: { width: "150px", "margin-right": "8px" }
281
285
  }, null, 8, ["modelValue", "onUpdate:modelValue"]),
282
- n(o($), {
283
- modelValue: l.label,
284
- "onUpdate:modelValue": (r) => l.label = r,
286
+ n(a(R), {
287
+ modelValue: t.label,
288
+ "onUpdate:modelValue": (u) => t.label = u,
285
289
  placeholder: "显示标签",
286
290
  size: "small",
287
291
  style: { width: "200px", "margin-right": "8px" }
288
292
  }, null, 8, ["modelValue", "onUpdate:modelValue"]),
289
- n(o(z), {
293
+ n(a(z), {
290
294
  type: "text",
291
295
  size: "small",
292
- onClick: (r) => e.$emit("insert-enum-after", t, s)
296
+ onClick: (u) => l.$emit("insert-enum-after", e, d)
293
297
  }, {
294
- default: u(() => [...a[2] || (a[2] = [
298
+ default: r(() => [...o[2] || (o[2] = [
295
299
  B("新增", -1)
296
300
  ])]),
297
301
  _: 1
298
302
  }, 8, ["onClick"]),
299
- n(o(z), {
303
+ n(a(z), {
300
304
  type: "text",
301
305
  size: "small",
302
- onClick: (r) => e.$emit("remove-enum", t, s)
306
+ onClick: (u) => l.$emit("remove-enum", e, d)
303
307
  }, {
304
- default: u(() => [...a[3] || (a[3] = [
308
+ default: r(() => [...o[3] || (o[3] = [
305
309
  B("删除", -1)
306
310
  ])]),
307
311
  _: 1
@@ -309,28 +313,28 @@ const P = (c, g) => {
309
313
  ]))), 128))
310
314
  ])
311
315
  ])
312
- ])) : t.type === "ModelRef" ? (m(), v("div", Ne, [
313
- p("div", De, [
314
- a[5] || (a[5] = p("h4", null, "引用的模型", -1)),
315
- p("div", Ae, [
316
- n(o(W), {
317
- modelValue: t.defaultValue,
318
- "onUpdate:modelValue": (l) => t.defaultValue = l,
316
+ ])) : e.type === "ModelRef" ? (p(), f("div", De, [
317
+ m("div", we, [
318
+ o[5] || (o[5] = m("h4", null, "引用的模型", -1)),
319
+ m("div", Ae, [
320
+ n(a(W), {
321
+ modelValue: e.defaultValue,
322
+ "onUpdate:modelValue": (t) => e.defaultValue = t,
319
323
  placeholder: "请选择要引用的模型",
320
324
  size: "small",
321
325
  style: { width: "100%" }
322
326
  }, {
323
- default: u(() => [
324
- (m(!0), v(T, null, G(y.value, (l) => (m(), te(o(N), {
325
- key: l.id,
326
- value: l.id,
327
- label: `${l.nameCn} (${l.nameEn})`
327
+ default: r(() => [
328
+ (p(!0), f(T, null, G(y.value, (t) => (p(), le(a(w), {
329
+ key: t.id,
330
+ value: t.id,
331
+ label: `${t.nameCn} (${t.nameEn})`
328
332
  }, null, 8, ["value", "label"]))), 128))
329
333
  ]),
330
334
  _: 1
331
335
  }, 8, ["modelValue", "onUpdate:modelValue"]),
332
- t.defaultValue ? (m(), v("div", Fe, [
333
- p("p", null, "已选择模型:" + D(b(t.defaultValue)), 1)
336
+ e.defaultValue ? (p(), f("div", Fe, [
337
+ m("p", null, "已选择模型:" + I(b(e.defaultValue)), 1)
334
338
  ])) : O("", !0)
335
339
  ])
336
340
  ])
@@ -338,135 +342,152 @@ const P = (c, g) => {
338
342
  ]),
339
343
  _: 1
340
344
  }),
341
- n(o(I), {
345
+ n(a(S), {
342
346
  field: "prop",
343
347
  title: "字段名称",
344
348
  width: "120"
345
349
  }, {
346
- default: u(({ row: t }) => [
347
- t.isEditing ? (m(), v("div", Le, [
348
- n(o($), {
349
- modelValue: t.prop,
350
- "onUpdate:modelValue": (l) => t.prop = l,
350
+ default: r(({ row: e }) => [
351
+ e.isEditing ? (p(), f("div", Le, [
352
+ n(a(R), {
353
+ modelValue: e.prop,
354
+ "onUpdate:modelValue": (t) => e.prop = t,
351
355
  placeholder: "请输入字段名称",
352
356
  size: "small"
353
357
  }, null, 8, ["modelValue", "onUpdate:modelValue"])
354
- ])) : (m(), v("div", qe, D(t.prop || "点击编辑"), 1))
358
+ ])) : (p(), f("div", qe, I(e.prop || "点击编辑"), 1))
355
359
  ]),
356
360
  _: 1
357
361
  }),
358
- n(o(I), {
362
+ n(a(S), {
359
363
  field: "type",
360
364
  title: "类型",
361
365
  width: "110"
362
366
  }, {
363
- default: u(({ row: t }) => [
364
- t.isEditing ? (m(), v("div", Te, [
365
- n(o(W), {
366
- modelValue: t.type,
367
- "onUpdate:modelValue": (l) => t.type = l,
367
+ default: r(({ row: e }) => [
368
+ e.isEditing ? (p(), f("div", Te, [
369
+ n(a(W), {
370
+ modelValue: e.type,
371
+ "onUpdate:modelValue": (t) => e.type = t,
368
372
  size: "small",
369
- onChange: (l) => h(t)
373
+ onChange: (t) => h(e)
370
374
  }, {
371
- default: u(() => [
372
- n(o(N), {
375
+ default: r(() => [
376
+ n(a(w), {
373
377
  value: "String",
374
378
  label: "字符串"
375
379
  }),
376
- n(o(N), {
380
+ n(a(w), {
377
381
  value: "Number",
378
382
  label: "数字"
379
383
  }),
380
- n(o(N), {
384
+ n(a(w), {
381
385
  value: "Boolean",
382
386
  label: "布尔值"
383
387
  }),
384
- n(o(N), {
388
+ n(a(w), {
385
389
  value: "Date",
386
390
  label: "日期"
387
391
  }),
388
- n(o(N), {
392
+ n(a(w), {
389
393
  value: "Enum",
390
394
  label: "枚举值"
391
395
  }),
392
- n(o(N), {
396
+ n(a(w), {
393
397
  value: "ModelRef",
394
398
  label: "模型引用"
395
399
  })
396
400
  ]),
397
401
  _: 1
398
402
  }, 8, ["modelValue", "onUpdate:modelValue", "onChange"])
399
- ])) : (m(), v("div", Be, D(C(t.type)), 1))
403
+ ])) : (p(), f("div", Be, I(V(e.type)), 1))
404
+ ]),
405
+ _: 1
406
+ }),
407
+ n(a(S), {
408
+ field: "defaultValue",
409
+ title: "默认值",
410
+ width: "120"
411
+ }, {
412
+ default: r(({ row: e }) => [
413
+ e.isEditing ? (p(), f("div", Oe, [
414
+ n(a(R), {
415
+ modelValue: e.defaultValue,
416
+ "onUpdate:modelValue": (t) => e.defaultValue = t,
417
+ placeholder: "请输入默认值",
418
+ size: "small"
419
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
420
+ ])) : (p(), f("div", Pe, I(e.defaultValue), 1))
400
421
  ]),
401
422
  _: 1
402
423
  }),
403
- n(o(I), {
424
+ n(a(S), {
404
425
  field: "required",
405
426
  title: "必填",
406
427
  width: "60"
407
428
  }, {
408
- default: u(({ row: t }) => [
409
- t.isEditing ? (m(), v("div", Oe, [
410
- n(o(X), {
411
- modelValue: t.required,
412
- "onUpdate:modelValue": (l) => t.required = l
429
+ default: r(({ row: e }) => [
430
+ e.isEditing ? (p(), f("div", ze, [
431
+ n(a(X), {
432
+ modelValue: e.required,
433
+ "onUpdate:modelValue": (t) => e.required = t
413
434
  }, null, 8, ["modelValue", "onUpdate:modelValue"])
414
- ])) : (m(), v("div", Pe, [
415
- n(o(X), {
416
- modelValue: t.required,
417
- "onUpdate:modelValue": (l) => t.required = l,
435
+ ])) : (p(), f("div", Ge, [
436
+ n(a(X), {
437
+ modelValue: e.required,
438
+ "onUpdate:modelValue": (t) => e.required = t,
418
439
  disabled: ""
419
440
  }, null, 8, ["modelValue", "onUpdate:modelValue"])
420
441
  ]))
421
442
  ]),
422
443
  _: 1
423
444
  }),
424
- n(o(I), {
445
+ n(a(S), {
425
446
  field: "description",
426
447
  title: "描述",
427
448
  width: "120"
428
449
  }, {
429
- default: u(({ row: t }) => [
430
- t.isEditing ? (m(), v("div", ze, [
431
- n(o($), {
432
- modelValue: t.description,
433
- "onUpdate:modelValue": (l) => t.description = l,
450
+ default: r(({ row: e }) => [
451
+ e.isEditing ? (p(), f("div", Ke, [
452
+ n(a(R), {
453
+ modelValue: e.description,
454
+ "onUpdate:modelValue": (t) => e.description = t,
434
455
  placeholder: "请输入字段描述",
435
456
  size: "small"
436
457
  }, null, 8, ["modelValue", "onUpdate:modelValue"])
437
- ])) : (m(), v("div", Ge, D(t.description || "点击编辑"), 1))
458
+ ])) : (p(), f("div", je, I(e.description || "点击编辑"), 1))
438
459
  ]),
439
460
  _: 1
440
461
  }),
441
- n(o(I), {
462
+ n(a(S), {
442
463
  field: "operation",
443
464
  title: "操作",
444
465
  width: "90"
445
466
  }, {
446
- default: u(({ row: t }) => [
447
- p("div", Ke, [
448
- t.isEditing ? (m(), v(T, { key: 0 }, [
449
- p("span", {
467
+ default: r(({ row: e }) => [
468
+ m("div", He, [
469
+ e.isEditing ? (p(), f(T, { key: 0 }, [
470
+ m("span", {
450
471
  type: "text",
451
472
  size: "mini",
452
- onClick: (l) => d(t)
453
- }, "保存", 8, je),
454
- p("span", {
473
+ onClick: (t) => s(e)
474
+ }, "保存", 8, Je),
475
+ m("span", {
455
476
  type: "text",
456
477
  size: "mini",
457
- onClick: (l) => M(t)
458
- }, "取消", 8, He)
459
- ], 64)) : (m(), v(T, { key: 1 }, [
460
- p("span", null, [
478
+ onClick: (t) => M(e)
479
+ }, "取消", 8, Qe)
480
+ ], 64)) : (p(), f(T, { key: 1 }, [
481
+ m("span", null, [
461
482
  n(_, {
462
483
  name: "to-edit",
463
- onClick: K((l) => U(t), ["stop"])
484
+ onClick: K((t) => $(e), ["stop"])
464
485
  }, null, 8, ["onClick"])
465
486
  ]),
466
- p("span", null, [
487
+ m("span", null, [
467
488
  n(_, {
468
489
  name: "delete",
469
- onClick: K((l) => S(t), ["stop"])
490
+ onClick: K((t) => N(e), ["stop"])
470
491
  }, null, 8, ["onClick"])
471
492
  ])
472
493
  ], 64))
@@ -481,39 +502,39 @@ const P = (c, g) => {
481
502
  ]);
482
503
  };
483
504
  }
484
- }, Qe = /* @__PURE__ */ P(Je, [["__scopeId", "data-v-0e237f07"]]), L = "/material-center/api/model";
485
- function We(c = {}) {
505
+ }, Xe = /* @__PURE__ */ P(We, [["__scopeId", "data-v-1e39724d"]]), L = "/material-center/api/model";
506
+ function Ye(c = {}) {
486
507
  return A(F.Http).get(`${L}/list`, { params: c });
487
508
  }
488
- function Xe(c) {
509
+ function Ze(c) {
489
510
  return A(F.Http).post(`${L}/create`, c);
490
511
  }
491
- function Ye(c, g) {
512
+ function el(c, g) {
492
513
  return A(F.Http).put(`${L}/update/${c}`, g);
493
514
  }
494
- function Ze(c) {
515
+ function ll(c) {
495
516
  return A(F.Http).delete(`${L}/delete/${c}`);
496
517
  }
497
- function et() {
518
+ function tl() {
498
519
  return A(F.Http).get(`${L}/table/list`);
499
520
  }
500
- function tt(c) {
521
+ function nl(c) {
501
522
  return A(F.Http).get(`${L}/table/${c}`);
502
523
  }
503
524
  const Q = E(!1), Y = () => {
504
525
  Q.value = !0;
505
526
  }, J = () => {
506
527
  Q.value = !1;
507
- }, lt = {
528
+ }, al = {
508
529
  components: {
509
530
  PluginSetting: _e,
510
531
  SvgButton: H,
511
532
  ButtonGroup: ge,
512
533
  ModelBasicForm: Re,
513
- FieldManager: Qe,
534
+ FieldManager: Xe,
514
535
  TinyButton: pe,
515
536
  TinyCollapse: ce,
516
- TinyCollapseItem: ue
537
+ TinyCollapseItem: re
517
538
  },
518
539
  props: {
519
540
  model: {
@@ -527,18 +548,18 @@ const Q = E(!1), Y = () => {
527
548
  },
528
549
  emits: ["editCallback", "exportModel"],
529
550
  setup(c, { emit: g }) {
530
- const { PLUGIN_NAME: x } = le(), i = E(["general", "fields"]), f = E(), y = E(), V = E({
551
+ const { PLUGIN_NAME: C } = te(), i = E(["general", "fields"]), v = E(), y = E(), x = E({
531
552
  expandAll: !1,
532
553
  trigger: "row",
533
554
  expandRowKeys: [],
534
555
  accordion: !1,
535
- activeMethod: (d) => d.type === "Enum" || d.type === "ModelRef",
556
+ activeMethod: (s) => s.type === "Enum" || s.type === "ModelRef",
536
557
  // 枚举类型和模型引用类型都显示展开箭头
537
- showIcon: (d) => d.type === "Enum" || d.type === "ModelRef"
558
+ showIcon: (s) => s.type === "Enum" || s.type === "ModelRef"
538
559
  // 枚举类型和模型引用类型都显示展开箭头
539
560
  }), b = () => {
540
- if (!f.value) return;
541
- const d = {
561
+ if (!v.value) return;
562
+ const s = {
542
563
  prop: "",
543
564
  type: "String",
544
565
  required: !1,
@@ -547,101 +568,101 @@ const Q = E(!1), Y = () => {
547
568
  isNew: !0
548
569
  // 新增字段标记
549
570
  };
550
- f.value.parameters.push(d), j(() => {
571
+ v.value.parameters.push(s), j(() => {
551
572
  const M = document.querySelectorAll(".editing-cell .tiny-input");
552
573
  M.length > 0 && M[M.length - 1].focus();
553
574
  });
554
- }, h = (d, M) => {
555
- d.options || (d.options = []), d.options.splice(M + 1, 0, { value: "", label: "" });
556
- }, C = (d, M) => {
557
- if (Array.isArray(d.options)) {
558
- if (d.options.length <= 1) {
559
- d.options[0] = { value: "", label: "" };
575
+ }, h = (s, M) => {
576
+ s.options || (s.options = []), s.options.splice(M + 1, 0, { value: "", label: "" });
577
+ }, V = (s, M) => {
578
+ if (Array.isArray(s.options)) {
579
+ if (s.options.length <= 1) {
580
+ s.options[0] = { value: "", label: "" };
560
581
  return;
561
582
  }
562
- d.options.splice(M, 1);
583
+ s.options.splice(M, 1);
563
584
  }
564
- }, U = async () => {
585
+ }, $ = async () => {
565
586
  var M;
566
- const d = (M = y.value) == null ? void 0 : M.getLocalValue();
567
- y.value.validate().then(async (S) => {
568
- var e;
569
- if (S) {
570
- const a = {
571
- description: d.description,
572
- modelUrl: d.modelUrl,
573
- nameCn: d.nameCn,
574
- nameEn: d.nameEn,
575
- version: d.version,
576
- id: d.id,
577
- parameters: d.parameters.filter((l) => !!l.prop)
587
+ const s = (M = y.value) == null ? void 0 : M.getLocalValue();
588
+ y.value.validate().then(async (N) => {
589
+ var l;
590
+ if (N) {
591
+ const o = {
592
+ description: s.description,
593
+ modelUrl: s.modelUrl,
594
+ nameCn: s.nameCn,
595
+ nameEn: s.nameEn,
596
+ version: s.version,
597
+ id: s.id,
598
+ parameters: s.parameters.filter((t) => !!t.prop)
578
599
  };
579
- let _ = !0, t = "";
580
- if (((e = a.parameters) == null ? void 0 : e.length) > 0 && a.parameters.forEach((l) => {
581
- l.type === "Enum" && (l.options = JSON.stringify(l.options)), l.type === "ModelRef" && (l.isModel = !0, delete l.options, l.defaultValue = l.defaultValue || null, _ = !!l.defaultValue, t = l.prop);
600
+ let _ = !0, e = "";
601
+ if (((l = o.parameters) == null ? void 0 : l.length) > 0 && o.parameters.forEach((t) => {
602
+ t.type === "Enum" && (t.options = JSON.stringify(t.options)), t.type === "ModelRef" && (t.isModel = !0, delete t.options, t.defaultValue = t.defaultValue || null, _ = !!t.defaultValue, e = t.prop);
582
603
  }), !_) {
583
604
  Notify({
584
605
  type: "error",
585
- message: `字段${t}未关联模型引用`
606
+ message: `字段${e}未关联模型引用`
586
607
  });
587
608
  return;
588
609
  }
589
- d.id === null ? (delete a.id, await Xe(a)) : await Ye(a.id, a), g("editCallback"), Notify({
610
+ s.id === null ? (delete o.id, await Ze(o)) : await el(o.id, o), g("editCallback"), Notify({
590
611
  type: "success",
591
612
  message: "保存成功"
592
- }), f.value = null;
613
+ }), v.value = null;
593
614
  }
594
615
  });
595
616
  };
596
617
  return Z(
597
618
  () => c.model,
598
- (d) => {
599
- f.value = d;
619
+ (s) => {
620
+ v.value = s;
600
621
  },
601
622
  { deep: !0 }
602
623
  ), {
603
624
  isShow: Q,
604
- PLUGIN_NAME: x,
625
+ PLUGIN_NAME: C,
605
626
  activeName: i,
606
627
  modelBasicFormRef: y,
607
- expandConfig: V,
608
- selectedModel: f,
628
+ expandConfig: x,
629
+ selectedModel: v,
609
630
  closeModelSettingPanel: J,
610
631
  handleAddField: b,
611
632
  insertEnumValueAfter: h,
612
- removeEnumValue: C,
613
- saveModel: U
633
+ removeEnumValue: V,
634
+ saveModel: $
614
635
  };
615
636
  }
616
637
  };
617
- function nt(c, g, x, i, f, y) {
618
- const V = k("tiny-button"), b = k("svg-button"), h = k("button-group"), C = k("model-basic-form"), U = k("tiny-collapse-item"), d = k("field-manager"), M = k("tiny-collapse"), S = k("plugin-setting");
619
- return i.isShow ? (m(), te(S, {
638
+ function ol(c, g, C, i, v, y) {
639
+ const x = k("tiny-button"), b = k("svg-button"), h = k("button-group"), V = k("model-basic-form"), $ = k("tiny-collapse-item"), s = k("field-manager"), M = k("tiny-collapse"), N = k("plugin-setting");
640
+ return i.isShow ? (p(), le(N, {
620
641
  key: 0,
621
642
  "fixed-name": i.PLUGIN_NAME.ModelManager,
622
643
  align: c.align,
623
644
  title: "模型设置",
624
645
  class: "modelmanager-plugin-setting"
625
646
  }, {
626
- header: u(() => [
647
+ header: r(() => [
627
648
  n(h, null, {
628
- default: u(() => [
629
- n(V, {
630
- onClick: g[0] || (g[0] = (e) => {
631
- var a;
632
- return c.$emit("exportModel", (a = i.selectedModel) == null ? void 0 : a.id);
649
+ default: r(() => [
650
+ n(x, {
651
+ onClick: g[0] || (g[0] = (l) => {
652
+ var o;
653
+ return c.$emit("exportModel", (o = i.selectedModel) == null ? void 0 : o.id);
633
654
  })
634
655
  }, {
635
- default: u(() => [...g[2] || (g[2] = [
656
+ default: r(() => [...g[2] || (g[2] = [
636
657
  B("导出SQL", -1)
637
658
  ])]),
638
659
  _: 1
639
660
  }),
640
- n(V, {
661
+ n(x, {
641
662
  type: "primary",
642
663
  onClick: i.saveModel
643
664
  }, {
644
- default: u(() => [...g[3] || (g[3] = [
665
+ default: r(() => [...g[3] || (g[3] = [
645
666
  B("保存", -1)
646
667
  ])]),
647
668
  _: 1
@@ -654,36 +675,36 @@ function nt(c, g, x, i, f, y) {
654
675
  _: 1
655
676
  })
656
677
  ]),
657
- content: u(() => [
678
+ content: r(() => [
658
679
  n(M, {
659
680
  modelValue: i.activeName,
660
- "onUpdate:modelValue": g[1] || (g[1] = (e) => i.activeName = e),
681
+ "onUpdate:modelValue": g[1] || (g[1] = (l) => i.activeName = l),
661
682
  class: "page-setting-collapse"
662
683
  }, {
663
- default: u(() => [
664
- n(U, {
684
+ default: r(() => [
685
+ n($, {
665
686
  title: "基本设置",
666
687
  name: "general"
667
688
  }, {
668
- default: u(() => [
669
- n(C, {
689
+ default: r(() => [
690
+ n(V, {
670
691
  ref: "modelBasicFormRef",
671
692
  model: i.selectedModel
672
693
  }, null, 8, ["model"])
673
694
  ]),
674
695
  _: 1
675
696
  }),
676
- n(U, {
697
+ n($, {
677
698
  class: "base-setting",
678
699
  title: "字段管理",
679
700
  name: "fields"
680
701
  }, {
681
- default: u(() => [
682
- n(d, {
702
+ default: r(() => [
703
+ n(s, {
683
704
  ref: "fieldManagerRef",
684
705
  model: i.selectedModel,
685
706
  "expand-config": i.expandConfig,
686
- "available-models": x.models,
707
+ "available-models": C.models,
687
708
  onAddField: i.handleAddField,
688
709
  onInsertEnumAfter: i.insertEnumValueAfter,
689
710
  onRemoveEnum: i.removeEnumValue
@@ -698,11 +719,11 @@ function nt(c, g, x, i, f, y) {
698
719
  _: 1
699
720
  }, 8, ["fixed-name", "align"])) : O("", !0);
700
721
  }
701
- const at = /* @__PURE__ */ P(lt, [["render", nt], ["__scopeId", "data-v-0287eead"]]), ot = { class: "plugin-modelmanager" }, it = {
722
+ const il = /* @__PURE__ */ P(al, [["render", ol], ["__scopeId", "data-v-6efda822"]]), dl = { class: "plugin-modelmanager" }, sl = {
702
723
  class: "model-manager-search",
703
724
  clearable: "",
704
725
  placeholder: "搜索"
705
- }, st = { class: "model-list" }, dt = ["onClick"], rt = { class: "model-info" }, ut = { class: "model-name" }, ct = { class: "model-english-name" }, pt = { class: "model-desc" }, mt = { class: "model-actions" }, ft = {
726
+ }, ul = { class: "model-list" }, rl = ["onClick"], cl = { class: "model-info" }, pl = { class: "model-name" }, ml = { class: "model-english-name" }, fl = { class: "model-desc" }, vl = { class: "model-actions" }, gl = {
706
727
  __name: "Main",
707
728
  props: {
708
729
  title: {
@@ -715,19 +736,19 @@ const at = /* @__PURE__ */ P(lt, [["render", nt], ["__scopeId", "data-v-0287eead
715
736
  },
716
737
  emits: ["close"],
717
738
  setup(c, { emit: g }) {
718
- const x = g, { PLUGIN_NAME: i } = le(), f = ve(), y = E(null), V = E([]), b = E(""), h = ae({
719
- emitEvent: x
739
+ const C = g, { PLUGIN_NAME: i } = te(), v = ve(), y = E(null), x = E([]), b = E(""), h = ae({
740
+ emitEvent: C
720
741
  });
721
742
  oe("panelState", h);
722
- const C = ee(() => b.value ? V.value.filter(
723
- (t) => (t.nameCn || "").toLowerCase().includes(b.value.toLowerCase()) || (t.description || "").toLowerCase().includes(b.value.toLowerCase())
724
- ) : V.value), U = () => {
725
- x("close"), J();
726
- }, d = (t) => {
727
- var l;
728
- ((l = t.parameters) == null ? void 0 : l.length) > 0 && t.parameters.forEach((s) => {
729
- s.isModel = !1, s.type === "Enum" && (s.options = typeof s.options == "string" ? JSON.parse(s.options) : s.options || []), s.type === "ModelRef" && (s.isModel = !0, s.defaultValue = Number(s.defaultValue));
730
- }), y.value = t, Y();
743
+ const V = ee(() => b.value ? x.value.filter(
744
+ (e) => (e.nameCn || "").toLowerCase().includes(b.value.toLowerCase()) || (e.description || "").toLowerCase().includes(b.value.toLowerCase())
745
+ ) : x.value), $ = () => {
746
+ C("close"), J();
747
+ }, s = (e) => {
748
+ var t;
749
+ ((t = e.parameters) == null ? void 0 : t.length) > 0 && e.parameters.forEach((d) => {
750
+ d.isModel = !1, d.type === "Enum" && (d.options = typeof d.options == "string" ? JSON.parse(d.options) : d.options || []), d.type === "ModelRef" && (d.isModel = !0, d.defaultValue = Number(d.defaultValue));
751
+ }), y.value = e, Y();
731
752
  }, M = () => {
732
753
  y.value = {
733
754
  id: null,
@@ -738,120 +759,120 @@ const at = /* @__PURE__ */ P(lt, [["render", nt], ["__scopeId", "data-v-0287eead
738
759
  description: "",
739
760
  parameters: []
740
761
  }, Y();
741
- }, S = async (t) => {
742
- var s;
743
- const l = t.nameCn || t.nameEn || t.id;
762
+ }, N = async (e) => {
763
+ var d;
764
+ const t = e.nameCn || e.nameEn || e.id;
744
765
  try {
745
- const r = await fe.confirm({
766
+ const u = await fe.confirm({
746
767
  title: "提示",
747
- message: `确认删除模型「${l}」吗?该操作不可恢复。`
768
+ message: `确认删除模型「${t}」吗?该操作不可恢复。`
748
769
  });
749
- if (!(r === "confirm" || (r == null ? void 0 : r.action) === "confirm" || r === !0 || r === void 0)) return;
750
- await Ze(t.id);
751
- const w = V.value.findIndex((ne) => ne.id === t.id);
752
- w > -1 && (V.value.splice(w, 1), ((s = y.value) == null ? void 0 : s.id) === t.id && (y.value = null));
770
+ if (!(u === "confirm" || (u == null ? void 0 : u.action) === "confirm" || u === !0 || u === void 0)) return;
771
+ await ll(e.id);
772
+ const D = x.value.findIndex((ne) => ne.id === e.id);
773
+ D > -1 && (x.value.splice(D, 1), ((d = y.value) == null ? void 0 : d.id) === e.id && (y.value = null));
753
774
  } catch {
754
775
  }
755
- }, e = async () => {
756
- const t = await We({
776
+ }, l = async () => {
777
+ const e = await Ye({
757
778
  currentPage: 1,
758
779
  pageSize: 500
759
780
  });
760
- V.value = t.records || [];
761
- }, a = async (t) => {
762
- var w;
763
- const l = t ? await tt(t) : await et(), s = new Blob([l], { type: "text/sql" }), r = URL.createObjectURL(s), R = document.createElement("a");
764
- R.href = r, R.download = `${t ? (w = y.value) == null ? void 0 : w.nameEn : "models"}.sql`, document.body.appendChild(R), R.click(), document.body.removeChild(R), URL.revokeObjectURL(r);
781
+ x.value = e.records || [];
782
+ }, o = async (e) => {
783
+ var D;
784
+ const t = e ? await nl(e) : await tl(), d = new Blob([t], { type: "text/sql" }), u = URL.createObjectURL(d), U = document.createElement("a");
785
+ U.href = u, U.download = `${e ? (D = y.value) == null ? void 0 : D.nameEn : "models"}.sql`, document.body.appendChild(U), U.click(), document.body.removeChild(U), URL.revokeObjectURL(u);
765
786
  }, _ = async () => {
766
- await e(), y.value = null, J();
787
+ await l(), y.value = null, J();
767
788
  };
768
789
  return ie(async () => {
769
- await e();
770
- }), (t, l) => {
771
- const s = k("svg-icon");
772
- return m(), v("div", ot, [
773
- n(o(ye), {
790
+ await l();
791
+ }), (e, t) => {
792
+ const d = k("svg-icon");
793
+ return p(), f("div", dl, [
794
+ n(a(ye), {
774
795
  title: c.title,
775
- "fixed-name": o(i).ModelManager,
796
+ "fixed-name": a(i).ModelManager,
776
797
  fixedPanels: c.fixedPanels,
777
- onClose: U
798
+ onClose: $
778
799
  }, {
779
- header: u(() => [
780
- n(o(H), {
800
+ header: r(() => [
801
+ n(a(H), {
781
802
  class: "add-icon",
782
803
  name: "add",
783
804
  placement: "bottom",
784
805
  tips: "新建模型",
785
806
  onClick: M
786
807
  }),
787
- n(o(H), {
808
+ n(a(H), {
788
809
  class: "flow-download-icon",
789
810
  name: "flow-download",
790
811
  placement: "bottom",
791
812
  tips: "导出SQL",
792
- onClick: a
813
+ onClick: o
793
814
  })
794
815
  ]),
795
- content: u(() => [
796
- p("div", it, [
797
- n(o(me), {
816
+ content: r(() => [
817
+ m("div", sl, [
818
+ n(a(me), {
798
819
  modelValue: b.value,
799
- "onUpdate:modelValue": l[0] || (l[0] = (r) => b.value = r)
820
+ "onUpdate:modelValue": t[0] || (t[0] = (u) => b.value = u)
800
821
  }, {
801
- prefix: u(() => [
802
- n(o(f))
822
+ prefix: r(() => [
823
+ n(a(v))
803
824
  ]),
804
825
  _: 1
805
826
  }, 8, ["modelValue"])
806
827
  ]),
807
- p("div", st, [
808
- V.value.length ? (m(!0), v(T, { key: 0 }, G(C.value, (r) => {
809
- var R;
810
- return m(), v("div", {
811
- key: r.id,
812
- class: se(["model-item", { active: ((R = y.value) == null ? void 0 : R.id) === r.id }]),
813
- onClick: (w) => d(r)
828
+ m("div", ul, [
829
+ x.value.length ? (p(!0), f(T, { key: 0 }, G(V.value, (u) => {
830
+ var U;
831
+ return p(), f("div", {
832
+ key: u.id,
833
+ class: de(["model-item", { active: ((U = y.value) == null ? void 0 : U.id) === u.id }]),
834
+ onClick: (D) => s(u)
814
835
  }, [
815
- p("div", rt, [
816
- p("div", ut, D(r.nameCn), 1),
817
- p("div", ct, D(r.nameEn), 1),
818
- p("div", pt, D(r.description || "暂无描述"), 1)
836
+ m("div", cl, [
837
+ m("div", pl, I(u.nameCn), 1),
838
+ m("div", ml, I(u.nameEn), 1),
839
+ m("div", fl, I(u.description || "暂无描述"), 1)
819
840
  ]),
820
- p("div", mt, [
821
- n(s, {
841
+ m("div", vl, [
842
+ n(d, {
822
843
  name: "delete",
823
- onClick: K((w) => S(r), ["stop"])
844
+ onClick: K((D) => N(u), ["stop"])
824
845
  }, null, 8, ["onClick"])
825
846
  ])
826
- ], 10, dt);
847
+ ], 10, rl);
827
848
  }), 128)) : O("", !0),
828
- n(o(he), {
829
- isShow: !V.value.length
849
+ n(a(he), {
850
+ isShow: !x.value.length
830
851
  }, null, 8, ["isShow"])
831
852
  ])
832
853
  ]),
833
854
  _: 1
834
855
  }, 8, ["title", "fixed-name", "fixedPanels"]),
835
- n(at, {
856
+ n(il, {
836
857
  model: y.value,
837
- models: V.value,
858
+ models: x.value,
838
859
  onEditCallback: _,
839
- onExportModel: a
860
+ onExportModel: o
840
861
  }, null, 8, ["model", "models"])
841
862
  ]);
842
863
  };
843
864
  }
844
- }, vt = /* @__PURE__ */ P(ft, [["__scopeId", "data-v-0c5de79e"]]), gt = {
865
+ }, _l = /* @__PURE__ */ P(gl, [["__scopeId", "data-v-0c5de79e"]]), yl = {
845
866
  id: "engine.plugins.modelmanager",
846
867
  title: "模型管理",
847
868
  type: "plugins",
848
869
  width: 280,
849
870
  icon: "plugin-icon-modelmanager"
850
- }, Mt = {
851
- ...gt,
852
- entry: vt
871
+ }, El = {
872
+ ...yl,
873
+ entry: _l
853
874
  };
854
875
  export {
855
- Mt as default
876
+ El as default
856
877
  };
857
878
  //# sourceMappingURL=index.js.map