ling-yun-custom-components 0.0.65 → 0.0.67

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.
Files changed (35) hide show
  1. package/es/PluginDetail.mjs +124 -128
  2. package/es/assets/PluginDetail.css +1 -1
  3. package/es/chunks/AppIntro.DubEs5q_.js +431 -0
  4. package/es/chunks/BuildComponents.Bu-jJtCo.js +203 -0
  5. package/es/chunks/CustomDialog.T0DjhxY4.js +5 -0
  6. package/es/chunks/CustomDropdown.BoSVXB8_.js +132 -0
  7. package/es/chunks/CustomPagination.D26A7iFP.js +5 -0
  8. package/es/chunks/CustomTab.BCs2BQZr.js +52 -0
  9. package/es/chunks/GradientButton.BVlXDphQ.js +91 -0
  10. package/es/chunks/PageNotFound.CLFUj6wN.js +31 -0
  11. package/es/chunks/PaginationTable.DCYPUxcZ.js +357 -0
  12. package/es/chunks/PluginDetail.CV8dYPPL.js +223 -0
  13. package/es/chunks/UpdatePasswordDialog.CkKA35QX.js +110 -0
  14. package/es/chunks/_plugin-vue_export-helper.Cf-_TWPK.js +6 -0
  15. package/es/chunks/layout.BqQQsRMO.js +95 -0
  16. package/es/chunks/layout.BuyWf5hx.js +189 -0
  17. package/es/chunks/utils.BhlZXNZ6.js +19 -0
  18. package/lib/PluginDetail.js +1 -1
  19. package/lib/assets/PluginDetail.css +1 -1
  20. package/lib/chunks/AppIntro.CIDfpAQM.js +1 -0
  21. package/lib/chunks/BuildComponents.CmF7gV_k.js +1 -0
  22. package/lib/chunks/CustomDialog.lBdGLThM.js +1 -0
  23. package/lib/chunks/CustomDropdown.DS2fIdjY.js +1 -0
  24. package/lib/chunks/CustomPagination.Cyej-_3r.js +1 -0
  25. package/lib/chunks/CustomTab.DccrszIL.js +1 -0
  26. package/lib/chunks/GradientButton.DVbHjYJL.js +1 -0
  27. package/lib/chunks/PageNotFound.DWUdrtNX.js +1 -0
  28. package/lib/chunks/PaginationTable.BfbaK5Og.js +1 -0
  29. package/lib/chunks/PluginDetail.BUfKJRob.js +1 -0
  30. package/lib/chunks/UpdatePasswordDialog.B-POajDC.js +1 -0
  31. package/lib/chunks/_plugin-vue_export-helper.C55-DZV2.js +1 -0
  32. package/lib/chunks/layout.C5f-mOl4.js +1 -0
  33. package/lib/chunks/layout.uCgAET3T.js +1 -0
  34. package/lib/chunks/utils.BT5Uuz2Q.js +1 -0
  35. package/package.json +10 -10
@@ -0,0 +1,223 @@
1
+ import { t as withInstall } from "./utils.BhlZXNZ6.js";
2
+ import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.Cf-_TWPK.js";
3
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, nextTick, normalizeClass, onMounted, openBlock, ref, renderList, renderSlot, toDisplayString, unref, watch, withCtx } from "vue";
4
+ import { ElButton, ElSegmented, ElTable, ElTableColumn } from "element-plus";
5
+ import { emitsMap } from "color-star-custom-methods";
6
+ import { CustomTitle } from "color-star-custom-components";
7
+ import '../assets/PluginDetail.css';const paramsConfigMap = {
8
+ name: "name",
9
+ type: "type",
10
+ required: "required",
11
+ description: "description"
12
+ }, paramsDataConfig = [
13
+ {
14
+ label: "参数名",
15
+ prop: paramsConfigMap.name
16
+ },
17
+ {
18
+ label: "参数类型",
19
+ prop: paramsConfigMap.type
20
+ },
21
+ {
22
+ label: "必填",
23
+ prop: paramsConfigMap.required
24
+ },
25
+ {
26
+ label: "描述",
27
+ prop: paramsConfigMap.description
28
+ }
29
+ ];
30
+ var _hoisted_1$1 = {
31
+ key: 1,
32
+ class: "type-tag"
33
+ }, ParamsTable_default = {
34
+ __name: "ParamsTable",
35
+ props: {
36
+ data: {
37
+ type: [Array, String],
38
+ default: () => []
39
+ },
40
+ columns: {
41
+ type: Array,
42
+ default: () => paramsDataConfig
43
+ },
44
+ hideColumns: {
45
+ type: Array,
46
+ default: () => []
47
+ }
48
+ },
49
+ setup(a) {
50
+ let E = a, O = computed(() => {
51
+ let a = E.data;
52
+ if (typeof a == "string") try {
53
+ a = JSON.parse(a);
54
+ } catch (a) {
55
+ return console.error("解析参数数据失败:", a), [];
56
+ }
57
+ return !a || !Array.isArray(a) ? [] : a;
58
+ }), k = computed(() => !E.hideColumns || E.hideColumns.length === 0 ? E.columns : E.columns.filter((a) => !E.hideColumns.includes(a.prop)));
59
+ return (a, E) => (openBlock(), createBlock(unref(ElTable), {
60
+ data: O.value,
61
+ "row-key": "uiid",
62
+ "tree-props": {
63
+ children: "children",
64
+ hasChildren: "hasChildren"
65
+ },
66
+ stripe: ""
67
+ }, {
68
+ default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(k.value, (a) => (openBlock(), createBlock(unref(ElTableColumn), {
69
+ key: a.prop,
70
+ prop: a.prop,
71
+ label: a.label,
72
+ width: a.width,
73
+ "min-width": a.minWidth
74
+ }, {
75
+ default: withCtx(({ row: E }) => [a.prop === "required" ? (openBlock(), createElementBlock("span", {
76
+ key: 0,
77
+ class: normalizeClass(E.required ? "required-yes" : "required-no")
78
+ }, toDisplayString(E.required ? "是" : "否"), 3)) : a.prop === "type" ? (openBlock(), createElementBlock("span", _hoisted_1$1, toDisplayString(E.type), 1)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(toDisplayString(E[a.prop] || "-"), 1)], 64))]),
79
+ _: 2
80
+ }, 1032, [
81
+ "prop",
82
+ "label",
83
+ "width",
84
+ "min-width"
85
+ ]))), 128))]),
86
+ _: 1
87
+ }, 8, ["data"]));
88
+ }
89
+ }, _hoisted_1 = { key: 0 }, _hoisted_2 = { key: 1 }, _hoisted_3 = {
90
+ key: 3,
91
+ class: "radius-12 border-f0f0f0 pd-l-20 pd-r-20 pd-b-24 pd-t-20 mg-b-34"
92
+ }, _hoisted_4 = { class: "weight-400 fz-16 text-666666 lh-24" }, _hoisted_5 = { class: "flex justify-end items-center gap-10 text-right" };
93
+ const PluginDetail = withInstall(/* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ name: "PluginDetail" }, {
94
+ __name: "layout",
95
+ props: {
96
+ intro: {
97
+ type: String,
98
+ default: ""
99
+ },
100
+ description: {
101
+ type: String,
102
+ default: ""
103
+ },
104
+ modelValue: {
105
+ type: [String, Number],
106
+ default: ""
107
+ },
108
+ tabItems: {
109
+ type: Array,
110
+ default: () => []
111
+ },
112
+ pluginDetailApi: {
113
+ type: Function,
114
+ default: () => {}
115
+ },
116
+ showInputParams: {
117
+ type: Boolean,
118
+ default: !0
119
+ },
120
+ showOutputParams: {
121
+ type: Boolean,
122
+ default: !0
123
+ },
124
+ inputParamsHideColumns: {
125
+ type: Array,
126
+ default: () => []
127
+ },
128
+ outputParamsHideColumns: {
129
+ type: Array,
130
+ default: () => [paramsConfigMap.required]
131
+ },
132
+ showIntro: {
133
+ type: Boolean,
134
+ default: !0
135
+ }
136
+ },
137
+ emits: [emitsMap.updateModelValue, emitsMap.tabChange],
138
+ setup(a, { expose: E, emit: A }) {
139
+ let j = a, M = A, N = ref(!1), P = ref(!1), F = ref(null), I = ref(j.modelValue), L = computed(() => !j.tabItems?.length || !I.value ? null : j.tabItems.find((a) => a.bnid == I.value) || null), R = () => {
140
+ N.value = !N.value;
141
+ }, z = (a) => {
142
+ M(emitsMap.updateModelValue, a), M(emitsMap.tabChange, a);
143
+ }, B = () => {
144
+ nextTick(() => {
145
+ let a = F.value;
146
+ a && (P.value = a.scrollHeight > 24);
147
+ });
148
+ }, V = ref(null);
149
+ return watch(() => L.value?.bnid, (a) => {
150
+ a && j.pluginDetailApi(a).then((a) => {
151
+ V.value = a?.data?.[0];
152
+ });
153
+ }, { immediate: !0 }), watch(() => j.modelValue, (a) => {
154
+ I.value = a;
155
+ }), watch(() => j.tabItems, (a) => {
156
+ I.value = a?.[0]?.bnid;
157
+ }, { immediate: !0 }), watch(() => L.value?.description, () => {
158
+ B();
159
+ }, { immediate: !0 }), onMounted(() => {
160
+ B();
161
+ }), E({
162
+ checkShowMoreBtn: B,
163
+ currentTabItem: L
164
+ }), (E, D) => (openBlock(), createElementBlock(Fragment, null, [
165
+ a.showIntro ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(unref(CustomTitle), {
166
+ content: "插件简介",
167
+ class: "mg-b-16"
168
+ }), createElementVNode("div", {
169
+ class: normalizeClass(["weight-400 fz-16 text-666", N.value ? "" : "hide-more"]),
170
+ ref_key: "descRef",
171
+ ref: F
172
+ }, [renderSlot(E.$slots, "intro", {}, () => [createTextVNode(toDisplayString(a.intro), 1)], !0)], 2)], 64)) : createCommentVNode("", !0),
173
+ a.tabItems?.length ? (openBlock(), createBlock(unref(ElSegmented), {
174
+ key: 1,
175
+ modelValue: I.value,
176
+ "onUpdate:modelValue": D[0] ||= (a) => I.value = a,
177
+ options: a.tabItems.map((a) => ({
178
+ label: a.interfaceName,
179
+ value: a.bnid
180
+ })),
181
+ onChange: z,
182
+ class: "mg-b-16"
183
+ }, null, 8, ["modelValue", "options"])) : createCommentVNode("", !0),
184
+ createVNode(unref(CustomTitle), {
185
+ content: "工具描述",
186
+ class: "mg-b-16"
187
+ }),
188
+ createElementVNode("div", {
189
+ class: normalizeClass(["weight-400 fz-16 text-666", N.value ? "" : "hide-more"]),
190
+ ref_key: "descRef",
191
+ ref: F
192
+ }, [renderSlot(E.$slots, "description", {}, () => [createTextVNode(toDisplayString(L.value?.description), 1)], !0)], 2),
193
+ P.value ? (openBlock(), createBlock(unref(ElButton), {
194
+ key: 2,
195
+ type: "text",
196
+ onClick: R
197
+ }, {
198
+ default: withCtx(() => [N.value ? (openBlock(), createElementBlock("span", _hoisted_2, "收起")) : (openBlock(), createElementBlock("span", _hoisted_1, "查看更多"))]),
199
+ _: 1
200
+ })) : createCommentVNode("", !0),
201
+ E.$slots.default || E.$slots.actions ? (openBlock(), createElementBlock("div", _hoisted_3, [createElementVNode("div", _hoisted_4, [renderSlot(E.$slots, "default", {}, () => [createTextVNode(toDisplayString(L.value?.description), 1)], !0)]), createElementVNode("div", _hoisted_5, [renderSlot(E.$slots, "actions", {}, void 0, !0)])])) : createCommentVNode("", !0),
202
+ a.showInputParams && a.tabItems?.length ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [createVNode(unref(CustomTitle), {
203
+ content: "输入参数",
204
+ class: "mg-b-16 mg-t-34"
205
+ }), V.value?.paramsOuter ? (openBlock(), createBlock(ParamsTable_default, {
206
+ key: 0,
207
+ data: V.value.paramsOuter,
208
+ "hide-columns": a.inputParamsHideColumns
209
+ }, null, 8, ["data", "hide-columns"])) : createCommentVNode("", !0)], 64)) : createCommentVNode("", !0),
210
+ a.showOutputParams && a.tabItems?.length ? (openBlock(), createElementBlock(Fragment, { key: 5 }, [createVNode(unref(CustomTitle), {
211
+ content: "输出参数",
212
+ class: "mg-b-16 mg-t-34"
213
+ }), V.value?.responseOuter ? (openBlock(), createBlock(ParamsTable_default, {
214
+ key: 0,
215
+ data: V.value.responseOuter,
216
+ "hide-columns": a.outputParamsHideColumns
217
+ }, null, 8, ["data", "hide-columns"])) : createCommentVNode("", !0)], 64)) : createCommentVNode("", !0),
218
+ renderSlot(E.$slots, "plugin-detail", {}, void 0, !0)
219
+ ], 64));
220
+ }
221
+ }), [["__scopeId", "data-v-70e5945d"]])), PluginDetailParamsTable = withInstall(ParamsTable_default);
222
+ var PluginDetail_default = PluginDetail;
223
+ export { PluginDetailParamsTable as n, PluginDetail_default as r, PluginDetail as t };
@@ -0,0 +1,110 @@
1
+ import { t as withInstall } from "./utils.BhlZXNZ6.js";
2
+ import { t as layout_default$1 } from "./layout.BuyWf5hx.js";
3
+ import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.Cf-_TWPK.js";
4
+ import { computed, createBlock, createVNode, isRef, openBlock, ref, unref, withCtx } from "vue";
5
+ import { codeMap, componentType, emitsMap, messageSuccess } from "color-star-custom-methods";
6
+ import { SearchBar } from "color-star-custom-components";
7
+ import { AESCrypto } from "ling-yun-methods";
8
+ import '../assets/UpdatePasswordDialog.css';const usePasswordForm = () => {
9
+ let e = ref({
10
+ password: "",
11
+ confirmPassword: ""
12
+ }), p = computed(() => [{
13
+ label: "请输入新密码",
14
+ key: "password",
15
+ type: componentType.text,
16
+ placeholder: "请输入6-20位,需包含大小写字母、数字",
17
+ wide: !0,
18
+ required: !0,
19
+ showPassword: !0,
20
+ validator: m
21
+ }, {
22
+ label: "请再次输入新密码",
23
+ key: "confirmPassword",
24
+ type: componentType.text,
25
+ placeholder: "请输入6-20位,需包含大小写字母、数字",
26
+ wide: !0,
27
+ required: !0,
28
+ showPassword: !0,
29
+ validator: g
30
+ }]), m = (e, p, m) => {
31
+ !p || !/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,20}$/.test(p) ? m(/* @__PURE__ */ Error("请输入6-20位,需包含大小写字母、数字")) : m();
32
+ }, g = (p, m, h) => {
33
+ m === "" ? h(/* @__PURE__ */ Error("两次密码不一致")) : m === e.value.password ? h() : h(/* @__PURE__ */ Error("两次密码不一致"));
34
+ };
35
+ return {
36
+ formData: e,
37
+ userFromItems: p
38
+ };
39
+ }, UpdatePasswordDialog = withInstall(/* @__PURE__ */ _plugin_vue_export_helper_default({
40
+ __name: "layout",
41
+ props: {
42
+ modelValue: {
43
+ type: Boolean,
44
+ default: !1
45
+ },
46
+ nowUserData: {
47
+ type: Object,
48
+ default: () => {}
49
+ },
50
+ apiConfig: {
51
+ type: Object,
52
+ default: () => {}
53
+ }
54
+ },
55
+ emits: [emitsMap.updateModelValue, emitsMap.change],
56
+ setup(e, { emit: m }) {
57
+ let _ = e, v = m, y = computed({
58
+ get: () => _.modelValue,
59
+ set: (e) => v(emitsMap.updateModelValue, e)
60
+ }), b = ref(null), { formData: x, userFromItems: S } = usePasswordForm(), C = async () => {
61
+ let e = await _.apiConfig.getSecretKeyApi();
62
+ if (e.code !== codeMap.success) return {};
63
+ let { key: p, iv: m, keyId: h } = e.data, { password: g } = b.value.getFormData();
64
+ return {
65
+ keyId: h,
66
+ encryptedPassword: AESCrypto.encrypt(g, p, m)
67
+ };
68
+ }, w = async () => {
69
+ let e = !1;
70
+ return await b.value.validate(async (p) => {
71
+ if (!p) return;
72
+ let { keyId: m, encryptedPassword: h } = await C();
73
+ if (!m || !h) return;
74
+ let g = {
75
+ userId: _.nowUserData.id,
76
+ newPassword: h,
77
+ aesKeyId: m
78
+ };
79
+ (await _.apiConfig.updatePasswordApi(g)).code === codeMap.success && (messageSuccess("修改成功"), y.value = !1, e = !0, v(emitsMap.change));
80
+ }), e;
81
+ };
82
+ return (e, m) => (openBlock(), createBlock(layout_default$1, {
83
+ modelValue: y.value,
84
+ "onUpdate:modelValue": m[1] ||= (e) => y.value = e,
85
+ title: "修改密码",
86
+ buttons: {
87
+ confirmText: "确定",
88
+ onConfirm: w
89
+ },
90
+ top: "30vh",
91
+ width: "568px",
92
+ "destroy-on-close": ""
93
+ }, {
94
+ default: withCtx(() => [createVNode(unref(SearchBar), {
95
+ modelValue: unref(x),
96
+ "onUpdate:modelValue": m[0] ||= (e) => isRef(x) ? x.value = e : null,
97
+ ref_key: "formRef",
98
+ ref: b,
99
+ items: unref(S),
100
+ isExpand: !1,
101
+ operationList: [],
102
+ filterMode: !1,
103
+ labelPosition: "top"
104
+ }, null, 8, ["modelValue", "items"])]),
105
+ _: 1
106
+ }, 8, ["modelValue", "buttons"]));
107
+ }
108
+ }, [["__scopeId", "data-v-befba0a5"]]));
109
+ var UpdatePasswordDialog_default = UpdatePasswordDialog;
110
+ export { UpdatePasswordDialog_default as n, UpdatePasswordDialog as t };
@@ -0,0 +1,6 @@
1
+ var _plugin_vue_export_helper_default = (e, t) => {
2
+ let n = e.__vccOpts || e;
3
+ for (let [e, r] of t) n[e] = r;
4
+ return n;
5
+ };
6
+ export { _plugin_vue_export_helper_default as t };
@@ -0,0 +1,95 @@
1
+ import { computed, createBlock, mergeProps, openBlock, unref } from "vue";
2
+ import { ElPagination } from "element-plus";
3
+ import { IconLeft, IconRight } from "color-message-lingyun-vue";
4
+ import { emitsMap, pageParams, paginationConfig } from "color-star-custom-methods";
5
+ var layout_default = /* @__PURE__ */ Object.assign({ name: "CustomPagination" }, {
6
+ __name: "layout",
7
+ props: {
8
+ currentPage: {
9
+ type: Number,
10
+ default: pageParams.pageNum
11
+ },
12
+ pageSize: {
13
+ type: Number,
14
+ default: pageParams.pageSize
15
+ },
16
+ pageSizes: {
17
+ type: Array,
18
+ default: () => paginationConfig.pageSizes
19
+ },
20
+ background: {
21
+ type: Boolean,
22
+ default: !0
23
+ },
24
+ layout: {
25
+ type: String,
26
+ default: paginationConfig.layout
27
+ },
28
+ prevIcon: {
29
+ type: Object,
30
+ default: IconLeft
31
+ },
32
+ nextIcon: {
33
+ type: Object,
34
+ default: IconRight
35
+ },
36
+ hideOnSinglePage: {
37
+ type: Boolean,
38
+ default: !0
39
+ },
40
+ total: {
41
+ type: Number,
42
+ default: 0
43
+ }
44
+ },
45
+ emits: [
46
+ emitsMap.sizeChange,
47
+ emitsMap.currentChange,
48
+ emitsMap.updateCurrentPage,
49
+ emitsMap.updatePageSize
50
+ ],
51
+ setup(s, { emit: c }) {
52
+ let l = c, u = s, d = computed({
53
+ get: () => u.currentPage,
54
+ set: (e) => {
55
+ l(emitsMap.updateCurrentPage, e);
56
+ }
57
+ }), f = computed({
58
+ get: () => u.pageSize,
59
+ set: (e) => {
60
+ l(emitsMap.updatePageSize, e);
61
+ }
62
+ }), p = (e) => {
63
+ l(emitsMap.sizeChange, e), l(emitsMap.updatePageSize, e);
64
+ }, m = (e) => {
65
+ l(emitsMap.currentChange, e), l(emitsMap.updateCurrentPage, e);
66
+ };
67
+ return (e, c) => (openBlock(), createBlock(unref(ElPagination), mergeProps({
68
+ "current-page": d.value,
69
+ "onUpdate:currentPage": c[0] ||= (e) => d.value = e,
70
+ "page-size": f.value,
71
+ "onUpdate:pageSize": c[1] ||= (e) => f.value = e,
72
+ "page-sizes": s.pageSizes,
73
+ background: s.background,
74
+ layout: s.layout,
75
+ total: s.total,
76
+ "prev-icon": s.prevIcon,
77
+ "next-icon": s.nextIcon,
78
+ "hide-on-single-page": s.hideOnSinglePage
79
+ }, e.$attrs, {
80
+ onSizeChange: p,
81
+ onCurrentChange: m
82
+ }), null, 16, [
83
+ "current-page",
84
+ "page-size",
85
+ "page-sizes",
86
+ "background",
87
+ "layout",
88
+ "total",
89
+ "prev-icon",
90
+ "next-icon",
91
+ "hide-on-single-page"
92
+ ]));
93
+ }
94
+ });
95
+ export { layout_default as t };
@@ -0,0 +1,189 @@
1
+ import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.Cf-_TWPK.js";
2
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, mergeProps, onMounted, openBlock, renderSlot, toDisplayString, unref, useAttrs, withCtx } from "vue";
3
+ import { ElButton, ElDialog, ElIcon } from "element-plus";
4
+ import { IconBack, IconClose } from "color-message-lingyun-vue";
5
+ import { emitsMap } from "color-star-custom-methods";
6
+ import '../assets/layout.css';const dialogModeMap = {
7
+ DEFAULT: "default",
8
+ PAGE: "page"
9
+ };
10
+ var _hoisted_1 = {
11
+ key: 0,
12
+ class: "flex justify-center w-full"
13
+ }, _hoisted_2 = {
14
+ class: "dialog-content flex flex-col",
15
+ style: { width: "60%" }
16
+ }, _hoisted_3 = {
17
+ key: 0,
18
+ class: "title-name flex items-center"
19
+ }, _hoisted_4 = { class: "dialog-footer" }, _hoisted_5 = {
20
+ key: 0,
21
+ class: "flex justify-center items-center w-full"
22
+ }, _hoisted_6 = {
23
+ class: "flex justify-center items-center",
24
+ style: { width: "60%" }
25
+ }, _hoisted_7 = { class: "flex justify-end items-center w-full" }, layout_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ name: "CustomDialog" }, {
26
+ __name: "layout",
27
+ props: {
28
+ modelValue: {
29
+ type: Boolean,
30
+ default: !1
31
+ },
32
+ width: {
33
+ type: [String, Number],
34
+ default: "50%"
35
+ },
36
+ closeOnClickModal: {
37
+ type: Boolean,
38
+ default: !1
39
+ },
40
+ closeOnPressEscape: {
41
+ type: Boolean,
42
+ default: !1
43
+ },
44
+ lockScroll: {
45
+ type: Boolean,
46
+ default: !0
47
+ },
48
+ closeIcon: {
49
+ type: Object,
50
+ default: IconClose
51
+ },
52
+ buttons: {
53
+ type: Object,
54
+ default: () => ({})
55
+ },
56
+ appendToBody: {
57
+ type: Boolean,
58
+ default: !0
59
+ },
60
+ dialogMode: {
61
+ type: String,
62
+ default: dialogModeMap.DEFAULT
63
+ },
64
+ titleName: {
65
+ type: String,
66
+ default: "默认标题"
67
+ }
68
+ },
69
+ emits: [
70
+ emitsMap.updateModelValue,
71
+ emitsMap.open,
72
+ emitsMap.opened,
73
+ emitsMap.close,
74
+ emitsMap.closed,
75
+ emitsMap.openAutoFocus,
76
+ emitsMap.closeAutoFocus,
77
+ emitsMap.cancel,
78
+ emitsMap.confirm
79
+ ],
80
+ setup(t, { emit: A }) {
81
+ let j = {
82
+ showCancel: !0,
83
+ showConfirm: !0,
84
+ cancelText: "取消",
85
+ confirmText: "确认",
86
+ onCancel: null,
87
+ onConfirm: null
88
+ }, M = t, N = useAttrs(), P = A, F = computed(() => M.dialogMode === dialogModeMap.PAGE ? {
89
+ marginLeft: "250px",
90
+ borderRadius: "24px",
91
+ boxShadow: "none"
92
+ } : {}), I = computed(() => M.dialogMode === dialogModeMap.PAGE ? !1 : N.modal ? N.modal : !0), L = computed(() => M.dialogMode === dialogModeMap.PAGE ? !0 : N.modalPenetrable ? N.modalPenetrable : !1), R = computed(() => M.dialogMode === dialogModeMap.PAGE ? "calc(100% - 250px - 12px)" : M.width), z = computed(() => M.dialogMode === dialogModeMap.PAGE ? "66px" : M.top || "15vh"), B = computed({
93
+ get: () => M.modelValue,
94
+ set: (t) => {
95
+ P(emitsMap.updateModelValue, t);
96
+ }
97
+ }), V = computed(() => ({
98
+ ...j,
99
+ ...M.buttons
100
+ })), H = computed(() => {
101
+ let { modelValue: t, ...D } = M;
102
+ return D;
103
+ }), U = () => {
104
+ P(emitsMap.open);
105
+ }, W = () => {
106
+ P(emitsMap.opened);
107
+ }, G = () => {
108
+ P(emitsMap.close);
109
+ }, K = () => {
110
+ P(emitsMap.closed);
111
+ }, q = () => {
112
+ P(emitsMap.openAutoFocus);
113
+ }, J = () => {
114
+ P(emitsMap.closeAutoFocus);
115
+ }, Y = () => {
116
+ V.value.onCancel ? V.value.onCancel() : B.value = !1, P(emitsMap.cancel);
117
+ }, X = async () => {
118
+ if (V.value.onConfirm) try {
119
+ await V.value.onConfirm() !== !1 && (B.value = !1);
120
+ } catch {}
121
+ else B.value = !1;
122
+ P(emitsMap.confirm);
123
+ };
124
+ return onMounted(() => {
125
+ M.dialogMode === dialogModeMap.PAGE && (document.querySelector(".el-overlay-dialog").style.overflow = "hidden");
126
+ }), (O, k) => (openBlock(), createBlock(unref(ElDialog), mergeProps({
127
+ ref: "dialogRef",
128
+ modelValue: B.value,
129
+ "onUpdate:modelValue": k[1] ||= (t) => B.value = t
130
+ }, H.value, {
131
+ width: R.value,
132
+ top: z.value,
133
+ style: F.value,
134
+ modal: I.value,
135
+ "modal-penetrable": L.value,
136
+ onOpen: U,
137
+ onOpened: W,
138
+ onClose: G,
139
+ onClosed: K,
140
+ onOpenAutoFocus: q,
141
+ onCloseAutoFocus: J,
142
+ "append-to-body": t.appendToBody,
143
+ class: { "custom-dialog-page": t.dialogMode === unref(dialogModeMap).PAGE }
144
+ }), {
145
+ header: withCtx(() => [t.dialogMode === unref(dialogModeMap).PAGE ? (openBlock(), createElementBlock("div", _hoisted_3, [createVNode(unref(ElIcon), {
146
+ size: 20,
147
+ color: "var(--text-color-1)",
148
+ class: "mg-r-6 pointer",
149
+ onClick: k[0] ||= (t) => B.value = !1
150
+ }, {
151
+ default: withCtx(() => [createVNode(unref(IconBack))]),
152
+ _: 1
153
+ }), createTextVNode(" " + toDisplayString(t.titleName), 1)])) : renderSlot(O.$slots, "header", { key: 1 }, void 0, !0)]),
154
+ footer: withCtx(() => [renderSlot(O.$slots, "footer", {}, () => [createElementVNode("div", _hoisted_4, [t.dialogMode === unref(dialogModeMap).PAGE ? (openBlock(), createElementBlock("div", _hoisted_5, [createElementVNode("div", _hoisted_6, [createElementVNode("div", _hoisted_7, [V.value.showConfirm ? (openBlock(), createBlock(unref(ElButton), {
155
+ key: 0,
156
+ type: "primary",
157
+ onClick: X
158
+ }, {
159
+ default: withCtx(() => [createTextVNode(toDisplayString(V.value.confirmText), 1)]),
160
+ _: 1
161
+ })) : createCommentVNode("", !0)])])])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [V.value.showCancel ? (openBlock(), createBlock(unref(ElButton), {
162
+ key: 0,
163
+ onClick: Y
164
+ }, {
165
+ default: withCtx(() => [createTextVNode(toDisplayString(V.value.cancelText), 1)]),
166
+ _: 1
167
+ })) : createCommentVNode("", !0), V.value.showConfirm ? (openBlock(), createBlock(unref(ElButton), {
168
+ key: 1,
169
+ type: "primary",
170
+ onClick: X
171
+ }, {
172
+ default: withCtx(() => [createTextVNode(toDisplayString(V.value.confirmText), 1)]),
173
+ _: 1
174
+ })) : createCommentVNode("", !0)], 64))])], !0)]),
175
+ default: withCtx(() => [t.dialogMode === unref(dialogModeMap).PAGE ? (openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [renderSlot(O.$slots, "default", {}, void 0, !0)])])) : renderSlot(O.$slots, "default", { key: 1 }, void 0, !0)]),
176
+ _: 3
177
+ }, 16, [
178
+ "modelValue",
179
+ "width",
180
+ "top",
181
+ "style",
182
+ "modal",
183
+ "modal-penetrable",
184
+ "append-to-body",
185
+ "class"
186
+ ]));
187
+ }
188
+ }), [["__scopeId", "data-v-09a941ae"]]);
189
+ export { layout_default as t };
@@ -0,0 +1,19 @@
1
+ Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ Object.getOwnPropertyDescriptor, Object.getOwnPropertyNames, Object.getPrototypeOf, Object.prototype.hasOwnProperty;
4
+ var __commonJSMin = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), __exportAll = (t, n) => {
5
+ let r = {};
6
+ for (var i in t) __defProp(r, i, {
7
+ get: t[i],
8
+ enumerable: !0
9
+ });
10
+ return n && __defProp(r, Symbol.toStringTag, { value: "Module" }), r;
11
+ }, require___vite_browser_external = /* @__PURE__ */ __commonJSMin(((e, t) => {
12
+ t.exports = {};
13
+ }));
14
+ require___vite_browser_external(), require___vite_browser_external();
15
+ const withInstall = (e) => (e.install = (t) => {
16
+ let n = e.name || e.__name;
17
+ t.component(n, e);
18
+ }, e);
19
+ export { __exportAll as n, withInstall as t };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/PluginDetail.css');const C=require("./chunks/index.CkihWzK6.js"),e=require("vue"),f=require("element-plus"),g=require("color-star-custom-components"),y=require("color-star-custom-methods"),N=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),h={name:"name",type:"type",required:"required",description:"description"},S=[{label:"参数名",prop:h.name},{label:"参数类型",prop:h.type},{label:"必填",prop:h.required},{label:"描述",prop:h.description}],E={key:1,class:"type-tag"},B={__name:"ParamsTable",props:{data:{type:[Array,String],default:()=>[]},columns:{type:Array,default:()=>S},hideColumns:{type:Array,default:()=>[]}},setup(a){const n=a,k=e.computed(()=>{let l=n.data;if(typeof l=="string")try{l=JSON.parse(l)}catch(s){return console.error("解析参数数据失败:",s),[]}return!l||!Array.isArray(l)?[]:l}),r=e.computed(()=>!n.hideColumns||n.hideColumns.length===0?n.columns:n.columns.filter(l=>!n.hideColumns.includes(l.prop)));return(l,s)=>(e.openBlock(),e.createBlock(e.unref(f.ElTable),{data:k.value,"row-key":"uiid","tree-props":{children:"children",hasChildren:"hasChildren"},stripe:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,o=>(e.openBlock(),e.createBlock(e.unref(f.ElTableColumn),{key:o.prop,prop:o.prop,label:o.label,width:o.width,"min-width":o.minWidth},{default:e.withCtx(({row:u})=>[o.prop==="required"?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(u.required?"required-yes":"required-no")},e.toDisplayString(u.required?"是":"否"),3)):o.prop==="type"?(e.openBlock(),e.createElementBlock("span",E,e.toDisplayString(u.type),1)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(u[o.prop]||"-"),1)],64))]),_:2},1032,["prop","label","width","min-width"]))),128))]),_:1},8,["data"]))}},P={key:0},I={key:1},T={class:"weight-400 fz-16 text-666"},D={key:3,class:"radius-12 border-f0f0f0 pd-l-20 pd-r-20 pd-b-24 pd-t-20 mg-b-34"},q={class:"weight-400 fz-16 text-666666 lh-24"},x={class:"flex justify-end items-center gap-10 text-right"},M=Object.assign({name:"PluginDetail"},{__name:"layout",props:{intro:{type:String,default:""},description:{type:String,default:""},modelValue:{type:[String,Number],default:""},tabItems:{type:Array,default:()=>[]},pluginDetailApi:{type:Function,default:()=>{}},showInputParams:{type:Boolean,default:!0},showOutputParams:{type:Boolean,default:!0},inputParamsHideColumns:{type:Array,default:()=>[]},outputParamsHideColumns:{type:Array,default:()=>[h.required]},showIntro:{type:Boolean,default:!0}},emits:[y.emitsMap.updateModelValue,y.emitsMap.tabChange],setup(a,{expose:n,emit:k}){const r=a,l=k,s=e.ref(!1),o=e.ref(!1),u=e.ref(null),i=e.ref(r.modelValue),c=e.computed(()=>!r.tabItems?.length||!i.value?null:r.tabItems.find(t=>t.bnid==i.value)||null),V=()=>{s.value=!s.value},w=t=>{l(y.emitsMap.updateModelValue,t),l(y.emitsMap.tabChange,t)},b=()=>{e.nextTick(()=>{const t=u.value;t&&(o.value=t.scrollHeight>24)})},p=e.ref(null);return e.watch(()=>c.value?.bnid,t=>{t&&r.pluginDetailApi(t).then(d=>{p.value=d?.data?.[0]})},{immediate:!0}),e.watch(()=>r.modelValue,t=>{i.value=t}),e.watch(()=>r.tabItems,t=>{i.value=t?.[0]?.bnid},{immediate:!0}),e.watch(()=>r.description,()=>{b()},{immediate:!0}),e.onMounted(()=>{b()}),n({checkShowMoreBtn:b,currentTabItem:c}),(t,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[a.showIntro?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(g.CustomTitle),{content:"插件简介",class:"mg-b-16"}),e.createElementVNode("div",{class:e.normalizeClass(["weight-400 fz-16 text-666",s.value?"":"hide-more"]),ref_key:"descRef",ref:u},[e.renderSlot(t.$slots,"intro",{},()=>[e.createTextVNode(e.toDisplayString(a.intro),1)],!0)],2)],64)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createBlock(e.unref(f.ElButton),{key:1,type:"text",onClick:V},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("span",I,"收起")):(e.openBlock(),e.createElementBlock("span",P,"查看更多"))]),_:1})):e.createCommentVNode("",!0),a.tabItems?.length?(e.openBlock(),e.createBlock(e.unref(f.ElSegmented),{key:2,modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=m=>i.value=m),options:a.tabItems.map(m=>({label:m.interfaceName,value:m.bnid})),onChange:w,class:"mg-b-16 mg-t-34"},null,8,["modelValue","options"])):e.createCommentVNode("",!0),e.createVNode(e.unref(g.CustomTitle),{content:"工具描述",class:"mg-b-16"}),e.createElementVNode("div",T,[e.renderSlot(t.$slots,"description",{},()=>[c.value?(e.openBlock(),e.createBlock(e.unref(f.ElInput),{key:0,type:"textarea",modelValue:c.value.description,"onUpdate:modelValue":d[1]||(d[1]=m=>c.value.description=m),autosize:{minRows:1,maxRows:3},maxlength:300,"show-word-limit":!0},null,8,["modelValue"])):e.createCommentVNode("",!0)],!0)]),t.$slots.default||t.$slots.actions?(e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("div",q,[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(c.value?.description),1)],!0)]),e.createElementVNode("div",x,[e.renderSlot(t.$slots,"actions",{},void 0,!0)])])):e.createCommentVNode("",!0),a.showInputParams&&a.tabItems?.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createVNode(e.unref(g.CustomTitle),{content:"输入参数",class:"mg-b-16 mg-t-34"}),p.value?.paramsOuter?(e.openBlock(),e.createBlock(B,{key:0,data:p.value.paramsOuter,"hide-columns":a.inputParamsHideColumns},null,8,["data","hide-columns"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),a.showOutputParams&&a.tabItems?.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createVNode(e.unref(g.CustomTitle),{content:"输出参数",class:"mg-b-16 mg-t-34"}),p.value?.responseOuter?(e.openBlock(),e.createBlock(B,{key:0,data:p.value.responseOuter,"hide-columns":a.outputParamsHideColumns},null,8,["data","hide-columns"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"plugin-detail",{},void 0,!0)],64))}}),A=N._export_sfc(M,[["__scopeId","data-v-c90740ac"]]),v=C.withInstall(A),O=C.withInstall(B);exports.PluginDetail=v;exports.PluginDetailParamsTable=O;exports.default=v;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/PluginDetail.css');const C=require("./chunks/index.CkihWzK6.js"),e=require("vue"),y=require("element-plus"),h=require("color-star-custom-components"),g=require("color-star-custom-methods"),S=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),m={name:"name",type:"type",required:"required",description:"description"},N=[{label:"参数名",prop:m.name},{label:"参数类型",prop:m.type},{label:"必填",prop:m.required},{label:"描述",prop:m.description}],E={key:1,class:"type-tag"},B={__name:"ParamsTable",props:{data:{type:[Array,String],default:()=>[]},columns:{type:Array,default:()=>N},hideColumns:{type:Array,default:()=>[]}},setup(a){const o=a,k=e.computed(()=>{let l=o.data;if(typeof l=="string")try{l=JSON.parse(l)}catch(s){return console.error("解析参数数据失败:",s),[]}return!l||!Array.isArray(l)?[]:l}),n=e.computed(()=>!o.hideColumns||o.hideColumns.length===0?o.columns:o.columns.filter(l=>!o.hideColumns.includes(l.prop)));return(l,s)=>(e.openBlock(),e.createBlock(e.unref(y.ElTable),{data:k.value,"row-key":"uiid","tree-props":{children:"children",hasChildren:"hasChildren"},stripe:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,r=>(e.openBlock(),e.createBlock(e.unref(y.ElTableColumn),{key:r.prop,prop:r.prop,label:r.label,width:r.width,"min-width":r.minWidth},{default:e.withCtx(({row:u})=>[r.prop==="required"?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(u.required?"required-yes":"required-no")},e.toDisplayString(u.required?"是":"否"),3)):r.prop==="type"?(e.openBlock(),e.createElementBlock("span",E,e.toDisplayString(u.type),1)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(u[r.prop]||"-"),1)],64))]),_:2},1032,["prop","label","width","min-width"]))),128))]),_:1},8,["data"]))}},P={key:0},T={key:1},D={key:3,class:"radius-12 border-f0f0f0 pd-l-20 pd-r-20 pd-b-24 pd-t-20 mg-b-34"},I={class:"weight-400 fz-16 text-666666 lh-24"},q={class:"flex justify-end items-center gap-10 text-right"},M=Object.assign({name:"PluginDetail"},{__name:"layout",props:{intro:{type:String,default:""},description:{type:String,default:""},modelValue:{type:[String,Number],default:""},tabItems:{type:Array,default:()=>[]},pluginDetailApi:{type:Function,default:()=>{}},showInputParams:{type:Boolean,default:!0},showOutputParams:{type:Boolean,default:!0},inputParamsHideColumns:{type:Array,default:()=>[]},outputParamsHideColumns:{type:Array,default:()=>[m.required]},showIntro:{type:Boolean,default:!0}},emits:[g.emitsMap.updateModelValue,g.emitsMap.tabChange],setup(a,{expose:o,emit:k}){const n=a,l=k,s=e.ref(!1),r=e.ref(!1),u=e.ref(null),i=e.ref(n.modelValue),c=e.computed(()=>!n.tabItems?.length||!i.value?null:n.tabItems.find(t=>t.bnid==i.value)||null),V=()=>{s.value=!s.value},w=t=>{l(g.emitsMap.updateModelValue,t),l(g.emitsMap.tabChange,t)},b=()=>{e.nextTick(()=>{const t=u.value;t&&(r.value=t.scrollHeight>24)})},d=e.ref(null);return e.watch(()=>c.value?.bnid,t=>{t&&n.pluginDetailApi(t).then(p=>{d.value=p?.data?.[0]})},{immediate:!0}),e.watch(()=>n.modelValue,t=>{i.value=t}),e.watch(()=>n.tabItems,t=>{i.value=t?.[0]?.bnid},{immediate:!0}),e.watch(()=>c.value?.description,()=>{b()},{immediate:!0}),e.onMounted(()=>{b()}),o({checkShowMoreBtn:b,currentTabItem:c}),(t,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[a.showIntro?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(h.CustomTitle),{content:"插件简介",class:"mg-b-16"}),e.createElementVNode("div",{class:e.normalizeClass(["weight-400 fz-16 text-666",s.value?"":"hide-more"]),ref_key:"descRef",ref:u},[e.renderSlot(t.$slots,"intro",{},()=>[e.createTextVNode(e.toDisplayString(a.intro),1)],!0)],2)],64)):e.createCommentVNode("",!0),a.tabItems?.length?(e.openBlock(),e.createBlock(e.unref(y.ElSegmented),{key:1,modelValue:i.value,"onUpdate:modelValue":p[0]||(p[0]=f=>i.value=f),options:a.tabItems.map(f=>({label:f.interfaceName,value:f.bnid})),onChange:w,class:"mg-b-16"},null,8,["modelValue","options"])):e.createCommentVNode("",!0),e.createVNode(e.unref(h.CustomTitle),{content:"工具描述",class:"mg-b-16"}),e.createElementVNode("div",{class:e.normalizeClass(["weight-400 fz-16 text-666",s.value?"":"hide-more"]),ref_key:"descRef",ref:u},[e.renderSlot(t.$slots,"description",{},()=>[e.createTextVNode(e.toDisplayString(c.value?.description),1)],!0)],2),r.value?(e.openBlock(),e.createBlock(e.unref(y.ElButton),{key:2,type:"text",onClick:V},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("span",T,"收起")):(e.openBlock(),e.createElementBlock("span",P,"查看更多"))]),_:1})):e.createCommentVNode("",!0),t.$slots.default||t.$slots.actions?(e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("div",I,[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(c.value?.description),1)],!0)]),e.createElementVNode("div",q,[e.renderSlot(t.$slots,"actions",{},void 0,!0)])])):e.createCommentVNode("",!0),a.showInputParams&&a.tabItems?.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createVNode(e.unref(h.CustomTitle),{content:"输入参数",class:"mg-b-16 mg-t-34"}),d.value?.paramsOuter?(e.openBlock(),e.createBlock(B,{key:0,data:d.value.paramsOuter,"hide-columns":a.inputParamsHideColumns},null,8,["data","hide-columns"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),a.showOutputParams&&a.tabItems?.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createVNode(e.unref(h.CustomTitle),{content:"输出参数",class:"mg-b-16 mg-t-34"}),d.value?.responseOuter?(e.openBlock(),e.createBlock(B,{key:0,data:d.value.responseOuter,"hide-columns":a.outputParamsHideColumns},null,8,["data","hide-columns"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"plugin-detail",{},void 0,!0)],64))}}),x=S._export_sfc(M,[["__scopeId","data-v-70e5945d"]]),v=C.withInstall(x),A=C.withInstall(B);exports.PluginDetail=v;exports.PluginDetailParamsTable=A;exports.default=v;
@@ -1 +1 @@
1
- .hide-more[data-v-c90740ac]{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}.border-f0f0f0[data-v-c90740ac]{border:1px solid var(--neutral-color-6)}
1
+ .hide-more[data-v-70e5945d]{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}.border-f0f0f0[data-v-70e5945d]{border:1px solid var(--neutral-color-6)}