@jeecg/online 3.5.3-beta3 → 3.6.0-beta

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 (163) hide show
  1. package/AuthButtonConfig-b6a674fa.mjs +125 -0
  2. package/AuthButtonTree-09e57bc4.mjs +156 -0
  3. package/AuthDataConfig-6e7e61ec.mjs +212 -0
  4. package/AuthDataTree-e83286c5.mjs +139 -0
  5. package/AuthFieldConfig-f1ec2708.mjs +139 -0
  6. package/AuthFieldTree-bb72e21f.mjs +232 -0
  7. package/AuthManagerDrawer-28a2d108.mjs +114 -0
  8. package/AuthSetterModal-2990d553.mjs +261 -0
  9. package/CgformCopyList-36a4cbf0.mjs +246 -0
  10. package/CgformModal-7399a5ac.mjs +611 -0
  11. package/CgreportModal-2eb9c9e1.mjs +13 -0
  12. package/CgreportModal.vue_vue_type_script_setup_true_lang-c2ceb064.mjs +566 -0
  13. package/CheckDictTable-3a8a54b3.mjs +211 -0
  14. package/CodeFileListModal-72f0d3bb.mjs +158 -0
  15. package/CodeFileViewModal-9eb88c47.mjs +244 -0
  16. package/CodeGeneratorModal-a89958f5.mjs +233 -0
  17. package/CustomButtonList-c44aec5a.mjs +363 -0
  18. package/DBAttributeTable-7d285e8d.mjs +473 -0
  19. package/DbToOnlineModal-d23cbeb1.mjs +160 -0
  20. package/DetailForm-2901d215.mjs +461 -0
  21. package/EnhanceJavaModal-153899a9.mjs +264 -0
  22. package/EnhanceJsHistory-7f5db3b1.mjs +184 -0
  23. package/EnhanceJsModal-c2fb75b8.mjs +311 -0
  24. package/EnhanceSqlModal-965e9b0a.mjs +268 -0
  25. package/ExtendConfigModal-8f08466f.mjs +111 -0
  26. package/FieldExtendJsonModal-adfcf5a7.mjs +219 -0
  27. package/FileSelectModal-432d4521.mjs +103 -0
  28. package/ForeignKeyTable-faab7ccf.mjs +69 -0
  29. package/IndexTable-0a2d3718.mjs +89 -0
  30. package/JModalTip-e1938b49.mjs +46 -0
  31. package/JOnlineSearchSelect-7e908492.mjs +95 -0
  32. package/LeftDepart-54f245b3.mjs +82 -0
  33. package/LeftRole-c138f892.mjs +86 -0
  34. package/LeftUser-9c812f8a.mjs +105 -0
  35. package/LinkTableConfigModal-c2c5c7e6.mjs +230 -0
  36. package/LinkTableFieldConfigModal-a3553b1f.mjs +176 -0
  37. package/LinkTableListPiece-7f793b08.mjs +34 -0
  38. package/ModalFormDemo-65685b0e.mjs +78 -0
  39. package/OnlCgformErpList-52c87ed3.mjs +449 -0
  40. package/OnlCgformErpSubTable-6e7fb17b.mjs +398 -0
  41. package/OnlCgformInnerSubTable-f0727b8f.mjs +248 -0
  42. package/OnlCgformInnerTableList-9f89c173.mjs +430 -0
  43. package/OnlCgformTabList-15516315.mjs +390 -0
  44. package/OnlineAutoList-63a0224f.mjs +474 -0
  45. package/OnlineAutoModal-ffe19c3f.mjs +206 -0
  46. package/OnlineAutoTreeList-317c7105.mjs +495 -0
  47. package/OnlineCustomModal-3939ce78.mjs +227 -0
  48. package/OnlineDetailModal-bfb1375f.mjs +177 -0
  49. package/OnlineForm-069f6092.mjs +749 -0
  50. package/OnlineFormDetail-ad5735fb.mjs +296 -0
  51. package/OnlineQueryForm-0771c80f.mjs +385 -0
  52. package/OnlineSearchFormItem-0db5834f.mjs +348 -0
  53. package/OnlineSelectCascade-a05c30f4.mjs +159 -0
  54. package/OnlineSubFormDetail-583d01eb.mjs +142 -0
  55. package/OnlineTabAutoModal-747e071d.mjs +253 -0
  56. package/OnlineTabDetailModal-887f0174.mjs +222 -0
  57. package/OnlineTabForm-b1dcd4b4.mjs +765 -0
  58. package/OnlineTabFormDetail-8e494a96.mjs +323 -0
  59. package/PageAttributeTable-5966b201.mjs +404 -0
  60. package/ProcessOnlineForm-4382bea7.mjs +177 -0
  61. package/QueryTable-6e8053ad.mjs +115 -0
  62. package/README.md +2 -1
  63. package/SuperQuery-78db6998.mjs +841 -0
  64. package/SuperQueryValComponent-471110b5.mjs +8 -0
  65. package/SuperQueryValComponent.vue_vue_type_script_lang-e3ad7ee8.mjs +101 -0
  66. package/auth.api-d3a6c4b3.mjs +39 -0
  67. package/auth.data-8be5c9e3.mjs +141 -0
  68. package/{cgform.data.js → cgform.data-cbdd88c3.mjs} +93 -62
  69. package/constant-754f1a9d.mjs +9 -0
  70. package/enhance.api-138e6826.mjs +104 -0
  71. package/enhance.data-efc7e155.mjs +175 -0
  72. package/index-0a93652b.mjs +237 -0
  73. package/index-7e9a23f2.mjs +1494 -0
  74. package/index-b70302f2.mjs +56 -0
  75. package/main.index.js +7 -1
  76. package/package.json +1 -1
  77. package/style.css +1 -1
  78. package/useCgformList-0c603af1.mjs +424 -0
  79. package/useCustomHook-acb00837.mjs +53 -0
  80. package/useExtendComponent-aa1cdfc8.mjs +3917 -0
  81. package/useListButton-0f18bf6a.mjs +671 -0
  82. package/useOnlinePopEvent-687070b7.mjs +19 -0
  83. package/useOnlineTest-e4bd8be3.mjs +42 -0
  84. package/useSchemas-43429d80.mjs +685 -0
  85. package/useTableSync-774c3774.mjs +87 -0
  86. package/AuthButtonConfig.js +0 -147
  87. package/AuthButtonTree.js +0 -183
  88. package/AuthDataConfig.js +0 -246
  89. package/AuthDataTree.js +0 -160
  90. package/AuthFieldConfig.js +0 -170
  91. package/AuthFieldTree.js +0 -281
  92. package/AuthManagerDrawer.js +0 -125
  93. package/AuthSetterModal.js +0 -316
  94. package/CgformCopyList.js +0 -266
  95. package/CgformModal.js +0 -780
  96. package/CgreportModal.js +0 -667
  97. package/CheckDictTable.js +0 -242
  98. package/CodeFileListModal.js +0 -175
  99. package/CodeFileViewModal.js +0 -325
  100. package/CodeGeneratorModal.js +0 -297
  101. package/CustomButtonList.js +0 -410
  102. package/DBAttributeTable.js +0 -526
  103. package/DbToOnlineModal.js +0 -192
  104. package/DetailForm.js +0 -608
  105. package/EnhanceJavaModal.js +0 -298
  106. package/EnhanceJsHistory.js +0 -229
  107. package/EnhanceJsModal.js +0 -293
  108. package/EnhanceSqlModal.js +0 -299
  109. package/ExtendConfigModal.js +0 -151
  110. package/FieldExtendJsonModal.js +0 -283
  111. package/FileSelectModal.js +0 -102
  112. package/ForeignKeyTable.js +0 -79
  113. package/IndexTable.js +0 -97
  114. package/JModalTip.js +0 -54
  115. package/JOnlineSearchSelect.js +0 -115
  116. package/LICENSE +0 -9
  117. package/LeftDepart.js +0 -96
  118. package/LeftRole.js +0 -98
  119. package/LeftUser.js +0 -117
  120. package/LinkTableConfigModal.js +0 -289
  121. package/LinkTableFieldConfigModal.js +0 -218
  122. package/LinkTableListPiece.js +0 -36
  123. package/ModalFormDemo.js +0 -85
  124. package/OnlineAutoList.js +0 -523
  125. package/OnlineAutoModal.js +0 -226
  126. package/OnlineAutoTreeList.js +0 -552
  127. package/OnlineCustomModal.js +0 -286
  128. package/OnlineDetailModal.js +0 -190
  129. package/OnlineForm.js +0 -1016
  130. package/OnlineFormDetail.js +0 -347
  131. package/OnlineQueryForm.js +0 -484
  132. package/OnlineSearchFormItem.js +0 -436
  133. package/OnlineSelectCascade.js +0 -228
  134. package/OnlineSubFormDetail.js +0 -166
  135. package/PageAttributeTable.js +0 -486
  136. package/ProcessOnlineForm.js +0 -208
  137. package/QueryTable.js +0 -129
  138. package/SuperQuery.js +0 -1020
  139. package/SuperQueryValComponent.js +0 -8
  140. package/SuperQueryValComponent.vue_vue_type_script_lang.js +0 -168
  141. package/_arrayPush.js +0 -278
  142. package/_baseClone.js +0 -471
  143. package/_baseSlice.js +0 -18
  144. package/_commonjsHelpers.js +0 -5
  145. package/_flatRest.js +0 -174
  146. package/auth.api.js +0 -43
  147. package/auth.data.js +0 -142
  148. package/clipboard.js +0 -565
  149. package/enhance.api.js +0 -129
  150. package/enhance.data.js +0 -196
  151. package/index.js +0 -87
  152. package/index2.js +0 -340
  153. package/index3.js +0 -264
  154. package/isArray.js +0 -47
  155. package/omit.js +0 -60
  156. package/pick.js +0 -68
  157. package/toString.js +0 -31
  158. package/useCgformList.js +0 -470
  159. package/useExtendComponent.js +0 -5205
  160. package/useListButton.js +0 -923
  161. package/useOnlineTest.js +0 -44
  162. package/useSchemas.js +0 -653
  163. 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 };