@jeecg/online 3.4.4-beta2 → 3.5.3-beta2

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.
package/useListButton.js CHANGED
@@ -37,17 +37,14 @@ var __async = (__this, __arguments, generator) => {
37
37
  step((generator = generator.apply(__this, __arguments)).next());
38
38
  });
39
39
  };
40
- import { E as ENHANCEJS, d as SETUP } from "./FormSchemaFactory.js";
40
+ import { E as ENHANCEJS, q as SETUP } from "./useExtendComponent.js";
41
41
  import { useRoute } from "vue-router";
42
42
  import { router } from "/@/router";
43
- import * as vue from "vue";
44
43
  import { ref, onBeforeUnmount, toRaw, nextTick, reactive } from "vue";
45
- import * as UTIL_AXIOS from "/@/utils/http/axios";
46
44
  import { defHttp } from "/@/utils/http/axios";
47
- import * as HOOK_MESSAGE from "/@/hooks/web/useMessage";
48
45
  import { useMessage } from "/@/hooks/web/useMessage";
49
- import { randomString, filterObj } from "/@/utils/common/compUtils";
50
- import * as UTIL_CACHE from "/@/utils/cache";
46
+ import { filterObj } from "/@/utils/common/compUtils";
47
+ import { u as useCustomHook, G as GET_FUN_BODY_REG } from "./OnlineForm.js";
51
48
  import { onMountedOrActivated } from "/@/hooks/core/onMountedOrActivated";
52
49
  import { useModal } from "/@/components/Modal";
53
50
  import { Modal } from "ant-design-vue";
@@ -55,47 +52,6 @@ import { useMethods } from "/@/hooks/system/useMethods";
55
52
  import { getToken } from "/@/utils/auth";
56
53
  import { goJmReportViewPage } from "/@/utils";
57
54
  import { p as pick } from "./pick.js";
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
55
  const CONTEXT_PROP_DESCRIPTION = {
100
56
  acceptHrefParams: "<p> \u8DF3\u8F6C\u65F6\u83B7\u53D6\u7684\u53C2\u6570\u4FE1\u606F",
101
57
  currentPage: "<p> \u5F53\u524D\u9875\u6570",
@@ -152,7 +108,6 @@ const metaPagination = {
152
108
  total: 0
153
109
  };
154
110
  const { createMessage: $message, createErrorModal } = useMessage();
155
- const GET_FUN_BODY_REG = /(?:\/\*[\s\S]*?\*\/|\/\/.*?\r?\n|[^{])+\{([\s\S]*)\}$/;
156
111
  function useOnlineTableContext() {
157
112
  console.log("-------------------------useOnlineTableContext----------------------->");
158
113
  const ID = ref("");
@@ -174,7 +129,12 @@ function useOnlineTableContext() {
174
129
  return onlineTableContext[ENHANCEJS][code].call(onlineTableContext, onlineTableContext, row);
175
130
  }
176
131
  } else if (onlineTableContext[ENHANCEJS][code + "_hook"]) {
177
- executeEnhanceJsHook(code + "_hook");
132
+ if (record) {
133
+ let row = toRaw(record);
134
+ executeEnhanceJsHook(code + "_hook", row);
135
+ } else {
136
+ executeEnhanceJsHook(code + "_hook");
137
+ }
178
138
  } else {
179
139
  console.log("\u589E\u5F3A\u6CA1\u627E\u5230!", code);
180
140
  }
@@ -188,12 +148,12 @@ function useOnlineTableContext() {
188
148
  }
189
149
  }
190
150
  };
191
- function executeEnhanceJsHook(code) {
151
+ function executeEnhanceJsHook(code, row) {
192
152
  let str = onlineTableContext[ENHANCEJS][code].toLocaleString();
193
153
  let arr = str.match(GET_FUN_BODY_REG);
194
154
  if (arr.length > 1) {
195
155
  let temp = arr[1];
196
- executeJsEnhanced(temp);
156
+ executeJsEnhanced(temp, row);
197
157
  }
198
158
  }
199
159
  const onlineTableContext = new Proxy(CONTEXT_PROP_DESCRIPTION, {
@@ -654,7 +614,7 @@ function useListButton(onlineTableContext, extConfigJson) {
654
614
  }
655
615
  function getActions(record) {
656
616
  let bpmStatusValue = getBpmStatusValue(record);
657
- let canEdit = bpmStatusValue && bpmStatusValue == "1" || !bpmStatusValue;
617
+ let canEdit = bpmStatusValue && (bpmStatusValue == "1" || bpmStatusValue == "3" || bpmStatusValue == "4") || !bpmStatusValue;
658
618
  if (toRaw(buttonSwitch.update) === true && canEdit) {
659
619
  return [
660
620
  {
@@ -909,7 +869,7 @@ function useListButton(onlineTableContext, extConfigJson) {
909
869
  let paramsStr = JSON.stringify(filterObj(params));
910
870
  let url = `${onlineTableContext.onlineUrl.exportXls}${onlineTableContext.ID}`;
911
871
  const description = onlineTableContext.description;
912
- handleExportXlsx(description, url, { paramsStr });
872
+ return handleExportXlsx(description, url, { paramsStr });
913
873
  }
914
874
  function showLinkButtonOfExpression(expression, row) {
915
875
  if (!expression || expression == "") {
package/useSchemas.js CHANGED
@@ -317,116 +317,84 @@ function useExtendConfigFormSchemas(_props, handlers) {
317
317
  const formSchemas = [
318
318
  mapFormSchema(
319
319
  {
320
- label: "\u96C6\u6210\u8BBE\u8BA1\u8868\u5355",
321
- field: "isDesForm",
320
+ label: "\u5F39\u7A97\u9ED8\u8BA4\u5168\u5C4F",
321
+ field: "modelFullscreen",
322
322
  component: "RadioButtonGroup",
323
323
  componentProps: {
324
324
  options: [
325
- { label: "\u5F00\u542F", value: "Y" },
326
- { label: "\u5173\u95ED", value: "N" }
325
+ { label: "\u5F00\u542F", value: 1 },
326
+ { label: "\u5173\u95ED", value: 0 }
327
327
  ],
328
- buttonStyle: "solid",
329
- onChange: handlers.onIsDesformChange
328
+ buttonStyle: "solid"
330
329
  }
331
330
  },
332
331
  "left"
333
332
  ),
334
333
  mapFormSchema(
335
334
  {
336
- label: "\u8868\u5355\u7F16\u7801",
337
- field: "desFormCode",
338
- component: "Input",
335
+ label: "\u5F39\u7A97\u5BBD\u5EA6",
336
+ field: "modalMinWidth",
337
+ component: "InputNumber",
339
338
  componentProps: {
340
- style: "width: 80%"
341
- },
342
- dynamicDisabled: ({ model }) => model.isDesForm !== "Y",
343
- dynamicRules: ({ model }) => {
344
- return [{ required: model.isDesForm === "Y", message: "\u8BF7\u8F93\u5165\u8868\u5355\u7F16\u7801\uFF01" }];
339
+ style: "width: 80%",
340
+ placeholder: "\u5F39\u7A97\u6700\u5C0F\u5BBD\u5EA6\uFF08\u5355\u4F4D\uFF1Apx\uFF09"
345
341
  }
346
342
  },
347
343
  "right"
348
344
  ),
349
345
  mapFormSchema(
350
346
  {
351
- label: "\u96C6\u6210\u79EF\u6728\u62A5\u8868",
352
- field: "reportPrintShow",
347
+ label: "\u5F00\u542F\u8868\u5355\u8BC4\u8BBA",
348
+ field: "commentStatus",
353
349
  component: "RadioButtonGroup",
354
350
  componentProps: {
355
351
  options: [
356
352
  { label: "\u5F00\u542F", value: 1 },
357
353
  { label: "\u5173\u95ED", value: 0 }
358
354
  ],
359
- buttonStyle: "solid",
360
- onChange: handlers.onReportPrintShowChange
355
+ buttonStyle: "solid"
361
356
  }
362
357
  },
363
358
  "left"
364
359
  ),
365
360
  mapFormSchema(
366
361
  {
367
- label: "\u62A5\u8868\u5730\u5740",
368
- field: "reportPrintUrl",
369
- component: "Input",
370
- componentProps: {
371
- style: "width: 80%"
372
- },
373
- dynamicDisabled: ({ model }) => !model.reportPrintShow,
374
- dynamicRules: ({ model }) => {
375
- return [
376
- { required: !!model.reportPrintShow, message: "\u8BF7\u8F93\u5165\u62A5\u8868\u5730\u5740\uFF01" },
377
- {
378
- validator({}, value) {
379
- if (/\/jmreport\/view\/{积木报表ID}/.test(value)) {
380
- return Promise.reject("\u8BF7\u5C06{\u79EF\u6728\u62A5\u8868ID}\u66FF\u6362\u4E3A\u771F\u5B9E\u7684\u79EF\u6728\u62A5\u8868ID\uFF01");
381
- }
382
- return Promise.resolve();
383
- }
384
- }
385
- ];
386
- }
362
+ label: "",
363
+ field: "commentStatus",
364
+ component: "InputNumber",
365
+ render: () => ""
387
366
  },
388
367
  "right"
389
368
  ),
390
369
  mapFormSchema(
391
370
  {
392
- label: "\u56FA\u5B9A\u64CD\u4F5C\u5217",
393
- field: "tableFixedAction",
371
+ label: "\u542F\u7528\u8054\u5408\u67E5\u8BE2",
372
+ field: "joinQuery",
394
373
  component: "RadioButtonGroup",
395
374
  componentProps: {
396
375
  options: [
397
376
  { label: "\u5F00\u542F", value: 1 },
398
377
  { label: "\u5173\u95ED", value: 0 }
399
378
  ],
400
- buttonStyle: "solid"
401
- },
402
- defaultValue: 0
379
+ buttonStyle: "solid",
380
+ onChange: handlers.onJoinQueryChange
381
+ }
403
382
  },
404
383
  "left"
405
384
  ),
406
385
  mapFormSchema(
407
386
  {
408
- label: "\u56FA\u5B9A\u65B9\u5F0F",
409
- field: "tableFixedActionType",
410
- component: "Select",
411
- componentProps: {
412
- options: [
413
- { label: "\u56FA\u5B9A\u5230\u53F3\u4FA7", value: "right" },
414
- { label: "\u56FA\u5B9A\u5230\u5DE6\u4FA7", value: "left" }
415
- ],
416
- style: "width: 80%"
417
- },
418
- defaultValue: "right",
419
- dynamicDisabled: ({ model }) => !model.tableFixedAction,
420
- dynamicRules: ({ model }) => {
421
- return [{ required: !!model.tableFixedAction, message: "\u8BF7\u9009\u62E9\u56FA\u5B9A\u65B9\u5F0F\uFF01" }];
422
- }
387
+ label: "",
388
+ field: "joinQuery",
389
+ component: "InputNumber",
390
+ render: () => ""
423
391
  },
424
392
  "right"
425
393
  ),
426
394
  mapFormSchema(
427
395
  {
428
- label: "\u542F\u7528\u8054\u5408\u67E5\u8BE2",
429
- field: "joinQuery",
396
+ label: "\u96C6\u6210\u79EF\u6728\u62A5\u8868",
397
+ field: "reportPrintShow",
430
398
  component: "RadioButtonGroup",
431
399
  componentProps: {
432
400
  options: [
@@ -434,51 +402,71 @@ function useExtendConfigFormSchemas(_props, handlers) {
434
402
  { label: "\u5173\u95ED", value: 0 }
435
403
  ],
436
404
  buttonStyle: "solid",
437
- onChange: handlers.onJoinQueryChange
405
+ onChange: handlers.onReportPrintShowChange
438
406
  }
439
407
  },
440
408
  "left"
441
409
  ),
442
410
  mapFormSchema(
443
411
  {
444
- label: "",
445
- field: "joinQuery",
446
- component: "InputNumber",
447
- render: () => ""
412
+ label: "\u62A5\u8868\u5730\u5740",
413
+ field: "reportPrintUrl",
414
+ component: "Input",
415
+ componentProps: {
416
+ style: "width: 80%"
417
+ },
418
+ dynamicDisabled: ({ model }) => !model.reportPrintShow,
419
+ dynamicRules: ({ model }) => {
420
+ return [
421
+ { required: !!model.reportPrintShow, message: "\u8BF7\u8F93\u5165\u62A5\u8868\u5730\u5740\uFF01" },
422
+ {
423
+ validator({}, value) {
424
+ if (/\/jmreport\/view\/{积木报表ID}/.test(value)) {
425
+ return Promise.reject("\u8BF7\u5C06{\u79EF\u6728\u62A5\u8868ID}\u66FF\u6362\u4E3A\u771F\u5B9E\u7684\u79EF\u6728\u62A5\u8868ID\uFF01");
426
+ }
427
+ return Promise.resolve();
428
+ }
429
+ }
430
+ ];
431
+ }
448
432
  },
449
433
  "right"
450
434
  ),
451
435
  mapFormSchema(
452
436
  {
453
- label: "\u5F39\u7A97\u9ED8\u8BA4\u5168\u5C4F",
454
- field: "modelFullscreen",
437
+ label: "\u96C6\u6210\u8BBE\u8BA1\u8868\u5355",
438
+ field: "isDesForm",
455
439
  component: "RadioButtonGroup",
456
440
  componentProps: {
457
441
  options: [
458
- { label: "\u5F00\u542F", value: 1 },
459
- { label: "\u5173\u95ED", value: 0 }
442
+ { label: "\u5F00\u542F", value: "Y" },
443
+ { label: "\u5173\u95ED", value: "N" }
460
444
  ],
461
- buttonStyle: "solid"
445
+ buttonStyle: "solid",
446
+ onChange: handlers.onIsDesformChange
462
447
  }
463
448
  },
464
449
  "left"
465
450
  ),
466
451
  mapFormSchema(
467
452
  {
468
- label: "\u5F39\u7A97\u5BBD\u5EA6",
469
- field: "modalMinWidth",
470
- component: "InputNumber",
453
+ label: "\u8868\u5355\u7F16\u7801",
454
+ field: "desFormCode",
455
+ component: "Input",
471
456
  componentProps: {
472
- style: "width: 80%",
473
- placeholder: "\u5F39\u7A97\u6700\u5C0F\u5BBD\u5EA6\uFF08\u5355\u4F4D\uFF1Apx\uFF09"
457
+ style: "width: 80%"
458
+ },
459
+ dynamicDisabled: ({ model }) => model.isDesForm !== "Y",
460
+ dynamicRules: ({ model }) => {
461
+ return [{ required: model.isDesForm === "Y", message: "\u8BF7\u8F93\u5165\u8868\u5355\u7F16\u7801\uFF01" }];
474
462
  }
475
463
  },
476
464
  "right"
477
465
  ),
478
466
  mapFormSchema(
479
467
  {
480
- label: "\u5F00\u542F\u8868\u5355\u8BC4\u8BBA",
481
- field: "commentStatus",
468
+ label: "\u56FA\u5B9A\u64CD\u4F5C\u5217",
469
+ field: "tableFixedAction",
482
470
  component: "RadioButtonGroup",
483
471
  componentProps: {
484
472
  options: [
@@ -486,16 +474,28 @@ function useExtendConfigFormSchemas(_props, handlers) {
486
474
  { label: "\u5173\u95ED", value: 0 }
487
475
  ],
488
476
  buttonStyle: "solid"
489
- }
477
+ },
478
+ defaultValue: 1
490
479
  },
491
480
  "left"
492
481
  ),
493
482
  mapFormSchema(
494
483
  {
495
- label: "",
496
- field: "commentStatus",
497
- component: "InputNumber",
498
- render: () => ""
484
+ label: "\u56FA\u5B9A\u65B9\u5F0F",
485
+ field: "tableFixedActionType",
486
+ component: "Select",
487
+ componentProps: {
488
+ options: [
489
+ { label: "\u56FA\u5B9A\u5230\u53F3\u4FA7", value: "right" },
490
+ { label: "\u56FA\u5B9A\u5230\u5DE6\u4FA7", value: "left" }
491
+ ],
492
+ style: "width: 80%"
493
+ },
494
+ defaultValue: "right",
495
+ dynamicDisabled: ({ model }) => !model.tableFixedAction,
496
+ dynamicRules: ({ model }) => {
497
+ return [{ required: !!model.tableFixedAction, message: "\u8BF7\u9009\u62E9\u56FA\u5B9A\u65B9\u5F0F\uFF01" }];
498
+ }
499
499
  },
500
500
  "right"
501
501
  )