@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
@@ -1,298 +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 { u as useJavaFormSchemas, a as useJavaColumns } from "./enhance.data.js";
44
- import { a as getEnhanceJavaByCode, b as saveEnhanceJava, d as doEnhanceJavaBatchDelete } 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: "EnhanceJavaModal",
57
- components: { BasicModal, BasicTable, BasicForm, TableAction },
58
- emits: ["register"],
59
- setup() {
60
- const code = ref("");
61
- const btnList = ref([]);
62
- const { columns } = useJavaColumns(btnList);
63
- const { doRequest, doDeleteRecord, tableContext } = useListPage({
64
- tableProps: {
65
- api: (params) => __async(this, null, function* () {
66
- let { dataSource, btnList: $btnList } = yield getEnhanceJavaByCode(code.value, params);
67
- btnList.value = $btnList;
68
- return dataSource;
69
- }),
70
- columns,
71
- canResize: false,
72
- useSearchForm: false,
73
- beforeFetch(params) {
74
- return Object.assign(params, { column: "orderNum", order: "asc" });
75
- }
76
- }
77
- });
78
- const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
79
- const [registerModal, { closeModal }] = useModalInner((data) => __async(this, null, function* () {
80
- code.value = data.row.id;
81
- reload();
82
- }));
83
- const { aiTestMode, genEnhanceJavaData } = useOnlineTest();
84
- const [registerFormModal, formModal] = useModal();
85
- const isUpdate = ref(false);
86
- const formModalProps = reactive({
87
- onRegister: registerFormModal,
88
- title: computed(() => (isUpdate == null ? void 0 : isUpdate.value) ? "\u4FEE\u6539" : "\u65B0\u589E"),
89
- width: 800,
90
- confirmLoading: false,
91
- bodyStyle: { height: "350px" },
92
- onOk: onSubmit,
93
- onCancel: formModal.closeModal
94
- });
95
- let formRecord = {};
96
- const { formSchemas } = useJavaFormSchemas(btnList);
97
- const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
98
- schemas: formSchemas,
99
- showActionButtonGroup: false
100
- });
101
- function onCancel() {
102
- closeModal();
103
- }
104
- function openFormModal(data) {
105
- return __async(this, null, function* () {
106
- var _a;
107
- isUpdate.value = data.isUpdate;
108
- formRecord = __spreadValues({}, (_a = data.record) != null ? _a : {});
109
- formModal.openModal();
110
- yield nextTick();
111
- yield resetFields();
112
- setFieldsValue(formRecord);
113
- });
114
- }
115
- function onAdd() {
116
- openFormModal({ isUpdate: false });
117
- }
118
- function onEdit(record) {
119
- openFormModal({ isUpdate: true, record });
120
- }
121
- function onGenEnhanceJavaData() {
122
- genEnhanceJavaData(code.value);
123
- }
124
- function onBatchDelete() {
125
- return __async(this, null, function* () {
126
- doRequest(() => doEnhanceJavaBatchDelete(selectedRowKeys.value));
127
- });
128
- }
129
- function onSubmit() {
130
- return __async(this, null, function* () {
131
- try {
132
- formModalProps.confirmLoading = true;
133
- let values = yield validate();
134
- values = Object.assign({}, formRecord, values);
135
- yield saveEnhanceJava(code.value, values, isUpdate.value);
136
- reload();
137
- formModal.closeModal();
138
- } finally {
139
- formModalProps.confirmLoading = false;
140
- }
141
- });
142
- }
143
- function getTableAction(record) {
144
- return [
145
- {
146
- label: "\u7F16\u8F91",
147
- onClick: () => onEdit(record)
148
- }
149
- ];
150
- }
151
- function getDropDownAction(record) {
152
- return [
153
- {
154
- label: "\u5220\u9664",
155
- popConfirm: {
156
- title: "\u786E\u5B9A\u5220\u9664\u5417\uFF1F",
157
- placement: "left",
158
- confirm: () => doDeleteRecord(() => doEnhanceJavaBatchDelete([record.id]))
159
- }
160
- }
161
- ];
162
- }
163
- return {
164
- rowSelection,
165
- selectedRowKeys,
166
- aiTestMode,
167
- onCancel,
168
- onAdd,
169
- onGenEnhanceJavaData,
170
- onBatchDelete,
171
- getTableAction,
172
- getDropDownAction,
173
- formModalProps,
174
- registerModal,
175
- registerTable,
176
- registerForm
177
- };
178
- },
179
- computed: {
180
- tableScroll() {
181
- let height = window.innerHeight;
182
- return {
183
- y: height - 320
184
- };
185
- }
186
- }
187
- });
188
- const _hoisted_1 = {
189
- key: 0,
190
- style: { "float": "left" }
191
- };
192
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
193
- const _component_a_button = resolveComponent("a-button");
194
- const _component_a_icon = resolveComponent("a-icon");
195
- const _component_a_menu_item = resolveComponent("a-menu-item");
196
- const _component_a_menu = resolveComponent("a-menu");
197
- const _component_a_dropdown = resolveComponent("a-dropdown");
198
- const _component_TableAction = resolveComponent("TableAction");
199
- const _component_BasicTable = resolveComponent("BasicTable");
200
- const _component_BasicForm = resolveComponent("BasicForm");
201
- const _component_a_spin = resolveComponent("a-spin");
202
- const _component_BasicModal = resolveComponent("BasicModal");
203
- return openBlock(), createBlock(_component_BasicModal, {
204
- onRegister: _ctx.registerModal,
205
- title: "JAVA\u589E\u5F3A",
206
- width: 1200,
207
- defaultFullscreen: "",
208
- onCancel: _ctx.onCancel
209
- }, {
210
- footer: withCtx(() => [
211
- createVNode(_component_a_button, { onClick: _ctx.onCancel }, {
212
- default: withCtx(() => [
213
- createTextVNode("\u5173\u95ED")
214
- ]),
215
- _: 1
216
- }, 8, ["onClick"]),
217
- _ctx.aiTestMode ? (openBlock(), createElementBlock("div", _hoisted_1, [
218
- createVNode(_component_a_button, { onClick: _ctx.onGenEnhanceJavaData }, {
219
- default: withCtx(() => [
220
- createTextVNode("\u751F\u6210\u6D4B\u8BD5\u6570\u636E")
221
- ]),
222
- _: 1
223
- }, 8, ["onClick"])
224
- ])) : createCommentVNode("", true)
225
- ]),
226
- default: withCtx(() => [
227
- createVNode(_component_BasicTable, {
228
- onRegister: _ctx.registerTable,
229
- rowSelection: _ctx.rowSelection
230
- }, {
231
- tableTitle: withCtx(() => [
232
- createVNode(_component_a_button, {
233
- onClick: _ctx.onAdd,
234
- type: "primary",
235
- preIcon: "ant-design:plus"
236
- }, {
237
- default: withCtx(() => [
238
- createTextVNode("\u65B0\u589E")
239
- ]),
240
- _: 1
241
- }, 8, ["onClick"]),
242
- _ctx.selectedRowKeys.length > 0 ? (openBlock(), createBlock(_component_a_dropdown, { key: 0 }, {
243
- overlay: withCtx(() => [
244
- createVNode(_component_a_menu, null, {
245
- default: withCtx(() => [
246
- createVNode(_component_a_menu_item, {
247
- key: "1",
248
- onClick: _ctx.onBatchDelete
249
- }, {
250
- default: withCtx(() => [
251
- createVNode(_component_a_icon, { type: "delete" }),
252
- createTextVNode(" \u5220\u9664 ")
253
- ]),
254
- _: 1
255
- }, 8, ["onClick"])
256
- ]),
257
- _: 1
258
- })
259
- ]),
260
- default: withCtx(() => [
261
- createVNode(_component_a_button, { style: { "margin-left": "8px" } }, {
262
- default: withCtx(() => [
263
- createTextVNode(" \u6279\u91CF\u64CD\u4F5C "),
264
- createVNode(_component_a_icon, { type: "down" })
265
- ]),
266
- _: 1
267
- })
268
- ]),
269
- _: 1
270
- })) : createCommentVNode("", true)
271
- ]),
272
- action: withCtx(({ record }) => [
273
- createVNode(_component_TableAction, {
274
- actions: _ctx.getTableAction(record),
275
- dropDownActions: _ctx.getDropDownAction(record)
276
- }, null, 8, ["actions", "dropDownActions"])
277
- ]),
278
- _: 1
279
- }, 8, ["onRegister", "rowSelection"]),
280
- createVNode(_component_BasicModal, normalizeProps(guardReactiveProps(_ctx.formModalProps)), {
281
- default: withCtx(() => [
282
- createVNode(_component_a_spin, {
283
- spinning: _ctx.formModalProps.confirmLoading
284
- }, {
285
- default: withCtx(() => [
286
- createVNode(_component_BasicForm, { onRegister: _ctx.registerForm }, null, 8, ["onRegister"])
287
- ]),
288
- _: 1
289
- }, 8, ["spinning"])
290
- ]),
291
- _: 1
292
- }, 16)
293
- ]),
294
- _: 1
295
- }, 8, ["onRegister", "onCancel"]);
296
- }
297
- var EnhanceJavaModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
298
- export { EnhanceJavaModal as default };
@@ -1,229 +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 { formatToDate } from "/@/utils/dateUtil";
38
- import { defineComponent, ref, nextTick, resolveComponent, openBlock, createBlock, withCtx, createVNode, createTextVNode, normalizeClass, createElementVNode, toDisplayString } from "vue";
39
- import { BasicModal, useModalInner } from "/@/components/Modal";
40
- import { JCodeEditor } from "/@/components/Form";
41
- import "/@/store";
42
- import { defineStore } from "pinia";
43
- import { createLocalStorage } from "/@/utils/cache";
44
- import { _ as _export_sfc } from "./index.js";
45
- const ls = createLocalStorage();
46
- const ENHANCE_PRE = "enhance_";
47
- const useEnhanceStore = defineStore({
48
- id: "online-cgform-enhance",
49
- state: () => ({
50
- enhanceJs: {}
51
- }),
52
- getters: {},
53
- actions: {
54
- getEnhanceJs(code) {
55
- this.enhanceJs[code] = ls.get(ENHANCE_PRE + code);
56
- return this.enhanceJs[code];
57
- },
58
- addEnhanceJs(record) {
59
- if (!this.enhanceJs[record.code]) {
60
- this.enhanceJs[record.code] = [__spreadValues({}, record)];
61
- } else {
62
- this.enhanceJs[record.code].push(__spreadValues({}, record));
63
- }
64
- let enhanceJsArray = this.enhanceJs[record.code];
65
- while (enhanceJsArray.length > 16) {
66
- enhanceJsArray.shift();
67
- }
68
- ls.set(ENHANCE_PRE + record.code, enhanceJsArray);
69
- }
70
- }
71
- });
72
- var EnhanceJsHistory_vue_vue_type_style_index_0_scoped_true_lang = "";
73
- const _sfc_main = defineComponent({
74
- name: "EnhanceJsHistory",
75
- components: { BasicModal, JCodeEditor },
76
- setup() {
77
- const enhanceStore = useEnhanceStore();
78
- const codeEditorRef = ref();
79
- const confirmLoading = ref(false);
80
- const dataList = ref([]);
81
- const jsStr = ref("");
82
- const activeIndex = ref(0);
83
- const [registerModal, { closeModal }] = useModalInner((data) => __async(this, null, function* () {
84
- show(data.code, data.type);
85
- }));
86
- function show(code, type) {
87
- jsStr.value = "";
88
- dataList.value = [];
89
- let arr = enhanceStore.getEnhanceJs(code);
90
- let ls2 = [];
91
- let index = 0;
92
- for (let item of arr) {
93
- if (item.type === type) {
94
- index++;
95
- ls2.push(Object.assign({}, item, { index }));
96
- }
97
- }
98
- if (ls2 && ls2.length > 0) {
99
- ls2.sort((a, b) => {
100
- return b.date - a.date;
101
- });
102
- }
103
- dataList.value = [...ls2];
104
- nextTick(() => fullCode(ls2[0]));
105
- }
106
- function onCancel() {
107
- closeModal();
108
- }
109
- function getFormatDate(date) {
110
- return formatToDate(date, "yyyy-MM-DD HH:mm:ss");
111
- }
112
- function fullCode(item) {
113
- activeIndex.value = item.index;
114
- codeEditorRef.value.setValue(item.str);
115
- }
116
- return {
117
- codeEditorRef,
118
- fullCode,
119
- registerModal,
120
- getFormatDate,
121
- onCancel,
122
- confirmLoading,
123
- dataList,
124
- jsStr,
125
- activeIndex
126
- };
127
- }
128
- });
129
- const _hoisted_1 = ["onClick"];
130
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
131
- const _component_a_divider = resolveComponent("a-divider");
132
- const _component_a_list_item = resolveComponent("a-list-item");
133
- const _component_a_list = resolveComponent("a-list");
134
- const _component_a_layout_sider = resolveComponent("a-layout-sider");
135
- const _component_JCodeEditor = resolveComponent("JCodeEditor");
136
- const _component_a_layout_content = resolveComponent("a-layout-content");
137
- const _component_a_layout = resolveComponent("a-layout");
138
- const _component_a_spin = resolveComponent("a-spin");
139
- const _component_a_button = resolveComponent("a-button");
140
- const _component_BasicModal = resolveComponent("BasicModal");
141
- return openBlock(), createBlock(_component_BasicModal, {
142
- onRegister: _ctx.registerModal,
143
- title: "JS\u589E\u5F3A\u5386\u53F2\u8BB0\u5F55",
144
- width: 1200,
145
- maskClosable: false,
146
- confirmLoading: _ctx.confirmLoading,
147
- defaultFullscreen: "",
148
- onCancel: _ctx.onCancel
149
- }, {
150
- footer: withCtx(() => [
151
- createVNode(_component_a_button, { onClick: _ctx.onCancel }, {
152
- default: withCtx(() => [
153
- createTextVNode("\u5173\u95ED")
154
- ]),
155
- _: 1
156
- }, 8, ["onClick"])
157
- ]),
158
- default: withCtx(() => [
159
- createVNode(_component_a_spin, { spinning: _ctx.confirmLoading }, {
160
- default: withCtx(() => [
161
- createVNode(_component_a_layout, null, {
162
- default: withCtx(() => [
163
- createVNode(_component_a_layout_sider, { theme: "light" }, {
164
- default: withCtx(() => [
165
- createVNode(_component_a_list, {
166
- bordered: "",
167
- dataSource: _ctx.dataList,
168
- class: normalizeClass("enhance-list")
169
- }, {
170
- header: withCtx(() => [
171
- createElementVNode("div", null, [
172
- createVNode(_component_a_divider, { style: { "margin": "0" } }, {
173
- default: withCtx(() => [
174
- createTextVNode("\u4FDD\u5B58\u65F6\u95F4")
175
- ]),
176
- _: 1
177
- })
178
- ])
179
- ]),
180
- renderItem: withCtx(({ item }) => [
181
- createVNode(_component_a_list_item, {
182
- class: normalizeClass(_ctx.activeIndex === item.index ? "bg-blue" : "")
183
- }, {
184
- default: withCtx(() => [
185
- createElementVNode("a", {
186
- onClick: ($event) => _ctx.fullCode(item)
187
- }, toDisplayString(_ctx.getFormatDate(item.date)), 9, _hoisted_1)
188
- ]),
189
- _: 2
190
- }, 1032, ["class"])
191
- ]),
192
- _: 1
193
- }, 8, ["dataSource"])
194
- ]),
195
- _: 1
196
- }),
197
- createVNode(_component_a_layout, null, {
198
- default: withCtx(() => [
199
- createVNode(_component_a_layout_content, { style: { margin: "8px 8px", padding: "8px", background: "#fff", minHeight: "280px" } }, {
200
- default: withCtx(() => [
201
- createVNode(_component_JCodeEditor, {
202
- ref: "codeEditorRef",
203
- language: "javascript",
204
- fullScreen: true,
205
- lineNumbers: false,
206
- "language-change": false
207
- }, null, 512)
208
- ]),
209
- _: 1
210
- })
211
- ]),
212
- _: 1
213
- })
214
- ]),
215
- _: 1
216
- })
217
- ]),
218
- _: 1
219
- }, 8, ["spinning"])
220
- ]),
221
- _: 1
222
- }, 8, ["onRegister", "confirmLoading", "onCancel"]);
223
- }
224
- var EnhanceJsHistory = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-8964b74c"]]);
225
- var EnhanceJsHistory$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
226
- __proto__: null,
227
- "default": EnhanceJsHistory
228
- }, Symbol.toStringTag, { value: "Module" }));
229
- export { EnhanceJsHistory as E, EnhanceJsHistory$1 as a, useEnhanceStore as u };