@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.
- package/AuthButtonConfig.js +14 -7
- package/AuthButtonTree.js +3 -5
- package/AuthDataConfig.js +9 -6
- package/AuthDataTree.js +3 -5
- package/AuthFieldConfig.js +15 -12
- package/AuthFieldTree.js +24 -18
- package/AuthManagerDrawer.js +1 -1
- package/AuthSetterModal.js +1 -0
- package/CgformCopyList.js +34 -22
- package/CgformModal.js +57 -50
- package/CgreportModal.js +32 -39
- package/CheckDictTable.js +144 -24
- package/CodeFileListModal.js +175 -0
- package/CodeFileViewModal.js +325 -0
- package/CodeGeneratorModal.js +41 -38
- package/CustomButtonList.js +19 -22
- package/DBAttributeTable.js +248 -12
- package/DbToOnlineModal.js +27 -25
- package/DetailForm.js +609 -0
- package/EnhanceJavaModal.js +11 -17
- package/EnhanceJsHistory.js +6 -8
- package/EnhanceJsModal.js +16 -16
- package/EnhanceSqlModal.js +11 -17
- package/ExtendConfigModal.js +24 -15
- package/ForeignKeyTable.js +4 -3
- package/FormSchemaFactory.js +163 -30
- package/IndexTable.js +6 -5
- package/JModalTip.js +54 -0
- package/JOnlineSearchSelect.js +18 -10
- package/LeftDepart.js +1 -1
- package/LeftRole.js +7 -4
- package/LeftUser.js +7 -4
- package/LinkTableConfigModal.js +289 -0
- package/LinkTableFieldConfigModal.js +218 -0
- package/LinkTableListPiece.js +36 -0
- package/ModalFormDemo.js +3 -2
- package/OnlineAutoList.js +154 -55
- package/OnlineAutoModal.js +92 -131
- package/OnlineAutoTreeList.js +93 -53
- package/OnlineCustomModal.js +30 -14
- package/OnlineDetailModal.js +184 -0
- package/OnlineForm.js +274 -141
- package/OnlineFormDetail.js +326 -0
- package/OnlineQueryForm.js +72 -40
- package/OnlineSearchFormItem.js +26 -18
- package/OnlineSelectCascade.js +37 -26
- package/OnlineSubFormDetail.js +167 -0
- package/OnlineSuperQuery.js +70 -75
- package/OnlineSuperQueryValComponent.js +1 -0
- package/OnlineSuperQueryValComponent.vue_vue_type_script_lang.js +1 -17
- package/PageAttributeTable.js +233 -30
- package/ProcessOnlineForm.js +41 -16
- package/QueryTable.js +4 -3
- package/README.md +3 -8
- package/_arrayPush.js +5 -3
- package/{cloneDeep.js → _baseClone.js} +5 -9
- package/_baseSlice.js +18 -0
- package/_commonjsHelpers.js +5 -0
- package/_flatRest.js +174 -0
- package/auth.data.js +1 -3
- package/cgform.data.js +18 -9
- package/enhance.api.js +27 -18
- package/index.js +27 -8
- package/index2.js +48 -45
- package/index3.js +29 -26
- package/isArray.js +1 -1
- package/main.index.js +2 -2
- package/omit.js +60 -0
- package/package.json +1 -1
- package/pick.js +3 -173
- package/style.css +1 -1
- package/toString.js +2 -2
- package/useAutoForm.js +3457 -3791
- package/useCgformList.js +44 -31
- package/{useTableColumns.js → useListButton.js} +218 -409
- package/useOnlineTest.js +5 -26827
- package/useSchemas.js +382 -234
- package/useTableSync.js +19 -7
- package/ChartAutoRender.js +0 -69
- package/ChartDoubleRender.js +0 -154
- package/ChartSingleRender.js +0 -132
- package/ChartTabsRender.js +0 -218
- package/ErrorTip.js +0 -21
- package/FieldTable.js +0 -185
- package/GraphreportAutoChart.js +0 -352
- package/GraphreportList.js +0 -239
- package/GraphreportModal.js +0 -559
- package/LICENSE +0 -7
- package/OnlineSubForm.js +0 -200
- package/ParamsTable.js +0 -71
- package/graphreport.api.js +0 -23
- package/useChartRender.js +0 -405
- 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 {
|
|
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,
|
|
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 {
|
|
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
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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 = {
|
|
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(
|
|
353
|
-
|
|
354
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
473
|
-
target.setValues(
|
|
461
|
+
if (target.vxeProps) {
|
|
462
|
+
target.setValues([
|
|
463
|
+
{
|
|
464
|
+
rowKey: id,
|
|
465
|
+
values
|
|
466
|
+
}
|
|
467
|
+
]);
|
|
474
468
|
} else {
|
|
475
|
-
target.
|
|
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 (
|
|
514
|
-
let tableChangeObj =
|
|
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 (
|
|
532
|
-
let tableChangeObj =
|
|
533
|
-
if (
|
|
534
|
-
|
|
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
|
-
|
|
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 (!
|
|
550
|
+
if (!EnhanceJS || !EnhanceJS["onlChange"]) {
|
|
547
551
|
return false;
|
|
548
552
|
}
|
|
549
553
|
if (!columnKey) {
|
|
550
554
|
return false;
|
|
551
555
|
}
|
|
552
|
-
let tableChangeObj =
|
|
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 (
|
|
566
|
-
if (
|
|
567
|
-
|
|
569
|
+
if ("js" == optType) {
|
|
570
|
+
if (EnhanceJS && EnhanceJS[buttonCode]) {
|
|
571
|
+
EnhanceJS[buttonCode].call(onlineFormContext, onlineFormContext);
|
|
568
572
|
}
|
|
569
|
-
} else if (
|
|
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
|
-
|
|
579
|
-
|
|
580
|
-
|
|
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
|
|
633
|
-
if (
|
|
634
|
-
return
|
|
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 = {
|
|
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:
|
|
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",
|
|
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
|
-
},
|
|
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
|
-
|
|
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 };
|