china-mobile-international-custom-components 0.0.54 → 0.0.56
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/ApplicationIcon.mjs +38 -37
- package/es/AuthSection.mjs +191 -0
- package/es/CodeView.mjs +170 -0
- package/es/CommonTagsList.mjs +31 -30
- package/es/CreateMcpForm.mjs +331 -0
- package/es/FilePreview.mjs +229 -0
- package/es/FileUploader.mjs +92 -87
- package/es/McpFormDialog.mjs +187 -0
- package/es/RadioGroup.mjs +119 -0
- package/es/SourcePublish.mjs +2 -2
- package/es/assets/AddOrEditSupplierDialog.css +1 -1
- package/es/assets/AuthSection.css +1 -0
- package/es/assets/CodeView.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/usePreview.css +1 -0
- package/es/chunks/config.CgrPt4Zx.js +435 -0
- package/es/chunks/mcp-tool.Nc4HT9IM.js +4 -0
- package/es/chunks/usePreview.BMkgYO7E.js +124 -0
- package/es/index.mjs +167 -149
- package/lib/AddOrEditSupplierDialog.js +1 -1
- package/lib/ApplicationIcon.js +1 -1
- package/lib/AuthSection.js +1 -0
- package/lib/CodeView.js +1 -0
- package/lib/CommonTagsList.js +1 -1
- package/lib/CreateMcpForm.js +1 -0
- package/lib/FilePreview.js +1 -0
- package/lib/FileUploader.js +1 -1
- 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/CodeView.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/usePreview.css +1 -0
- package/lib/chunks/config.BvBtwI1A.js +1 -0
- package/lib/chunks/mcp-tool.fb1SS2wA.js +1 -0
- package/lib/chunks/usePreview.BzTCNJfE.js +1 -0
- package/lib/index.js +1 -1
- package/package.json +7 -1
package/es/ApplicationIcon.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { w as
|
|
2
|
-
import { computed as s, createElementBlock as
|
|
3
|
-
import { WorkflowIcon3 as
|
|
4
|
-
import { S as
|
|
5
|
-
import { ElImage as
|
|
6
|
-
|
|
1
|
+
import { w as d } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
+
import { computed as s, createElementBlock as I, openBlock as n, createBlock as c, unref as a, normalizeStyle as T, withCtx as r, createVNode as w, resolveDynamicComponent as u } from "vue";
|
|
3
|
+
import { WorkflowIcon3 as z, WorkflowIcon1 as g, Model as E, Plugin as k, Workflow as v } from "color-message-aibox-vue";
|
|
4
|
+
import { S as o, A as m } from "./chunks/config.DE5PZU2F.js";
|
|
5
|
+
import { ElImage as A, ElIcon as f } from "element-plus";
|
|
6
|
+
import { m as M } from "./chunks/mcp-tool.Nc4HT9IM.js";
|
|
7
|
+
const O = /* @__PURE__ */ Object.assign({
|
|
7
8
|
name: "ApplicationIcon"
|
|
8
9
|
}, {
|
|
9
10
|
__name: "layout",
|
|
@@ -18,7 +19,7 @@ const E = "data:image/webp;base64,UklGRiIOAABXRUJQVlA4WAoAAAAwAAAAdwAAdwAASUNDUM
|
|
|
18
19
|
},
|
|
19
20
|
applicationType: {
|
|
20
21
|
type: String,
|
|
21
|
-
default:
|
|
22
|
+
default: o.AGENT
|
|
22
23
|
},
|
|
23
24
|
// 图标字段名,用于指定从row中获取图标的字段
|
|
24
25
|
iconField: {
|
|
@@ -26,53 +27,53 @@ const E = "data:image/webp;base64,UklGRiIOAABXRUJQVlA4WAoAAAAwAAAAdwAAdwAASUNDUM
|
|
|
26
27
|
default: "icon"
|
|
27
28
|
}
|
|
28
29
|
},
|
|
29
|
-
setup(
|
|
30
|
-
const
|
|
31
|
-
const i =
|
|
30
|
+
setup(t) {
|
|
31
|
+
const e = t, l = s(() => {
|
|
32
|
+
const i = e.row?.[e.iconField];
|
|
32
33
|
if (i)
|
|
33
34
|
return i;
|
|
34
|
-
if (
|
|
35
|
-
return
|
|
36
|
-
}),
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
}[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
}[
|
|
44
|
-
return (i,
|
|
45
|
-
|
|
35
|
+
if (e.applicationType === o.MCP)
|
|
36
|
+
return M;
|
|
37
|
+
}), p = s(() => e.applicationType === o.AGENT ? {
|
|
38
|
+
[m.autonomous]: g,
|
|
39
|
+
[m.dialogue]: z
|
|
40
|
+
}[e.row?.type] : {
|
|
41
|
+
[o.WORKFLOW]: v,
|
|
42
|
+
[o.PLUGIN]: k,
|
|
43
|
+
[o.MODEL]: E
|
|
44
|
+
}[e.applicationType]);
|
|
45
|
+
return (i, y) => (n(), I("div", null, [
|
|
46
|
+
l.value ? (n(), c(a(A), {
|
|
46
47
|
key: 0,
|
|
47
|
-
style:
|
|
48
|
-
src:
|
|
48
|
+
style: T({ width: t.size + "px", height: t.size + "px" }),
|
|
49
|
+
src: l.value,
|
|
49
50
|
fit: "cover",
|
|
50
51
|
class: "radius-8"
|
|
51
52
|
}, {
|
|
52
|
-
error:
|
|
53
|
-
|
|
54
|
-
default:
|
|
55
|
-
(
|
|
53
|
+
error: r(() => [
|
|
54
|
+
w(a(f), { size: t.size }, {
|
|
55
|
+
default: r(() => [
|
|
56
|
+
(n(), c(u(p.value)))
|
|
56
57
|
]),
|
|
57
58
|
_: 1
|
|
58
59
|
}, 8, ["size"])
|
|
59
60
|
]),
|
|
60
61
|
_: 1
|
|
61
|
-
}, 8, ["style", "src"])) : (
|
|
62
|
+
}, 8, ["style", "src"])) : (n(), c(a(f), {
|
|
62
63
|
key: 1,
|
|
63
|
-
size:
|
|
64
|
+
size: t.size
|
|
64
65
|
}, {
|
|
65
|
-
default:
|
|
66
|
-
(
|
|
66
|
+
default: r(() => [
|
|
67
|
+
(n(), c(u(p.value)))
|
|
67
68
|
]),
|
|
68
69
|
_: 1
|
|
69
70
|
}, 8, ["size"]))
|
|
70
71
|
]));
|
|
71
72
|
}
|
|
72
|
-
}),
|
|
73
|
+
}), W = d(O);
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
m as APPLICATION_TYPE,
|
|
76
|
+
W as ApplicationIcon,
|
|
77
|
+
o as SOURCE_TYPE,
|
|
78
|
+
W as default
|
|
78
79
|
};
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { w as Y } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
+
import { mergeModels as A, useModel as x, ref as D, watch as w, createElementBlock as h, openBlock as i, createVNode as r, createBlock as c, createCommentVNode as d, unref as a, createElementVNode as E, createTextVNode as N, toDisplayString as L, withCtx as T, normalizeClass as O, withDirectives as C, vShow as M } from "vue";
|
|
3
|
+
import { RadioGroup as y } from "./RadioGroup.mjs";
|
|
4
|
+
import { ElTooltip as f, ElIcon as I, ElInput as _ } from "element-plus";
|
|
5
|
+
import { u as P } from "./chunks/i18n.Bd7hh14j.js";
|
|
6
|
+
import { IconTip as V } from "color-message-aibox-vue";
|
|
7
|
+
import { _ as R } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
8
|
+
import './assets/AuthSection.css';const q = { class: "auth-section" }, z = {
|
|
9
|
+
key: 2,
|
|
10
|
+
class: "auth-input-field"
|
|
11
|
+
}, F = { class: "field-label" }, G = {
|
|
12
|
+
key: 3,
|
|
13
|
+
class: "auth-input-field"
|
|
14
|
+
}, Q = { class: "field-label" }, j = {
|
|
15
|
+
__name: "AuthSection",
|
|
16
|
+
props: /* @__PURE__ */ A({
|
|
17
|
+
layout: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: "horizontal"
|
|
20
|
+
}
|
|
21
|
+
}, {
|
|
22
|
+
featData: {
|
|
23
|
+
default: () => ({
|
|
24
|
+
auth: {}
|
|
25
|
+
})
|
|
26
|
+
},
|
|
27
|
+
featDataModifiers: {}
|
|
28
|
+
}),
|
|
29
|
+
emits: /* @__PURE__ */ A(["auth-validation-errors", "resetDebugStatus"], ["update:featData"]),
|
|
30
|
+
setup(s, { expose: U, emit: k }) {
|
|
31
|
+
const { t } = P(), e = x(s, "featData"), v = k, p = () => {
|
|
32
|
+
v("resetDebugStatus");
|
|
33
|
+
}, S = [
|
|
34
|
+
{ value: "none", label: t("COMMON_AUTHSECTION.LABEL_NO_AUTH") },
|
|
35
|
+
{ value: "apiKey", label: t("COMMON_AUTHSECTION.LABEL_API_KEY") }
|
|
36
|
+
], B = [
|
|
37
|
+
{ value: "bearer", label: t("COMMON_AUTHSECTION.LABEL_BEARER") },
|
|
38
|
+
{ value: "custom", label: t("COMMON_AUTHSECTION.LABEL_CUSTOM") }
|
|
39
|
+
], H = [
|
|
40
|
+
{ value: "header", label: t("COMMON_AUTHSECTION.LABEL_KEY_LOCATION_HEADER") },
|
|
41
|
+
{ value: "query", label: t("COMMON_AUTHSECTION.LABEL_KEY_LOCATION_QUERY") }
|
|
42
|
+
], K = (n) => {
|
|
43
|
+
p(), u.value = {}, n === "apiKey" ? e.value.auth = {
|
|
44
|
+
authType: "apiKey",
|
|
45
|
+
keyType: "custom",
|
|
46
|
+
paramLocation: "header",
|
|
47
|
+
paramName: "",
|
|
48
|
+
paramValue: "",
|
|
49
|
+
token: ""
|
|
50
|
+
} : e.value.auth = {
|
|
51
|
+
authType: "none"
|
|
52
|
+
};
|
|
53
|
+
}, b = (n) => {
|
|
54
|
+
p(), u.value = {}, n === "bearer" ? (e.value.auth.paramName = "", e.value.auth.paramValue = "") : n === "custom" && (e.value.auth.token = "");
|
|
55
|
+
}, g = (n) => {
|
|
56
|
+
console.log(n, "value"), p(), u.value = {}, n === "query" && (e.value.auth.token = "", e.value.auth.keyType = "custom");
|
|
57
|
+
}, u = D({}), m = () => (p(), u.value = {}, e.value.auth.authType === "apiKey" && (e.value.auth.keyType === "custom" && (e.value.auth.paramName || (u.value.paramName = !0)), e.value.auth.keyType === "custom" && (e.value.auth.paramValue || (u.value.paramValue = !0)), e.value.auth.keyType === "bearer" && (e.value.auth.token || (u.value.token = !0))), u.value);
|
|
58
|
+
return w(
|
|
59
|
+
() => u.value,
|
|
60
|
+
() => {
|
|
61
|
+
v("auth-validation-errors", u.value);
|
|
62
|
+
}
|
|
63
|
+
), U({
|
|
64
|
+
validateField: m
|
|
65
|
+
}), (n, l) => (i(), h("div", q, [
|
|
66
|
+
r(a(y), {
|
|
67
|
+
modelValue: e.value.auth.authType,
|
|
68
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => e.value.auth.authType = o),
|
|
69
|
+
options: S,
|
|
70
|
+
label: a(t)("COMMON_AUTHSECTION.LABEL_AUTH_TYPE"),
|
|
71
|
+
required: !0,
|
|
72
|
+
className: "auth-radio-group",
|
|
73
|
+
layout: s.layout,
|
|
74
|
+
onChange: K
|
|
75
|
+
}, null, 8, ["modelValue", "label", "layout"]),
|
|
76
|
+
e.value.auth.authType === "apiKey" ? (i(), c(a(y), {
|
|
77
|
+
key: 0,
|
|
78
|
+
modelValue: e.value.auth.paramLocation,
|
|
79
|
+
"onUpdate:modelValue": l[1] || (l[1] = (o) => e.value.auth.paramLocation = o),
|
|
80
|
+
options: H,
|
|
81
|
+
label: a(t)("COMMON_AUTHSECTION.LABEL_KEY_LOCATION"),
|
|
82
|
+
"tip-text": a(t)("COMMON_AUTHSECTION.LABEL_KEY_LOCATION_TIP"),
|
|
83
|
+
required: !0,
|
|
84
|
+
className: "location-radio-group",
|
|
85
|
+
layout: s.layout,
|
|
86
|
+
onChange: g
|
|
87
|
+
}, null, 8, ["modelValue", "label", "tip-text", "layout"])) : d("", !0),
|
|
88
|
+
e.value.auth.authType === "apiKey" && e.value.auth.paramLocation === "header" ? (i(), c(a(y), {
|
|
89
|
+
key: 1,
|
|
90
|
+
modelValue: e.value.auth.keyType,
|
|
91
|
+
"onUpdate:modelValue": l[2] || (l[2] = (o) => e.value.auth.keyType = o),
|
|
92
|
+
options: B,
|
|
93
|
+
label: a(t)("COMMON_AUTHSECTION.LABEL_KEY_TYPE"),
|
|
94
|
+
"tip-text": a(t)("COMMON_AUTHSECTION.LABEL_KEY_TYPE_TIP"),
|
|
95
|
+
required: !0,
|
|
96
|
+
className: "key-radio-group",
|
|
97
|
+
layout: s.layout,
|
|
98
|
+
onChange: b
|
|
99
|
+
}, null, 8, ["modelValue", "label", "tip-text", "layout"])) : d("", !0),
|
|
100
|
+
e.value.auth.authType === "apiKey" && e.value.auth.keyType === "custom" ? (i(), h("div", z, [
|
|
101
|
+
E("div", F, [
|
|
102
|
+
l[6] || (l[6] = E("span", { class: "required" }, "*", -1)),
|
|
103
|
+
N(" " + L(a(t)("COMMON_AUTHSECTION.LABEL_KEY_NAME")) + " ", 1),
|
|
104
|
+
r(a(f), {
|
|
105
|
+
content: a(t)("COMMON_AUTHSECTION.LABEL_KEY_NAME_TIP"),
|
|
106
|
+
placement: "top"
|
|
107
|
+
}, {
|
|
108
|
+
default: T(() => [
|
|
109
|
+
r(a(I), {
|
|
110
|
+
style: { "margin-left": "4px" },
|
|
111
|
+
size: "14px",
|
|
112
|
+
color: "#999"
|
|
113
|
+
}, {
|
|
114
|
+
default: T(() => [
|
|
115
|
+
r(a(V))
|
|
116
|
+
]),
|
|
117
|
+
_: 1
|
|
118
|
+
})
|
|
119
|
+
]),
|
|
120
|
+
_: 1
|
|
121
|
+
}, 8, ["content"])
|
|
122
|
+
]),
|
|
123
|
+
r(a(_), {
|
|
124
|
+
modelValue: e.value.auth.paramName,
|
|
125
|
+
"onUpdate:modelValue": l[3] || (l[3] = (o) => e.value.auth.paramName = o),
|
|
126
|
+
placeholder: a(t)("COMMON_AUTHSECTION.LABEL_KEY_NAME_PLACEHOLDER"),
|
|
127
|
+
maxlength: "64",
|
|
128
|
+
"show-word-limit": "",
|
|
129
|
+
class: O(["key-input", {
|
|
130
|
+
"error-input": u.value.paramName
|
|
131
|
+
}]),
|
|
132
|
+
onBlur: m
|
|
133
|
+
}, null, 8, ["modelValue", "placeholder", "class"])
|
|
134
|
+
])) : d("", !0),
|
|
135
|
+
e.value.auth.authType === "apiKey" ? (i(), h("div", G, [
|
|
136
|
+
E("div", Q, [
|
|
137
|
+
l[7] || (l[7] = E("span", { class: "required" }, "*", -1)),
|
|
138
|
+
N(" " + L(a(t)("COMMON_AUTHSECTION.LABEL_KEY_VALUE")) + " ", 1),
|
|
139
|
+
r(a(f), {
|
|
140
|
+
content: a(t)("COMMON_AUTHSECTION.LABEL_KEY_VALUE_TIP"),
|
|
141
|
+
placement: "top"
|
|
142
|
+
}, {
|
|
143
|
+
default: T(() => [
|
|
144
|
+
r(a(I), {
|
|
145
|
+
style: { "margin-left": "4px" },
|
|
146
|
+
size: "14px",
|
|
147
|
+
color: "#999"
|
|
148
|
+
}, {
|
|
149
|
+
default: T(() => [
|
|
150
|
+
r(a(V))
|
|
151
|
+
]),
|
|
152
|
+
_: 1
|
|
153
|
+
})
|
|
154
|
+
]),
|
|
155
|
+
_: 1
|
|
156
|
+
}, 8, ["content"])
|
|
157
|
+
]),
|
|
158
|
+
C(r(a(_), {
|
|
159
|
+
modelValue: e.value.auth.paramValue,
|
|
160
|
+
"onUpdate:modelValue": l[4] || (l[4] = (o) => e.value.auth.paramValue = o),
|
|
161
|
+
placeholder: a(t)("COMMON_AUTHSECTION.LABEL_KEY_VALUE_PLACEHOLDER"),
|
|
162
|
+
maxlength: "20000",
|
|
163
|
+
"show-word-limit": "",
|
|
164
|
+
class: O(["key-input", {
|
|
165
|
+
"error-input": u.value.paramValue
|
|
166
|
+
}]),
|
|
167
|
+
onBlur: m
|
|
168
|
+
}, null, 8, ["modelValue", "placeholder", "class"]), [
|
|
169
|
+
[M, e.value.auth.keyType === "custom"]
|
|
170
|
+
]),
|
|
171
|
+
C(r(a(_), {
|
|
172
|
+
modelValue: e.value.auth.token,
|
|
173
|
+
"onUpdate:modelValue": l[5] || (l[5] = (o) => e.value.auth.token = o),
|
|
174
|
+
placeholder: a(t)("COMMON_AUTHSECTION.LABEL_KEY_VALUE_PLACEHOLDER"),
|
|
175
|
+
maxlength: "20000",
|
|
176
|
+
"show-word-limit": "",
|
|
177
|
+
class: O(["key-input", {
|
|
178
|
+
"error-input": u.value.token
|
|
179
|
+
}]),
|
|
180
|
+
onBlur: m
|
|
181
|
+
}, null, 8, ["modelValue", "placeholder", "class"]), [
|
|
182
|
+
[M, e.value.auth.keyType === "bearer"]
|
|
183
|
+
])
|
|
184
|
+
])) : d("", !0)
|
|
185
|
+
]));
|
|
186
|
+
}
|
|
187
|
+
}, J = /* @__PURE__ */ R(j, [["__scopeId", "data-v-ce4d7772"]]), le = Y(J);
|
|
188
|
+
export {
|
|
189
|
+
le as AuthSection,
|
|
190
|
+
le as default
|
|
191
|
+
};
|
package/es/CodeView.mjs
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { w as _ } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
+
import { ref as O, shallowRef as B, watch as k, onMounted as A, resolveComponent as f, createElementBlock as N, openBlock as m, normalizeClass as b, createBlock as M, createCommentVNode as I, createVNode as c, withCtx as g, unref as y } from "vue";
|
|
3
|
+
import { Codemirror as P } from "vue-codemirror";
|
|
4
|
+
import { EditorView as h } from "@codemirror/view";
|
|
5
|
+
import { json as x } from "@codemirror/lang-json";
|
|
6
|
+
import { oneDark as L } from "@codemirror/theme-one-dark";
|
|
7
|
+
import { codeFolding as V } from "@codemirror/language";
|
|
8
|
+
import { IconCopy1 as R } from "color-message-aibox-vue";
|
|
9
|
+
import F from "copy-to-clipboard";
|
|
10
|
+
import { u as j } from "./chunks/i18n.Bd7hh14j.js";
|
|
11
|
+
import { _ as D } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
12
|
+
import './assets/CodeView.css';const J = {
|
|
13
|
+
__name: "index",
|
|
14
|
+
props: {
|
|
15
|
+
code: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ""
|
|
18
|
+
},
|
|
19
|
+
language: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: "json"
|
|
22
|
+
},
|
|
23
|
+
customExpandDepth: {
|
|
24
|
+
type: Number,
|
|
25
|
+
default: 1 / 0
|
|
26
|
+
},
|
|
27
|
+
sort: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !0
|
|
30
|
+
},
|
|
31
|
+
noPadding: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: !1
|
|
34
|
+
},
|
|
35
|
+
theme: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: "light"
|
|
38
|
+
},
|
|
39
|
+
showLength: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: !1
|
|
42
|
+
},
|
|
43
|
+
maxHeight: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "calc(100vh - 125px)"
|
|
46
|
+
},
|
|
47
|
+
showCopy: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: !1
|
|
50
|
+
},
|
|
51
|
+
// 是否自定义折叠
|
|
52
|
+
enableFolding: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: !1
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
setup(l) {
|
|
58
|
+
const { t: u } = j(), a = l, s = O(""), d = {
|
|
59
|
+
json: () => x()
|
|
60
|
+
}, C = () => {
|
|
61
|
+
const r = a.language.toLowerCase();
|
|
62
|
+
return d[r] ? d[r]() : x();
|
|
63
|
+
}, p = B([]), v = (r) => {
|
|
64
|
+
const o = r.trim(), n = (t) => {
|
|
65
|
+
try {
|
|
66
|
+
return JSON.parse(t);
|
|
67
|
+
} catch {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
let e = null;
|
|
72
|
+
if ((o.startsWith("{") || o.startsWith("[")) && (e = n(o)), !e) {
|
|
73
|
+
const t = `{${o.replace(/,\s*$/, "")}}`;
|
|
74
|
+
e = n(t);
|
|
75
|
+
}
|
|
76
|
+
if (e && typeof e == "object" && !Array.isArray(e)) {
|
|
77
|
+
const t = e.role;
|
|
78
|
+
if (t) return "role: " + t;
|
|
79
|
+
}
|
|
80
|
+
return "";
|
|
81
|
+
}, w = () => {
|
|
82
|
+
const r = [
|
|
83
|
+
C(),
|
|
84
|
+
h.editable.of(!1),
|
|
85
|
+
// 只读模式
|
|
86
|
+
h.lineWrapping
|
|
87
|
+
// 自动换行
|
|
88
|
+
];
|
|
89
|
+
a.enableFolding && r.push(
|
|
90
|
+
// 配置代码折叠,自定义折叠后的显示内容
|
|
91
|
+
V({
|
|
92
|
+
preparePlaceholder: (o, n) => {
|
|
93
|
+
try {
|
|
94
|
+
const e = o.doc.sliceString(n.from, n.to);
|
|
95
|
+
return v(e);
|
|
96
|
+
} catch (e) {
|
|
97
|
+
return console.error("Error getting fold preview:", e), "...";
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
placeholderDOM: (o, n, e) => {
|
|
101
|
+
const t = document.createElement("span");
|
|
102
|
+
return t.className = "cm-foldPlaceholder", t.onclick = n, t.style.cursor = "pointer", t.style.color = "#888", t.style.padding = "0 4px", t.style.borderRadius = "3px", t.textContent = e ? `${e}...` : "...", t;
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
), a.theme === "dark" && r.push(L), p.value = r;
|
|
106
|
+
}, E = (r) => {
|
|
107
|
+
try {
|
|
108
|
+
const o = JSON.parse(r);
|
|
109
|
+
if (a.sort && typeof o == "object" && o !== null) {
|
|
110
|
+
const n = (e) => Array.isArray(e) ? e.map(n) : typeof e == "object" && e !== null ? Object.keys(e).sort().reduce((t, i) => (t[i] = n(e[i]), t), {}) : e;
|
|
111
|
+
return JSON.stringify(n(o), null, 2);
|
|
112
|
+
}
|
|
113
|
+
return JSON.stringify(o, null, 2);
|
|
114
|
+
} catch {
|
|
115
|
+
return r;
|
|
116
|
+
}
|
|
117
|
+
}, S = (r) => {
|
|
118
|
+
F(r) ? ElMessage({
|
|
119
|
+
message: u("MESSAGE_REMIND.COPY_SUCCESS"),
|
|
120
|
+
type: "success"
|
|
121
|
+
}) : ElMessage({
|
|
122
|
+
message: u("COMMON_STORE_LIBRARY.LABEL_COPY_FAIL"),
|
|
123
|
+
type: "error"
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
return k(
|
|
127
|
+
() => a.code,
|
|
128
|
+
(r) => {
|
|
129
|
+
a.language === "json" ? s.value = E(r) : s.value = r;
|
|
130
|
+
},
|
|
131
|
+
{ immediate: !0 }
|
|
132
|
+
), A(() => {
|
|
133
|
+
w();
|
|
134
|
+
}), (r, o) => {
|
|
135
|
+
const n = f("el-icon"), e = f("el-scrollbar");
|
|
136
|
+
return m(), N("div", {
|
|
137
|
+
class: b(["code-viewer", { "no-padding": l.noPadding, dark: l.theme === "dark" }])
|
|
138
|
+
}, [
|
|
139
|
+
l.showCopy ? (m(), M(n, {
|
|
140
|
+
key: 0,
|
|
141
|
+
onClick: o[0] || (o[0] = (t) => S(l.code)),
|
|
142
|
+
class: "code-viewer__copy",
|
|
143
|
+
color: "#96A0AB",
|
|
144
|
+
size: "18px"
|
|
145
|
+
}, {
|
|
146
|
+
default: g(() => [
|
|
147
|
+
c(y(R))
|
|
148
|
+
]),
|
|
149
|
+
_: 1
|
|
150
|
+
})) : I("", !0),
|
|
151
|
+
c(e, { "max-height": l.maxHeight }, {
|
|
152
|
+
default: g(() => [
|
|
153
|
+
c(y(P), {
|
|
154
|
+
modelValue: s.value,
|
|
155
|
+
"onUpdate:modelValue": o[1] || (o[1] = (t) => s.value = t),
|
|
156
|
+
style: { height: "100%", minHeight: "100px" },
|
|
157
|
+
extensions: p.value,
|
|
158
|
+
disabled: !0
|
|
159
|
+
}, null, 8, ["modelValue", "extensions"])
|
|
160
|
+
]),
|
|
161
|
+
_: 1
|
|
162
|
+
}, 8, ["max-height"])
|
|
163
|
+
], 2);
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}, T = /* @__PURE__ */ D(J, [["__scopeId", "data-v-29ff9bad"]]), Z = _(T);
|
|
167
|
+
export {
|
|
168
|
+
Z as CodeView,
|
|
169
|
+
Z as default
|
|
170
|
+
};
|
package/es/CommonTagsList.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { w as D } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
-
import { computed as c, createBlock as p, openBlock as t, unref as s, withCtx as h, createElementVNode as m, createCommentVNode as _, resolveDynamicComponent as x, toDisplayString as
|
|
2
|
+
import { computed as c, createBlock as p, openBlock as t, unref as s, withCtx as h, createElementVNode as m, createCommentVNode as _, resolveDynamicComponent as x, toDisplayString as u, createElementBlock as l, withModifiers as M, Fragment as v, renderList as T, createVNode as b, normalizeStyle as B, createTextVNode as k } from "vue";
|
|
3
3
|
import { ElTag as w, ElIcon as U, ElPopover as z } from "element-plus";
|
|
4
4
|
import { u as G } from "./chunks/i18n.Bd7hh14j.js";
|
|
5
|
-
import { I as H, e as O, d as E, c as V, P as A, R as L, C as R, f as F } from "./chunks/config.
|
|
6
|
-
import { P as
|
|
5
|
+
import { I as H, e as O, d as E, c as V, P as A, R as L, C as R, f as F } from "./chunks/config.CgrPt4Zx.js";
|
|
6
|
+
import { P as N, A as $ } from "./chunks/index.5lH4UH_M.js";
|
|
7
7
|
import { _ as j } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
8
8
|
import './assets/CommonTagsList.css';const K = { class: "status-tag-content flex items-center" }, W = { class: "status-text fz-12" }, Y = {
|
|
9
9
|
__name: "StatusTag",
|
|
@@ -26,20 +26,20 @@ import './assets/CommonTagsList.css';const K = { class: "status-tag-content flex
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
setup(r) {
|
|
29
|
-
const S = r, a = c(() => S.inActive === H.UNPUBLISHED ?
|
|
30
|
-
return (
|
|
29
|
+
const S = r, a = c(() => S.inActive === H.UNPUBLISHED ? N.UNPUBLISHED : S.channelStatus), C = c(() => O[a.value]), y = c(() => E[a.value]), d = c(() => V[a.value]), g = c(() => A[a.value]);
|
|
30
|
+
return (i, e) => (t(), p(s(w), { type: C.value }, {
|
|
31
31
|
default: h(() => [
|
|
32
32
|
m("div", K, [
|
|
33
33
|
r.showIcon && d.value ? (t(), p(s(U), {
|
|
34
34
|
key: 0,
|
|
35
|
-
color:
|
|
35
|
+
color: g.value
|
|
36
36
|
}, {
|
|
37
37
|
default: h(() => [
|
|
38
38
|
(t(), p(x(d.value)))
|
|
39
39
|
]),
|
|
40
40
|
_: 1
|
|
41
41
|
}, 8, ["color"])) : _("", !0),
|
|
42
|
-
m("span", W,
|
|
42
|
+
m("span", W, u(r.statusText || y.value), 1)
|
|
43
43
|
])
|
|
44
44
|
]),
|
|
45
45
|
_: 1
|
|
@@ -77,35 +77,35 @@ import './assets/CommonTagsList.css';const K = { class: "status-tag-content flex
|
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
setup(r) {
|
|
80
|
-
const { t: S } = G(), a = r,
|
|
80
|
+
const { t: S } = G(), a = r, C = c(() => a.publishChannelList || []), y = c(() => {
|
|
81
81
|
if (!a.publishChannelList?.length) return [];
|
|
82
|
-
const
|
|
83
|
-
const f = o.inActive === H.UNPUBLISHED ?
|
|
82
|
+
const i = a.publishChannelList.reduce((e, o) => {
|
|
83
|
+
const f = o.inActive === H.UNPUBLISHED ? N.UNPUBLISHED : o.channelStatus;
|
|
84
84
|
return e[f] || (e[f] = []), e[f].push(o), e;
|
|
85
85
|
}, {});
|
|
86
|
-
return Object.entries(
|
|
86
|
+
return Object.entries(i).map(([e, o]) => ({
|
|
87
87
|
status: parseInt(e),
|
|
88
88
|
channels: o
|
|
89
89
|
})).sort((e, o) => o.status - e.status);
|
|
90
90
|
}), d = c(() => {
|
|
91
91
|
if (!a.publishChannelList?.length) return [];
|
|
92
|
-
const
|
|
92
|
+
const i = S("COMMON_TAGS_LIST.UNKNOWN_CHANNEL");
|
|
93
93
|
return a.publishChannelList.filter((e) => e.visibleScope && e.visibleScope.length > 0).map((e) => ({
|
|
94
|
-
channelName: L[e.channelType]?.name(a.sourceType) ||
|
|
94
|
+
channelName: L[e.channelType]?.name(a.sourceType) || i,
|
|
95
95
|
channelType: e.channelType,
|
|
96
96
|
visibleScope: e.visibleScope,
|
|
97
97
|
allVisible: e.allVisible
|
|
98
98
|
}));
|
|
99
|
-
}),
|
|
100
|
-
const e = F[
|
|
99
|
+
}), g = (i) => {
|
|
100
|
+
const e = F[i];
|
|
101
101
|
return R[e];
|
|
102
102
|
};
|
|
103
|
-
return (
|
|
103
|
+
return (i, e) => (t(), l("div", {
|
|
104
104
|
class: "commont-status-box",
|
|
105
105
|
onClick: e[0] || (e[0] = M(() => {
|
|
106
106
|
}, ["stop"]))
|
|
107
107
|
}, [
|
|
108
|
-
(t(!0), l(v, null,
|
|
108
|
+
(t(!0), l(v, null, T(C.value, (o, f) => (t(), p(s(z), {
|
|
109
109
|
key: f,
|
|
110
110
|
placement: "bottom",
|
|
111
111
|
trigger: "click",
|
|
@@ -122,7 +122,7 @@ import './assets/CommonTagsList.css';const K = { class: "status-tag-content flex
|
|
|
122
122
|
]),
|
|
123
123
|
default: h(() => [
|
|
124
124
|
m("div", q, [
|
|
125
|
-
(t(!0), l(v, null,
|
|
125
|
+
(t(!0), l(v, null, T(y.value, (n, I) => (t(), l(v, {
|
|
126
126
|
key: n.status
|
|
127
127
|
}, [
|
|
128
128
|
n.channels.length > 0 ? (t(), l("div", J, [
|
|
@@ -138,35 +138,36 @@ import './assets/CommonTagsList.css';const K = { class: "status-tag-content flex
|
|
|
138
138
|
m("div", {
|
|
139
139
|
class: "content-item-name fz-14 mg-l-4",
|
|
140
140
|
style: B({ color: s(A)[n.status] })
|
|
141
|
-
},
|
|
141
|
+
}, u(s(E)[n.status]) + "(" + u(n.channels.length) + ") ", 5)
|
|
142
142
|
]),
|
|
143
143
|
m("div", Z, [
|
|
144
|
-
(t(!0), l(v, null,
|
|
144
|
+
(t(!0), l(v, null, T(n.channels, (P) => (t(), l("div", {
|
|
145
145
|
class: "b-item-box mg-r-8 radius-4 fz-12 pd-t-4 pd-b-4 pd-l-8 pd-r-8 mg-b-8 text-1f2329 bg-f5f6f7",
|
|
146
146
|
key: P.channelType
|
|
147
|
-
},
|
|
147
|
+
}, u(s(L)?.[P.channelType]?.name(
|
|
148
148
|
r.sourceType
|
|
149
149
|
)), 1))), 128))
|
|
150
150
|
])
|
|
151
151
|
])) : _("", !0),
|
|
152
|
-
|
|
152
|
+
I < y.value.length - 1 ? (t(), l("div", ee)) : _("", !0)
|
|
153
153
|
], 64))), 128)),
|
|
154
154
|
d.value.length > 0 ? (t(), l("div", te, [
|
|
155
|
-
(t(!0), l(v, null,
|
|
155
|
+
(t(!0), l(v, null, T(d.value, (n, I) => (t(), l("div", {
|
|
156
156
|
key: n.channelType,
|
|
157
157
|
class: "channel-visible-range"
|
|
158
158
|
}, [
|
|
159
159
|
m("div", se, [
|
|
160
160
|
b(s(U), {
|
|
161
161
|
class: "mg-r-2",
|
|
162
|
-
size: "14"
|
|
162
|
+
size: "14",
|
|
163
|
+
color: g(n.channelType)?.iconColor
|
|
163
164
|
}, {
|
|
164
165
|
default: h(() => [
|
|
165
|
-
(t(), p(x(
|
|
166
|
+
(t(), p(x(g(n.channelType)?.icon)))
|
|
166
167
|
]),
|
|
167
168
|
_: 2
|
|
168
|
-
},
|
|
169
|
-
k(" " +
|
|
169
|
+
}, 1032, ["color"]),
|
|
170
|
+
k(" " + u(n.channelName) + " " + u(s(S)("COMMON_TAGS_LIST.AVAILABLE_SCOPE")), 1)
|
|
170
171
|
]),
|
|
171
172
|
b(s($), {
|
|
172
173
|
"all-visible": n.allVisible,
|
|
@@ -174,7 +175,7 @@ import './assets/CommonTagsList.css';const K = { class: "status-tag-content flex
|
|
|
174
175
|
"tree-list": [],
|
|
175
176
|
readonly: !0
|
|
176
177
|
}, null, 8, ["all-visible", "model-value"]),
|
|
177
|
-
|
|
178
|
+
I < d.value.length - 1 ? (t(), l("div", ne)) : _("", !0)
|
|
178
179
|
]))), 128))
|
|
179
180
|
])) : _("", !0)
|
|
180
181
|
])
|
|
@@ -183,10 +184,10 @@ import './assets/CommonTagsList.css';const K = { class: "status-tag-content flex
|
|
|
183
184
|
}, 1024))), 128)),
|
|
184
185
|
r.publishChannelList?.length ? _("", !0) : (t(), p(s(w), {
|
|
185
186
|
key: 0,
|
|
186
|
-
type: s(O)[s(
|
|
187
|
+
type: s(O)[s(N).UNPUBLISHED]
|
|
187
188
|
}, {
|
|
188
189
|
default: h(() => [
|
|
189
|
-
k(
|
|
190
|
+
k(u(s(E)[s(N).UNPUBLISHED]), 1)
|
|
190
191
|
]),
|
|
191
192
|
_: 1
|
|
192
193
|
}, 8, ["type"]))
|