@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.
- 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 +605 -0
- package/EnhanceJavaModal.js +11 -17
- package/EnhanceJsHistory.js +6 -8
- package/EnhanceJsModal.js +9 -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 +88 -131
- package/OnlineAutoTreeList.js +93 -53
- package/OnlineCustomModal.js +30 -14
- package/OnlineDetailModal.js +184 -0
- package/OnlineForm.js +259 -141
- package/OnlineFormDetail.js +326 -0
- package/OnlineQueryForm.js +72 -40
- package/OnlineSearchFormItem.js +26 -18
- package/OnlineSelectCascade.js +67 -53
- package/OnlineSubFormDetail.js +167 -0
- package/OnlineSuperQuery.js +69 -74
- 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 +16 -6
- package/index2.js +48 -45
- package/index3.js +29 -26
- package/isArray.js +1 -1
- 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 +3437 -3791
- package/useCgformList.js +44 -31
- package/{useTableColumns.js → useListButton.js} +212 -407
- package/useOnlineTest.js +5 -26827
- package/useSchemas.js +364 -230
- 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/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,10 @@ 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("--------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.
|
|
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
|
-
|
|
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
|
-
|
|
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 = {
|
|
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(
|
|
353
|
-
|
|
354
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
473
|
-
target.setValues(
|
|
463
|
+
if (target.vxeProps) {
|
|
464
|
+
target.setValues([
|
|
465
|
+
{
|
|
466
|
+
rowKey: id,
|
|
467
|
+
values
|
|
468
|
+
}
|
|
469
|
+
]);
|
|
474
470
|
} else {
|
|
475
|
-
target.
|
|
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 (
|
|
514
|
-
let tableChangeObj =
|
|
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 (
|
|
532
|
-
let tableChangeObj =
|
|
533
|
-
if (
|
|
534
|
-
|
|
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
|
-
|
|
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 (!
|
|
552
|
+
if (!EnhanceJS || !EnhanceJS["onlChange"]) {
|
|
547
553
|
return false;
|
|
548
554
|
}
|
|
549
555
|
if (!columnKey) {
|
|
550
556
|
return false;
|
|
551
557
|
}
|
|
552
|
-
let tableChangeObj =
|
|
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 (
|
|
566
|
-
if (
|
|
567
|
-
|
|
571
|
+
if ("js" == optType) {
|
|
572
|
+
if (EnhanceJS && EnhanceJS[buttonCode]) {
|
|
573
|
+
EnhanceJS[buttonCode].call(onlineFormContext, onlineFormContext);
|
|
568
574
|
}
|
|
569
|
-
} else if (
|
|
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
|
-
|
|
579
|
-
|
|
580
|
-
|
|
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
|
|
633
|
-
if (
|
|
634
|
-
return
|
|
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 = {
|
|
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:
|
|
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",
|
|
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
|
-
},
|
|
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
|
-
|
|
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 };
|