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