@jeecg/online 1.0.1 → 3.4.3-beta

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 (91) 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 +605 -0
  20. package/EnhanceJavaModal.js +11 -17
  21. package/EnhanceJsHistory.js +6 -8
  22. package/EnhanceJsModal.js +9 -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 +88 -131
  39. package/OnlineAutoTreeList.js +93 -53
  40. package/OnlineCustomModal.js +30 -14
  41. package/OnlineDetailModal.js +184 -0
  42. package/OnlineForm.js +259 -141
  43. package/OnlineFormDetail.js +326 -0
  44. package/OnlineQueryForm.js +72 -40
  45. package/OnlineSearchFormItem.js +26 -18
  46. package/OnlineSelectCascade.js +67 -53
  47. package/OnlineSubFormDetail.js +167 -0
  48. package/OnlineSuperQuery.js +69 -74
  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 +16 -6
  64. package/index2.js +48 -45
  65. package/index3.js +29 -26
  66. package/isArray.js +1 -1
  67. package/omit.js +60 -0
  68. package/package.json +1 -1
  69. package/pick.js +3 -173
  70. package/style.css +1 -1
  71. package/toString.js +2 -2
  72. package/useAutoForm.js +3437 -3791
  73. package/useCgformList.js +44 -31
  74. package/{useTableColumns.js → useListButton.js} +212 -407
  75. package/useOnlineTest.js +5 -26827
  76. package/useSchemas.js +364 -230
  77. package/useTableSync.js +19 -7
  78. package/ChartAutoRender.js +0 -69
  79. package/ChartDoubleRender.js +0 -154
  80. package/ChartSingleRender.js +0 -132
  81. package/ChartTabsRender.js +0 -218
  82. package/ErrorTip.js +0 -21
  83. package/FieldTable.js +0 -185
  84. package/GraphreportAutoChart.js +0 -352
  85. package/GraphreportList.js +0 -239
  86. package/GraphreportModal.js +0 -559
  87. package/OnlineSubForm.js +0 -200
  88. package/ParamsTable.js +0 -71
  89. package/graphreport.api.js +0 -23
  90. package/useChartRender.js +0 -405
  91. 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,10 @@ 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("--------v3_hello-----------");
160
+ console.log("--formSchemas----------", formSchemas);
161
+ tableName.value = "v3_hello";
196
162
  const [registerForm, { setProps, validate, resetFields, setFieldsValue, updateSchema, getFieldsValue, scrollToField }] = useForm({
197
163
  schemas: formSchemas,
198
164
  showActionButtonGroup: false,
@@ -262,15 +228,23 @@ const _sfc_main = {
262
228
  loadFormFieldsDefVal(subFieldProperties, (values) => {
263
229
  const { row, target } = $event;
264
230
  let v = [{ rowKey: row.id, values: __spreadValues({}, values) }];
265
- target.ctx.setValues(v);
231
+ target.setValues(v);
266
232
  });
267
233
  }
268
234
  function edit(record) {
269
235
  return __async(this, null, function* () {
270
236
  let formData = yield getFormData(record.id);
271
- dbData.value = Object.assign({}, record);
237
+ dbData.value = Object.assign({}, record, formData);
272
238
  let arr = realFormFieldNames.value;
273
- yield setFieldsValue(pick(formData, ...arr));
239
+ let values = pick(formData, ...arr);
240
+ if (props.disabled) {
241
+ Object.keys(values).map((k) => {
242
+ if (!values[k] && values[k] !== 0 && values[k] !== "0") {
243
+ delete values[k];
244
+ }
245
+ });
246
+ }
247
+ yield setFieldsValue(values);
274
248
  editSubVxeTableData(formData);
275
249
  });
276
250
  }
@@ -317,16 +291,19 @@ const _sfc_main = {
317
291
  single.value = data.head.tableType == 1;
318
292
  handleExtConfigJson(data.head.extConfigJson);
319
293
  createFormSchemas(data.schema.properties, data.schema.required, checkOnlyFieldValue);
320
- EnhanceJS2 = initCgEnhanceJs2(data.enhanceJs);
294
+ EnhanceJS = initCgEnhanceJs(data.enhanceJs);
321
295
  emit("rendered", onlineExtConfigJson);
322
296
  let formRefObject = yield getRefPromise(onlineFormRef);
323
- formRefObject.$formValueChange = (field, value) => {
297
+ formRefObject.$formValueChange = (field, value, changeFormData) => {
324
298
  onValuesChange(field, value);
299
+ if (changeFormData) {
300
+ setFieldsValue(changeFormData);
301
+ }
325
302
  };
326
303
  });
327
304
  }
328
305
  function handleExtConfigJson(jsonStr) {
329
- let extConfigJson = { "reportPrintShow": 0, "reportPrintUrl": "", "joinQuery": 0, "modelFullscreen": 1, "modalMinWidth": "" };
306
+ let extConfigJson = { reportPrintShow: 0, reportPrintUrl: "", joinQuery: 0, modelFullscreen: 1, modalMinWidth: "", commentStatus: 0 };
330
307
  if (jsonStr) {
331
308
  extConfigJson = JSON.parse(jsonStr);
332
309
  }
@@ -349,12 +326,15 @@ const _sfc_main = {
349
326
  function validateAll() {
350
327
  let temp = {};
351
328
  return new Promise((resolve, reject) => {
352
- validate().then((values) => resolve(values), ({ errorFields }) => {
353
- if (errorFields && errorFields.length > 0) {
354
- scrollToField(errorFields[0][0]);
329
+ validate().then(
330
+ (values) => resolve(values),
331
+ ({ errorFields }) => {
332
+ if (errorFields && errorFields.length > 0) {
333
+ scrollToField(errorFields[0][0]);
334
+ }
335
+ reject(VALIDATE_FAILED);
355
336
  }
356
- reject(VALIDATE_FAILED);
357
- });
337
+ );
358
338
  }).then((result) => {
359
339
  Object.assign(temp, changeDataIfArray2String(result));
360
340
  return validateSubTableFields();
@@ -377,7 +357,16 @@ const _sfc_main = {
377
357
  let arr = subTabInfo.value;
378
358
  for (let i = 0; i < arr.length; i++) {
379
359
  if (key == arr[i].key) {
380
- subActiveKey.value = i + "";
360
+ let activeKey = i + "";
361
+ if (subActiveKey.value === activeKey) {
362
+ break;
363
+ }
364
+ subActiveKey.value = activeKey;
365
+ if (arr[i].relationType === 0) {
366
+ let instance = refMap[key].value;
367
+ instance = Array.isArray(instance) ? instance[0] : instance;
368
+ sleep(300, () => instance == null ? void 0 : instance.validateTable());
369
+ }
381
370
  break;
382
371
  }
383
372
  }
@@ -429,7 +418,7 @@ const _sfc_main = {
429
418
  });
430
419
  }
431
420
  function handleApplyRequest(formData) {
432
- customBeforeSubmit2(context, formData).then(() => {
421
+ customBeforeSubmit(context, formData).then(() => {
433
422
  doApplyRequest(formData);
434
423
  }).catch((msg) => {
435
424
  $message.warning(msg);
@@ -459,7 +448,9 @@ const _sfc_main = {
459
448
  formData[SUBMIT_FLOW_ID] = res.result;
460
449
  }
461
450
  emit("success", formData);
462
- $message.success(res.message);
451
+ if (props.submitTip === true) {
452
+ $message.success(res.message);
453
+ }
463
454
  } else {
464
455
  $message.warning(res.message);
465
456
  }
@@ -469,13 +460,15 @@ const _sfc_main = {
469
460
  }
470
461
  function triggleChangeValues(values, id, target) {
471
462
  if (id && target) {
472
- if (target.setValues) {
473
- target.setValues(values);
463
+ if (target.vxeProps) {
464
+ target.setValues([
465
+ {
466
+ rowKey: id,
467
+ values
468
+ }
469
+ ]);
474
470
  } else {
475
- target.ctx.setValues([{
476
- rowKey: id,
477
- values
478
- }]);
471
+ target.setValues(values);
479
472
  }
480
473
  } else {
481
474
  setFieldsValue(values);
@@ -510,8 +503,8 @@ const _sfc_main = {
510
503
  return "";
511
504
  }
512
505
  function handleSubFormChange(valueObj, tableKey) {
513
- if (EnhanceJS2 && EnhanceJS2[tableKey + "_onlChange"]) {
514
- let tableChangeObj = EnhanceJS2[tableKey + "_onlChange"]();
506
+ if (EnhanceJS && EnhanceJS[tableKey + "_onlChange"]) {
507
+ let tableChangeObj = EnhanceJS[tableKey + "_onlChange"]();
515
508
  let columnKey = Object.keys(valueObj)[0];
516
509
  if (tableChangeObj[columnKey]) {
517
510
  let subRef = refMap[tableKey].value;
@@ -528,28 +521,41 @@ const _sfc_main = {
528
521
  }
529
522
  }
530
523
  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);
524
+ if (EnhanceJS && EnhanceJS[tableKey + "_onlChange"]) {
525
+ let tableChangeObj = EnhanceJS[tableKey + "_onlChange"](onlineFormContext);
526
+ if (event.column === "all") {
527
+ let keys = Object.keys(tableChangeObj);
528
+ if (keys.length > 0) {
529
+ for (let key of keys) {
530
+ tableChangeObj[key].call(onlineFormContext, onlineFormContext, event);
531
+ }
532
+ }
533
+ } else {
534
+ let columnKey = event.column.key || event.col.key;
535
+ if (tableChangeObj[columnKey]) {
536
+ if (event.row && event.row.id) {
537
+ tableChangeObj[columnKey].call(onlineFormContext, onlineFormContext, event);
538
+ }
539
+ }
535
540
  }
536
541
  }
537
542
  }
538
- function handleAdded(event) {
539
- event.target.emit("executeFillRule", event);
543
+ function handleAdded(sub, event) {
544
+ console.log("handleAdded", sub, event);
545
+ handleSubTableDefaultValue(sub, event);
540
546
  }
541
547
  function getSubTableAuthPre(table) {
542
548
  return "online_" + table + ":";
543
549
  }
544
550
  function onValuesChange(columnKey, value) {
545
551
  return __async(this, null, function* () {
546
- if (!EnhanceJS2 || !EnhanceJS2["onlChange"]) {
552
+ if (!EnhanceJS || !EnhanceJS["onlChange"]) {
547
553
  return false;
548
554
  }
549
555
  if (!columnKey) {
550
556
  return false;
551
557
  }
552
- let tableChangeObj = EnhanceJS2["onlChange"]();
558
+ let tableChangeObj = EnhanceJS["onlChange"]();
553
559
  if (tableChangeObj[columnKey]) {
554
560
  let formData = yield getFieldsValue();
555
561
  let event = {
@@ -562,11 +568,11 @@ const _sfc_main = {
562
568
  });
563
569
  }
564
570
  function handleCgButtonClick(optType, buttonCode) {
565
- if (optType == "js") {
566
- if (EnhanceJS2 && EnhanceJS2[buttonCode]) {
567
- EnhanceJS2[buttonCode].call(onlineFormContext, onlineFormContext);
571
+ if ("js" == optType) {
572
+ if (EnhanceJS && EnhanceJS[buttonCode]) {
573
+ EnhanceJS[buttonCode].call(onlineFormContext, onlineFormContext);
568
574
  }
569
- } else if (optType == "action") {
575
+ } else if ("action" == optType) {
570
576
  let formData = dbData.value;
571
577
  let params = {
572
578
  formId: props.id,
@@ -574,10 +580,13 @@ const _sfc_main = {
574
580
  dataId: formData.id,
575
581
  uiFormData: Object.assign({}, formData)
576
582
  };
577
- defHttp.post({
578
- url: `${urlObject.urlButtonAction}`,
579
- params
580
- }, { isTransformResponse: false }).then((res) => {
583
+ defHttp.post(
584
+ {
585
+ url: `${urlObject.urlButtonAction}`,
586
+ params
587
+ },
588
+ { isTransformResponse: false }
589
+ ).then((res) => {
581
590
  if (res.success) {
582
591
  $message.success("\u5904\u7406\u5B8C\u6210!");
583
592
  } else {
@@ -629,9 +638,9 @@ const _sfc_main = {
629
638
  }
630
639
  });
631
640
  }
632
- function customBeforeSubmit2(that, formData) {
633
- if (EnhanceJS2 && EnhanceJS2["beforeSubmit"]) {
634
- return EnhanceJS2["beforeSubmit"](that, formData);
641
+ function customBeforeSubmit(that, formData) {
642
+ if (EnhanceJS && EnhanceJS["beforeSubmit"]) {
643
+ return EnhanceJS["beforeSubmit"](that, formData);
635
644
  } else {
636
645
  return Promise.resolve();
637
646
  }
@@ -672,6 +681,64 @@ const _sfc_main = {
672
681
  }
673
682
  return instance;
674
683
  }
684
+ function onOpenReportPrint() {
685
+ let url = onlineExtConfigJson.reportPrintUrl;
686
+ let id = dbData.value.id;
687
+ let token = getToken();
688
+ goJmReportViewPage(url, id, token);
689
+ }
690
+ const [registerPopModal, { openModal: openPopModal }] = useModal();
691
+ const popTableName = ref("");
692
+ const popModalRequest = ref(true);
693
+ function openSubFormModalForAdd(sub) {
694
+ console.log("openSubFormModalForAdd", sub);
695
+ popTableName.value = sub.id;
696
+ popModalRequest.value = false;
697
+ openPopModal(true, {});
698
+ }
699
+ function openSubFormModalForEdit(sub) {
700
+ let ref2 = refMap[sub.key];
701
+ if (!ref2 || !ref2.value) {
702
+ $message.warning("\u5B50\u8868ref\u627E\u4E0D\u5230:" + sub.key);
703
+ return;
704
+ }
705
+ ref2 = ref2.value;
706
+ if (Array.isArray(ref2)) {
707
+ ref2 = ref2[0];
708
+ }
709
+ let arr = ref2.getSelectedData();
710
+ if (arr.length != 1) {
711
+ $message.warning("\u8BF7\u9009\u62E9\u4E00\u6761\u6570\u636E");
712
+ return;
713
+ }
714
+ popTableName.value = sub.id;
715
+ popModalRequest.value = false;
716
+ openPopModal(true, { isUpdate: true, record: arr[0] });
717
+ }
718
+ function getPopFormData(data) {
719
+ const tableName2 = data[ONL_FORM_TABLE_NAME];
720
+ let record = omit(data, [ONL_FORM_TABLE_NAME]);
721
+ if (record.id) {
722
+ const ref2 = refMap[tableName2];
723
+ if (!ref2 || !ref2.value) {
724
+ $message.warning("\u5B50\u8868ref\u627E\u4E0D\u5230:" + tableName2);
725
+ return;
726
+ }
727
+ let values = omit(__spreadValues({}, record), "id");
728
+ let arr = [{ rowKey: record.id, values }];
729
+ let instance = ref2.value;
730
+ if (instance instanceof Array) {
731
+ instance = instance[0];
732
+ }
733
+ instance.setValues(arr);
734
+ } else {
735
+ let instance = refMap[tableName2].value;
736
+ if (instance instanceof Array) {
737
+ instance = instance[0];
738
+ }
739
+ instance.addRows(record, { isOnlineJS: false, setActive: false, emitChange: true });
740
+ }
741
+ }
675
742
  let context = {
676
743
  tableName,
677
744
  loading,
@@ -691,7 +758,8 @@ const _sfc_main = {
691
758
  clearThenAddRows,
692
759
  changeOptions,
693
760
  isUpdate,
694
- getSubTableInstance
761
+ getSubTableInstance,
762
+ updateSchema
695
763
  };
696
764
  resetContext(context);
697
765
  return {
@@ -714,34 +782,59 @@ const _sfc_main = {
714
782
  handleAdded,
715
783
  handleSubTableDefaultValue,
716
784
  handleValueChange,
785
+ openSubFormModalForAdd,
786
+ openSubFormModalForEdit,
717
787
  show,
718
788
  createRootProperties,
719
789
  handleSubmit,
720
790
  sh: fieldDisplayStatus,
721
791
  handleCgButtonClick,
722
792
  handleCustomFormSh,
723
- handleCustomFormEdit
793
+ handleCustomFormEdit,
794
+ dbData,
795
+ onOpenReportPrint,
796
+ onlineExtConfigJson,
797
+ registerPopModal,
798
+ popTableName,
799
+ getPopFormData,
800
+ popModalRequest
724
801
  };
725
802
  }
726
803
  };
727
804
  const _hoisted_1 = ["id"];
728
- const _hoisted_2 = { key: 1 };
805
+ const _hoisted_2 = {
806
+ key: 0,
807
+ style: { "text-align": "right", "position": "absolute", "top": "6px", "right": "20px", "z-index": "999" }
808
+ };
809
+ const _hoisted_3 = { key: 1 };
729
810
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
811
+ const _component_PrinterOutlined = resolveComponent("PrinterOutlined");
730
812
  const _component_BasicForm = resolveComponent("BasicForm");
731
813
  const _component_online_sub_form = resolveComponent("online-sub-form");
814
+ const _component_diff_outlined = resolveComponent("diff-outlined");
815
+ const _component_a_button = resolveComponent("a-button");
816
+ const _component_form_outlined = resolveComponent("form-outlined");
732
817
  const _component_JVxeTable = resolveComponent("JVxeTable");
733
818
  const _component_a_tab_pane = resolveComponent("a-tab-pane");
734
819
  const _component_a_tabs = resolveComponent("a-tabs");
735
820
  const _component_Loading = resolveComponent("Loading");
821
+ const _component_online_pop_modal = resolveComponent("online-pop-modal");
736
822
  return openBlock(), createElementBlock("div", {
737
823
  id: $setup.tableName + "_form"
738
824
  }, [
825
+ !!$setup.dbData.id && !!$setup.onlineExtConfigJson.reportPrintShow ? (openBlock(), createElementBlock("div", _hoisted_2, [
826
+ createVNode(_component_PrinterOutlined, {
827
+ title: "\u6253\u5370",
828
+ onClick: $setup.onOpenReportPrint,
829
+ style: { "font-size": "16px" }
830
+ }, null, 8, ["onClick"])
831
+ ])) : createCommentVNode("", true),
739
832
  createVNode(_component_BasicForm, {
740
833
  ref: "onlineFormRef",
741
834
  onRegister: $setup.registerForm
742
835
  }, null, 8, ["onRegister"]),
743
836
  $setup.hasSubTable ? (openBlock(), createBlock(_component_a_tabs, {
744
- key: 0,
837
+ key: 1,
745
838
  activeKey: $setup.subActiveKey,
746
839
  "onUpdate:activeKey": _cache[0] || (_cache[0] = ($event) => $setup.subActiveKey = $event)
747
840
  }, {
@@ -769,7 +862,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
769
862
  "is-update": $setup.isUpdate,
770
863
  onFormChange: (arg) => $setup.handleSubFormChange(arg, sub.key)
771
864
  }, null, 8, ["table", "disabled", "form-template", "main-id", "properties", "required-fields", "is-update", "onFormChange"])
772
- ], 4)) : (openBlock(), createElementBlock("div", _hoisted_2, [
865
+ ], 4)) : (openBlock(), createElementBlock("div", _hoisted_3, [
773
866
  createVNode(_component_JVxeTable, {
774
867
  ref_for: true,
775
868
  ref: $setup.refMap[sub.key],
@@ -783,9 +876,31 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
783
876
  dataSource: $setup.subDataSource[sub.key],
784
877
  onValueChange: (event) => $setup.handleValueChange(event, sub.key),
785
878
  authPre: $setup.getSubTableAuthPre(sub.key),
786
- onAdded: $setup.handleAdded,
879
+ onAdded: ($event) => $setup.handleAdded(sub, $event),
787
880
  onExecuteFillRule: ($event) => $setup.handleSubTableDefaultValue(sub, $event)
788
- }, null, 8, ["height", "disabled", "columns", "dataSource", "onValueChange", "authPre", "onAdded", "onExecuteFillRule"])
881
+ }, {
882
+ toolbarSuffix: withCtx(() => [
883
+ createVNode(_component_a_button, {
884
+ type: "primary",
885
+ onClick: ($event) => $setup.openSubFormModalForAdd(sub)
886
+ }, {
887
+ default: withCtx(() => [
888
+ createVNode(_component_diff_outlined)
889
+ ]),
890
+ _: 2
891
+ }, 1032, ["onClick"]),
892
+ createVNode(_component_a_button, {
893
+ type: "primary",
894
+ onClick: ($event) => $setup.openSubFormModalForEdit(sub)
895
+ }, {
896
+ default: withCtx(() => [
897
+ createVNode(_component_form_outlined)
898
+ ]),
899
+ _: 2
900
+ }, 1032, ["onClick"])
901
+ ]),
902
+ _: 2
903
+ }, 1032, ["height", "disabled", "columns", "dataSource", "onValueChange", "authPre", "onAdded", "onExecuteFillRule"])
789
904
  ]))
790
905
  ]),
791
906
  _: 2
@@ -798,12 +913,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
798
913
  loading: $setup.loading,
799
914
  absolute: false
800
915
  }, null, 8, ["loading"]),
801
- renderSlot(_ctx.$slots, "bottom")
916
+ renderSlot(_ctx.$slots, "bottom"),
917
+ createVNode(_component_online_pop_modal, {
918
+ request: $setup.popModalRequest,
919
+ id: $setup.popTableName,
920
+ onRegister: $setup.registerPopModal,
921
+ onSuccess: $setup.getPopFormData,
922
+ topTip: ""
923
+ }, null, 8, ["request", "id", "onRegister", "onSuccess"])
802
924
  ], 8, _hoisted_1);
803
925
  }
804
926
  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 };
927
+ export { OnlineForm as default };