@jeecg/online 3.5.3-beta2 → 3.5.3-vite4

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 (154) hide show
  1. package/AuthButtonConfig-2f71787c.mjs +125 -0
  2. package/AuthButtonTree-d73bccf5.mjs +156 -0
  3. package/AuthDataConfig-32cf23d2.mjs +212 -0
  4. package/AuthDataTree-03d62d3f.mjs +139 -0
  5. package/AuthFieldConfig-b1217a0c.mjs +139 -0
  6. package/AuthFieldTree-888e04a9.mjs +232 -0
  7. package/AuthManagerDrawer-f127b8a2.mjs +114 -0
  8. package/AuthSetterModal-37da78ed.mjs +261 -0
  9. package/CgformCopyList-3adab58f.mjs +245 -0
  10. package/CgformModal-6938d8c2.mjs +613 -0
  11. package/CgreportModal-77ec8c17.mjs +12 -0
  12. package/CgreportModal.vue_vue_type_script_setup_true_lang-52dcec5e.mjs +567 -0
  13. package/CheckDictTable-414313f2.mjs +211 -0
  14. package/CodeFileListModal-4831ce3d.mjs +158 -0
  15. package/CodeFileViewModal-5990dac4.mjs +244 -0
  16. package/CodeGeneratorModal-7df9e25d.mjs +234 -0
  17. package/CustomButtonList-1c9bd859.mjs +363 -0
  18. package/DBAttributeTable-cd1c41e5.mjs +473 -0
  19. package/DbToOnlineModal-dc5d2030.mjs +160 -0
  20. package/DetailForm-e4538e7a.mjs +446 -0
  21. package/EnhanceJavaModal-7f53d2ca.mjs +260 -0
  22. package/EnhanceJsHistory-c30805ce.mjs +184 -0
  23. package/EnhanceJsModal-0b133341.mjs +233 -0
  24. package/EnhanceSqlModal-33a94c83.mjs +259 -0
  25. package/ExtendConfigModal-60f2cf86.mjs +111 -0
  26. package/FieldExtendJsonModal-48f7d67f.mjs +220 -0
  27. package/FileSelectModal-64aaf623.mjs +91 -0
  28. package/ForeignKeyTable-cb1abd1d.mjs +69 -0
  29. package/IndexTable-4e94cd1f.mjs +89 -0
  30. package/JModalTip-abe1515a.mjs +46 -0
  31. package/JOnlineSearchSelect-5608a5cf.mjs +94 -0
  32. package/LeftDepart-ca7a7375.mjs +82 -0
  33. package/LeftRole-d0fa8398.mjs +86 -0
  34. package/LeftUser-0c88c240.mjs +105 -0
  35. package/LinkTableConfigModal-77d7c0b9.mjs +230 -0
  36. package/LinkTableFieldConfigModal-c5689ab0.mjs +178 -0
  37. package/LinkTableListPiece-34266919.mjs +34 -0
  38. package/ModalFormDemo-0eeea994.mjs +78 -0
  39. package/OnlCgformErpList-7a0388d8.mjs +425 -0
  40. package/OnlCgformErpSubTable-fc6ade76.mjs +388 -0
  41. package/OnlineAutoList-85e6a30d.mjs +472 -0
  42. package/OnlineAutoModal-2a146238.mjs +206 -0
  43. package/OnlineAutoTreeList-f8d0e100.mjs +495 -0
  44. package/OnlineCustomModal-456a85a6.mjs +227 -0
  45. package/OnlineDetailModal-f967f080.mjs +177 -0
  46. package/OnlineForm-630a22c2.mjs +778 -0
  47. package/OnlineFormDetail-1b216792.mjs +296 -0
  48. package/OnlineQueryForm-1c5949a7.mjs +378 -0
  49. package/OnlineSearchFormItem-7c2ea9ed.mjs +352 -0
  50. package/OnlineSelectCascade-c7baf52b.mjs +160 -0
  51. package/OnlineSubFormDetail-0aa4966c.mjs +140 -0
  52. package/PageAttributeTable-811185fd.mjs +404 -0
  53. package/ProcessOnlineForm-27be6f6f.mjs +177 -0
  54. package/QueryTable-4ba771ef.mjs +115 -0
  55. package/SuperQuery-3821f984.mjs +845 -0
  56. package/SuperQueryValComponent-471110b5.mjs +8 -0
  57. package/SuperQueryValComponent.vue_vue_type_script_lang-e3ad7ee8.mjs +101 -0
  58. package/auth.api-d3a6c4b3.mjs +39 -0
  59. package/auth.data-8be5c9e3.mjs +141 -0
  60. package/{cgform.data.js → cgform.data-cbdd88c3.mjs} +93 -62
  61. package/constant-fe20103a.mjs +6 -0
  62. package/enhance.api-138e6826.mjs +104 -0
  63. package/enhance.data-efc7e155.mjs +175 -0
  64. package/index-074b92e5.mjs +236 -0
  65. package/index-6a09a912.mjs +58 -0
  66. package/index-9d32ae88.mjs +313 -0
  67. package/main.index.js +7 -1
  68. package/package.json +1 -1
  69. package/style.css +1 -1
  70. package/useCgformList-2d6a5955.mjs +388 -0
  71. package/useExtendComponent-48d37d9b.mjs +3919 -0
  72. package/useListButton-cef1371a.mjs +656 -0
  73. package/useOnlinePopEvent-e9a042f8.mjs +19 -0
  74. package/useOnlineTest-0df0ae86.mjs +43 -0
  75. package/useSchemas-fc8d97ce.mjs +669 -0
  76. package/useTableSync-dc333087.mjs +83 -0
  77. package/AuthButtonConfig.js +0 -147
  78. package/AuthButtonTree.js +0 -183
  79. package/AuthDataConfig.js +0 -246
  80. package/AuthDataTree.js +0 -160
  81. package/AuthFieldConfig.js +0 -170
  82. package/AuthFieldTree.js +0 -281
  83. package/AuthManagerDrawer.js +0 -125
  84. package/AuthSetterModal.js +0 -316
  85. package/CgformCopyList.js +0 -266
  86. package/CgformModal.js +0 -780
  87. package/CgreportModal.js +0 -667
  88. package/CheckDictTable.js +0 -242
  89. package/CodeFileListModal.js +0 -175
  90. package/CodeFileViewModal.js +0 -325
  91. package/CodeGeneratorModal.js +0 -297
  92. package/CustomButtonList.js +0 -410
  93. package/DBAttributeTable.js +0 -526
  94. package/DbToOnlineModal.js +0 -192
  95. package/DetailForm.js +0 -608
  96. package/EnhanceJavaModal.js +0 -298
  97. package/EnhanceJsHistory.js +0 -229
  98. package/EnhanceJsModal.js +0 -293
  99. package/EnhanceSqlModal.js +0 -299
  100. package/ExtendConfigModal.js +0 -151
  101. package/FieldExtendJsonModal.js +0 -283
  102. package/FileSelectModal.js +0 -102
  103. package/ForeignKeyTable.js +0 -79
  104. package/IndexTable.js +0 -97
  105. package/JModalTip.js +0 -54
  106. package/JOnlineSearchSelect.js +0 -115
  107. package/LICENSE +0 -9
  108. package/LeftDepart.js +0 -96
  109. package/LeftRole.js +0 -98
  110. package/LeftUser.js +0 -117
  111. package/LinkTableConfigModal.js +0 -289
  112. package/LinkTableFieldConfigModal.js +0 -218
  113. package/LinkTableListPiece.js +0 -36
  114. package/ModalFormDemo.js +0 -85
  115. package/OnlineAutoList.js +0 -524
  116. package/OnlineAutoModal.js +0 -226
  117. package/OnlineAutoTreeList.js +0 -553
  118. package/OnlineCustomModal.js +0 -286
  119. package/OnlineDetailModal.js +0 -190
  120. package/OnlineForm.js +0 -1018
  121. package/OnlineFormDetail.js +0 -347
  122. package/OnlineQueryForm.js +0 -484
  123. package/OnlineSearchFormItem.js +0 -436
  124. package/OnlineSelectCascade.js +0 -228
  125. package/OnlineSubFormDetail.js +0 -166
  126. package/PageAttributeTable.js +0 -486
  127. package/ProcessOnlineForm.js +0 -208
  128. package/QueryTable.js +0 -129
  129. package/SuperQuery.js +0 -1021
  130. package/SuperQueryValComponent.js +0 -9
  131. package/SuperQueryValComponent.vue_vue_type_script_lang.js +0 -162
  132. package/_arrayPush.js +0 -278
  133. package/_baseClone.js +0 -471
  134. package/_baseSlice.js +0 -18
  135. package/_commonjsHelpers.js +0 -5
  136. package/_flatRest.js +0 -174
  137. package/auth.api.js +0 -43
  138. package/auth.data.js +0 -142
  139. package/clipboard.js +0 -565
  140. package/enhance.api.js +0 -129
  141. package/enhance.data.js +0 -196
  142. package/index.js +0 -87
  143. package/index2.js +0 -340
  144. package/index3.js +0 -264
  145. package/isArray.js +0 -47
  146. package/omit.js +0 -60
  147. package/pick.js +0 -68
  148. package/toString.js +0 -31
  149. package/useCgformList.js +0 -470
  150. package/useExtendComponent.js +0 -5205
  151. package/useListButton.js +0 -923
  152. package/useOnlineTest.js +0 -44
  153. package/useSchemas.js +0 -653
  154. package/useTableSync.js +0 -117
package/CgreportModal.js DELETED
@@ -1,667 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __async = (__this, __arguments, generator) => {
21
- return new Promise((resolve, reject) => {
22
- var fulfilled = (value) => {
23
- try {
24
- step(generator.next(value));
25
- } catch (e) {
26
- reject(e);
27
- }
28
- };
29
- var rejected = (value) => {
30
- try {
31
- step(generator.throw(value));
32
- } catch (e) {
33
- reject(e);
34
- }
35
- };
36
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
37
- step((generator = generator.apply(__this, __arguments)).next());
38
- });
39
- };
40
- import { defineComponent, ref, reactive, unref, computed, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createVNode, createElementVNode, createTextVNode } from "vue";
41
- import { useModalInner, BasicModal } from "/@/components/Modal";
42
- import { useForm, BasicForm } from "/@/components/Form/index";
43
- import { useJvxeMethod } from "/@/hooks/system/useJvxeMethods.ts";
44
- import { JVxeTypes } from "/@/components/jeecg/JVxeTable/types";
45
- import { duplicateCheck } from "/@/views/system/user/user.api";
46
- import { defHttp } from "/@/utils/http/axios";
47
- import { useMessage } from "/@/hooks/web/useMessage";
48
- const { createConfirm } = useMessage();
49
- const onlCgreportParamList = "/online/cgreport/param/listByHeadId";
50
- const onlCgreportItemList = "/online/cgreport/item/listByHeadId";
51
- const list = (params) => defHttp.get({ url: "/online/cgreport/head/list", params });
52
- const deleteOne = (params, handleSuccess) => {
53
- return defHttp.delete({ url: "/online/cgreport/head/delete", params }, { joinParamsToUrl: true }).then(() => {
54
- handleSuccess();
55
- });
56
- };
57
- const batchDelete = (params, handleSuccess) => {
58
- createConfirm({
59
- title: "\u786E\u8BA4\u5220\u9664",
60
- content: "\u662F\u5426\u5220\u9664\u9009\u4E2D\u6570\u636E",
61
- okText: "\u786E\u8BA4",
62
- cancelText: "\u53D6\u6D88",
63
- iconType: "warning",
64
- onOk: () => {
65
- return defHttp.delete({ url: "/online/cgreport/head/deleteBatch", data: params }, { joinParamsToUrl: true }).then(() => {
66
- handleSuccess();
67
- });
68
- }
69
- });
70
- };
71
- const saveOrUpdate = (params, isUpdate) => {
72
- if (isUpdate) {
73
- return defHttp.put({ url: "/online/cgreport/head/editAll", params });
74
- } else {
75
- return defHttp.post({ url: "/online/cgreport/head/add", params });
76
- }
77
- };
78
- const getReportParam = (id) => {
79
- return defHttp.get({ url: "/online/cgreport/api/getParamsInfo/" + id });
80
- };
81
- const getDataSourceList = () => {
82
- return defHttp.get({ url: "/sys/dataSource/options" });
83
- };
84
- const analyzeSql = (params) => {
85
- return defHttp.get({
86
- url: "/online/cgreport/head/parseSql?" + params
87
- });
88
- };
89
- const columns = [
90
- {
91
- title: "\u62A5\u8868\u540D\u5B57",
92
- align: "center",
93
- dataIndex: "name",
94
- width: 120
95
- },
96
- {
97
- title: "\u62A5\u8868\u7F16\u7801",
98
- align: "center",
99
- dataIndex: "code",
100
- width: 120
101
- },
102
- {
103
- title: "\u62A5\u8868SQL",
104
- align: "center",
105
- dataIndex: "cgrSql",
106
- width: 360
107
- },
108
- {
109
- title: "\u6570\u636E\u6E90",
110
- align: "center",
111
- dataIndex: "dbSource",
112
- width: 120
113
- },
114
- {
115
- title: "\u521B\u5EFA\u65F6\u95F4",
116
- align: "center",
117
- dataIndex: "createTime",
118
- width: 120
119
- }
120
- ];
121
- const searchFormSchema = [
122
- {
123
- label: "\u62A5\u8868\u540D\u79F0",
124
- field: "name",
125
- component: "JInput"
126
- },
127
- {
128
- label: "\u62A5\u8868\u7F16\u7801",
129
- field: "code",
130
- component: "JInput"
131
- }
132
- ];
133
- const codePattern = /^[a-z|A-Z][a-z|A-Z|\d|_|-]{0,}$/;
134
- const formSchema = [
135
- {
136
- label: "",
137
- field: "id",
138
- component: "Input",
139
- show: false
140
- },
141
- {
142
- label: "\u62A5\u8868\u7F16\u7801",
143
- field: "code",
144
- component: "Input",
145
- colProps: {
146
- sm: 24,
147
- xs: 24,
148
- md: 12,
149
- lg: 8,
150
- xl: 8,
151
- xxl: 8
152
- },
153
- dynamicRules: ({ values, model }) => {
154
- console.log("values:", values);
155
- return [
156
- {
157
- required: true,
158
- validator: (_, value) => {
159
- return new Promise((resolve, reject) => {
160
- if (!value) {
161
- return reject("\u8BF7\u8F93\u5165\u62A5\u8868\u7F16\u7801\uFF01");
162
- }
163
- if (!codePattern.test(value)) {
164
- return reject("\u7F16\u7801\u5FC5\u987B\u4EE5\u5B57\u6BCD\u5F00\u5934\uFF0C\u53EF\u5305\u542B\u6570\u5B57\u3001\u4E0B\u5212\u7EBF\u3001\u6A2A\u6760\uFF01");
165
- }
166
- let params = {
167
- tableName: "onl_cgreport_head",
168
- fieldName: "code",
169
- fieldVal: value,
170
- dataId: model.id
171
- };
172
- duplicateCheck(params).then((res) => {
173
- res.success ? resolve() : reject("\u62A5\u8868\u7F16\u7801\u5DF2\u5B58\u5728!");
174
- }).catch((err) => {
175
- reject(err.message || "\u6821\u9A8C\u5931\u8D25");
176
- });
177
- });
178
- }
179
- }
180
- ];
181
- }
182
- },
183
- {
184
- label: "\u62A5\u8868\u540D\u5B57",
185
- field: "name",
186
- component: "Input",
187
- colProps: {
188
- sm: 24,
189
- xs: 24,
190
- md: 12,
191
- lg: 8,
192
- xl: 8,
193
- xxl: 8
194
- },
195
- dynamicRules: () => {
196
- return [{ required: true, message: "\u8BF7\u8F93\u5165\u62A5\u8868\u540D\u5B57!" }];
197
- }
198
- },
199
- {
200
- label: "\u52A8\u6001\u6570\u636E\u6E90",
201
- field: "dbSource",
202
- colProps: {
203
- sm: 24,
204
- xs: 24,
205
- md: 12,
206
- lg: 8,
207
- xl: 8,
208
- xxl: 8
209
- },
210
- component: "ApiSelect",
211
- componentProps: {
212
- api: getDataSourceList
213
- }
214
- },
215
- {
216
- label: "\u62A5\u8868SQL",
217
- field: "cgrSql",
218
- component: "JCodeEditor",
219
- rules: [{ required: true, message: "\u8BF7\u586B\u5199\u62A5\u8868SQL" }],
220
- itemProps: {
221
- labelCol: { xs: 24, sm: 2 },
222
- wrapperCol: { xs: 24, sm: 22 }
223
- },
224
- componentProps: {
225
- height: "200px",
226
- fullScreen: true
227
- },
228
- colProps: {
229
- span: 20
230
- }
231
- },
232
- {
233
- label: " ",
234
- field: "analyseButton",
235
- component: "Input",
236
- slot: "analyseButton",
237
- colProps: {
238
- span: 4
239
- },
240
- itemProps: {
241
- labelCol: { xs: 1, sm: 1 },
242
- wrapperCol: { xs: 23, sm: 23 },
243
- colon: false
244
- }
245
- }
246
- ];
247
- const onlCgreportParamColumns = [
248
- {
249
- title: "\u53C2\u6570\u5B57\u6BB5",
250
- key: "paramName",
251
- type: JVxeTypes.input,
252
- width: "200px",
253
- placeholder: "\u8BF7\u8F93\u5165${title}",
254
- defaultValue: "",
255
- validateRules: [{ required: true, message: "${title}\u4E0D\u80FD\u4E3A\u7A7A" }]
256
- },
257
- {
258
- title: "\u53C2\u6570\u6587\u672C",
259
- key: "paramTxt",
260
- type: JVxeTypes.input,
261
- width: "200px",
262
- placeholder: "\u8BF7\u8F93\u5165${title}",
263
- defaultValue: "",
264
- validateRules: [{ required: true, message: "${title}\u4E0D\u80FD\u4E3A\u7A7A" }]
265
- },
266
- {
267
- title: "\u53C2\u6570\u9ED8\u8BA4\u503C",
268
- key: "paramValue",
269
- type: JVxeTypes.input,
270
- width: "200px",
271
- placeholder: "\u8BF7\u8F93\u5165${title}",
272
- defaultValue: ""
273
- }
274
- ];
275
- const onlCgreportItemColumns = [
276
- {
277
- title: "\u5B57\u6BB5\u540D\u5B57",
278
- key: "fieldName",
279
- type: JVxeTypes.input,
280
- minWidth: "150px",
281
- placeholder: "\u8BF7\u8F93\u5165${title}",
282
- defaultValue: "",
283
- validateRules: [{ required: true, message: "${title}\u4E0D\u80FD\u4E3A\u7A7A" }]
284
- },
285
- {
286
- title: "\u5B57\u6BB5\u6587\u672C",
287
- key: "fieldTxt",
288
- type: JVxeTypes.input,
289
- minWidth: "150px",
290
- placeholder: "\u8BF7\u8F93\u5165${title}",
291
- defaultValue: "",
292
- validateRules: [{ required: true, message: "${title}\u4E0D\u80FD\u4E3A\u7A7A" }]
293
- },
294
- {
295
- title: "\u5B57\u6BB5\u7C7B\u578B",
296
- key: "fieldType",
297
- minWidth: "150px",
298
- placeholder: "\u8BF7\u8F93\u5165${title}",
299
- defaultValue: "",
300
- validateRules: [{ required: true, message: "${title}\u4E0D\u80FD\u4E3A\u7A7A" }],
301
- type: JVxeTypes.select,
302
- options: [
303
- { title: "\u6570\u503C\u7C7B\u578B", value: "Integer" },
304
- { title: "\u5B57\u7B26\u7C7B\u578B", value: "String" },
305
- { title: "\u65E5\u671F\u7C7B\u578B", value: "Date" },
306
- { title: "\u65F6\u95F4\u7C7B\u578B", value: "Datetime" },
307
- { title: "\u957F\u6574\u578B", value: "Long" }
308
- ]
309
- },
310
- {
311
- title: "\u662F\u5426\u663E\u793A",
312
- key: "isShow",
313
- minWidth: "80px",
314
- align: "center",
315
- type: JVxeTypes.checkbox,
316
- customValue: [1, 0],
317
- defaultChecked: true
318
- },
319
- {
320
- title: "\u5B57\u6BB5href",
321
- key: "fieldHref",
322
- type: JVxeTypes.input,
323
- minWidth: "150px",
324
- placeholder: "\u8BF7\u8F93\u5165${title}",
325
- defaultValue: ""
326
- },
327
- {
328
- title: "\u67E5\u8BE2\u6A21\u5F0F",
329
- key: "searchMode",
330
- type: JVxeTypes.select,
331
- minWidth: "150px",
332
- placeholder: "\u8BF7\u9009\u62E9${title}",
333
- options: [
334
- { title: "\u5355\u6761\u4EF6\u67E5\u8BE2", value: "single" },
335
- { title: "\u8303\u56F4\u67E5\u8BE2", value: "group" }
336
- ]
337
- },
338
- {
339
- title: "\u53D6\u503C\u8868\u8FBE\u5F0F",
340
- key: "replaceVal",
341
- type: JVxeTypes.input,
342
- minWidth: "150px",
343
- placeholder: "\u8BF7\u8F93\u5165${title}",
344
- defaultValue: ""
345
- },
346
- {
347
- title: "\u5B57\u5178code",
348
- key: "dictCode",
349
- type: JVxeTypes.input,
350
- minWidth: "150px",
351
- placeholder: "\u8BF7\u8F93\u5165${title}",
352
- defaultValue: ""
353
- },
354
- {
355
- title: "\u5206\u7EC4\u6807\u9898",
356
- key: "groupTitle",
357
- type: JVxeTypes.input,
358
- minWidth: "150px",
359
- placeholder: "\u8BF7\u8F93\u5165${title}",
360
- defaultValue: ""
361
- },
362
- {
363
- title: "\u662F\u5426\u67E5\u8BE2",
364
- key: "isSearch",
365
- type: JVxeTypes.checkbox,
366
- customValue: ["1", "0"],
367
- minWidth: "80px",
368
- align: "center",
369
- defaultChecked: false
370
- },
371
- {
372
- title: "\u662F\u5426\u5408\u8BA1",
373
- align: "center",
374
- key: "isTotal",
375
- type: JVxeTypes.checkbox,
376
- customValue: ["1", "0"],
377
- minWidth: "80px",
378
- defaultChecked: false
379
- }
380
- ];
381
- const _hoisted_1 = { style: { "flex": "1", "text-align": "left" } };
382
- const _hoisted_2 = /* @__PURE__ */ createElementVNode("br", null, null, -1);
383
- const _hoisted_3 = /* @__PURE__ */ createElementVNode("br", null, null, -1);
384
- const _hoisted_4 = /* @__PURE__ */ createElementVNode("br", null, null, -1);
385
- const _hoisted_5 = /* @__PURE__ */ createElementVNode("br", null, null, -1);
386
- const _hoisted_6 = /* @__PURE__ */ createElementVNode("br", null, null, -1);
387
- const _hoisted_7 = /* @__PURE__ */ createElementVNode("span", { style: { "color": "red" } }, "\u6CE8\uFF1A\u53C2\u6570\u53EA\u652F\u6301\u52A8\u6001\u62A5\u8868\uFF0Cpopup\u6682\u4E0D\u652F\u6301", -1);
388
- const _sfc_main = /* @__PURE__ */ defineComponent({
389
- __name: "CgreportModal",
390
- emits: ["register", "success"],
391
- setup(__props, { emit }) {
392
- const { createMessage } = useMessage();
393
- const isUpdate = ref(true);
394
- const confirmLoading = ref(true);
395
- const refKeys = ref(["onlCgreportItem", "onlCgreportParam"]);
396
- const activeKey = ref("onlCgreportItem");
397
- const onlCgreportParam = ref();
398
- const onlCgreportItem = ref();
399
- const tableRefs = { onlCgreportItem, onlCgreportParam };
400
- const onlCgreportParamTable = reactive({
401
- loading: false,
402
- dataSource: [],
403
- columns: onlCgreportParamColumns
404
- });
405
- const onlCgreportItemTable = reactive({
406
- loading: false,
407
- dataSource: [],
408
- columns: onlCgreportItemColumns
409
- });
410
- const [registerForm, { setProps, resetFields, setFieldsValue, validate, validateFields }] = useForm({
411
- schemas: formSchema,
412
- showActionButtonGroup: false
413
- });
414
- const [registerModal, { setModalProps, closeModal }] = useModalInner((data) => __async(this, null, function* () {
415
- var _a, _b;
416
- yield reset();
417
- setModalProps({ confirmLoading: false, showCancelBtn: data == null ? void 0 : data.showFooter, showOkBtn: data == null ? void 0 : data.showFooter });
418
- isUpdate.value = !!(data == null ? void 0 : data.isUpdate);
419
- if (unref(isUpdate)) {
420
- yield setFieldsValue(__spreadValues({}, data.record));
421
- requestSubTableData(onlCgreportParamList, { headId: (_a = data == null ? void 0 : data.record) == null ? void 0 : _a.id }, onlCgreportParamTable);
422
- requestSubTableData(onlCgreportItemList, { headId: (_b = data == null ? void 0 : data.record) == null ? void 0 : _b.id }, onlCgreportItemTable);
423
- }
424
- setProps({ disabled: !(data == null ? void 0 : data.showFooter) });
425
- }));
426
- const [handleChangeTabs, handleSubmit, requestSubTableData, formRef] = useJvxeMethod(
427
- requestAddOrEdit,
428
- classifyIntoFormData,
429
- tableRefs,
430
- activeKey,
431
- refKeys
432
- );
433
- const title = computed(() => !unref(isUpdate) ? "\u65B0\u589E" : "\u7F16\u8F91");
434
- function reset() {
435
- return __async(this, null, function* () {
436
- yield resetFields();
437
- activeKey.value = "onlCgreportItem";
438
- onlCgreportParamTable.dataSource = [];
439
- onlCgreportItemTable.dataSource = [];
440
- });
441
- }
442
- function classifyIntoFormData(allValues) {
443
- let main = Object.assign({}, allValues.formValue);
444
- return __spreadProps(__spreadValues({}, main), {
445
- onlCgreportParamList: allValues.tablesValue[1].tableData,
446
- onlCgreportItemList: allValues.tablesValue[0].tableData
447
- });
448
- }
449
- function requestAddOrEdit(values) {
450
- return __async(this, null, function* () {
451
- try {
452
- setModalProps({ confirmLoading: true });
453
- let params = [], items = [], head = {};
454
- Object.keys(values).map((k) => {
455
- if (k == "onlCgreportItemList") {
456
- items = values[k];
457
- } else if (k == "onlCgreportParamList") {
458
- params = values[k];
459
- } else {
460
- head[k] = values[k];
461
- }
462
- });
463
- let obj = { head, params, items };
464
- console.log("\u62A5\u8868\u914D\u7F6E\u4FDD\u5B58\u8BF7\u6C42\u53C2\u6570", obj);
465
- yield saveOrUpdate(obj, isUpdate.value);
466
- closeModal();
467
- emit("success");
468
- } finally {
469
- setModalProps({ confirmLoading: false });
470
- }
471
- });
472
- }
473
- function handleSQLAnalyze() {
474
- setModalProps({ confirmLoading: true });
475
- validateFields(["cgrSql", "dbSource"]).then((values) => {
476
- let { cgrSql, dbSource } = values;
477
- let urlParam = "sql=" + encodeURIComponent(cgrSql);
478
- if (dbSource) {
479
- urlParam += "&dbKey=" + dbSource;
480
- }
481
- console.log("urlParam----", urlParam);
482
- analyzeSql(urlParam).then((res) => {
483
- if (res) {
484
- createMessage.success("\u89E3\u6790\u6210\u529F");
485
- let { fields, params } = res;
486
- let newFields = fields.filter((item) => item.fieldName != "__row_number__");
487
- let itemDataSource = onlCgreportItem.value.getTableData();
488
- let newItemDataList = getTabData(itemDataSource, newFields || [], "fieldName");
489
- newItemDataList = newItemDataList.sort((a, b) => a.orderNum - b.orderNum);
490
- onlCgreportItemTable.dataSource = newItemDataList;
491
- let paramDataSource = onlCgreportParam.value.getTableData();
492
- let newParamList = getTabData(paramDataSource, params || [], "paramName");
493
- newParamList = newParamList.sort((a, b) => a.orderNum - b.orderNum);
494
- onlCgreportParamTable.dataSource = newParamList;
495
- }
496
- });
497
- }).catch(() => {
498
- console.log("\u89E3\u6790\u5931\u8D25");
499
- }).finally(() => {
500
- setModalProps({ confirmLoading: false });
501
- });
502
- }
503
- function getTabData(old_arr, new_arr, columnName) {
504
- if (old_arr.length > 0) {
505
- let need = [], field_arr = [], max_order = 1;
506
- for (let t of new_arr) {
507
- for (let o of old_arr) {
508
- if (o[columnName] == t[columnName]) {
509
- need.push(o);
510
- field_arr.push(t[columnName]);
511
- if (o.orderNum > max_order) {
512
- max_order = o.orderNum;
513
- }
514
- break;
515
- }
516
- }
517
- }
518
- for (let t of new_arr) {
519
- if (field_arr.indexOf(t[columnName]) < 0) {
520
- t.orderNum = ++max_order;
521
- need.push(t);
522
- }
523
- }
524
- return need;
525
- } else {
526
- let max_order = 0;
527
- for (let t of new_arr) {
528
- if (!t.orderNum) {
529
- t.orderNum = ++max_order;
530
- }
531
- }
532
- return new_arr;
533
- }
534
- }
535
- return (_ctx, _cache) => {
536
- const _component_a_icon = resolveComponent("a-icon");
537
- const _component_a_popover = resolveComponent("a-popover");
538
- const _component_a_button = resolveComponent("a-button");
539
- const _component_a_divider = resolveComponent("a-divider");
540
- const _component_JVxeTable = resolveComponent("JVxeTable");
541
- const _component_a_tab_pane = resolveComponent("a-tab-pane");
542
- const _component_a_tabs = resolveComponent("a-tabs");
543
- return openBlock(), createBlock(unref(BasicModal), mergeProps(_ctx.$attrs, {
544
- onRegister: unref(registerModal),
545
- title: unref(title),
546
- width: 1200,
547
- maskClosable: false,
548
- defaultFullscreen: true,
549
- confirmLoading: confirmLoading.value,
550
- onOk: unref(handleSubmit)
551
- }), {
552
- default: withCtx(() => [
553
- createVNode(unref(BasicForm), {
554
- onRegister: unref(registerForm),
555
- ref_key: "formRef",
556
- ref: formRef
557
- }, {
558
- analyseButton: withCtx(() => [
559
- createElementVNode("div", _hoisted_1, [
560
- createVNode(_component_a_popover, {
561
- title: "\u4F7F\u7528\u6307\u5357",
562
- trigger: "hover",
563
- style: { "margin": "0 10px 0 6px" }
564
- }, {
565
- content: withCtx(() => [
566
- createTextVNode(" \u60A8\u53EF\u4EE5\u952E\u5165\u201C\u201D\u4F5C\u4E3A\u4E00\u4E2A\u53C2\u6570\uFF0C\u8FD9\u91CCabc\u662F\u53C2\u6570\u7684\u540D\u79F0\u3002\u4F8B\u5982\uFF1A"),
567
- _hoisted_2,
568
- createTextVNode(" select * from table where id = ${abc}\u3002"),
569
- _hoisted_3,
570
- createTextVNode(" select * from table where id like concat('%',${abc},'%')\u3002(mysql\u6A21\u7CCA\u67E5\u8BE2)"),
571
- _hoisted_4,
572
- createTextVNode(" select * from table where id like '%'||${abc}||'%'\u3002(oracle\u6A21\u7CCA\u67E5\u8BE2)"),
573
- _hoisted_5,
574
- createTextVNode(" select * from table where id like '%'+${abc}+'%'\u3002(sqlserver\u6A21\u7CCA\u67E5\u8BE2)"),
575
- _hoisted_6,
576
- _hoisted_7
577
- ]),
578
- default: withCtx(() => [
579
- createVNode(_component_a_icon, { type: "question-circle" })
580
- ]),
581
- _: 1
582
- }),
583
- createVNode(_component_a_button, {
584
- style: { "margin-left": "10px" },
585
- type: "primary",
586
- onClick: handleSQLAnalyze
587
- }, {
588
- default: withCtx(() => [
589
- createTextVNode("SQL\u89E3\u6790")
590
- ]),
591
- _: 1
592
- })
593
- ])
594
- ]),
595
- _: 1
596
- }, 8, ["onRegister"]),
597
- createVNode(_component_a_divider, {
598
- style: { "margin": "1px 0" },
599
- class: "cust-divider"
600
- }),
601
- createVNode(_component_a_tabs, {
602
- activeKey: activeKey.value,
603
- "onUpdate:activeKey": _cache[0] || (_cache[0] = ($event) => activeKey.value = $event),
604
- animated: "",
605
- onChange: unref(handleChangeTabs)
606
- }, {
607
- default: withCtx(() => [
608
- (openBlock(), createBlock(_component_a_tab_pane, {
609
- tab: "\u52A8\u6001\u62A5\u8868\u914D\u7F6E\u660E\u7EC6",
610
- key: refKeys.value[0],
611
- forceRender: true
612
- }, {
613
- default: withCtx(() => [
614
- createVNode(_component_JVxeTable, {
615
- "keep-source": "",
616
- dragSort: "",
617
- resizable: "",
618
- ref_key: "onlCgreportItem",
619
- ref: onlCgreportItem,
620
- loading: onlCgreportItemTable.loading,
621
- columns: onlCgreportItemTable.columns,
622
- dataSource: onlCgreportItemTable.dataSource,
623
- height: 390,
624
- rowNumber: true,
625
- rowSelection: true,
626
- toolbar: true
627
- }, null, 8, ["loading", "columns", "dataSource"])
628
- ]),
629
- _: 1
630
- })),
631
- (openBlock(), createBlock(_component_a_tab_pane, {
632
- tab: "\u62A5\u8868\u53C2\u6570",
633
- key: refKeys.value[1],
634
- forceRender: true
635
- }, {
636
- default: withCtx(() => [
637
- createVNode(_component_JVxeTable, {
638
- "keep-source": "",
639
- resizable: "",
640
- dragSort: "",
641
- ref_key: "onlCgreportParam",
642
- ref: onlCgreportParam,
643
- loading: onlCgreportParamTable.loading,
644
- columns: onlCgreportParamTable.columns,
645
- dataSource: onlCgreportParamTable.dataSource,
646
- height: 390,
647
- rowNumber: true,
648
- rowSelection: true,
649
- toolbar: true
650
- }, null, 8, ["loading", "columns", "dataSource"])
651
- ]),
652
- _: 1
653
- }))
654
- ]),
655
- _: 1
656
- }, 8, ["activeKey", "onChange"])
657
- ]),
658
- _: 1
659
- }, 16, ["onRegister", "title", "confirmLoading", "onOk"]);
660
- };
661
- }
662
- });
663
- var CgreportModal = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
664
- __proto__: null,
665
- "default": _sfc_main
666
- }, Symbol.toStringTag, { value: "Module" }));
667
- export { CgreportModal as C, _sfc_main as _, batchDelete as b, columns as c, deleteOne as d, getReportParam as g, list as l, searchFormSchema as s };