data-source-tree 0.0.1 → 0.0.3

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 (73) hide show
  1. package/COLLECTION-CGr8r7D0.js +4 -0
  2. package/INDEX-CWRlbxz6.js +4 -0
  3. package/NODE_LABEL-BNtE9a8x.js +4 -0
  4. package/PACKAGE-Cdqdazmm.js +4 -0
  5. package/PROCEDURE-BFKXCwJs.js +4 -0
  6. package/RELATIONSHIP_TYPE-DH_Ql50v.js +4 -0
  7. package/TABLE-C6D4BTNb.js +4 -0
  8. package/TOPIC-DDMJFl8M.js +4 -0
  9. package/VIEW-Dy2H__0e.js +4 -0
  10. package/cassandra-kZBMMRLi.js +4 -0
  11. package/clickhouse-wZad6bX_.js +4 -0
  12. package/cratedb-Bp9DafHH.js +4 -0
  13. package/dameng-DDKENLSf.js +4 -0
  14. package/database-DorJeeaH.js +4 -0
  15. package/db2-BQLq-8O9.js +4 -0
  16. package/dm-DDKENLSf.js +4 -0
  17. package/doris-sPgf3dKR.js +4 -0
  18. package/druid-BCpjCk40.js +4 -0
  19. package/elasticsearch-IjsXozrl.js +4 -0
  20. package/file-CYyJ85qD.js +4 -0
  21. package/filesystem-CHNDPEkF.js +4 -0
  22. package/folder-B_IZAYKT.js +4 -0
  23. package/folderClose-Ci16QLsN.js +4 -0
  24. package/folderOpen-ClecyRH1.js +4 -0
  25. package/ftp-B1EMbJZ8.js +4 -0
  26. package/gbase-Cfbti4wa.js +4 -0
  27. package/greenplum-C72qwgT6.js +4 -0
  28. package/hbase-DJlmFvuj.js +4 -0
  29. package/hdfs-HbRnS4Ee.js +4 -0
  30. package/hive-CFGs347R.js +4 -0
  31. package/hive-metastore-CFGs347R.js +4 -0
  32. package/hudi-BXyzOfLV.js +4 -0
  33. package/iceberg-BCCMLWKb.js +4 -0
  34. package/index.js +3622 -16
  35. package/index.umd.cjs +1 -1
  36. package/kafka-BQTmKvyf.js +4 -0
  37. package/kingbase-CtbaKFzM.js +4 -0
  38. package/mariadb-DUUVCuEd.js +4 -0
  39. package/milvus-B_EXXpE7.js +4 -0
  40. package/minio-DrkEY6Lg.js +4 -0
  41. package/mission-DP49naae.js +4 -0
  42. package/mongodb-sCoR-0DO.js +4 -0
  43. package/mssql-CyLYBEca.js +4 -0
  44. package/mysql-B6gniQbL.js +4 -0
  45. package/neo4j-fM-N6RPF.js +4 -0
  46. package/note-KSl8tOvD.js +4 -0
  47. package/oceanbase-CHQGzVAU.js +4 -0
  48. package/opensearch-Bkb3qPjF.js +4 -0
  49. package/oracle-7N_bpyOE.js +4 -0
  50. package/package.json +5 -2
  51. package/paimon-ChRYie-E.js +4 -0
  52. package/postgres-CU2CHKIj.js +4 -0
  53. package/presto-XCYrPD7W.js +4 -0
  54. package/report-zbtqy9nr.js +4 -0
  55. package/schema-DHIGvfp2.js +4 -0
  56. package/snowflake-Cy_FOrcV.js +4 -0
  57. package/sqlserver-CyLYBEca.js +4 -0
  58. package/starrocks-BAeDPSaX.js +4 -0
  59. package/style.css +1 -0
  60. package/sybase-JxsUZBj2.js +4 -0
  61. package/tidb-CKZDxkdA.js +4 -0
  62. package/trino-CTo8-zn8.js +4 -0
  63. package//345/205/250/346/226/207/346/243/200/347/264/242-CM_FkicR.js +4 -0
  64. package//345/205/263/347/263/273/345/236/213/346/225/260/346/215/256/345/272/223-CdxjM7fF.js +4 -0
  65. package//345/210/206/346/236/220/345/236/213/346/225/260/346/215/256/345/272/223-DCG17zXf.js +4 -0
  66. package//345/220/221/351/207/217/346/225/260/346/215/256/345/272/223-Sus8yO-o.js +4 -0
  67. package//345/233/276/346/225/260/346/215/256/345/272/223-m2gN34YV.js +4 -0
  68. package//346/225/260/346/215/256/346/271/226-DYPNBEro.js +4 -0
  69. package//346/226/207/344/273/266/347/263/273/347/273/237-BpeHJ8ur.js +4 -0
  70. package//346/226/207/346/241/243/346/225/260/346/215/256/345/272/223-CYyJ85qD.js +4 -0
  71. package//346/227/266/345/272/217/346/225/260/346/215/256/345/272/223-BKM1uC99.js +4 -0
  72. package//346/266/210/346/201/257/351/230/237/345/210/227-BZj1tfb_.js +4 -0
  73. package//351/235/236/345/205/263/347/263/273/345/236/213/357/274/210NoSQL/357/274/211/346/225/260/346/215/256/345/272/223-Ciz5Z_Sa.js +4 -0
package/index.js CHANGED
@@ -1,23 +1,3629 @@
1
- import { openBlock as r, createElementBlock as a } from "vue";
2
- const s = (e, o) => {
3
- const t = e.__vccOpts || e;
4
- for (const [n, c] of o)
5
- t[n] = c;
6
- return t;
7
- }, p = {
8
- name: "dataSourceTree"
1
+ import { defineComponent as Se, openBlock as o, createElementBlock as y, createElementVNode as r, resolveComponent as f, Fragment as pe, renderList as ye, normalizeStyle as kt, normalizeClass as ke, toDisplayString as Q, createVNode as e, withCtx as a, ref as c, watch as Ue, onMounted as it, nextTick as Ce, computed as ze, createBlock as q, unref as _, createCommentVNode as ne, withModifiers as $e, createTextVNode as C, reactive as Te, resolveDirective as St, withDirectives as De, getCurrentInstance as us, isRef as Pe } from "vue";
2
+ import { ElMessage as z, ElLoading as Fe } from "element-plus";
3
+ /*! Element Plus Icons Vue v2.3.2 */
4
+ var ds = /* @__PURE__ */ Se({
5
+ name: "CirclePlus",
6
+ __name: "circle-plus",
7
+ setup(i) {
8
+ return (P, x) => (o(), y("svg", {
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ viewBox: "0 0 1024 1024"
11
+ }, [
12
+ r("path", {
13
+ fill: "currentColor",
14
+ d: "M352 480h320a32 32 0 1 1 0 64H352a32 32 0 0 1 0-64"
15
+ }),
16
+ r("path", {
17
+ fill: "currentColor",
18
+ d: "M480 672V352a32 32 0 1 1 64 0v320a32 32 0 0 1-64 0"
19
+ }),
20
+ r("path", {
21
+ fill: "currentColor",
22
+ d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
23
+ })
24
+ ]));
25
+ }
26
+ }), Re = ds, cs = /* @__PURE__ */ Se({
27
+ name: "Close",
28
+ __name: "close",
29
+ setup(i) {
30
+ return (P, x) => (o(), y("svg", {
31
+ xmlns: "http://www.w3.org/2000/svg",
32
+ viewBox: "0 0 1024 1024"
33
+ }, [
34
+ r("path", {
35
+ fill: "currentColor",
36
+ d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
37
+ })
38
+ ]));
39
+ }
40
+ }), ps = cs, ms = /* @__PURE__ */ Se({
41
+ name: "Delete",
42
+ __name: "delete",
43
+ setup(i) {
44
+ return (P, x) => (o(), y("svg", {
45
+ xmlns: "http://www.w3.org/2000/svg",
46
+ viewBox: "0 0 1024 1024"
47
+ }, [
48
+ r("path", {
49
+ fill: "currentColor",
50
+ d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"
51
+ })
52
+ ]));
53
+ }
54
+ }), fs = ms, vs = /* @__PURE__ */ Se({
55
+ name: "Document",
56
+ __name: "document",
57
+ setup(i) {
58
+ return (P, x) => (o(), y("svg", {
59
+ xmlns: "http://www.w3.org/2000/svg",
60
+ viewBox: "0 0 1024 1024"
61
+ }, [
62
+ r("path", {
63
+ fill: "currentColor",
64
+ d: "M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"
65
+ })
66
+ ]));
67
+ }
68
+ }), wt = vs, gs = /* @__PURE__ */ Se({
69
+ name: "FolderOpened",
70
+ __name: "folder-opened",
71
+ setup(i) {
72
+ return (P, x) => (o(), y("svg", {
73
+ xmlns: "http://www.w3.org/2000/svg",
74
+ viewBox: "0 0 1024 1024"
75
+ }, [
76
+ r("path", {
77
+ fill: "currentColor",
78
+ d: "M878.08 448H241.92l-96 384h636.16zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 0 1 216.96 384zm-24.96 512H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h287.872l128.384 128H864a32 32 0 0 1 32 32v96h23.04a32 32 0 0 1 31.04 39.744l-112 448A32 32 0 0 1 807.04 896"
79
+ })
80
+ ]));
81
+ }
82
+ }), ys = gs, _s = /* @__PURE__ */ Se({
83
+ name: "Folder",
84
+ __name: "folder",
85
+ setup(i) {
86
+ return (P, x) => (o(), y("svg", {
87
+ xmlns: "http://www.w3.org/2000/svg",
88
+ viewBox: "0 0 1024 1024"
89
+ }, [
90
+ r("path", {
91
+ fill: "currentColor",
92
+ d: "M128 192v640h768V320H485.76L357.504 192zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32"
93
+ })
94
+ ]));
95
+ }
96
+ }), qe = _s, bs = /* @__PURE__ */ Se({
97
+ name: "Loading",
98
+ __name: "loading",
99
+ setup(i) {
100
+ return (P, x) => (o(), y("svg", {
101
+ xmlns: "http://www.w3.org/2000/svg",
102
+ viewBox: "0 0 1024 1024"
103
+ }, [
104
+ r("path", {
105
+ fill: "currentColor",
106
+ d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"
107
+ })
108
+ ]));
109
+ }
110
+ }), hs = bs, Is = /* @__PURE__ */ Se({
111
+ name: "MoreFilled",
112
+ __name: "more-filled",
113
+ setup(i) {
114
+ return (P, x) => (o(), y("svg", {
115
+ xmlns: "http://www.w3.org/2000/svg",
116
+ viewBox: "0 0 1024 1024"
117
+ }, [
118
+ r("path", {
119
+ fill: "currentColor",
120
+ d: "M176 416a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224"
121
+ })
122
+ ]));
123
+ }
124
+ }), ws = Is, xs = /* @__PURE__ */ Se({
125
+ name: "Plus",
126
+ __name: "plus",
127
+ setup(i) {
128
+ return (P, x) => (o(), y("svg", {
129
+ xmlns: "http://www.w3.org/2000/svg",
130
+ viewBox: "0 0 1024 1024"
131
+ }, [
132
+ r("path", {
133
+ fill: "currentColor",
134
+ d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"
135
+ })
136
+ ]));
137
+ }
138
+ }), Vs = xs, ks = /* @__PURE__ */ Se({
139
+ name: "Refresh",
140
+ __name: "refresh",
141
+ setup(i) {
142
+ return (P, x) => (o(), y("svg", {
143
+ xmlns: "http://www.w3.org/2000/svg",
144
+ viewBox: "0 0 1024 1024"
145
+ }, [
146
+ r("path", {
147
+ fill: "currentColor",
148
+ d: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"
149
+ })
150
+ ]));
151
+ }
152
+ }), st = ks, Ss = /* @__PURE__ */ Se({
153
+ name: "Search",
154
+ __name: "search",
155
+ setup(i) {
156
+ return (P, x) => (o(), y("svg", {
157
+ xmlns: "http://www.w3.org/2000/svg",
158
+ viewBox: "0 0 1024 1024"
159
+ }, [
160
+ r("path", {
161
+ fill: "currentColor",
162
+ d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"
163
+ })
164
+ ]));
165
+ }
166
+ }), Ts = Ss;
167
+ const Oe = (i, P) => {
168
+ const x = i.__vccOpts || i;
169
+ for (const [j, m] of P)
170
+ x[j] = m;
171
+ return x;
172
+ }, $s = { class: "steps" }, Cs = { class: "stepNun" }, Ps = { class: "stepWord" }, Ks = {
173
+ __name: "index",
174
+ props: {
175
+ step: {
176
+ type: Number,
177
+ default: 0
178
+ },
179
+ stepList: {
180
+ type: Array,
181
+ default: () => []
182
+ }
183
+ },
184
+ setup(i) {
185
+ return (P, x) => {
186
+ const j = f("Check"), m = f("el-icon");
187
+ return o(), y("div", $s, [
188
+ (o(!0), y(pe, null, ye(i.stepList, (D, T) => (o(), y("div", {
189
+ key: T,
190
+ class: ke(["stepBox", { stepActive: i.step === T + 1, stepFinish: i.step > T + 1 }]),
191
+ style: kt({ width: 100 / i.stepList.length + "%" })
192
+ }, [
193
+ x[0] || (x[0] = r("div", { class: "space" }, null, -1)),
194
+ r("div", Cs, [
195
+ r("span", null, Q(T + 1), 1),
196
+ e(m, null, {
197
+ default: a(() => [
198
+ e(j)
199
+ ]),
200
+ _: 1
201
+ })
202
+ ]),
203
+ r("div", Ps, Q(D), 1)
204
+ ], 6))), 128))
205
+ ]);
206
+ };
207
+ }
208
+ }, Ns = /* @__PURE__ */ Oe(Ks, [["__scopeId", "data-v-8d7f61a5"]]), xt = (i, P, x) => {
209
+ const j = i[P];
210
+ return j ? typeof j == "function" ? j() : Promise.resolve(j) : new Promise((m, D) => {
211
+ (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
212
+ D.bind(
213
+ null,
214
+ new Error(
215
+ "Unknown variable dynamic import: " + P + (P.split("/").length !== x ? ". Note that variables only represent file names one level deep." : "")
216
+ )
217
+ )
218
+ );
219
+ });
220
+ };
221
+ let te = null, se = null;
222
+ const Us = (i, P) => {
223
+ te = i, se = P;
224
+ };
225
+ function Os(i) {
226
+ return te({
227
+ url: `${se}/datasourceProxy/driver/icon/${i}`,
228
+ method: "get"
229
+ });
230
+ }
231
+ function Es() {
232
+ return te({
233
+ url: `${se}/datasourceProxy/search/getDataSourceTree`,
234
+ method: "post"
235
+ });
236
+ }
237
+ function Bs(i) {
238
+ return te({
239
+ url: `${se}/datasourceProxy/datasource/testConnection/${i}`,
240
+ method: "post"
241
+ });
242
+ }
243
+ function Ls(i) {
244
+ return te({
245
+ url: `${se}/datasourceProxy/search/getDataSourceInfo/${i}`,
246
+ method: "post"
247
+ });
248
+ }
249
+ function As(i) {
250
+ return te({
251
+ url: `${se}/datasourceProxy/search/getDataSetInfo/${i}`,
252
+ method: "post"
253
+ });
254
+ }
255
+ function at(i) {
256
+ return te({
257
+ url: `${se}/datasourceProxy/dataSourceTree/addDataSourceToDir`,
258
+ method: "post",
259
+ data: i
260
+ });
261
+ }
262
+ function Ds(i) {
263
+ return te({
264
+ url: `${se}/datasourceProxy/dataSourceTree/removeDataSourceTree/${i}`,
265
+ method: "post"
266
+ });
267
+ }
268
+ function He(i) {
269
+ return te({
270
+ url: `${se}/datasourceProxy/dataSourceTree/removeDataSourceFromDir`,
271
+ method: "post",
272
+ data: i
273
+ });
274
+ }
275
+ function Fs(i) {
276
+ return te({
277
+ url: `${se}/datasourceProxy/dataSourceTree/saveDataSourceTree`,
278
+ method: "post",
279
+ data: i
280
+ });
281
+ }
282
+ function lt(i) {
283
+ return te({
284
+ url: `${se}/datasourceProxy/dataSourceTree/updateDataSourceTree`,
285
+ method: "post",
286
+ data: i
287
+ });
288
+ }
289
+ function Ms(i) {
290
+ return te({
291
+ url: `${se}/datasourceProxy/search/updateDataSourceInfo`,
292
+ method: "post",
293
+ data: i
294
+ });
295
+ }
296
+ function Rs(i) {
297
+ return te({
298
+ url: `${se}/datasourceProxy/search/updateDataSetInfo`,
299
+ method: "post",
300
+ data: i
301
+ });
302
+ }
303
+ function Hs(i) {
304
+ return te({
305
+ url: `${se}/datasourceProxy/search/deleteDataSourceInfo/${i}`,
306
+ method: "post"
307
+ });
308
+ }
309
+ function qs(i) {
310
+ return te({
311
+ url: `${se}/datasourceProxy/search/deleteDataSetInfo/${i}`,
312
+ method: "post"
313
+ });
314
+ }
315
+ function zs(i) {
316
+ return te({
317
+ url: `${se}/datasourceProxy/ingestion/executeDatasetSyncTask/${i}`,
318
+ method: "get"
319
+ });
320
+ }
321
+ function js(i) {
322
+ return te({
323
+ url: `${se}/datasourceProxy/search/syncDataSetInfo/${i}`,
324
+ method: "post"
325
+ });
326
+ }
327
+ function Ys(i) {
328
+ return te({
329
+ url: `${se}/datasourceProxy/dataset/statistic/${i}`,
330
+ method: "get"
331
+ });
332
+ }
333
+ function Ws() {
334
+ return te({
335
+ url: `${se}/datasourceProxy/search/getDataSourceClassifyTree`,
336
+ method: "post"
337
+ });
338
+ }
339
+ function Js(i) {
340
+ return te({
341
+ url: `${se}/datasourceProxy/datasource/getCreateTableDdlByDatasetId/${i}`,
342
+ method: "post"
343
+ });
344
+ }
345
+ const je = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2025.0.0,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%206.00%20Build%200)%20--%3e%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20viewBox='0%200%2018%2018'%20style='enable-background:new%200%200%2018%2018;'%20xml:space='preserve'%3e%3cstyle%20type='text/css'%3e%20.st0{fill:%23999FAB;}%20%3c/style%3e%3cg%3e%3cpath%20class='st0'%20d='M15,4.7h-4.6c-0.3,0-0.5-0.1-0.7-0.3L8.6,3.1C8.2,2.7,7.7,2.5,7.1,2.5H3c-1.1,0-2,0.9-2,2v9c0,1.1,0.9,2,2,2%20h12c1.1,0,2-0.9,2-2V6.7C17,5.6,16.1,4.7,15,4.7z%20M15.5,13.5c0,0.3-0.2,0.5-0.5,0.5H3c-0.3,0-0.5-0.2-0.5-0.5v-9C2.5,4.2,2.7,4,3,4%20h4.1c0.1,0,0.3,0.1,0.4,0.2l1.1,1.2c0.5,0.5,1.1,0.8,1.8,0.8H15c0.3,0,0.5,0.2,0.5,0.5V13.5z'/%3e%3cpath%20class='st0'%20d='M7.2,11H4.8C4.3,11,4,11.3,4,11.8s0.3,0.8,0.8,0.8h2.5c0.4,0,0.8-0.3,0.8-0.8S7.7,11,7.2,11z'/%3e%3c/g%3e%3c/svg%3e", Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
346
+ __proto__: null,
347
+ default: je
348
+ }, Symbol.toStringTag, { value: "Module" })), Le = {
349
+ __name: "treeIcon",
350
+ props: {
351
+ typeName: {
352
+ type: String,
353
+ default: "default"
354
+ },
355
+ isDataSource: {
356
+ type: Boolean,
357
+ default: !1
358
+ }
359
+ },
360
+ setup(i) {
361
+ const P = i, x = c(null), j = async () => {
362
+ if (await Ce(), x.value)
363
+ if (P.isDataSource)
364
+ try {
365
+ const D = await Os(P.typeName);
366
+ x.value.src = await m(D);
367
+ } catch {
368
+ try {
369
+ const T = await xt(/* @__PURE__ */ Object.assign({ "../../../assets/images/treeIcons/COLLECTION.svg": () => import("./COLLECTION-CGr8r7D0.js"), "../../../assets/images/treeIcons/INDEX.svg": () => import("./INDEX-CWRlbxz6.js"), "../../../assets/images/treeIcons/NODE_LABEL.svg": () => import("./NODE_LABEL-BNtE9a8x.js"), "../../../assets/images/treeIcons/PACKAGE.svg": () => import("./PACKAGE-Cdqdazmm.js"), "../../../assets/images/treeIcons/PROCEDURE.svg": () => import("./PROCEDURE-BFKXCwJs.js"), "../../../assets/images/treeIcons/RELATIONSHIP_TYPE.svg": () => import("./RELATIONSHIP_TYPE-DH_Ql50v.js"), "../../../assets/images/treeIcons/TABLE.svg": () => import("./TABLE-C6D4BTNb.js"), "../../../assets/images/treeIcons/TOPIC.svg": () => import("./TOPIC-DDMJFl8M.js"), "../../../assets/images/treeIcons/VIEW.svg": () => import("./VIEW-Dy2H__0e.js"), "../../../assets/images/treeIcons/cassandra.svg": () => import("./cassandra-kZBMMRLi.js"), "../../../assets/images/treeIcons/clickhouse.svg": () => import("./clickhouse-wZad6bX_.js"), "../../../assets/images/treeIcons/cratedb.svg": () => import("./cratedb-Bp9DafHH.js"), "../../../assets/images/treeIcons/dameng.svg": () => import("./dameng-DDKENLSf.js"), "../../../assets/images/treeIcons/database.svg": () => import("./database-DorJeeaH.js"), "../../../assets/images/treeIcons/db2.svg": () => import("./db2-BQLq-8O9.js"), "../../../assets/images/treeIcons/default.svg": () => Promise.resolve().then(() => Vt), "../../../assets/images/treeIcons/dm.svg": () => import("./dm-DDKENLSf.js"), "../../../assets/images/treeIcons/doris.svg": () => import("./doris-sPgf3dKR.js"), "../../../assets/images/treeIcons/druid.svg": () => import("./druid-BCpjCk40.js"), "../../../assets/images/treeIcons/elasticsearch.svg": () => import("./elasticsearch-IjsXozrl.js"), "../../../assets/images/treeIcons/file.svg": () => import("./file-CYyJ85qD.js"), "../../../assets/images/treeIcons/filesystem.svg": () => import("./filesystem-CHNDPEkF.js"), "../../../assets/images/treeIcons/folder.svg": () => import("./folder-B_IZAYKT.js"), "../../../assets/images/treeIcons/folderClose.svg": () => import("./folderClose-Ci16QLsN.js"), "../../../assets/images/treeIcons/folderOpen.svg": () => import("./folderOpen-ClecyRH1.js"), "../../../assets/images/treeIcons/ftp.svg": () => import("./ftp-B1EMbJZ8.js"), "../../../assets/images/treeIcons/gbase.svg": () => import("./gbase-Cfbti4wa.js"), "../../../assets/images/treeIcons/greenplum.svg": () => import("./greenplum-C72qwgT6.js"), "../../../assets/images/treeIcons/hbase.svg": () => import("./hbase-DJlmFvuj.js"), "../../../assets/images/treeIcons/hdfs.svg": () => import("./hdfs-HbRnS4Ee.js"), "../../../assets/images/treeIcons/hive-metastore.svg": () => import("./hive-metastore-CFGs347R.js"), "../../../assets/images/treeIcons/hive.svg": () => import("./hive-CFGs347R.js"), "../../../assets/images/treeIcons/hudi.svg": () => import("./hudi-BXyzOfLV.js"), "../../../assets/images/treeIcons/iceberg.svg": () => import("./iceberg-BCCMLWKb.js"), "../../../assets/images/treeIcons/kafka.svg": () => import("./kafka-BQTmKvyf.js"), "../../../assets/images/treeIcons/kingbase.svg": () => import("./kingbase-CtbaKFzM.js"), "../../../assets/images/treeIcons/mariadb.svg": () => import("./mariadb-DUUVCuEd.js"), "../../../assets/images/treeIcons/milvus.svg": () => import("./milvus-B_EXXpE7.js"), "../../../assets/images/treeIcons/minio.svg": () => import("./minio-DrkEY6Lg.js"), "../../../assets/images/treeIcons/mission.svg": () => import("./mission-DP49naae.js"), "../../../assets/images/treeIcons/mongodb.svg": () => import("./mongodb-sCoR-0DO.js"), "../../../assets/images/treeIcons/mssql.svg": () => import("./mssql-CyLYBEca.js"), "../../../assets/images/treeIcons/mysql.svg": () => import("./mysql-B6gniQbL.js"), "../../../assets/images/treeIcons/neo4j.svg": () => import("./neo4j-fM-N6RPF.js"), "../../../assets/images/treeIcons/note.svg": () => import("./note-KSl8tOvD.js"), "../../../assets/images/treeIcons/oceanbase.svg": () => import("./oceanbase-CHQGzVAU.js"), "../../../assets/images/treeIcons/opensearch.svg": () => import("./opensearch-Bkb3qPjF.js"), "../../../assets/images/treeIcons/oracle.svg": () => import("./oracle-7N_bpyOE.js"), "../../../assets/images/treeIcons/paimon.svg": () => import("./paimon-ChRYie-E.js"), "../../../assets/images/treeIcons/postgres.svg": () => import("./postgres-CU2CHKIj.js"), "../../../assets/images/treeIcons/presto.svg": () => import("./presto-XCYrPD7W.js"), "../../../assets/images/treeIcons/report.svg": () => import("./report-zbtqy9nr.js"), "../../../assets/images/treeIcons/schema.svg": () => import("./schema-DHIGvfp2.js"), "../../../assets/images/treeIcons/snowflake.svg": () => import("./snowflake-Cy_FOrcV.js"), "../../../assets/images/treeIcons/sqlserver.svg": () => import("./sqlserver-CyLYBEca.js"), "../../../assets/images/treeIcons/starrocks.svg": () => import("./starrocks-BAeDPSaX.js"), "../../../assets/images/treeIcons/sybase.svg": () => import("./sybase-JxsUZBj2.js"), "../../../assets/images/treeIcons/tidb.svg": () => import("./tidb-CKZDxkdA.js"), "../../../assets/images/treeIcons/trino.svg": () => import("./trino-CTo8-zn8.js"), "../../../assets/images/treeIcons/全文检索.svg": () => import("./全文检索-CM_FkicR.js"), "../../../assets/images/treeIcons/关系型数据库.svg": () => import("./关系型数据库-CdxjM7fF.js"), "../../../assets/images/treeIcons/分析型数据库.svg": () => import("./分析型数据库-DCG17zXf.js"), "../../../assets/images/treeIcons/向量数据库.svg": () => import("./向量数据库-Sus8yO-o.js"), "../../../assets/images/treeIcons/图数据库.svg": () => import("./图数据库-m2gN34YV.js"), "../../../assets/images/treeIcons/数据湖.svg": () => import("./数据湖-DYPNBEro.js"), "../../../assets/images/treeIcons/文件系统.svg": () => import("./文件系统-BpeHJ8ur.js"), "../../../assets/images/treeIcons/文档数据库.svg": () => import("./文档数据库-CYyJ85qD.js"), "../../../assets/images/treeIcons/时序数据库.svg": () => import("./时序数据库-BKM1uC99.js"), "../../../assets/images/treeIcons/消息队列.svg": () => import("./消息队列-BZj1tfb_.js"), "../../../assets/images/treeIcons/非关系型(NoSQL)数据库.svg": () => import("./非关系型(NoSQL)数据库-Ciz5Z_Sa.js") }), `../../../assets/images/treeIcons/${P.typeName}.svg`, 7);
370
+ x.value.src = T.default;
371
+ } catch {
372
+ console.log(`暂无该图标: ${P.typeName}`), x.value.src = je;
373
+ }
374
+ }
375
+ else
376
+ try {
377
+ const D = await xt(/* @__PURE__ */ Object.assign({ "../../../assets/images/treeIcons/COLLECTION.svg": () => import("./COLLECTION-CGr8r7D0.js"), "../../../assets/images/treeIcons/INDEX.svg": () => import("./INDEX-CWRlbxz6.js"), "../../../assets/images/treeIcons/NODE_LABEL.svg": () => import("./NODE_LABEL-BNtE9a8x.js"), "../../../assets/images/treeIcons/PACKAGE.svg": () => import("./PACKAGE-Cdqdazmm.js"), "../../../assets/images/treeIcons/PROCEDURE.svg": () => import("./PROCEDURE-BFKXCwJs.js"), "../../../assets/images/treeIcons/RELATIONSHIP_TYPE.svg": () => import("./RELATIONSHIP_TYPE-DH_Ql50v.js"), "../../../assets/images/treeIcons/TABLE.svg": () => import("./TABLE-C6D4BTNb.js"), "../../../assets/images/treeIcons/TOPIC.svg": () => import("./TOPIC-DDMJFl8M.js"), "../../../assets/images/treeIcons/VIEW.svg": () => import("./VIEW-Dy2H__0e.js"), "../../../assets/images/treeIcons/cassandra.svg": () => import("./cassandra-kZBMMRLi.js"), "../../../assets/images/treeIcons/clickhouse.svg": () => import("./clickhouse-wZad6bX_.js"), "../../../assets/images/treeIcons/cratedb.svg": () => import("./cratedb-Bp9DafHH.js"), "../../../assets/images/treeIcons/dameng.svg": () => import("./dameng-DDKENLSf.js"), "../../../assets/images/treeIcons/database.svg": () => import("./database-DorJeeaH.js"), "../../../assets/images/treeIcons/db2.svg": () => import("./db2-BQLq-8O9.js"), "../../../assets/images/treeIcons/default.svg": () => Promise.resolve().then(() => Vt), "../../../assets/images/treeIcons/dm.svg": () => import("./dm-DDKENLSf.js"), "../../../assets/images/treeIcons/doris.svg": () => import("./doris-sPgf3dKR.js"), "../../../assets/images/treeIcons/druid.svg": () => import("./druid-BCpjCk40.js"), "../../../assets/images/treeIcons/elasticsearch.svg": () => import("./elasticsearch-IjsXozrl.js"), "../../../assets/images/treeIcons/file.svg": () => import("./file-CYyJ85qD.js"), "../../../assets/images/treeIcons/filesystem.svg": () => import("./filesystem-CHNDPEkF.js"), "../../../assets/images/treeIcons/folder.svg": () => import("./folder-B_IZAYKT.js"), "../../../assets/images/treeIcons/folderClose.svg": () => import("./folderClose-Ci16QLsN.js"), "../../../assets/images/treeIcons/folderOpen.svg": () => import("./folderOpen-ClecyRH1.js"), "../../../assets/images/treeIcons/ftp.svg": () => import("./ftp-B1EMbJZ8.js"), "../../../assets/images/treeIcons/gbase.svg": () => import("./gbase-Cfbti4wa.js"), "../../../assets/images/treeIcons/greenplum.svg": () => import("./greenplum-C72qwgT6.js"), "../../../assets/images/treeIcons/hbase.svg": () => import("./hbase-DJlmFvuj.js"), "../../../assets/images/treeIcons/hdfs.svg": () => import("./hdfs-HbRnS4Ee.js"), "../../../assets/images/treeIcons/hive-metastore.svg": () => import("./hive-metastore-CFGs347R.js"), "../../../assets/images/treeIcons/hive.svg": () => import("./hive-CFGs347R.js"), "../../../assets/images/treeIcons/hudi.svg": () => import("./hudi-BXyzOfLV.js"), "../../../assets/images/treeIcons/iceberg.svg": () => import("./iceberg-BCCMLWKb.js"), "../../../assets/images/treeIcons/kafka.svg": () => import("./kafka-BQTmKvyf.js"), "../../../assets/images/treeIcons/kingbase.svg": () => import("./kingbase-CtbaKFzM.js"), "../../../assets/images/treeIcons/mariadb.svg": () => import("./mariadb-DUUVCuEd.js"), "../../../assets/images/treeIcons/milvus.svg": () => import("./milvus-B_EXXpE7.js"), "../../../assets/images/treeIcons/minio.svg": () => import("./minio-DrkEY6Lg.js"), "../../../assets/images/treeIcons/mission.svg": () => import("./mission-DP49naae.js"), "../../../assets/images/treeIcons/mongodb.svg": () => import("./mongodb-sCoR-0DO.js"), "../../../assets/images/treeIcons/mssql.svg": () => import("./mssql-CyLYBEca.js"), "../../../assets/images/treeIcons/mysql.svg": () => import("./mysql-B6gniQbL.js"), "../../../assets/images/treeIcons/neo4j.svg": () => import("./neo4j-fM-N6RPF.js"), "../../../assets/images/treeIcons/note.svg": () => import("./note-KSl8tOvD.js"), "../../../assets/images/treeIcons/oceanbase.svg": () => import("./oceanbase-CHQGzVAU.js"), "../../../assets/images/treeIcons/opensearch.svg": () => import("./opensearch-Bkb3qPjF.js"), "../../../assets/images/treeIcons/oracle.svg": () => import("./oracle-7N_bpyOE.js"), "../../../assets/images/treeIcons/paimon.svg": () => import("./paimon-ChRYie-E.js"), "../../../assets/images/treeIcons/postgres.svg": () => import("./postgres-CU2CHKIj.js"), "../../../assets/images/treeIcons/presto.svg": () => import("./presto-XCYrPD7W.js"), "../../../assets/images/treeIcons/report.svg": () => import("./report-zbtqy9nr.js"), "../../../assets/images/treeIcons/schema.svg": () => import("./schema-DHIGvfp2.js"), "../../../assets/images/treeIcons/snowflake.svg": () => import("./snowflake-Cy_FOrcV.js"), "../../../assets/images/treeIcons/sqlserver.svg": () => import("./sqlserver-CyLYBEca.js"), "../../../assets/images/treeIcons/starrocks.svg": () => import("./starrocks-BAeDPSaX.js"), "../../../assets/images/treeIcons/sybase.svg": () => import("./sybase-JxsUZBj2.js"), "../../../assets/images/treeIcons/tidb.svg": () => import("./tidb-CKZDxkdA.js"), "../../../assets/images/treeIcons/trino.svg": () => import("./trino-CTo8-zn8.js"), "../../../assets/images/treeIcons/全文检索.svg": () => import("./全文检索-CM_FkicR.js"), "../../../assets/images/treeIcons/关系型数据库.svg": () => import("./关系型数据库-CdxjM7fF.js"), "../../../assets/images/treeIcons/分析型数据库.svg": () => import("./分析型数据库-DCG17zXf.js"), "../../../assets/images/treeIcons/向量数据库.svg": () => import("./向量数据库-Sus8yO-o.js"), "../../../assets/images/treeIcons/图数据库.svg": () => import("./图数据库-m2gN34YV.js"), "../../../assets/images/treeIcons/数据湖.svg": () => import("./数据湖-DYPNBEro.js"), "../../../assets/images/treeIcons/文件系统.svg": () => import("./文件系统-BpeHJ8ur.js"), "../../../assets/images/treeIcons/文档数据库.svg": () => import("./文档数据库-CYyJ85qD.js"), "../../../assets/images/treeIcons/时序数据库.svg": () => import("./时序数据库-BKM1uC99.js"), "../../../assets/images/treeIcons/消息队列.svg": () => import("./消息队列-BZj1tfb_.js"), "../../../assets/images/treeIcons/非关系型(NoSQL)数据库.svg": () => import("./非关系型(NoSQL)数据库-Ciz5Z_Sa.js") }), `../../../assets/images/treeIcons/${P.typeName}.svg`, 7);
378
+ x.value.src = D.default;
379
+ } catch {
380
+ console.log(`暂无该图标: ${P.typeName}`), x.value.src = je;
381
+ }
382
+ }, m = async (D) => {
383
+ const T = D.replace(/.*(?=<svg)/, "");
384
+ if (/^<svg/.test(T))
385
+ return await new Promise((le, Y) => {
386
+ const X = new Blob([T], { type: "image/svg+xml" }), N = URL.createObjectURL(X);
387
+ le(N);
388
+ });
389
+ const B = await (await fetch(T)).blob();
390
+ return new Promise((le, Y) => {
391
+ const X = new FileReader();
392
+ X.onloadend = () => le(X.result), X.onerror = Y, X.readAsDataURL(B);
393
+ });
394
+ };
395
+ return Ue(() => P.typeName, () => {
396
+ j();
397
+ }), it(() => {
398
+ j();
399
+ }), (D, T) => (o(), y("img", {
400
+ ref_key: "imgRef",
401
+ ref: x
402
+ }, null, 512));
403
+ }
9
404
  };
10
- function u(e, o, t, n, c, d) {
11
- return r(), a("div", null, "dataSourceTree");
405
+ function Tt(i) {
406
+ return te({
407
+ url: `${se}/datasourceProxy/datasource/testConnection`,
408
+ method: "post",
409
+ data: i
410
+ });
411
+ }
412
+ function Gs() {
413
+ return te({
414
+ url: `${se}/datasourceProxy/driver/driverTypeList`,
415
+ method: "get"
416
+ });
417
+ }
418
+ function ot(i) {
419
+ return te({
420
+ url: `${se}/datasourceProxy/driver/list`,
421
+ method: "post",
422
+ data: {
423
+ source_type: i,
424
+ driver_name: "",
425
+ description: ""
426
+ }
427
+ });
428
+ }
429
+ function rt(i) {
430
+ return te({
431
+ url: `${se}/datasourceProxy/cfgtemplate/datasourceCfgTemplate/${i}`,
432
+ method: "get"
433
+ });
434
+ }
435
+ function $t(i, P) {
436
+ return P === void 0 && (P = !1), te({
437
+ url: `${se}/datasourceProxy/datasource/saveOrUpdate/${P}`,
438
+ method: "post",
439
+ data: i
440
+ });
441
+ }
442
+ function Qs(i) {
443
+ return te({
444
+ url: `${se}/datasourceProxy/datasource/getDetailById/${i}`,
445
+ method: "post"
446
+ });
447
+ }
448
+ function Xs(i) {
449
+ return te({
450
+ url: `${se}/datasourceProxy/ingestion/getUnIngestingDatasets/${i}`,
451
+ method: "get"
452
+ });
12
453
  }
13
- const l = /* @__PURE__ */ s(p, [["render", u]]), _ = [l], m = {
14
- install(e) {
15
- _.forEach((o) => {
16
- e.component(o.name, o);
454
+ function Zs(i) {
455
+ return te({
456
+ url: `${se}/datasourceProxy/ingestion/syncDatasetAndUpdateTask`,
457
+ method: "post",
458
+ data: i
459
+ });
460
+ }
461
+ function ea(i) {
462
+ return te({
463
+ url: `${se}/datasourceProxy/fileManage/listFiles`,
464
+ method: "post",
465
+ data: i
466
+ });
467
+ }
468
+ function ta(i) {
469
+ return te({
470
+ url: `${se}/datasourceProxy/search/saveOrUpdateFileDatasetInfo`,
471
+ method: "post",
472
+ data: i
473
+ });
474
+ }
475
+ function Ct(i) {
476
+ return te({
477
+ url: `${se}/datasourceProxy/uploadFile/upload`,
478
+ method: "post",
479
+ data: i,
480
+ headers: { "Content-Type": "multipart/form-data" }
481
+ });
482
+ }
483
+ function sa(i, P) {
484
+ return te({
485
+ url: `${se}/dataSourceRest/queryIngestionSource/${i}`,
486
+ method: "post",
487
+ data: P
488
+ });
489
+ }
490
+ const aa = { class: "addDiv" }, la = { class: "drawer-header" }, oa = { class: "drawer-title" }, ra = { class: "stepBox" }, na = { class: "addContent" }, ia = { key: 0 }, ua = { class: "line" }, da = { class: "lineTitle" }, ca = {
491
+ key: 0,
492
+ class: "lineContent"
493
+ }, pa = ["onClick"], ma = { class: "name" }, fa = {
494
+ key: 1,
495
+ class: "lineContent blank"
496
+ }, va = { key: 1 }, ga = { class: "stepBtn" }, ya = { key: 0 }, _a = { key: 1 }, ba = {
497
+ __name: "addSource",
498
+ props: {
499
+ addSourceVisible: {
500
+ type: Boolean,
501
+ default: !1
502
+ },
503
+ nowTreeItem: {
504
+ type: Object,
505
+ default: () => ({})
506
+ },
507
+ nowSource: {
508
+ type: Object,
509
+ default: () => ({})
510
+ },
511
+ isChange: {
512
+ type: Boolean,
513
+ default: !1
514
+ }
515
+ },
516
+ emits: ["close", "confirm", "refresh"],
517
+ setup(i, { emit: P }) {
518
+ const x = i, j = P, m = ze({
519
+ get() {
520
+ return x.addSourceVisible;
521
+ },
522
+ set(O) {
523
+ j("close", O);
524
+ }
525
+ }), D = () => {
526
+ m.value = !1;
527
+ }, T = () => {
528
+ j("close", !1);
529
+ }, w = c(1), B = ["选择数据源类型", "配置信息"], le = c("数据源登记"), Y = c([]), X = c([]), N = c(""), U = c(""), oe = c(""), re = c({
530
+ datasourceName: "",
531
+ isPublic: "YES",
532
+ isDisabled: "NO",
533
+ driverId: "",
534
+ description: ""
535
+ }), R = c({}), me = {
536
+ datasourceName: [{ required: !0, message: "请输入数据源名称", trigger: "blur" }]
537
+ }, ue = c({}), _e = c(), de = c(), Z = c([]), F = c([]), ae = c([]), ve = c({}), ge = c(""), be = c(""), L = c(""), n = c("temp_" + Math.random().toString(36).substr(2, 8)), p = c("admin"), J = () => !X.value.includes(N.value), V = (O) => ve.value[O] || [], u = async (O, l) => {
538
+ const { file: S, onSuccess: h, onError: E } = O;
539
+ if (!S) return;
540
+ const we = new FormData();
541
+ we.append("file", S), we.append("assocId", be.value || n.value), we.append("assocType", "config"), we.append("uploadedBy", p.value), we.append("remarks", l);
542
+ try {
543
+ const xe = await Ct(we);
544
+ xe.code === 0 ? (R.value[l] = xe.data, ve.value[l] = [{ name: S.name, url: "" }], z.success("文件上传成功"), h && h(xe)) : (z.error("文件上传失败"), E && E(xe));
545
+ } catch (xe) {
546
+ console.error(xe), z.error("文件上传失败"), E && E(xe);
547
+ }
548
+ }, k = (O, l, S) => {
549
+ R.value[S] = "", ve.value[S] = l;
550
+ }, ee = (O, l, S) => {
551
+ z.warning(`当前限制选择 1 个文件,本次选择了 ${O.length} 个文件,共选择了 ${O.length + l.length} 个文件`);
552
+ }, ie = (O) => {
553
+ console.log("item", O), N.value = O.type, re.value.driverId = O.driverId, N.value === "filesystem" ? U.value = O.serverType : U.value = "";
554
+ }, M = () => {
555
+ if (N.value)
556
+ if (J()) {
557
+ const O = N.value === "filesystem" ? U.value : N.value;
558
+ O !== oe.value ? (re.value = {
559
+ ...re.value,
560
+ datasourceName: "",
561
+ isPublic: "YES",
562
+ isDisabled: "NO",
563
+ description: "",
564
+ cfgList: []
565
+ }, R.value = {}, ve.value = {}, oe.value = O, Promise.all([
566
+ ot(oe.value),
567
+ rt(oe.value)
568
+ ]).then(([l, S]) => {
569
+ l.code === 0 ? l.data.length > 0 ? (Z.value = l.data, w.value = 2) : (oe.value = "", z.error("该数据源驱动信息为空,请选择其他数据源类型")) : (oe.value = "", z.error("获取数据源驱动信息失败")), S.code === 0 && (F.value = S.data.map((h) => ({
570
+ ...h,
571
+ mappedPropKey: h.propKey ? h.propKey.replace(/\./g, "_") : h.propKey
572
+ })), ae.value = [], ue.value = {}, console.log("configListOption.value", F.value), F.value.forEach((h) => {
573
+ h.options && (h.options = JSON.parse(h.options));
574
+ const E = h.mappedPropKey || h.propKey;
575
+ h.required === "YES" && (ue.value[E] = [{ required: !0, message: "必填项,请填写" + h.label, trigger: "blur" }]), h.defaultValue && (R.value[E] = h.defaultValue), ae.value.push({
576
+ scope: h.scope,
577
+ propKey: h.propKey,
578
+ propValue: h.defaultValue,
579
+ valueType: "String",
580
+ description: h.label
581
+ }), h.inputType === "textAndUpload" && (ve.value[E] = []);
582
+ }));
583
+ })) : w.value = 2;
584
+ } else
585
+ z.warning("该数据源暂不支持");
586
+ else
587
+ z.warning("请选择数据源类型");
588
+ }, ce = () => {
589
+ w.value = 1;
590
+ }, v = async () => {
591
+ try {
592
+ await _e.value.validate(), await de.value.validate();
593
+ const O = {
594
+ ...re.value,
595
+ datasourceType: oe.value,
596
+ cfgList: F.value.map((l) => {
597
+ const S = l.mappedPropKey || l.propKey;
598
+ return {
599
+ scope: l.scope,
600
+ propKey: l.propKey,
601
+ propValue: R.value[S],
602
+ valueType: "String",
603
+ description: l.label
604
+ };
605
+ })
606
+ };
607
+ return console.log("params", O), O;
608
+ } catch {
609
+ return z.warning("请填写必填信息"), !1;
610
+ }
611
+ }, W = async () => {
612
+ const O = await v();
613
+ if (!O)
614
+ return;
615
+ const l = Fe.service({
616
+ lock: !0,
617
+ text: "测试连接中...",
618
+ spinner: "el-icon-loading",
619
+ background: "rgba(235 235 235 / 70%)"
620
+ });
621
+ try {
622
+ const S = await Tt(O);
623
+ S.code === 0 ? z.success("连接成功") : z.error(S.message);
624
+ } catch (S) {
625
+ console.log("err", S), z.error(S.message);
626
+ } finally {
627
+ l.close();
628
+ }
629
+ }, he = async (O) => {
630
+ const l = await v();
631
+ if (!l)
632
+ return;
633
+ const S = Fe.service({
634
+ lock: !0,
635
+ text: "保存中...",
636
+ spinner: "el-icon-loading",
637
+ background: "rgba(235 235 235 / 70%)"
638
+ });
639
+ try {
640
+ const h = localStorage.getItem("TENANT_ID") || null;
641
+ l.tenantId = h.currentTenantId;
642
+ const E = await $t(l, O);
643
+ E.code === 0 ? (z.success("保存成功"), T(), j("refresh", E.data.id)) : E.code === 1000008 ? z.success("保存成功,创建元数据同步任务失败,请稍后手动创建任务") : z.error("保存失败:" + E.message);
644
+ } catch (h) {
645
+ console.log("err", h);
646
+ } finally {
647
+ S.close();
648
+ }
649
+ };
650
+ return it(async () => {
651
+ try {
652
+ const O = await Gs();
653
+ Y.value = O.data;
654
+ } catch (O) {
655
+ console.log("获取数据源类型列表失败", O);
656
+ }
657
+ if (x.isChange) {
658
+ le.value = "数据源修改", L.value = x.nowSource.nodeCode, be.value = x.nowSource.id, ge.value = x.nowSource.parentId;
659
+ try {
660
+ const O = await sa(L.value);
661
+ if (re.value.datasourceName = O.data.name, re.value.description = O.data.description, N.value = O.data.type, N.value === "filesystem") {
662
+ const l = JSON.parse(O.data.recipe).source.config;
663
+ U.value = l.server_type;
664
+ } else
665
+ U.value = "";
666
+ oe.value = N.value === "filesystem" ? U.value : N.value;
667
+ try {
668
+ const [l, S] = await Promise.all([
669
+ ot(oe.value),
670
+ rt(oe.value)
671
+ ]);
672
+ l.code === 0 && (Z.value = l.data), S.code === 0 && (F.value = S.data.map((h) => ({
673
+ ...h,
674
+ mappedPropKey: h.propKey ? h.propKey.replace(/\./g, "_") : h.propKey
675
+ })), ae.value = [], ue.value = {}, F.value.forEach((h) => {
676
+ h.options && (h.options = JSON.parse(h.options));
677
+ const E = h.mappedPropKey || h.propKey;
678
+ h.required === "YES" && (ue.value[E] = [{ required: !0, message: "必填项,请填写" + h.label, trigger: "blur" }]), h.defaultValue && (R.value[E] = h.defaultValue), ae.value.push({
679
+ scope: h.scope,
680
+ propKey: h.propKey,
681
+ propValue: h.defaultValue,
682
+ valueType: "String",
683
+ description: h.label
684
+ }), h.inputType === "textAndUpload" && (ve.value[E] = []);
685
+ }));
686
+ } catch (l) {
687
+ console.log("加载配置信息失败", l);
688
+ }
689
+ w.value = 2;
690
+ } catch (O) {
691
+ console.log(O), j("close");
692
+ }
693
+ } else
694
+ le.value = "数据源登记", ge.value = x.nowTreeItem.id;
695
+ }), (O, l) => {
696
+ const S = f("el-icon"), h = f("el-input"), E = f("el-form-item"), we = f("el-form"), xe = f("el-radio"), Ye = f("el-radio-group"), Ke = f("el-button"), We = f("el-upload"), Je = f("el-option"), Ge = f("el-select"), Qe = f("el-drawer");
697
+ return o(), q(Qe, {
698
+ modelValue: m.value,
699
+ "onUpdate:modelValue": l[6] || (l[6] = (I) => m.value = I),
700
+ title: le.value,
701
+ "before-close": D,
702
+ "close-on-click-modal": !1,
703
+ modal: !1,
704
+ "append-to-body": !0,
705
+ direction: "btt",
706
+ size: "calc(100vh - 48px)",
707
+ "with-header": !1,
708
+ "close-on-press-escape": !1,
709
+ "open-delay": 0,
710
+ "close-delay": 0,
711
+ class: "addSource-drawer",
712
+ "custom-class": "fullscreen-drawer no-animation-drawer"
713
+ }, {
714
+ default: a(() => [
715
+ r("div", aa, [
716
+ r("div", la, [
717
+ r("div", oa, Q(le.value), 1),
718
+ r("div", {
719
+ class: "drawer-close",
720
+ onClick: T
721
+ }, [
722
+ e(S, null, {
723
+ default: a(() => [
724
+ e(_(ps))
725
+ ]),
726
+ _: 1
727
+ })
728
+ ])
729
+ ]),
730
+ r("div", ra, [
731
+ e(Ns, {
732
+ step: w.value,
733
+ "step-list": B
734
+ }, null, 8, ["step"])
735
+ ]),
736
+ r("div", na, [
737
+ w.value === 1 ? (o(), y("div", ia, [
738
+ (o(!0), y(pe, null, ye(Y.value, (I) => (o(), y("div", ua, [
739
+ r("div", da, Q(I.name), 1),
740
+ I.list.length > 0 ? (o(), y("div", ca, [
741
+ (o(!0), y(pe, null, ye(I.list, (G) => (o(), y("div", {
742
+ class: ke(["lineItem", { typeActive: U.value ? U.value === G.serverType : N.value === G.type }]),
743
+ onClick: (Ee) => ie(G)
744
+ }, [
745
+ e(Le, {
746
+ "type-name": G.type,
747
+ isDataSource: !0
748
+ }, null, 8, ["type-name"]),
749
+ r("div", ma, Q(G.name), 1)
750
+ ], 10, pa))), 256))
751
+ ])) : (o(), y("div", fa, "暂无支持的该类型数据源"))
752
+ ]))), 256))
753
+ ])) : ne("", !0),
754
+ w.value === 2 ? (o(), y("div", va, [
755
+ l[9] || (l[9] = r("div", { class: "title_line" }, "配置数据源信息", -1)),
756
+ e(we, {
757
+ ref_key: "f1Ref",
758
+ ref: _e,
759
+ key: "f1",
760
+ rules: me,
761
+ "label-position": "left",
762
+ "label-width": "200px",
763
+ style: { "max-width": "700px" },
764
+ model: re.value,
765
+ onSubmit: l[2] || (l[2] = $e(() => {
766
+ }, ["prevent"]))
767
+ }, {
768
+ default: a(() => [
769
+ e(E, {
770
+ label: "数据源名称",
771
+ prop: "datasourceName"
772
+ }, {
773
+ default: a(() => [
774
+ e(h, {
775
+ modelValue: re.value.datasourceName,
776
+ "onUpdate:modelValue": l[0] || (l[0] = (I) => re.value.datasourceName = I),
777
+ placeholder: "请输入数据源名称"
778
+ }, null, 8, ["modelValue"])
779
+ ]),
780
+ _: 1
781
+ }),
782
+ e(E, {
783
+ label: "数据源描述",
784
+ prop: "description"
785
+ }, {
786
+ default: a(() => [
787
+ e(h, {
788
+ modelValue: re.value.description,
789
+ "onUpdate:modelValue": l[1] || (l[1] = (I) => re.value.description = I),
790
+ type: "textarea",
791
+ rows: 2
792
+ }, null, 8, ["modelValue"])
793
+ ]),
794
+ _: 1
795
+ })
796
+ ]),
797
+ _: 1
798
+ }, 8, ["model"]),
799
+ l[10] || (l[10] = r("div", { class: "title_line" }, "配置连接信息", -1)),
800
+ e(we, {
801
+ ref_key: "f2Ref",
802
+ ref: de,
803
+ key: "f2",
804
+ rules: ue.value,
805
+ "label-position": "left",
806
+ "label-width": "200px",
807
+ style: { "max-width": "700px", "padding-bottom": "15px" },
808
+ model: R.value,
809
+ onSubmit: l[3] || (l[3] = $e(() => {
810
+ }, ["prevent"]))
811
+ }, {
812
+ default: a(() => [
813
+ (o(!0), y(pe, null, ye(F.value, (I) => (o(), q(E, {
814
+ key: I.propKey,
815
+ label: I.label,
816
+ prop: I.mappedPropKey || I.propKey
817
+ }, {
818
+ default: a(() => [
819
+ I.inputType === "text" ? (o(), q(h, {
820
+ key: 0,
821
+ modelValue: R.value[I.mappedPropKey || I.propKey],
822
+ "onUpdate:modelValue": (G) => R.value[I.mappedPropKey || I.propKey] = G
823
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])) : ne("", !0),
824
+ I.inputType === "password" ? (o(), q(h, {
825
+ key: 1,
826
+ modelValue: R.value[I.mappedPropKey || I.propKey],
827
+ "onUpdate:modelValue": (G) => R.value[I.mappedPropKey || I.propKey] = G,
828
+ "show-password": "",
829
+ type: "password"
830
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])) : ne("", !0),
831
+ I.inputType === "number" ? (o(), q(h, {
832
+ key: 2,
833
+ modelValue: R.value[I.mappedPropKey || I.propKey],
834
+ "onUpdate:modelValue": (G) => R.value[I.mappedPropKey || I.propKey] = G,
835
+ type: "number"
836
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])) : ne("", !0),
837
+ I.inputType === "textarea" ? (o(), q(h, {
838
+ key: 3,
839
+ modelValue: R.value[I.mappedPropKey || I.propKey],
840
+ "onUpdate:modelValue": (G) => R.value[I.mappedPropKey || I.propKey] = G,
841
+ type: "textarea",
842
+ rows: 2
843
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])) : ne("", !0),
844
+ I.inputType === "radio" ? (o(), q(Ye, {
845
+ key: 4,
846
+ modelValue: R.value[I.mappedPropKey || I.propKey],
847
+ "onUpdate:modelValue": (G) => R.value[I.mappedPropKey || I.propKey] = G
848
+ }, {
849
+ default: a(() => [
850
+ (o(!0), y(pe, null, ye(I.options, (G) => (o(), q(xe, {
851
+ key: G.value,
852
+ label: G.value
853
+ }, {
854
+ default: a(() => [
855
+ C(Q(G.label), 1)
856
+ ]),
857
+ _: 2
858
+ }, 1032, ["label"]))), 128))
859
+ ]),
860
+ _: 2
861
+ }, 1032, ["modelValue", "onUpdate:modelValue"])) : ne("", !0),
862
+ I.inputType === "textAndUpload" ? (o(), q(We, {
863
+ key: 5,
864
+ class: "upload-demo",
865
+ action: "",
866
+ "http-request": (G) => u(G, I.mappedPropKey || I.propKey),
867
+ "on-remove": (G, Ee) => k(G, Ee, I.mappedPropKey || I.propKey),
868
+ limit: 1,
869
+ "on-exceed": (G, Ee) => ee(G, Ee, I.mappedPropKey || I.propKey),
870
+ "file-list": V(I.mappedPropKey || I.propKey),
871
+ "show-file-list": !0
872
+ }, {
873
+ tip: a(() => [...l[8] || (l[8] = [
874
+ r("div", { class: "el-upload__tip" }, "只能上传一个文件", -1)
875
+ ])]),
876
+ default: a(() => [
877
+ e(Ke, {
878
+ size: "small",
879
+ type: "primary"
880
+ }, {
881
+ default: a(() => [...l[7] || (l[7] = [
882
+ C("点击上传", -1)
883
+ ])]),
884
+ _: 1
885
+ })
886
+ ]),
887
+ _: 1
888
+ }, 8, ["http-request", "on-remove", "on-exceed", "file-list"])) : ne("", !0),
889
+ I.inputType === "select" ? (o(), q(Ge, {
890
+ key: 6,
891
+ modelValue: R.value[I.mappedPropKey || I.propKey],
892
+ "onUpdate:modelValue": (G) => R.value[I.mappedPropKey || I.propKey] = G,
893
+ placeholder: "请选择"
894
+ }, {
895
+ default: a(() => [
896
+ (o(!0), y(pe, null, ye(I.options, (G) => (o(), q(Je, {
897
+ key: G.id,
898
+ label: G.label,
899
+ value: G.value
900
+ }, null, 8, ["label", "value"]))), 128))
901
+ ]),
902
+ _: 2
903
+ }, 1032, ["modelValue", "onUpdate:modelValue"])) : ne("", !0)
904
+ ]),
905
+ _: 2
906
+ }, 1032, ["label", "prop"]))), 128))
907
+ ]),
908
+ _: 1
909
+ }, 8, ["rules", "model"])
910
+ ])) : ne("", !0)
911
+ ]),
912
+ r("div", ga, [
913
+ w.value === 1 ? (o(), y("div", ya, [
914
+ e(Ke, {
915
+ type: "primary",
916
+ onClick: M
917
+ }, {
918
+ default: a(() => [...l[11] || (l[11] = [
919
+ C("下一步", -1)
920
+ ])]),
921
+ _: 1
922
+ })
923
+ ])) : ne("", !0),
924
+ w.value === 2 ? (o(), y("div", _a, [
925
+ e(Ke, {
926
+ class: "plainButton",
927
+ onClick: ce
928
+ }, {
929
+ default: a(() => [...l[12] || (l[12] = [
930
+ C("上一步", -1)
931
+ ])]),
932
+ _: 1
933
+ }),
934
+ e(Ke, { onClick: W }, {
935
+ default: a(() => [...l[13] || (l[13] = [
936
+ C("测试连接", -1)
937
+ ])]),
938
+ _: 1
939
+ }),
940
+ e(Ke, {
941
+ type: "primary",
942
+ onClick: l[4] || (l[4] = (I) => he(!1))
943
+ }, {
944
+ default: a(() => [...l[14] || (l[14] = [
945
+ C("保存", -1)
946
+ ])]),
947
+ _: 1
948
+ }),
949
+ e(Ke, {
950
+ type: "primary",
951
+ onClick: l[5] || (l[5] = (I) => he(!0))
952
+ }, {
953
+ default: a(() => [...l[15] || (l[15] = [
954
+ C("保存并同步元数据", -1)
955
+ ])]),
956
+ _: 1
957
+ })
958
+ ])) : ne("", !0)
959
+ ])
960
+ ])
961
+ ]),
962
+ _: 1
963
+ }, 8, ["modelValue", "title"]);
964
+ };
965
+ }
966
+ }, ha = /* @__PURE__ */ Oe(ba, [["__scopeId", "data-v-ade2dbcd"]]), Ia = { class: "addDivPosition" }, wa = { class: "addContent" }, xa = {
967
+ __name: "updateDataSource",
968
+ props: {
969
+ changeType: {
970
+ type: String,
971
+ default: ""
972
+ },
973
+ title: {
974
+ type: String,
975
+ default: "编辑元数据信息"
976
+ },
977
+ baseData: {
978
+ type: Object,
979
+ default: () => ({})
980
+ },
981
+ dialogVisible: {
982
+ type: Boolean,
983
+ default: !1
984
+ }
985
+ },
986
+ emits: ["update:dialogVisible", "refresh"],
987
+ setup(i, { emit: P }) {
988
+ const x = i, j = P, m = c(null), D = c(null), T = Te({
989
+ datasourceName: "",
990
+ isPublic: "NO",
991
+ isDisabled: "NO",
992
+ driverId: "",
993
+ description: "",
994
+ cfgList: []
995
+ }), w = Te({}), B = Te({
996
+ datasourceName: [{ required: !0, message: "请输入数据源名称", trigger: "blur" }],
997
+ isPublic: [{ required: !0, message: "请选择", trigger: "change" }],
998
+ isDisabled: [{ required: !0, message: "请选择", trigger: "change" }],
999
+ driverId: [{ required: !0, message: "请选择数据源驱动", trigger: "blur" }]
1000
+ }), le = Te({}), Y = c([]), X = c([]), N = c([]), U = Te({}), oe = Te({}), re = c("admin"), R = c(""), me = (V) => {
1001
+ Object.keys(V).forEach((u) => {
1002
+ delete V[u];
1003
+ });
1004
+ }, ue = (V) => V.replace(/\./g, "_"), _e = async (V) => {
1005
+ try {
1006
+ const u = await ot(V);
1007
+ u.code === 0 ? u.data.length > 0 && (X.value = u.data) : z.error("获取数据源驱动信息失败");
1008
+ } catch (u) {
1009
+ console.error("获取驱动信息失败:", u), z.error("获取数据源驱动信息失败");
1010
+ }
1011
+ }, de = async (V, u = [], k = {}) => {
1012
+ var ee;
1013
+ try {
1014
+ const ie = await rt(V);
1015
+ ie.code === 0 && (Y.value = ie.data.map((M) => ({
1016
+ ...M,
1017
+ mappedPropKey: ue(M.propKey)
1018
+ })), N.value = [], me(le), me(U), me(oe), Y.value.forEach((M) => {
1019
+ if (M.options)
1020
+ try {
1021
+ M.options = JSON.parse(M.options);
1022
+ } catch (W) {
1023
+ console.error("解析配置项 options 失败:", W), M.options = [];
1024
+ }
1025
+ M.required === "YES" && (le[M.mappedPropKey] = [{
1026
+ required: !0,
1027
+ message: "必填项,请填写" + M.label,
1028
+ trigger: "change"
1029
+ }]);
1030
+ const ce = u.find((W) => W.propKey === M.propKey);
1031
+ let v = ce ? ce.propValue : M.defaultValue || "";
1032
+ if (v && typeof v == "string" && v.includes("/metadata/uploadFile/read/") && (v = v.split("/").pop()), w[M.mappedPropKey] = v, N.value.push({
1033
+ scope: M.scope,
1034
+ propKey: M.propKey,
1035
+ mappedPropKey: M.mappedPropKey,
1036
+ propValue: v,
1037
+ valueType: "String",
1038
+ description: M.label
1039
+ }), v && (oe[M.mappedPropKey] = v), M.inputType === "textAndUpload") {
1040
+ const W = k[M.propKey];
1041
+ U[M.mappedPropKey] = [], W && W.id === v && (U[M.mappedPropKey] = [{ name: W.origName, url: "" }]);
1042
+ }
1043
+ }), await Ce(), (ee = D.value) == null || ee.clearValidate());
1044
+ } catch (ie) {
1045
+ console.error("获取配置模板失败:", ie), z.error("获取配置模板失败");
1046
+ }
1047
+ };
1048
+ Ue(() => x.baseData, async (V) => {
1049
+ if (V && Object.keys(V).length > 0) {
1050
+ R.value = V.id || "", Object.assign(T, {
1051
+ datasourceName: V.datasourceName || "",
1052
+ isPublic: V.isPublic || "NO",
1053
+ isDisabled: V.isDisabled || "NO",
1054
+ driverId: V.driverId || "",
1055
+ description: V.description || "",
1056
+ cfgList: V.cfgList || []
1057
+ }), Object.keys(w).forEach((k) => {
1058
+ delete w[k];
1059
+ });
1060
+ const u = V.datasourceType;
1061
+ if (!u)
1062
+ return;
1063
+ await _e(u), await de(u, V.cfgList || [], V.fileMap || {});
1064
+ }
1065
+ }, { immediate: !0, deep: !0 });
1066
+ const Z = () => {
1067
+ }, F = () => {
1068
+ j("update:dialogVisible", !1);
1069
+ }, ae = async (V) => {
1070
+ if (!V.value)
1071
+ return !1;
1072
+ try {
1073
+ return await V.value.validate(), !0;
1074
+ } catch {
1075
+ return !1;
1076
+ }
1077
+ }, ve = async () => {
1078
+ if (!await ae(m))
1079
+ return z.warning("请填写必填信息"), !1;
1080
+ if (!await ae(D))
1081
+ return z.warning("请填写必填信息"), !1;
1082
+ const k = {
1083
+ ...x.baseData,
1084
+ ...T
1085
+ };
1086
+ return k.cfgList = N.value.map((ee) => {
1087
+ const { mappedPropKey: ie, ...M } = ee;
1088
+ return {
1089
+ ...M,
1090
+ propValue: w[ie] || ""
1091
+ };
1092
+ }), k;
1093
+ }, ge = (V) => U[V] || [], be = async (V, u) => {
1094
+ const k = V.file;
1095
+ if (!k)
1096
+ return;
1097
+ const ee = u.mappedPropKey, ie = u.propKey, M = oe[ee] || "", ce = new FormData();
1098
+ ce.append("file", k), ce.append("assocId", R.value), ce.append("assocType", "config"), ce.append("uploadedBy", re.value), ce.append("remarks", ie), ce.append("oldFileId", M);
1099
+ try {
1100
+ const v = await Ct(ce);
1101
+ if (v.code === 0) {
1102
+ const W = v.data;
1103
+ w[ee] = W, U[ee] = [{ name: k.name, url: "" }], oe[ee] || (oe[ee] = W);
1104
+ const he = N.value.find((O) => O.propKey === u.propKey);
1105
+ he && (he.propValue = W), z.success("文件上传成功");
1106
+ } else
1107
+ z.error("文件上传失败");
1108
+ } catch (v) {
1109
+ console.error("文件上传失败:", v), z.error("文件上传失败");
1110
+ }
1111
+ }, L = (V, u, k) => {
1112
+ const ee = k.mappedPropKey;
1113
+ w[ee] = "", U[ee] = u;
1114
+ const ie = N.value.find((M) => M.propKey === k.propKey);
1115
+ ie && (ie.propValue = ""), z.success("文件已移除");
1116
+ }, n = (V, u) => {
1117
+ z.warning(`当前限制选择 1 个文件,本次选择了 ${V.length} 个文件,共选择了 ${V.length + u.length} 个文件`);
1118
+ }, p = async () => {
1119
+ const V = await ve();
1120
+ if (!V)
1121
+ return;
1122
+ const u = Fe.service({
1123
+ lock: !0,
1124
+ text: "保存中...",
1125
+ spinner: "el-icon-loading",
1126
+ background: "rgba(235 235 235 / 70%)"
1127
+ });
1128
+ try {
1129
+ const k = await $t(V);
1130
+ u.close(), k.code === 0 ? (z.success("保存成功"), j("refresh"), j("update:dialogVisible", !1)) : z.error("保存失败:" + (k.msg || k.message));
1131
+ } catch (k) {
1132
+ console.error("保存失败:", k), u.close(), z.error("保存失败:" + (k.message || "未知错误"));
1133
+ }
1134
+ }, J = async () => {
1135
+ const V = await ve();
1136
+ if (!V)
1137
+ return;
1138
+ const u = Fe.service({
1139
+ lock: !0,
1140
+ text: "测试连接中...",
1141
+ spinner: "el-icon-loading",
1142
+ background: "rgba(235 235 235 / 70%)"
1143
+ });
1144
+ try {
1145
+ const k = await Tt(V);
1146
+ k.code === 0 ? z.success("连接成功") : z.error("连接失败:" + (k.msg || "未知错误"));
1147
+ } catch (k) {
1148
+ console.error("测试连接失败:", k), z.error("连接失败:" + (k.message || "未知错误"));
1149
+ } finally {
1150
+ u.close();
1151
+ }
1152
+ };
1153
+ return (V, u) => {
1154
+ const k = f("el-input"), ee = f("el-form-item"), ie = f("el-radio"), M = f("el-option"), ce = f("el-select"), v = f("el-form"), W = f("el-button"), he = f("el-upload"), O = f("el-dialog");
1155
+ return o(), q(O, {
1156
+ title: i.title,
1157
+ modelValue: x.dialogVisible,
1158
+ "onUpdate:modelValue": u[9] || (u[9] = (l) => x.dialogVisible = l),
1159
+ width: "800px",
1160
+ top: "10vh",
1161
+ "before-close": F,
1162
+ class: "full-dialog"
1163
+ }, {
1164
+ footer: a(() => [
1165
+ e(W, { onClick: J }, {
1166
+ default: a(() => [...u[18] || (u[18] = [
1167
+ C("测试连接", -1)
1168
+ ])]),
1169
+ _: 1
1170
+ }),
1171
+ e(W, { onClick: F }, {
1172
+ default: a(() => [...u[19] || (u[19] = [
1173
+ C("取 消", -1)
1174
+ ])]),
1175
+ _: 1
1176
+ }),
1177
+ e(W, {
1178
+ type: "primary",
1179
+ onClick: p
1180
+ }, {
1181
+ default: a(() => [...u[20] || (u[20] = [
1182
+ C("确 定", -1)
1183
+ ])]),
1184
+ _: 1
1185
+ })
1186
+ ]),
1187
+ default: a(() => [
1188
+ r("div", Ia, [
1189
+ r("div", wa, [
1190
+ u[16] || (u[16] = r("div", { class: "title_line" }, "数据源信息", -1)),
1191
+ e(v, {
1192
+ ref_key: "f1Ref",
1193
+ ref: m,
1194
+ key: "f1",
1195
+ rules: B,
1196
+ "label-position": "left",
1197
+ "label-width": "120px",
1198
+ style: { "max-width": "700px" },
1199
+ model: T,
1200
+ onSubmit: u[7] || (u[7] = $e(() => {
1201
+ }, ["prevent"]))
1202
+ }, {
1203
+ default: a(() => [
1204
+ e(ee, {
1205
+ label: "数据源名称",
1206
+ prop: "datasourceName"
1207
+ }, {
1208
+ default: a(() => [
1209
+ e(k, {
1210
+ modelValue: T.datasourceName,
1211
+ "onUpdate:modelValue": u[0] || (u[0] = (l) => T.datasourceName = l),
1212
+ placeholder: "请输入数据源名称"
1213
+ }, null, 8, ["modelValue"])
1214
+ ]),
1215
+ _: 1
1216
+ }),
1217
+ e(ee, {
1218
+ label: "是否禁用",
1219
+ prop: "isDisabled"
1220
+ }, {
1221
+ default: a(() => [
1222
+ e(ie, {
1223
+ modelValue: T.isDisabled,
1224
+ "onUpdate:modelValue": u[1] || (u[1] = (l) => T.isDisabled = l),
1225
+ label: "YES"
1226
+ }, {
1227
+ default: a(() => [...u[10] || (u[10] = [
1228
+ C("是", -1)
1229
+ ])]),
1230
+ _: 1
1231
+ }, 8, ["modelValue"]),
1232
+ e(ie, {
1233
+ modelValue: T.isDisabled,
1234
+ "onUpdate:modelValue": u[2] || (u[2] = (l) => T.isDisabled = l),
1235
+ label: "NO"
1236
+ }, {
1237
+ default: a(() => [...u[11] || (u[11] = [
1238
+ C("否", -1)
1239
+ ])]),
1240
+ _: 1
1241
+ }, 8, ["modelValue"])
1242
+ ]),
1243
+ _: 1
1244
+ }),
1245
+ e(ee, {
1246
+ label: "是否公开",
1247
+ prop: "isPublic"
1248
+ }, {
1249
+ default: a(() => [
1250
+ e(ie, {
1251
+ modelValue: T.isPublic,
1252
+ "onUpdate:modelValue": u[3] || (u[3] = (l) => T.isPublic = l),
1253
+ label: "YES"
1254
+ }, {
1255
+ default: a(() => [...u[12] || (u[12] = [
1256
+ C("是", -1)
1257
+ ])]),
1258
+ _: 1
1259
+ }, 8, ["modelValue"]),
1260
+ e(ie, {
1261
+ modelValue: T.isPublic,
1262
+ "onUpdate:modelValue": u[4] || (u[4] = (l) => T.isPublic = l),
1263
+ label: "NO"
1264
+ }, {
1265
+ default: a(() => [...u[13] || (u[13] = [
1266
+ C("否", -1)
1267
+ ])]),
1268
+ _: 1
1269
+ }, 8, ["modelValue"])
1270
+ ]),
1271
+ _: 1
1272
+ }),
1273
+ e(ee, {
1274
+ label: "数据源驱动",
1275
+ prop: "driverId"
1276
+ }, {
1277
+ default: a(() => [
1278
+ e(ce, {
1279
+ modelValue: T.driverId,
1280
+ "onUpdate:modelValue": u[5] || (u[5] = (l) => T.driverId = l),
1281
+ placeholder: "请选择数据源驱动",
1282
+ onChange: Z
1283
+ }, {
1284
+ default: a(() => [
1285
+ (o(!0), y(pe, null, ye(X.value, (l) => (o(), q(M, {
1286
+ key: l.id,
1287
+ label: l.driverName,
1288
+ value: l.id
1289
+ }, null, 8, ["label", "value"]))), 128))
1290
+ ]),
1291
+ _: 1
1292
+ }, 8, ["modelValue"])
1293
+ ]),
1294
+ _: 1
1295
+ }),
1296
+ e(ee, {
1297
+ label: "数据源描述",
1298
+ prop: "description"
1299
+ }, {
1300
+ default: a(() => [
1301
+ e(k, {
1302
+ modelValue: T.description,
1303
+ "onUpdate:modelValue": u[6] || (u[6] = (l) => T.description = l),
1304
+ type: "textarea",
1305
+ rows: 2
1306
+ }, null, 8, ["modelValue"])
1307
+ ]),
1308
+ _: 1
1309
+ })
1310
+ ]),
1311
+ _: 1
1312
+ }, 8, ["rules", "model"]),
1313
+ u[17] || (u[17] = r("div", { class: "title_line" }, "连接信息", -1)),
1314
+ e(v, {
1315
+ ref_key: "f2Ref",
1316
+ ref: D,
1317
+ key: "f2",
1318
+ rules: le,
1319
+ "label-position": "left",
1320
+ "label-width": "200px",
1321
+ style: { "max-width": "700px", "padding-bottom": "15px" },
1322
+ model: w,
1323
+ onSubmit: u[8] || (u[8] = $e(() => {
1324
+ }, ["prevent"]))
1325
+ }, {
1326
+ default: a(() => [
1327
+ (o(!0), y(pe, null, ye(Y.value, (l) => (o(), q(ee, {
1328
+ key: l.propKey,
1329
+ label: l.label,
1330
+ prop: l.mappedPropKey
1331
+ }, {
1332
+ default: a(() => [
1333
+ l.inputType === "text" ? (o(), q(k, {
1334
+ key: 0,
1335
+ modelValue: w[l.mappedPropKey],
1336
+ "onUpdate:modelValue": (S) => w[l.mappedPropKey] = S
1337
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])) : ne("", !0),
1338
+ l.inputType === "password" ? (o(), q(k, {
1339
+ key: 1,
1340
+ modelValue: w[l.mappedPropKey],
1341
+ "onUpdate:modelValue": (S) => w[l.mappedPropKey] = S,
1342
+ type: "password"
1343
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])) : ne("", !0),
1344
+ l.inputType === "number" ? (o(), q(k, {
1345
+ key: 2,
1346
+ modelValue: w[l.mappedPropKey],
1347
+ "onUpdate:modelValue": (S) => w[l.mappedPropKey] = S,
1348
+ type: "number"
1349
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])) : ne("", !0),
1350
+ l.inputType === "textarea" ? (o(), q(k, {
1351
+ key: 3,
1352
+ modelValue: w[l.mappedPropKey],
1353
+ "onUpdate:modelValue": (S) => w[l.mappedPropKey] = S,
1354
+ type: "textarea",
1355
+ rows: 2
1356
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])) : ne("", !0),
1357
+ l.inputType === "radio" ? (o(!0), y(pe, { key: 4 }, ye(l.options, (S) => (o(), q(ie, {
1358
+ key: S.value,
1359
+ modelValue: w[l.mappedPropKey],
1360
+ "onUpdate:modelValue": (h) => w[l.mappedPropKey] = h,
1361
+ label: S.value
1362
+ }, {
1363
+ default: a(() => [
1364
+ C(Q(S.label), 1)
1365
+ ]),
1366
+ _: 2
1367
+ }, 1032, ["modelValue", "onUpdate:modelValue", "label"]))), 128)) : ne("", !0),
1368
+ l.inputType === "textAndUpload" ? (o(), q(he, {
1369
+ key: 5,
1370
+ class: "upload-demo",
1371
+ action: "",
1372
+ "http-request": (S) => be(S, l),
1373
+ "on-remove": (S, h) => L(S, h, l),
1374
+ limit: 1,
1375
+ "on-exceed": n,
1376
+ "file-list": ge(l.mappedPropKey),
1377
+ "show-file-list": !0
1378
+ }, {
1379
+ tip: a(() => [...u[15] || (u[15] = [
1380
+ r("div", { class: "el-upload__tip" }, "只能上传一个文件", -1)
1381
+ ])]),
1382
+ default: a(() => [
1383
+ e(W, {
1384
+ size: "small",
1385
+ type: "primary"
1386
+ }, {
1387
+ default: a(() => [...u[14] || (u[14] = [
1388
+ C("点击上传", -1)
1389
+ ])]),
1390
+ _: 1
1391
+ })
1392
+ ]),
1393
+ _: 1
1394
+ }, 8, ["http-request", "on-remove", "file-list"])) : ne("", !0),
1395
+ l.inputType === "select" ? (o(), q(ce, {
1396
+ key: 6,
1397
+ modelValue: w[l.mappedPropKey],
1398
+ "onUpdate:modelValue": (S) => w[l.mappedPropKey] = S,
1399
+ placeholder: "请选择",
1400
+ onChange: Z
1401
+ }, {
1402
+ default: a(() => [
1403
+ (o(!0), y(pe, null, ye(l.options, (S) => (o(), q(M, {
1404
+ key: S.id,
1405
+ label: S.label,
1406
+ value: S.value
1407
+ }, null, 8, ["label", "value"]))), 128))
1408
+ ]),
1409
+ _: 2
1410
+ }, 1032, ["modelValue", "onUpdate:modelValue"])) : ne("", !0)
1411
+ ]),
1412
+ _: 2
1413
+ }, 1032, ["label", "prop"]))), 128))
1414
+ ]),
1415
+ _: 1
1416
+ }, 8, ["rules", "model"])
1417
+ ])
1418
+ ])
1419
+ ]),
1420
+ _: 1
1421
+ }, 8, ["title", "modelValue"]);
1422
+ };
1423
+ }
1424
+ }, Va = /* @__PURE__ */ Oe(xa, [["__scopeId", "data-v-3e514c25"]]), ka = { class: "filter-section" }, Sa = { class: "table-section" }, Ta = { class: "dialog-footer" }, $a = {
1425
+ __name: "addTableOrView",
1426
+ props: {
1427
+ visible: {
1428
+ type: Boolean,
1429
+ default: !1
1430
+ },
1431
+ dataSourceInfo: {
1432
+ type: Object,
1433
+ default: () => ({})
1434
+ }
1435
+ },
1436
+ emits: ["update:visible", "success"],
1437
+ setup(i, { emit: P }) {
1438
+ const x = i, j = P, m = c(!1), D = c(!1), T = c(null), w = c(!1), B = Te({
1439
+ schemaNames: [],
1440
+ datasetType: "",
1441
+ commentEmpty: !1,
1442
+ tableName: "",
1443
+ tableComment: ""
1444
+ }), le = c([]), Y = c([]), X = c([]), N = c([]), U = c(1), oe = c(10), re = c(!1);
1445
+ ze(() => N.value.length), Ue(() => x.visible, (n) => {
1446
+ console.log("addTableOrView visible changed to:", n), m.value = n, n && R();
1447
+ }, { immediate: !0 }), Ue(m, (n) => {
1448
+ j("update:visible", n);
17
1449
  });
1450
+ const R = async () => {
1451
+ console.log("initDialog called with dataSourceInfo:", x.dataSourceInfo), x.dataSourceInfo && x.dataSourceInfo.id ? await me() : console.log("No valid dataSourceInfo, skipping loadTableData");
1452
+ }, me = async () => {
1453
+ D.value = !0, Y.value = [], X.value = [];
1454
+ try {
1455
+ const n = await Xs(x.dataSourceInfo.id);
1456
+ n.code === 0 && (Y.value = n.data || [], X.value = [...Y.value], ue());
1457
+ } catch (n) {
1458
+ console.error("加载表格数据失败:", n);
1459
+ } finally {
1460
+ D.value = !1;
1461
+ }
1462
+ }, ue = () => {
1463
+ const n = /* @__PURE__ */ new Set();
1464
+ Y.value.forEach((p) => {
1465
+ p.schemaName && n.add(p.schemaName);
1466
+ }), le.value = Array.from(n).map((p) => ({
1467
+ label: p,
1468
+ value: p
1469
+ }));
1470
+ }, _e = () => {
1471
+ let n = [...Y.value];
1472
+ if (B.schemaNames.length > 0 && (n = n.filter(
1473
+ (p) => B.schemaNames.includes(p.schemaName)
1474
+ )), B.datasetType && (n = n.filter(
1475
+ (p) => p.tableType === B.datasetType
1476
+ )), B.tableName) {
1477
+ const p = B.tableName.toLowerCase();
1478
+ n = n.filter(
1479
+ (J) => J.tableName && J.tableName.toLowerCase().includes(p)
1480
+ );
1481
+ }
1482
+ if (B.tableComment) {
1483
+ const p = B.tableComment.toLowerCase();
1484
+ n = n.filter(
1485
+ (J) => J.tableComment && J.tableComment.toLowerCase().includes(p)
1486
+ );
1487
+ }
1488
+ B.commentEmpty && (n = n.filter(
1489
+ (p) => !p.tableComment || p.tableComment.trim() === ""
1490
+ )), X.value = n;
1491
+ }, de = () => {
1492
+ _e();
1493
+ }, Z = () => {
1494
+ Object.assign(B, {
1495
+ schemaNames: [],
1496
+ datasetType: "",
1497
+ commentEmpty: !1,
1498
+ tableName: "",
1499
+ tableComment: ""
1500
+ }), _e();
1501
+ }, F = (n) => {
1502
+ N.value = n;
1503
+ }, ae = async (n) => {
1504
+ if (N.value.length === 0) {
1505
+ z.warning("请选择要添加的表或视图");
1506
+ return;
1507
+ }
1508
+ w.value = !0;
1509
+ const p = {};
1510
+ N.value.forEach((J) => {
1511
+ p[J.schemaName] || (p[J.schemaName] = []), p[J.schemaName].push(J.tableName);
1512
+ });
1513
+ try {
1514
+ const J = {
1515
+ datasourceId: x.dataSourceInfo.id,
1516
+ datasetGroup: p,
1517
+ statistic: n
1518
+ }, V = await Zs(J);
1519
+ w.value = !1, V.code === 0 ? (z.success(`成功添加 ${N.value.length} 个表/视图`), j("success"), ve()) : z.error(V.message || "保存失败");
1520
+ } catch (J) {
1521
+ console.error("保存失败:", J), z.error("保存失败");
1522
+ }
1523
+ }, ve = () => {
1524
+ m.value = !1, N.value = [], Object.assign(B, {
1525
+ schemaNames: [],
1526
+ datasetType: "",
1527
+ commentEmpty: !1,
1528
+ tableName: "",
1529
+ tableComment: ""
1530
+ });
1531
+ }, ge = ze(() => {
1532
+ const n = (U.value - 1) * oe.value, p = n + oe.value;
1533
+ return X.value.slice(n, p);
1534
+ }), be = (n) => {
1535
+ U.value = n;
1536
+ }, L = (n) => {
1537
+ re.value = n, n ? (N.value = [], X.value.forEach((p) => {
1538
+ p.tableName !== void 0 && N.value.push(p);
1539
+ })) : N.value = [];
1540
+ };
1541
+ return (n, p) => {
1542
+ const J = f("el-option"), V = f("el-select"), u = f("el-form-item"), k = f("el-col"), ee = f("el-input"), ie = f("el-row"), M = f("el-checkbox"), ce = f("el-button"), v = f("el-form"), W = f("el-table-column"), he = f("el-tag"), O = f("el-table"), l = f("el-pagination"), S = f("el-dialog"), h = St("loading");
1543
+ return o(), q(S, {
1544
+ title: "添加表/视图",
1545
+ modelValue: m.value,
1546
+ "onUpdate:modelValue": p[9] || (p[9] = (E) => m.value = E),
1547
+ width: "60%",
1548
+ top: "10vh",
1549
+ "before-close": ve,
1550
+ "destroy-on-close": !0,
1551
+ class: "add-table-or-view-dialog"
1552
+ }, {
1553
+ footer: a(() => [
1554
+ r("div", Ta, [
1555
+ r("div", {
1556
+ class: "custom-button cancel-btn",
1557
+ onClick: ve
1558
+ }, "取消"),
1559
+ De((o(), y("div", {
1560
+ class: ke(["custom-button primary-btn", { disabled: N.value.length === 0 }]),
1561
+ onClick: p[7] || (p[7] = (E) => N.value.length > 0 && ae(!1))
1562
+ }, [
1563
+ C(" 添加选择资源 (" + Q(N.value.length) + ") ", 1)
1564
+ ], 2)), [
1565
+ [h, w.value]
1566
+ ]),
1567
+ De((o(), y("div", {
1568
+ class: ke(["custom-button primary-btn", { disabled: N.value.length === 0 }]),
1569
+ onClick: p[8] || (p[8] = (E) => N.value.length > 0 && ae(!0))
1570
+ }, [
1571
+ C(" 添加选择资源并更新统计信息 (" + Q(N.value.length) + ") ", 1)
1572
+ ], 2)), [
1573
+ [h, w.value]
1574
+ ])
1575
+ ])
1576
+ ]),
1577
+ default: a(() => [
1578
+ r("div", ka, [
1579
+ e(v, {
1580
+ model: B,
1581
+ "label-width": "100px"
1582
+ }, {
1583
+ default: a(() => [
1584
+ e(ie, { gutter: 20 }, {
1585
+ default: a(() => [
1586
+ e(k, { span: 8 }, {
1587
+ default: a(() => [
1588
+ e(u, { label: "模式名" }, {
1589
+ default: a(() => [
1590
+ e(V, {
1591
+ modelValue: B.schemaNames,
1592
+ "onUpdate:modelValue": p[0] || (p[0] = (E) => B.schemaNames = E),
1593
+ multiple: "",
1594
+ placeholder: "请选择模式名",
1595
+ style: { width: "100%" },
1596
+ clearable: ""
1597
+ }, {
1598
+ default: a(() => [
1599
+ (o(!0), y(pe, null, ye(le.value, (E) => (o(), q(J, {
1600
+ key: E.value,
1601
+ label: E.label,
1602
+ value: E.value
1603
+ }, null, 8, ["label", "value"]))), 128))
1604
+ ]),
1605
+ _: 1
1606
+ }, 8, ["modelValue"])
1607
+ ]),
1608
+ _: 1
1609
+ })
1610
+ ]),
1611
+ _: 1
1612
+ }),
1613
+ e(k, { span: 8 }, {
1614
+ default: a(() => [
1615
+ e(u, { label: "数据集类型" }, {
1616
+ default: a(() => [
1617
+ e(V, {
1618
+ modelValue: B.datasetType,
1619
+ "onUpdate:modelValue": p[1] || (p[1] = (E) => B.datasetType = E),
1620
+ placeholder: "请选择数据集类型",
1621
+ style: { width: "100%" },
1622
+ clearable: ""
1623
+ }, {
1624
+ default: a(() => [
1625
+ e(J, {
1626
+ label: "表",
1627
+ value: "TABLE"
1628
+ }),
1629
+ e(J, {
1630
+ label: "视图",
1631
+ value: "VIEW"
1632
+ })
1633
+ ]),
1634
+ _: 1
1635
+ }, 8, ["modelValue"])
1636
+ ]),
1637
+ _: 1
1638
+ })
1639
+ ]),
1640
+ _: 1
1641
+ }),
1642
+ e(k, { span: 8 }, {
1643
+ default: a(() => [
1644
+ e(u, { label: "数据表名称" }, {
1645
+ default: a(() => [
1646
+ e(ee, {
1647
+ modelValue: B.tableName,
1648
+ "onUpdate:modelValue": p[2] || (p[2] = (E) => B.tableName = E),
1649
+ placeholder: "请输入数据表名称",
1650
+ style: { width: "100%" },
1651
+ clearable: ""
1652
+ }, null, 8, ["modelValue"])
1653
+ ]),
1654
+ _: 1
1655
+ })
1656
+ ]),
1657
+ _: 1
1658
+ })
1659
+ ]),
1660
+ _: 1
1661
+ }),
1662
+ e(ie, { gutter: 20 }, {
1663
+ default: a(() => [
1664
+ e(k, { span: 8 }, {
1665
+ default: a(() => [
1666
+ e(u, { label: "数据表注释" }, {
1667
+ default: a(() => [
1668
+ e(ee, {
1669
+ modelValue: B.tableComment,
1670
+ "onUpdate:modelValue": p[3] || (p[3] = (E) => B.tableComment = E),
1671
+ placeholder: "请输入数据表注释",
1672
+ style: { width: "100%" },
1673
+ clearable: ""
1674
+ }, null, 8, ["modelValue"])
1675
+ ]),
1676
+ _: 1
1677
+ })
1678
+ ]),
1679
+ _: 1
1680
+ }),
1681
+ e(k, { span: 8 }, {
1682
+ default: a(() => [
1683
+ e(u, { label: "注释是否为空" }, {
1684
+ default: a(() => [
1685
+ e(M, {
1686
+ modelValue: B.commentEmpty,
1687
+ "onUpdate:modelValue": p[4] || (p[4] = (E) => B.commentEmpty = E)
1688
+ }, {
1689
+ default: a(() => [...p[10] || (p[10] = [
1690
+ C("注释为空", -1)
1691
+ ])]),
1692
+ _: 1
1693
+ }, 8, ["modelValue"])
1694
+ ]),
1695
+ _: 1
1696
+ })
1697
+ ]),
1698
+ _: 1
1699
+ }),
1700
+ e(k, {
1701
+ span: 8,
1702
+ style: { "text-align": "right" }
1703
+ }, {
1704
+ default: a(() => [
1705
+ e(u, null, {
1706
+ default: a(() => [
1707
+ e(ce, {
1708
+ type: "primary",
1709
+ onClick: de
1710
+ }, {
1711
+ default: a(() => [...p[11] || (p[11] = [
1712
+ C("查询", -1)
1713
+ ])]),
1714
+ _: 1
1715
+ }),
1716
+ e(ce, { onClick: Z }, {
1717
+ default: a(() => [...p[12] || (p[12] = [
1718
+ C("重置", -1)
1719
+ ])]),
1720
+ _: 1
1721
+ })
1722
+ ]),
1723
+ _: 1
1724
+ })
1725
+ ]),
1726
+ _: 1
1727
+ })
1728
+ ]),
1729
+ _: 1
1730
+ })
1731
+ ]),
1732
+ _: 1
1733
+ }, 8, ["model"])
1734
+ ]),
1735
+ r("div", Sa, [
1736
+ e(M, {
1737
+ modelValue: re.value,
1738
+ "onUpdate:modelValue": p[5] || (p[5] = (E) => re.value = E),
1739
+ onChange: L,
1740
+ style: { "margin-bottom": "10px" }
1741
+ }, {
1742
+ default: a(() => [
1743
+ C(" 全选 (显示所有 " + Q(X.value.length) + " 条记录) ", 1)
1744
+ ]),
1745
+ _: 1
1746
+ }, 8, ["modelValue"]),
1747
+ De((o(), q(O, {
1748
+ ref_key: "tableRef",
1749
+ ref: T,
1750
+ data: ge.value,
1751
+ height: "400",
1752
+ onSelectionChange: F
1753
+ }, {
1754
+ default: a(() => [
1755
+ e(W, {
1756
+ type: "selection",
1757
+ width: "55"
1758
+ }),
1759
+ e(W, {
1760
+ prop: "tableName",
1761
+ label: "表名",
1762
+ width: "300"
1763
+ }),
1764
+ e(W, {
1765
+ prop: "schemaName",
1766
+ label: "模式名",
1767
+ width: "200"
1768
+ }),
1769
+ e(W, {
1770
+ prop: "tableType",
1771
+ label: "类型",
1772
+ width: "150"
1773
+ }, {
1774
+ default: a((E) => [
1775
+ e(he, {
1776
+ type: E.row.tableType === "TABLE" ? "primary" : "success"
1777
+ }, {
1778
+ default: a(() => [
1779
+ C(Q(E.row.tableType === "TABLE" ? "表" : "视图"), 1)
1780
+ ]),
1781
+ _: 2
1782
+ }, 1032, ["type"])
1783
+ ]),
1784
+ _: 1
1785
+ }),
1786
+ e(W, {
1787
+ prop: "tableComment",
1788
+ label: "表注释",
1789
+ "min-width": "200",
1790
+ "show-overflow-tooltip": ""
1791
+ })
1792
+ ]),
1793
+ _: 1
1794
+ }, 8, ["data"])), [
1795
+ [h, D.value]
1796
+ ]),
1797
+ e(l, {
1798
+ background: "",
1799
+ layout: "prev, pager, next, jumper, ->, total",
1800
+ total: X.value.length,
1801
+ "page-size": oe.value,
1802
+ "current-page": U.value,
1803
+ "onUpdate:currentPage": p[6] || (p[6] = (E) => U.value = E),
1804
+ onCurrentChange: be,
1805
+ style: { "margin-top": "10px", "text-align": "center" }
1806
+ }, null, 8, ["total", "page-size", "current-page"])
1807
+ ])
1808
+ ]),
1809
+ _: 1
1810
+ }, 8, ["modelValue"]);
1811
+ };
18
1812
  }
1813
+ }, Ca = /* @__PURE__ */ Oe($a, [["__scopeId", "data-v-58c12c58"]]), Pa = { class: "add-file-set" }, Ka = { class: "form-section" }, Na = { class: "form-section" }, Ua = {
1814
+ key: 0,
1815
+ class: "selected-files"
1816
+ }, Oa = { class: "file-icon" }, Ea = { class: "file-info" }, Ba = { class: "file-name" }, La = { class: "file-path" }, Aa = { class: "file-actions" }, Da = { class: "dialog-footer" }, Fa = { class: "file-system-dialog" }, Ma = { class: "breadcrumb-container" }, Ra = ["onClick"], Ha = { key: 1 }, qa = { class: "file-list-container" }, za = {
1817
+ key: 0,
1818
+ class: "loading-container"
1819
+ }, ja = {
1820
+ key: 1,
1821
+ class: "empty-container"
1822
+ }, Ya = {
1823
+ key: 2,
1824
+ class: "file-list"
1825
+ }, Wa = ["onDblclick"], Ja = { class: "file-name" }, Ga = { class: "file-lastModified" }, Qa = { class: "file-name" }, Xa = { class: "file-lastModified" }, Za = { class: "dialog-footer" }, el = {
1826
+ __name: "addFileSet",
1827
+ props: {
1828
+ visible: {
1829
+ type: Boolean,
1830
+ default: !1
1831
+ },
1832
+ fileTypeDatasourceId: {
1833
+ type: String,
1834
+ default: ""
1835
+ },
1836
+ fileTypeDatasourceSchema: {
1837
+ type: String,
1838
+ default: ""
1839
+ }
1840
+ },
1841
+ emits: ["update:visible", "refresh"],
1842
+ setup(i, { emit: P }) {
1843
+ const x = i, j = P, m = c(!1), D = c(!1), T = c(!1), w = c(""), B = c([]), le = c([]), Y = c([]), X = c([]), N = c(null), U = Te({
1844
+ name: "",
1845
+ chineseName: "",
1846
+ description: ""
1847
+ }), oe = Te({
1848
+ name: [
1849
+ { required: !0, message: "请输入文件集名称", trigger: "blur" }
1850
+ ],
1851
+ chineseName: [
1852
+ { required: !0, message: "请输入文件集中文名称", trigger: "blur" }
1853
+ ]
1854
+ }), re = ze(() => Y.value.length === 0 ? "" : Y.value.length === 1 ? Y.value[0].name : `已选择 ${Y.value.length} 项`);
1855
+ Ue(() => x.visible, (L) => {
1856
+ m.value = L;
1857
+ }, { immediate: !0 }), Ue(m, (L) => {
1858
+ j("update:visible", L);
1859
+ }), Ue(D, (L) => {
1860
+ L && (R(), X.value = [...Y.value]);
1861
+ });
1862
+ const R = async () => {
1863
+ T.value = !0;
1864
+ try {
1865
+ const L = await ea({
1866
+ datasourceId: x.fileTypeDatasourceId,
1867
+ path: w.value
1868
+ });
1869
+ console.log("加载目录数据:", L), L.code === 0 && L.data ? (B.value = L.data, me()) : B.value = [];
1870
+ } catch (L) {
1871
+ console.error("加载目录失败:", L), B.value = [];
1872
+ } finally {
1873
+ T.value = !1;
1874
+ }
1875
+ }, me = () => {
1876
+ if (w.value === "") {
1877
+ le.value = [];
1878
+ return;
1879
+ }
1880
+ const L = w.value.split("/").filter((n) => n !== "");
1881
+ le.value = L.map((n, p) => {
1882
+ const J = "/" + L.slice(0, p + 1).join("/");
1883
+ return {
1884
+ name: n,
1885
+ path: J
1886
+ };
1887
+ });
1888
+ }, ue = (L) => {
1889
+ w.value = L.startsWith("/") ? L : "/" + L, R();
1890
+ }, _e = (L) => {
1891
+ if (!L.isFile) {
1892
+ const n = w.value === "" ? L.name : `${w.value}/${L.name}`;
1893
+ ue(n);
1894
+ }
1895
+ }, de = (L) => X.value.some((n) => n.name === L), Z = (L) => {
1896
+ const n = X.value.findIndex((p) => p.name === L.name);
1897
+ n > -1 ? X.value.splice(n, 1) : X.value.push({
1898
+ name: L.name,
1899
+ path: L.path || `${w.value}/${L.name}`,
1900
+ isFile: L.isFile
1901
+ });
1902
+ }, F = () => {
1903
+ Y.value = [...X.value], D.value = !1;
1904
+ }, ae = () => {
1905
+ m.value = !1, ge();
1906
+ }, ve = () => {
1907
+ N.value.validate(async (L) => {
1908
+ if (L) {
1909
+ console.log("表单数据:", U), console.log("选中的文件:", Y.value), console.log("文件类型数据源ID:", x.fileTypeDatasourceId, x.fileTypeDatasourceSchema);
1910
+ const n = {
1911
+ datasourceId: x.fileTypeDatasourceId,
1912
+ schemaName: x.fileTypeDatasourceSchema,
1913
+ datasetName: U.name,
1914
+ datasetComment: U.chineseName,
1915
+ detailDescription: U.description,
1916
+ cfgList: [
1917
+ {
1918
+ propKey: "filePathList",
1919
+ propValue: JSON.stringify(Y.value.map((J) => J.path))
1920
+ }
1921
+ ]
1922
+ }, p = await ta(n);
1923
+ p.code === 0 ? (z.success("文件集添加成功"), j("refresh"), ae()) : z.error(p.message || "文件集添加失败");
1924
+ }
1925
+ });
1926
+ }, ge = () => {
1927
+ Object.assign(U, {
1928
+ name: "",
1929
+ chineseName: "",
1930
+ description: ""
1931
+ }), Y.value = [], w.value = "", B.value = [], le.value = [], X.value = [], N.value && N.value.resetFields();
1932
+ }, be = (L) => {
1933
+ Y.value.splice(L, 1);
1934
+ };
1935
+ return (L, n) => {
1936
+ const p = f("el-input"), J = f("el-form-item"), V = f("el-form"), u = f("el-icon"), k = f("el-button"), ee = f("el-dialog"), ie = f("el-breadcrumb-item"), M = f("el-breadcrumb"), ce = f("el-checkbox");
1937
+ return o(), y("div", null, [
1938
+ e(ee, {
1939
+ title: "添加文件集",
1940
+ width: "800px",
1941
+ modelValue: m.value,
1942
+ "onUpdate:modelValue": n[6] || (n[6] = (v) => m.value = v),
1943
+ "append-to-body": !0,
1944
+ "before-close": ae,
1945
+ "destroy-on-close": !0,
1946
+ "close-on-click-modal": !1
1947
+ }, {
1948
+ footer: a(() => [
1949
+ r("div", Da, [
1950
+ e(k, { onClick: ae }, {
1951
+ default: a(() => [...n[14] || (n[14] = [
1952
+ C("取消", -1)
1953
+ ])]),
1954
+ _: 1
1955
+ }),
1956
+ e(k, {
1957
+ type: "primary",
1958
+ onClick: ve
1959
+ }, {
1960
+ default: a(() => [...n[15] || (n[15] = [
1961
+ C("确定", -1)
1962
+ ])]),
1963
+ _: 1
1964
+ })
1965
+ ])
1966
+ ]),
1967
+ default: a(() => [
1968
+ r("div", Pa, [
1969
+ r("div", Ka, [
1970
+ n[12] || (n[12] = r("div", { class: "section-title" }, "基本信息", -1)),
1971
+ e(V, {
1972
+ ref_key: "formRef",
1973
+ ref: N,
1974
+ model: U,
1975
+ rules: oe,
1976
+ "label-width": "160px"
1977
+ }, {
1978
+ default: a(() => [
1979
+ e(J, {
1980
+ label: "文件集名称:",
1981
+ prop: "name"
1982
+ }, {
1983
+ default: a(() => [
1984
+ e(p, {
1985
+ modelValue: U.name,
1986
+ "onUpdate:modelValue": n[0] || (n[0] = (v) => U.name = v),
1987
+ placeholder: "请输入文件集名称"
1988
+ }, null, 8, ["modelValue"])
1989
+ ]),
1990
+ _: 1
1991
+ }),
1992
+ e(J, {
1993
+ label: "文件集中文名称:",
1994
+ prop: "chineseName"
1995
+ }, {
1996
+ default: a(() => [
1997
+ e(p, {
1998
+ modelValue: U.chineseName,
1999
+ "onUpdate:modelValue": n[1] || (n[1] = (v) => U.chineseName = v),
2000
+ placeholder: "请输入文件集中文名称"
2001
+ }, null, 8, ["modelValue"])
2002
+ ]),
2003
+ _: 1
2004
+ }),
2005
+ e(J, {
2006
+ label: "文件集描述:",
2007
+ prop: "description"
2008
+ }, {
2009
+ default: a(() => [
2010
+ e(p, {
2011
+ modelValue: U.description,
2012
+ "onUpdate:modelValue": n[2] || (n[2] = (v) => U.description = v),
2013
+ type: "textarea",
2014
+ rows: 3,
2015
+ placeholder: "请输入文件集描述"
2016
+ }, null, 8, ["modelValue"])
2017
+ ]),
2018
+ _: 1
2019
+ })
2020
+ ]),
2021
+ _: 1
2022
+ }, 8, ["model", "rules"])
2023
+ ]),
2024
+ r("div", Na, [
2025
+ n[13] || (n[13] = r("div", { class: "section-title" }, "选中目录或文件", -1)),
2026
+ e(V, {
2027
+ ref: "formRef1",
2028
+ model: U,
2029
+ rules: oe,
2030
+ "label-width": "160px"
2031
+ }, {
2032
+ default: a(() => [
2033
+ e(J, {
2034
+ label: "文件集名称:",
2035
+ prop: "selectedFiles"
2036
+ }, {
2037
+ default: a(() => [
2038
+ r("div", {
2039
+ class: "file-selector-container",
2040
+ onClick: n[5] || (n[5] = (v) => D.value = !0)
2041
+ }, [
2042
+ e(p, {
2043
+ modelValue: re.value,
2044
+ "onUpdate:modelValue": n[4] || (n[4] = (v) => re.value = v),
2045
+ placeholder: "请点击选择目录或文件",
2046
+ readonly: "",
2047
+ class: "clickable-input"
2048
+ }, {
2049
+ suffix: a(() => [
2050
+ e(u, {
2051
+ onClick: n[3] || (n[3] = $e((v) => D.value = !0, ["stop"]))
2052
+ }, {
2053
+ default: a(() => [
2054
+ e(_(ys))
2055
+ ]),
2056
+ _: 1
2057
+ })
2058
+ ]),
2059
+ _: 1
2060
+ }, 8, ["modelValue"])
2061
+ ])
2062
+ ]),
2063
+ _: 1
2064
+ })
2065
+ ]),
2066
+ _: 1
2067
+ }, 8, ["model", "rules"]),
2068
+ Y.value.length > 0 ? (o(), y("div", Ua, [
2069
+ (o(!0), y(pe, null, ye(Y.value, (v, W) => (o(), y("div", {
2070
+ key: W,
2071
+ class: "file-item"
2072
+ }, [
2073
+ r("div", Oa, [
2074
+ v.isFile ? (o(), q(u, { key: 1 }, {
2075
+ default: a(() => [
2076
+ e(_(wt))
2077
+ ]),
2078
+ _: 1
2079
+ })) : (o(), q(u, { key: 0 }, {
2080
+ default: a(() => [
2081
+ e(_(qe))
2082
+ ]),
2083
+ _: 1
2084
+ }))
2085
+ ]),
2086
+ r("div", Ea, [
2087
+ r("div", Ba, Q(v.name), 1),
2088
+ r("div", La, Q(v.path), 1)
2089
+ ]),
2090
+ r("div", Aa, [
2091
+ e(u, {
2092
+ onClick: (he) => be(W)
2093
+ }, {
2094
+ default: a(() => [
2095
+ e(_(fs))
2096
+ ]),
2097
+ _: 1
2098
+ }, 8, ["onClick"])
2099
+ ])
2100
+ ]))), 128))
2101
+ ])) : ne("", !0)
2102
+ ])
2103
+ ])
2104
+ ]),
2105
+ _: 1
2106
+ }, 8, ["modelValue"]),
2107
+ e(ee, {
2108
+ title: "选择文件或目录",
2109
+ width: "600px",
2110
+ modelValue: D.value,
2111
+ "onUpdate:modelValue": n[11] || (n[11] = (v) => D.value = v),
2112
+ "append-to-body": !0,
2113
+ "close-on-click-modal": !1
2114
+ }, {
2115
+ footer: a(() => [
2116
+ r("div", Za, [
2117
+ e(k, {
2118
+ onClick: n[10] || (n[10] = (v) => D.value = !1)
2119
+ }, {
2120
+ default: a(() => [...n[18] || (n[18] = [
2121
+ C("取消", -1)
2122
+ ])]),
2123
+ _: 1
2124
+ }),
2125
+ e(k, {
2126
+ type: "primary",
2127
+ onClick: F
2128
+ }, {
2129
+ default: a(() => [...n[19] || (n[19] = [
2130
+ C("确定", -1)
2131
+ ])]),
2132
+ _: 1
2133
+ })
2134
+ ])
2135
+ ]),
2136
+ default: a(() => [
2137
+ r("div", Fa, [
2138
+ r("div", Ma, [
2139
+ e(M, { separator: "/" }, {
2140
+ default: a(() => [
2141
+ e(ie, null, {
2142
+ default: a(() => [
2143
+ r("a", {
2144
+ onClick: n[7] || (n[7] = (v) => ue(""))
2145
+ }, "根目录")
2146
+ ]),
2147
+ _: 1
2148
+ }),
2149
+ (o(!0), y(pe, null, ye(le.value, (v, W) => (o(), q(ie, { key: W }, {
2150
+ default: a(() => [
2151
+ W < le.value.length - 1 ? (o(), y("a", {
2152
+ key: 0,
2153
+ onClick: (he) => ue(v.path)
2154
+ }, Q(v.name), 9, Ra)) : (o(), y("span", Ha, Q(v.name), 1))
2155
+ ]),
2156
+ _: 2
2157
+ }, 1024))), 128))
2158
+ ]),
2159
+ _: 1
2160
+ })
2161
+ ]),
2162
+ r("div", qa, [
2163
+ T.value ? (o(), y("div", za, [
2164
+ e(u, { class: "is-loading" }, {
2165
+ default: a(() => [
2166
+ e(_(hs))
2167
+ ]),
2168
+ _: 1
2169
+ }),
2170
+ n[16] || (n[16] = r("span", null, "加载中...", -1))
2171
+ ])) : B.value.length === 0 ? (o(), y("div", ja, [
2172
+ e(u, null, {
2173
+ default: a(() => [
2174
+ e(_(qe))
2175
+ ]),
2176
+ _: 1
2177
+ }),
2178
+ n[17] || (n[17] = r("span", null, "该目录为空", -1))
2179
+ ])) : (o(), y("div", Ya, [
2180
+ (o(!0), y(pe, null, ye(B.value.filter((v) => v.isFile === !1), (v) => (o(), y("div", {
2181
+ key: v.name,
2182
+ class: ke(["file-item", { selected: de(v.name) }]),
2183
+ onDblclick: (W) => _e(v)
2184
+ }, [
2185
+ e(ce, {
2186
+ value: de(v.name),
2187
+ onChange: (W) => Z(v),
2188
+ onClick: n[8] || (n[8] = $e(() => {
2189
+ }, ["stop"]))
2190
+ }, null, 8, ["value", "onChange"]),
2191
+ e(u, { class: "file-icon" }, {
2192
+ default: a(() => [
2193
+ e(_(qe))
2194
+ ]),
2195
+ _: 1
2196
+ }),
2197
+ r("span", Ja, Q(v.name), 1),
2198
+ r("span", Ga, Q(v.lastModified), 1)
2199
+ ], 42, Wa))), 128)),
2200
+ (o(!0), y(pe, null, ye(B.value.filter((v) => v.isFile === !0), (v) => (o(), y("div", {
2201
+ key: v.name,
2202
+ class: ke(["file-item", { selected: de(v.name) }])
2203
+ }, [
2204
+ e(ce, {
2205
+ value: de(v.name),
2206
+ onChange: (W) => Z(v),
2207
+ onClick: n[9] || (n[9] = $e(() => {
2208
+ }, ["stop"]))
2209
+ }, null, 8, ["value", "onChange"]),
2210
+ e(u, { class: "file-icon" }, {
2211
+ default: a(() => [
2212
+ e(_(wt))
2213
+ ]),
2214
+ _: 1
2215
+ }),
2216
+ r("span", Qa, Q(v.name), 1),
2217
+ r("span", Xa, Q(v.lastModified), 1)
2218
+ ], 2))), 128))
2219
+ ]))
2220
+ ])
2221
+ ])
2222
+ ]),
2223
+ _: 1
2224
+ }, 8, ["modelValue"])
2225
+ ]);
2226
+ };
2227
+ }
2228
+ }, tl = /* @__PURE__ */ Oe(el, [["__scopeId", "data-v-0d07c15c"]]);
2229
+ let nt = null;
2230
+ const sl = (i) => {
2231
+ nt = i.dataSourceUrl;
2232
+ }, al = { class: "active" }, ll = { style: { display: "flex", "justify-content": "space-between" } }, ol = { class: "plainButton dropdown-button" }, rl = {
2233
+ class: "filter-input-group",
2234
+ style: { "margin-bottom": "10px" }
2235
+ }, nl = ["src"], il = ["onClick"], ul = ["onClick"], dl = { class: "tree-name" }, cl = ["onMouseenter"], pl = {
2236
+ key: 0,
2237
+ style: { width: "50%", textAlign: "right", color: "#AAAAAA", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
2238
+ }, ml = { key: 1 }, fl = { key: 2 }, vl = {
2239
+ key: 0,
2240
+ class: "tree-btn"
2241
+ }, gl = {
2242
+ key: 0,
2243
+ class: "detail-info"
2244
+ }, yl = { class: "info-item" }, _l = { class: "value" }, bl = { class: "info-item" }, hl = { class: "value" }, Il = { class: "info-item" }, wl = { class: "value" }, xl = { class: "info-item" }, Vl = { class: "value" }, kl = { class: "info-item" }, Sl = { class: "value" }, Tl = { class: "info-item" }, $l = { class: "value" }, Cl = { class: "info-item" }, Pl = { class: "value" }, Kl = { class: "info-item" }, Nl = { class: "value" }, Ul = { class: "info-item" }, Ol = { class: "value" }, El = { class: "info-item" }, Bl = { class: "value" }, Ll = {
2245
+ key: 1,
2246
+ class: "no-data"
2247
+ }, Al = {
2248
+ slot: "footer",
2249
+ class: "dialog-footer"
2250
+ }, Dl = {
2251
+ __name: "tree",
2252
+ props: {
2253
+ getFilters: {
2254
+ type: Function,
2255
+ default() {
2256
+ return [];
2257
+ }
2258
+ }
2259
+ },
2260
+ emits: [
2261
+ "addDataSourceByParent",
2262
+ "editDataSourceByParent",
2263
+ "viewDataSourceInfo",
2264
+ "addTableOrViewByParent",
2265
+ "addFileSetByParent"
2266
+ ],
2267
+ setup(i, { expose: P, emit: x }) {
2268
+ const j = i, { proxy: m } = us(), D = c(null), T = c(!1), w = c("file"), B = c({
2269
+ fileTree: !1,
2270
+ typeTree: !1
2271
+ }), le = c(null), Y = c([]), X = c([]), N = c([]), U = c(""), oe = c([]), re = c(null), R = c("add"), me = c(!1), ue = c("all"), _e = Te({
2272
+ children: "children",
2273
+ label: "label"
2274
+ }), de = c(null), Z = c(null), F = c(null), ae = c(null), ve = c(""), ge = c(null), be = c(!1), L = c("right-start"), n = c(!1), p = c(null), J = c(null), V = c(!1), u = c(["minio", "ftp", "sftp", "hdfs"]), k = c(""), ee = c(null), ie = () => {
2275
+ Z.value && clearTimeout(Z.value), F.value && clearTimeout(F.value), F.value = setTimeout(() => {
2276
+ V.value || M();
2277
+ }, 500);
2278
+ }, M = () => {
2279
+ Z.value && (clearTimeout(Z.value), Z.value = null), F.value && (clearTimeout(F.value), F.value = null), be.value = !1, ae.value = null, ge.value = null, p.value = null, V.value = !1;
2280
+ }, ce = (s) => !!(s.type === "folder" || s.level === 1 && !u.value.includes(s.type) || s.level === 4 || s.level === 1 && u.value.includes(s.type)), v = (s) => {
2281
+ const { action: t, data: d } = s;
2282
+ switch (t) {
2283
+ case "addDir":
2284
+ gt(d);
2285
+ break;
2286
+ case "editDir":
2287
+ W(d);
2288
+ break;
2289
+ case "deleteDir":
2290
+ he(d);
2291
+ break;
2292
+ case "addDataSource":
2293
+ l(d);
2294
+ break;
2295
+ case "editDataSource":
2296
+ h(d);
2297
+ break;
2298
+ case "renameDataSource":
2299
+ we(d);
2300
+ break;
2301
+ case "deleteDataSource":
2302
+ xe(d);
2303
+ break;
2304
+ case "addTableOrView":
2305
+ Ye(d);
2306
+ break;
2307
+ case "refreshDataSource":
2308
+ Ke(d);
2309
+ break;
2310
+ case "testConnection":
2311
+ Xe(d);
2312
+ break;
2313
+ case "viewDetail":
2314
+ We(d);
2315
+ break;
2316
+ case "updateMetadata":
2317
+ Je(d);
2318
+ break;
2319
+ case "updateStatistics":
2320
+ Ge(d);
2321
+ break;
2322
+ case "copyCreateTableSql":
2323
+ Qe(d);
2324
+ break;
2325
+ case "renameDataset":
2326
+ G(d);
2327
+ break;
2328
+ case "deleteDataset":
2329
+ Ee(d);
2330
+ break;
2331
+ case "addFileSet":
2332
+ Pt(d);
2333
+ break;
2334
+ case "viewInfo":
2335
+ E(d);
2336
+ break;
2337
+ case "removeOut":
2338
+ Kt(d.node);
2339
+ break;
2340
+ default:
2341
+ console.warn("未知的菜单操作:", t);
2342
+ }
2343
+ }, W = (s) => {
2344
+ re.value = s.pid, R.value = "edit", k.value = s.name, ee.value = s.id, me.value = !0;
2345
+ }, he = (s) => {
2346
+ m.$confirm(`此操作将永久删除 ${s.name} 目录, 是否继续?`, "提示", {
2347
+ confirmButtonText: "确定",
2348
+ cancelButtonText: "取消",
2349
+ type: "warning"
2350
+ }).then(() => {
2351
+ Ds(s.id).then((t) => {
2352
+ m.$message({
2353
+ type: "success",
2354
+ message: "删除成功!"
2355
+ }), fe();
2356
+ });
2357
+ });
2358
+ }, O = () => {
2359
+ me.value = !1, k.value = "", ee.value = null, R.value = "add";
2360
+ }, l = (s) => {
2361
+ S("addDataSourceByParent", s);
2362
+ }, S = x, h = (s) => {
2363
+ S("editDataSourceByParent", s);
2364
+ }, E = (s) => {
2365
+ S("viewDataSourceInfo", s);
2366
+ }, we = (s) => {
2367
+ m.$prompt("请输入新的数据源名称", "重命名数据源", {
2368
+ confirmButtonText: "确定",
2369
+ cancelButtonText: "取消",
2370
+ inputValue: s.name || s.label,
2371
+ inputValidator: (t) => !t || t.trim() === "" ? "数据源名称不能为空" : !0
2372
+ }).then(async ({ value: t }) => {
2373
+ (await Ms({ id: s.id, datasourceName: t })).code === 0 && (m.$message.success("操作成功"), fe());
2374
+ }).catch(() => {
2375
+ });
2376
+ }, xe = (s) => {
2377
+ m.$confirm(
2378
+ `此操作将永久删除数据源 "${s.name || s.label}",是否继续?`,
2379
+ "提示",
2380
+ {
2381
+ confirmButtonText: "确定",
2382
+ cancelButtonText: "取消",
2383
+ type: "warning"
2384
+ }
2385
+ ).then(async () => {
2386
+ (await Hs(s.id)).code === 0 && (m.$message.success("数据源删除成功"), fe());
2387
+ }).catch(() => {
2388
+ });
2389
+ }, Ye = (s) => {
2390
+ S("addTableOrViewByParent", s);
2391
+ }, Ke = (s) => {
2392
+ m.$confirm(
2393
+ "确定要刷新数据源吗?这将重新加载数据源的所有元数据信息。",
2394
+ "提示",
2395
+ {
2396
+ confirmButtonText: "确定",
2397
+ cancelButtonText: "取消",
2398
+ type: "info"
2399
+ }
2400
+ ).then(async () => {
2401
+ T.value = !0;
2402
+ const t = await zs(s.id);
2403
+ T.value = !1, t.code === 0 && (m.$message.success("数据源刷新成功"), fe(s));
2404
+ }).catch(() => {
2405
+ T.value = !1;
2406
+ });
2407
+ }, We = (s) => {
2408
+ nt ? window.open(nt + s.id) : m.$message.error("暂未配置数据源详情页面地址"), console.log("viewDetail", s);
2409
+ }, Je = (s) => {
2410
+ m.$confirm(
2411
+ "确定要更新元数据吗?这将重新获取数据集的元数据信息。",
2412
+ "提示",
2413
+ {
2414
+ confirmButtonText: "确定",
2415
+ cancelButtonText: "取消",
2416
+ type: "info"
2417
+ }
2418
+ ).then(async () => {
2419
+ (await js(s.id)).code === 0 && m.$message.success("更新元数据成功");
2420
+ }).catch(() => {
2421
+ });
2422
+ }, Ge = (s) => {
2423
+ m.$confirm(
2424
+ "确定要更新统计信息吗?这将重新计算数据集的统计信息。",
2425
+ "提示",
2426
+ {
2427
+ confirmButtonText: "确定",
2428
+ cancelButtonText: "取消",
2429
+ type: "info"
2430
+ }
2431
+ ).then(async () => {
2432
+ (await Ys(s.id)).code === 0 && m.$message.success("更新统计信息成功");
2433
+ }).catch(() => {
2434
+ });
2435
+ }, Qe = async (s) => {
2436
+ const t = Fe.service({
2437
+ lock: !0,
2438
+ text: "正在获取建表语句...",
2439
+ spinner: "el-icon-loading",
2440
+ background: "rgba(0, 0, 0, 0.7)"
2441
+ });
2442
+ try {
2443
+ const d = await Js(s.id);
2444
+ if (t.close(), d.code === 0 && d.data) {
2445
+ const b = document.createElement("textarea");
2446
+ b.value = d.data, b.style.position = "fixed", b.style.opacity = "0", document.body.appendChild(b), b.select();
2447
+ try {
2448
+ document.execCommand("copy") ? m.$message.success("建表语句已复制到剪贴板") : I(d.data);
2449
+ } catch {
2450
+ I(d.data);
2451
+ } finally {
2452
+ document.body.removeChild(b);
2453
+ }
2454
+ } else
2455
+ m.$message.error(d.message || "获取建表语句失败");
2456
+ } catch (d) {
2457
+ console.error("复制建表语句失败:", d), m.$message.error("复制建表语句失败: " + (d.message || "未知错误")), t.close();
2458
+ }
2459
+ }, I = (s) => {
2460
+ navigator.clipboard.writeText(s).then(() => {
2461
+ m.$message.success("建表语句已复制到剪贴板");
2462
+ }).catch((t) => {
2463
+ console.error("复制失败:", t), m.$message.error("复制失败,请手动复制");
2464
+ });
2465
+ }, G = (s) => {
2466
+ m.$prompt("请输入新的数据集中文名称", "重命名数据集", {
2467
+ confirmButtonText: "确定",
2468
+ cancelButtonText: "取消",
2469
+ inputValue: s.label || s.name,
2470
+ inputValidator: (t) => !t || t.trim() === "" ? "数据集名称不能为空" : !0
2471
+ }).then(async ({ value: t }) => {
2472
+ (await Rs({ id: s.id, description: t })).code === 0 && (m.$message.success("数据集重命名成功"), fe());
2473
+ }).catch(() => {
2474
+ });
2475
+ }, Ee = (s) => {
2476
+ m.$confirm(
2477
+ `此操作将永久删除数据集 "${s.name || s.label}",是否继续?`,
2478
+ "提示",
2479
+ {
2480
+ confirmButtonText: "确定",
2481
+ cancelButtonText: "取消",
2482
+ type: "warning"
2483
+ }
2484
+ ).then(async () => {
2485
+ (await qs(s.id)).code === 0 && (m.$message.success("数据集删除成功"), fe());
2486
+ }).catch(() => {
2487
+ });
2488
+ }, Pt = (s) => {
2489
+ S("addFileSetByParent", s);
2490
+ }, Kt = (s) => {
2491
+ const t = {
2492
+ id: s.parent.data.id,
2493
+ sourceId: s.data.id
2494
+ };
2495
+ m.$confirm(
2496
+ `是否将 ${s.data.name} 数据源移出自定义分类树?(可重新拖回)`,
2497
+ "提示",
2498
+ {
2499
+ confirmButtonText: "确定",
2500
+ cancelButtonText: "取消",
2501
+ type: "warning"
2502
+ }
2503
+ ).then(() => {
2504
+ He(t).then((d) => {
2505
+ d.code === 0 ? m.$message.success("移除成功") : m.$message.error("移除失败:" + d.message), fe();
2506
+ });
2507
+ });
2508
+ }, Nt = () => {
2509
+ V.value = !0, F.value && (clearTimeout(F.value), F.value = null);
2510
+ }, Ut = () => {
2511
+ V.value = !1, F.value = setTimeout(() => {
2512
+ M();
2513
+ }, 300);
2514
+ }, Ot = () => {
2515
+ if (k.value === "") {
2516
+ m.$message({
2517
+ type: "error",
2518
+ message: "目录名称不能为空,请填写目录名称!"
2519
+ });
2520
+ return;
2521
+ }
2522
+ if (R.value === "add") {
2523
+ const s = { name: k.value, parentId: re.value };
2524
+ Fs(s).then((t) => {
2525
+ t.code === 0 ? m.$message.success("新增成功") : m.$message.error("新增失败:" + t.message), fe(), O();
2526
+ });
2527
+ } else if (R.value === "edit") {
2528
+ const s = { parentId: re.value, id: ee.value, name: k.value };
2529
+ lt(s).then((t) => {
2530
+ t.code === 0 ? m.$message.success("修改成功") : m.$message.error("修改失败:" + t.message), fe(), O();
2531
+ });
2532
+ }
2533
+ }, ut = (s) => {
2534
+ switch (s) {
2535
+ case "ACTIVE":
2536
+ return "state-normal";
2537
+ case "INACTIVE":
2538
+ return "state-error";
2539
+ case "UNKNOWN":
2540
+ return "state-disconnected";
2541
+ case "loading":
2542
+ case "connecting":
2543
+ return "state-loading";
2544
+ default:
2545
+ return "state-disconnected";
2546
+ }
2547
+ }, Xe = (s) => {
2548
+ s.state === "loading" || s.state === "connecting" || (s.state = "loading", Et(s));
2549
+ }, Et = async (s) => {
2550
+ try {
2551
+ const t = s.id || s.sourceId;
2552
+ if (!t) {
2553
+ m.$message.error("数据源ID不存在,无法进行连接测试"), s.state = "UNKNOWN";
2554
+ return;
2555
+ }
2556
+ m.$message.info("正在检测数据源连接...");
2557
+ const d = await Bs(t);
2558
+ d.code === 0 && (s.state = d.data.state, s.stateMessage = d.data.state_message, d.data.state === "ACTIVE" ? m.$message.success("数据源连接成功") : d.data.state === "INACTIVE" ? m.$message.warning("数据源连接失败") : d.data.state === "UNKNOWN" && m.$message.warning("数据源连接状态未知"));
2559
+ } catch (t) {
2560
+ s.state = "INACTIVE", m.$message.error("数据源连接测试失败:" + (t.message || "网络异常")), console.error("数据源连接测试失败:", t);
2561
+ }
2562
+ }, Bt = (s) => s.level === 1 || s.level === 4, Lt = (s, t) => {
2563
+ Z.value && clearTimeout(Z.value), F.value && (clearTimeout(F.value), F.value = null), Z.value = setTimeout(() => {
2564
+ At(s, t);
2565
+ }, 300);
2566
+ }, At = async (s, t) => {
2567
+ try {
2568
+ F.value && (clearTimeout(F.value), F.value = null), ae.value = t, ve.value = t.level === 1 ? "数据源信息" : "数据集信息";
2569
+ const d = `popover-trigger-${(t.key || t.id).replace(/\./g, "-")}`;
2570
+ if (ge.value = document.querySelector(`.${d}`), !ge.value)
2571
+ return;
2572
+ be.value = !0, n.value = !0, p.value = null, Dt();
2573
+ let b;
2574
+ if (t.level === 1) {
2575
+ const $ = t.id || t.sourceId;
2576
+ b = await Ls($);
2577
+ } else if (t.level === 4) {
2578
+ const $ = t.id || t.urn;
2579
+ b = await As($);
2580
+ }
2581
+ b && b.code === 0 ? p.value = b.data : p.value = null;
2582
+ } catch (d) {
2583
+ console.error("获取详情数据失败:", d), p.value = null;
2584
+ } finally {
2585
+ n.value = !1;
2586
+ }
2587
+ }, Dt = () => {
2588
+ be.value && ge.value && J.value && Ce(() => {
2589
+ ge.value.getBoundingClientRect().top > window.innerHeight / 2 ? L.value = "right-end" : L.value = "right-start";
2590
+ });
2591
+ }, Ft = (s, t, d) => {
2592
+ if (!s) return !0;
2593
+ const b = (A, K) => (A || "").indexOf(K) !== -1, $ = (A) => {
2594
+ const K = A && (A.name || A.label) || "";
2595
+ switch (ue.value) {
2596
+ case "all":
2597
+ return b(K, s);
2598
+ case "dataSource":
2599
+ return A && A.level === 1 && b(K, s);
2600
+ case "schemaName":
2601
+ return A && A.level === 2 && b(K, s);
2602
+ case "dataSet":
2603
+ return A && A.level === 4 && b(K, s);
2604
+ default:
2605
+ return b(K, s);
2606
+ }
2607
+ };
2608
+ if ($(t)) return !0;
2609
+ let H = d && d.parent;
2610
+ for (; H && H.data; ) {
2611
+ if ($(H.data)) return !0;
2612
+ H = H.parent;
2613
+ }
2614
+ return !1;
2615
+ }, Mt = (s) => {
2616
+ if (s.data.type && s.data.type !== "folder") {
2617
+ const t = {
2618
+ data: s.data,
2619
+ parent: s.parent.data.id
2620
+ };
2621
+ return de.value = JSON.parse(JSON.stringify(t)), !0;
2622
+ } else
2623
+ return !1;
2624
+ }, Rt = (s, t, d) => t.data.type === "folder" && d === "inner" ? !0 : t.data.type !== "folder" && d === "inner" || t.data.type === "folder" && de.value.parent === t.parent.data.id ? !1 : t.level > 1 && t.data.type, Ht = (s, t, d) => {
2625
+ const b = {
2626
+ id: t.data.id,
2627
+ sourceId: s.data.id || s.data.sourceId
2628
+ };
2629
+ if (console.log("---params", s, t), d === "inner")
2630
+ at(b).then(($) => {
2631
+ $.code === 0 && (de.value.parent ? He({
2632
+ id: de.value.parent,
2633
+ sourceId: s.data.id || s.data.sourceId
2634
+ }).then((H) => {
2635
+ H.code === 0 && (m.$message.success("移动成功"), fe());
2636
+ }) : (m.$message.success("移动成功"), fe()));
2637
+ });
2638
+ else if (t.data.type === "folder") {
2639
+ if (b.id = t.parent.data.id, console.log("文件夹前后", b), de.value.parent === t.parent.data.id) {
2640
+ fe();
2641
+ return;
2642
+ }
2643
+ at(b).then(($) => {
2644
+ $.code === 0 && (de.value.parent ? He({
2645
+ id: de.value.parent,
2646
+ sourceId: s.data.id || s.data.sourceId
2647
+ }).then((H) => {
2648
+ H.code === 0 && (m.$message.success("移动成功"), fe());
2649
+ }) : (m.$message.success("移动成功"), fe()));
2650
+ });
2651
+ } else if (de.value.parent === t.parent.data.id) {
2652
+ const $ = t.parent.childNodes.map((K) => K.data.urn).filter((K) => K !== s.data.urn), H = $.indexOf(t.data.urn);
2653
+ d === "before" ? $.splice(H, 0, s.data.urn) : $.splice(H + 1, 0, s.data.urn);
2654
+ const A = {
2655
+ sourceId: $.join(","),
2656
+ id: t.parent.data.id
2657
+ };
2658
+ console.log("par", A), lt(A).then((K) => {
2659
+ K.code === 0 ? m.$message.success("修改成功") : m.$message.error("修改失败:" + K.message), fe();
2660
+ });
2661
+ } else {
2662
+ const $ = {
2663
+ id: t.parent.data.id,
2664
+ sourceId: s.data.id || s.data.sourceId
2665
+ };
2666
+ at($).then((H) => {
2667
+ H.code === 0 ? He({
2668
+ id: de.value.parent,
2669
+ sourceId: s.data.id || s.data.sourceId
2670
+ }).then((A) => {
2671
+ if (A.code === 0) {
2672
+ const K = t.parent.childNodes.map((Ve) => Ve.data.urn).filter((Ve) => Ve !== s.data.urn), Ne = K.indexOf(t.data.urn);
2673
+ d === "before" ? K.splice(Ne, 0, s.data.urn) : K.splice(Ne + 1, 0, s.data.urn);
2674
+ const Be = {
2675
+ sourceId: K.join(","),
2676
+ id: t.parent.data.id
2677
+ };
2678
+ console.log("par", Be), lt(Be).then((Ve) => {
2679
+ Ve.code === 0 ? m.$message.success("移动成功") : m.$message.error("移动失败:" + Ve.message), fe();
2680
+ });
2681
+ } else
2682
+ m.$message.error("移动失败:" + A.message), fe();
2683
+ }) : (m.$message.success("移动失败"), fe());
2684
+ });
2685
+ }
2686
+ }, qt = (s, t) => {
2687
+ console.log("nodeClick", t, s), !(s.type === "folder" || s.level === -1 || s.level === 0) && j.getFilters(s);
2688
+ }, zt = ({ paneName: s }) => {
2689
+ w.value = s, yt(s);
2690
+ }, dt = (s) => {
2691
+ s === 0 ? B.value.fileTree ? (N.value = X.value, ct()) : mt() : s === 1 && (B.value.typeTree ? (N.value = oe.value, ct()) : pt());
2692
+ }, ct = () => {
2693
+ Ce(() => {
2694
+ (!U.value || U.value.trim() === "") && Ae();
2695
+ });
2696
+ }, pt = (s) => {
2697
+ T.value = !0, Ws().then((t) => {
2698
+ if (t.code === 0) {
2699
+ const d = t.data.data || [];
2700
+ d.forEach(($) => {
2701
+ $.key = $.id || $.urn, $.type && $.type !== "folder" && ($.state || ($.state = "disconnected"));
2702
+ }), oe.value = d, N.value = d, B.value.typeTree = !0, T.value = !1;
2703
+ let b = [];
2704
+ s && s.parentId && (b = ft(d, s.parentId), b && b.length > 0 && b.push(s.id)), Y.value = b && b.length > 0 ? b : [], Ce(() => {
2705
+ (!U.value || U.value.trim() === "") && Ae();
2706
+ });
2707
+ } else
2708
+ m.$message.error("加载类型分类数据失败:" + (t.message || "未知错误")), T.value = !1;
2709
+ }).catch((t) => {
2710
+ console.error("加载类型分类数据失败:", t), m.$message.error("加载类型分类数据失败,请稍后重试"), T.value = !1;
2711
+ });
2712
+ }, mt = (s) => {
2713
+ T.value = !0, Es().then((t) => {
2714
+ if (t.code === 0) {
2715
+ const d = t.data.data.sort(($, H) => $.type === "folder" && H.type !== "folder" ? -1 : H.type === "folder" && $.type !== "folder" ? 1 : 0);
2716
+ d.forEach(($) => {
2717
+ $.key = $.id || $.urn, $.type && $.type !== "folder" && ($.state || ($.state = "disconnected"));
2718
+ }), le.value = d.filter(($) => $.type === "folder")[0];
2719
+ let b = [];
2720
+ s && s.parentId ? (b = ft(d, s.parentId), b && b.length > 0 && b.push(s.id)) : s && s.id && b.push(s.id), Y.value = b && b.length > 0 ? b : le.value ? [le.value.key] : [], X.value = d, N.value = d, B.value.fileTree = !0, T.value = !1, Ce(() => {
2721
+ (!U.value || U.value.trim() === "") && Ae();
2722
+ });
2723
+ } else
2724
+ m.$message.error("加载文件分类数据失败:" + (t.message || "未知错误")), T.value = !1;
2725
+ }).catch((t) => {
2726
+ console.error("加载文件分类数据失败:", t), m.$message.error("加载文件分类数据失败,请稍后重试"), T.value = !1;
2727
+ });
2728
+ }, ft = (s, t) => {
2729
+ const d = [];
2730
+ return !s || s[0].level > 1 ? d : (s.some((b, $) => {
2731
+ if (b.id === t)
2732
+ return d.push(b.id), !0;
2733
+ if (b.children && b.children.length > 0) {
2734
+ let H = Ze(b, t);
2735
+ if (H && H.length > 0)
2736
+ for (d.push(H); !H || H.length < 1; )
2737
+ H = Ze(b, H), H && H.length > 0 && d.push(H);
2738
+ if (d.length > 0)
2739
+ return d.push(t), !0;
2740
+ }
2741
+ }), d.reverse());
2742
+ }, Ze = (s, t) => {
2743
+ let d = "";
2744
+ return !s.children || s.children.length < 1 || s.children[0].level > 1 || s.children.some((b, $) => {
2745
+ if (b.id === t)
2746
+ return d = s.id, !0;
2747
+ if (b.children && b.children.length > 0) {
2748
+ if (b.children[0].level > 1)
2749
+ return !0;
2750
+ if (d = Ze(b, t), d && d.length > 0)
2751
+ return !0;
2752
+ }
2753
+ }), d;
2754
+ }, Ae = () => {
2755
+ if (D.value) {
2756
+ const s = (d) => {
2757
+ d && d.length > 0 && d.forEach((b) => {
2758
+ b.expanded = !1, b.childNodes && b.childNodes.length > 0 && s(b.childNodes);
2759
+ });
2760
+ }, t = D.value.store._getAllNodes();
2761
+ s(t), Ce(() => {
2762
+ Y.value.forEach((d, b) => {
2763
+ const $ = D.value.getNode(d);
2764
+ $ && ($.expanded = !0), t.forEach((H, A) => {
2765
+ if (H.data.id === d) {
2766
+ H.expanded = !0;
2767
+ const K = [];
2768
+ Y.value.forEach((Ne, Be) => K.push(Ne)), K.splice(b, 1), vt(K, H.childNodes);
2769
+ }
2770
+ });
2771
+ });
2772
+ });
2773
+ }
2774
+ }, vt = (s, t) => {
2775
+ s.some((d, b) => {
2776
+ let $ = !1;
2777
+ if (t && t.length > 0 && t.some((H, A) => {
2778
+ if (d === H.data.id) {
2779
+ H.expanded = !0, $ = !0;
2780
+ const K = s;
2781
+ if (K.splice(b, 1), K.length > 0)
2782
+ return vt(K, H.childNodes), !0;
2783
+ }
2784
+ }), $)
2785
+ return !0;
2786
+ });
2787
+ }, fe = (s) => {
2788
+ w.value === "file" ? (B.value.fileTree = !1, mt(s)) : w.value === "type" && (B.value.typeTree = !1, pt(s));
2789
+ }, jt = () => {
2790
+ m.$message.info("正在刷新数据..."), fe();
2791
+ }, Yt = (s) => {
2792
+ s === "addDir" ? gt() : s === "addDataSource" && Wt();
2793
+ }, gt = (s) => {
2794
+ s ? re.value = s.id || null : re.value = null, R.value = "add", me.value = !0;
2795
+ }, Wt = () => {
2796
+ S("addDataSourceByParent"), console.log("addDataSource");
2797
+ }, Jt = () => {
2798
+ if (U.value = "", D.value)
2799
+ try {
2800
+ D.value.filter("");
2801
+ } catch {
2802
+ }
2803
+ Ce(() => {
2804
+ Ae();
2805
+ });
2806
+ }, Gt = (s) => {
2807
+ ue.value = s, D.value.filter(U.value);
2808
+ }, Qt = () => {
2809
+ const s = (U.value || "").trim();
2810
+ if (D.value)
2811
+ try {
2812
+ D.value.filter(s);
2813
+ } catch (t) {
2814
+ console.warn("triggerFilter: tree.filter 调用失败", t);
2815
+ }
2816
+ s || Ce(() => {
2817
+ Ae();
2818
+ });
2819
+ }, yt = (s) => {
2820
+ s === "file" ? dt(0) : s === "type" && dt(1);
2821
+ };
2822
+ return P({
2823
+ refreshTableConditions: fe
2824
+ }), it(() => {
2825
+ yt("file");
2826
+ }), (s, t) => {
2827
+ const d = f("el-tab-pane"), b = f("el-tabs"), $ = f("el-button"), H = f("el-tooltip"), A = f("el-icon"), K = f("el-dropdown-item"), Ne = f("el-dropdown-menu"), Be = f("el-dropdown"), Ve = f("el-option"), Xt = f("el-select"), _t = f("el-input"), et = f("Edit"), Me = f("Delete"), tt = f("EditPen"), bt = f("Connection"), Zt = f("View"), es = f("RefreshLeft"), ts = f("DataAnalysis"), ss = f("DocumentCopy"), as = f("FolderAdd"), ls = f("el-tree"), os = f("el-popover"), rs = f("el-form-item"), ns = f("el-form"), is = f("el-dialog"), ht = St("loading");
2828
+ return De((o(), y("div", al, [
2829
+ r("div", ll, [
2830
+ e(b, {
2831
+ modelValue: _(w),
2832
+ "onUpdate:modelValue": t[0] || (t[0] = (Ie) => Pe(w) ? w.value = Ie : null),
2833
+ class: "custom-tabs",
2834
+ onTabClick: zt
2835
+ }, {
2836
+ default: a(() => [
2837
+ e(d, {
2838
+ label: "默认分类",
2839
+ name: "file"
2840
+ }),
2841
+ e(d, {
2842
+ label: "按类型分类",
2843
+ name: "type"
2844
+ })
2845
+ ]),
2846
+ _: 1
2847
+ }, 8, ["modelValue"]),
2848
+ r("div", null, [
2849
+ r("span", null, [
2850
+ e(H, {
2851
+ content: "刷新数据",
2852
+ placement: "top"
2853
+ }, {
2854
+ default: a(() => [
2855
+ e($, {
2856
+ link: "",
2857
+ icon: _(st),
2858
+ size: "small",
2859
+ class: "refresh-btn",
2860
+ onClick: jt
2861
+ }, null, 8, ["icon"])
2862
+ ]),
2863
+ _: 1
2864
+ })
2865
+ ]),
2866
+ e(Be, {
2867
+ class: "treeAdd",
2868
+ trigger: "click",
2869
+ placement: "bottom-end",
2870
+ onCommand: Yt
2871
+ }, {
2872
+ dropdown: a(() => [
2873
+ e(Ne, { class: "custom-dropdown-menu" }, {
2874
+ default: a(() => [
2875
+ e(K, {
2876
+ command: "addDir",
2877
+ class: "dropdown-item"
2878
+ }, {
2879
+ default: a(() => [
2880
+ e(A, { style: { "margin-right": "5px" } }, {
2881
+ default: a(() => [
2882
+ e(_(qe))
2883
+ ]),
2884
+ _: 1
2885
+ }),
2886
+ t[7] || (t[7] = C(" 新建文件夹 ", -1))
2887
+ ]),
2888
+ _: 1
2889
+ }),
2890
+ e(K, {
2891
+ command: "addDataSource",
2892
+ class: "dropdown-item"
2893
+ }, {
2894
+ default: a(() => [
2895
+ e(A, { style: { "margin-right": "5px" } }, {
2896
+ default: a(() => [
2897
+ e(_(Re))
2898
+ ]),
2899
+ _: 1
2900
+ }),
2901
+ t[8] || (t[8] = C(" 添加数据源 ", -1))
2902
+ ]),
2903
+ _: 1
2904
+ })
2905
+ ]),
2906
+ _: 1
2907
+ })
2908
+ ]),
2909
+ default: a(() => [
2910
+ r("span", ol, [
2911
+ e(A, null, {
2912
+ default: a(() => [
2913
+ e(_(Vs))
2914
+ ]),
2915
+ _: 1
2916
+ }),
2917
+ t[6] || (t[6] = r("span", { class: "dropdown-corner" }, null, -1))
2918
+ ])
2919
+ ]),
2920
+ _: 1
2921
+ })
2922
+ ])
2923
+ ]),
2924
+ r("div", rl, [
2925
+ e(_t, {
2926
+ modelValue: _(U),
2927
+ "onUpdate:modelValue": t[2] || (t[2] = (Ie) => Pe(U) ? U.value = Ie : null),
2928
+ class: "custominput",
2929
+ clearable: "",
2930
+ placeholder: "输入检索内容",
2931
+ onClear: Jt
2932
+ }, {
2933
+ prepend: a(() => [
2934
+ e(Xt, {
2935
+ modelValue: _(ue),
2936
+ "onUpdate:modelValue": t[1] || (t[1] = (Ie) => Pe(ue) ? ue.value = Ie : null),
2937
+ placeholder: "请选择",
2938
+ onChange: Gt,
2939
+ style: { width: "90px" }
2940
+ }, {
2941
+ default: a(() => [
2942
+ e(Ve, {
2943
+ label: "全部",
2944
+ value: "all"
2945
+ }),
2946
+ e(Ve, {
2947
+ label: "数据源",
2948
+ value: "dataSource"
2949
+ }),
2950
+ e(Ve, {
2951
+ label: "模式名",
2952
+ value: "schemaName"
2953
+ }),
2954
+ e(Ve, {
2955
+ label: "数据集",
2956
+ value: "dataSet"
2957
+ })
2958
+ ]),
2959
+ _: 1
2960
+ }, 8, ["modelValue"])
2961
+ ]),
2962
+ append: a(() => [
2963
+ e($, {
2964
+ style: { padding: "8px 10px" },
2965
+ icon: _(Ts),
2966
+ onClick: Qt
2967
+ }, null, 8, ["icon"])
2968
+ ]),
2969
+ _: 1
2970
+ }, 8, ["modelValue"])
2971
+ ]),
2972
+ _(T) ? ne("", !0) : (o(), q(ls, {
2973
+ key: 0,
2974
+ ref_key: "treeRef",
2975
+ ref: D,
2976
+ class: "filter-tree",
2977
+ data: _(N),
2978
+ props: _(_e),
2979
+ "filter-node-method": Ft,
2980
+ "expand-on-click-node": !1,
2981
+ draggable: "",
2982
+ "node-key": "key",
2983
+ "default-expanded-keys": [..._(Y)],
2984
+ "allow-drag": Mt,
2985
+ "allow-drop": Rt,
2986
+ onNodeDrop: Ht,
2987
+ onNodeClick: qt
2988
+ }, {
2989
+ default: a(({ node: Ie, data: g }) => [
2990
+ r("div", {
2991
+ class: ke(["treeNodeIcon", { outNode: g.level === 1 && g.type !== "folder" }])
2992
+ }, [
2993
+ r("div", {
2994
+ class: ke(["treeIcon", { "has-state": g.level === 1 && g.type !== "folder" }])
2995
+ }, [
2996
+ g.type === "folder" || g.level === 0 ? (o(), q(Le, {
2997
+ key: 0,
2998
+ "type-name": Ie.expanded ? "folderOpen" : "folderClose"
2999
+ }, null, 8, ["type-name"])) : g.level === -1 ? (o(), q(Le, {
3000
+ key: 1,
3001
+ "type-name": g.name
3002
+ }, null, 8, ["type-name"])) : g.level === 1 ? (o(), q(Le, {
3003
+ key: 2,
3004
+ "type-name": g.type,
3005
+ "is-data-source": !0
3006
+ }, null, 8, ["type-name"])) : g.level === 3 ? (o(), q(Le, {
3007
+ key: 3,
3008
+ "type-name": Ie.expanded ? "folderOpen" : "folderClose"
3009
+ }, null, 8, ["type-name"])) : g.type ? (o(), q(Le, {
3010
+ key: 4,
3011
+ "type-name": g.type
3012
+ }, null, 8, ["type-name"])) : (o(), y("img", {
3013
+ key: 5,
3014
+ src: _(je),
3015
+ style: { transform: "translateY(.5px)" },
3016
+ alt: ""
3017
+ }, null, 8, nl)),
3018
+ g.level === 1 && g.type !== "folder" ? (o(), y(pe, { key: 6 }, [
3019
+ g.stateMessage ? (o(), q(H, {
3020
+ key: 0,
3021
+ content: g.stateMessage,
3022
+ placement: "top",
3023
+ effect: "light",
3024
+ "open-delay": "500"
3025
+ }, {
3026
+ default: a(() => [
3027
+ r("div", {
3028
+ class: ke(["state-dot", ut(g.state)]),
3029
+ onClick: $e((It) => Xe(g), ["stop"])
3030
+ }, null, 10, il)
3031
+ ]),
3032
+ _: 2
3033
+ }, 1032, ["content"])) : (o(), y("div", {
3034
+ key: 1,
3035
+ class: ke(["state-dot", ut(g.state)]),
3036
+ onClick: $e((It) => Xe(g), ["stop"])
3037
+ }, null, 10, ul))
3038
+ ], 64)) : ne("", !0)
3039
+ ], 2),
3040
+ r("div", dl, [
3041
+ Bt(g) ? (o(), y("div", {
3042
+ key: 0,
3043
+ ref: `popover-trigger-${g.key || g.id}`,
3044
+ class: ke(["popover-trigger", `popover-trigger-${(g.key || g.id).replace(/\./g, "-")}`]),
3045
+ style: { display: "flex", "justify-content": "space-between" },
3046
+ onMouseenter: (It) => Lt(Ie, g),
3047
+ onMouseleave: ie
3048
+ }, [
3049
+ r("span", {
3050
+ style: kt({ width: g.level === 4 ? "50%" : "100%", textAlign: "left", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" })
3051
+ }, Q(g.name || g.label), 5),
3052
+ g.level === 4 ? (o(), y("span", pl, Q(g.label || "--"), 1)) : ne("", !0)
3053
+ ], 42, cl)) : g.level === 3 ? (o(), y("span", ml, Q(g.label || g.name), 1)) : (o(), y("span", fl, Q(g.name || g.label), 1))
3054
+ ]),
3055
+ ce(g) ? (o(), y("div", vl, [
3056
+ e(Be, {
3057
+ trigger: "click",
3058
+ placement: "bottom-start",
3059
+ onCommand: v
3060
+ }, {
3061
+ dropdown: a(() => [
3062
+ e(Ne, {
3063
+ slot: "dropdown",
3064
+ class: "custom-dropdown-menu"
3065
+ }, {
3066
+ default: a(() => [
3067
+ g.type === "folder" ? (o(), y(pe, { key: 0 }, [
3068
+ e(K, {
3069
+ command: { action: "addDir", data: g },
3070
+ class: "dropdown-item"
3071
+ }, {
3072
+ default: a(() => [
3073
+ e(A, { style: { "margin-right": "5px" } }, {
3074
+ default: a(() => [
3075
+ e(_(Re))
3076
+ ]),
3077
+ _: 1
3078
+ }),
3079
+ t[9] || (t[9] = C(" 新建子目录 ", -1))
3080
+ ]),
3081
+ _: 1
3082
+ }, 8, ["command"]),
3083
+ e(K, {
3084
+ command: { action: "editDir", data: g },
3085
+ class: "dropdown-item"
3086
+ }, {
3087
+ default: a(() => [
3088
+ e(A, { style: { "margin-right": "5px" } }, {
3089
+ default: a(() => [
3090
+ e(et)
3091
+ ]),
3092
+ _: 1
3093
+ }),
3094
+ t[10] || (t[10] = C(" 重命名 ", -1))
3095
+ ]),
3096
+ _: 1
3097
+ }, 8, ["command"]),
3098
+ g.id !== _(le).id && g.children.length === 0 ? (o(), q(K, {
3099
+ key: 0,
3100
+ command: { action: "deleteDir", data: g },
3101
+ class: "dropdown-item"
3102
+ }, {
3103
+ default: a(() => [
3104
+ e(A, { style: { "margin-right": "5px" } }, {
3105
+ default: a(() => [
3106
+ e(Me)
3107
+ ]),
3108
+ _: 1
3109
+ }),
3110
+ t[11] || (t[11] = C(" 删除 ", -1))
3111
+ ]),
3112
+ _: 1
3113
+ }, 8, ["command"])) : ne("", !0),
3114
+ e(K, {
3115
+ divided: "",
3116
+ command: { action: "addDataSource", data: g },
3117
+ class: "dropdown-item"
3118
+ }, {
3119
+ default: a(() => [
3120
+ e(A, { style: { "margin-right": "5px" } }, {
3121
+ default: a(() => [
3122
+ e(_(Re))
3123
+ ]),
3124
+ _: 1
3125
+ }),
3126
+ t[12] || (t[12] = C(" 添加数据源 ", -1))
3127
+ ]),
3128
+ _: 1
3129
+ }, 8, ["command"])
3130
+ ], 64)) : g.level === 1 && !_(u).includes(g.type) ? (o(), y(pe, { key: 1 }, [
3131
+ e(K, {
3132
+ command: { action: "editDataSource", data: g },
3133
+ class: "dropdown-item"
3134
+ }, {
3135
+ default: a(() => [
3136
+ e(A, { style: { "margin-right": "5px" } }, {
3137
+ default: a(() => [
3138
+ e(et)
3139
+ ]),
3140
+ _: 1
3141
+ }),
3142
+ t[13] || (t[13] = C(" 编辑数据源 ", -1))
3143
+ ]),
3144
+ _: 1
3145
+ }, 8, ["command"]),
3146
+ e(K, {
3147
+ command: { action: "renameDataSource", data: g },
3148
+ class: "dropdown-item"
3149
+ }, {
3150
+ default: a(() => [
3151
+ e(A, { style: { "margin-right": "5px" } }, {
3152
+ default: a(() => [
3153
+ e(tt)
3154
+ ]),
3155
+ _: 1
3156
+ }),
3157
+ t[14] || (t[14] = C(" 重命名 ", -1))
3158
+ ]),
3159
+ _: 1
3160
+ }, 8, ["command"]),
3161
+ e(K, {
3162
+ command: { action: "deleteDataSource", data: g },
3163
+ class: "dropdown-item"
3164
+ }, {
3165
+ default: a(() => [
3166
+ e(A, { style: { "margin-right": "5px" } }, {
3167
+ default: a(() => [
3168
+ e(Me)
3169
+ ]),
3170
+ _: 1
3171
+ }),
3172
+ t[15] || (t[15] = C(" 删除 ", -1))
3173
+ ]),
3174
+ _: 1
3175
+ }, 8, ["command"]),
3176
+ e(K, {
3177
+ divided: "",
3178
+ command: { action: "addTableOrView", data: g },
3179
+ class: "dropdown-item"
3180
+ }, {
3181
+ default: a(() => [
3182
+ e(A, { style: { "margin-right": "5px" } }, {
3183
+ default: a(() => [
3184
+ e(_(Re))
3185
+ ]),
3186
+ _: 1
3187
+ }),
3188
+ t[16] || (t[16] = C(" 添加表/视图 ", -1))
3189
+ ]),
3190
+ _: 1
3191
+ }, 8, ["command"]),
3192
+ e(K, {
3193
+ command: { action: "refreshDataSource", data: g },
3194
+ class: "dropdown-item"
3195
+ }, {
3196
+ default: a(() => [
3197
+ e(A, { style: { "margin-right": "5px" } }, {
3198
+ default: a(() => [
3199
+ e(_(st))
3200
+ ]),
3201
+ _: 1
3202
+ }),
3203
+ t[17] || (t[17] = C(" 刷新数据源 ", -1))
3204
+ ]),
3205
+ _: 1
3206
+ }, 8, ["command"]),
3207
+ e(K, {
3208
+ command: { action: "testConnection", data: g },
3209
+ class: "dropdown-item"
3210
+ }, {
3211
+ default: a(() => [
3212
+ e(A, { style: { "margin-right": "5px" } }, {
3213
+ default: a(() => [
3214
+ e(bt)
3215
+ ]),
3216
+ _: 1
3217
+ }),
3218
+ t[18] || (t[18] = C(" 测试连接 ", -1))
3219
+ ]),
3220
+ _: 1
3221
+ }, 8, ["command"])
3222
+ ], 64)) : g.level === 4 ? (o(), y(pe, { key: 2 }, [
3223
+ e(K, {
3224
+ command: { action: "viewDetail", data: g },
3225
+ class: "dropdown-item"
3226
+ }, {
3227
+ default: a(() => [
3228
+ e(A, { style: { "margin-right": "5px" } }, {
3229
+ default: a(() => [
3230
+ e(Zt)
3231
+ ]),
3232
+ _: 1
3233
+ }),
3234
+ t[19] || (t[19] = C(" 查看详情 ", -1))
3235
+ ]),
3236
+ _: 1
3237
+ }, 8, ["command"]),
3238
+ e(K, {
3239
+ command: { action: "updateMetadata", data: g },
3240
+ class: "dropdown-item"
3241
+ }, {
3242
+ default: a(() => [
3243
+ e(A, { style: { "margin-right": "5px" } }, {
3244
+ default: a(() => [
3245
+ e(es)
3246
+ ]),
3247
+ _: 1
3248
+ }),
3249
+ t[20] || (t[20] = C(" 更新元数据 ", -1))
3250
+ ]),
3251
+ _: 1
3252
+ }, 8, ["command"]),
3253
+ e(K, {
3254
+ command: { action: "updateStatistics", data: g },
3255
+ class: "dropdown-item"
3256
+ }, {
3257
+ default: a(() => [
3258
+ e(A, { style: { "margin-right": "5px" } }, {
3259
+ default: a(() => [
3260
+ e(ts)
3261
+ ]),
3262
+ _: 1
3263
+ }),
3264
+ t[21] || (t[21] = C(" 更新统计 ", -1))
3265
+ ]),
3266
+ _: 1
3267
+ }, 8, ["command"]),
3268
+ e(K, {
3269
+ command: { action: "copyCreateTableSql", data: g },
3270
+ class: "dropdown-item"
3271
+ }, {
3272
+ default: a(() => [
3273
+ e(A, { style: { "margin-right": "5px" } }, {
3274
+ default: a(() => [
3275
+ e(ss)
3276
+ ]),
3277
+ _: 1
3278
+ }),
3279
+ t[22] || (t[22] = C(" 复制建表语句 ", -1))
3280
+ ]),
3281
+ _: 1
3282
+ }, 8, ["command"]),
3283
+ e(K, {
3284
+ divided: "",
3285
+ command: { action: "renameDataset", data: g },
3286
+ class: "dropdown-item"
3287
+ }, {
3288
+ default: a(() => [
3289
+ e(A, { style: { "margin-right": "5px" } }, {
3290
+ default: a(() => [
3291
+ e(tt)
3292
+ ]),
3293
+ _: 1
3294
+ }),
3295
+ t[23] || (t[23] = C(" 重命名 ", -1))
3296
+ ]),
3297
+ _: 1
3298
+ }, 8, ["command"]),
3299
+ e(K, {
3300
+ command: { action: "deleteDataset", data: g },
3301
+ class: "dropdown-item"
3302
+ }, {
3303
+ default: a(() => [
3304
+ e(A, { style: { "margin-right": "5px" } }, {
3305
+ default: a(() => [
3306
+ e(Me)
3307
+ ]),
3308
+ _: 1
3309
+ }),
3310
+ t[24] || (t[24] = C(" 删除 ", -1))
3311
+ ]),
3312
+ _: 1
3313
+ }, 8, ["command"])
3314
+ ], 64)) : g.level === 1 && _(u).includes(g.type) ? (o(), y(pe, { key: 3 }, [
3315
+ e(K, {
3316
+ command: { action: "editDataSource", data: g },
3317
+ class: "dropdown-item"
3318
+ }, {
3319
+ default: a(() => [
3320
+ e(A, { style: { "margin-right": "5px" } }, {
3321
+ default: a(() => [
3322
+ e(et)
3323
+ ]),
3324
+ _: 1
3325
+ }),
3326
+ t[25] || (t[25] = C(" 编辑数据源 ", -1))
3327
+ ]),
3328
+ _: 1
3329
+ }, 8, ["command"]),
3330
+ e(K, {
3331
+ command: { action: "renameDataSource", data: g },
3332
+ class: "dropdown-item"
3333
+ }, {
3334
+ default: a(() => [
3335
+ e(A, { style: { "margin-right": "5px" } }, {
3336
+ default: a(() => [
3337
+ e(tt)
3338
+ ]),
3339
+ _: 1
3340
+ }),
3341
+ t[26] || (t[26] = C(" 重命名 ", -1))
3342
+ ]),
3343
+ _: 1
3344
+ }, 8, ["command"]),
3345
+ e(K, {
3346
+ command: { action: "deleteDataSource", data: g },
3347
+ class: "dropdown-item"
3348
+ }, {
3349
+ default: a(() => [
3350
+ e(A, { style: { "margin-right": "5px" } }, {
3351
+ default: a(() => [
3352
+ e(Me)
3353
+ ]),
3354
+ _: 1
3355
+ }),
3356
+ t[27] || (t[27] = C(" 删除 ", -1))
3357
+ ]),
3358
+ _: 1
3359
+ }, 8, ["command"]),
3360
+ e(K, {
3361
+ divided: "",
3362
+ command: { action: "addFileSet", data: g },
3363
+ class: "dropdown-item"
3364
+ }, {
3365
+ default: a(() => [
3366
+ e(A, { style: { "margin-right": "5px" } }, {
3367
+ default: a(() => [
3368
+ e(as)
3369
+ ]),
3370
+ _: 1
3371
+ }),
3372
+ t[28] || (t[28] = C(" 添加文件集 ", -1))
3373
+ ]),
3374
+ _: 1
3375
+ }, 8, ["command"]),
3376
+ e(K, {
3377
+ command: { action: "refreshDataSource", data: g },
3378
+ class: "dropdown-item"
3379
+ }, {
3380
+ default: a(() => [
3381
+ e(A, { style: { "margin-right": "5px" } }, {
3382
+ default: a(() => [
3383
+ e(_(st))
3384
+ ]),
3385
+ _: 1
3386
+ }),
3387
+ t[29] || (t[29] = C(" 刷新数据源 ", -1))
3388
+ ]),
3389
+ _: 1
3390
+ }, 8, ["command"]),
3391
+ e(K, {
3392
+ command: { action: "testConnection", data: g },
3393
+ class: "dropdown-item"
3394
+ }, {
3395
+ default: a(() => [
3396
+ e(A, { style: { "margin-right": "5px" } }, {
3397
+ default: a(() => [
3398
+ e(bt)
3399
+ ]),
3400
+ _: 1
3401
+ }),
3402
+ t[30] || (t[30] = C(" 测试连接 ", -1))
3403
+ ]),
3404
+ _: 1
3405
+ }, 8, ["command"])
3406
+ ], 64)) : ne("", !0)
3407
+ ]),
3408
+ _: 2
3409
+ }, 1024)
3410
+ ]),
3411
+ default: a(() => [
3412
+ r("span", {
3413
+ class: "tree-more-btn",
3414
+ onClick: t[3] || (t[3] = $e(() => {
3415
+ }, ["stop"]))
3416
+ }, [
3417
+ e(A, { style: { "margin-right": "5px" } }, {
3418
+ default: a(() => [
3419
+ e(_(ws))
3420
+ ]),
3421
+ _: 1
3422
+ })
3423
+ ])
3424
+ ]),
3425
+ _: 2
3426
+ }, 1024)
3427
+ ])) : ne("", !0)
3428
+ ], 2)
3429
+ ]),
3430
+ _: 1
3431
+ }, 8, ["data", "props", "default-expanded-keys"])),
3432
+ e(os, {
3433
+ ref_key: "singlePopover",
3434
+ ref: J,
3435
+ visible: _(be),
3436
+ placement: _(L),
3437
+ width: "350",
3438
+ trigger: "manual",
3439
+ "popper-class": "custom-tree-popover",
3440
+ title: _(ve),
3441
+ "virtual-ref": _(ge),
3442
+ "virtual-triggering": ""
3443
+ }, {
3444
+ default: a(() => [
3445
+ De((o(), y("div", {
3446
+ class: "popover-content",
3447
+ onMouseenter: Nt,
3448
+ onMouseleave: Ut
3449
+ }, [
3450
+ _(p) ? (o(), y("div", gl, [
3451
+ _(ae) && _(ae).level === 1 ? (o(), y(pe, { key: 0 }, [
3452
+ r("div", yl, [
3453
+ t[31] || (t[31] = r("span", { class: "label" }, "IP地址:", -1)),
3454
+ r("span", _l, Q(_(p).datasourceIp || "--"), 1)
3455
+ ]),
3456
+ r("div", bl, [
3457
+ t[32] || (t[32] = r("span", { class: "label" }, "端口:", -1)),
3458
+ r("span", hl, Q(_(p).datasourcePort || "--"), 1)
3459
+ ]),
3460
+ r("div", Il, [
3461
+ t[33] || (t[33] = r("span", { class: "label" }, "资源描述:", -1)),
3462
+ r("span", wl, Q(_(p).description || "--"), 1)
3463
+ ])
3464
+ ], 64)) : _(ae) && _(ae).level === 4 ? (o(), y(pe, { key: 1 }, [
3465
+ r("div", xl, [
3466
+ t[34] || (t[34] = r("span", { class: "label" }, "资源名称:", -1)),
3467
+ r("span", Vl, Q(_(p).datasetName || "--"), 1)
3468
+ ]),
3469
+ r("div", kl, [
3470
+ t[35] || (t[35] = r("span", { class: "label" }, "模式名:", -1)),
3471
+ r("span", Sl, Q(_(p).schemaName || "--"), 1)
3472
+ ]),
3473
+ r("div", Tl, [
3474
+ t[36] || (t[36] = r("span", { class: "label" }, "资源注释:", -1)),
3475
+ r("span", $l, Q(_(p).datasetComment || "--"), 1)
3476
+ ]),
3477
+ r("div", Cl, [
3478
+ t[37] || (t[37] = r("span", { class: "label" }, "数据量:", -1)),
3479
+ r("span", Pl, Q(_(p).rowCount || "--"), 1)
3480
+ ]),
3481
+ r("div", Kl, [
3482
+ t[38] || (t[38] = r("span", { class: "label" }, "字段数:", -1)),
3483
+ r("span", Nl, Q(_(p).fieldCount || "--") + "个", 1)
3484
+ ]),
3485
+ r("div", Ul, [
3486
+ t[39] || (t[39] = r("span", { class: "label" }, "最后统计信息:", -1)),
3487
+ r("span", Ol, Q(_(p).countTime || "-"), 1)
3488
+ ]),
3489
+ r("div", El, [
3490
+ t[40] || (t[40] = r("span", { class: "label" }, "最后统计状态:", -1)),
3491
+ r("span", Bl, Q(_(p).latestCountState || "-"), 1)
3492
+ ])
3493
+ ], 64)) : ne("", !0)
3494
+ ])) : (o(), y("div", Ll, "暂无详情数据"))
3495
+ ], 32)), [
3496
+ [ht, _(n)]
3497
+ ])
3498
+ ]),
3499
+ _: 1
3500
+ }, 8, ["visible", "placement", "title", "virtual-ref"]),
3501
+ e(is, {
3502
+ title: _(R) === "edit" ? "编辑目录信息" : "添加目录",
3503
+ top: "40vh",
3504
+ modelValue: _(me),
3505
+ "onUpdate:modelValue": t[5] || (t[5] = (Ie) => Pe(me) ? me.value = Ie : null),
3506
+ width: "30%"
3507
+ }, {
3508
+ default: a(() => [
3509
+ e(ns, { "label-width": "80px" }, {
3510
+ default: a(() => [
3511
+ e(rs, { label: "目录名称" }, {
3512
+ default: a(() => [
3513
+ e(_t, {
3514
+ modelValue: _(k),
3515
+ "onUpdate:modelValue": t[4] || (t[4] = (Ie) => Pe(k) ? k.value = Ie : null),
3516
+ placeholder: "请输入目录名称"
3517
+ }, null, 8, ["modelValue"])
3518
+ ]),
3519
+ _: 1
3520
+ })
3521
+ ]),
3522
+ _: 1
3523
+ }),
3524
+ r("div", Al, [
3525
+ e($, { onClick: O }, {
3526
+ default: a(() => [...t[41] || (t[41] = [
3527
+ C("取消", -1)
3528
+ ])]),
3529
+ _: 1
3530
+ }),
3531
+ e($, {
3532
+ type: "primary",
3533
+ onClick: Ot
3534
+ }, {
3535
+ default: a(() => [...t[42] || (t[42] = [
3536
+ C("确定", -1)
3537
+ ])]),
3538
+ _: 1
3539
+ })
3540
+ ])
3541
+ ]),
3542
+ _: 1
3543
+ }, 8, ["title", "modelValue"])
3544
+ ])), [
3545
+ [ht, _(T)]
3546
+ ]);
3547
+ };
3548
+ }
3549
+ }, Fl = /* @__PURE__ */ Oe(Dl, [["__scopeId", "data-v-3e4938a8"]]), Ml = { class: "main" }, Rl = {
3550
+ name: "dataSourceTree"
3551
+ }, Hl = /* @__PURE__ */ Object.assign(Rl, {
3552
+ setup(i) {
3553
+ const P = c(null), x = c(null), j = c(!1), m = (Z) => {
3554
+ x.value = Z, j.value = !0;
3555
+ }, D = () => {
3556
+ j.value = !1;
3557
+ }, T = () => {
3558
+ x.value = null, j.value = !1, P.value.refreshTableConditions();
3559
+ }, w = c(!1), B = c({}), le = async (Z) => {
3560
+ await Qs(Z.id).then((F) => {
3561
+ B.value = { ...F.data };
3562
+ }), w.value = !0;
3563
+ }, Y = () => {
3564
+ w.value = !1;
3565
+ }, X = () => {
3566
+ w.value = !1, B.value = {}, P.value.refreshTableConditions();
3567
+ }, N = c(!1), U = c({}), oe = (Z) => {
3568
+ U.value = { ...Z }, N.value = !0, console.log("handleAddTableOrView", Z);
3569
+ }, re = (Z) => {
3570
+ U.value = {}, P.value.refreshTableConditions();
3571
+ }, R = c(!1), me = c(""), ue = c(""), _e = (Z) => {
3572
+ me.value = Z.id, ue.value = Z.type || "", R.value = !0, console.log("handleAddFileSet", Z);
3573
+ }, de = () => {
3574
+ me.value = "", ue.value = "", P.value.refreshTableConditions();
3575
+ };
3576
+ return (Z, F) => (o(), y("div", Ml, [
3577
+ e(Fl, {
3578
+ ref_key: "treeRef",
3579
+ ref: P,
3580
+ onAddDataSource: m,
3581
+ onAddDataSourceByParent: m,
3582
+ onEditDataSourceByParent: le,
3583
+ onAddTableOrViewByParent: oe,
3584
+ onAddFileSetByParent: _e
3585
+ }, null, 512),
3586
+ _(j) ? (o(), q(ha, {
3587
+ key: 0,
3588
+ addSourceVisible: _(j),
3589
+ "onUpdate:addSourceVisible": F[0] || (F[0] = (ae) => Pe(j) ? j.value = ae : null),
3590
+ onRefresh: T,
3591
+ onClose: D
3592
+ }, null, 8, ["addSourceVisible"])) : ne("", !0),
3593
+ _(w) ? (o(), q(Va, {
3594
+ key: 1,
3595
+ dialogVisible: _(w),
3596
+ "onUpdate:dialogVisible": F[1] || (F[1] = (ae) => Pe(w) ? w.value = ae : null),
3597
+ title: "编辑元数据信息",
3598
+ "base-data": _(B),
3599
+ onRefresh: X,
3600
+ onClose: Y
3601
+ }, null, 8, ["dialogVisible", "base-data"])) : ne("", !0),
3602
+ e(Ca, {
3603
+ visible: _(N),
3604
+ "onUpdate:visible": F[2] || (F[2] = (ae) => Pe(N) ? N.value = ae : null),
3605
+ "data-source-info": _(U),
3606
+ onSuccess: re
3607
+ }, null, 8, ["visible", "data-source-info"]),
3608
+ e(tl, {
3609
+ visible: _(R),
3610
+ "onUpdate:visible": F[3] || (F[3] = (ae) => Pe(R) ? R.value = ae : null),
3611
+ "file-type-datasource-id": _(me),
3612
+ "file-type-datasource-schema": _(ue),
3613
+ onRefresh: de
3614
+ }, null, 8, ["visible", "file-type-datasource-id", "file-type-datasource-schema"])
3615
+ ]));
3616
+ }
3617
+ }), ql = /* @__PURE__ */ Oe(Hl, [["__scopeId", "data-v-46cfca19"]]), zl = [ql], Wl = {
3618
+ install(i) {
3619
+ zl.forEach((P) => {
3620
+ i.component(P.name, P);
3621
+ });
3622
+ },
3623
+ initHttp: Us,
3624
+ initVariable: sl
19
3625
  };
20
3626
  export {
21
- l as dataSourceTree,
22
- m as default
3627
+ ql as dataSourceTree,
3628
+ Wl as default
23
3629
  };