@jeecg/online 1.0.1

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 (82) hide show
  1. package/AuthButtonConfig.js +140 -0
  2. package/AuthButtonTree.js +183 -0
  3. package/AuthDataConfig.js +243 -0
  4. package/AuthDataTree.js +160 -0
  5. package/AuthFieldConfig.js +167 -0
  6. package/AuthFieldTree.js +273 -0
  7. package/AuthManagerDrawer.js +125 -0
  8. package/AuthSetterModal.js +317 -0
  9. package/CgformCopyList.js +253 -0
  10. package/CgformModal.js +748 -0
  11. package/CgreportModal.js +673 -0
  12. package/ChartAutoRender.js +69 -0
  13. package/ChartDoubleRender.js +154 -0
  14. package/ChartSingleRender.js +132 -0
  15. package/ChartTabsRender.js +218 -0
  16. package/CheckDictTable.js +121 -0
  17. package/CodeGeneratorModal.js +293 -0
  18. package/CustomButtonList.js +413 -0
  19. package/DBAttributeTable.js +278 -0
  20. package/DbToOnlineModal.js +190 -0
  21. package/EnhanceJavaModal.js +304 -0
  22. package/EnhanceJsHistory.js +231 -0
  23. package/EnhanceJsModal.js +293 -0
  24. package/EnhanceSqlModal.js +305 -0
  25. package/ErrorTip.js +21 -0
  26. package/ExtendConfigModal.js +142 -0
  27. package/FieldTable.js +185 -0
  28. package/FileSelectModal.js +102 -0
  29. package/ForeignKeyTable.js +78 -0
  30. package/FormSchemaFactory.js +938 -0
  31. package/GraphreportAutoChart.js +352 -0
  32. package/GraphreportList.js +239 -0
  33. package/GraphreportModal.js +559 -0
  34. package/IndexTable.js +96 -0
  35. package/JOnlineSearchSelect.js +107 -0
  36. package/LICENSE +7 -0
  37. package/LeftDepart.js +96 -0
  38. package/LeftRole.js +95 -0
  39. package/LeftUser.js +114 -0
  40. package/ModalFormDemo.js +84 -0
  41. package/OnlineAutoList.js +410 -0
  42. package/OnlineAutoModal.js +265 -0
  43. package/OnlineAutoTreeList.js +513 -0
  44. package/OnlineCustomModal.js +269 -0
  45. package/OnlineForm.js +809 -0
  46. package/OnlineQueryForm.js +442 -0
  47. package/OnlineSearchFormItem.js +428 -0
  48. package/OnlineSelectCascade.js +217 -0
  49. package/OnlineSubForm.js +200 -0
  50. package/OnlineSuperQuery.js +912 -0
  51. package/OnlineSuperQueryValComponent.js +8 -0
  52. package/OnlineSuperQueryValComponent.vue_vue_type_script_lang.js +172 -0
  53. package/PageAttributeTable.js +242 -0
  54. package/ParamsTable.js +71 -0
  55. package/ProcessOnlineForm.js +183 -0
  56. package/QueryTable.js +128 -0
  57. package/README.md +23 -0
  58. package/_arrayPush.js +276 -0
  59. package/auth.api.js +43 -0
  60. package/auth.data.js +144 -0
  61. package/cgform.data.js +235 -0
  62. package/cloneDeep.js +475 -0
  63. package/enhance.api.js +120 -0
  64. package/enhance.data.js +196 -0
  65. package/graphreport.api.js +23 -0
  66. package/index.js +64 -0
  67. package/index2.js +336 -0
  68. package/index3.js +799 -0
  69. package/isArray.js +47 -0
  70. package/main.index.js +6 -0
  71. package/package.json +6 -0
  72. package/pick.js +238 -0
  73. package/style.css +1 -0
  74. package/toString.js +31 -0
  75. package/useAutoForm.js +4274 -0
  76. package/useCgformList.js +353 -0
  77. package/useChartRender.js +405 -0
  78. package/useMessageOnline.js +71 -0
  79. package/useOnlineTest.js +26866 -0
  80. package/useSchemas.js +505 -0
  81. package/useTableColumns.js +1154 -0
  82. package/useTableSync.js +105 -0
package/index3.js ADDED
@@ -0,0 +1,799 @@
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, resolveComponent, openBlock, createElementBlock, createVNode, unref, withCtx, createBlock, createCommentVNode, createTextVNode } from "vue";
22
+ import { BasicTable, TableAction } from "/@/components/Table";
23
+ import { useListPage } from "/@/hooks/system/useListPage";
24
+ import { l as list, c as columns, s as searchFormSchema, _ as _sfc_main$1, d as deleteOne, b as batchDelete, g as getReportParam } from "./CgreportModal.js";
25
+ import { useModal } from "/@/components/Modal";
26
+ import { useRouter } from "vue-router";
27
+ import "/@/components/Form/index";
28
+ import "/@/hooks/system/useJvxeMethods.ts";
29
+ import "/@/components/jeecg/JVxeTable/types";
30
+ import "/@/views/system/user/user.api";
31
+ import "/@/utils/http/axios";
32
+ import "ant-design-vue";
33
+ import "/@/hooks/web/useMessage";
34
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
35
+ function getDefaultExportFromCjs(x) {
36
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
37
+ }
38
+ var clipboard = { exports: {} };
39
+ /*!
40
+ * clipboard.js v2.0.11
41
+ * https://clipboardjs.com/
42
+ *
43
+ * Licensed MIT © Zeno Rocha
44
+ */
45
+ (function(module, exports) {
46
+ (function webpackUniversalModuleDefinition(root, factory) {
47
+ module.exports = factory();
48
+ })(commonjsGlobal, function() {
49
+ return function() {
50
+ var __webpack_modules__ = {
51
+ 686: function(__unused_webpack_module, __webpack_exports__, __webpack_require__2) {
52
+ __webpack_require__2.d(__webpack_exports__, {
53
+ "default": function() {
54
+ return clipboard2;
55
+ }
56
+ });
57
+ var tiny_emitter = __webpack_require__2(279);
58
+ var tiny_emitter_default = /* @__PURE__ */ __webpack_require__2.n(tiny_emitter);
59
+ var listen = __webpack_require__2(370);
60
+ var listen_default = /* @__PURE__ */ __webpack_require__2.n(listen);
61
+ var src_select = __webpack_require__2(817);
62
+ var select_default = /* @__PURE__ */ __webpack_require__2.n(src_select);
63
+ function command(type) {
64
+ try {
65
+ return document.execCommand(type);
66
+ } catch (err) {
67
+ return false;
68
+ }
69
+ }
70
+ var ClipboardActionCut = function ClipboardActionCut2(target) {
71
+ var selectedText = select_default()(target);
72
+ command("cut");
73
+ return selectedText;
74
+ };
75
+ var actions_cut = ClipboardActionCut;
76
+ function createFakeElement(value) {
77
+ var isRTL = document.documentElement.getAttribute("dir") === "rtl";
78
+ var fakeElement = document.createElement("textarea");
79
+ fakeElement.style.fontSize = "12pt";
80
+ fakeElement.style.border = "0";
81
+ fakeElement.style.padding = "0";
82
+ fakeElement.style.margin = "0";
83
+ fakeElement.style.position = "absolute";
84
+ fakeElement.style[isRTL ? "right" : "left"] = "-9999px";
85
+ var yPosition = window.pageYOffset || document.documentElement.scrollTop;
86
+ fakeElement.style.top = "".concat(yPosition, "px");
87
+ fakeElement.setAttribute("readonly", "");
88
+ fakeElement.value = value;
89
+ return fakeElement;
90
+ }
91
+ var fakeCopyAction = function fakeCopyAction2(value, options) {
92
+ var fakeElement = createFakeElement(value);
93
+ options.container.appendChild(fakeElement);
94
+ var selectedText = select_default()(fakeElement);
95
+ command("copy");
96
+ fakeElement.remove();
97
+ return selectedText;
98
+ };
99
+ var ClipboardActionCopy = function ClipboardActionCopy2(target) {
100
+ var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
101
+ container: document.body
102
+ };
103
+ var selectedText = "";
104
+ if (typeof target === "string") {
105
+ selectedText = fakeCopyAction(target, options);
106
+ } else if (target instanceof HTMLInputElement && !["text", "search", "url", "tel", "password"].includes(target === null || target === void 0 ? void 0 : target.type)) {
107
+ selectedText = fakeCopyAction(target.value, options);
108
+ } else {
109
+ selectedText = select_default()(target);
110
+ command("copy");
111
+ }
112
+ return selectedText;
113
+ };
114
+ var actions_copy = ClipboardActionCopy;
115
+ function _typeof(obj) {
116
+ "@babel/helpers - typeof";
117
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
118
+ _typeof = function _typeof2(obj2) {
119
+ return typeof obj2;
120
+ };
121
+ } else {
122
+ _typeof = function _typeof2(obj2) {
123
+ return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
124
+ };
125
+ }
126
+ return _typeof(obj);
127
+ }
128
+ var ClipboardActionDefault = function ClipboardActionDefault2() {
129
+ var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
130
+ var _options$action = options.action, action = _options$action === void 0 ? "copy" : _options$action, container = options.container, target = options.target, text = options.text;
131
+ if (action !== "copy" && action !== "cut") {
132
+ throw new Error('Invalid "action" value, use either "copy" or "cut"');
133
+ }
134
+ if (target !== void 0) {
135
+ if (target && _typeof(target) === "object" && target.nodeType === 1) {
136
+ if (action === "copy" && target.hasAttribute("disabled")) {
137
+ throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
138
+ }
139
+ if (action === "cut" && (target.hasAttribute("readonly") || target.hasAttribute("disabled"))) {
140
+ throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`);
141
+ }
142
+ } else {
143
+ throw new Error('Invalid "target" value, use a valid Element');
144
+ }
145
+ }
146
+ if (text) {
147
+ return actions_copy(text, {
148
+ container
149
+ });
150
+ }
151
+ if (target) {
152
+ return action === "cut" ? actions_cut(target) : actions_copy(target, {
153
+ container
154
+ });
155
+ }
156
+ };
157
+ var actions_default = ClipboardActionDefault;
158
+ function clipboard_typeof(obj) {
159
+ "@babel/helpers - typeof";
160
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
161
+ clipboard_typeof = function _typeof2(obj2) {
162
+ return typeof obj2;
163
+ };
164
+ } else {
165
+ clipboard_typeof = function _typeof2(obj2) {
166
+ return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
167
+ };
168
+ }
169
+ return clipboard_typeof(obj);
170
+ }
171
+ function _classCallCheck(instance, Constructor) {
172
+ if (!(instance instanceof Constructor)) {
173
+ throw new TypeError("Cannot call a class as a function");
174
+ }
175
+ }
176
+ function _defineProperties(target, props) {
177
+ for (var i = 0; i < props.length; i++) {
178
+ var descriptor = props[i];
179
+ descriptor.enumerable = descriptor.enumerable || false;
180
+ descriptor.configurable = true;
181
+ if ("value" in descriptor)
182
+ descriptor.writable = true;
183
+ Object.defineProperty(target, descriptor.key, descriptor);
184
+ }
185
+ }
186
+ function _createClass(Constructor, protoProps, staticProps) {
187
+ if (protoProps)
188
+ _defineProperties(Constructor.prototype, protoProps);
189
+ if (staticProps)
190
+ _defineProperties(Constructor, staticProps);
191
+ return Constructor;
192
+ }
193
+ function _inherits(subClass, superClass) {
194
+ if (typeof superClass !== "function" && superClass !== null) {
195
+ throw new TypeError("Super expression must either be null or a function");
196
+ }
197
+ subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
198
+ if (superClass)
199
+ _setPrototypeOf(subClass, superClass);
200
+ }
201
+ function _setPrototypeOf(o, p) {
202
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
203
+ o2.__proto__ = p2;
204
+ return o2;
205
+ };
206
+ return _setPrototypeOf(o, p);
207
+ }
208
+ function _createSuper(Derived) {
209
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
210
+ return function _createSuperInternal() {
211
+ var Super = _getPrototypeOf(Derived), result;
212
+ if (hasNativeReflectConstruct) {
213
+ var NewTarget = _getPrototypeOf(this).constructor;
214
+ result = Reflect.construct(Super, arguments, NewTarget);
215
+ } else {
216
+ result = Super.apply(this, arguments);
217
+ }
218
+ return _possibleConstructorReturn(this, result);
219
+ };
220
+ }
221
+ function _possibleConstructorReturn(self2, call) {
222
+ if (call && (clipboard_typeof(call) === "object" || typeof call === "function")) {
223
+ return call;
224
+ }
225
+ return _assertThisInitialized(self2);
226
+ }
227
+ function _assertThisInitialized(self2) {
228
+ if (self2 === void 0) {
229
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
230
+ }
231
+ return self2;
232
+ }
233
+ function _isNativeReflectConstruct() {
234
+ if (typeof Reflect === "undefined" || !Reflect.construct)
235
+ return false;
236
+ if (Reflect.construct.sham)
237
+ return false;
238
+ if (typeof Proxy === "function")
239
+ return true;
240
+ try {
241
+ Date.prototype.toString.call(Reflect.construct(Date, [], function() {
242
+ }));
243
+ return true;
244
+ } catch (e) {
245
+ return false;
246
+ }
247
+ }
248
+ function _getPrototypeOf(o) {
249
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o2) {
250
+ return o2.__proto__ || Object.getPrototypeOf(o2);
251
+ };
252
+ return _getPrototypeOf(o);
253
+ }
254
+ function getAttributeValue(suffix, element) {
255
+ var attribute = "data-clipboard-".concat(suffix);
256
+ if (!element.hasAttribute(attribute)) {
257
+ return;
258
+ }
259
+ return element.getAttribute(attribute);
260
+ }
261
+ var Clipboard2 = /* @__PURE__ */ function(_Emitter) {
262
+ _inherits(Clipboard3, _Emitter);
263
+ var _super = _createSuper(Clipboard3);
264
+ function Clipboard3(trigger, options) {
265
+ var _this;
266
+ _classCallCheck(this, Clipboard3);
267
+ _this = _super.call(this);
268
+ _this.resolveOptions(options);
269
+ _this.listenClick(trigger);
270
+ return _this;
271
+ }
272
+ _createClass(Clipboard3, [{
273
+ key: "resolveOptions",
274
+ value: function resolveOptions() {
275
+ var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
276
+ this.action = typeof options.action === "function" ? options.action : this.defaultAction;
277
+ this.target = typeof options.target === "function" ? options.target : this.defaultTarget;
278
+ this.text = typeof options.text === "function" ? options.text : this.defaultText;
279
+ this.container = clipboard_typeof(options.container) === "object" ? options.container : document.body;
280
+ }
281
+ }, {
282
+ key: "listenClick",
283
+ value: function listenClick(trigger) {
284
+ var _this2 = this;
285
+ this.listener = listen_default()(trigger, "click", function(e) {
286
+ return _this2.onClick(e);
287
+ });
288
+ }
289
+ }, {
290
+ key: "onClick",
291
+ value: function onClick(e) {
292
+ var trigger = e.delegateTarget || e.currentTarget;
293
+ var action = this.action(trigger) || "copy";
294
+ var text = actions_default({
295
+ action,
296
+ container: this.container,
297
+ target: this.target(trigger),
298
+ text: this.text(trigger)
299
+ });
300
+ this.emit(text ? "success" : "error", {
301
+ action,
302
+ text,
303
+ trigger,
304
+ clearSelection: function clearSelection() {
305
+ if (trigger) {
306
+ trigger.focus();
307
+ }
308
+ window.getSelection().removeAllRanges();
309
+ }
310
+ });
311
+ }
312
+ }, {
313
+ key: "defaultAction",
314
+ value: function defaultAction(trigger) {
315
+ return getAttributeValue("action", trigger);
316
+ }
317
+ }, {
318
+ key: "defaultTarget",
319
+ value: function defaultTarget(trigger) {
320
+ var selector = getAttributeValue("target", trigger);
321
+ if (selector) {
322
+ return document.querySelector(selector);
323
+ }
324
+ }
325
+ }, {
326
+ key: "defaultText",
327
+ value: function defaultText(trigger) {
328
+ return getAttributeValue("text", trigger);
329
+ }
330
+ }, {
331
+ key: "destroy",
332
+ value: function destroy() {
333
+ this.listener.destroy();
334
+ }
335
+ }], [{
336
+ key: "copy",
337
+ value: function copy(target) {
338
+ var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
339
+ container: document.body
340
+ };
341
+ return actions_copy(target, options);
342
+ }
343
+ }, {
344
+ key: "cut",
345
+ value: function cut(target) {
346
+ return actions_cut(target);
347
+ }
348
+ }, {
349
+ key: "isSupported",
350
+ value: function isSupported() {
351
+ var action = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ["copy", "cut"];
352
+ var actions = typeof action === "string" ? [action] : action;
353
+ var support = !!document.queryCommandSupported;
354
+ actions.forEach(function(action2) {
355
+ support = support && !!document.queryCommandSupported(action2);
356
+ });
357
+ return support;
358
+ }
359
+ }]);
360
+ return Clipboard3;
361
+ }(tiny_emitter_default());
362
+ var clipboard2 = Clipboard2;
363
+ },
364
+ 828: function(module2) {
365
+ var DOCUMENT_NODE_TYPE = 9;
366
+ if (typeof Element !== "undefined" && !Element.prototype.matches) {
367
+ var proto = Element.prototype;
368
+ proto.matches = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector || proto.webkitMatchesSelector;
369
+ }
370
+ function closest(element, selector) {
371
+ while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
372
+ if (typeof element.matches === "function" && element.matches(selector)) {
373
+ return element;
374
+ }
375
+ element = element.parentNode;
376
+ }
377
+ }
378
+ module2.exports = closest;
379
+ },
380
+ 438: function(module2, __unused_webpack_exports, __webpack_require__2) {
381
+ var closest = __webpack_require__2(828);
382
+ function _delegate(element, selector, type, callback, useCapture) {
383
+ var listenerFn = listener.apply(this, arguments);
384
+ element.addEventListener(type, listenerFn, useCapture);
385
+ return {
386
+ destroy: function() {
387
+ element.removeEventListener(type, listenerFn, useCapture);
388
+ }
389
+ };
390
+ }
391
+ function delegate(elements, selector, type, callback, useCapture) {
392
+ if (typeof elements.addEventListener === "function") {
393
+ return _delegate.apply(null, arguments);
394
+ }
395
+ if (typeof type === "function") {
396
+ return _delegate.bind(null, document).apply(null, arguments);
397
+ }
398
+ if (typeof elements === "string") {
399
+ elements = document.querySelectorAll(elements);
400
+ }
401
+ return Array.prototype.map.call(elements, function(element) {
402
+ return _delegate(element, selector, type, callback, useCapture);
403
+ });
404
+ }
405
+ function listener(element, selector, type, callback) {
406
+ return function(e) {
407
+ e.delegateTarget = closest(e.target, selector);
408
+ if (e.delegateTarget) {
409
+ callback.call(element, e);
410
+ }
411
+ };
412
+ }
413
+ module2.exports = delegate;
414
+ },
415
+ 879: function(__unused_webpack_module, exports2) {
416
+ exports2.node = function(value) {
417
+ return value !== void 0 && value instanceof HTMLElement && value.nodeType === 1;
418
+ };
419
+ exports2.nodeList = function(value) {
420
+ var type = Object.prototype.toString.call(value);
421
+ return value !== void 0 && (type === "[object NodeList]" || type === "[object HTMLCollection]") && "length" in value && (value.length === 0 || exports2.node(value[0]));
422
+ };
423
+ exports2.string = function(value) {
424
+ return typeof value === "string" || value instanceof String;
425
+ };
426
+ exports2.fn = function(value) {
427
+ var type = Object.prototype.toString.call(value);
428
+ return type === "[object Function]";
429
+ };
430
+ },
431
+ 370: function(module2, __unused_webpack_exports, __webpack_require__2) {
432
+ var is = __webpack_require__2(879);
433
+ var delegate = __webpack_require__2(438);
434
+ function listen(target, type, callback) {
435
+ if (!target && !type && !callback) {
436
+ throw new Error("Missing required arguments");
437
+ }
438
+ if (!is.string(type)) {
439
+ throw new TypeError("Second argument must be a String");
440
+ }
441
+ if (!is.fn(callback)) {
442
+ throw new TypeError("Third argument must be a Function");
443
+ }
444
+ if (is.node(target)) {
445
+ return listenNode(target, type, callback);
446
+ } else if (is.nodeList(target)) {
447
+ return listenNodeList(target, type, callback);
448
+ } else if (is.string(target)) {
449
+ return listenSelector(target, type, callback);
450
+ } else {
451
+ throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");
452
+ }
453
+ }
454
+ function listenNode(node, type, callback) {
455
+ node.addEventListener(type, callback);
456
+ return {
457
+ destroy: function() {
458
+ node.removeEventListener(type, callback);
459
+ }
460
+ };
461
+ }
462
+ function listenNodeList(nodeList, type, callback) {
463
+ Array.prototype.forEach.call(nodeList, function(node) {
464
+ node.addEventListener(type, callback);
465
+ });
466
+ return {
467
+ destroy: function() {
468
+ Array.prototype.forEach.call(nodeList, function(node) {
469
+ node.removeEventListener(type, callback);
470
+ });
471
+ }
472
+ };
473
+ }
474
+ function listenSelector(selector, type, callback) {
475
+ return delegate(document.body, selector, type, callback);
476
+ }
477
+ module2.exports = listen;
478
+ },
479
+ 817: function(module2) {
480
+ function select(element) {
481
+ var selectedText;
482
+ if (element.nodeName === "SELECT") {
483
+ element.focus();
484
+ selectedText = element.value;
485
+ } else if (element.nodeName === "INPUT" || element.nodeName === "TEXTAREA") {
486
+ var isReadOnly = element.hasAttribute("readonly");
487
+ if (!isReadOnly) {
488
+ element.setAttribute("readonly", "");
489
+ }
490
+ element.select();
491
+ element.setSelectionRange(0, element.value.length);
492
+ if (!isReadOnly) {
493
+ element.removeAttribute("readonly");
494
+ }
495
+ selectedText = element.value;
496
+ } else {
497
+ if (element.hasAttribute("contenteditable")) {
498
+ element.focus();
499
+ }
500
+ var selection = window.getSelection();
501
+ var range = document.createRange();
502
+ range.selectNodeContents(element);
503
+ selection.removeAllRanges();
504
+ selection.addRange(range);
505
+ selectedText = selection.toString();
506
+ }
507
+ return selectedText;
508
+ }
509
+ module2.exports = select;
510
+ },
511
+ 279: function(module2) {
512
+ function E() {
513
+ }
514
+ E.prototype = {
515
+ on: function(name, callback, ctx) {
516
+ var e = this.e || (this.e = {});
517
+ (e[name] || (e[name] = [])).push({
518
+ fn: callback,
519
+ ctx
520
+ });
521
+ return this;
522
+ },
523
+ once: function(name, callback, ctx) {
524
+ var self2 = this;
525
+ function listener() {
526
+ self2.off(name, listener);
527
+ callback.apply(ctx, arguments);
528
+ }
529
+ listener._ = callback;
530
+ return this.on(name, listener, ctx);
531
+ },
532
+ emit: function(name) {
533
+ var data = [].slice.call(arguments, 1);
534
+ var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
535
+ var i = 0;
536
+ var len = evtArr.length;
537
+ for (i; i < len; i++) {
538
+ evtArr[i].fn.apply(evtArr[i].ctx, data);
539
+ }
540
+ return this;
541
+ },
542
+ off: function(name, callback) {
543
+ var e = this.e || (this.e = {});
544
+ var evts = e[name];
545
+ var liveEvents = [];
546
+ if (evts && callback) {
547
+ for (var i = 0, len = evts.length; i < len; i++) {
548
+ if (evts[i].fn !== callback && evts[i].fn._ !== callback)
549
+ liveEvents.push(evts[i]);
550
+ }
551
+ }
552
+ liveEvents.length ? e[name] = liveEvents : delete e[name];
553
+ return this;
554
+ }
555
+ };
556
+ module2.exports = E;
557
+ module2.exports.TinyEmitter = E;
558
+ }
559
+ };
560
+ var __webpack_module_cache__ = {};
561
+ function __webpack_require__(moduleId) {
562
+ if (__webpack_module_cache__[moduleId]) {
563
+ return __webpack_module_cache__[moduleId].exports;
564
+ }
565
+ var module2 = __webpack_module_cache__[moduleId] = {
566
+ exports: {}
567
+ };
568
+ __webpack_modules__[moduleId](module2, module2.exports, __webpack_require__);
569
+ return module2.exports;
570
+ }
571
+ !function() {
572
+ __webpack_require__.n = function(module2) {
573
+ var getter = module2 && module2.__esModule ? function() {
574
+ return module2["default"];
575
+ } : function() {
576
+ return module2;
577
+ };
578
+ __webpack_require__.d(getter, { a: getter });
579
+ return getter;
580
+ };
581
+ }();
582
+ !function() {
583
+ __webpack_require__.d = function(exports2, definition) {
584
+ for (var key in definition) {
585
+ if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports2, key)) {
586
+ Object.defineProperty(exports2, key, { enumerable: true, get: definition[key] });
587
+ }
588
+ }
589
+ };
590
+ }();
591
+ !function() {
592
+ __webpack_require__.o = function(obj, prop) {
593
+ return Object.prototype.hasOwnProperty.call(obj, prop);
594
+ };
595
+ }();
596
+ return __webpack_require__(686);
597
+ }().default;
598
+ });
599
+ })(clipboard);
600
+ var Clipboard = /* @__PURE__ */ getDefaultExportFromCjs(clipboard.exports);
601
+ const _hoisted_1 = /* @__PURE__ */ createTextVNode("\u5F55\u5165");
602
+ const _hoisted_2 = /* @__PURE__ */ createTextVNode(" \u5220\u9664 ");
603
+ const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u6279\u91CF\u64CD\u4F5C ");
604
+ const _sfc_main = /* @__PURE__ */ defineComponent({
605
+ name: "index",
606
+ setup(__props) {
607
+ let router = useRouter();
608
+ const [registerModal, { openModal }] = useModal();
609
+ const { prefixCls, tableContext, createMessage: $message, createConfirm: $confirm } = useListPage({
610
+ designScope: "online-cgreport-list",
611
+ pagination: true,
612
+ tableProps: {
613
+ title: "Online\u62A5\u8868",
614
+ api: list,
615
+ rowKey: "id",
616
+ columns,
617
+ formConfig: {
618
+ autoSubmitOnEnter: true,
619
+ showAdvancedButton: true,
620
+ schemas: searchFormSchema
621
+ }
622
+ }
623
+ });
624
+ const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
625
+ function handleAdd() {
626
+ openModal(true, {
627
+ isUpdate: false,
628
+ showFooter: true
629
+ });
630
+ }
631
+ function handleEdit(record) {
632
+ openModal(true, {
633
+ record,
634
+ isUpdate: true,
635
+ showFooter: true
636
+ });
637
+ }
638
+ function handleDelete(record) {
639
+ return __async(this, null, function* () {
640
+ yield deleteOne({ id: record.id }, reload);
641
+ });
642
+ }
643
+ function batchHandleDelete() {
644
+ return __async(this, null, function* () {
645
+ yield batchDelete({ ids: selectedRowKeys.value }, () => {
646
+ reload();
647
+ selectedRowKeys.value = [];
648
+ });
649
+ });
650
+ }
651
+ function handleSuccess() {
652
+ reload();
653
+ }
654
+ function getAction(record) {
655
+ return [
656
+ {
657
+ label: "\u7F16\u8F91",
658
+ onClick: handleEdit.bind(null, record)
659
+ }
660
+ ];
661
+ }
662
+ function getDropDownAction(record) {
663
+ return [
664
+ {
665
+ label: "\u529F\u80FD\u6D4B\u8BD5",
666
+ onClick: () => onShowList(record.id)
667
+ },
668
+ {
669
+ label: "\u914D\u7F6E\u5730\u5740",
670
+ onClick: () => onShowOnlineUrl(record)
671
+ },
672
+ {
673
+ label: "\u5220\u9664",
674
+ popConfirm: {
675
+ title: "\u662F\u5426\u786E\u8BA4\u5220\u9664",
676
+ confirm: handleDelete.bind(null, record)
677
+ }
678
+ }
679
+ ];
680
+ }
681
+ function onShowList(id) {
682
+ router.push({ path: "/online/cgreport/" + id });
683
+ }
684
+ function onShowOnlineUrl(record) {
685
+ let id = record.id;
686
+ let baseUrl = `/online/cgreport/${id}`;
687
+ getReportParam(id).then((arr) => {
688
+ let urlParam = "";
689
+ if (arr && arr.length > 0) {
690
+ for (let i of arr) {
691
+ urlParam += i.paramName + "=${" + i.paramName + "}&";
692
+ }
693
+ }
694
+ if (urlParam.length > 0) {
695
+ urlParam = urlParam.substring(0, urlParam.length - 1);
696
+ baseUrl += "?" + urlParam;
697
+ }
698
+ }).catch(() => {
699
+ $message.warning("\u83B7\u53D6\u53C2\u6570\u5931\u8D25!");
700
+ }).finally(() => {
701
+ $confirm({
702
+ iconType: "info",
703
+ width: 500,
704
+ title: `\u83DC\u5355\u94FE\u63A5\u3010${record.name}\u3011`,
705
+ content: baseUrl,
706
+ maskClosable: true,
707
+ okText: "\u590D\u5236",
708
+ okButtonProps: {
709
+ class: "copy-this-text",
710
+ "data-clipboard-text": baseUrl
711
+ },
712
+ onOk() {
713
+ return new Promise((resolve) => {
714
+ const clipboard2 = new Clipboard(".copy-this-text");
715
+ clipboard2.on("success", () => {
716
+ clipboard2.destroy();
717
+ $message.success("\u590D\u5236\u6210\u529F");
718
+ resolve();
719
+ });
720
+ clipboard2.on("error", () => {
721
+ $message.error("\u8BE5\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u81EA\u52A8\u590D\u5236");
722
+ clipboard2.destroy();
723
+ resolve();
724
+ });
725
+ });
726
+ }
727
+ });
728
+ });
729
+ }
730
+ return (_ctx, _cache) => {
731
+ const _component_a_button = resolveComponent("a-button");
732
+ const _component_Icon = resolveComponent("Icon");
733
+ const _component_a_menu_item = resolveComponent("a-menu-item");
734
+ const _component_a_menu = resolveComponent("a-menu");
735
+ const _component_a_dropdown = resolveComponent("a-dropdown");
736
+ return openBlock(), createElementBlock("div", null, [
737
+ createVNode(unref(BasicTable), {
738
+ onRegister: unref(registerTable),
739
+ rowSelection: unref(rowSelection)
740
+ }, {
741
+ tableTitle: withCtx(() => [
742
+ createVNode(_component_a_button, {
743
+ preIcon: "ant-design:plus-outlined",
744
+ type: "primary",
745
+ onClick: handleAdd,
746
+ style: { "margin-right": "5px" }
747
+ }, {
748
+ default: withCtx(() => [
749
+ _hoisted_1
750
+ ]),
751
+ _: 1
752
+ }),
753
+ unref(selectedRowKeys).length > 0 ? (openBlock(), createBlock(_component_a_dropdown, { key: 0 }, {
754
+ overlay: withCtx(() => [
755
+ createVNode(_component_a_menu, null, {
756
+ default: withCtx(() => [
757
+ createVNode(_component_a_menu_item, {
758
+ key: "1",
759
+ onClick: batchHandleDelete
760
+ }, {
761
+ default: withCtx(() => [
762
+ createVNode(_component_Icon, { icon: "ant-design:delete-outlined" }),
763
+ _hoisted_2
764
+ ]),
765
+ _: 1
766
+ })
767
+ ]),
768
+ _: 1
769
+ })
770
+ ]),
771
+ default: withCtx(() => [
772
+ createVNode(_component_a_button, null, {
773
+ default: withCtx(() => [
774
+ _hoisted_3,
775
+ createVNode(_component_Icon, { icon: "mdi:chevron-down" })
776
+ ]),
777
+ _: 1
778
+ })
779
+ ]),
780
+ _: 1
781
+ })) : createCommentVNode("", true)
782
+ ]),
783
+ action: withCtx(({ record }) => [
784
+ createVNode(unref(TableAction), {
785
+ actions: getAction(record),
786
+ dropDownActions: getDropDownAction(record)
787
+ }, null, 8, ["actions", "dropDownActions"])
788
+ ]),
789
+ _: 1
790
+ }, 8, ["onRegister", "rowSelection"]),
791
+ createVNode(_sfc_main$1, {
792
+ onRegister: unref(registerModal),
793
+ onSuccess: handleSuccess
794
+ }, null, 8, ["onRegister"])
795
+ ]);
796
+ };
797
+ }
798
+ });
799
+ export { _sfc_main as default };