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