@opentiny/tiny-engine-plugin-model-manager 2.8.2-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/LICENSE +22 -0
- package/dist/index.js +857 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +1 -0
- package/package.json +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 - present TinyEngine Authors.
|
|
4
|
+
Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,857 @@
|
|
|
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";
|
|
4
|
+
import { IconSearch as ve } from "@opentiny/vue-icon";
|
|
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";
|
|
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 = {
|
|
13
|
+
__name: "ModelBasicForm",
|
|
14
|
+
props: {
|
|
15
|
+
model: { type: Object, required: !0 }
|
|
16
|
+
},
|
|
17
|
+
setup(c, { expose: g }) {
|
|
18
|
+
const x = c, i = E(x.model), f = E(), y = E({
|
|
19
|
+
nameCn: [
|
|
20
|
+
{ required: !0, message: "必填", trigger: "blur" },
|
|
21
|
+
{ min: 1, max: 32, message: "长度在1-32之间", trigger: "blur" }
|
|
22
|
+
],
|
|
23
|
+
nameEn: [
|
|
24
|
+
{ required: !0, message: "必填", trigger: "blur" },
|
|
25
|
+
{ min: 1, max: 32, message: "长度在1-32之间", trigger: "blur" }
|
|
26
|
+
],
|
|
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
|
+
]
|
|
32
|
+
});
|
|
33
|
+
return Z(
|
|
34
|
+
() => x.model,
|
|
35
|
+
(b) => {
|
|
36
|
+
i.value = b;
|
|
37
|
+
},
|
|
38
|
+
{ deep: !0 }
|
|
39
|
+
), g({
|
|
40
|
+
getLocalValue: () => i.value,
|
|
41
|
+
validate: () => f.value.validate()
|
|
42
|
+
}), (b, h) => (m(), v("div", Ce, [
|
|
43
|
+
n(o(de), {
|
|
44
|
+
ref_key: "ruleFormRef",
|
|
45
|
+
ref: f,
|
|
46
|
+
model: i.value,
|
|
47
|
+
rules: y.value
|
|
48
|
+
}, {
|
|
49
|
+
default: u(() => [
|
|
50
|
+
p("div", xe, [
|
|
51
|
+
n(o(q), {
|
|
52
|
+
label: "中文名称",
|
|
53
|
+
prop: "nameCn"
|
|
54
|
+
}, {
|
|
55
|
+
default: u(() => [
|
|
56
|
+
n(o($), {
|
|
57
|
+
modelValue: i.value.nameCn,
|
|
58
|
+
"onUpdate:modelValue": h[0] || (h[0] = (C) => i.value.nameCn = C),
|
|
59
|
+
placeholder: "请输入模型中文名称"
|
|
60
|
+
}, null, 8, ["modelValue"])
|
|
61
|
+
]),
|
|
62
|
+
_: 1
|
|
63
|
+
})
|
|
64
|
+
]),
|
|
65
|
+
p("div", Ve, [
|
|
66
|
+
n(o(q), {
|
|
67
|
+
label: "英文名称",
|
|
68
|
+
prop: "nameEn"
|
|
69
|
+
}, {
|
|
70
|
+
default: u(() => [
|
|
71
|
+
n(o($), {
|
|
72
|
+
modelValue: i.value.nameEn,
|
|
73
|
+
"onUpdate:modelValue": h[1] || (h[1] = (C) => i.value.nameEn = C),
|
|
74
|
+
placeholder: "请输入模型英文名称"
|
|
75
|
+
}, null, 8, ["modelValue"])
|
|
76
|
+
]),
|
|
77
|
+
_: 1
|
|
78
|
+
})
|
|
79
|
+
]),
|
|
80
|
+
p("div", Me, [
|
|
81
|
+
n(o(q), {
|
|
82
|
+
label: "版本号",
|
|
83
|
+
prop: "version"
|
|
84
|
+
}, {
|
|
85
|
+
default: u(() => [
|
|
86
|
+
n(o($), {
|
|
87
|
+
modelValue: i.value.version,
|
|
88
|
+
"onUpdate:modelValue": h[2] || (h[2] = (C) => i.value.version = C),
|
|
89
|
+
placeholder: "1.0.0"
|
|
90
|
+
}, null, 8, ["modelValue"])
|
|
91
|
+
]),
|
|
92
|
+
_: 1
|
|
93
|
+
})
|
|
94
|
+
]),
|
|
95
|
+
p("div", be, [
|
|
96
|
+
n(o(q), {
|
|
97
|
+
label: "模型地址",
|
|
98
|
+
prop: "modelUrl"
|
|
99
|
+
}, {
|
|
100
|
+
default: u(() => [
|
|
101
|
+
n(o($), {
|
|
102
|
+
modelValue: i.value.modelUrl,
|
|
103
|
+
"onUpdate:modelValue": h[3] || (h[3] = (C) => i.value.modelUrl = C),
|
|
104
|
+
placeholder: "请输入模型地址,如:https://api.example.com/model"
|
|
105
|
+
}, null, 8, ["modelValue"])
|
|
106
|
+
]),
|
|
107
|
+
_: 1
|
|
108
|
+
})
|
|
109
|
+
]),
|
|
110
|
+
p("div", Ee, [
|
|
111
|
+
n(o(q), {
|
|
112
|
+
label: "描述",
|
|
113
|
+
prop: "description"
|
|
114
|
+
}, {
|
|
115
|
+
default: u(() => [
|
|
116
|
+
n(o($), {
|
|
117
|
+
type: "textarea",
|
|
118
|
+
rows: 3,
|
|
119
|
+
modelValue: i.value.description,
|
|
120
|
+
"onUpdate:modelValue": h[4] || (h[4] = (C) => i.value.description = C),
|
|
121
|
+
placeholder: "请输入模型描述"
|
|
122
|
+
}, null, 8, ["modelValue"])
|
|
123
|
+
]),
|
|
124
|
+
_: 1
|
|
125
|
+
})
|
|
126
|
+
])
|
|
127
|
+
]),
|
|
128
|
+
_: 1
|
|
129
|
+
}, 8, ["model", "rules"])
|
|
130
|
+
]));
|
|
131
|
+
}
|
|
132
|
+
}, Re = /* @__PURE__ */ P(ke, [["__scopeId", "data-v-1f80f91c"]]), $e = { class: "section" }, Ue = { class: "field-table" }, Se = {
|
|
133
|
+
key: 0,
|
|
134
|
+
class: "expand-content"
|
|
135
|
+
}, we = { class: "expand-section" }, Ie = { class: "enum-values" }, Ne = {
|
|
136
|
+
key: 1,
|
|
137
|
+
class: "expand-content"
|
|
138
|
+
}, De = { class: "expand-section" }, Ae = { class: "model-ref-section" }, Fe = {
|
|
139
|
+
key: 0,
|
|
140
|
+
class: "model-ref-info"
|
|
141
|
+
}, Le = {
|
|
142
|
+
key: 0,
|
|
143
|
+
class: "editing-cell"
|
|
144
|
+
}, qe = {
|
|
145
|
+
key: 1,
|
|
146
|
+
class: "readonly-cell"
|
|
147
|
+
}, Te = {
|
|
148
|
+
key: 0,
|
|
149
|
+
class: "editing-cell"
|
|
150
|
+
}, Be = {
|
|
151
|
+
key: 1,
|
|
152
|
+
class: "readonly-cell"
|
|
153
|
+
}, Oe = {
|
|
154
|
+
key: 0,
|
|
155
|
+
class: "editing-cell"
|
|
156
|
+
}, Pe = {
|
|
157
|
+
key: 1,
|
|
158
|
+
class: "readonly-cell"
|
|
159
|
+
}, ze = {
|
|
160
|
+
key: 0,
|
|
161
|
+
class: "editing-cell"
|
|
162
|
+
}, Ge = {
|
|
163
|
+
key: 1,
|
|
164
|
+
class: "readonly-cell"
|
|
165
|
+
}, Ke = { class: "field-actions" }, je = ["onClick"], He = ["onClick"], Je = {
|
|
166
|
+
__name: "FieldManager",
|
|
167
|
+
props: {
|
|
168
|
+
model: { type: Object, required: !0 },
|
|
169
|
+
expandConfig: { type: Object, required: !0 },
|
|
170
|
+
availableModels: { type: Array, default: () => [] }
|
|
171
|
+
},
|
|
172
|
+
emits: ["insert-enum-after", "remove-enum"],
|
|
173
|
+
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);
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
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);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
j(() => {
|
|
198
|
+
f.value && f.value.parameters && (f.value.parameters = [...f.value.parameters]);
|
|
199
|
+
});
|
|
200
|
+
}, C = (e) => ({
|
|
201
|
+
String: "字符串",
|
|
202
|
+
Number: "数字",
|
|
203
|
+
Boolean: "布尔值",
|
|
204
|
+
Date: "日期",
|
|
205
|
+
Enum: "枚举值",
|
|
206
|
+
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);
|
|
211
|
+
}));
|
|
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);
|
|
218
|
+
if (_) {
|
|
219
|
+
const s = expandConfig.value.expandRowKeys.indexOf(_._RID);
|
|
220
|
+
s > -1 && expandConfig.value.expandRowKeys.splice(s, 1);
|
|
221
|
+
}
|
|
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
|
+
}
|
|
226
|
+
}, S = (e) => {
|
|
227
|
+
const a = f.value.parameters.findIndex((_) => _.prop === e.prop);
|
|
228
|
+
a > -1 && f.value.parameters.splice(a, 1);
|
|
229
|
+
};
|
|
230
|
+
return g({
|
|
231
|
+
fieldGrid: i,
|
|
232
|
+
getGridData: V
|
|
233
|
+
}), (e, a) => {
|
|
234
|
+
const _ = k("svg-icon");
|
|
235
|
+
return m(), v("div", $e, [
|
|
236
|
+
n(o(z), {
|
|
237
|
+
size: "mini",
|
|
238
|
+
onClick: a[0] || (a[0] = (t) => e.$emit("add-field"))
|
|
239
|
+
}, {
|
|
240
|
+
default: u(() => [
|
|
241
|
+
n(_, { name: "add" }),
|
|
242
|
+
a[1] || (a[1] = B(" 添加字段 ", -1))
|
|
243
|
+
]),
|
|
244
|
+
_: 1
|
|
245
|
+
}),
|
|
246
|
+
p("div", Ue, [
|
|
247
|
+
n(o(re), {
|
|
248
|
+
data: c.model.parameters,
|
|
249
|
+
"header-fixed": !0,
|
|
250
|
+
scrollable: { y: !0 },
|
|
251
|
+
"expand-config": c.expandConfig,
|
|
252
|
+
ref_key: "fieldGrid",
|
|
253
|
+
ref: i,
|
|
254
|
+
style: { height: "100%" }
|
|
255
|
+
}, {
|
|
256
|
+
default: u(() => [
|
|
257
|
+
n(o(I), {
|
|
258
|
+
type: "index",
|
|
259
|
+
width: "60",
|
|
260
|
+
title: "序号"
|
|
261
|
+
}),
|
|
262
|
+
n(o(I), {
|
|
263
|
+
type: "expand",
|
|
264
|
+
width: "20"
|
|
265
|
+
}, {
|
|
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,
|
|
273
|
+
class: "enum-item"
|
|
274
|
+
}, [
|
|
275
|
+
n(o($), {
|
|
276
|
+
modelValue: l.value,
|
|
277
|
+
"onUpdate:modelValue": (r) => l.value = r,
|
|
278
|
+
placeholder: "值",
|
|
279
|
+
size: "small",
|
|
280
|
+
style: { width: "150px", "margin-right": "8px" }
|
|
281
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
282
|
+
n(o($), {
|
|
283
|
+
modelValue: l.label,
|
|
284
|
+
"onUpdate:modelValue": (r) => l.label = r,
|
|
285
|
+
placeholder: "显示标签",
|
|
286
|
+
size: "small",
|
|
287
|
+
style: { width: "200px", "margin-right": "8px" }
|
|
288
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
289
|
+
n(o(z), {
|
|
290
|
+
type: "text",
|
|
291
|
+
size: "small",
|
|
292
|
+
onClick: (r) => e.$emit("insert-enum-after", t, s)
|
|
293
|
+
}, {
|
|
294
|
+
default: u(() => [...a[2] || (a[2] = [
|
|
295
|
+
B("新增", -1)
|
|
296
|
+
])]),
|
|
297
|
+
_: 1
|
|
298
|
+
}, 8, ["onClick"]),
|
|
299
|
+
n(o(z), {
|
|
300
|
+
type: "text",
|
|
301
|
+
size: "small",
|
|
302
|
+
onClick: (r) => e.$emit("remove-enum", t, s)
|
|
303
|
+
}, {
|
|
304
|
+
default: u(() => [...a[3] || (a[3] = [
|
|
305
|
+
B("删除", -1)
|
|
306
|
+
])]),
|
|
307
|
+
_: 1
|
|
308
|
+
}, 8, ["onClick"])
|
|
309
|
+
]))), 128))
|
|
310
|
+
])
|
|
311
|
+
])
|
|
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,
|
|
319
|
+
placeholder: "请选择要引用的模型",
|
|
320
|
+
size: "small",
|
|
321
|
+
style: { width: "100%" }
|
|
322
|
+
}, {
|
|
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})`
|
|
328
|
+
}, null, 8, ["value", "label"]))), 128))
|
|
329
|
+
]),
|
|
330
|
+
_: 1
|
|
331
|
+
}, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
332
|
+
t.defaultValue ? (m(), v("div", Fe, [
|
|
333
|
+
p("p", null, "已选择模型:" + D(b(t.defaultValue)), 1)
|
|
334
|
+
])) : O("", !0)
|
|
335
|
+
])
|
|
336
|
+
])
|
|
337
|
+
])) : O("", !0)
|
|
338
|
+
]),
|
|
339
|
+
_: 1
|
|
340
|
+
}),
|
|
341
|
+
n(o(I), {
|
|
342
|
+
field: "prop",
|
|
343
|
+
title: "字段名称",
|
|
344
|
+
width: "120"
|
|
345
|
+
}, {
|
|
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,
|
|
351
|
+
placeholder: "请输入字段名称",
|
|
352
|
+
size: "small"
|
|
353
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
354
|
+
])) : (m(), v("div", qe, D(t.prop || "点击编辑"), 1))
|
|
355
|
+
]),
|
|
356
|
+
_: 1
|
|
357
|
+
}),
|
|
358
|
+
n(o(I), {
|
|
359
|
+
field: "type",
|
|
360
|
+
title: "类型",
|
|
361
|
+
width: "110"
|
|
362
|
+
}, {
|
|
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,
|
|
368
|
+
size: "small",
|
|
369
|
+
onChange: (l) => h(t)
|
|
370
|
+
}, {
|
|
371
|
+
default: u(() => [
|
|
372
|
+
n(o(N), {
|
|
373
|
+
value: "String",
|
|
374
|
+
label: "字符串"
|
|
375
|
+
}),
|
|
376
|
+
n(o(N), {
|
|
377
|
+
value: "Number",
|
|
378
|
+
label: "数字"
|
|
379
|
+
}),
|
|
380
|
+
n(o(N), {
|
|
381
|
+
value: "Boolean",
|
|
382
|
+
label: "布尔值"
|
|
383
|
+
}),
|
|
384
|
+
n(o(N), {
|
|
385
|
+
value: "Date",
|
|
386
|
+
label: "日期"
|
|
387
|
+
}),
|
|
388
|
+
n(o(N), {
|
|
389
|
+
value: "Enum",
|
|
390
|
+
label: "枚举值"
|
|
391
|
+
}),
|
|
392
|
+
n(o(N), {
|
|
393
|
+
value: "ModelRef",
|
|
394
|
+
label: "模型引用"
|
|
395
|
+
})
|
|
396
|
+
]),
|
|
397
|
+
_: 1
|
|
398
|
+
}, 8, ["modelValue", "onUpdate:modelValue", "onChange"])
|
|
399
|
+
])) : (m(), v("div", Be, D(C(t.type)), 1))
|
|
400
|
+
]),
|
|
401
|
+
_: 1
|
|
402
|
+
}),
|
|
403
|
+
n(o(I), {
|
|
404
|
+
field: "required",
|
|
405
|
+
title: "必填",
|
|
406
|
+
width: "60"
|
|
407
|
+
}, {
|
|
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
|
|
413
|
+
}, 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,
|
|
418
|
+
disabled: ""
|
|
419
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
420
|
+
]))
|
|
421
|
+
]),
|
|
422
|
+
_: 1
|
|
423
|
+
}),
|
|
424
|
+
n(o(I), {
|
|
425
|
+
field: "description",
|
|
426
|
+
title: "描述",
|
|
427
|
+
width: "120"
|
|
428
|
+
}, {
|
|
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,
|
|
434
|
+
placeholder: "请输入字段描述",
|
|
435
|
+
size: "small"
|
|
436
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
437
|
+
])) : (m(), v("div", Ge, D(t.description || "点击编辑"), 1))
|
|
438
|
+
]),
|
|
439
|
+
_: 1
|
|
440
|
+
}),
|
|
441
|
+
n(o(I), {
|
|
442
|
+
field: "operation",
|
|
443
|
+
title: "操作",
|
|
444
|
+
width: "90"
|
|
445
|
+
}, {
|
|
446
|
+
default: u(({ row: t }) => [
|
|
447
|
+
p("div", Ke, [
|
|
448
|
+
t.isEditing ? (m(), v(T, { key: 0 }, [
|
|
449
|
+
p("span", {
|
|
450
|
+
type: "text",
|
|
451
|
+
size: "mini",
|
|
452
|
+
onClick: (l) => d(t)
|
|
453
|
+
}, "保存", 8, je),
|
|
454
|
+
p("span", {
|
|
455
|
+
type: "text",
|
|
456
|
+
size: "mini",
|
|
457
|
+
onClick: (l) => M(t)
|
|
458
|
+
}, "取消", 8, He)
|
|
459
|
+
], 64)) : (m(), v(T, { key: 1 }, [
|
|
460
|
+
p("span", null, [
|
|
461
|
+
n(_, {
|
|
462
|
+
name: "to-edit",
|
|
463
|
+
onClick: K((l) => U(t), ["stop"])
|
|
464
|
+
}, null, 8, ["onClick"])
|
|
465
|
+
]),
|
|
466
|
+
p("span", null, [
|
|
467
|
+
n(_, {
|
|
468
|
+
name: "delete",
|
|
469
|
+
onClick: K((l) => S(t), ["stop"])
|
|
470
|
+
}, null, 8, ["onClick"])
|
|
471
|
+
])
|
|
472
|
+
], 64))
|
|
473
|
+
])
|
|
474
|
+
]),
|
|
475
|
+
_: 1
|
|
476
|
+
})
|
|
477
|
+
]),
|
|
478
|
+
_: 1
|
|
479
|
+
}, 8, ["data", "expand-config"])
|
|
480
|
+
])
|
|
481
|
+
]);
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
}, Qe = /* @__PURE__ */ P(Je, [["__scopeId", "data-v-0e237f07"]]), L = "/material-center/api/model";
|
|
485
|
+
function We(c = {}) {
|
|
486
|
+
return A(F.Http).get(`${L}/list`, { params: c });
|
|
487
|
+
}
|
|
488
|
+
function Xe(c) {
|
|
489
|
+
return A(F.Http).post(`${L}/create`, c);
|
|
490
|
+
}
|
|
491
|
+
function Ye(c, g) {
|
|
492
|
+
return A(F.Http).put(`${L}/update/${c}`, g);
|
|
493
|
+
}
|
|
494
|
+
function Ze(c) {
|
|
495
|
+
return A(F.Http).delete(`${L}/delete/${c}`);
|
|
496
|
+
}
|
|
497
|
+
function et() {
|
|
498
|
+
return A(F.Http).get(`${L}/table/list`);
|
|
499
|
+
}
|
|
500
|
+
function tt(c) {
|
|
501
|
+
return A(F.Http).get(`${L}/table/${c}`);
|
|
502
|
+
}
|
|
503
|
+
const Q = E(!1), Y = () => {
|
|
504
|
+
Q.value = !0;
|
|
505
|
+
}, J = () => {
|
|
506
|
+
Q.value = !1;
|
|
507
|
+
}, lt = {
|
|
508
|
+
components: {
|
|
509
|
+
PluginSetting: _e,
|
|
510
|
+
SvgButton: H,
|
|
511
|
+
ButtonGroup: ge,
|
|
512
|
+
ModelBasicForm: Re,
|
|
513
|
+
FieldManager: Qe,
|
|
514
|
+
TinyButton: pe,
|
|
515
|
+
TinyCollapse: ce,
|
|
516
|
+
TinyCollapseItem: ue
|
|
517
|
+
},
|
|
518
|
+
props: {
|
|
519
|
+
model: {
|
|
520
|
+
type: Object,
|
|
521
|
+
default: () => ({})
|
|
522
|
+
},
|
|
523
|
+
models: {
|
|
524
|
+
type: Array,
|
|
525
|
+
default: () => []
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
emits: ["editCallback", "exportModel"],
|
|
529
|
+
setup(c, { emit: g }) {
|
|
530
|
+
const { PLUGIN_NAME: x } = le(), i = E(["general", "fields"]), f = E(), y = E(), V = E({
|
|
531
|
+
expandAll: !1,
|
|
532
|
+
trigger: "row",
|
|
533
|
+
expandRowKeys: [],
|
|
534
|
+
accordion: !1,
|
|
535
|
+
activeMethod: (d) => d.type === "Enum" || d.type === "ModelRef",
|
|
536
|
+
// 枚举类型和模型引用类型都显示展开箭头
|
|
537
|
+
showIcon: (d) => d.type === "Enum" || d.type === "ModelRef"
|
|
538
|
+
// 枚举类型和模型引用类型都显示展开箭头
|
|
539
|
+
}), b = () => {
|
|
540
|
+
if (!f.value) return;
|
|
541
|
+
const d = {
|
|
542
|
+
prop: "",
|
|
543
|
+
type: "String",
|
|
544
|
+
required: !1,
|
|
545
|
+
description: "",
|
|
546
|
+
isEditing: !0,
|
|
547
|
+
isNew: !0
|
|
548
|
+
// 新增字段标记
|
|
549
|
+
};
|
|
550
|
+
f.value.parameters.push(d), j(() => {
|
|
551
|
+
const M = document.querySelectorAll(".editing-cell .tiny-input");
|
|
552
|
+
M.length > 0 && M[M.length - 1].focus();
|
|
553
|
+
});
|
|
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: "" };
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
d.options.splice(M, 1);
|
|
563
|
+
}
|
|
564
|
+
}, U = async () => {
|
|
565
|
+
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)
|
|
578
|
+
};
|
|
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);
|
|
582
|
+
}), !_) {
|
|
583
|
+
Notify({
|
|
584
|
+
type: "error",
|
|
585
|
+
message: `字段${t}未关联模型引用`
|
|
586
|
+
});
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
d.id === null ? (delete a.id, await Xe(a)) : await Ye(a.id, a), g("editCallback"), Notify({
|
|
590
|
+
type: "success",
|
|
591
|
+
message: "保存成功"
|
|
592
|
+
}), f.value = null;
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
};
|
|
596
|
+
return Z(
|
|
597
|
+
() => c.model,
|
|
598
|
+
(d) => {
|
|
599
|
+
f.value = d;
|
|
600
|
+
},
|
|
601
|
+
{ deep: !0 }
|
|
602
|
+
), {
|
|
603
|
+
isShow: Q,
|
|
604
|
+
PLUGIN_NAME: x,
|
|
605
|
+
activeName: i,
|
|
606
|
+
modelBasicFormRef: y,
|
|
607
|
+
expandConfig: V,
|
|
608
|
+
selectedModel: f,
|
|
609
|
+
closeModelSettingPanel: J,
|
|
610
|
+
handleAddField: b,
|
|
611
|
+
insertEnumValueAfter: h,
|
|
612
|
+
removeEnumValue: C,
|
|
613
|
+
saveModel: U
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
};
|
|
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, {
|
|
620
|
+
key: 0,
|
|
621
|
+
"fixed-name": i.PLUGIN_NAME.ModelManager,
|
|
622
|
+
align: c.align,
|
|
623
|
+
title: "模型设置",
|
|
624
|
+
class: "modelmanager-plugin-setting"
|
|
625
|
+
}, {
|
|
626
|
+
header: u(() => [
|
|
627
|
+
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);
|
|
633
|
+
})
|
|
634
|
+
}, {
|
|
635
|
+
default: u(() => [...g[2] || (g[2] = [
|
|
636
|
+
B("导出SQL", -1)
|
|
637
|
+
])]),
|
|
638
|
+
_: 1
|
|
639
|
+
}),
|
|
640
|
+
n(V, {
|
|
641
|
+
type: "primary",
|
|
642
|
+
onClick: i.saveModel
|
|
643
|
+
}, {
|
|
644
|
+
default: u(() => [...g[3] || (g[3] = [
|
|
645
|
+
B("保存", -1)
|
|
646
|
+
])]),
|
|
647
|
+
_: 1
|
|
648
|
+
}, 8, ["onClick"]),
|
|
649
|
+
n(b, {
|
|
650
|
+
name: "close",
|
|
651
|
+
onClick: i.closeModelSettingPanel
|
|
652
|
+
}, null, 8, ["onClick"])
|
|
653
|
+
]),
|
|
654
|
+
_: 1
|
|
655
|
+
})
|
|
656
|
+
]),
|
|
657
|
+
content: u(() => [
|
|
658
|
+
n(M, {
|
|
659
|
+
modelValue: i.activeName,
|
|
660
|
+
"onUpdate:modelValue": g[1] || (g[1] = (e) => i.activeName = e),
|
|
661
|
+
class: "page-setting-collapse"
|
|
662
|
+
}, {
|
|
663
|
+
default: u(() => [
|
|
664
|
+
n(U, {
|
|
665
|
+
title: "基本设置",
|
|
666
|
+
name: "general"
|
|
667
|
+
}, {
|
|
668
|
+
default: u(() => [
|
|
669
|
+
n(C, {
|
|
670
|
+
ref: "modelBasicFormRef",
|
|
671
|
+
model: i.selectedModel
|
|
672
|
+
}, null, 8, ["model"])
|
|
673
|
+
]),
|
|
674
|
+
_: 1
|
|
675
|
+
}),
|
|
676
|
+
n(U, {
|
|
677
|
+
class: "base-setting",
|
|
678
|
+
title: "字段管理",
|
|
679
|
+
name: "fields"
|
|
680
|
+
}, {
|
|
681
|
+
default: u(() => [
|
|
682
|
+
n(d, {
|
|
683
|
+
ref: "fieldManagerRef",
|
|
684
|
+
model: i.selectedModel,
|
|
685
|
+
"expand-config": i.expandConfig,
|
|
686
|
+
"available-models": x.models,
|
|
687
|
+
onAddField: i.handleAddField,
|
|
688
|
+
onInsertEnumAfter: i.insertEnumValueAfter,
|
|
689
|
+
onRemoveEnum: i.removeEnumValue
|
|
690
|
+
}, null, 8, ["model", "expand-config", "available-models", "onAddField", "onInsertEnumAfter", "onRemoveEnum"])
|
|
691
|
+
]),
|
|
692
|
+
_: 1
|
|
693
|
+
})
|
|
694
|
+
]),
|
|
695
|
+
_: 1
|
|
696
|
+
}, 8, ["modelValue"])
|
|
697
|
+
]),
|
|
698
|
+
_: 1
|
|
699
|
+
}, 8, ["fixed-name", "align"])) : O("", !0);
|
|
700
|
+
}
|
|
701
|
+
const at = /* @__PURE__ */ P(lt, [["render", nt], ["__scopeId", "data-v-0287eead"]]), ot = { class: "plugin-modelmanager" }, it = {
|
|
702
|
+
class: "model-manager-search",
|
|
703
|
+
clearable: "",
|
|
704
|
+
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 = {
|
|
706
|
+
__name: "Main",
|
|
707
|
+
props: {
|
|
708
|
+
title: {
|
|
709
|
+
type: String,
|
|
710
|
+
default: "模型管理"
|
|
711
|
+
},
|
|
712
|
+
fixedPanels: {
|
|
713
|
+
type: Array
|
|
714
|
+
}
|
|
715
|
+
},
|
|
716
|
+
emits: ["close"],
|
|
717
|
+
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
|
|
720
|
+
});
|
|
721
|
+
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();
|
|
731
|
+
}, M = () => {
|
|
732
|
+
y.value = {
|
|
733
|
+
id: null,
|
|
734
|
+
nameCn: "",
|
|
735
|
+
nameEn: "",
|
|
736
|
+
version: "",
|
|
737
|
+
modelUrl: "",
|
|
738
|
+
description: "",
|
|
739
|
+
parameters: []
|
|
740
|
+
}, Y();
|
|
741
|
+
}, S = async (t) => {
|
|
742
|
+
var s;
|
|
743
|
+
const l = t.nameCn || t.nameEn || t.id;
|
|
744
|
+
try {
|
|
745
|
+
const r = await fe.confirm({
|
|
746
|
+
title: "提示",
|
|
747
|
+
message: `确认删除模型「${l}」吗?该操作不可恢复。`
|
|
748
|
+
});
|
|
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));
|
|
753
|
+
} catch {
|
|
754
|
+
}
|
|
755
|
+
}, e = async () => {
|
|
756
|
+
const t = await We({
|
|
757
|
+
currentPage: 1,
|
|
758
|
+
pageSize: 500
|
|
759
|
+
});
|
|
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);
|
|
765
|
+
}, _ = async () => {
|
|
766
|
+
await e(), y.value = null, J();
|
|
767
|
+
};
|
|
768
|
+
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), {
|
|
774
|
+
title: c.title,
|
|
775
|
+
"fixed-name": o(i).ModelManager,
|
|
776
|
+
fixedPanels: c.fixedPanels,
|
|
777
|
+
onClose: U
|
|
778
|
+
}, {
|
|
779
|
+
header: u(() => [
|
|
780
|
+
n(o(H), {
|
|
781
|
+
class: "add-icon",
|
|
782
|
+
name: "add",
|
|
783
|
+
placement: "bottom",
|
|
784
|
+
tips: "新建模型",
|
|
785
|
+
onClick: M
|
|
786
|
+
}),
|
|
787
|
+
n(o(H), {
|
|
788
|
+
class: "flow-download-icon",
|
|
789
|
+
name: "flow-download",
|
|
790
|
+
placement: "bottom",
|
|
791
|
+
tips: "导出SQL",
|
|
792
|
+
onClick: a
|
|
793
|
+
})
|
|
794
|
+
]),
|
|
795
|
+
content: u(() => [
|
|
796
|
+
p("div", it, [
|
|
797
|
+
n(o(me), {
|
|
798
|
+
modelValue: b.value,
|
|
799
|
+
"onUpdate:modelValue": l[0] || (l[0] = (r) => b.value = r)
|
|
800
|
+
}, {
|
|
801
|
+
prefix: u(() => [
|
|
802
|
+
n(o(f))
|
|
803
|
+
]),
|
|
804
|
+
_: 1
|
|
805
|
+
}, 8, ["modelValue"])
|
|
806
|
+
]),
|
|
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)
|
|
814
|
+
}, [
|
|
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)
|
|
819
|
+
]),
|
|
820
|
+
p("div", mt, [
|
|
821
|
+
n(s, {
|
|
822
|
+
name: "delete",
|
|
823
|
+
onClick: K((w) => S(r), ["stop"])
|
|
824
|
+
}, null, 8, ["onClick"])
|
|
825
|
+
])
|
|
826
|
+
], 10, dt);
|
|
827
|
+
}), 128)) : O("", !0),
|
|
828
|
+
n(o(he), {
|
|
829
|
+
isShow: !V.value.length
|
|
830
|
+
}, null, 8, ["isShow"])
|
|
831
|
+
])
|
|
832
|
+
]),
|
|
833
|
+
_: 1
|
|
834
|
+
}, 8, ["title", "fixed-name", "fixedPanels"]),
|
|
835
|
+
n(at, {
|
|
836
|
+
model: y.value,
|
|
837
|
+
models: V.value,
|
|
838
|
+
onEditCallback: _,
|
|
839
|
+
onExportModel: a
|
|
840
|
+
}, null, 8, ["model", "models"])
|
|
841
|
+
]);
|
|
842
|
+
};
|
|
843
|
+
}
|
|
844
|
+
}, vt = /* @__PURE__ */ P(ft, [["__scopeId", "data-v-0c5de79e"]]), gt = {
|
|
845
|
+
id: "engine.plugins.modelmanager",
|
|
846
|
+
title: "模型管理",
|
|
847
|
+
type: "plugins",
|
|
848
|
+
width: 280,
|
|
849
|
+
icon: "plugin-icon-modelmanager"
|
|
850
|
+
}, Mt = {
|
|
851
|
+
...gt,
|
|
852
|
+
entry: vt
|
|
853
|
+
};
|
|
854
|
+
export {
|
|
855
|
+
Mt as default
|
|
856
|
+
};
|
|
857
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/components/ModelBasicForm.vue","../src/components/FieldManager.vue","../src/composable/useModelManager.js","../src/components/ModelSetting.vue","../src/Main.vue","../meta.js","../index.ts"],"sourcesContent":["<template>\n <div class=\"section\">\n <tiny-form ref=\"ruleFormRef\" :model=\"localValue\" :rules=\"rules\">\n <div class=\"form-item\">\n <tiny-form-item label=\"中文名称\" prop=\"nameCn\">\n <tiny-input v-model=\"localValue.nameCn\" placeholder=\"请输入模型中文名称\" />\n </tiny-form-item>\n </div>\n <div class=\"form-item\">\n <tiny-form-item label=\"英文名称\" prop=\"nameEn\">\n <tiny-input v-model=\"localValue.nameEn\" placeholder=\"请输入模型英文名称\" />\n </tiny-form-item>\n </div>\n <div class=\"form-item\">\n <tiny-form-item label=\"版本号\" prop=\"version\">\n <tiny-input v-model=\"localValue.version\" placeholder=\"1.0.0\" />\n </tiny-form-item>\n </div>\n <div class=\"form-item\">\n <tiny-form-item label=\"模型地址\" prop=\"modelUrl\">\n <tiny-input v-model=\"localValue.modelUrl\" placeholder=\"请输入模型地址,如:https://api.example.com/model\" />\n </tiny-form-item>\n </div>\n <div class=\"form-item\">\n <tiny-form-item label=\"描述\" prop=\"description\">\n <tiny-input type=\"textarea\" :rows=\"3\" v-model=\"localValue.description\" placeholder=\"请输入模型描述\" />\n </tiny-form-item>\n </div>\n </tiny-form>\n </div>\n</template>\n\n<script setup>\nimport { ref, watch } from 'vue'\nimport { TinyInput, Form as TinyForm, FormItem as TinyFormItem } from '@opentiny/vue'\n\nconst props = defineProps({\n model: { type: Object, required: true }\n})\n\n// 创建本地副本,直接编辑本地数据\nconst localValue = ref(props.model)\n\nconst ruleFormRef = ref()\n\nconst rules = ref({\n nameCn: [\n { required: true, message: '必填', trigger: 'blur' },\n { min: 1, max: 32, message: '长度在1-32之间', trigger: 'blur' }\n ],\n nameEn: [\n { required: true, message: '必填', trigger: 'blur' },\n { min: 1, max: 32, message: '长度在1-32之间', trigger: 'blur' }\n ],\n version: [{ required: true, message: '必填', trigger: 'blur' }],\n modelUrl: [\n { required: true, message: '必填', trigger: 'blur' },\n { min: 1, max: 200, message: '长度在1-200之间', trigger: 'blur' }\n ]\n})\n\n// 监听 props 变化,同步到本地(当选择不同模型时)\nwatch(\n () => props.model,\n (newModel) => {\n localValue.value = newModel\n },\n { deep: true }\n)\n\nconst validate = () => ruleFormRef.value.validate()\n\n// 暴露本地数据给父组件访问\ndefineExpose({\n getLocalValue: () => localValue.value,\n validate\n})\n</script>\n\n<style scoped>\n.section {\n margin-bottom: 16px;\n border-radius: 6px;\n padding: 12px;\n}\n.section-title {\n font-size: 16px;\n font-weight: 600;\n color: #262626;\n margin: 0 0 16px 0;\n padding-bottom: 8px;\n border-bottom: 1px solid #f0f0f0;\n}\n.form-item {\n margin-bottom: 20px;\n}\n.form-item label {\n display: block;\n margin-bottom: 8px;\n font-weight: 500;\n color: #262626;\n font-size: 14px;\n}\n</style>\n","<template>\n <div class=\"section\">\n <tiny-button size=\"mini\" @click=\"$emit('add-field')\"> <svg-icon name=\"add\"></svg-icon> 添加字段 </tiny-button>\n <div class=\"field-table\">\n <tiny-grid\n :data=\"model.parameters\"\n :header-fixed=\"true\"\n :scrollable=\"{ y: true }\"\n :expand-config=\"expandConfig\"\n ref=\"fieldGrid\"\n style=\"height: 100%\"\n >\n <tiny-grid-column type=\"index\" width=\"60\" title=\"序号\"></tiny-grid-column>\n <tiny-grid-column type=\"expand\" width=\"20\">\n <template #default=\"{ row }\">\n <div v-if=\"row.type === 'Enum'\" class=\"expand-content\">\n <div class=\"expand-section\">\n <h4>默认选项(下拉框)</h4>\n <div class=\"enum-values\">\n <div v-for=\"(opt, index) in row.options || []\" :key=\"index\" class=\"enum-item\">\n <tiny-input\n v-model=\"opt.value\"\n placeholder=\"值\"\n size=\"small\"\n style=\"width: 150px; margin-right: 8px\"\n />\n <tiny-input\n v-model=\"opt.label\"\n placeholder=\"显示标签\"\n size=\"small\"\n style=\"width: 200px; margin-right: 8px\"\n />\n <tiny-button type=\"text\" size=\"small\" @click=\"$emit('insert-enum-after', row, index)\"\n >新增</tiny-button\n >\n <tiny-button type=\"text\" size=\"small\" @click=\"$emit('remove-enum', row, index)\">删除</tiny-button>\n </div>\n </div>\n </div>\n </div>\n <div v-else-if=\"row.type === 'ModelRef'\" class=\"expand-content\">\n <div class=\"expand-section\">\n <h4>引用的模型</h4>\n <div class=\"model-ref-section\">\n <tiny-select\n v-model=\"row.defaultValue\"\n placeholder=\"请选择要引用的模型\"\n size=\"small\"\n style=\"width: 100%\"\n >\n <tiny-option\n v-for=\"model in relativeModels\"\n :key=\"model.id\"\n :value=\"model.id\"\n :label=\"`${model.nameCn} (${model.nameEn})`\"\n />\n </tiny-select>\n <div class=\"model-ref-info\" v-if=\"row.defaultValue\">\n <p>已选择模型:{{ getModelName(row.defaultValue) }}</p>\n </div>\n </div>\n </div>\n </div>\n </template>\n </tiny-grid-column>\n <tiny-grid-column field=\"prop\" title=\"字段名称\" width=\"120\">\n <template #default=\"{ row }\">\n <div v-if=\"row.isEditing\" class=\"editing-cell\">\n <tiny-input v-model=\"row.prop\" placeholder=\"请输入字段名称\" size=\"small\" />\n </div>\n <div v-else class=\"readonly-cell\">{{ row.prop || '点击编辑' }}</div>\n </template>\n </tiny-grid-column>\n <tiny-grid-column field=\"type\" title=\"类型\" width=\"110\">\n <template #default=\"{ row }\">\n <div v-if=\"row.isEditing\" class=\"editing-cell\">\n <tiny-select v-model=\"row.type\" size=\"small\" @change=\"handleTypeChange(row)\">\n <tiny-option value=\"String\" label=\"字符串\" />\n <tiny-option value=\"Number\" label=\"数字\" />\n <tiny-option value=\"Boolean\" label=\"布尔值\" />\n <tiny-option value=\"Date\" label=\"日期\" />\n <tiny-option value=\"Enum\" label=\"枚举值\" />\n <tiny-option value=\"ModelRef\" label=\"模型引用\" />\n </tiny-select>\n </div>\n <div v-else class=\"readonly-cell\">{{ getFieldTypeLabel(row.type) }}</div>\n </template>\n </tiny-grid-column>\n <tiny-grid-column field=\"required\" title=\"必填\" width=\"60\">\n <template #default=\"{ row }\">\n <div v-if=\"row.isEditing\" class=\"editing-cell\">\n <tiny-checkbox v-model=\"row.required\" />\n </div>\n <div v-else class=\"readonly-cell\"><tiny-checkbox v-model=\"row.required\" disabled /></div>\n </template>\n </tiny-grid-column>\n <tiny-grid-column field=\"description\" title=\"描述\" width=\"120\">\n <template #default=\"{ row }\">\n <div v-if=\"row.isEditing\" class=\"editing-cell\">\n <tiny-input v-model=\"row.description\" placeholder=\"请输入字段描述\" size=\"small\" />\n </div>\n <div v-else class=\"readonly-cell\">{{ row.description || '点击编辑' }}</div>\n </template>\n </tiny-grid-column>\n <tiny-grid-column field=\"operation\" title=\"操作\" width=\"90\">\n <template #default=\"{ row }\">\n <div class=\"field-actions\">\n <template v-if=\"row.isEditing\">\n <span type=\"text\" size=\"mini\" @click=\"saveFieldEdit(row)\">保存</span>\n <span type=\"text\" size=\"mini\" @click=\"cancelFieldEdit(row)\">取消</span>\n </template>\n <template v-else>\n <span><svg-icon name=\"to-edit\" @click.stop=\"startFieldEdit(row)\" /></span>\n <span><svg-icon name=\"delete\" @click.stop=\"handleDeleteField(row)\" /></span>\n </template>\n </div>\n </template>\n </tiny-grid-column>\n </tiny-grid>\n </div>\n </div>\n</template>\n\n<script setup>\n// 字段表格与展开编辑内容组件\n// 仅承载表格与展开内容,具体列通过插槽从父组件传入,保证与现有逻辑一致\nimport { ref, computed, nextTick } from 'vue'\nimport { TinyButton, TinyGrid, TinyGridColumn, TinyInput, TinySelect, TinyOption, TinyCheckbox } from '@opentiny/vue'\n\nconst props = defineProps({\n model: { type: Object, required: true },\n expandConfig: { type: Object, required: true },\n availableModels: { type: Array, default: () => [] }\n})\n\ndefineEmits(['insert-enum-after', 'remove-enum'])\n\nconst fieldGrid = ref(null)\n\nconst selectedModel = ref(props.model)\n\nconst relativeModels = computed(() => props.availableModels.filter((item) => item.id !== props.model.id))\n\n// 父组件需要:\n// 1) 读取 grid 数据以拿到 _RID\nconst getGridData = () => fieldGrid.value?.getData?.() || []\n\n// 根据模型ID获取模型名称\nconst getModelName = (modelId) => {\n const model = relativeModels.value.find((m) => m.id === modelId)\n return model ? `${model.nameCn} (${model.nameEn})` : '未知模型'\n}\n\n// 字段类型变化处理\nconst handleTypeChange = (field) => {\n if (field.type === 'Enum' || field.type === 'ModelRef') {\n field.isExpanded = true\n // 初始化相应的数据结构\n if (field.type === 'Enum' && (!Array.isArray(field.options) || field.options.length === 0)) {\n field.options = [{ value: '', label: '' }]\n }\n // 模型引用类型:初始化模型引用\n if (field.type === 'ModelRef') {\n field.isModel = true\n field.defaultValue = field.defaultValue || null\n }\n // 将对应 _RID 推入展开 keys(去重)\n nextTick(() => {\n const gridData = fieldGrid.value?.getGridData?.() || []\n gridData.forEach((item) => {\n if (item.id === field.id && !expandConfig.value.expandRowKeys.includes(item._RID)) {\n expandConfig.value.expandRowKeys.push(item._RID)\n }\n })\n })\n } else {\n field.isExpanded = false\n // 按 _RID 从展开 keys 移除\n const gridData = fieldGrid.value?.getGridData?.() || []\n const current = gridData.find((item) => item.id === field.id)\n if (current) {\n const idx = expandConfig.value.expandRowKeys.indexOf(current._RID)\n if (idx > -1) expandConfig.value.expandRowKeys.splice(idx, 1)\n }\n }\n // 强制更新视图\n nextTick(() => {\n if (selectedModel.value && selectedModel.value.parameters) {\n selectedModel.value.parameters = [...selectedModel.value.parameters]\n }\n })\n}\n\n// 字段类型label转换\nconst getFieldTypeLabel = (type) => {\n const typeMap = {\n String: '字符串',\n Number: '数字',\n Boolean: '布尔值',\n Date: '日期',\n Enum: '枚举值',\n ModelRef: '模型引用'\n }\n return typeMap[type] || type\n}\n\n// 字段进入编辑状态\nconst startFieldEdit = (field) => {\n field._editCache = { ...field } // 缓存原始数据\n field.isEditing = true\n // 如果字段类型是枚举值或模型引用类型,自动展开\n if (field.type === 'Enum' || field.type === 'ModelRef') {\n field.isExpanded = true\n // 枚举类型:至少保证一条空数据\n if (field.type === 'Enum' && (!Array.isArray(field.options) || field.options.length === 0)) {\n field.options = [{ value: '', label: '' }]\n }\n // 模型引用类型:初始化模型引用\n if (field.type === 'ModelRef') {\n field.isModel = true\n field.defaultValue = field.defaultValue || null\n }\n // 添加到展开行keys(使用 _RID),并避免重复\n const gridData = fieldGrid.value?.getGridData() || []\n gridData.forEach((item) => {\n if (item.id === field.id && !expandConfig.value.expandRowKeys.includes(item._RID)) {\n expandConfig.value.expandRowKeys.push(item._RID)\n }\n })\n }\n}\n// 字段保存编辑\nconst saveFieldEdit = (field) => {\n field.isEditing = false\n field.isExpanded = false // 保存时收起展开行\n if (field._editCache && JSON.stringify(field._editCache) !== JSON.stringify(field)) {\n field._editCache = null\n }\n // 保存后移除 isNew 标记\n if (field.isNew) delete field.isNew\n}\n\n// 字段取消编辑\nconst cancelFieldEdit = (field) => {\n field.isEditing = false\n field.isExpanded = false // 取消时收起展开行\n // 从展开行keys中移除(使用 _RID)\n const gridData = fieldGrid.value?.getGridData?.() || []\n const current = gridData.find((item) => item.id === field.id)\n if (current) {\n const idx = expandConfig.value.expandRowKeys.indexOf(current._RID)\n if (idx > -1) expandConfig.value.expandRowKeys.splice(idx, 1)\n }\n // 取消编辑时,还原到缓存的数据\n if (field._editCache) {\n Object.assign(field, field._editCache)\n field._editCache = null\n }\n // 如果字段是新增的,则直接删除\n if (field.isNew) {\n const index = selectedModel.value.parameters.findIndex((f) => f.id === field.id)\n if (index > -1) selectedModel.value.parameters.splice(index, 1)\n }\n}\n// 删除字段\nconst handleDeleteField = (field) => {\n const index = selectedModel.value.parameters.findIndex((f) => f.prop === field.prop)\n if (index > -1) selectedModel.value.parameters.splice(index, 1)\n}\n\ndefineExpose({\n fieldGrid,\n getGridData\n})\n</script>\n\n<style lang=\"less\" scoped>\n.section {\n .add-field-btn {\n margin-bottom: 16px;\n }\n\n :deep(.tiny-grid-body__expanded-row) {\n background-color: var(--te-model-manage-input-bg-color);\n }\n .expand-section {\n margin-bottom: 16px;\n\n h4 {\n font-size: 14px;\n font-weight: 600;\n color: var(--te-model-manage-title-text-color);\n margin: 0 0 8px 0;\n padding-bottom: 1px;\n }\n\n .enum-item {\n display: flex;\n align-items: center;\n margin-bottom: 8px;\n padding: 8px;\n background-color: var(--te-model-manage-input-bg-color);\n border-radius: 4px;\n }\n\n .model-ref-section {\n margin-top: 8px;\n }\n\n .model-ref-info {\n margin-top: 8px;\n padding: 8px;\n background: #f0f8ff;\n border-radius: 4px;\n border: 1px solid #d6e4ff;\n\n p {\n margin: 0;\n font-size: 12px;\n color: #1890ff;\n }\n }\n }\n\n .editing-cell {\n :deep(.tiny-input),\n :deep(.tiny-select) {\n width: 100%;\n }\n }\n\n .readonly-cell {\n cursor: pointer;\n border-radius: 4px;\n transition: background-color 0.2s ease;\n\n &:hover {\n background-color: #f5f5f5;\n }\n }\n\n .field-actions,\n .editing-cell,\n .readonly-cell {\n background: transparent !important;\n }\n\n .field-actions {\n display: flex;\n gap: 8px;\n span {\n color: var(--te-common-text-emphasize);\n }\n }\n}\n</style>\n","import { getMetaApi, META_SERVICE } from '@opentiny/tiny-engine-meta-register'\n\n// 示例API路径,请根据实际后端接口调整\nconst modelApi = '/material-center/api/model'\n\nexport function getModelList(params = {}) {\n return getMetaApi(META_SERVICE.Http).get(`${modelApi}/list`, { params })\n}\n\nexport function createModel(data) {\n return getMetaApi(META_SERVICE.Http).post(`${modelApi}/create`, data)\n}\n\nexport function updateModel(id, data) {\n return getMetaApi(META_SERVICE.Http).put(`${modelApi}/update/${id}`, data)\n}\n\nexport function deleteModel(id) {\n return getMetaApi(META_SERVICE.Http).delete(`${modelApi}/delete/${id}`)\n}\n\nexport function getModelSql() {\n return getMetaApi(META_SERVICE.Http).get(`${modelApi}/table/list`)\n}\n\nexport function getModelSqlById(id) {\n return getMetaApi(META_SERVICE.Http).get(`${modelApi}/table/${id}`)\n}\n","<template>\n <plugin-setting\n v-if=\"isShow\"\n :fixed-name=\"PLUGIN_NAME.ModelManager\"\n :align=\"align\"\n title=\"模型设置\"\n class=\"modelmanager-plugin-setting\"\n >\n <template #header>\n <button-group>\n <tiny-button @click=\"$emit('exportModel', selectedModel?.id)\">导出SQL</tiny-button>\n <tiny-button type=\"primary\" @click=\"saveModel\">保存</tiny-button>\n <svg-button name=\"close\" @click=\"closeModelSettingPanel\"></svg-button>\n </button-group>\n </template>\n\n <template #content>\n <tiny-collapse v-model=\"activeName\" class=\"page-setting-collapse\">\n <tiny-collapse-item title=\"基本设置\" name=\"general\">\n <model-basic-form ref=\"modelBasicFormRef\" :model=\"selectedModel\"></model-basic-form>\n </tiny-collapse-item>\n\n <tiny-collapse-item class=\"base-setting\" title=\"字段管理\" name=\"fields\">\n <field-manager\n ref=\"fieldManagerRef\"\n :model=\"selectedModel\"\n :expand-config=\"expandConfig\"\n :available-models=\"models\"\n @add-field=\"handleAddField\"\n @insert-enum-after=\"insertEnumValueAfter\"\n @remove-enum=\"removeEnumValue\"\n >\n </field-manager>\n </tiny-collapse-item>\n </tiny-collapse>\n </template>\n </plugin-setting>\n</template>\n<script>\nimport { ref, watch, nextTick } from 'vue'\nimport { Button, Collapse, CollapseItem } from '@opentiny/vue'\nimport { PluginSetting, ButtonGroup, SvgButton } from '@opentiny/tiny-engine-common'\nimport { useLayout } from '@opentiny/tiny-engine-meta-register'\nimport ModelBasicForm from './ModelBasicForm.vue'\nimport FieldManager from './FieldManager.vue'\nimport { createModel, updateModel } from '../composable/useModelManager'\n\nconst isShow = ref(false)\n\nexport const openModelSettingPanel = () => {\n isShow.value = true\n}\n\nexport const closeModelSettingPanel = () => {\n isShow.value = false\n}\n\nexport default {\n components: {\n PluginSetting,\n SvgButton,\n ButtonGroup,\n ModelBasicForm,\n FieldManager,\n TinyButton: Button,\n TinyCollapse: Collapse,\n TinyCollapseItem: CollapseItem\n },\n props: {\n model: {\n type: Object,\n default: () => ({})\n },\n models: {\n type: Array,\n default: () => []\n }\n },\n emits: ['editCallback', 'exportModel'],\n setup(props, { emit }) {\n const { PLUGIN_NAME } = useLayout()\n const activeName = ref(['general', 'fields'])\n const selectedModel = ref()\n const modelBasicFormRef = ref()\n // 展开行配置\n const expandConfig = ref({\n expandAll: false,\n trigger: 'row',\n expandRowKeys: [],\n accordion: false,\n activeMethod: (row) => row.type === 'Enum' || row.type === 'ModelRef', // 枚举类型和模型引用类型都显示展开箭头\n showIcon: (row) => row.type === 'Enum' || row.type === 'ModelRef' // 枚举类型和模型引用类型都显示展开箭头\n })\n\n // 添加字段,自动进入编辑状态\n const handleAddField = () => {\n if (!selectedModel.value) return\n const newField = {\n prop: '',\n type: 'String',\n required: false,\n description: '',\n isEditing: true,\n isNew: true // 新增字段标记\n }\n selectedModel.value.parameters.push(newField)\n nextTick(() => {\n const nameInputs = document.querySelectorAll('.editing-cell .tiny-input')\n if (nameInputs.length > 0) nameInputs[nameInputs.length - 1].focus()\n })\n }\n\n // 在当前行后插入一条枚举值\n const insertEnumValueAfter = (field, index) => {\n if (!field.options) {\n field.options = []\n }\n field.options.splice(index + 1, 0, { value: '', label: '' })\n }\n\n // 删除枚举值\n const removeEnumValue = (field, index) => {\n if (!Array.isArray(field.options)) return\n if (field.options.length <= 1) {\n // 只剩一条时,不删除,清空内容\n field.options[0] = { value: '', label: '' }\n return\n }\n field.options.splice(index, 1)\n }\n\n // 保存模型时一并保存version字段\n const saveModel = async () => {\n // 从子组件获取最新的数据\n const latestModelData = modelBasicFormRef.value?.getLocalValue()\n modelBasicFormRef.value.validate().then(async (valid) => {\n if (valid) {\n const newModel = {\n description: latestModelData.description,\n modelUrl: latestModelData.modelUrl,\n nameCn: latestModelData.nameCn,\n nameEn: latestModelData.nameEn,\n version: latestModelData.version,\n id: latestModelData.id,\n parameters: latestModelData.parameters.filter((item) => !!item.prop)\n }\n let isModelRefRelative = true\n let propertyName = ''\n if (newModel.parameters?.length > 0) {\n newModel.parameters.forEach((item) => {\n if (item.type === 'Enum') {\n item.options = JSON.stringify(item.options)\n }\n if (item.type === 'ModelRef') {\n item.isModel = true\n delete item.options\n item.defaultValue = item.defaultValue || null\n isModelRefRelative = !!item.defaultValue\n propertyName = item.prop\n }\n })\n }\n if (!isModelRefRelative) {\n Notify({\n type: 'error',\n message: `字段${propertyName}未关联模型引用`\n })\n return\n }\n if (latestModelData.id === null) {\n delete newModel.id\n await createModel(newModel)\n } else {\n await updateModel(newModel.id, newModel)\n }\n emit('editCallback')\n Notify({\n type: 'success',\n message: '保存成功'\n })\n selectedModel.value = null\n }\n })\n }\n // 监听 props 变化,同步到本地(当选择不同模型时)\n watch(\n () => props.model,\n (newModel) => {\n selectedModel.value = newModel\n },\n { deep: true }\n )\n return {\n isShow,\n PLUGIN_NAME,\n activeName,\n modelBasicFormRef,\n expandConfig,\n selectedModel,\n closeModelSettingPanel,\n handleAddField,\n insertEnumValueAfter,\n removeEnumValue,\n saveModel\n }\n }\n}\n</script>\n<style lang=\"less\" scoped>\n:deep(.plugin-setting) {\n width: fit-content !important;\n}\n</style>\n","<template>\n <div class=\"plugin-modelmanager\">\n <plugin-panel\n :title=\"title\"\n :fixed-name=\"PLUGIN_NAME.ModelManager\"\n :fixedPanels=\"fixedPanels\"\n @close=\"pluginPanelClosed\"\n >\n <template #header>\n <svg-button class=\"add-icon\" name=\"add\" placement=\"bottom\" tips=\"新建模型\" @click=\"handleAddModel\"></svg-button>\n <svg-button\n class=\"flow-download-icon\"\n name=\"flow-download\"\n placement=\"bottom\"\n tips=\"导出SQL\"\n @click=\"exportModel\"\n ></svg-button>\n </template>\n <template #content>\n <div class=\"model-manager-search\" clearable placeholder=\"搜索\">\n <tiny-search v-model=\"localKeyword\">\n <template #prefix>\n <tiny-icon-search />\n </template>\n </tiny-search>\n </div>\n <div class=\"model-list\">\n <template v-if=\"models.length\">\n <div\n v-for=\"model in filteredModels\"\n :key=\"model.id\"\n :class=\"['model-item', { active: selectedModel?.id === model.id }]\"\n @click=\"selectModel(model)\"\n >\n <div class=\"model-info\">\n <div class=\"model-name\">{{ model.nameCn }}</div>\n <div class=\"model-english-name\">{{ model.nameEn }}</div>\n <div class=\"model-desc\">{{ model.description || '暂无描述' }}</div>\n </div>\n <div class=\"model-actions\">\n <svg-icon name=\"delete\" @click.stop=\"handleDeleteModel(model)\"></svg-icon>\n </div>\n </div>\n </template>\n <search-empty :isShow=\"!models.length\" />\n </div>\n </template>\n </plugin-panel>\n <model-setting\n :model=\"selectedModel\"\n :models=\"models\"\n @editCallback=\"editCallback\"\n @exportModel=\"exportModel\"\n ></model-setting>\n </div>\n</template>\n\n<script setup>\nimport { ref, reactive, provide, computed, onMounted } from 'vue'\nimport { TinySearch, Modal } from '@opentiny/vue'\nimport { IconSearch } from '@opentiny/vue-icon'\nimport { PluginPanel, SvgButton, SearchEmpty } from '@opentiny/tiny-engine-common'\nimport { useLayout } from '@opentiny/tiny-engine-meta-register'\nimport ModelSetting, { openModelSettingPanel, closeModelSettingPanel } from './components/ModelSetting.vue'\nimport { getModelList, deleteModel, getModelSql, getModelSqlById } from './composable/useModelManager'\n\ndefineProps({\n title: {\n type: String,\n default: '模型管理'\n },\n fixedPanels: {\n type: Array\n }\n})\nconst emit = defineEmits(['close'])\n\nconst { PLUGIN_NAME } = useLayout()\nconst TinyIconSearch = IconSearch()\nconst selectedModel = ref(null) // 当前选中的模型\n// 模型数据列表,包含模型及其字段\nconst models = ref([])\nconst localKeyword = ref('')\n\nconst panelState = reactive({\n emitEvent: emit\n})\n\nprovide('panelState', panelState)\n// 根据搜索关键字过滤模型列表\nconst filteredModels = computed(() => {\n if (!localKeyword.value) return models.value\n return models.value.filter(\n (model) =>\n (model.nameCn || '').toLowerCase().includes(localKeyword.value.toLowerCase()) ||\n (model.description || '').toLowerCase().includes(localKeyword.value.toLowerCase())\n )\n})\n\nconst pluginPanelClosed = () => {\n emit('close')\n closeModelSettingPanel()\n}\n\n// 选中模型\nconst selectModel = (model) => {\n if (model.parameters?.length > 0) {\n model.parameters.forEach((item) => {\n item.isModel = false\n if (item.type === 'Enum') {\n item.options = typeof item.options === 'string' ? JSON.parse(item.options) : item.options || []\n }\n if (item.type === 'ModelRef') {\n item.isModel = true\n item.defaultValue = Number(item.defaultValue)\n }\n })\n }\n selectedModel.value = model\n openModelSettingPanel()\n}\n// 添加新模型\nconst handleAddModel = () => {\n selectedModel.value = {\n id: null,\n nameCn: '',\n nameEn: '',\n version: '',\n modelUrl: '',\n description: '',\n parameters: []\n }\n openModelSettingPanel()\n}\n\n// 删除模型(TinyVue 二次确认)\nconst handleDeleteModel = async (model) => {\n const name = model.nameCn || model.nameEn || model.id\n try {\n const result = await Modal.confirm({\n title: '提示',\n message: `确认删除模型「${name}」吗?该操作不可恢复。`\n })\n const confirmed = result === 'confirm' || result?.action === 'confirm' || result === true || result === undefined\n if (!confirmed) return\n await deleteModel(model.id)\n const index = models.value.findIndex((m) => m.id === model.id)\n if (index > -1) {\n models.value.splice(index, 1)\n if (selectedModel.value?.id === model.id) selectedModel.value = null\n }\n } catch (error) {\n // 用户取消或弹窗异常,不做处理\n }\n}\n\nconst getModelLists = async () => {\n const data = await getModelList({\n currentPage: 1,\n pageSize: 500\n })\n models.value = data.records || []\n}\n// 导出模型的sql\nconst exportModel = async (id) => {\n const sqlContent = id ? await getModelSqlById(id) : await getModelSql()\n // 创建 Blob 对象,指定 MIME 类型为 text/sql\n const blob = new Blob([sqlContent], { type: 'text/sql' })\n const url = URL.createObjectURL(blob)\n const a = document.createElement('a')\n a.href = url\n a.download = `${id ? selectedModel.value?.nameEn : 'models'}.sql`\n // 将 <a> 元素添加到 DOM 中\n document.body.appendChild(a)\n a.click()\n document.body.removeChild(a)\n URL.revokeObjectURL(url)\n}\n\nconst editCallback = async () => {\n await getModelLists()\n selectedModel.value = null\n closeModelSettingPanel()\n}\n\n// 生命周期:页面加载时拉取模型列表\nonMounted(async () => {\n await getModelLists()\n})\n</script>\n\n<style lang=\"less\" scoped>\n.plugin-modelmanager {\n height: 100%;\n width: 280px;\n\n .model-manager-search {\n padding: 0 12px 12px 12px;\n }\n\n .model-list {\n border-top: 1px solid var(--te-model-common-border-color-divider);\n padding-top: 12px;\n overflow-y: scroll;\n color: var(--te-common-text-primary);\n font-size: var(--te-base-font-size-base);\n\n .model-item {\n padding: 10px;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n\n &:hover {\n background-color: var(--te-model-manage-draggable-row-bg-color-hover);\n color: var(--te-model-manage-draggable-text-color);\n }\n\n &.active {\n background-color: var(--te-model-manage-draggable-row-bg-color-hover);\n color: var(--te-model-manage-draggable-text-color);\n }\n\n svg {\n cursor: pointer;\n }\n\n .model-info {\n .model-name {\n font-weight: 600;\n margin-bottom: 2px;\n font-size: 14px;\n }\n .model-english-name {\n font-size: 11px;\n margin-bottom: 4px;\n font-family: monospace;\n }\n .model-desc {\n font-size: 12px;\n color: var(--te-model-manage-tip-text-color);\n display: -webkit-box;\n overflow: hidden;\n }\n }\n }\n }\n}\n</style>\n","export default {\n id: 'engine.plugins.modelmanager',\n title: '模型管理',\n type: 'plugins',\n width: 280,\n icon: 'plugin-icon-modelmanager'\n}\n","import entry from './src/Main.vue'\nimport metaData from './meta'\nimport './src/styles/vars.less'\n\nexport default {\n ...metaData,\n entry\n}\n"],"names":["props","__props","localValue","ref","ruleFormRef","rules","watch","newModel","__expose","_openBlock","_createElementBlock","_hoisted_1","_createVNode","_unref","TinyForm","_createElementVNode","_hoisted_2","TinyFormItem","TinyInput","_cache","$event","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","fieldGrid","selectedModel","relativeModels","computed","item","getGridData","_b","_a","getModelName","modelId","model","m","handleTypeChange","field","nextTick","current","idx","getFieldTypeLabel","type","startFieldEdit","saveFieldEdit","cancelFieldEdit","index","f","handleDeleteField","TinyButton","$emit","_component_svg_icon","TinyGrid","TinyGridColumn","_withCtx","row","_Fragment","opt","_hoisted_7","_hoisted_8","TinySelect","_renderList","_createBlock","TinyOption","_hoisted_9","_toDisplayString","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","TinyCheckbox","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_withModifiers","modelApi","getModelList","params","getMetaApi","META_SERVICE","createModel","data","updateModel","id","deleteModel","getModelSql","getModelSqlById","isShow","openModelSettingPanel","closeModelSettingPanel","_sfc_main","PluginSetting","SvgButton","ButtonGroup","ModelBasicForm","FieldManager","Button","Collapse","CollapseItem","emit","PLUGIN_NAME","useLayout","activeName","modelBasicFormRef","expandConfig","handleAddField","newField","nameInputs","insertEnumValueAfter","removeEnumValue","saveModel","latestModelData","valid","isModelRefRelative","propertyName","$setup","_component_plugin_setting","_ctx","_component_button_group","_component_tiny_button","_component_svg_button","_component_tiny_collapse","_component_tiny_collapse_item","_component_model_basic_form","_component_field_manager","$props","__emit","TinyIconSearch","IconSearch","models","localKeyword","panelState","reactive","provide","filteredModels","pluginPanelClosed","selectModel","handleAddModel","handleDeleteModel","name","result","Modal","getModelLists","exportModel","sqlContent","blob","url","a","editCallback","onMounted","PluginPanel","TinySearch","SearchEmpty","ModelSetting","metaData","entry"],"mappings":";;;;;;;;;;;;;;;;;AAoCA,UAAMA,IAAQC,GAKRC,IAAaC,EAAIH,EAAM,KAAK,GAE5BI,IAAcD,EAAG,GAEjBE,IAAQF,EAAI;AAAA,MAChB,QAAQ;AAAA,QACN,EAAE,UAAU,IAAM,SAAS,MAAM,SAAS,OAAM;AAAA,QAChD,EAAE,KAAK,GAAG,KAAK,IAAI,SAAS,aAAa,SAAS,OAAM;AAAA,MAC5D;AAAA,MACE,QAAQ;AAAA,QACN,EAAE,UAAU,IAAM,SAAS,MAAM,SAAS,OAAM;AAAA,QAChD,EAAE,KAAK,GAAG,KAAK,IAAI,SAAS,aAAa,SAAS,OAAM;AAAA,MAC5D;AAAA,MACE,SAAS,CAAC,EAAE,UAAU,IAAM,SAAS,MAAM,SAAS,QAAQ;AAAA,MAC5D,UAAU;AAAA,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
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.section[data-v-1f80f91c]{margin-bottom:16px;border-radius:6px;padding:12px}.section-title[data-v-1f80f91c]{font-size:16px;font-weight:600;color:#262626;margin:0 0 16px;padding-bottom:8px;border-bottom:1px solid #f0f0f0}.form-item[data-v-1f80f91c]{margin-bottom:20px}.form-item label[data-v-1f80f91c]{display:block;margin-bottom:8px;font-weight:500;color:#262626;font-size:14px}.section .add-field-btn[data-v-0e237f07]{margin-bottom:16px}.section[data-v-0e237f07] .tiny-grid-body__expanded-row{background-color:var(--te-model-manage-input-bg-color)}.section .expand-section[data-v-0e237f07]{margin-bottom:16px}.section .expand-section h4[data-v-0e237f07]{font-size:14px;font-weight:600;color:var(--te-model-manage-title-text-color);margin:0 0 8px;padding-bottom:1px}.section .expand-section .enum-item[data-v-0e237f07]{display:flex;align-items:center;margin-bottom:8px;padding:8px;background-color:var(--te-model-manage-input-bg-color);border-radius:4px}.section .expand-section .model-ref-section[data-v-0e237f07]{margin-top:8px}.section .expand-section .model-ref-info[data-v-0e237f07]{margin-top:8px;padding:8px;background:#f0f8ff;border-radius:4px;border:1px solid #d6e4ff}.section .expand-section .model-ref-info p[data-v-0e237f07]{margin:0;font-size:12px;color:#1890ff}.section .editing-cell[data-v-0e237f07] .tiny-input,.section .editing-cell[data-v-0e237f07] .tiny-select{width:100%}.section .readonly-cell[data-v-0e237f07]{cursor:pointer;border-radius:4px;transition:background-color .2s ease}.section .readonly-cell[data-v-0e237f07]:hover{background-color:#f5f5f5}.section .field-actions[data-v-0e237f07],.section .editing-cell[data-v-0e237f07],.section .readonly-cell[data-v-0e237f07]{background:transparent!important}.section .field-actions[data-v-0e237f07]{display:flex;gap:8px}.section .field-actions span[data-v-0e237f07]{color:var(--te-common-text-emphasize)}[data-v-0287eead] .plugin-setting{width:fit-content!important}.plugin-modelmanager[data-v-0c5de79e]{height:100%;width:280px}.plugin-modelmanager .model-manager-search[data-v-0c5de79e]{padding:0 12px 12px}.plugin-modelmanager .model-list[data-v-0c5de79e]{border-top:1px solid var(--te-model-common-border-color-divider);padding-top:12px;overflow-y:scroll;color:var(--te-common-text-primary);font-size:var(--te-base-font-size-base)}.plugin-modelmanager .model-list .model-item[data-v-0c5de79e]{padding:10px;display:flex;flex-direction:row;justify-content:space-between;align-items:center}.plugin-modelmanager .model-list .model-item[data-v-0c5de79e]:hover,.plugin-modelmanager .model-list .model-item.active[data-v-0c5de79e]{background-color:var(--te-model-manage-draggable-row-bg-color-hover);color:var(--te-model-manage-draggable-text-color)}.plugin-modelmanager .model-list .model-item svg[data-v-0c5de79e]{cursor:pointer}.plugin-modelmanager .model-list .model-item .model-info .model-name[data-v-0c5de79e]{font-weight:600;margin-bottom:2px;font-size:14px}.plugin-modelmanager .model-list .model-item .model-info .model-english-name[data-v-0c5de79e]{font-size:11px;margin-bottom:4px;font-family:monospace}.plugin-modelmanager .model-list .model-item .model-info .model-desc[data-v-0c5de79e]{font-size:12px;color:var(--te-model-manage-tip-text-color);display:-webkit-box;overflow:hidden}.plugin-modelmanager{--te-model-manage-title-text-color: var(--te-common-text-primary);--te-model-manage-input-bg-color: var(--te-common-bg-default);--te-model-manage-input-border-color: var(--te-common-border-default);--te-model-manage-tip-color: var(--te-common-text-primary);--te-model-manage-tip-text-color: var(--te-common-text-weaken);--te-model-manage-tip-dim-text-color: var(--te-common-text-primary);--te-model-manage-tree-text-bg-color: var(--te-common-bg-default);--te-model-manage-tree-node-bg-color: var(--te-common-bg-default);--te-model-manage-tree-node-bg-color-hover: var(--te-common-bg-container);--te-model-manage-text-color: var(--te-common-text-secondary);--te-model-manage-input-head-text-color: var(--te-common-text-primary);--te-model-manage-input-or-output-text-color: var(--te-common-text-secondary);--te-model-manage-life-cycle-alert-text-color: var(--te-common-text-weaken);--te-model-manage-icon-color: var(--te-common-icon-secondary);--te-model-manage-draggable-row-bg-color-hover: var(--te-common-bg-container);--te-model-manage-draggable-text-color: var(--te-common-text-primary);--te-model-manage-draggable-icon-color: var(--te-common-icon-secondary);--te-model-manage-draggable-border-color: var(--te-common-border-checked);--te-model-common-border-color-divider: var(--te-common-border-divider)}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opentiny/tiny-engine-plugin-model-manager",
|
|
3
|
+
"version": "2.8.2-alpha.1",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "vite build"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "dist/index.js",
|
|
12
|
+
"module": "dist/index.js",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"keywords": [
|
|
17
|
+
"tiny-engine-plugin",
|
|
18
|
+
"model-manager"
|
|
19
|
+
],
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/opentiny/tiny-engine",
|
|
23
|
+
"directory": "packages/plugins/model-manager"
|
|
24
|
+
},
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/opentiny/tiny-engine/issues"
|
|
27
|
+
},
|
|
28
|
+
"author": "OpenTiny Team",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"homepage": "https://opentiny.design/tiny-engine",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@opentiny/tiny-engine-common": "2.8.2-alpha.1",
|
|
33
|
+
"@opentiny/tiny-engine-meta-register": "2.8.2-alpha.1"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@opentiny/tiny-engine-vite-plugin-meta-comments": "2.8.2-alpha.1",
|
|
37
|
+
"@vitejs/plugin-vue": "^5.1.2",
|
|
38
|
+
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
|
39
|
+
"vite": "^5.4.2"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"@opentiny/vue": "^3.20.0",
|
|
43
|
+
"@opentiny/vue-icon": "^3.20.0",
|
|
44
|
+
"@opentiny/vue-renderless": "^3.20.0",
|
|
45
|
+
"vue": "^3.4.15"
|
|
46
|
+
},
|
|
47
|
+
"gitHead": "f48ce1a6af275b1ffda621ff7e53921af92d0d19"
|
|
48
|
+
}
|