@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/EnhanceJsModal.js DELETED
@@ -1,293 +0,0 @@
1
- var __async = (__this, __arguments, generator) => {
2
- return new Promise((resolve, reject) => {
3
- var fulfilled = (value) => {
4
- try {
5
- step(generator.next(value));
6
- } catch (e) {
7
- reject(e);
8
- }
9
- };
10
- var rejected = (value) => {
11
- try {
12
- step(generator.throw(value));
13
- } catch (e) {
14
- reject(e);
15
- }
16
- };
17
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
- step((generator = generator.apply(__this, __arguments)).next());
19
- });
20
- };
21
- import { defineComponent, ref, reactive, resolveComponent, openBlock, createBlock, withCtx, createVNode, createTextVNode, createCommentVNode } from "vue";
22
- import { BasicModal, useModalInner, useModal } from "/@/components/Modal";
23
- import { JCodeEditor } from "/@/components/Form";
24
- import { u as useOnlineTest } from "./useOnlineTest.js";
25
- import { E as EnhanceJsHistory, u as useEnhanceStore } from "./EnhanceJsHistory.js";
26
- import { g as getEnhanceJsByCode, s as saveEnhanceJs } from "./enhance.api.js";
27
- import { useMessage } from "/@/hooks/web/useMessage";
28
- import { _ as _export_sfc } from "./index.js";
29
- import "/@/utils/dateUtil";
30
- import "/@/store";
31
- import "pinia";
32
- import "/@/utils/cache";
33
- import "/@/utils/http/axios";
34
- import "/@/utils/is";
35
- import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
36
- import "vue-router";
37
- const _sfc_main = defineComponent({
38
- name: "EnhanceJs",
39
- components: { BasicModal, JCodeEditor, EnhanceJsHistory },
40
- emits: ["register"],
41
- setup() {
42
- const { createMessage: $message } = useMessage();
43
- const enhanceStore = useEnhanceStore();
44
- const formEditorRef = ref();
45
- const listEditorRef = ref();
46
- const models = reactive({ form: {}, list: {} });
47
- const enhanceType = ref("list");
48
- const code = ref("");
49
- const showHistory = ref(false);
50
- const codeChange = ref(false);
51
- const tableName = ref("");
52
- const enhanceValues = reactive({ form: "", list: "" });
53
- const getFlag = { form: false, list: false };
54
- const reloading = ref(false);
55
- const [registerModal, { closeModal }] = useModalInner((data) => __async(this, null, function* () {
56
- show(data.row);
57
- }));
58
- const [registerEnhanceJsHistory, enhanceJsHistory] = useModal();
59
- const { aiTestMode, genEnhanceJsData } = useOnlineTest();
60
- function show(row) {
61
- code.value = row.id;
62
- codeChange.value = false;
63
- tableName.value = row.tableName;
64
- let enhances = enhanceStore.getEnhanceJs(code.value);
65
- if ((enhances == null ? void 0 : enhances.length) > 0) {
66
- enhanceType.value = enhances[enhances.length - 1].type;
67
- showHistory.value = true;
68
- } else {
69
- showHistory.value = false;
70
- }
71
- getFlag.form = false;
72
- getFlag.list = false;
73
- if (!enhanceType.value) {
74
- onChangeType("form");
75
- } else {
76
- onChangeType(enhanceType.value);
77
- }
78
- reloading.value = true;
79
- setTimeout(() => reloading.value = false, 150);
80
- }
81
- function onSubmit() {
82
- return __async(this, null, function* () {
83
- yield Promise.all([saveEnhanceJsByType("form"), saveEnhanceJsByType("list")]);
84
- closeModal();
85
- $message.success("\u4FDD\u5B58\u6210\u529F");
86
- });
87
- }
88
- function saveEnhanceJsByType(type) {
89
- return __async(this, null, function* () {
90
- let model = models[type];
91
- let params = {
92
- cgJs: enhanceValues[type],
93
- cgJsType: type
94
- };
95
- if (!getFlag[type] || model.cgJs === params.cgJs) {
96
- return;
97
- }
98
- let isUpdate = !!model.id;
99
- if (isUpdate) {
100
- params = Object.assign({}, model, params);
101
- }
102
- yield saveEnhanceJs(code.value, params, isUpdate);
103
- enhanceStore.addEnhanceJs({
104
- code: code.value,
105
- str: params.cgJs,
106
- type: params.cgJsType,
107
- date: new Date().getTime()
108
- });
109
- });
110
- }
111
- function onCancel() {
112
- closeModal();
113
- }
114
- function onChangeType(type) {
115
- return __async(this, null, function* () {
116
- enhanceType.value = type;
117
- try {
118
- if (!getFlag[type]) {
119
- let result = yield getEnhanceJsByCode(code.value, type);
120
- Object.assign(models[type], { id: null }, result);
121
- enhanceValues[type] = models[type].cgJs;
122
- getFlag[type] = true;
123
- }
124
- } catch (e) {
125
- console.error(e);
126
- }
127
- setTimeout(() => {
128
- if (type == "list") {
129
- listEditorRef.value.refresh();
130
- } else {
131
- formEditorRef.value.refresh();
132
- }
133
- }, 150);
134
- });
135
- }
136
- function onShowHistory() {
137
- enhanceJsHistory.openModal(true, {
138
- code: code.value,
139
- type: enhanceType.value
140
- });
141
- }
142
- function onCodeChange(value) {
143
- if (enhanceValues[enhanceType.value] != value) {
144
- codeChange.value = true;
145
- enhanceValues[enhanceType.value] = value;
146
- }
147
- }
148
- function onGenTestData() {
149
- if (enhanceType.value === "form") {
150
- genEnhanceJsData(tableName.value, enhanceType.value, formEditorRef.value);
151
- } else {
152
- genEnhanceJsData(tableName.value, enhanceType.value, listEditorRef.value);
153
- }
154
- }
155
- return {
156
- formEditorRef,
157
- listEditorRef,
158
- reloading,
159
- enhanceValues,
160
- enhanceType,
161
- showHistory,
162
- aiTestMode,
163
- tableName,
164
- genEnhanceJsData,
165
- onGenTestData,
166
- onChangeType,
167
- onCodeChange,
168
- onShowHistory,
169
- onSubmit,
170
- onCancel,
171
- registerModal,
172
- registerEnhanceJsHistory
173
- };
174
- }
175
- });
176
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
177
- const _component_JCodeEditor = resolveComponent("JCodeEditor");
178
- const _component_a_tab_pane = resolveComponent("a-tab-pane");
179
- const _component_a_tabs = resolveComponent("a-tabs");
180
- const _component_a_button = resolveComponent("a-button");
181
- const _component_a_space = resolveComponent("a-space");
182
- const _component_EnhanceJsHistory = resolveComponent("EnhanceJsHistory");
183
- const _component_BasicModal = resolveComponent("BasicModal");
184
- return openBlock(), createBlock(_component_BasicModal, {
185
- onRegister: _ctx.registerModal,
186
- title: "JS\u589E\u5F3A",
187
- width: 800,
188
- bodyStyle: { height: "360px" }
189
- }, {
190
- footer: withCtx(() => [
191
- createVNode(_component_a_space, null, {
192
- default: withCtx(() => [
193
- createVNode(_component_a_button, { onClick: _ctx.onCancel }, {
194
- default: withCtx(() => [
195
- createTextVNode("\u5173\u95ED")
196
- ]),
197
- _: 1
198
- }, 8, ["onClick"]),
199
- createVNode(_component_a_button, {
200
- type: "primary",
201
- onClick: _ctx.onSubmit
202
- }, {
203
- default: withCtx(() => [
204
- createTextVNode("\u786E\u5B9A")
205
- ]),
206
- _: 1
207
- }, 8, ["onClick"])
208
- ]),
209
- _: 1
210
- }),
211
- createVNode(_component_a_space, { style: { "float": "left" } }, {
212
- default: withCtx(() => [
213
- _ctx.showHistory ? (openBlock(), createBlock(_component_a_button, {
214
- key: 0,
215
- onClick: _ctx.onShowHistory
216
- }, {
217
- default: withCtx(() => [
218
- createTextVNode("\u67E5\u770B\u5386\u53F2\u7248\u672C")
219
- ]),
220
- _: 1
221
- }, 8, ["onClick"])) : createCommentVNode("", true),
222
- _ctx.aiTestMode ? (openBlock(), createBlock(_component_a_button, {
223
- key: 1,
224
- onClick: _ctx.onGenTestData
225
- }, {
226
- default: withCtx(() => [
227
- createTextVNode("\u751F\u6210\u6D4B\u8BD5\u6570\u636E")
228
- ]),
229
- _: 1
230
- }, 8, ["onClick"])) : createCommentVNode("", true)
231
- ]),
232
- _: 1
233
- })
234
- ]),
235
- default: withCtx(() => [
236
- createVNode(_component_a_tabs, {
237
- activeKey: _ctx.enhanceType,
238
- "onUpdate:activeKey": _cache[2] || (_cache[2] = ($event) => _ctx.enhanceType = $event),
239
- onChange: _ctx.onChangeType
240
- }, {
241
- default: withCtx(() => [
242
- createVNode(_component_a_tab_pane, {
243
- tab: "form",
244
- key: "form",
245
- forceRender: ""
246
- }, {
247
- default: withCtx(() => [
248
- !_ctx.reloading ? (openBlock(), createBlock(_component_JCodeEditor, {
249
- key: 0,
250
- ref: "formEditorRef",
251
- value: _ctx.enhanceValues.form,
252
- "onUpdate:value": _cache[0] || (_cache[0] = ($event) => _ctx.enhanceValues.form = $event),
253
- language: "javascript",
254
- fullScreen: true,
255
- lineNumbers: false,
256
- height: "240px",
257
- "language-change": false,
258
- onChange: _ctx.onCodeChange
259
- }, null, 8, ["value", "onChange"])) : createCommentVNode("", true)
260
- ]),
261
- _: 1
262
- }),
263
- createVNode(_component_a_tab_pane, {
264
- tab: "list",
265
- key: "list",
266
- forceRender: ""
267
- }, {
268
- default: withCtx(() => [
269
- !_ctx.reloading ? (openBlock(), createBlock(_component_JCodeEditor, {
270
- key: 0,
271
- ref: "listEditorRef",
272
- value: _ctx.enhanceValues.list,
273
- "onUpdate:value": _cache[1] || (_cache[1] = ($event) => _ctx.enhanceValues.list = $event),
274
- language: "javascript",
275
- fullScreen: true,
276
- lineNumbers: false,
277
- height: "240px",
278
- "language-change": false,
279
- onChange: _ctx.onCodeChange
280
- }, null, 8, ["value", "onChange"])) : createCommentVNode("", true)
281
- ]),
282
- _: 1
283
- })
284
- ]),
285
- _: 1
286
- }, 8, ["activeKey", "onChange"]),
287
- createVNode(_component_EnhanceJsHistory, { onRegister: _ctx.registerEnhanceJsHistory }, null, 8, ["onRegister"])
288
- ]),
289
- _: 1
290
- }, 8, ["onRegister"]);
291
- }
292
- var EnhanceJsModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
293
- export { EnhanceJsModal as default };
@@ -1,299 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
- var __async = (__this, __arguments, generator) => {
18
- return new Promise((resolve, reject) => {
19
- var fulfilled = (value) => {
20
- try {
21
- step(generator.next(value));
22
- } catch (e) {
23
- reject(e);
24
- }
25
- };
26
- var rejected = (value) => {
27
- try {
28
- step(generator.throw(value));
29
- } catch (e) {
30
- reject(e);
31
- }
32
- };
33
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
34
- step((generator = generator.apply(__this, __arguments)).next());
35
- });
36
- };
37
- import { defineComponent, ref, reactive, computed, resolveComponent, openBlock, createBlock, withCtx, createVNode, createTextVNode, createElementBlock, createCommentVNode, normalizeProps, guardReactiveProps, nextTick } from "vue";
38
- import { BasicModal, useModalInner, useModal } from "/@/components/Modal";
39
- import { BasicForm, useForm } from "/@/components/Form";
40
- import { BasicTable, TableAction } from "/@/components/Table";
41
- import { useListPage } from "/@/hooks/system/useListPage";
42
- import { u as useOnlineTest } from "./useOnlineTest.js";
43
- import { b as useSqlFormSchemas, c as useSqlColumns } from "./enhance.data.js";
44
- import { c as getEnhanceSqlByCode, e as saveEnhanceSql, f as doEnhanceSqlBatchDelete } from "./enhance.api.js";
45
- import { _ as _export_sfc } from "./index.js";
46
- import "./cgform.data.js";
47
- import "/@/utils/dict";
48
- import "/@/utils/dict/JDictSelectUtil";
49
- import "/@/utils/uuid";
50
- import "/@/utils/http/axios";
51
- import "/@/utils/is";
52
- import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
53
- import "/@/hooks/web/useMessage";
54
- import "vue-router";
55
- const _sfc_main = defineComponent({
56
- name: "EnhanceSqlModal",
57
- components: { BasicModal, BasicTable, BasicForm, TableAction },
58
- emits: ["register"],
59
- setup() {
60
- const code = ref("");
61
- const tableName = ref("");
62
- const btnList = ref([]);
63
- const { columns } = useSqlColumns(btnList);
64
- const { doRequest, doDeleteRecord, tableContext } = useListPage({
65
- tableProps: {
66
- api: (params) => __async(this, null, function* () {
67
- let { dataSource, btnList: $btnList } = yield getEnhanceSqlByCode(code.value, params);
68
- btnList.value = $btnList;
69
- return dataSource;
70
- }),
71
- columns,
72
- canResize: false,
73
- useSearchForm: false,
74
- beforeFetch(params) {
75
- return Object.assign(params, { column: "orderNum", order: "asc" });
76
- }
77
- }
78
- });
79
- const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
80
- const [registerModal, { closeModal }] = useModalInner((data) => __async(this, null, function* () {
81
- code.value = data.row.id;
82
- tableName.value = data.row.tableName;
83
- reload();
84
- }));
85
- const { aiTestMode, genEnhanceSqlData } = useOnlineTest();
86
- const [registerFormModal, formModal] = useModal();
87
- const isUpdate = ref(false);
88
- const formModalProps = reactive({
89
- onRegister: registerFormModal,
90
- title: computed(() => (isUpdate == null ? void 0 : isUpdate.value) ? "\u4FEE\u6539" : "\u65B0\u589E"),
91
- width: 800,
92
- confirmLoading: false,
93
- onOk: onSubmit,
94
- onCancel: formModal.closeModal
95
- });
96
- let formRecord = {};
97
- const { formSchemas } = useSqlFormSchemas(btnList);
98
- const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
99
- schemas: formSchemas,
100
- showActionButtonGroup: false
101
- });
102
- function onCancel() {
103
- closeModal();
104
- }
105
- function openFormModal(data) {
106
- return __async(this, null, function* () {
107
- var _a;
108
- isUpdate.value = data.isUpdate;
109
- formRecord = __spreadValues({}, (_a = data.record) != null ? _a : {});
110
- formModal.openModal();
111
- yield nextTick();
112
- yield resetFields();
113
- setFieldsValue(formRecord);
114
- });
115
- }
116
- function onAdd() {
117
- openFormModal({ isUpdate: false });
118
- }
119
- function onEdit(record) {
120
- openFormModal({ isUpdate: true, record });
121
- }
122
- function onGenEnhanceSqlData() {
123
- genEnhanceSqlData(code.value, tableName.value);
124
- }
125
- function onBatchDelete() {
126
- return __async(this, null, function* () {
127
- doRequest(() => doEnhanceSqlBatchDelete(selectedRowKeys.value));
128
- });
129
- }
130
- function onSubmit() {
131
- return __async(this, null, function* () {
132
- try {
133
- formModalProps.confirmLoading = true;
134
- let values = yield validate();
135
- values = Object.assign({}, formRecord, values);
136
- yield saveEnhanceSql(code.value, values, isUpdate.value);
137
- reload();
138
- formModal.closeModal();
139
- } finally {
140
- formModalProps.confirmLoading = false;
141
- }
142
- });
143
- }
144
- function getTableAction(record) {
145
- return [
146
- {
147
- label: "\u7F16\u8F91",
148
- onClick: () => onEdit(record)
149
- }
150
- ];
151
- }
152
- function getDropDownAction(record) {
153
- return [
154
- {
155
- label: "\u5220\u9664",
156
- popConfirm: {
157
- title: "\u786E\u5B9A\u5220\u9664\u5417\uFF1F",
158
- placement: "left",
159
- confirm: () => doDeleteRecord(() => doEnhanceSqlBatchDelete([record.id]))
160
- }
161
- }
162
- ];
163
- }
164
- return {
165
- rowSelection,
166
- selectedRowKeys,
167
- aiTestMode,
168
- onCancel,
169
- onAdd,
170
- onGenEnhanceSqlData,
171
- onBatchDelete,
172
- getTableAction,
173
- getDropDownAction,
174
- formModalProps,
175
- registerModal,
176
- registerTable,
177
- registerForm
178
- };
179
- },
180
- computed: {
181
- tableScroll() {
182
- let height = window.innerHeight;
183
- return {
184
- y: height - 320
185
- };
186
- }
187
- }
188
- });
189
- const _hoisted_1 = {
190
- key: 0,
191
- style: { "float": "left" }
192
- };
193
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
194
- const _component_a_button = resolveComponent("a-button");
195
- const _component_a_icon = resolveComponent("a-icon");
196
- const _component_a_menu_item = resolveComponent("a-menu-item");
197
- const _component_a_menu = resolveComponent("a-menu");
198
- const _component_a_dropdown = resolveComponent("a-dropdown");
199
- const _component_TableAction = resolveComponent("TableAction");
200
- const _component_BasicTable = resolveComponent("BasicTable");
201
- const _component_BasicForm = resolveComponent("BasicForm");
202
- const _component_a_spin = resolveComponent("a-spin");
203
- const _component_BasicModal = resolveComponent("BasicModal");
204
- return openBlock(), createBlock(_component_BasicModal, {
205
- onRegister: _ctx.registerModal,
206
- title: "SQL\u589E\u5F3A",
207
- width: 1200,
208
- defaultFullscreen: "",
209
- onCancel: _ctx.onCancel
210
- }, {
211
- footer: withCtx(() => [
212
- createVNode(_component_a_button, { onClick: _ctx.onCancel }, {
213
- default: withCtx(() => [
214
- createTextVNode("\u5173\u95ED")
215
- ]),
216
- _: 1
217
- }, 8, ["onClick"]),
218
- _ctx.aiTestMode ? (openBlock(), createElementBlock("div", _hoisted_1, [
219
- createVNode(_component_a_button, { onClick: _ctx.onGenEnhanceSqlData }, {
220
- default: withCtx(() => [
221
- createTextVNode("\u751F\u6210\u6D4B\u8BD5\u6570\u636E")
222
- ]),
223
- _: 1
224
- }, 8, ["onClick"])
225
- ])) : createCommentVNode("", true)
226
- ]),
227
- default: withCtx(() => [
228
- createVNode(_component_BasicTable, {
229
- onRegister: _ctx.registerTable,
230
- rowSelection: _ctx.rowSelection
231
- }, {
232
- tableTitle: withCtx(() => [
233
- createVNode(_component_a_button, {
234
- onClick: _ctx.onAdd,
235
- type: "primary",
236
- preIcon: "ant-design:plus"
237
- }, {
238
- default: withCtx(() => [
239
- createTextVNode("\u65B0\u589E")
240
- ]),
241
- _: 1
242
- }, 8, ["onClick"]),
243
- _ctx.selectedRowKeys.length > 0 ? (openBlock(), createBlock(_component_a_dropdown, { key: 0 }, {
244
- overlay: withCtx(() => [
245
- createVNode(_component_a_menu, null, {
246
- default: withCtx(() => [
247
- createVNode(_component_a_menu_item, {
248
- key: "1",
249
- onClick: _ctx.onBatchDelete
250
- }, {
251
- default: withCtx(() => [
252
- createVNode(_component_a_icon, { type: "delete" }),
253
- createTextVNode(" \u5220\u9664 ")
254
- ]),
255
- _: 1
256
- }, 8, ["onClick"])
257
- ]),
258
- _: 1
259
- })
260
- ]),
261
- default: withCtx(() => [
262
- createVNode(_component_a_button, { style: { "margin-left": "8px" } }, {
263
- default: withCtx(() => [
264
- createTextVNode(" \u6279\u91CF\u64CD\u4F5C "),
265
- createVNode(_component_a_icon, { type: "down" })
266
- ]),
267
- _: 1
268
- })
269
- ]),
270
- _: 1
271
- })) : createCommentVNode("", true)
272
- ]),
273
- action: withCtx(({ record }) => [
274
- createVNode(_component_TableAction, {
275
- actions: _ctx.getTableAction(record),
276
- dropDownActions: _ctx.getDropDownAction(record)
277
- }, null, 8, ["actions", "dropDownActions"])
278
- ]),
279
- _: 1
280
- }, 8, ["onRegister", "rowSelection"]),
281
- createVNode(_component_BasicModal, normalizeProps(guardReactiveProps(_ctx.formModalProps)), {
282
- default: withCtx(() => [
283
- createVNode(_component_a_spin, {
284
- spinning: _ctx.formModalProps.confirmLoading
285
- }, {
286
- default: withCtx(() => [
287
- createVNode(_component_BasicForm, { onRegister: _ctx.registerForm }, null, 8, ["onRegister"])
288
- ]),
289
- _: 1
290
- }, 8, ["spinning"])
291
- ]),
292
- _: 1
293
- }, 16)
294
- ]),
295
- _: 1
296
- }, 8, ["onRegister", "onCancel"]);
297
- }
298
- var EnhanceSqlModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
299
- export { EnhanceSqlModal as default };