@jeecg/online 1.0.1 → 3.4.3-GA

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 (93) hide show
  1. package/AuthButtonConfig.js +14 -7
  2. package/AuthButtonTree.js +3 -5
  3. package/AuthDataConfig.js +9 -6
  4. package/AuthDataTree.js +3 -5
  5. package/AuthFieldConfig.js +15 -12
  6. package/AuthFieldTree.js +24 -18
  7. package/AuthManagerDrawer.js +1 -1
  8. package/AuthSetterModal.js +1 -0
  9. package/CgformCopyList.js +34 -22
  10. package/CgformModal.js +57 -50
  11. package/CgreportModal.js +32 -39
  12. package/CheckDictTable.js +144 -24
  13. package/CodeFileListModal.js +175 -0
  14. package/CodeFileViewModal.js +325 -0
  15. package/CodeGeneratorModal.js +41 -38
  16. package/CustomButtonList.js +19 -22
  17. package/DBAttributeTable.js +248 -12
  18. package/DbToOnlineModal.js +27 -25
  19. package/DetailForm.js +609 -0
  20. package/EnhanceJavaModal.js +11 -17
  21. package/EnhanceJsHistory.js +6 -8
  22. package/EnhanceJsModal.js +16 -16
  23. package/EnhanceSqlModal.js +11 -17
  24. package/ExtendConfigModal.js +24 -15
  25. package/ForeignKeyTable.js +4 -3
  26. package/FormSchemaFactory.js +163 -30
  27. package/IndexTable.js +6 -5
  28. package/JModalTip.js +54 -0
  29. package/JOnlineSearchSelect.js +18 -10
  30. package/LeftDepart.js +1 -1
  31. package/LeftRole.js +7 -4
  32. package/LeftUser.js +7 -4
  33. package/LinkTableConfigModal.js +289 -0
  34. package/LinkTableFieldConfigModal.js +218 -0
  35. package/LinkTableListPiece.js +36 -0
  36. package/ModalFormDemo.js +3 -2
  37. package/OnlineAutoList.js +154 -55
  38. package/OnlineAutoModal.js +92 -131
  39. package/OnlineAutoTreeList.js +93 -53
  40. package/OnlineCustomModal.js +30 -14
  41. package/OnlineDetailModal.js +184 -0
  42. package/OnlineForm.js +274 -141
  43. package/OnlineFormDetail.js +326 -0
  44. package/OnlineQueryForm.js +72 -40
  45. package/OnlineSearchFormItem.js +26 -18
  46. package/OnlineSelectCascade.js +37 -26
  47. package/OnlineSubFormDetail.js +167 -0
  48. package/OnlineSuperQuery.js +70 -75
  49. package/OnlineSuperQueryValComponent.js +1 -0
  50. package/OnlineSuperQueryValComponent.vue_vue_type_script_lang.js +1 -17
  51. package/PageAttributeTable.js +233 -30
  52. package/ProcessOnlineForm.js +41 -16
  53. package/QueryTable.js +4 -3
  54. package/README.md +3 -8
  55. package/_arrayPush.js +5 -3
  56. package/{cloneDeep.js → _baseClone.js} +5 -9
  57. package/_baseSlice.js +18 -0
  58. package/_commonjsHelpers.js +5 -0
  59. package/_flatRest.js +174 -0
  60. package/auth.data.js +1 -3
  61. package/cgform.data.js +18 -9
  62. package/enhance.api.js +27 -18
  63. package/index.js +27 -8
  64. package/index2.js +48 -45
  65. package/index3.js +29 -26
  66. package/isArray.js +1 -1
  67. package/main.index.js +2 -2
  68. package/omit.js +60 -0
  69. package/package.json +1 -1
  70. package/pick.js +3 -173
  71. package/style.css +1 -1
  72. package/toString.js +2 -2
  73. package/useAutoForm.js +3457 -3791
  74. package/useCgformList.js +44 -31
  75. package/{useTableColumns.js → useListButton.js} +218 -409
  76. package/useOnlineTest.js +5 -26827
  77. package/useSchemas.js +382 -234
  78. package/useTableSync.js +19 -7
  79. package/ChartAutoRender.js +0 -69
  80. package/ChartDoubleRender.js +0 -154
  81. package/ChartSingleRender.js +0 -132
  82. package/ChartTabsRender.js +0 -218
  83. package/ErrorTip.js +0 -21
  84. package/FieldTable.js +0 -185
  85. package/GraphreportAutoChart.js +0 -352
  86. package/GraphreportList.js +0 -239
  87. package/GraphreportModal.js +0 -559
  88. package/LICENSE +0 -7
  89. package/OnlineSubForm.js +0 -200
  90. package/ParamsTable.js +0 -71
  91. package/graphreport.api.js +0 -23
  92. package/useChartRender.js +0 -405
  93. package/useMessageOnline.js +0 -71
@@ -37,24 +37,24 @@ var __async = (__this, __arguments, generator) => {
37
37
  step((generator = generator.apply(__this, __arguments)).next());
38
38
  });
39
39
  };
40
- import { E as ENHANCEJS, c as SETUP } from "./FormSchemaFactory.js";
41
- import { useRoute, useRouter } from "vue-router";
40
+ import { E as ENHANCEJS, d as SETUP } from "./FormSchemaFactory.js";
41
+ import { useRoute } from "vue-router";
42
+ import { router } from "/@/router";
42
43
  import * as vue from "vue";
43
- import { ref, onBeforeUnmount, toRaw, nextTick, reactive, computed, unref, h, defineAsyncComponent, watch } from "vue";
44
+ import { ref, onBeforeUnmount, toRaw, nextTick, reactive } from "vue";
44
45
  import * as UTIL_AXIOS from "/@/utils/http/axios";
45
46
  import { defHttp } from "/@/utils/http/axios";
46
47
  import * as HOOK_MESSAGE from "/@/hooks/web/useMessage";
47
48
  import { useMessage } from "/@/hooks/web/useMessage";
48
- import { randomString, filterObj, getFileAccessHttpUrl } from "/@/utils/common/compUtils";
49
+ import { randomString, filterObj } from "/@/utils/common/compUtils";
49
50
  import * as UTIL_CACHE from "/@/utils/cache";
50
51
  import { onMountedOrActivated } from "/@/hooks/core/onMountedOrActivated";
51
52
  import { useModal } from "/@/components/Modal";
52
53
  import { Modal } from "ant-design-vue";
53
54
  import { useMethods } from "/@/hooks/system/useMethods";
55
+ import { getToken } from "/@/utils/auth";
56
+ import { goJmReportViewPage } from "/@/utils";
54
57
  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
58
  const $exports = {
59
59
  vue,
60
60
  "@": {
@@ -119,7 +119,7 @@ const onlineUrl = {
119
119
  getTreeData: "/online/cgform/api/getTreeData/",
120
120
  optPre: "/online/cgform/api/form/",
121
121
  buttonAction: "/online/cgform/api/doButton",
122
- exportXls: "/online/cgform/api/exportXls/",
122
+ exportXls: "/online/cgform/api/exportXlsOld/",
123
123
  importXls: "/online/cgform/api/importXls/",
124
124
  startProcess: "/act/process/extActProcess/startMutilProcess"
125
125
  };
@@ -151,7 +151,7 @@ const metaPagination = {
151
151
  showSizeChanger: true,
152
152
  total: 0
153
153
  };
154
- const { createMessage: $message } = useMessage();
154
+ const { createMessage: $message, createErrorModal } = useMessage();
155
155
  const GET_FUN_BODY_REG = /(?:\/\*[\s\S]*?\*\/|\/\/.*?\r?\n|[^{])+\{([\s\S]*)\}$/;
156
156
  function useOnlineTableContext() {
157
157
  console.log("-------------------------useOnlineTableContext----------------------->");
@@ -161,17 +161,19 @@ function useOnlineTableContext() {
161
161
  const superQueryButtonRef = ref();
162
162
  const pagination = ref(false);
163
163
  const dataSource = ref([]);
164
+ const tableReloading = ref(true);
165
+ const onlineExtConfigJson = ref();
164
166
  let specialConfigMap = {};
165
167
  const methods = {
166
- execButtonEnhance: function(code, record2) {
167
- if (onlineTableContext2[ENHANCEJS][code]) {
168
+ execButtonEnhance: function(code, record) {
169
+ if (onlineTableContext[ENHANCEJS][code]) {
168
170
  if (SETUP === code) {
169
171
  executeEnhanceJsHook(code);
170
172
  } else {
171
- let row = toRaw(record2);
172
- return onlineTableContext2[ENHANCEJS][code].call(onlineTableContext2, onlineTableContext2, row);
173
+ let row = toRaw(record);
174
+ return onlineTableContext[ENHANCEJS][code].call(onlineTableContext, onlineTableContext, row);
173
175
  }
174
- } else if (onlineTableContext2[ENHANCEJS][code + "_hook"]) {
176
+ } else if (onlineTableContext[ENHANCEJS][code + "_hook"]) {
175
177
  executeEnhanceJsHook(code + "_hook");
176
178
  } else {
177
179
  console.log("\u589E\u5F3A\u6CA1\u627E\u5230!", code);
@@ -179,22 +181,22 @@ function useOnlineTableContext() {
179
181
  },
180
182
  isTree: function(status) {
181
183
  if (typeof status === "boolean") {
182
- onlineTableContext2["isTreeTable"] = status;
184
+ onlineTableContext["isTreeTable"] = status;
183
185
  return status;
184
186
  } else {
185
- return onlineTableContext2["isTreeTable"];
187
+ return onlineTableContext["isTreeTable"];
186
188
  }
187
189
  }
188
190
  };
189
191
  function executeEnhanceJsHook(code) {
190
- let str = onlineTableContext2[ENHANCEJS][code].toLocaleString();
192
+ let str = onlineTableContext[ENHANCEJS][code].toLocaleString();
191
193
  let arr = str.match(GET_FUN_BODY_REG);
192
194
  if (arr.length > 1) {
193
195
  let temp = arr[1];
194
196
  executeJsEnhanced(temp);
195
197
  }
196
198
  }
197
- const onlineTableContext2 = new Proxy(CONTEXT_PROP_DESCRIPTION, {
199
+ const onlineTableContext = new Proxy(CONTEXT_PROP_DESCRIPTION, {
198
200
  get(_target, prop) {
199
201
  if (typeof methods[prop] === "function") {
200
202
  return methods[prop];
@@ -220,7 +222,7 @@ function useOnlineTableContext() {
220
222
  }
221
223
  }
222
224
  });
223
- const { executeJsEnhanced } = useCustomHook({}, onlineTableContext2);
225
+ const { executeJsEnhanced } = useCustomHook({}, onlineTableContext);
224
226
  function getTableId() {
225
227
  let idValue = route.params.id;
226
228
  if (!idValue) {
@@ -252,14 +254,17 @@ function useOnlineTableContext() {
252
254
  Object.keys(hrefParam).map((key) => {
253
255
  acceptHrefParams[key] = hrefParam[key];
254
256
  });
255
- onlineTableContext2["acceptHrefParams"] = acceptHrefParams;
257
+ onlineTableContext["acceptHrefParams"] = acceptHrefParams;
256
258
  }
257
259
  }
258
260
  function getColumnList() {
259
261
  return new Promise((resolve, reject) => {
260
- defHttp.get({
261
- url: `${onlineTableContext2.onlineUrl.getColumns}${ID.value}`
262
- }, { isTransformResponse: false }).then((res) => {
262
+ defHttp.get(
263
+ {
264
+ url: `${onlineTableContext.onlineUrl.getColumns}${ID.value}`
265
+ },
266
+ { isTransformResponse: false }
267
+ ).then((res) => {
263
268
  if (res.success) {
264
269
  resolve(res.result);
265
270
  } else {
@@ -273,9 +278,9 @@ function useOnlineTableContext() {
273
278
  }
274
279
  function loadData() {
275
280
  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}`;
281
+ let url = `${onlineTableContext.onlineUrl.getData}${ID.value}`;
282
+ if (onlineTableContext.isTree() === true) {
283
+ url = `${onlineTableContext.onlineUrl.getTreeData}${ID.value}`;
279
284
  }
280
285
  let params = getLoadDataParams();
281
286
  console.log("------\u67E5\u8BE2\u53C2\u6570-----", params);
@@ -285,7 +290,15 @@ function useOnlineTableContext() {
285
290
  handleDataResult(res.result);
286
291
  resolve(true);
287
292
  } else {
288
- $message.warning(res.message);
293
+ if (res.message === "NO_DB_SYNC") {
294
+ createErrorModal({
295
+ title: "\u6570\u636E\u5E93\u672A\u540C\u6B65",
296
+ content: "\u8BF7\u5148\u540C\u6B65\u6570\u636E\u5E93\u518D\u67E5\u770B\u6B64\u9875\u9762\uFF01",
297
+ onOk: () => router.back()
298
+ });
299
+ } else {
300
+ $message.warning(res.message);
301
+ }
289
302
  reject(false);
290
303
  }
291
304
  }).catch(() => {
@@ -296,9 +309,9 @@ function useOnlineTableContext() {
296
309
  });
297
310
  }
298
311
  function getLoadDataParams() {
299
- const { sortField, sortType, acceptHrefParams, queryParam } = onlineTableContext2;
312
+ const { sortField, sortType, acceptHrefParams, queryParam } = onlineTableContext;
300
313
  let treeParam = {};
301
- if (onlineTableContext2.isTree() === true) {
314
+ if (onlineTableContext.isTree() === true) {
302
315
  treeParam["hasQuery"] = "false";
303
316
  } else {
304
317
  treeParam["hasQuery"] = "true";
@@ -318,7 +331,7 @@ function useOnlineTableContext() {
318
331
  function handleDataResult(result) {
319
332
  let total = 0;
320
333
  if (Number(result.total) > 0) {
321
- if (onlineTableContext2.isTree() === true) {
334
+ if (onlineTableContext.isTree() === true) {
322
335
  dataSource.value = getTreeDataByResult(result.records);
323
336
  nextTick(() => {
324
337
  loadDataByExpandedRows(dataSource.value);
@@ -336,11 +349,11 @@ function useOnlineTableContext() {
336
349
  }
337
350
  function handleChangeInTable($pagination, _filters, sorter) {
338
351
  if (sorter && sorter.order) {
339
- onlineTableContext2["sortField"] = sorter.field;
340
- onlineTableContext2["sortType"] = sorter.order == "ascend" ? "asc" : "desc";
352
+ onlineTableContext["sortField"] = sorter.field;
353
+ onlineTableContext["sortType"] = "ascend" == sorter.order ? "asc" : "desc";
341
354
  } else {
342
- onlineTableContext2["sortField"] = "id";
343
- onlineTableContext2["sortType"] = "asc";
355
+ onlineTableContext["sortField"] = "id";
356
+ onlineTableContext["sortType"] = "asc";
344
357
  }
345
358
  if (pagination.value) {
346
359
  pagination.value = $pagination;
@@ -348,20 +361,20 @@ function useOnlineTableContext() {
348
361
  loadData();
349
362
  }
350
363
  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;
364
+ onlineTableContext["description"] = result.description;
365
+ onlineTableContext["currentTableName"] = result.currentTableName;
366
+ onlineTableContext["isDesForm"] = result.isDesForm;
367
+ onlineTableContext["desFormCode"] = result.desFormCode;
368
+ onlineTableContext["ID"] = ID.value;
369
+ let { acceptHrefParams, queryParam, superQuery, currentPage, pageSize } = onlineTableContext;
357
370
  handleAcceptHrefParams();
358
371
  if (!queryParam) {
359
- onlineTableContext2["queryParam"] = {};
372
+ onlineTableContext["queryParam"] = {};
360
373
  } else {
361
374
  onlineQueryFormOuter.value.initDefaultValues(queryParam, acceptHrefParams);
362
375
  }
363
376
  if (!superQuery) {
364
- onlineTableContext2["superQuery"] = { params: "", matchType: "" };
377
+ onlineTableContext["superQuery"] = { params: "", matchType: "" };
365
378
  } else {
366
379
  superQueryButtonRef.value.initDefaultValues(superQuery);
367
380
  }
@@ -371,12 +384,20 @@ function useOnlineTableContext() {
371
384
  pagination.value = false;
372
385
  }
373
386
  }
387
+ function reloadTable() {
388
+ return __async(this, null, function* () {
389
+ tableReloading.value = true;
390
+ yield nextTick();
391
+ tableReloading.value = false;
392
+ });
393
+ }
374
394
  const add2Context = {
375
395
  loadData,
376
- getLoadDataParams
396
+ getLoadDataParams,
397
+ reloadTable
377
398
  };
378
399
  Object.keys(add2Context).map((key) => {
379
- onlineTableContext2[key] = add2Context[key];
400
+ onlineTableContext[key] = add2Context[key];
380
401
  });
381
402
  let loading = ref(false);
382
403
  function reload() {
@@ -384,14 +405,14 @@ function useOnlineTableContext() {
384
405
  if (pagination.value) {
385
406
  pagination.value = __spreadProps(__spreadValues({}, pagination.value), { current: 1 });
386
407
  }
387
- onlineTableContext2.clearSelectedRow();
408
+ onlineTableContext.clearSelectedRow();
388
409
  yield loadData();
389
410
  });
390
411
  }
391
412
  function getTreeDataByResult(result) {
392
413
  if (result) {
393
414
  return result.map((item) => {
394
- let hasChildrenField = onlineTableContext2["hasChildrenField"];
415
+ let hasChildrenField = onlineTableContext["hasChildrenField"];
395
416
  if (item[hasChildrenField] == "1") {
396
417
  let loadChild = { id: item.id + "_loadChild", name: "loading...", isLoading: true };
397
418
  loadChild["jeecg_row_key"] = loadChild.id;
@@ -408,7 +429,7 @@ function useOnlineTableContext() {
408
429
  function loadDataByExpandedRows(dataList) {
409
430
  let expandedRowKeysValue = expandedRowKeys.value;
410
431
  if (expandedRowKeysValue.length > 0) {
411
- const { sortField, sortType, pidField } = onlineTableContext2;
432
+ const { sortField, sortType, pidField } = onlineTableContext;
412
433
  let params = Object.assign({}, { column: sortField, order: sortType });
413
434
  params["hasQuery"] = "in";
414
435
  let superParams = Object.assign({});
@@ -420,7 +441,7 @@ function useOnlineTableContext() {
420
441
  params["superQueryParams"] = encodeURI(JSON.stringify(superParams));
421
442
  params["superQueryMatchType"] = "and";
422
443
  params["batchFlag"] = "true";
423
- let url = `${onlineTableContext2.onlineUrl.getTreeData}${ID.value}`;
444
+ let url = `${onlineTableContext.onlineUrl.getTreeData}${ID.value}`;
424
445
  console.log("--onlineList-\u67E5\u8BE2\u5B50\u8282\u70B9\u53C2\u6570", superParams);
425
446
  defHttp.get({ url, params }, { isTransformResponse: false }).then((res) => {
426
447
  console.log("--onlineList-\u67E5\u8BE2\u5B50\u8282\u70B9\u5217\u8868\u6570\u636E", res);
@@ -460,18 +481,21 @@ function useOnlineTableContext() {
460
481
  }
461
482
  }
462
483
  function getSuperQueryData() {
463
- if (!onlineTableContext2.superQuery) {
484
+ if (!onlineTableContext.superQuery) {
464
485
  return {};
465
486
  }
466
- const { superQuery: { params, matchType }, currentTableName } = onlineTableContext2;
487
+ const {
488
+ superQuery: { params, matchType },
489
+ currentTableName
490
+ } = onlineTableContext;
467
491
  let pre = currentTableName + "@";
468
492
  let arr = [];
469
493
  if (params.length > 0) {
470
494
  for (let data of params) {
471
495
  let item = __spreadValues({}, data);
472
- let field2 = item.field;
473
- if (field2.startsWith(pre)) {
474
- item.field = field2.replace(pre, "");
496
+ let field = item.field;
497
+ if (field.startsWith(pre)) {
498
+ item.field = field.replace(pre, "");
475
499
  }
476
500
  arr.push(item);
477
501
  }
@@ -485,7 +509,7 @@ function useOnlineTableContext() {
485
509
  }
486
510
  const superQueryStatus = ref(false);
487
511
  function handleSuperQuery(params, matchType) {
488
- onlineTableContext2["superQuery"] = {
512
+ onlineTableContext["superQuery"] = {
489
513
  params,
490
514
  matchType
491
515
  };
@@ -502,7 +526,7 @@ function useOnlineTableContext() {
502
526
  param = {};
503
527
  }
504
528
  if (!param.row) {
505
- let rows = onlineTableContext2["selectedRows"];
529
+ let rows = onlineTableContext["selectedRows"];
506
530
  if (!rows || rows.length == 0 || rows.length > 1) {
507
531
  $message.warning("\u8BF7\u9009\u62E9\u4E00\u6761\u6570\u636E");
508
532
  return;
@@ -512,12 +536,18 @@ function useOnlineTableContext() {
512
536
  param["code"] = ID.value;
513
537
  doOpenCustomModal(true, param);
514
538
  }
515
- onlineTableContext2["openCustomModal"] = openCustomModal;
539
+ onlineTableContext["openCustomModal"] = openCustomModal;
516
540
  function handlePageChange() {
517
541
  let idValue = getTableId();
518
542
  ID.value = idValue;
519
543
  }
520
544
  handlePageChange();
545
+ function handleFormConfig(formConfig) {
546
+ let extConfigJson = formConfig.head.extConfigJson;
547
+ if (extConfigJson) {
548
+ onlineExtConfigJson.value = JSON.parse(extConfigJson);
549
+ }
550
+ }
521
551
  return __spreadValues({
522
552
  ID,
523
553
  onlineQueryFormOuter,
@@ -526,20 +556,23 @@ function useOnlineTableContext() {
526
556
  reload,
527
557
  dataSource,
528
558
  pagination,
559
+ tableReloading,
529
560
  handleSpecialConfig,
530
- onlineTableContext: onlineTableContext2,
561
+ onlineTableContext,
531
562
  handleChangeInTable,
532
563
  getColumnList,
533
564
  getTreeDataByResult,
534
565
  expandedRowKeys,
535
566
  handleExpandedRowsChange,
567
+ onlineExtConfigJson,
568
+ handleFormConfig,
536
569
  superQueryStatus,
537
570
  handleSuperQuery,
538
571
  registerCustomModal
539
572
  }, add2Context);
540
573
  }
541
574
  const FLOW_CODE_PRE = "onl_";
542
- function useListButton(onlineTableContext2) {
575
+ function useListButton(onlineTableContext, extConfigJson) {
543
576
  const buttonStatus = {
544
577
  add: true,
545
578
  addSub: true,
@@ -554,6 +587,8 @@ function useListButton(onlineTableContext2) {
554
587
  };
555
588
  const [registerModal, { openModal }] = useModal();
556
589
  const [registerImportModal, { openModal: openImportModal }] = useModal();
590
+ const [registerDetailModal, { openModal: openDetailModal }] = useModal();
591
+ const [registerBpmModal, { openModal: openBpmModal }] = useModal();
557
592
  const { createMessage: $message2 } = useMessage();
558
593
  const buttonSwitch = reactive(buttonStatus);
559
594
  const cgLinkButtonList = reactive([]);
@@ -591,93 +626,142 @@ function useListButton(onlineTableContext2) {
591
626
  }
592
627
  openModal(true, data);
593
628
  }
594
- function handleEdit(record2) {
595
- onlineTableContext2.beforeEdit(record2).then(() => {
629
+ function handleEdit(record) {
630
+ onlineTableContext.beforeEdit(record).then(() => {
596
631
  openModal(true, {
597
632
  isUpdate: true,
598
- record: record2
633
+ record
599
634
  });
600
635
  }).catch((msg) => {
601
636
  $message2.warning(msg);
602
637
  });
603
638
  }
604
- const getDeleteButton = (record2) => {
639
+ const getDeleteButton = (record) => {
605
640
  return {
606
641
  label: "\u5220\u9664",
607
642
  popConfirm: {
608
643
  title: "\u662F\u5426\u5220\u9664\uFF1F",
609
- confirm: handleDeleteOne.bind(null, record2)
644
+ confirm: handleDeleteOne.bind(null, record)
610
645
  }
611
646
  };
612
647
  };
613
- function handleDeleteOne(record2) {
614
- onlineTableContext2.beforeDelete(record2).then(() => {
615
- handleDelete(record2.id);
648
+ function handleDeleteOne(record) {
649
+ onlineTableContext.beforeDelete(record).then(() => {
650
+ handleDelete(record.id);
616
651
  }).catch((msg) => {
617
652
  $message2.warning(msg);
618
653
  });
619
654
  }
620
- function getActions(record2) {
621
- if (toRaw(buttonSwitch.update) === true) {
655
+ function getActions(record) {
656
+ let bpmStatusValue = getBpmStatusValue(record);
657
+ let canEdit = bpmStatusValue && bpmStatusValue == "1" || !bpmStatusValue;
658
+ if (toRaw(buttonSwitch.update) === true && canEdit) {
622
659
  return [
623
660
  {
624
661
  label: "\u7F16\u8F91",
625
- onClick: handleEdit.bind(null, record2)
662
+ onClick: handleEdit.bind(null, record)
626
663
  }
627
664
  ];
628
665
  }
629
666
  return [];
630
667
  }
631
- function getSubmitFlowButton(record2) {
668
+ function getSubmitFlowButton(record) {
632
669
  return {
633
670
  label: "\u63D0\u4EA4\u6D41\u7A0B",
634
671
  popConfirm: {
635
672
  title: "\u786E\u8BA4\u63D0\u4EA4\u6D41\u7A0B\u5417\uFF1F",
636
- confirm: handleSubmitFlow.bind(null, record2)
673
+ confirm: handleSubmitFlow.bind(null, record)
637
674
  }
638
675
  };
639
676
  }
640
- function getDropDownActions(record2) {
677
+ function getViewBpmGraphicButton(record) {
678
+ return {
679
+ label: "\u5BA1\u6279\u8FDB\u5EA6",
680
+ onClick: handleViewGraphic.bind(null, record)
681
+ };
682
+ }
683
+ function handleViewGraphic(record) {
684
+ const { currentTableName } = onlineTableContext;
685
+ let flowCode = FLOW_CODE_PRE + currentTableName;
686
+ let dataId = record.id;
687
+ openBpmModal(true, {
688
+ flowCode,
689
+ dataId
690
+ });
691
+ }
692
+ function getDropDownActions(record) {
641
693
  let arr = [];
642
- if (toRaw(buttonSwitch.delete) === true) {
694
+ if (toRaw(buttonSwitch.detail) === true) {
643
695
  arr.push({
644
696
  label: "\u8BE6\u60C5",
645
- onClick: handleDetail.bind(null, record2)
697
+ onClick: handleDetail.bind(null, record)
646
698
  });
647
699
  }
648
- if (onlineTableContext2["hasBpmStatus"] === true) {
649
- arr.push(getSubmitFlowButton(record2));
700
+ if (onlineTableContext["hasBpmStatus"] === true && toRaw(buttonSwitch.bpm) === true) {
701
+ let bpmStatusValue2 = getBpmStatusValue(record);
702
+ if (!bpmStatusValue2 || bpmStatusValue2 == "1") {
703
+ arr.push(getSubmitFlowButton(record));
704
+ } else {
705
+ arr.push(getViewBpmGraphicButton(record));
706
+ }
650
707
  }
651
- if (toRaw(buttonSwitch.delete) === true) {
652
- arr.push(getDeleteButton(record2));
708
+ if (extConfigJson.value) {
709
+ let { reportPrintShow, reportPrintUrl } = extConfigJson.value;
710
+ if (reportPrintShow && reportPrintUrl) {
711
+ arr.push({
712
+ label: "\u6253\u5370",
713
+ onClick() {
714
+ let url = reportPrintUrl;
715
+ let id = record.id;
716
+ let token = getToken();
717
+ goJmReportViewPage(url, id, token);
718
+ }
719
+ });
720
+ }
721
+ }
722
+ let bpmStatusValue = getBpmStatusValue(record);
723
+ let canDelete = bpmStatusValue && bpmStatusValue == "1" || !bpmStatusValue;
724
+ if (toRaw(buttonSwitch.delete) === true && canDelete) {
725
+ arr.push(getDeleteButton(record));
653
726
  }
654
727
  let buttonList = cgLinkButtonList;
655
728
  if (buttonList && buttonList.length > 0) {
656
729
  for (let item of buttonList) {
657
- if (showLinkButtonOfExpression(item.exp || "", record2) === true) {
730
+ if (showLinkButtonOfExpression(item.exp || "", record) === true) {
658
731
  arr.push({
659
732
  label: item.buttonName,
660
- onClick: cgButtonLinkHandler.bind(null, record2, item.buttonCode, item.optType)
733
+ onClick: cgButtonLinkHandler.bind(null, record, item.buttonCode, item.optType)
661
734
  });
662
735
  }
663
736
  }
664
737
  }
665
738
  return arr;
666
739
  }
667
- function handleDetail(record2) {
668
- openModal(true, {
740
+ function getBpmStatusValue(record) {
741
+ const key = "bpm_status";
742
+ let value = record[key];
743
+ if (!value) {
744
+ value = record[key.toUpperCase()];
745
+ }
746
+ return value;
747
+ }
748
+ function handleDetail(record) {
749
+ openDetailModal(true, {
669
750
  isUpdate: true,
670
751
  disableSubmit: true,
671
- record: record2
752
+ record
672
753
  });
673
754
  }
674
- function startProcess(record2) {
675
- const { currentTableName, onlineUrl: { startProcess: startProcess2 } } = onlineTableContext2;
755
+ function startProcess(record) {
756
+ const {
757
+ currentTableName,
758
+ onlineUrl: { startProcess: startProcess2 }
759
+ } = onlineTableContext;
676
760
  let postConfig = {
677
761
  url: startProcess2,
678
762
  params: {
679
763
  flowCode: FLOW_CODE_PRE + currentTableName,
680
- id: record2.id,
764
+ id: record.id,
681
765
  formUrl: "modules/bpm/task/form/OnlineFormDetail",
682
766
  formUrlMobile: "check/onlineForm/detail"
683
767
  }
@@ -695,22 +779,25 @@ function useListButton(onlineTableContext2) {
695
779
  });
696
780
  });
697
781
  }
698
- function handleSubmitFlow(record2) {
782
+ function handleSubmitFlow(record) {
699
783
  return __async(this, null, function* () {
700
- yield startProcess(record2);
701
- onlineTableContext2.loadData();
784
+ yield startProcess(record);
785
+ onlineTableContext.loadData();
702
786
  });
703
787
  }
704
788
  function handleDelete(dataId) {
705
789
  console.log("\u5220\u9664\u6570\u636Eid\u503C", dataId);
706
- let url = `${onlineTableContext2.onlineUrl.optPre}${onlineTableContext2.ID}/${dataId}`;
790
+ let url = `${onlineTableContext.onlineUrl.optPre}${onlineTableContext.ID}/${dataId}`;
707
791
  return new Promise((resolve, reject) => {
708
- defHttp.delete({
709
- url
710
- }, { isTransformResponse: false }).then((res) => {
792
+ defHttp.delete(
793
+ {
794
+ url
795
+ },
796
+ { isTransformResponse: false }
797
+ ).then((res) => {
711
798
  if (res.success) {
712
799
  $message2.success(res.message);
713
- onlineTableContext2.loadData();
800
+ onlineTableContext.loadData();
714
801
  resolve(true);
715
802
  } else {
716
803
  $message2.warning(res.message);
@@ -720,7 +807,7 @@ function useListButton(onlineTableContext2) {
720
807
  });
721
808
  }
722
809
  function handleBatchDelete() {
723
- let arr = onlineTableContext2["selectedRowKeys"];
810
+ let arr = onlineTableContext["selectedRowKeys"];
724
811
  if (arr.length <= 0) {
725
812
  $message2.warning("\u8BF7\u9009\u62E9\u4E00\u6761\u8BB0\u5F55\uFF01");
726
813
  return false;
@@ -743,27 +830,30 @@ function useListButton(onlineTableContext2) {
743
830
  cancelText: "\u53D6\u6D88",
744
831
  onOk: () => __async(this, null, function* () {
745
832
  yield handleDelete(ids);
746
- onlineTableContext2.clearSelectedRow();
833
+ onlineTableContext.clearSelectedRow();
747
834
  })
748
835
  });
749
836
  }
750
837
  }
751
- function cgButtonLinkHandler(record2, buttonCode, optType) {
838
+ function cgButtonLinkHandler(record, buttonCode, optType) {
752
839
  if (optType == "js") {
753
- onlineTableContext2["execButtonEnhance"](buttonCode, record2);
840
+ onlineTableContext["execButtonEnhance"](buttonCode, record);
754
841
  } else if (optType == "action") {
755
842
  let params = {
756
- formId: onlineTableContext2["ID"],
843
+ formId: onlineTableContext["ID"],
757
844
  buttonCode,
758
- dataId: record2.id
845
+ dataId: record.id
759
846
  };
760
- let url = `${onlineTableContext2.onlineUrl.buttonAction}`;
761
- defHttp.post({
762
- url,
763
- params
764
- }, { isTransformResponse: false }).then((res) => {
847
+ let url = `${onlineTableContext.onlineUrl.buttonAction}`;
848
+ defHttp.post(
849
+ {
850
+ url,
851
+ params
852
+ },
853
+ { isTransformResponse: false }
854
+ ).then((res) => {
765
855
  if (res.success) {
766
- onlineTableContext2.loadData();
856
+ onlineTableContext.loadData();
767
857
  $message2.success("\u5904\u7406\u5B8C\u6210!");
768
858
  } else {
769
859
  $message2.warning(res.message);
@@ -772,28 +862,31 @@ function useListButton(onlineTableContext2) {
772
862
  }
773
863
  }
774
864
  function cgButtonJsHandler(buttonCode) {
775
- onlineTableContext2["execButtonEnhance"](buttonCode);
865
+ onlineTableContext["execButtonEnhance"](buttonCode);
776
866
  }
777
867
  function cgButtonActionHandler(buttonCode) {
778
- let arr = onlineTableContext2["selectedRowKeys"];
868
+ let arr = onlineTableContext["selectedRowKeys"];
779
869
  if (!arr || arr.length == 0) {
780
870
  $message2.warning("\u8BF7\u5148\u9009\u4E2D\u4E00\u6761\u8BB0\u5F55");
781
871
  return false;
782
872
  }
783
873
  let dataId = arr.join(",");
784
874
  let params = {
785
- formId: onlineTableContext2["ID"],
875
+ formId: onlineTableContext["ID"],
786
876
  buttonCode,
787
877
  dataId
788
878
  };
789
- let url = `${onlineTableContext2.onlineUrl.buttonAction}`;
790
- defHttp.post({
791
- url,
792
- params
793
- }, { isTransformResponse: false }).then((res) => {
879
+ let url = `${onlineTableContext.onlineUrl.buttonAction}`;
880
+ defHttp.post(
881
+ {
882
+ url,
883
+ params
884
+ },
885
+ { isTransformResponse: false }
886
+ ).then((res) => {
794
887
  if (res.success) {
795
- onlineTableContext2.loadData();
796
- onlineTableContext2.clearSelectedRow();
888
+ onlineTableContext.loadData();
889
+ onlineTableContext.clearSelectedRow();
797
890
  $message2.success("\u5904\u7406\u5B8C\u6210!");
798
891
  } else {
799
892
  $message2.warning(res.message);
@@ -804,18 +897,18 @@ function useListButton(onlineTableContext2) {
804
897
  openImportModal(true);
805
898
  }
806
899
  const importUrl = () => {
807
- return `${onlineTableContext2.onlineUrl.importXls}${onlineTableContext2.ID}`;
900
+ return `${onlineTableContext.onlineUrl.importXls}${onlineTableContext.ID}`;
808
901
  };
809
902
  const { handleExportXlsx } = useMethods();
810
903
  function onExportExcel() {
811
- let params = onlineTableContext2.getLoadDataParams();
812
- let selections = onlineTableContext2["selectedRowKeys"];
904
+ let params = onlineTableContext.getLoadDataParams();
905
+ let selections = onlineTableContext["selectedRowKeys"];
813
906
  if (selections && selections.length > 0) {
814
907
  params["selections"] = selections.join(",");
815
908
  }
816
909
  let paramsStr = JSON.stringify(filterObj(params));
817
- let url = `${onlineTableContext2.onlineUrl.exportXls}${onlineTableContext2.ID}`;
818
- const description = onlineTableContext2.description;
910
+ let url = `${onlineTableContext.onlineUrl.exportXls}${onlineTableContext.ID}`;
911
+ const description = onlineTableContext.description;
819
912
  handleExportXlsx(description, url, { paramsStr });
820
913
  }
821
914
  function showLinkButtonOfExpression(expression, row) {
@@ -862,293 +955,9 @@ function useListButton(onlineTableContext2) {
862
955
  initButtonSwitch,
863
956
  getDeleteButton,
864
957
  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
958
+ getSubmitFlowButton,
959
+ registerDetailModal,
960
+ registerBpmModal
1152
961
  };
1153
962
  }
1154
- export { useListButton as a, useTableColumns as b, useOnlineTableContext as u };
963
+ export { useListButton as a, useOnlineTableContext as u };