china-mobile-international-custom-components 0.0.53 → 0.0.55
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/es/AddOrEditSupplierDialog.mjs +920 -22
- package/es/AuthSection.mjs +192 -0
- package/es/CommonTagsList.mjs +31 -30
- package/es/CreateMcpForm.mjs +321 -0
- package/es/FilePreview.mjs +229 -0
- package/es/McpFormDialog.mjs +188 -0
- package/es/RadioGroup.mjs +120 -0
- package/es/SourcePublish.mjs +119 -119
- package/es/assets/AddOrEditSupplierDialog.css +1 -1
- package/es/assets/AuthSection.css +1 -0
- package/es/assets/CreateMcpForm.css +1 -0
- package/es/assets/FilePreview.css +1 -0
- package/es/assets/McpFormDialog.css +1 -0
- package/es/assets/RadioGroup.css +1 -0
- package/es/assets/SourcePublish.css +1 -1
- package/es/assets/usePreview.css +1 -0
- package/es/chunks/config.CgrPt4Zx.js +435 -0
- package/es/chunks/usePreview.BMkgYO7E.js +124 -0
- package/es/index.mjs +162 -147
- package/lib/AddOrEditSupplierDialog.js +1 -1
- package/lib/AuthSection.js +1 -0
- package/lib/CommonTagsList.js +1 -1
- package/lib/CreateMcpForm.js +1 -0
- package/lib/FilePreview.js +1 -0
- package/lib/McpFormDialog.js +1 -0
- package/lib/RadioGroup.js +1 -0
- package/lib/SourcePublish.js +1 -1
- package/lib/assets/AddOrEditSupplierDialog.css +1 -1
- package/lib/assets/AuthSection.css +1 -0
- package/lib/assets/CreateMcpForm.css +1 -0
- package/lib/assets/FilePreview.css +1 -0
- package/lib/assets/McpFormDialog.css +1 -0
- package/lib/assets/RadioGroup.css +1 -0
- package/lib/assets/SourcePublish.css +1 -1
- package/lib/assets/usePreview.css +1 -0
- package/lib/chunks/config.BvBtwI1A.js +1 -0
- package/lib/chunks/usePreview.BzTCNJfE.js +1 -0
- package/lib/index.js +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { w as U } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
+
import { resolveComponent as c, createElementBlock as r, openBlock as n, createCommentVNode as w, unref as _, renderSlot as C, createVNode as u, withCtx as i, Fragment as D, renderList as b, createBlock as a, createElementVNode as x, resolveDynamicComponent as S, toDisplayString as V, createTextVNode as L } from "vue";
|
|
3
|
+
import { o as H } from "./chunks/usePreview.BMkgYO7E.js";
|
|
4
|
+
import { _ as N } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
5
|
+
import './assets/FilePreview.css';const g = {
|
|
6
|
+
卡片: "Card",
|
|
7
|
+
按钮: "Button",
|
|
8
|
+
面板: "Panel",
|
|
9
|
+
自定义: "Custom"
|
|
10
|
+
}, M = (e) => /(txt|yaml)/i.test(e), j = (e) => /ppt|pptx/i.test(e), A = (e) => /pdf/i.test(e);
|
|
11
|
+
function O(e) {
|
|
12
|
+
return /(docx|doc|msword)/i.test(e);
|
|
13
|
+
}
|
|
14
|
+
function J(e) {
|
|
15
|
+
return /(xlsx|xls|sheet|csv)/i.test(e);
|
|
16
|
+
}
|
|
17
|
+
function W(e) {
|
|
18
|
+
return /(zip|rar|7z)$/i.test(e);
|
|
19
|
+
}
|
|
20
|
+
const k = (e) => /(jpe?g|png|bmp|gif|webp|svg|ico)(\?.*)?$/i.test(e), Z = (e) => /(mp4|avi|rmvb|rm|wmv|flv|3gp|mkv|mov)(\?.*)?$/i.test(e), q = (e) => /(mp3|wav|wma|aac|flac)(\?.*)?$/i.test(e), G = (e) => /(md|markdown)/i.test(e), K = (e) => /(html|htm|xhtml|xml)/i.test(e), Q = (e) => /(json)/i.test(e), R = (e) => {
|
|
21
|
+
if (A(e.suffix))
|
|
22
|
+
return "Pdf1";
|
|
23
|
+
if (O(e.suffix))
|
|
24
|
+
return "Doc";
|
|
25
|
+
if (J(e.suffix))
|
|
26
|
+
return "Excel1";
|
|
27
|
+
if (Z(e.suffix))
|
|
28
|
+
return "Video";
|
|
29
|
+
if (q(e.suffix))
|
|
30
|
+
return "Music";
|
|
31
|
+
if (j(e.suffix))
|
|
32
|
+
return "Ppt1";
|
|
33
|
+
if (G(e.suffix))
|
|
34
|
+
return "Md";
|
|
35
|
+
if (K(e.suffix))
|
|
36
|
+
return "Html";
|
|
37
|
+
if (M(e.suffix))
|
|
38
|
+
return "Txt1";
|
|
39
|
+
if (Q(e.suffix))
|
|
40
|
+
return "Other";
|
|
41
|
+
if (W(e.suffix))
|
|
42
|
+
return "Other";
|
|
43
|
+
if (k(e.suffix))
|
|
44
|
+
return "Pic";
|
|
45
|
+
}, X = { class: "file-preview-wrapper" }, Y = {
|
|
46
|
+
key: 0,
|
|
47
|
+
class: "panel-preview"
|
|
48
|
+
}, ee = { class: "panel-preview__item" }, te = ["onClick"], ne = ["src", "alt"], oe = { class: "panel-preview__name ellipsis" }, se = { key: 0 }, re = { key: 1 }, le = {
|
|
49
|
+
key: 1,
|
|
50
|
+
class: "upload-preview"
|
|
51
|
+
}, ie = ["src", "alt"], ae = { class: "preview-item__mask" }, ce = {
|
|
52
|
+
__name: "index",
|
|
53
|
+
props: {
|
|
54
|
+
fileList: {
|
|
55
|
+
type: Array,
|
|
56
|
+
default: () => []
|
|
57
|
+
},
|
|
58
|
+
canEdit: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: !0
|
|
61
|
+
},
|
|
62
|
+
previewType: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: g.面板
|
|
65
|
+
},
|
|
66
|
+
isStream: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: !1
|
|
69
|
+
},
|
|
70
|
+
isCustom: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: !1
|
|
73
|
+
},
|
|
74
|
+
// 下载文件函数,接收 (item) => Promise<Array<{ url, suffix }>>
|
|
75
|
+
onDownload: {
|
|
76
|
+
type: Function,
|
|
77
|
+
default: null
|
|
78
|
+
},
|
|
79
|
+
// 下载文件流函数,接收 (item) => Promise<Blob>
|
|
80
|
+
onDownloadStream: {
|
|
81
|
+
type: Function,
|
|
82
|
+
default: null
|
|
83
|
+
},
|
|
84
|
+
// 预览图片函数,接收 (url) => void
|
|
85
|
+
onPreviewImage: {
|
|
86
|
+
type: Function,
|
|
87
|
+
default: null
|
|
88
|
+
},
|
|
89
|
+
// 下载 Blob 文件函数,接收 (blob, name, type) => string
|
|
90
|
+
downloadBlobFile: {
|
|
91
|
+
type: Function,
|
|
92
|
+
default: null
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
emits: ["on-remove", "on-preview"],
|
|
96
|
+
setup(e, { emit: s }) {
|
|
97
|
+
const l = e, f = s, { downloadPrew: B, downloadStreamPrew: I } = H({
|
|
98
|
+
onDownload: l.onDownload,
|
|
99
|
+
onDownloadStream: l.onDownloadStream,
|
|
100
|
+
onPreviewImage: l.onPreviewImage || ((o) => window.open(o, "_blank")),
|
|
101
|
+
downloadBlobFile: l.downloadBlobFile
|
|
102
|
+
}), y = (o) => R(o);
|
|
103
|
+
function F(o) {
|
|
104
|
+
l.isCustom ? f("on-preview", o) : l.isStream ? l.onDownloadStream ? I(o) : (console.warn("FilePreview: isStream 为 true 但未提供 onDownloadStream 函数"), f("on-preview", o)) : l.onDownload ? B(o) : f("on-preview", o);
|
|
105
|
+
}
|
|
106
|
+
function h(o, p) {
|
|
107
|
+
f("on-remove", o, p);
|
|
108
|
+
}
|
|
109
|
+
return (o, p) => {
|
|
110
|
+
const d = c("el-icon"), $ = c("el-button"), P = c("IconDelete"), E = c("el-col"), T = c("el-row"), z = c("IconHide");
|
|
111
|
+
return n(), r("div", X, [
|
|
112
|
+
e.previewType === _(g).面板 ? (n(), r("div", Y, [
|
|
113
|
+
C(o.$slots, "PanelUploader", {}, void 0, !0),
|
|
114
|
+
u(T, {
|
|
115
|
+
gutter: 20,
|
|
116
|
+
class: "panel-preview__row"
|
|
117
|
+
}, {
|
|
118
|
+
default: i(() => [
|
|
119
|
+
(n(!0), r(D, null, b(e.fileList, (t, m) => (n(), a(E, {
|
|
120
|
+
span: 8,
|
|
121
|
+
key: t.bnid
|
|
122
|
+
}, {
|
|
123
|
+
default: i(() => [
|
|
124
|
+
x("div", ee, [
|
|
125
|
+
x("div", {
|
|
126
|
+
class: "panel-preview__box",
|
|
127
|
+
onClick: (v) => F(t)
|
|
128
|
+
}, [
|
|
129
|
+
_(k)(t.suffix) ? (n(), r("img", {
|
|
130
|
+
key: 0,
|
|
131
|
+
src: t.url,
|
|
132
|
+
alt: t.name,
|
|
133
|
+
class: "panel-preview__img"
|
|
134
|
+
}, null, 8, ne)) : (n(), a(d, {
|
|
135
|
+
key: 1,
|
|
136
|
+
size: "32px",
|
|
137
|
+
class: "panel-preview__img"
|
|
138
|
+
}, {
|
|
139
|
+
default: i(() => [
|
|
140
|
+
(n(), a(S(y(t))))
|
|
141
|
+
]),
|
|
142
|
+
_: 2
|
|
143
|
+
}, 1024)),
|
|
144
|
+
x("span", oe, V(t.name), 1)
|
|
145
|
+
], 8, te),
|
|
146
|
+
t.isUploading ? (n(), r("div", se, [
|
|
147
|
+
u($, {
|
|
148
|
+
text: "",
|
|
149
|
+
size: "small",
|
|
150
|
+
loading: ""
|
|
151
|
+
}, {
|
|
152
|
+
default: i(() => [...p[0] || (p[0] = [
|
|
153
|
+
L("上传中...", -1)
|
|
154
|
+
])]),
|
|
155
|
+
_: 1
|
|
156
|
+
})
|
|
157
|
+
])) : (n(), r("div", re, [
|
|
158
|
+
e.canEdit ? (n(), a(d, {
|
|
159
|
+
key: 0,
|
|
160
|
+
size: "18",
|
|
161
|
+
style: { cursor: "pointer" },
|
|
162
|
+
onClick: (v) => h(m, t)
|
|
163
|
+
}, {
|
|
164
|
+
default: i(() => [
|
|
165
|
+
u(P)
|
|
166
|
+
]),
|
|
167
|
+
_: 1
|
|
168
|
+
}, 8, ["onClick"])) : w("", !0)
|
|
169
|
+
]))
|
|
170
|
+
])
|
|
171
|
+
]),
|
|
172
|
+
_: 2
|
|
173
|
+
}, 1024))), 128))
|
|
174
|
+
]),
|
|
175
|
+
_: 1
|
|
176
|
+
})
|
|
177
|
+
])) : w("", !0),
|
|
178
|
+
e.previewType === _(g).卡片 ? (n(), r("ul", le, [
|
|
179
|
+
(n(!0), r(D, null, b(e.fileList, (t, m) => (n(), r("li", {
|
|
180
|
+
class: "preview-item",
|
|
181
|
+
key: t.bnid
|
|
182
|
+
}, [
|
|
183
|
+
_(k)(t.suffix) ? (n(), r("img", {
|
|
184
|
+
key: 0,
|
|
185
|
+
src: t.url,
|
|
186
|
+
alt: t.name,
|
|
187
|
+
class: "preview-item__img"
|
|
188
|
+
}, null, 8, ie)) : (n(), a(d, {
|
|
189
|
+
key: 1,
|
|
190
|
+
size: "32px",
|
|
191
|
+
class: "preview-item__img"
|
|
192
|
+
}, {
|
|
193
|
+
default: i(() => [
|
|
194
|
+
(n(), a(S(y(t))))
|
|
195
|
+
]),
|
|
196
|
+
_: 2
|
|
197
|
+
}, 1024)),
|
|
198
|
+
x("div", ae, [
|
|
199
|
+
u(d, {
|
|
200
|
+
class: "preview-item__mask--view",
|
|
201
|
+
onClick: (v) => F(t)
|
|
202
|
+
}, {
|
|
203
|
+
default: i(() => [
|
|
204
|
+
u(z)
|
|
205
|
+
]),
|
|
206
|
+
_: 1
|
|
207
|
+
}, 8, ["onClick"]),
|
|
208
|
+
e.canEdit ? (n(), a(d, {
|
|
209
|
+
key: 0,
|
|
210
|
+
class: "preview-item__mask--delete",
|
|
211
|
+
onClick: (v) => h(m, t)
|
|
212
|
+
}, {
|
|
213
|
+
default: i(() => [
|
|
214
|
+
u(P)
|
|
215
|
+
]),
|
|
216
|
+
_: 1
|
|
217
|
+
}, 8, ["onClick"])) : w("", !0)
|
|
218
|
+
])
|
|
219
|
+
]))), 128)),
|
|
220
|
+
C(o.$slots, "CardUploader", {}, void 0, !0)
|
|
221
|
+
])) : w("", !0)
|
|
222
|
+
]);
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
}, ue = /* @__PURE__ */ N(ce, [["__scopeId", "data-v-fe542fce"]]), _e = U(ue);
|
|
226
|
+
export {
|
|
227
|
+
_e as FilePreview,
|
|
228
|
+
_e as default
|
|
229
|
+
};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { w as S } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
+
import { ref as u, nextTick as w, resolveComponent as B, createBlock as G, openBlock as N, unref as I, normalizeClass as U, withCtx as A, createVNode as F, createElementVNode as L, createTextVNode as h, toDisplayString as R } from "vue";
|
|
3
|
+
import { useDialog as $, DialogContainer as x } from "./DialogContainer.mjs";
|
|
4
|
+
import { CreateMcpForm as k } from "./CreateMcpForm.mjs";
|
|
5
|
+
import { u as V } from "./chunks/i18n.Bd7hh14j.js";
|
|
6
|
+
import { useRouter as X } from "vue-router";
|
|
7
|
+
import { g as z } from "./chunks/request.24c3shPx.js";
|
|
8
|
+
import { _ as Q } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
9
|
+
import { ElMessage as v } from "element-plus";
|
|
10
|
+
import './assets/McpFormDialog.css';const b = () => {
|
|
11
|
+
const { $request: _, $env: a } = z();
|
|
12
|
+
return {
|
|
13
|
+
createMcp: (l) => _({
|
|
14
|
+
url: `${a.VITE_APP_AIBOX_BASE_URL}/api/v1/mcp/customize`,
|
|
15
|
+
method: "post",
|
|
16
|
+
data: l
|
|
17
|
+
}),
|
|
18
|
+
getMcpDetail: (l) => _({
|
|
19
|
+
url: `${a.VITE_APP_AIBOX_BASE_URL}/api/v1/mcp/customize/${l}`,
|
|
20
|
+
method: "get"
|
|
21
|
+
}),
|
|
22
|
+
updateMcp: (l, e) => _({
|
|
23
|
+
url: `${a.VITE_APP_AIBOX_BASE_URL}/api/v1/mcp/customize/${l}`,
|
|
24
|
+
method: "put",
|
|
25
|
+
data: e
|
|
26
|
+
})
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
function ae(_ = {}) {
|
|
30
|
+
const { t: a, onSuccess: g, onError: M } = _, P = () => {
|
|
31
|
+
const { getMcpDetail: o, updateMcp: t, createMcp: r } = b();
|
|
32
|
+
return { getMcpDetail: o, updateMcp: t, createMcp: r };
|
|
33
|
+
}, l = u(!0), e = u(null), f = u(!1), i = u(null), E = async (o, t) => {
|
|
34
|
+
if (!o || !o.bnid && !o.id) {
|
|
35
|
+
v.error(a?.("MCPFORMDIALOG.MCP_ID_REQUIRED") || "缺少MCP ID,无法编辑");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const r = o.bnid || o.id;
|
|
39
|
+
e.value = r, l.value = !0, t();
|
|
40
|
+
try {
|
|
41
|
+
const { getMcpDetail: n } = P(), p = await n(r);
|
|
42
|
+
p.code === 0 && p.data ? (await w(), i.value && i.value.setFormData(p.data)) : m();
|
|
43
|
+
} catch (n) {
|
|
44
|
+
console.error("获取MCP详情失败:", n), m();
|
|
45
|
+
}
|
|
46
|
+
}, m = (o) => {
|
|
47
|
+
o && o(), e.value = null, l.value = !0;
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
// 状态
|
|
51
|
+
isEdit: l,
|
|
52
|
+
currentBnid: e,
|
|
53
|
+
btnLoading: f,
|
|
54
|
+
createFormRef: i,
|
|
55
|
+
// 方法
|
|
56
|
+
showEditDialog: E,
|
|
57
|
+
hideEditDialog: m,
|
|
58
|
+
submitForm: async (o, t) => {
|
|
59
|
+
if (f.value = !0, !i.value) {
|
|
60
|
+
console.error("表单引用不存在"), f.value = !1;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
if (await i.value.validate()) {
|
|
65
|
+
const n = i.value.getFormData();
|
|
66
|
+
if (!e.value) {
|
|
67
|
+
v.error(a?.("MCPFORMDIALOG.MCP_ID_REQUIRED") || "缺少MCP ID,无法更新"), f.value = !1;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const { updateMcp: p } = P(), d = await p(e.value, n);
|
|
71
|
+
if (d.code === 0)
|
|
72
|
+
v.success(a?.("MCPFORMDIALOG.UPDATE_SUCCESS") || "更新MCP成功"), m(o), g && g(n, e.value), t && t("refresh");
|
|
73
|
+
else if (d.code === -1)
|
|
74
|
+
console.error("更新MCP失败,返回数据异常:", d), v.error(d.msg || a?.("MCPFORMDIALOG.UPDATE_FAIL"));
|
|
75
|
+
else {
|
|
76
|
+
const C = d.msg || a?.("MCPFORMDIALOG.UPDATE_FAIL") || "更新MCP失败";
|
|
77
|
+
v.error(C), M && M(new Error(C));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
} catch (r) {
|
|
81
|
+
console.error("表单提交错误:", r), v.error(r.message || a?.("MCPFORMDIALOG.UPDATE_FAIL") || "更新MCP失败"), M && M(r);
|
|
82
|
+
} finally {
|
|
83
|
+
f.value = !1;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const q = {
|
|
89
|
+
class: /* @__PURE__ */ U("custom-mcp-dialog__footer")
|
|
90
|
+
}, j = {
|
|
91
|
+
__name: "McpFormDialog",
|
|
92
|
+
emits: ["refresh"],
|
|
93
|
+
setup(_, { expose: a, emit: g }) {
|
|
94
|
+
const { getMcpDetail: M, updateMcp: P, createMcp: l } = b(), { t: e } = V(), { dialogRef: f, showDialog: i, hideDialog: E } = $(), m = g, T = X(), o = u(!1), t = u(null), r = u(null), n = u(!1), p = () => {
|
|
95
|
+
o.value = !1, r.value = null, i();
|
|
96
|
+
}, d = async (D) => {
|
|
97
|
+
o.value = !0, r.value = D.bnid, i();
|
|
98
|
+
try {
|
|
99
|
+
const c = await M(D.bnid);
|
|
100
|
+
c.code === 0 && c.data ? (await w(), t.value && t.value.setFormData(c.data)) : E();
|
|
101
|
+
} catch (c) {
|
|
102
|
+
console.error("获取MCP详情失败:", c), E();
|
|
103
|
+
}
|
|
104
|
+
}, C = () => {
|
|
105
|
+
E(), r.value = null;
|
|
106
|
+
}, y = async () => {
|
|
107
|
+
if (n.value = !0, !t.value) {
|
|
108
|
+
console.error("表单引用不存在");
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
if (await t.value.validate()) {
|
|
113
|
+
const c = t.value.getFormData();
|
|
114
|
+
if (o.value) {
|
|
115
|
+
if (!r.value) {
|
|
116
|
+
ElMessage.error(e("MCPFORMDIALOG.MCP_ID_REQUIRED") || "缺少MCP ID,无法更新");
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const s = await P(r.value, c);
|
|
120
|
+
s.code === 0 ? (ElMessage.success(e("MCPFORMDIALOG.UPDATE_SUCCESS") || "更新MCP成功"), C(), m("refresh")) : s.code === -1 && (console.error("更新MCP失败,返回数据异常:", s), ElMessage.error(s.msg || e("MCPFORMDIALOG.UPDATE_FAIL")));
|
|
121
|
+
} else {
|
|
122
|
+
const s = await l(c);
|
|
123
|
+
if (console.log("创建MCP响应:", s), s.code === 0) {
|
|
124
|
+
const O = s.data;
|
|
125
|
+
ElMessage.success(e("MCPFORMDIALOG.CREATE_SUCCESS") || "创建MCP成功"), C(), m("refresh"), O ? T.push({
|
|
126
|
+
name: "MCPTool",
|
|
127
|
+
params: {
|
|
128
|
+
bnId: O
|
|
129
|
+
}
|
|
130
|
+
}) : console.warn("创建MCP成功,但未返回bnid,无法跳转");
|
|
131
|
+
} else
|
|
132
|
+
console.error("创建MCP失败,返回数据异常:", s);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
} catch (D) {
|
|
136
|
+
console.error("表单提交错误:", D);
|
|
137
|
+
} finally {
|
|
138
|
+
n.value = !1;
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
return a({ showCreateDialog: p, showEditDialog: d }), (D, c) => {
|
|
142
|
+
const s = B("el-button");
|
|
143
|
+
return N(), G(I(x), {
|
|
144
|
+
class: U("custom-mcp-dialog"),
|
|
145
|
+
width: "520px",
|
|
146
|
+
ref_key: "dialogRef",
|
|
147
|
+
ref: f
|
|
148
|
+
}, {
|
|
149
|
+
title: A(() => [
|
|
150
|
+
L("div", null, R(I(e)("MCPFORMDIALOG.TITLE")), 1)
|
|
151
|
+
]),
|
|
152
|
+
footer: A(() => [
|
|
153
|
+
L("div", q, [
|
|
154
|
+
F(s, { onClick: C }, {
|
|
155
|
+
default: A(() => [
|
|
156
|
+
h(R(I(e)("COMMON_BUTTON.CANCEL_TEXT")), 1)
|
|
157
|
+
]),
|
|
158
|
+
_: 1
|
|
159
|
+
}),
|
|
160
|
+
F(s, {
|
|
161
|
+
color: "var(--el-color-primary)",
|
|
162
|
+
type: "primary",
|
|
163
|
+
onClick: c[0] || (c[0] = (O) => y()),
|
|
164
|
+
loading: n.value
|
|
165
|
+
}, {
|
|
166
|
+
default: A(() => [
|
|
167
|
+
h(R(I(e)("COMMON_BUTTON.CONFIRM_TEXT")), 1)
|
|
168
|
+
]),
|
|
169
|
+
_: 1
|
|
170
|
+
}, 8, ["loading"])
|
|
171
|
+
])
|
|
172
|
+
]),
|
|
173
|
+
default: A(() => [
|
|
174
|
+
F(I(k), {
|
|
175
|
+
ref_key: "createFormRef",
|
|
176
|
+
ref: t
|
|
177
|
+
}, null, 512)
|
|
178
|
+
]),
|
|
179
|
+
_: 1
|
|
180
|
+
}, 512);
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
}, H = /* @__PURE__ */ Q(j, [["__scopeId", "data-v-69163ac9"]]), se = S(H);
|
|
184
|
+
export {
|
|
185
|
+
se as McpFormDialog,
|
|
186
|
+
se as default,
|
|
187
|
+
ae as useMcpEditDialog
|
|
188
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { w as V } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
+
import { computed as m, resolveComponent as l, createElementBlock as n, openBlock as a, normalizeClass as p, createCommentVNode as d, createVNode as c, createTextVNode as f, createBlock as v, toDisplayString as g, withCtx as r, Fragment as N, renderList as T, renderSlot as q } from "vue";
|
|
3
|
+
import { _ as B } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
4
|
+
import './assets/RadioGroup.css';const G = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "field-label"
|
|
7
|
+
}, I = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "required"
|
|
10
|
+
}, w = {
|
|
11
|
+
__name: "RadioGroup",
|
|
12
|
+
props: {
|
|
13
|
+
modelValue: {
|
|
14
|
+
type: [String, Number, null],
|
|
15
|
+
required: !1,
|
|
16
|
+
default: null
|
|
17
|
+
},
|
|
18
|
+
options: {
|
|
19
|
+
type: Array,
|
|
20
|
+
required: !0,
|
|
21
|
+
default: () => []
|
|
22
|
+
},
|
|
23
|
+
label: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: ""
|
|
26
|
+
},
|
|
27
|
+
required: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !1
|
|
30
|
+
},
|
|
31
|
+
className: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: ""
|
|
34
|
+
},
|
|
35
|
+
direction: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: "horizontal",
|
|
38
|
+
// horizontal | vertical
|
|
39
|
+
validator: (e) => ["horizontal", "vertical"].includes(e)
|
|
40
|
+
},
|
|
41
|
+
layout: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: "horizontal",
|
|
44
|
+
// horizontal | vertical (controls label and radio group layout)
|
|
45
|
+
validator: (e) => ["horizontal", "vertical"].includes(e)
|
|
46
|
+
},
|
|
47
|
+
tipText: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: ""
|
|
50
|
+
},
|
|
51
|
+
disabled: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: !1
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
emits: ["update:modelValue", "change"],
|
|
57
|
+
setup(e, { emit: y }) {
|
|
58
|
+
const i = e, s = y, _ = m(() => i.layout === "vertical" ? "container-vertical" : ""), h = m(() => {
|
|
59
|
+
const t = i.className, u = i.direction === "vertical" ? "radio-group-vertical" : "radio-group-horizontal";
|
|
60
|
+
return `${t} ${u}`.trim();
|
|
61
|
+
}), b = (t) => {
|
|
62
|
+
s("update:modelValue", t), s("change", t);
|
|
63
|
+
};
|
|
64
|
+
return (t, u) => {
|
|
65
|
+
const C = l("IconTip"), x = l("el-icon"), S = l("el-tooltip"), k = l("el-radio"), z = l("el-radio-group");
|
|
66
|
+
return a(), n("div", {
|
|
67
|
+
class: p(["radio-group-container", _.value])
|
|
68
|
+
}, [
|
|
69
|
+
e.label ? (a(), n("div", G, [
|
|
70
|
+
e.required ? (a(), n("span", I, "*")) : d("", !0),
|
|
71
|
+
f(" " + g(e.label) + " ", 1),
|
|
72
|
+
e.tipText ? (a(), v(S, {
|
|
73
|
+
key: 1,
|
|
74
|
+
content: e.tipText,
|
|
75
|
+
placement: "top"
|
|
76
|
+
}, {
|
|
77
|
+
default: r(() => [
|
|
78
|
+
c(x, {
|
|
79
|
+
style: { "margin-left": "4px" },
|
|
80
|
+
size: "14px",
|
|
81
|
+
color: "#999"
|
|
82
|
+
}, {
|
|
83
|
+
default: r(() => [
|
|
84
|
+
c(C)
|
|
85
|
+
]),
|
|
86
|
+
_: 1
|
|
87
|
+
})
|
|
88
|
+
]),
|
|
89
|
+
_: 1
|
|
90
|
+
}, 8, ["content"])) : d("", !0)
|
|
91
|
+
])) : d("", !0),
|
|
92
|
+
c(z, {
|
|
93
|
+
"model-value": e.modelValue,
|
|
94
|
+
class: p(h.value),
|
|
95
|
+
disabled: e.disabled,
|
|
96
|
+
onChange: b
|
|
97
|
+
}, {
|
|
98
|
+
default: r(() => [
|
|
99
|
+
(a(!0), n(N, null, T(e.options, (o) => (a(), v(k, {
|
|
100
|
+
key: o.value,
|
|
101
|
+
class: "radio-item",
|
|
102
|
+
value: o.value
|
|
103
|
+
}, {
|
|
104
|
+
default: r(() => [
|
|
105
|
+
f(g(o.label) + " ", 1),
|
|
106
|
+
q(t.$slots, o.value, {}, void 0, !0)
|
|
107
|
+
]),
|
|
108
|
+
_: 2
|
|
109
|
+
}, 1032, ["value"]))), 128))
|
|
110
|
+
]),
|
|
111
|
+
_: 3
|
|
112
|
+
}, 8, ["model-value", "class", "disabled"])
|
|
113
|
+
], 2);
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}, R = /* @__PURE__ */ B(w, [["__scopeId", "data-v-e31adbcf"]]), E = V(R);
|
|
117
|
+
export {
|
|
118
|
+
E as RadioGroup,
|
|
119
|
+
E as default
|
|
120
|
+
};
|