@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
package/OnlineForm.js CHANGED
@@ -35,95 +35,49 @@ var __async = (__this, __arguments, generator) => {
35
35
  });
36
36
  };
37
37
  import { useMessage } from "/@/hooks/web/useMessage";
38
- import { reactive, ref, computed, resolveComponent, openBlock, createElementBlock, createVNode, createBlock, withCtx, Fragment, renderList, normalizeStyle, createCommentVNode, renderSlot, unref, nextTick, toRaw } from "vue";
38
+ import { ref, reactive, computed, resolveComponent, openBlock, createElementBlock, createVNode, createCommentVNode, createBlock, withCtx, Fragment, renderList, normalizeStyle, renderSlot, unref, nextTick, toRaw } from "vue";
39
39
  import { BasicForm, useForm } from "/@/components/Form/index";
40
- import { V as VALIDATE_FAILED, S as SUBMIT_FLOW_KEY, a as SUBMIT_FLOW_ID } from "./FormSchemaFactory.js";
40
+ import { V as VALIDATE_FAILED, S as SUBMIT_FLOW_KEY, b as SUBMIT_FLOW_ID, O as ONL_FORM_TABLE_NAME } from "./FormSchemaFactory.js";
41
41
  import { defHttp } from "/@/utils/http/axios";
42
- import { u as useOnlineFormContext, a as useFormItems, l as loadFormFieldsDefVal, g as getRefPromise } from "./useAutoForm.js";
42
+ import { sleep, goJmReportViewPage } from "/@/utils";
43
+ import { O as OnlineSubForm, a as OnlinePopModal, u as useOnlineFormContext, b as useFormItems, c as useEnhance, l as loadFormFieldsDefVal, g as getRefPromise } from "./useAutoForm.js";
43
44
  import { Loading } from "/@/components/Loading";
44
- import OnlineSubForm from "./OnlineSubForm.js";
45
+ import "/@/components/jeecg/JVxeTable/types";
46
+ import { getToken } from "/@/utils/auth";
47
+ import { PrinterOutlined, DiffOutlined, FormOutlined } from "@ant-design/icons-vue";
48
+ import "/@/hooks/core/useContext";
49
+ import "/@/utils/mitt";
50
+ import { useModal } from "/@/components/Modal";
45
51
  import { _ as _export_sfc } from "./index.js";
46
52
  import { p as pick } from "./pick.js";
47
- function useEnhance(onlineTableContext, isList = true) {
48
- let EnhanceJS = reactive({});
49
- const getAction = (url, params) => {
50
- return defHttp.get({ url, params }, { isTransformResponse: false });
51
- };
52
- const postAction = (url, params) => {
53
- return defHttp.post({ url, params }, { isTransformResponse: false });
54
- };
55
- const putAction = (url, params) => {
56
- return defHttp.put({ url, params }, { isTransformResponse: false });
57
- };
58
- const deleteAction = (url, params) => {
59
- return defHttp.delete({ url, params }, { isTransformResponse: false });
60
- };
61
- if (isList === true) {
62
- onlineTableContext["_getAction"] = getAction;
63
- onlineTableContext["_postAction"] = postAction;
64
- onlineTableContext["_putAction"] = putAction;
65
- onlineTableContext["_deleteAction"] = deleteAction;
66
- } else {
67
- onlineTableContext.addObject2Context("_getAction", getAction);
68
- onlineTableContext.addObject2Context("_postAction", postAction);
69
- onlineTableContext.addObject2Context("_putAction", putAction);
70
- onlineTableContext.addObject2Context("_deleteAction", deleteAction);
71
- }
72
- function initCgEnhanceJs(str) {
73
- if (str) {
74
- let Obj = eval("(" + str + ")");
75
- return new Obj(getAction, postAction, deleteAction);
76
- } else {
77
- return {};
78
- }
79
- }
80
- function triggerJsFun(that, buttonCode) {
81
- if (EnhanceJS && EnhanceJS[buttonCode]) {
82
- EnhanceJS[buttonCode](that);
83
- }
84
- }
85
- function customBeforeSubmit(that, formData) {
86
- if (EnhanceJS && EnhanceJS["beforeSubmit"]) {
87
- return EnhanceJS["beforeSubmit"](that, formData);
88
- } else {
89
- return Promise.resolve();
90
- }
91
- }
92
- function beforeDelete(that, record) {
93
- if (EnhanceJS && EnhanceJS["beforeDelete"]) {
94
- return EnhanceJS["beforeDelete"](that, record);
95
- } else {
96
- return Promise.resolve();
97
- }
98
- }
99
- if (isList === true) {
100
- if (onlineTableContext) {
101
- onlineTableContext["beforeDelete"] = (record) => {
102
- const onlEnhanceJS = onlineTableContext["EnhanceJS"];
103
- if (onlEnhanceJS && onlEnhanceJS["beforeDelete"]) {
104
- return onlEnhanceJS["beforeDelete"](onlineTableContext, record);
105
- } else {
106
- return Promise.resolve();
107
- }
108
- };
109
- onlineTableContext["beforeEdit"] = (record) => {
110
- const onlEnhanceJS = onlineTableContext["EnhanceJS"];
111
- if (onlEnhanceJS && onlEnhanceJS["beforeEdit"]) {
112
- return onlEnhanceJS["beforeEdit"](onlineTableContext, record);
113
- } else {
114
- return Promise.resolve();
115
- }
116
- };
117
- }
118
- }
119
- return {
120
- EnhanceJS,
121
- initCgEnhanceJs,
122
- customBeforeSubmit,
123
- beforeDelete,
124
- triggerJsFun
125
- };
126
- }
53
+ import { o as omit } from "./omit.js";
54
+ import "/@/components/Form/src/jeecg/components/JUpload";
55
+ import "/@/views/system/user/user.api";
56
+ import "./_commonjsHelpers.js";
57
+ import "/@/store/modules/user";
58
+ import "/@/utils/desform/customExpression";
59
+ import "/@/components/Form/src/componentMap";
60
+ import "./OnlineSelectCascade.js";
61
+ import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
62
+ import "vue-router";
63
+ import "/@/store/modules/permission";
64
+ import "/@/utils/propTypes";
65
+ import "/@/utils/dict/JDictSelectUtil";
66
+ import "/@/utils/common/compUtils";
67
+ import "/@/components/Table";
68
+ import "/@/hooks/system/useListPage";
69
+ import "/@/components/Form/src/utils/Area";
70
+ import "/@/components/Preview/index";
71
+ import "./LinkTableListPiece.js";
72
+ import "./JModalTip.js";
73
+ import "ant-design-vue";
74
+ import "@vueuse/core";
75
+ import "./_flatRest.js";
76
+ import "./isArray.js";
77
+ import "./toString.js";
78
+ import "./_arrayPush.js";
79
+ import "./_baseClone.js";
80
+ import "./_baseSlice.js";
127
81
  const urlObject = {
128
82
  optPre: "/online/cgform/api/form/",
129
83
  urlButtonAction: "/online/cgform/api/doButton"
@@ -133,7 +87,11 @@ const _sfc_main = {
133
87
  components: {
134
88
  BasicForm,
135
89
  Loading,
136
- OnlineSubForm
90
+ OnlineSubForm,
91
+ PrinterOutlined,
92
+ DiffOutlined,
93
+ FormOutlined,
94
+ OnlinePopModal
137
95
  },
138
96
  props: {
139
97
  id: {
@@ -155,6 +113,10 @@ const _sfc_main = {
155
113
  pidField: {
156
114
  type: String,
157
115
  default: ""
116
+ },
117
+ submitTip: {
118
+ type: Boolean,
119
+ default: true
158
120
  }
159
121
  },
160
122
  emits: ["success", "rendered"],
@@ -173,7 +135,8 @@ const _sfc_main = {
173
135
  reportPrintUrl: "",
174
136
  joinQuery: 0,
175
137
  modelFullscreen: 0,
176
- modalMinWidth: ""
138
+ modalMinWidth: "",
139
+ commentStatus: 0
177
140
  });
178
141
  const { onlineFormContext, resetContext } = useOnlineFormContext();
179
142
  const {
@@ -192,7 +155,8 @@ const _sfc_main = {
192
155
  linkDownList,
193
156
  fieldDisplayStatus
194
157
  } = useFormItems(props, onlineFormRef);
195
- let { EnhanceJS: EnhanceJS2, initCgEnhanceJs: initCgEnhanceJs2 } = useEnhance(onlineFormContext, false);
158
+ let { EnhanceJS, initCgEnhanceJs } = useEnhance(onlineFormContext, false);
159
+ console.log("--formSchemas----------", formSchemas);
196
160
  const [registerForm, { setProps, validate, resetFields, setFieldsValue, updateSchema, getFieldsValue, scrollToField }] = useForm({
197
161
  schemas: formSchemas,
198
162
  showActionButtonGroup: false,
@@ -262,15 +226,23 @@ const _sfc_main = {
262
226
  loadFormFieldsDefVal(subFieldProperties, (values) => {
263
227
  const { row, target } = $event;
264
228
  let v = [{ rowKey: row.id, values: __spreadValues({}, values) }];
265
- target.ctx.setValues(v);
229
+ target.setValues(v);
266
230
  });
267
231
  }
268
232
  function edit(record) {
269
233
  return __async(this, null, function* () {
270
234
  let formData = yield getFormData(record.id);
271
- dbData.value = Object.assign({}, record);
235
+ dbData.value = Object.assign({}, record, formData);
272
236
  let arr = realFormFieldNames.value;
273
- yield setFieldsValue(pick(formData, ...arr));
237
+ let values = pick(formData, ...arr);
238
+ if (props.disabled) {
239
+ Object.keys(values).map((k) => {
240
+ if (!values[k] && values[k] !== 0 && values[k] !== "0") {
241
+ delete values[k];
242
+ }
243
+ });
244
+ }
245
+ yield setFieldsValue(values);
274
246
  editSubVxeTableData(formData);
275
247
  });
276
248
  }
@@ -317,16 +289,19 @@ const _sfc_main = {
317
289
  single.value = data.head.tableType == 1;
318
290
  handleExtConfigJson(data.head.extConfigJson);
319
291
  createFormSchemas(data.schema.properties, data.schema.required, checkOnlyFieldValue);
320
- EnhanceJS2 = initCgEnhanceJs2(data.enhanceJs);
292
+ EnhanceJS = initCgEnhanceJs(data.enhanceJs);
321
293
  emit("rendered", onlineExtConfigJson);
322
294
  let formRefObject = yield getRefPromise(onlineFormRef);
323
- formRefObject.$formValueChange = (field, value) => {
295
+ formRefObject.$formValueChange = (field, value, changeFormData) => {
324
296
  onValuesChange(field, value);
297
+ if (changeFormData) {
298
+ setFieldsValue(changeFormData);
299
+ }
325
300
  };
326
301
  });
327
302
  }
328
303
  function handleExtConfigJson(jsonStr) {
329
- let extConfigJson = { "reportPrintShow": 0, "reportPrintUrl": "", "joinQuery": 0, "modelFullscreen": 1, "modalMinWidth": "" };
304
+ let extConfigJson = { reportPrintShow: 0, reportPrintUrl: "", joinQuery: 0, modelFullscreen: 1, modalMinWidth: "", commentStatus: 0 };
330
305
  if (jsonStr) {
331
306
  extConfigJson = JSON.parse(jsonStr);
332
307
  }
@@ -349,12 +324,15 @@ const _sfc_main = {
349
324
  function validateAll() {
350
325
  let temp = {};
351
326
  return new Promise((resolve, reject) => {
352
- validate().then((values) => resolve(values), ({ errorFields }) => {
353
- if (errorFields && errorFields.length > 0) {
354
- scrollToField(errorFields[0][0]);
327
+ validate().then(
328
+ (values) => resolve(values),
329
+ ({ errorFields }) => {
330
+ if (errorFields && errorFields.length > 0) {
331
+ scrollToField(errorFields[0][0]);
332
+ }
333
+ reject(VALIDATE_FAILED);
355
334
  }
356
- reject(VALIDATE_FAILED);
357
- });
335
+ );
358
336
  }).then((result) => {
359
337
  Object.assign(temp, changeDataIfArray2String(result));
360
338
  return validateSubTableFields();
@@ -377,7 +355,16 @@ const _sfc_main = {
377
355
  let arr = subTabInfo.value;
378
356
  for (let i = 0; i < arr.length; i++) {
379
357
  if (key == arr[i].key) {
380
- subActiveKey.value = i + "";
358
+ let activeKey = i + "";
359
+ if (subActiveKey.value === activeKey) {
360
+ break;
361
+ }
362
+ subActiveKey.value = activeKey;
363
+ if (arr[i].relationType === 0) {
364
+ let instance = refMap[key].value;
365
+ instance = Array.isArray(instance) ? instance[0] : instance;
366
+ sleep(300, () => instance == null ? void 0 : instance.validateTable());
367
+ }
381
368
  break;
382
369
  }
383
370
  }
@@ -429,7 +416,7 @@ const _sfc_main = {
429
416
  });
430
417
  }
431
418
  function handleApplyRequest(formData) {
432
- customBeforeSubmit2(context, formData).then(() => {
419
+ customBeforeSubmit(context, formData).then(() => {
433
420
  doApplyRequest(formData);
434
421
  }).catch((msg) => {
435
422
  $message.warning(msg);
@@ -459,7 +446,9 @@ const _sfc_main = {
459
446
  formData[SUBMIT_FLOW_ID] = res.result;
460
447
  }
461
448
  emit("success", formData);
462
- $message.success(res.message);
449
+ if (props.submitTip === true) {
450
+ $message.success(res.message);
451
+ }
463
452
  } else {
464
453
  $message.warning(res.message);
465
454
  }
@@ -469,13 +458,15 @@ const _sfc_main = {
469
458
  }
470
459
  function triggleChangeValues(values, id, target) {
471
460
  if (id && target) {
472
- if (target.setValues) {
473
- target.setValues(values);
461
+ if (target.vxeProps) {
462
+ target.setValues([
463
+ {
464
+ rowKey: id,
465
+ values
466
+ }
467
+ ]);
474
468
  } else {
475
- target.ctx.setValues([{
476
- rowKey: id,
477
- values
478
- }]);
469
+ target.setValues(values);
479
470
  }
480
471
  } else {
481
472
  setFieldsValue(values);
@@ -510,8 +501,8 @@ const _sfc_main = {
510
501
  return "";
511
502
  }
512
503
  function handleSubFormChange(valueObj, tableKey) {
513
- if (EnhanceJS2 && EnhanceJS2[tableKey + "_onlChange"]) {
514
- let tableChangeObj = EnhanceJS2[tableKey + "_onlChange"]();
504
+ if (EnhanceJS && EnhanceJS[tableKey + "_onlChange"]) {
505
+ let tableChangeObj = EnhanceJS[tableKey + "_onlChange"]();
515
506
  let columnKey = Object.keys(valueObj)[0];
516
507
  if (tableChangeObj[columnKey]) {
517
508
  let subRef = refMap[tableKey].value;
@@ -528,28 +519,41 @@ const _sfc_main = {
528
519
  }
529
520
  }
530
521
  function handleValueChange(event, tableKey) {
531
- if (EnhanceJS2 && EnhanceJS2[tableKey + "_onlChange"]) {
532
- let tableChangeObj = EnhanceJS2[tableKey + "_onlChange"](onlineFormContext);
533
- if (tableChangeObj[event.column.key]) {
534
- tableChangeObj[event.column.key].call(onlineFormContext, onlineFormContext, event);
522
+ if (EnhanceJS && EnhanceJS[tableKey + "_onlChange"]) {
523
+ let tableChangeObj = EnhanceJS[tableKey + "_onlChange"](onlineFormContext);
524
+ if (event.column === "all") {
525
+ let keys = Object.keys(tableChangeObj);
526
+ if (keys.length > 0) {
527
+ for (let key of keys) {
528
+ tableChangeObj[key].call(onlineFormContext, onlineFormContext, event);
529
+ }
530
+ }
531
+ } else {
532
+ let columnKey = event.column.key || event.col.key;
533
+ if (tableChangeObj[columnKey]) {
534
+ if (event.row && event.row.id) {
535
+ tableChangeObj[columnKey].call(onlineFormContext, onlineFormContext, event);
536
+ }
537
+ }
535
538
  }
536
539
  }
537
540
  }
538
- function handleAdded(event) {
539
- event.target.emit("executeFillRule", event);
541
+ function handleAdded(sub, event) {
542
+ console.log("handleAdded", sub, event);
543
+ handleSubTableDefaultValue(sub, event);
540
544
  }
541
545
  function getSubTableAuthPre(table) {
542
546
  return "online_" + table + ":";
543
547
  }
544
548
  function onValuesChange(columnKey, value) {
545
549
  return __async(this, null, function* () {
546
- if (!EnhanceJS2 || !EnhanceJS2["onlChange"]) {
550
+ if (!EnhanceJS || !EnhanceJS["onlChange"]) {
547
551
  return false;
548
552
  }
549
553
  if (!columnKey) {
550
554
  return false;
551
555
  }
552
- let tableChangeObj = EnhanceJS2["onlChange"]();
556
+ let tableChangeObj = EnhanceJS["onlChange"]();
553
557
  if (tableChangeObj[columnKey]) {
554
558
  let formData = yield getFieldsValue();
555
559
  let event = {
@@ -562,11 +566,11 @@ const _sfc_main = {
562
566
  });
563
567
  }
564
568
  function handleCgButtonClick(optType, buttonCode) {
565
- if (optType == "js") {
566
- if (EnhanceJS2 && EnhanceJS2[buttonCode]) {
567
- EnhanceJS2[buttonCode].call(onlineFormContext, onlineFormContext);
569
+ if ("js" == optType) {
570
+ if (EnhanceJS && EnhanceJS[buttonCode]) {
571
+ EnhanceJS[buttonCode].call(onlineFormContext, onlineFormContext);
568
572
  }
569
- } else if (optType == "action") {
573
+ } else if ("action" == optType) {
570
574
  let formData = dbData.value;
571
575
  let params = {
572
576
  formId: props.id,
@@ -574,10 +578,13 @@ const _sfc_main = {
574
578
  dataId: formData.id,
575
579
  uiFormData: Object.assign({}, formData)
576
580
  };
577
- defHttp.post({
578
- url: `${urlObject.urlButtonAction}`,
579
- params
580
- }, { isTransformResponse: false }).then((res) => {
581
+ defHttp.post(
582
+ {
583
+ url: `${urlObject.urlButtonAction}`,
584
+ params
585
+ },
586
+ { isTransformResponse: false }
587
+ ).then((res) => {
581
588
  if (res.success) {
582
589
  $message.success("\u5904\u7406\u5B8C\u6210!");
583
590
  } else {
@@ -629,9 +636,9 @@ const _sfc_main = {
629
636
  }
630
637
  });
631
638
  }
632
- function customBeforeSubmit2(that, formData) {
633
- if (EnhanceJS2 && EnhanceJS2["beforeSubmit"]) {
634
- return EnhanceJS2["beforeSubmit"](that, formData);
639
+ function customBeforeSubmit(that, formData) {
640
+ if (EnhanceJS && EnhanceJS["beforeSubmit"]) {
641
+ return EnhanceJS["beforeSubmit"](that, formData);
635
642
  } else {
636
643
  return Promise.resolve();
637
644
  }
@@ -672,6 +679,79 @@ const _sfc_main = {
672
679
  }
673
680
  return instance;
674
681
  }
682
+ function onOpenReportPrint() {
683
+ let url = onlineExtConfigJson.reportPrintUrl;
684
+ let id = dbData.value.id;
685
+ let token = getToken();
686
+ goJmReportViewPage(url, id, token);
687
+ }
688
+ const [registerPopModal, { openModal: openPopModal }] = useModal();
689
+ const popTableName = ref("");
690
+ const popModalRequest = ref(true);
691
+ function openSubFormModalForAdd(sub) {
692
+ console.log("openSubFormModalForAdd", sub);
693
+ popTableName.value = sub.id;
694
+ popModalRequest.value = false;
695
+ openPopModal(true, {});
696
+ }
697
+ function openSubFormModalForEdit(sub) {
698
+ let ref2 = refMap[sub.key];
699
+ if (!ref2 || !ref2.value) {
700
+ $message.warning("\u5B50\u8868ref\u627E\u4E0D\u5230:" + sub.key);
701
+ return;
702
+ }
703
+ ref2 = ref2.value;
704
+ if (Array.isArray(ref2)) {
705
+ ref2 = ref2[0];
706
+ }
707
+ let arr = ref2.getSelectedData();
708
+ if (arr.length != 1) {
709
+ $message.warning("\u8BF7\u9009\u62E9\u4E00\u6761\u6570\u636E");
710
+ return;
711
+ }
712
+ popTableName.value = sub.id;
713
+ popModalRequest.value = false;
714
+ openPopModal(true, { isUpdate: true, record: arr[0] });
715
+ }
716
+ function getPopFormData(data) {
717
+ const tableName2 = data[ONL_FORM_TABLE_NAME];
718
+ let record = omit(data, [ONL_FORM_TABLE_NAME]);
719
+ if (record.id) {
720
+ const ref2 = refMap[tableName2];
721
+ if (!ref2 || !ref2.value) {
722
+ $message.warning("\u5B50\u8868ref\u627E\u4E0D\u5230:" + tableName2);
723
+ return;
724
+ }
725
+ let values = omit(__spreadValues({}, record), "id");
726
+ let arr = [{ rowKey: record.id, values }];
727
+ let instance = ref2.value;
728
+ if (instance instanceof Array) {
729
+ instance = instance[0];
730
+ }
731
+ instance.setValues(arr);
732
+ } else {
733
+ let instance = refMap[tableName2].value;
734
+ if (instance instanceof Array) {
735
+ instance = instance[0];
736
+ }
737
+ instance.addRows(record, { isOnlineJS: false, setActive: false, emitChange: true });
738
+ }
739
+ }
740
+ function onCloseModal() {
741
+ let arr = subTabInfo.value;
742
+ if (arr && arr.length > 0) {
743
+ for (let item of arr) {
744
+ if (item.relationType == 1)
745
+ ;
746
+ else {
747
+ let inst = getSubTableInstance(item.key);
748
+ if (inst) {
749
+ inst.clearSelection();
750
+ }
751
+ }
752
+ }
753
+ }
754
+ }
675
755
  let context = {
676
756
  tableName,
677
757
  loading,
@@ -691,7 +771,8 @@ const _sfc_main = {
691
771
  clearThenAddRows,
692
772
  changeOptions,
693
773
  isUpdate,
694
- getSubTableInstance
774
+ getSubTableInstance,
775
+ updateSchema
695
776
  };
696
777
  resetContext(context);
697
778
  return {
@@ -714,34 +795,60 @@ const _sfc_main = {
714
795
  handleAdded,
715
796
  handleSubTableDefaultValue,
716
797
  handleValueChange,
798
+ openSubFormModalForAdd,
799
+ openSubFormModalForEdit,
717
800
  show,
718
801
  createRootProperties,
719
802
  handleSubmit,
720
803
  sh: fieldDisplayStatus,
721
804
  handleCgButtonClick,
722
805
  handleCustomFormSh,
723
- handleCustomFormEdit
806
+ handleCustomFormEdit,
807
+ dbData,
808
+ onOpenReportPrint,
809
+ onlineExtConfigJson,
810
+ registerPopModal,
811
+ popTableName,
812
+ getPopFormData,
813
+ popModalRequest,
814
+ onCloseModal
724
815
  };
725
816
  }
726
817
  };
727
818
  const _hoisted_1 = ["id"];
728
- const _hoisted_2 = { key: 1 };
819
+ const _hoisted_2 = {
820
+ key: 0,
821
+ style: { "text-align": "right", "position": "absolute", "top": "6px", "right": "20px", "z-index": "999" }
822
+ };
823
+ const _hoisted_3 = { key: 1 };
729
824
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
825
+ const _component_PrinterOutlined = resolveComponent("PrinterOutlined");
730
826
  const _component_BasicForm = resolveComponent("BasicForm");
731
827
  const _component_online_sub_form = resolveComponent("online-sub-form");
828
+ const _component_diff_outlined = resolveComponent("diff-outlined");
829
+ const _component_a_button = resolveComponent("a-button");
830
+ const _component_form_outlined = resolveComponent("form-outlined");
732
831
  const _component_JVxeTable = resolveComponent("JVxeTable");
733
832
  const _component_a_tab_pane = resolveComponent("a-tab-pane");
734
833
  const _component_a_tabs = resolveComponent("a-tabs");
735
834
  const _component_Loading = resolveComponent("Loading");
835
+ const _component_online_pop_modal = resolveComponent("online-pop-modal");
736
836
  return openBlock(), createElementBlock("div", {
737
837
  id: $setup.tableName + "_form"
738
838
  }, [
839
+ !!$setup.dbData.id && !!$setup.onlineExtConfigJson.reportPrintShow ? (openBlock(), createElementBlock("div", _hoisted_2, [
840
+ createVNode(_component_PrinterOutlined, {
841
+ title: "\u6253\u5370",
842
+ onClick: $setup.onOpenReportPrint,
843
+ style: { "font-size": "16px" }
844
+ }, null, 8, ["onClick"])
845
+ ])) : createCommentVNode("", true),
739
846
  createVNode(_component_BasicForm, {
740
847
  ref: "onlineFormRef",
741
848
  onRegister: $setup.registerForm
742
849
  }, null, 8, ["onRegister"]),
743
850
  $setup.hasSubTable ? (openBlock(), createBlock(_component_a_tabs, {
744
- key: 0,
851
+ key: 1,
745
852
  activeKey: $setup.subActiveKey,
746
853
  "onUpdate:activeKey": _cache[0] || (_cache[0] = ($event) => $setup.subActiveKey = $event)
747
854
  }, {
@@ -769,7 +876,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
769
876
  "is-update": $setup.isUpdate,
770
877
  onFormChange: (arg) => $setup.handleSubFormChange(arg, sub.key)
771
878
  }, null, 8, ["table", "disabled", "form-template", "main-id", "properties", "required-fields", "is-update", "onFormChange"])
772
- ], 4)) : (openBlock(), createElementBlock("div", _hoisted_2, [
879
+ ], 4)) : (openBlock(), createElementBlock("div", _hoisted_3, [
773
880
  createVNode(_component_JVxeTable, {
774
881
  ref_for: true,
775
882
  ref: $setup.refMap[sub.key],
@@ -783,9 +890,31 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
783
890
  dataSource: $setup.subDataSource[sub.key],
784
891
  onValueChange: (event) => $setup.handleValueChange(event, sub.key),
785
892
  authPre: $setup.getSubTableAuthPre(sub.key),
786
- onAdded: $setup.handleAdded,
893
+ onAdded: ($event) => $setup.handleAdded(sub, $event),
787
894
  onExecuteFillRule: ($event) => $setup.handleSubTableDefaultValue(sub, $event)
788
- }, null, 8, ["height", "disabled", "columns", "dataSource", "onValueChange", "authPre", "onAdded", "onExecuteFillRule"])
895
+ }, {
896
+ toolbarSuffix: withCtx(() => [
897
+ createVNode(_component_a_button, {
898
+ type: "primary",
899
+ onClick: ($event) => $setup.openSubFormModalForAdd(sub)
900
+ }, {
901
+ default: withCtx(() => [
902
+ createVNode(_component_diff_outlined)
903
+ ]),
904
+ _: 2
905
+ }, 1032, ["onClick"]),
906
+ createVNode(_component_a_button, {
907
+ type: "primary",
908
+ onClick: ($event) => $setup.openSubFormModalForEdit(sub)
909
+ }, {
910
+ default: withCtx(() => [
911
+ createVNode(_component_form_outlined)
912
+ ]),
913
+ _: 2
914
+ }, 1032, ["onClick"])
915
+ ]),
916
+ _: 2
917
+ }, 1032, ["height", "disabled", "columns", "dataSource", "onValueChange", "authPre", "onAdded", "onExecuteFillRule"])
789
918
  ]))
790
919
  ]),
791
920
  _: 2
@@ -798,12 +927,16 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
798
927
  loading: $setup.loading,
799
928
  absolute: false
800
929
  }, null, 8, ["loading"]),
801
- renderSlot(_ctx.$slots, "bottom")
930
+ renderSlot(_ctx.$slots, "bottom"),
931
+ createVNode(_component_online_pop_modal, {
932
+ request: $setup.popModalRequest,
933
+ id: $setup.popTableName,
934
+ onRegister: $setup.registerPopModal,
935
+ onSuccess: $setup.getPopFormData,
936
+ topTip: "",
937
+ isVxeTableData: ""
938
+ }, null, 8, ["request", "id", "onRegister", "onSuccess"])
802
939
  ], 8, _hoisted_1);
803
940
  }
804
941
  var OnlineForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
805
- var OnlineForm$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
806
- __proto__: null,
807
- "default": OnlineForm
808
- }, Symbol.toStringTag, { value: "Module" }));
809
- export { OnlineForm as O, OnlineForm$1 as a, useEnhance as u };
942
+ export { OnlineForm as default };