@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 +349 -328
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
|
-
import { ref as E, watch as Z, createElementBlock as
|
|
3
|
-
import { Form as
|
|
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
|
|
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
|
|
9
|
-
for (const [i,
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
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
|
|
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
|
-
() =>
|
|
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: () =>
|
|
42
|
-
}), (b, h) => (
|
|
43
|
-
n(
|
|
38
|
+
validate: () => v.value.validate()
|
|
39
|
+
}), (b, h) => (p(), f("div", Ve, [
|
|
40
|
+
n(a(se), {
|
|
44
41
|
ref_key: "ruleFormRef",
|
|
45
|
-
ref:
|
|
42
|
+
ref: v,
|
|
46
43
|
model: i.value,
|
|
47
44
|
rules: y.value
|
|
48
45
|
}, {
|
|
49
|
-
default:
|
|
50
|
-
|
|
51
|
-
n(
|
|
46
|
+
default: r(() => [
|
|
47
|
+
m("div", Ce, [
|
|
48
|
+
n(a(q), {
|
|
52
49
|
label: "中文名称",
|
|
53
50
|
prop: "nameCn"
|
|
54
51
|
}, {
|
|
55
|
-
default:
|
|
56
|
-
n(
|
|
52
|
+
default: r(() => [
|
|
53
|
+
n(a(R), {
|
|
57
54
|
modelValue: i.value.nameCn,
|
|
58
|
-
"onUpdate:modelValue": h[0] || (h[0] = (
|
|
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
|
-
|
|
66
|
-
n(
|
|
62
|
+
m("div", xe, [
|
|
63
|
+
n(a(q), {
|
|
67
64
|
label: "英文名称",
|
|
68
65
|
prop: "nameEn"
|
|
69
66
|
}, {
|
|
70
|
-
default:
|
|
71
|
-
n(
|
|
67
|
+
default: r(() => [
|
|
68
|
+
n(a(R), {
|
|
72
69
|
modelValue: i.value.nameEn,
|
|
73
|
-
"onUpdate:modelValue": h[1] || (h[1] = (
|
|
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
|
-
|
|
81
|
-
n(
|
|
77
|
+
m("div", Me, [
|
|
78
|
+
n(a(q), {
|
|
82
79
|
label: "版本号",
|
|
83
80
|
prop: "version"
|
|
84
81
|
}, {
|
|
85
|
-
default:
|
|
86
|
-
n(
|
|
82
|
+
default: r(() => [
|
|
83
|
+
n(a(R), {
|
|
87
84
|
modelValue: i.value.version,
|
|
88
|
-
"onUpdate:modelValue": h[2] || (h[2] = (
|
|
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
|
-
|
|
96
|
-
n(
|
|
92
|
+
m("div", be, [
|
|
93
|
+
n(a(q), {
|
|
97
94
|
label: "模型地址",
|
|
98
95
|
prop: "modelUrl"
|
|
99
96
|
}, {
|
|
100
|
-
default:
|
|
101
|
-
n(
|
|
97
|
+
default: r(() => [
|
|
98
|
+
n(a(R), {
|
|
102
99
|
modelValue: i.value.modelUrl,
|
|
103
|
-
"onUpdate:modelValue": h[3] || (h[3] = (
|
|
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
|
-
|
|
111
|
-
n(
|
|
107
|
+
m("div", Ee, [
|
|
108
|
+
n(a(q), {
|
|
112
109
|
label: "描述",
|
|
113
110
|
prop: "description"
|
|
114
111
|
}, {
|
|
115
|
-
default:
|
|
116
|
-
n(
|
|
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] = (
|
|
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-
|
|
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
|
-
},
|
|
132
|
+
}, Ie = { class: "expand-section" }, Ne = { class: "enum-values" }, De = {
|
|
136
133
|
key: 1,
|
|
137
134
|
class: "expand-content"
|
|
138
|
-
},
|
|
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 = {
|
|
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
|
|
175
|
-
var
|
|
176
|
-
return ((
|
|
177
|
-
}, b = (
|
|
178
|
-
const
|
|
179
|
-
return
|
|
180
|
-
}, h = (
|
|
181
|
-
var
|
|
182
|
-
if (
|
|
183
|
-
|
|
184
|
-
var
|
|
185
|
-
(((
|
|
186
|
-
|
|
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
|
-
|
|
191
|
-
const
|
|
192
|
-
if (
|
|
193
|
-
const
|
|
194
|
-
|
|
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
|
-
|
|
201
|
+
v.value && v.value.parameters && (v.value.parameters = [...v.value.parameters]);
|
|
199
202
|
});
|
|
200
|
-
},
|
|
203
|
+
}, V = (l) => ({
|
|
201
204
|
String: "字符串",
|
|
202
205
|
Number: "数字",
|
|
203
206
|
Boolean: "布尔值",
|
|
204
207
|
Date: "日期",
|
|
205
208
|
Enum: "枚举值",
|
|
206
209
|
ModelRef: "模型引用"
|
|
207
|
-
})[
|
|
208
|
-
var
|
|
209
|
-
|
|
210
|
-
|
|
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
|
-
},
|
|
213
|
-
|
|
214
|
-
}, M = (
|
|
215
|
-
var
|
|
216
|
-
|
|
217
|
-
const _ = (((
|
|
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
|
|
220
|
-
|
|
222
|
+
const d = expandConfig.value.expandRowKeys.indexOf(_._RID);
|
|
223
|
+
d > -1 && expandConfig.value.expandRowKeys.splice(d, 1);
|
|
221
224
|
}
|
|
222
|
-
if (
|
|
223
|
-
const
|
|
224
|
-
|
|
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
|
-
},
|
|
227
|
-
const
|
|
228
|
-
|
|
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:
|
|
233
|
-
}), (
|
|
235
|
+
getGridData: x
|
|
236
|
+
}), (l, o) => {
|
|
234
237
|
const _ = k("svg-icon");
|
|
235
|
-
return
|
|
236
|
-
n(
|
|
238
|
+
return p(), f("div", Ue, [
|
|
239
|
+
n(a(z), {
|
|
240
|
+
class: "add-field-btn",
|
|
237
241
|
size: "mini",
|
|
238
|
-
onClick:
|
|
242
|
+
onClick: o[0] || (o[0] = (e) => l.$emit("add-field"))
|
|
239
243
|
}, {
|
|
240
|
-
default:
|
|
244
|
+
default: r(() => [
|
|
241
245
|
n(_, { name: "add" }),
|
|
242
|
-
|
|
246
|
+
o[1] || (o[1] = B(" 添加字段 ", -1))
|
|
243
247
|
]),
|
|
244
248
|
_: 1
|
|
245
249
|
}),
|
|
246
|
-
|
|
247
|
-
n(
|
|
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:
|
|
257
|
-
n(
|
|
260
|
+
default: r(() => [
|
|
261
|
+
n(a(S), {
|
|
258
262
|
type: "index",
|
|
259
263
|
width: "60",
|
|
260
264
|
title: "序号"
|
|
261
265
|
}),
|
|
262
|
-
n(
|
|
266
|
+
n(a(S), {
|
|
263
267
|
type: "expand",
|
|
264
268
|
width: "20"
|
|
265
269
|
}, {
|
|
266
|
-
default:
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
(
|
|
272
|
-
key:
|
|
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(
|
|
276
|
-
modelValue:
|
|
277
|
-
"onUpdate:modelValue": (
|
|
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(
|
|
283
|
-
modelValue:
|
|
284
|
-
"onUpdate:modelValue": (
|
|
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(
|
|
293
|
+
n(a(z), {
|
|
290
294
|
type: "text",
|
|
291
295
|
size: "small",
|
|
292
|
-
onClick: (
|
|
296
|
+
onClick: (u) => l.$emit("insert-enum-after", e, d)
|
|
293
297
|
}, {
|
|
294
|
-
default:
|
|
298
|
+
default: r(() => [...o[2] || (o[2] = [
|
|
295
299
|
B("新增", -1)
|
|
296
300
|
])]),
|
|
297
301
|
_: 1
|
|
298
302
|
}, 8, ["onClick"]),
|
|
299
|
-
n(
|
|
303
|
+
n(a(z), {
|
|
300
304
|
type: "text",
|
|
301
305
|
size: "small",
|
|
302
|
-
onClick: (
|
|
306
|
+
onClick: (u) => l.$emit("remove-enum", e, d)
|
|
303
307
|
}, {
|
|
304
|
-
default:
|
|
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
|
-
])) :
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
n(
|
|
317
|
-
modelValue:
|
|
318
|
-
"onUpdate:modelValue": (
|
|
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:
|
|
324
|
-
(
|
|
325
|
-
key:
|
|
326
|
-
value:
|
|
327
|
-
label: `${
|
|
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
|
-
|
|
333
|
-
|
|
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(
|
|
345
|
+
n(a(S), {
|
|
342
346
|
field: "prop",
|
|
343
347
|
title: "字段名称",
|
|
344
348
|
width: "120"
|
|
345
349
|
}, {
|
|
346
|
-
default:
|
|
347
|
-
|
|
348
|
-
n(
|
|
349
|
-
modelValue:
|
|
350
|
-
"onUpdate:modelValue": (
|
|
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
|
-
])) : (
|
|
358
|
+
])) : (p(), f("div", qe, I(e.prop || "点击编辑"), 1))
|
|
355
359
|
]),
|
|
356
360
|
_: 1
|
|
357
361
|
}),
|
|
358
|
-
n(
|
|
362
|
+
n(a(S), {
|
|
359
363
|
field: "type",
|
|
360
364
|
title: "类型",
|
|
361
365
|
width: "110"
|
|
362
366
|
}, {
|
|
363
|
-
default:
|
|
364
|
-
|
|
365
|
-
n(
|
|
366
|
-
modelValue:
|
|
367
|
-
"onUpdate:modelValue": (
|
|
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: (
|
|
373
|
+
onChange: (t) => h(e)
|
|
370
374
|
}, {
|
|
371
|
-
default:
|
|
372
|
-
n(
|
|
375
|
+
default: r(() => [
|
|
376
|
+
n(a(w), {
|
|
373
377
|
value: "String",
|
|
374
378
|
label: "字符串"
|
|
375
379
|
}),
|
|
376
|
-
n(
|
|
380
|
+
n(a(w), {
|
|
377
381
|
value: "Number",
|
|
378
382
|
label: "数字"
|
|
379
383
|
}),
|
|
380
|
-
n(
|
|
384
|
+
n(a(w), {
|
|
381
385
|
value: "Boolean",
|
|
382
386
|
label: "布尔值"
|
|
383
387
|
}),
|
|
384
|
-
n(
|
|
388
|
+
n(a(w), {
|
|
385
389
|
value: "Date",
|
|
386
390
|
label: "日期"
|
|
387
391
|
}),
|
|
388
|
-
n(
|
|
392
|
+
n(a(w), {
|
|
389
393
|
value: "Enum",
|
|
390
394
|
label: "枚举值"
|
|
391
395
|
}),
|
|
392
|
-
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
|
-
])) : (
|
|
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(
|
|
424
|
+
n(a(S), {
|
|
404
425
|
field: "required",
|
|
405
426
|
title: "必填",
|
|
406
427
|
width: "60"
|
|
407
428
|
}, {
|
|
408
|
-
default:
|
|
409
|
-
|
|
410
|
-
n(
|
|
411
|
-
modelValue:
|
|
412
|
-
"onUpdate:modelValue": (
|
|
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
|
-
])) : (
|
|
415
|
-
n(
|
|
416
|
-
modelValue:
|
|
417
|
-
"onUpdate:modelValue": (
|
|
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(
|
|
445
|
+
n(a(S), {
|
|
425
446
|
field: "description",
|
|
426
447
|
title: "描述",
|
|
427
448
|
width: "120"
|
|
428
449
|
}, {
|
|
429
|
-
default:
|
|
430
|
-
|
|
431
|
-
n(
|
|
432
|
-
modelValue:
|
|
433
|
-
"onUpdate:modelValue": (
|
|
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
|
-
])) : (
|
|
458
|
+
])) : (p(), f("div", je, I(e.description || "点击编辑"), 1))
|
|
438
459
|
]),
|
|
439
460
|
_: 1
|
|
440
461
|
}),
|
|
441
|
-
n(
|
|
462
|
+
n(a(S), {
|
|
442
463
|
field: "operation",
|
|
443
464
|
title: "操作",
|
|
444
465
|
width: "90"
|
|
445
466
|
}, {
|
|
446
|
-
default:
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
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: (
|
|
453
|
-
}, "保存", 8,
|
|
454
|
-
|
|
473
|
+
onClick: (t) => s(e)
|
|
474
|
+
}, "保存", 8, Je),
|
|
475
|
+
m("span", {
|
|
455
476
|
type: "text",
|
|
456
477
|
size: "mini",
|
|
457
|
-
onClick: (
|
|
458
|
-
}, "取消", 8,
|
|
459
|
-
], 64)) : (
|
|
460
|
-
|
|
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((
|
|
484
|
+
onClick: K((t) => $(e), ["stop"])
|
|
464
485
|
}, null, 8, ["onClick"])
|
|
465
486
|
]),
|
|
466
|
-
|
|
487
|
+
m("span", null, [
|
|
467
488
|
n(_, {
|
|
468
489
|
name: "delete",
|
|
469
|
-
onClick: K((
|
|
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
|
-
},
|
|
485
|
-
function
|
|
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
|
|
509
|
+
function Ze(c) {
|
|
489
510
|
return A(F.Http).post(`${L}/create`, c);
|
|
490
511
|
}
|
|
491
|
-
function
|
|
512
|
+
function el(c, g) {
|
|
492
513
|
return A(F.Http).put(`${L}/update/${c}`, g);
|
|
493
514
|
}
|
|
494
|
-
function
|
|
515
|
+
function ll(c) {
|
|
495
516
|
return A(F.Http).delete(`${L}/delete/${c}`);
|
|
496
517
|
}
|
|
497
|
-
function
|
|
518
|
+
function tl() {
|
|
498
519
|
return A(F.Http).get(`${L}/table/list`);
|
|
499
520
|
}
|
|
500
|
-
function
|
|
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
|
-
},
|
|
528
|
+
}, al = {
|
|
508
529
|
components: {
|
|
509
530
|
PluginSetting: _e,
|
|
510
531
|
SvgButton: H,
|
|
511
532
|
ButtonGroup: ge,
|
|
512
533
|
ModelBasicForm: Re,
|
|
513
|
-
FieldManager:
|
|
534
|
+
FieldManager: Xe,
|
|
514
535
|
TinyButton: pe,
|
|
515
536
|
TinyCollapse: ce,
|
|
516
|
-
TinyCollapseItem:
|
|
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:
|
|
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: (
|
|
556
|
+
activeMethod: (s) => s.type === "Enum" || s.type === "ModelRef",
|
|
536
557
|
// 枚举类型和模型引用类型都显示展开箭头
|
|
537
|
-
showIcon: (
|
|
558
|
+
showIcon: (s) => s.type === "Enum" || s.type === "ModelRef"
|
|
538
559
|
// 枚举类型和模型引用类型都显示展开箭头
|
|
539
560
|
}), b = () => {
|
|
540
|
-
if (!
|
|
541
|
-
const
|
|
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
|
-
|
|
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 = (
|
|
555
|
-
|
|
556
|
-
},
|
|
557
|
-
if (Array.isArray(
|
|
558
|
-
if (
|
|
559
|
-
|
|
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
|
-
|
|
583
|
+
s.options.splice(M, 1);
|
|
563
584
|
}
|
|
564
|
-
},
|
|
585
|
+
}, $ = async () => {
|
|
565
586
|
var M;
|
|
566
|
-
const
|
|
567
|
-
y.value.validate().then(async (
|
|
568
|
-
var
|
|
569
|
-
if (
|
|
570
|
-
const
|
|
571
|
-
description:
|
|
572
|
-
modelUrl:
|
|
573
|
-
nameCn:
|
|
574
|
-
nameEn:
|
|
575
|
-
version:
|
|
576
|
-
id:
|
|
577
|
-
parameters:
|
|
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,
|
|
580
|
-
if (((
|
|
581
|
-
|
|
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: `字段${
|
|
606
|
+
message: `字段${e}未关联模型引用`
|
|
586
607
|
});
|
|
587
608
|
return;
|
|
588
609
|
}
|
|
589
|
-
|
|
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
|
-
}),
|
|
613
|
+
}), v.value = null;
|
|
593
614
|
}
|
|
594
615
|
});
|
|
595
616
|
};
|
|
596
617
|
return Z(
|
|
597
618
|
() => c.model,
|
|
598
|
-
(
|
|
599
|
-
|
|
619
|
+
(s) => {
|
|
620
|
+
v.value = s;
|
|
600
621
|
},
|
|
601
622
|
{ deep: !0 }
|
|
602
623
|
), {
|
|
603
624
|
isShow: Q,
|
|
604
|
-
PLUGIN_NAME:
|
|
625
|
+
PLUGIN_NAME: C,
|
|
605
626
|
activeName: i,
|
|
606
627
|
modelBasicFormRef: y,
|
|
607
|
-
expandConfig:
|
|
608
|
-
selectedModel:
|
|
628
|
+
expandConfig: x,
|
|
629
|
+
selectedModel: v,
|
|
609
630
|
closeModelSettingPanel: J,
|
|
610
631
|
handleAddField: b,
|
|
611
632
|
insertEnumValueAfter: h,
|
|
612
|
-
removeEnumValue:
|
|
613
|
-
saveModel:
|
|
633
|
+
removeEnumValue: V,
|
|
634
|
+
saveModel: $
|
|
614
635
|
};
|
|
615
636
|
}
|
|
616
637
|
};
|
|
617
|
-
function
|
|
618
|
-
const
|
|
619
|
-
return i.isShow ? (
|
|
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:
|
|
647
|
+
header: r(() => [
|
|
627
648
|
n(h, null, {
|
|
628
|
-
default:
|
|
629
|
-
n(
|
|
630
|
-
onClick: g[0] || (g[0] = (
|
|
631
|
-
var
|
|
632
|
-
return c.$emit("exportModel", (
|
|
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:
|
|
656
|
+
default: r(() => [...g[2] || (g[2] = [
|
|
636
657
|
B("导出SQL", -1)
|
|
637
658
|
])]),
|
|
638
659
|
_: 1
|
|
639
660
|
}),
|
|
640
|
-
n(
|
|
661
|
+
n(x, {
|
|
641
662
|
type: "primary",
|
|
642
663
|
onClick: i.saveModel
|
|
643
664
|
}, {
|
|
644
|
-
default:
|
|
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:
|
|
678
|
+
content: r(() => [
|
|
658
679
|
n(M, {
|
|
659
680
|
modelValue: i.activeName,
|
|
660
|
-
"onUpdate:modelValue": g[1] || (g[1] = (
|
|
681
|
+
"onUpdate:modelValue": g[1] || (g[1] = (l) => i.activeName = l),
|
|
661
682
|
class: "page-setting-collapse"
|
|
662
683
|
}, {
|
|
663
|
-
default:
|
|
664
|
-
n(
|
|
684
|
+
default: r(() => [
|
|
685
|
+
n($, {
|
|
665
686
|
title: "基本设置",
|
|
666
687
|
name: "general"
|
|
667
688
|
}, {
|
|
668
|
-
default:
|
|
669
|
-
n(
|
|
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(
|
|
697
|
+
n($, {
|
|
677
698
|
class: "base-setting",
|
|
678
699
|
title: "字段管理",
|
|
679
700
|
name: "fields"
|
|
680
701
|
}, {
|
|
681
|
-
default:
|
|
682
|
-
n(
|
|
702
|
+
default: r(() => [
|
|
703
|
+
n(s, {
|
|
683
704
|
ref: "fieldManagerRef",
|
|
684
705
|
model: i.selectedModel,
|
|
685
706
|
"expand-config": i.expandConfig,
|
|
686
|
-
"available-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
|
|
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
|
-
},
|
|
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
|
|
719
|
-
emitEvent:
|
|
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
|
|
723
|
-
(
|
|
724
|
-
) :
|
|
725
|
-
|
|
726
|
-
},
|
|
727
|
-
var
|
|
728
|
-
((
|
|
729
|
-
|
|
730
|
-
}), y.value =
|
|
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
|
-
},
|
|
742
|
-
var
|
|
743
|
-
const
|
|
762
|
+
}, N = async (e) => {
|
|
763
|
+
var d;
|
|
764
|
+
const t = e.nameCn || e.nameEn || e.id;
|
|
744
765
|
try {
|
|
745
|
-
const
|
|
766
|
+
const u = await fe.confirm({
|
|
746
767
|
title: "提示",
|
|
747
|
-
message: `确认删除模型「${
|
|
768
|
+
message: `确认删除模型「${t}」吗?该操作不可恢复。`
|
|
748
769
|
});
|
|
749
|
-
if (!(
|
|
750
|
-
await
|
|
751
|
-
const
|
|
752
|
-
|
|
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
|
-
},
|
|
756
|
-
const
|
|
776
|
+
}, l = async () => {
|
|
777
|
+
const e = await Ye({
|
|
757
778
|
currentPage: 1,
|
|
758
779
|
pageSize: 500
|
|
759
780
|
});
|
|
760
|
-
|
|
761
|
-
},
|
|
762
|
-
var
|
|
763
|
-
const
|
|
764
|
-
|
|
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
|
|
787
|
+
await l(), y.value = null, J();
|
|
767
788
|
};
|
|
768
789
|
return ie(async () => {
|
|
769
|
-
await
|
|
770
|
-
}), (
|
|
771
|
-
const
|
|
772
|
-
return
|
|
773
|
-
n(
|
|
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":
|
|
796
|
+
"fixed-name": a(i).ModelManager,
|
|
776
797
|
fixedPanels: c.fixedPanels,
|
|
777
|
-
onClose:
|
|
798
|
+
onClose: $
|
|
778
799
|
}, {
|
|
779
|
-
header:
|
|
780
|
-
n(
|
|
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(
|
|
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:
|
|
813
|
+
onClick: o
|
|
793
814
|
})
|
|
794
815
|
]),
|
|
795
|
-
content:
|
|
796
|
-
|
|
797
|
-
n(
|
|
816
|
+
content: r(() => [
|
|
817
|
+
m("div", sl, [
|
|
818
|
+
n(a(me), {
|
|
798
819
|
modelValue: b.value,
|
|
799
|
-
"onUpdate:modelValue":
|
|
820
|
+
"onUpdate:modelValue": t[0] || (t[0] = (u) => b.value = u)
|
|
800
821
|
}, {
|
|
801
|
-
prefix:
|
|
802
|
-
n(
|
|
822
|
+
prefix: r(() => [
|
|
823
|
+
n(a(v))
|
|
803
824
|
]),
|
|
804
825
|
_: 1
|
|
805
826
|
}, 8, ["modelValue"])
|
|
806
827
|
]),
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
var
|
|
810
|
-
return
|
|
811
|
-
key:
|
|
812
|
-
class:
|
|
813
|
-
onClick: (
|
|
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
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
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
|
-
|
|
821
|
-
n(
|
|
841
|
+
m("div", vl, [
|
|
842
|
+
n(d, {
|
|
822
843
|
name: "delete",
|
|
823
|
-
onClick: K((
|
|
844
|
+
onClick: K((D) => N(u), ["stop"])
|
|
824
845
|
}, null, 8, ["onClick"])
|
|
825
846
|
])
|
|
826
|
-
], 10,
|
|
847
|
+
], 10, rl);
|
|
827
848
|
}), 128)) : O("", !0),
|
|
828
|
-
n(
|
|
829
|
-
isShow: !
|
|
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(
|
|
856
|
+
n(il, {
|
|
836
857
|
model: y.value,
|
|
837
|
-
models:
|
|
858
|
+
models: x.value,
|
|
838
859
|
onEditCallback: _,
|
|
839
|
-
onExportModel:
|
|
860
|
+
onExportModel: o
|
|
840
861
|
}, null, 8, ["model", "models"])
|
|
841
862
|
]);
|
|
842
863
|
};
|
|
843
864
|
}
|
|
844
|
-
},
|
|
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
|
-
},
|
|
851
|
-
...
|
|
852
|
-
entry:
|
|
871
|
+
}, El = {
|
|
872
|
+
...yl,
|
|
873
|
+
entry: _l
|
|
853
874
|
};
|
|
854
875
|
export {
|
|
855
|
-
|
|
876
|
+
El as default
|
|
856
877
|
};
|
|
857
878
|
//# sourceMappingURL=index.js.map
|