@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
@@ -0,0 +1,1154 @@
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 { E as ENHANCEJS, c as SETUP } from "./FormSchemaFactory.js";
41
+ import { useRoute, useRouter } from "vue-router";
42
+ import * as vue from "vue";
43
+ import { ref, onBeforeUnmount, toRaw, nextTick, reactive, computed, unref, h, defineAsyncComponent, watch } from "vue";
44
+ import * as UTIL_AXIOS from "/@/utils/http/axios";
45
+ import { defHttp } from "/@/utils/http/axios";
46
+ import * as HOOK_MESSAGE from "/@/hooks/web/useMessage";
47
+ import { useMessage } from "/@/hooks/web/useMessage";
48
+ import { randomString, filterObj, getFileAccessHttpUrl } from "/@/utils/common/compUtils";
49
+ import * as UTIL_CACHE from "/@/utils/cache";
50
+ import { onMountedOrActivated } from "/@/hooks/core/onMountedOrActivated";
51
+ import { useModal } from "/@/components/Modal";
52
+ import { Modal } from "ant-design-vue";
53
+ import { useMethods } from "/@/hooks/system/useMethods";
54
+ import { p as pick } from "./pick.js";
55
+ import { filterMultiDictText } from "/@/utils/dict/JDictSelectUtil";
56
+ import { getAreaTextByCode } from "/@/components/Form/src/utils/Area";
57
+ import { createImgPreview } from "/@/components/Preview/index";
58
+ const $exports = {
59
+ vue,
60
+ "@": {
61
+ hooks: {
62
+ useMessage: HOOK_MESSAGE
63
+ },
64
+ utils: {
65
+ axios: UTIL_AXIOS,
66
+ cache: UTIL_CACHE
67
+ }
68
+ }
69
+ };
70
+ function useCustomHook(otherExports, context) {
71
+ const assignExports = Object.assign({}, $exports, otherExports);
72
+ function doImport(path) {
73
+ if (path != null && path != "") {
74
+ let paths = path.toString().split("/");
75
+ let result = assignExports[paths[0]];
76
+ for (let i = 1; i < paths.length; i++) {
77
+ result = result[paths[i]];
78
+ }
79
+ return result;
80
+ }
81
+ return null;
82
+ }
83
+ function doExport() {
84
+ }
85
+ function executeJsEnhanced(code) {
86
+ let randomKey = randomString(6);
87
+ let exportKey = "__export_" + randomKey;
88
+ const executeCode = `return function (customImport, ${exportKey}) {"use strict"; ${code}}`;
89
+ console.group("executeJsEnhanced");
90
+ console.log(executeCode);
91
+ console.groupEnd();
92
+ const fun = new Function(executeCode)();
93
+ fun.call(context, doImport, doExport);
94
+ }
95
+ return {
96
+ executeJsEnhanced
97
+ };
98
+ }
99
+ const CONTEXT_PROP_DESCRIPTION = {
100
+ acceptHrefParams: "<p> \u8DF3\u8F6C\u65F6\u83B7\u53D6\u7684\u53C2\u6570\u4FE1\u606F",
101
+ currentPage: "<p> \u5F53\u524D\u9875\u6570",
102
+ currentTableName: "<p> \u5F53\u524D\u8868\u540D",
103
+ description: "<p> \u5F53\u524D\u8868\u63CF\u8FF0",
104
+ hasChildrenField: "<p> \u662F\u5426\u6709\u5B50\u8282\u70B9\u7684\u5B57\u6BB5\u540D\uFF0C\u4EC5\u6811\u5F62\u8868\u5355\u4E0B\u6709\u6548",
105
+ isDesForm: "<p> xx",
106
+ isTree: "<m> \u662F\u5426\u662F\u6811\u5F62\u8868\u5355 ",
107
+ loadData: "<m> \u52A0\u8F7D\u5217\u8868\u6570\u636E",
108
+ pageSize: "<p> \u6BCF\u4E00\u9875\u663E\u793A\u6761\u6570",
109
+ queryParam: "<p> \u67E5\u8BE2\u6761\u4EF6\u5BF9\u8C61\uFF0C\u6BCF\u6B21\u70B9\u51FB\u67E5\u8BE2\u540E\u624D\u4F1A\u66F4\u65B0\u6B64\u6570\u636E",
110
+ selectedRowKeys: "<p> \u9009\u4E2D\u7684\u884C\u7684id\u6570\u7EC4",
111
+ sortField: "<p> \u6392\u5E8F\u5B57\u6BB5",
112
+ sortType: "<p> \u6392\u5E8F\u89C4\u5219",
113
+ total: "<p> \u603B\u9875\u6570"
114
+ };
115
+ const onlineUrl = {
116
+ getColumns: "/online/cgform/api/getColumns/",
117
+ getQueryInfo: "/online/cgform/api/getQueryInfo/",
118
+ getData: "/online/cgform/api/getData/",
119
+ getTreeData: "/online/cgform/api/getTreeData/",
120
+ optPre: "/online/cgform/api/form/",
121
+ buttonAction: "/online/cgform/api/doButton",
122
+ exportXls: "/online/cgform/api/exportXls/",
123
+ importXls: "/online/cgform/api/importXls/",
124
+ startProcess: "/act/process/extActProcess/startMutilProcess"
125
+ };
126
+ let config = {
127
+ sortField: "id",
128
+ sortType: "asc",
129
+ currentPage: 1,
130
+ pageSize: 10,
131
+ total: 0,
132
+ selectedRowKeys: [],
133
+ queryParam: {},
134
+ acceptHrefParams: {},
135
+ description: "",
136
+ currentTableName: "",
137
+ isDesForm: false,
138
+ desFormCode: "",
139
+ cache: false,
140
+ isTree: false,
141
+ hasChildrenField: ""
142
+ };
143
+ const metaPagination = {
144
+ current: 1,
145
+ pageSize: 10,
146
+ pageSizeOptions: ["10", "20", "30"],
147
+ showTotal: (total, range) => {
148
+ return range[0] + "-" + range[1] + " \u5171" + total + "\u6761";
149
+ },
150
+ showQuickJumper: true,
151
+ showSizeChanger: true,
152
+ total: 0
153
+ };
154
+ const { createMessage: $message } = useMessage();
155
+ const GET_FUN_BODY_REG = /(?:\/\*[\s\S]*?\*\/|\/\/.*?\r?\n|[^{])+\{([\s\S]*)\}$/;
156
+ function useOnlineTableContext() {
157
+ console.log("-------------------------useOnlineTableContext----------------------->");
158
+ const ID = ref("");
159
+ const route = useRoute();
160
+ const onlineQueryFormOuter = ref();
161
+ const superQueryButtonRef = ref();
162
+ const pagination = ref(false);
163
+ const dataSource = ref([]);
164
+ let specialConfigMap = {};
165
+ const methods = {
166
+ execButtonEnhance: function(code, record2) {
167
+ if (onlineTableContext2[ENHANCEJS][code]) {
168
+ if (SETUP === code) {
169
+ executeEnhanceJsHook(code);
170
+ } else {
171
+ let row = toRaw(record2);
172
+ return onlineTableContext2[ENHANCEJS][code].call(onlineTableContext2, onlineTableContext2, row);
173
+ }
174
+ } else if (onlineTableContext2[ENHANCEJS][code + "_hook"]) {
175
+ executeEnhanceJsHook(code + "_hook");
176
+ } else {
177
+ console.log("\u589E\u5F3A\u6CA1\u627E\u5230!", code);
178
+ }
179
+ },
180
+ isTree: function(status) {
181
+ if (typeof status === "boolean") {
182
+ onlineTableContext2["isTreeTable"] = status;
183
+ return status;
184
+ } else {
185
+ return onlineTableContext2["isTreeTable"];
186
+ }
187
+ }
188
+ };
189
+ function executeEnhanceJsHook(code) {
190
+ let str = onlineTableContext2[ENHANCEJS][code].toLocaleString();
191
+ let arr = str.match(GET_FUN_BODY_REG);
192
+ if (arr.length > 1) {
193
+ let temp = arr[1];
194
+ executeJsEnhanced(temp);
195
+ }
196
+ }
197
+ const onlineTableContext2 = new Proxy(CONTEXT_PROP_DESCRIPTION, {
198
+ get(_target, prop) {
199
+ if (typeof methods[prop] === "function") {
200
+ return methods[prop];
201
+ } else {
202
+ let temp = specialConfigMap[ID.value];
203
+ return Reflect.get(temp, prop);
204
+ }
205
+ },
206
+ set(_target, prop, value) {
207
+ let temp = getCurrentPageSpecialConfigMap();
208
+ if (typeof value === "function") {
209
+ return Reflect.set(methods, prop, value);
210
+ } else {
211
+ return Reflect.set(temp, prop, value);
212
+ }
213
+ },
214
+ deleteProperty(_target, key) {
215
+ if (key === ID.value) {
216
+ delete specialConfigMap[key];
217
+ return true;
218
+ } else {
219
+ return false;
220
+ }
221
+ }
222
+ });
223
+ const { executeJsEnhanced } = useCustomHook({}, onlineTableContext2);
224
+ function getTableId() {
225
+ let idValue = route.params.id;
226
+ if (!idValue) {
227
+ idValue = "";
228
+ }
229
+ return idValue;
230
+ }
231
+ onMountedOrActivated(() => {
232
+ console.log("-------------------onMountedOrActivated-------------------");
233
+ handlePageChange();
234
+ });
235
+ onBeforeUnmount(() => {
236
+ console.log("-------------------onBeforeUnmount-------------------");
237
+ delete specialConfigMap[ID.value];
238
+ });
239
+ function getCurrentPageSpecialConfigMap() {
240
+ let temp = specialConfigMap[ID.value];
241
+ if (!temp) {
242
+ let obj = Object.assign({}, config, { onlineUrl });
243
+ temp = JSON.parse(JSON.stringify(obj));
244
+ specialConfigMap[ID.value] = temp;
245
+ }
246
+ return temp;
247
+ }
248
+ function handleAcceptHrefParams() {
249
+ let acceptHrefParams = {};
250
+ let hrefParam = route.query;
251
+ if (hrefParam) {
252
+ Object.keys(hrefParam).map((key) => {
253
+ acceptHrefParams[key] = hrefParam[key];
254
+ });
255
+ onlineTableContext2["acceptHrefParams"] = acceptHrefParams;
256
+ }
257
+ }
258
+ function getColumnList() {
259
+ return new Promise((resolve, reject) => {
260
+ defHttp.get({
261
+ url: `${onlineTableContext2.onlineUrl.getColumns}${ID.value}`
262
+ }, { isTransformResponse: false }).then((res) => {
263
+ if (res.success) {
264
+ resolve(res.result);
265
+ } else {
266
+ $message.warning(res.message);
267
+ reject();
268
+ }
269
+ }).catch(() => {
270
+ reject();
271
+ });
272
+ });
273
+ }
274
+ function loadData() {
275
+ return new Promise((resolve, reject) => {
276
+ let url = `${onlineTableContext2.onlineUrl.getData}${ID.value}`;
277
+ if (onlineTableContext2.isTree() === true) {
278
+ url = `${onlineTableContext2.onlineUrl.getTreeData}${ID.value}`;
279
+ }
280
+ let params = getLoadDataParams();
281
+ console.log("------\u67E5\u8BE2\u53C2\u6570-----", params);
282
+ defHttp.get({ url, params }, { isTransformResponse: false }).then((res) => {
283
+ console.log("--onlineList-\u67E5\u8BE2\u5217\u8868\u6570\u636E", res);
284
+ if (res.success) {
285
+ handleDataResult(res.result);
286
+ resolve(true);
287
+ } else {
288
+ $message.warning(res.message);
289
+ reject(false);
290
+ }
291
+ }).catch(() => {
292
+ let error = "\u8BF7\u6C42\u5217\u8868\u6570\u636E\u5F02\u5E38!";
293
+ $message.warning(error);
294
+ reject(false);
295
+ });
296
+ });
297
+ }
298
+ function getLoadDataParams() {
299
+ const { sortField, sortType, acceptHrefParams, queryParam } = onlineTableContext2;
300
+ let treeParam = {};
301
+ if (onlineTableContext2.isTree() === true) {
302
+ treeParam["hasQuery"] = "false";
303
+ } else {
304
+ treeParam["hasQuery"] = "true";
305
+ }
306
+ let params = Object.assign({}, treeParam, acceptHrefParams, queryParam, { column: sortField, order: sortType });
307
+ if (pagination.value) {
308
+ params.pageNo = pagination.value.current;
309
+ params.pageSize = pagination.value.pageSize;
310
+ } else {
311
+ params["pageSize"] = -521;
312
+ }
313
+ let superQueryData = getSuperQueryData();
314
+ params.superQueryMatchType = superQueryData.matchType || "";
315
+ params.superQueryParams = superQueryData.params || "";
316
+ return filterObj(params);
317
+ }
318
+ function handleDataResult(result) {
319
+ let total = 0;
320
+ if (Number(result.total) > 0) {
321
+ if (onlineTableContext2.isTree() === true) {
322
+ dataSource.value = getTreeDataByResult(result.records);
323
+ nextTick(() => {
324
+ loadDataByExpandedRows(dataSource.value);
325
+ });
326
+ } else {
327
+ dataSource.value = result.records;
328
+ }
329
+ total = Number(result.total);
330
+ } else {
331
+ dataSource.value = [];
332
+ }
333
+ if (pagination.value) {
334
+ pagination.value = __spreadProps(__spreadValues({}, pagination.value), { total });
335
+ }
336
+ }
337
+ function handleChangeInTable($pagination, _filters, sorter) {
338
+ if (sorter && sorter.order) {
339
+ onlineTableContext2["sortField"] = sorter.field;
340
+ onlineTableContext2["sortType"] = sorter.order == "ascend" ? "asc" : "desc";
341
+ } else {
342
+ onlineTableContext2["sortField"] = "id";
343
+ onlineTableContext2["sortType"] = "asc";
344
+ }
345
+ if (pagination.value) {
346
+ pagination.value = $pagination;
347
+ }
348
+ loadData();
349
+ }
350
+ function handleSpecialConfig(result) {
351
+ onlineTableContext2["description"] = result.description;
352
+ onlineTableContext2["currentTableName"] = result.currentTableName;
353
+ onlineTableContext2["isDesForm"] = result.isDesForm;
354
+ onlineTableContext2["desFormCode"] = result.desFormCode;
355
+ onlineTableContext2["ID"] = ID.value;
356
+ let { acceptHrefParams, queryParam, superQuery, currentPage, pageSize } = onlineTableContext2;
357
+ handleAcceptHrefParams();
358
+ if (!queryParam) {
359
+ onlineTableContext2["queryParam"] = {};
360
+ } else {
361
+ onlineQueryFormOuter.value.initDefaultValues(queryParam, acceptHrefParams);
362
+ }
363
+ if (!superQuery) {
364
+ onlineTableContext2["superQuery"] = { params: "", matchType: "" };
365
+ } else {
366
+ superQueryButtonRef.value.initDefaultValues(superQuery);
367
+ }
368
+ if (result.paginationFlag == "Y") {
369
+ pagination.value = __spreadValues(__spreadValues({}, metaPagination), { current: currentPage, pageSize });
370
+ } else {
371
+ pagination.value = false;
372
+ }
373
+ }
374
+ const add2Context = {
375
+ loadData,
376
+ getLoadDataParams
377
+ };
378
+ Object.keys(add2Context).map((key) => {
379
+ onlineTableContext2[key] = add2Context[key];
380
+ });
381
+ let loading = ref(false);
382
+ function reload() {
383
+ return __async(this, null, function* () {
384
+ if (pagination.value) {
385
+ pagination.value = __spreadProps(__spreadValues({}, pagination.value), { current: 1 });
386
+ }
387
+ onlineTableContext2.clearSelectedRow();
388
+ yield loadData();
389
+ });
390
+ }
391
+ function getTreeDataByResult(result) {
392
+ if (result) {
393
+ return result.map((item) => {
394
+ let hasChildrenField = onlineTableContext2["hasChildrenField"];
395
+ if (item[hasChildrenField] == "1") {
396
+ let loadChild = { id: item.id + "_loadChild", name: "loading...", isLoading: true };
397
+ loadChild["jeecg_row_key"] = loadChild.id;
398
+ item.children = [loadChild];
399
+ }
400
+ return item;
401
+ });
402
+ }
403
+ }
404
+ const expandedRowKeys = ref([]);
405
+ function handleExpandedRowsChange(expandedRowKeysValue) {
406
+ expandedRowKeys.value = expandedRowKeysValue;
407
+ }
408
+ function loadDataByExpandedRows(dataList) {
409
+ let expandedRowKeysValue = expandedRowKeys.value;
410
+ if (expandedRowKeysValue.length > 0) {
411
+ const { sortField, sortType, pidField } = onlineTableContext2;
412
+ let params = Object.assign({}, { column: sortField, order: sortType });
413
+ params["hasQuery"] = "in";
414
+ let superParams = Object.assign({});
415
+ superParams.rule = "in";
416
+ superParams.type = "text";
417
+ superParams.val = expandedRowKeysValue.join(",");
418
+ superParams.field = pidField;
419
+ superParams = [superParams];
420
+ params["superQueryParams"] = encodeURI(JSON.stringify(superParams));
421
+ params["superQueryMatchType"] = "and";
422
+ params["batchFlag"] = "true";
423
+ let url = `${onlineTableContext2.onlineUrl.getTreeData}${ID.value}`;
424
+ console.log("--onlineList-\u67E5\u8BE2\u5B50\u8282\u70B9\u53C2\u6570", superParams);
425
+ defHttp.get({ url, params }, { isTransformResponse: false }).then((res) => {
426
+ console.log("--onlineList-\u67E5\u8BE2\u5B50\u8282\u70B9\u5217\u8868\u6570\u636E", res);
427
+ if (res.success && res.result.records && res.result.records.length > 0) {
428
+ let records = res.result.records;
429
+ const listMap = /* @__PURE__ */ new Map();
430
+ for (let item of records) {
431
+ let pid = item[pidField];
432
+ if (expandedRowKeysValue.join(",").includes(pid)) {
433
+ let mapList = listMap.get(pid);
434
+ if (mapList == null) {
435
+ mapList = [];
436
+ }
437
+ mapList.push(item);
438
+ listMap.set(pid, mapList);
439
+ }
440
+ }
441
+ let childrenMap = listMap;
442
+ let fn = (list) => {
443
+ if (list) {
444
+ list.forEach((data) => {
445
+ if (expandedRowKeysValue.includes(data.id)) {
446
+ data.children = getTreeDataByResult(childrenMap.get(data.id));
447
+ fn(data.children);
448
+ }
449
+ });
450
+ }
451
+ };
452
+ fn(dataList);
453
+ }
454
+ }).catch(() => {
455
+ let error = "loadDataByExpandedRows\u8BF7\u6C42\u5217\u8868\u6570\u636E\u5F02\u5E38!";
456
+ $message.warning(error);
457
+ });
458
+ } else {
459
+ return Promise.resolve();
460
+ }
461
+ }
462
+ function getSuperQueryData() {
463
+ if (!onlineTableContext2.superQuery) {
464
+ return {};
465
+ }
466
+ const { superQuery: { params, matchType }, currentTableName } = onlineTableContext2;
467
+ let pre = currentTableName + "@";
468
+ let arr = [];
469
+ if (params.length > 0) {
470
+ for (let data of params) {
471
+ let item = __spreadValues({}, data);
472
+ let field2 = item.field;
473
+ if (field2.startsWith(pre)) {
474
+ item.field = field2.replace(pre, "");
475
+ }
476
+ arr.push(item);
477
+ }
478
+ }
479
+ let str = arr.length > 0 ? JSON.stringify(arr) : "";
480
+ console.log("\u9AD8\u7EA7\u67E5\u8BE2\u6761\u4EF6", arr, matchType);
481
+ return {
482
+ params: encodeURIComponent(str),
483
+ matchType
484
+ };
485
+ }
486
+ const superQueryStatus = ref(false);
487
+ function handleSuperQuery(params, matchType) {
488
+ onlineTableContext2["superQuery"] = {
489
+ params,
490
+ matchType
491
+ };
492
+ if (params.length == 0) {
493
+ superQueryStatus.value = false;
494
+ } else {
495
+ superQueryStatus.value = true;
496
+ }
497
+ loadData();
498
+ }
499
+ const [registerCustomModal, { openModal: doOpenCustomModal }] = useModal();
500
+ function openCustomModal(param) {
501
+ if (!param) {
502
+ param = {};
503
+ }
504
+ if (!param.row) {
505
+ let rows = onlineTableContext2["selectedRows"];
506
+ if (!rows || rows.length == 0 || rows.length > 1) {
507
+ $message.warning("\u8BF7\u9009\u62E9\u4E00\u6761\u6570\u636E");
508
+ return;
509
+ }
510
+ param.row = rows[0];
511
+ }
512
+ param["code"] = ID.value;
513
+ doOpenCustomModal(true, param);
514
+ }
515
+ onlineTableContext2["openCustomModal"] = openCustomModal;
516
+ function handlePageChange() {
517
+ let idValue = getTableId();
518
+ ID.value = idValue;
519
+ }
520
+ handlePageChange();
521
+ return __spreadValues({
522
+ ID,
523
+ onlineQueryFormOuter,
524
+ superQueryButtonRef,
525
+ loading,
526
+ reload,
527
+ dataSource,
528
+ pagination,
529
+ handleSpecialConfig,
530
+ onlineTableContext: onlineTableContext2,
531
+ handleChangeInTable,
532
+ getColumnList,
533
+ getTreeDataByResult,
534
+ expandedRowKeys,
535
+ handleExpandedRowsChange,
536
+ superQueryStatus,
537
+ handleSuperQuery,
538
+ registerCustomModal
539
+ }, add2Context);
540
+ }
541
+ const FLOW_CODE_PRE = "onl_";
542
+ function useListButton(onlineTableContext2) {
543
+ const buttonStatus = {
544
+ add: true,
545
+ addSub: true,
546
+ update: true,
547
+ delete: true,
548
+ batch_delete: true,
549
+ import: true,
550
+ export: true,
551
+ detail: true,
552
+ super_query: true,
553
+ bpm: true
554
+ };
555
+ const [registerModal, { openModal }] = useModal();
556
+ const [registerImportModal, { openModal: openImportModal }] = useModal();
557
+ const { createMessage: $message2 } = useMessage();
558
+ const buttonSwitch = reactive(buttonStatus);
559
+ const cgLinkButtonList = reactive([]);
560
+ const cgTopButtonList = reactive([]);
561
+ function initButtonList(btnList) {
562
+ cgLinkButtonList.length = 0;
563
+ cgTopButtonList.length = 0;
564
+ if (btnList && btnList.length > 0) {
565
+ for (let i = 0; i < btnList.length; i++) {
566
+ let temp = pick(btnList[i], "buttonCode", "buttonName", "buttonStyle", "optType", "exp", "buttonIcon");
567
+ if (temp.buttonStyle == "button") {
568
+ cgTopButtonList.push(temp);
569
+ } else if (temp.buttonStyle == "link") {
570
+ cgLinkButtonList.push(temp);
571
+ }
572
+ }
573
+ }
574
+ }
575
+ function initButtonSwitch(hideColumns) {
576
+ Object.keys(buttonSwitch).forEach((key) => {
577
+ buttonSwitch[key] = true;
578
+ });
579
+ if (hideColumns && hideColumns.length > 0) {
580
+ Object.keys(buttonSwitch).forEach((key) => {
581
+ if (hideColumns.indexOf(key) >= 0) {
582
+ buttonSwitch[key] = false;
583
+ }
584
+ });
585
+ }
586
+ }
587
+ function handleAdd(param) {
588
+ let data = { isUpdate: false };
589
+ if (param) {
590
+ data["param"] = param;
591
+ }
592
+ openModal(true, data);
593
+ }
594
+ function handleEdit(record2) {
595
+ onlineTableContext2.beforeEdit(record2).then(() => {
596
+ openModal(true, {
597
+ isUpdate: true,
598
+ record: record2
599
+ });
600
+ }).catch((msg) => {
601
+ $message2.warning(msg);
602
+ });
603
+ }
604
+ const getDeleteButton = (record2) => {
605
+ return {
606
+ label: "\u5220\u9664",
607
+ popConfirm: {
608
+ title: "\u662F\u5426\u5220\u9664\uFF1F",
609
+ confirm: handleDeleteOne.bind(null, record2)
610
+ }
611
+ };
612
+ };
613
+ function handleDeleteOne(record2) {
614
+ onlineTableContext2.beforeDelete(record2).then(() => {
615
+ handleDelete(record2.id);
616
+ }).catch((msg) => {
617
+ $message2.warning(msg);
618
+ });
619
+ }
620
+ function getActions(record2) {
621
+ if (toRaw(buttonSwitch.update) === true) {
622
+ return [
623
+ {
624
+ label: "\u7F16\u8F91",
625
+ onClick: handleEdit.bind(null, record2)
626
+ }
627
+ ];
628
+ }
629
+ return [];
630
+ }
631
+ function getSubmitFlowButton(record2) {
632
+ return {
633
+ label: "\u63D0\u4EA4\u6D41\u7A0B",
634
+ popConfirm: {
635
+ title: "\u786E\u8BA4\u63D0\u4EA4\u6D41\u7A0B\u5417\uFF1F",
636
+ confirm: handleSubmitFlow.bind(null, record2)
637
+ }
638
+ };
639
+ }
640
+ function getDropDownActions(record2) {
641
+ let arr = [];
642
+ if (toRaw(buttonSwitch.delete) === true) {
643
+ arr.push({
644
+ label: "\u8BE6\u60C5",
645
+ onClick: handleDetail.bind(null, record2)
646
+ });
647
+ }
648
+ if (onlineTableContext2["hasBpmStatus"] === true) {
649
+ arr.push(getSubmitFlowButton(record2));
650
+ }
651
+ if (toRaw(buttonSwitch.delete) === true) {
652
+ arr.push(getDeleteButton(record2));
653
+ }
654
+ let buttonList = cgLinkButtonList;
655
+ if (buttonList && buttonList.length > 0) {
656
+ for (let item of buttonList) {
657
+ if (showLinkButtonOfExpression(item.exp || "", record2) === true) {
658
+ arr.push({
659
+ label: item.buttonName,
660
+ onClick: cgButtonLinkHandler.bind(null, record2, item.buttonCode, item.optType)
661
+ });
662
+ }
663
+ }
664
+ }
665
+ return arr;
666
+ }
667
+ function handleDetail(record2) {
668
+ openModal(true, {
669
+ isUpdate: true,
670
+ disableSubmit: true,
671
+ record: record2
672
+ });
673
+ }
674
+ function startProcess(record2) {
675
+ const { currentTableName, onlineUrl: { startProcess: startProcess2 } } = onlineTableContext2;
676
+ let postConfig = {
677
+ url: startProcess2,
678
+ params: {
679
+ flowCode: FLOW_CODE_PRE + currentTableName,
680
+ id: record2.id,
681
+ formUrl: "modules/bpm/task/form/OnlineFormDetail",
682
+ formUrlMobile: "check/onlineForm/detail"
683
+ }
684
+ };
685
+ let postOption = { isTransformResponse: false };
686
+ return new Promise((resolve, reject) => {
687
+ defHttp.post(postConfig, postOption).then((res) => {
688
+ if (res.success) {
689
+ resolve(res);
690
+ $message2.success(res.message);
691
+ } else {
692
+ reject();
693
+ $message2.warning(res.message);
694
+ }
695
+ });
696
+ });
697
+ }
698
+ function handleSubmitFlow(record2) {
699
+ return __async(this, null, function* () {
700
+ yield startProcess(record2);
701
+ onlineTableContext2.loadData();
702
+ });
703
+ }
704
+ function handleDelete(dataId) {
705
+ console.log("\u5220\u9664\u6570\u636Eid\u503C", dataId);
706
+ let url = `${onlineTableContext2.onlineUrl.optPre}${onlineTableContext2.ID}/${dataId}`;
707
+ return new Promise((resolve, reject) => {
708
+ defHttp.delete({
709
+ url
710
+ }, { isTransformResponse: false }).then((res) => {
711
+ if (res.success) {
712
+ $message2.success(res.message);
713
+ onlineTableContext2.loadData();
714
+ resolve(true);
715
+ } else {
716
+ $message2.warning(res.message);
717
+ reject();
718
+ }
719
+ });
720
+ });
721
+ }
722
+ function handleBatchDelete() {
723
+ let arr = onlineTableContext2["selectedRowKeys"];
724
+ if (arr.length <= 0) {
725
+ $message2.warning("\u8BF7\u9009\u62E9\u4E00\u6761\u8BB0\u5F55\uFF01");
726
+ return false;
727
+ } else {
728
+ let idSet = [];
729
+ arr.forEach(function(val) {
730
+ let temp = val;
731
+ if (temp && temp.endsWith("_loadChild")) {
732
+ temp = temp.replace("_loadChild", "");
733
+ }
734
+ if (idSet.indexOf(temp) < 0) {
735
+ idSet.push(temp);
736
+ }
737
+ });
738
+ let ids = idSet.join(",");
739
+ Modal.confirm({
740
+ title: "\u786E\u8BA4\u5220\u9664",
741
+ content: "\u662F\u5426\u5220\u9664\u9009\u4E2D\u6570\u636E",
742
+ okText: "\u786E\u8BA4",
743
+ cancelText: "\u53D6\u6D88",
744
+ onOk: () => __async(this, null, function* () {
745
+ yield handleDelete(ids);
746
+ onlineTableContext2.clearSelectedRow();
747
+ })
748
+ });
749
+ }
750
+ }
751
+ function cgButtonLinkHandler(record2, buttonCode, optType) {
752
+ if (optType == "js") {
753
+ onlineTableContext2["execButtonEnhance"](buttonCode, record2);
754
+ } else if (optType == "action") {
755
+ let params = {
756
+ formId: onlineTableContext2["ID"],
757
+ buttonCode,
758
+ dataId: record2.id
759
+ };
760
+ let url = `${onlineTableContext2.onlineUrl.buttonAction}`;
761
+ defHttp.post({
762
+ url,
763
+ params
764
+ }, { isTransformResponse: false }).then((res) => {
765
+ if (res.success) {
766
+ onlineTableContext2.loadData();
767
+ $message2.success("\u5904\u7406\u5B8C\u6210!");
768
+ } else {
769
+ $message2.warning(res.message);
770
+ }
771
+ });
772
+ }
773
+ }
774
+ function cgButtonJsHandler(buttonCode) {
775
+ onlineTableContext2["execButtonEnhance"](buttonCode);
776
+ }
777
+ function cgButtonActionHandler(buttonCode) {
778
+ let arr = onlineTableContext2["selectedRowKeys"];
779
+ if (!arr || arr.length == 0) {
780
+ $message2.warning("\u8BF7\u5148\u9009\u4E2D\u4E00\u6761\u8BB0\u5F55");
781
+ return false;
782
+ }
783
+ let dataId = arr.join(",");
784
+ let params = {
785
+ formId: onlineTableContext2["ID"],
786
+ buttonCode,
787
+ dataId
788
+ };
789
+ let url = `${onlineTableContext2.onlineUrl.buttonAction}`;
790
+ defHttp.post({
791
+ url,
792
+ params
793
+ }, { isTransformResponse: false }).then((res) => {
794
+ if (res.success) {
795
+ onlineTableContext2.loadData();
796
+ onlineTableContext2.clearSelectedRow();
797
+ $message2.success("\u5904\u7406\u5B8C\u6210!");
798
+ } else {
799
+ $message2.warning(res.message);
800
+ }
801
+ });
802
+ }
803
+ function onImportExcel() {
804
+ openImportModal(true);
805
+ }
806
+ const importUrl = () => {
807
+ return `${onlineTableContext2.onlineUrl.importXls}${onlineTableContext2.ID}`;
808
+ };
809
+ const { handleExportXlsx } = useMethods();
810
+ function onExportExcel() {
811
+ let params = onlineTableContext2.getLoadDataParams();
812
+ let selections = onlineTableContext2["selectedRowKeys"];
813
+ if (selections && selections.length > 0) {
814
+ params["selections"] = selections.join(",");
815
+ }
816
+ let paramsStr = JSON.stringify(filterObj(params));
817
+ let url = `${onlineTableContext2.onlineUrl.exportXls}${onlineTableContext2.ID}`;
818
+ const description = onlineTableContext2.description;
819
+ handleExportXlsx(description, url, { paramsStr });
820
+ }
821
+ function showLinkButtonOfExpression(expression, row) {
822
+ if (!expression || expression == "") {
823
+ return true;
824
+ }
825
+ let arr = expression.split("#");
826
+ let fieldValue = row[arr[0]];
827
+ let exp = arr[1].toLowerCase();
828
+ if (exp === "eq") {
829
+ return fieldValue == arr[2];
830
+ } else if (exp === "ne") {
831
+ return !(fieldValue == arr[2]);
832
+ } else if (exp === "empty") {
833
+ if (arr[2] === "true") {
834
+ return !fieldValue || fieldValue == "";
835
+ } else {
836
+ return fieldValue && fieldValue.length > 0;
837
+ }
838
+ } else if (exp === "in") {
839
+ let arr2 = arr[2].split(",");
840
+ return arr2.indexOf(String(fieldValue)) >= 0;
841
+ }
842
+ return false;
843
+ }
844
+ return {
845
+ buttonSwitch,
846
+ cgLinkButtonList,
847
+ cgTopButtonList,
848
+ importUrl,
849
+ registerModal,
850
+ handleAdd,
851
+ handleEdit,
852
+ handleBatchDelete,
853
+ registerImportModal,
854
+ onImportExcel,
855
+ onExportExcel,
856
+ getDropDownActions,
857
+ getActions,
858
+ cgButtonJsHandler,
859
+ cgButtonActionHandler,
860
+ cgButtonLinkHandler,
861
+ initButtonList,
862
+ initButtonSwitch,
863
+ getDeleteButton,
864
+ handleSubmitFlow,
865
+ getSubmitFlowButton
866
+ };
867
+ }
868
+ function useTableColumns(onlineTableContext) {
869
+ let router = useRouter();
870
+ const columns = ref([]);
871
+ const dictOptionInfo = ref({});
872
+ const selectedKeys = ref([]);
873
+ const rowSelection = ref(null);
874
+ let enableScrollBar = ref(true);
875
+ let tableScroll = computed(() => {
876
+ if (enableScrollBar.value == true) {
877
+ return void 0;
878
+ } else {
879
+ return { x: false };
880
+ }
881
+ });
882
+ function handleColumnResult(result) {
883
+ dictOptionInfo.value = result.dictOptions;
884
+ if (result.checkboxFlag == "Y") {
885
+ rowSelection.value = {
886
+ selectedRowKeys: selectedKeys,
887
+ onChange: onSelectChange
888
+ };
889
+ } else {
890
+ rowSelection.value = null;
891
+ }
892
+ enableScrollBar.value = result.scrollFlag == 1;
893
+ let dataColumns = result.columns;
894
+ dataColumns.forEach((column) => {
895
+ Object.keys(column).map((key) => {
896
+ if (column[key] == null) {
897
+ delete column[key];
898
+ }
899
+ });
900
+ });
901
+ let fieldHrefSlots = result.fieldHrefSlots;
902
+ const fieldHrefSlotKeysMap = {};
903
+ fieldHrefSlots.forEach((item) => fieldHrefSlotKeysMap[item.slotName] = item);
904
+ let tableColumns = [];
905
+ tableColumns = handleColumnHrefAndDict(dataColumns, fieldHrefSlotKeysMap);
906
+ bpmStatusFilter(tableColumns);
907
+ console.log("-----\u5217\u8868\u5217\u914D\u7F6E----", tableColumns);
908
+ if (onlineTableContext.isTree() === true) {
909
+ let firstField = result.textField;
910
+ let index = -1;
911
+ for (let i = 0; i < tableColumns.length; i++) {
912
+ if (tableColumns[i].dataIndex == firstField) {
913
+ index = i;
914
+ break;
915
+ }
916
+ }
917
+ if (index > 0) {
918
+ let deleteColumns = tableColumns.splice(index, 1);
919
+ tableColumns.unshift(deleteColumns[0]);
920
+ }
921
+ if (tableColumns.length > 0) {
922
+ tableColumns[0].align = "left";
923
+ }
924
+ }
925
+ columns.value = tableColumns;
926
+ }
927
+ function onSelectChange(selectedRowKeys, selectedRows) {
928
+ selectedKeys.value = selectedRowKeys;
929
+ onlineTableContext["selectedRows"] = toRaw(selectedRows);
930
+ onlineTableContext["selectedRowKeys"] = toRaw(selectedRowKeys);
931
+ }
932
+ function handleColumnHrefAndDict(columns2, fieldHrefSlotKeysMap) {
933
+ for (let column of columns2) {
934
+ let { customRender, hrefSlotName, fieldType } = column;
935
+ if (fieldType == "Date") {
936
+ column.customRender = ({ text: text2 }) => {
937
+ if (!text2) {
938
+ return "";
939
+ }
940
+ if (text2.length > 10) {
941
+ return text2.substring(0, 10);
942
+ }
943
+ return text2;
944
+ };
945
+ } else {
946
+ if (!hrefSlotName && (column.scopedSlots && column.scopedSlots.customRender)) {
947
+ if (fieldHrefSlotKeysMap.hasOwnProperty(column.scopedSlots.customRender)) {
948
+ hrefSlotName = column.scopedSlots.customRender;
949
+ }
950
+ }
951
+ if (customRender || hrefSlotName) {
952
+ let dictCode = customRender;
953
+ let replaceFlag = "_replace_text_";
954
+ column.ellipsis = true;
955
+ column.customRender = ({ text: text2, record: record2 }) => {
956
+ let value = text2;
957
+ if (dictCode) {
958
+ if (dictCode.startsWith(replaceFlag)) {
959
+ let textFieldName = dictCode.replace(replaceFlag, "");
960
+ value = record2[textFieldName];
961
+ } else {
962
+ value = filterMultiDictText(unref(dictOptionInfo)[dictCode], text2 + "");
963
+ }
964
+ }
965
+ if (column.showLength) {
966
+ if (value && value.length > column.showLength) {
967
+ value = value.substr(0, column.showLength) + "...";
968
+ }
969
+ }
970
+ if (hrefSlotName) {
971
+ let field2 = fieldHrefSlotKeysMap[hrefSlotName];
972
+ if (field2) {
973
+ return h("a", {
974
+ onClick: () => handleClickFieldHref(field2, record2)
975
+ }, value);
976
+ }
977
+ }
978
+ return value;
979
+ };
980
+ }
981
+ if (column.scopedSlots) {
982
+ column.ellipsis = true;
983
+ let slots = column.scopedSlots;
984
+ column["slots"] = slots;
985
+ delete column.scopedSlots;
986
+ }
987
+ }
988
+ }
989
+ return columns2;
990
+ }
991
+ function handleClickFieldHref(field, record) {
992
+ let href = field.href;
993
+ let urlPattern = /(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%\$#_]*)?/;
994
+ let compPattern = /\.vue(\?.*)?$/;
995
+ let jsPattern = /{{([^}]+)}}/g;
996
+ if (typeof href === "string") {
997
+ href = href.trim().replace(/\${([^}]+)?}/g, (_s1, s2) => record[s2]);
998
+ if (jsPattern.test(href)) {
999
+ href = href.replace(jsPattern, function(text, s0) {
1000
+ try {
1001
+ return eval(s0);
1002
+ } catch (e) {
1003
+ console.error(e);
1004
+ return text;
1005
+ }
1006
+ });
1007
+ }
1008
+ if (urlPattern.test(href)) {
1009
+ window.open(href, "_blank");
1010
+ } else if (compPattern.test(href)) {
1011
+ openHrefCompModal(href);
1012
+ } else {
1013
+ router.push(href);
1014
+ }
1015
+ }
1016
+ }
1017
+ const dialogStyle = {
1018
+ top: 0,
1019
+ left: 0,
1020
+ height: "100%",
1021
+ margin: 0,
1022
+ padding: 0
1023
+ };
1024
+ const hrefComponent = reactive({
1025
+ model: {
1026
+ title: "",
1027
+ okText: "\u5173\u95ED",
1028
+ width: "100%",
1029
+ visible: false,
1030
+ destroyOnClose: true,
1031
+ style: dialogStyle,
1032
+ bodyStyle: { padding: "8px", height: "calc(100vh - 108px)", overflow: "auto", overflowX: "hidden" },
1033
+ cancelButtonProps: { style: { display: "none" } }
1034
+ },
1035
+ on: {
1036
+ ok: () => hrefComponent.model.visible = false,
1037
+ cancel: () => hrefComponent.model.visible = false
1038
+ },
1039
+ is: null,
1040
+ params: {}
1041
+ });
1042
+ function openHrefCompModal(href2) {
1043
+ let index = href2.indexOf("?");
1044
+ let path = href2;
1045
+ if (index !== -1) {
1046
+ path = href2.substring(0, index);
1047
+ let paramString = href2.substring(index + 1, href2.length);
1048
+ let paramArray = paramString.split("&");
1049
+ let params = {};
1050
+ paramArray.forEach((paramObject) => {
1051
+ let paramItem = paramObject.split("=");
1052
+ params[paramItem[0]] = paramItem[1];
1053
+ });
1054
+ hrefComponent.params = params;
1055
+ } else {
1056
+ hrefComponent.params = {};
1057
+ }
1058
+ hrefComponent.model.visible = true;
1059
+ hrefComponent.model.title = "\u64CD\u4F5C";
1060
+ hrefComponent.is = defineAsyncComponent(() => import(
1061
+ /* @vite-ignore */
1062
+ "/@/views/" + (path.startsWith("/") ? path.slice(1) : path)
1063
+ ));
1064
+ }
1065
+ const actionColumn = reactive({
1066
+ title: "\u64CD\u4F5C",
1067
+ dataIndex: "action",
1068
+ slots: { customRender: "action" },
1069
+ align: "center",
1070
+ width: 150
1071
+ });
1072
+ function bpmStatusFilter(tableColumns) {
1073
+ let flag = false;
1074
+ for (let i = 0; i < tableColumns.length; i++) {
1075
+ let item = tableColumns[i];
1076
+ let fieldName = item.dataIndex;
1077
+ if (fieldName.toLowerCase() == "bpm_status") {
1078
+ flag = true;
1079
+ break;
1080
+ }
1081
+ }
1082
+ onlineTableContext["hasBpmStatus"] = flag;
1083
+ return flag;
1084
+ }
1085
+ function downloadRowFile(text2) {
1086
+ if (!text2) {
1087
+ return;
1088
+ }
1089
+ if (text2.indexOf(",") > 0) {
1090
+ text2 = text2.substring(0, text2.indexOf(","));
1091
+ }
1092
+ let url = getFileAccessHttpUrl(text2);
1093
+ window.open(url);
1094
+ }
1095
+ function getImgView(text2) {
1096
+ if (text2 && text2.indexOf(",") > 0) {
1097
+ text2 = text2.substring(0, text2.indexOf(","));
1098
+ }
1099
+ return getFileAccessHttpUrl(text2);
1100
+ }
1101
+ function getPcaText(code) {
1102
+ if (!code) {
1103
+ return "";
1104
+ }
1105
+ return getAreaTextByCode(code);
1106
+ }
1107
+ function getFormatDate(text2) {
1108
+ if (!text2) {
1109
+ return "";
1110
+ }
1111
+ let a = text2;
1112
+ if (a.length > 10) {
1113
+ a = a.substring(0, 10);
1114
+ }
1115
+ return a;
1116
+ }
1117
+ watch(selectedKeys, () => {
1118
+ onlineTableContext["selectedRowKeys"] = toRaw(selectedKeys.value);
1119
+ });
1120
+ onlineTableContext["clearSelectedRow"] = () => {
1121
+ selectedKeys.value = [];
1122
+ onlineTableContext["selectedRows"] = [];
1123
+ onlineTableContext["selectedRowKeys"] = [];
1124
+ };
1125
+ function viewOnlineCellImage(text2) {
1126
+ if (text2) {
1127
+ let imgList = [];
1128
+ let arr = text2.split(",");
1129
+ for (let str of arr) {
1130
+ if (str) {
1131
+ imgList.push(getFileAccessHttpUrl(str));
1132
+ }
1133
+ }
1134
+ createImgPreview({ imageList: imgList });
1135
+ }
1136
+ }
1137
+ return {
1138
+ columns,
1139
+ actionColumn,
1140
+ selectedKeys,
1141
+ rowSelection,
1142
+ enableScrollBar,
1143
+ tableScroll,
1144
+ downloadRowFile,
1145
+ getImgView,
1146
+ getPcaText,
1147
+ getFormatDate,
1148
+ handleColumnResult,
1149
+ onSelectChange,
1150
+ hrefComponent,
1151
+ viewOnlineCellImage
1152
+ };
1153
+ }
1154
+ export { useListButton as a, useTableColumns as b, useOnlineTableContext as u };