@jeecg/online 3.5.3-beta3 → 3.6.0-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-b6a674fa.mjs +125 -0
- package/AuthButtonTree-09e57bc4.mjs +156 -0
- package/AuthDataConfig-6e7e61ec.mjs +212 -0
- package/AuthDataTree-e83286c5.mjs +139 -0
- package/AuthFieldConfig-f1ec2708.mjs +139 -0
- package/AuthFieldTree-bb72e21f.mjs +232 -0
- package/AuthManagerDrawer-28a2d108.mjs +114 -0
- package/AuthSetterModal-2990d553.mjs +261 -0
- package/CgformCopyList-36a4cbf0.mjs +246 -0
- package/CgformModal-7399a5ac.mjs +611 -0
- package/CgreportModal-2eb9c9e1.mjs +13 -0
- package/CgreportModal.vue_vue_type_script_setup_true_lang-c2ceb064.mjs +566 -0
- package/CheckDictTable-3a8a54b3.mjs +211 -0
- package/CodeFileListModal-72f0d3bb.mjs +158 -0
- package/CodeFileViewModal-9eb88c47.mjs +244 -0
- package/CodeGeneratorModal-a89958f5.mjs +233 -0
- package/CustomButtonList-c44aec5a.mjs +363 -0
- package/DBAttributeTable-7d285e8d.mjs +473 -0
- package/DbToOnlineModal-d23cbeb1.mjs +160 -0
- package/DetailForm-2901d215.mjs +461 -0
- package/EnhanceJavaModal-153899a9.mjs +264 -0
- package/EnhanceJsHistory-7f5db3b1.mjs +184 -0
- package/EnhanceJsModal-c2fb75b8.mjs +311 -0
- package/EnhanceSqlModal-965e9b0a.mjs +268 -0
- package/ExtendConfigModal-8f08466f.mjs +111 -0
- package/FieldExtendJsonModal-adfcf5a7.mjs +219 -0
- package/FileSelectModal-432d4521.mjs +103 -0
- package/ForeignKeyTable-faab7ccf.mjs +69 -0
- package/IndexTable-0a2d3718.mjs +89 -0
- package/JModalTip-e1938b49.mjs +46 -0
- package/JOnlineSearchSelect-7e908492.mjs +95 -0
- package/LeftDepart-54f245b3.mjs +82 -0
- package/LeftRole-c138f892.mjs +86 -0
- package/LeftUser-9c812f8a.mjs +105 -0
- package/LinkTableConfigModal-c2c5c7e6.mjs +230 -0
- package/LinkTableFieldConfigModal-a3553b1f.mjs +176 -0
- package/LinkTableListPiece-7f793b08.mjs +34 -0
- package/ModalFormDemo-65685b0e.mjs +78 -0
- package/OnlCgformErpList-52c87ed3.mjs +449 -0
- package/OnlCgformErpSubTable-6e7fb17b.mjs +398 -0
- package/OnlCgformInnerSubTable-f0727b8f.mjs +248 -0
- package/OnlCgformInnerTableList-9f89c173.mjs +430 -0
- package/OnlCgformTabList-15516315.mjs +390 -0
- package/OnlineAutoList-63a0224f.mjs +474 -0
- package/OnlineAutoModal-ffe19c3f.mjs +206 -0
- package/OnlineAutoTreeList-317c7105.mjs +495 -0
- package/OnlineCustomModal-3939ce78.mjs +227 -0
- package/OnlineDetailModal-bfb1375f.mjs +177 -0
- package/OnlineForm-069f6092.mjs +749 -0
- package/OnlineFormDetail-ad5735fb.mjs +296 -0
- package/OnlineQueryForm-0771c80f.mjs +385 -0
- package/OnlineSearchFormItem-0db5834f.mjs +348 -0
- package/OnlineSelectCascade-a05c30f4.mjs +159 -0
- package/OnlineSubFormDetail-583d01eb.mjs +142 -0
- package/OnlineTabAutoModal-747e071d.mjs +253 -0
- package/OnlineTabDetailModal-887f0174.mjs +222 -0
- package/OnlineTabForm-b1dcd4b4.mjs +765 -0
- package/OnlineTabFormDetail-8e494a96.mjs +323 -0
- package/PageAttributeTable-5966b201.mjs +404 -0
- package/ProcessOnlineForm-4382bea7.mjs +177 -0
- package/QueryTable-6e8053ad.mjs +115 -0
- package/README.md +2 -1
- package/SuperQuery-78db6998.mjs +841 -0
- package/SuperQueryValComponent-471110b5.mjs +8 -0
- package/SuperQueryValComponent.vue_vue_type_script_lang-e3ad7ee8.mjs +101 -0
- package/auth.api-d3a6c4b3.mjs +39 -0
- package/auth.data-8be5c9e3.mjs +141 -0
- package/{cgform.data.js → cgform.data-cbdd88c3.mjs} +93 -62
- package/constant-754f1a9d.mjs +9 -0
- package/enhance.api-138e6826.mjs +104 -0
- package/enhance.data-efc7e155.mjs +175 -0
- package/index-0a93652b.mjs +237 -0
- package/index-7e9a23f2.mjs +1494 -0
- package/index-b70302f2.mjs +56 -0
- package/main.index.js +7 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/useCgformList-0c603af1.mjs +424 -0
- package/useCustomHook-acb00837.mjs +53 -0
- package/useExtendComponent-aa1cdfc8.mjs +3917 -0
- package/useListButton-0f18bf6a.mjs +671 -0
- package/useOnlinePopEvent-687070b7.mjs +19 -0
- package/useOnlineTest-e4bd8be3.mjs +42 -0
- package/useSchemas-43429d80.mjs +685 -0
- package/useTableSync-774c3774.mjs +87 -0
- package/AuthButtonConfig.js +0 -147
- package/AuthButtonTree.js +0 -183
- package/AuthDataConfig.js +0 -246
- package/AuthDataTree.js +0 -160
- package/AuthFieldConfig.js +0 -170
- package/AuthFieldTree.js +0 -281
- package/AuthManagerDrawer.js +0 -125
- package/AuthSetterModal.js +0 -316
- package/CgformCopyList.js +0 -266
- package/CgformModal.js +0 -780
- package/CgreportModal.js +0 -667
- package/CheckDictTable.js +0 -242
- package/CodeFileListModal.js +0 -175
- package/CodeFileViewModal.js +0 -325
- package/CodeGeneratorModal.js +0 -297
- package/CustomButtonList.js +0 -410
- package/DBAttributeTable.js +0 -526
- package/DbToOnlineModal.js +0 -192
- package/DetailForm.js +0 -608
- package/EnhanceJavaModal.js +0 -298
- package/EnhanceJsHistory.js +0 -229
- package/EnhanceJsModal.js +0 -293
- package/EnhanceSqlModal.js +0 -299
- package/ExtendConfigModal.js +0 -151
- package/FieldExtendJsonModal.js +0 -283
- package/FileSelectModal.js +0 -102
- package/ForeignKeyTable.js +0 -79
- package/IndexTable.js +0 -97
- package/JModalTip.js +0 -54
- package/JOnlineSearchSelect.js +0 -115
- package/LICENSE +0 -9
- package/LeftDepart.js +0 -96
- package/LeftRole.js +0 -98
- package/LeftUser.js +0 -117
- package/LinkTableConfigModal.js +0 -289
- package/LinkTableFieldConfigModal.js +0 -218
- package/LinkTableListPiece.js +0 -36
- package/ModalFormDemo.js +0 -85
- package/OnlineAutoList.js +0 -523
- package/OnlineAutoModal.js +0 -226
- package/OnlineAutoTreeList.js +0 -552
- package/OnlineCustomModal.js +0 -286
- package/OnlineDetailModal.js +0 -190
- package/OnlineForm.js +0 -1016
- package/OnlineFormDetail.js +0 -347
- package/OnlineQueryForm.js +0 -484
- package/OnlineSearchFormItem.js +0 -436
- package/OnlineSelectCascade.js +0 -228
- package/OnlineSubFormDetail.js +0 -166
- package/PageAttributeTable.js +0 -486
- package/ProcessOnlineForm.js +0 -208
- package/QueryTable.js +0 -129
- package/SuperQuery.js +0 -1020
- package/SuperQueryValComponent.js +0 -8
- package/SuperQueryValComponent.vue_vue_type_script_lang.js +0 -168
- package/_arrayPush.js +0 -278
- package/_baseClone.js +0 -471
- package/_baseSlice.js +0 -18
- package/_commonjsHelpers.js +0 -5
- package/_flatRest.js +0 -174
- package/auth.api.js +0 -43
- package/auth.data.js +0 -142
- package/clipboard.js +0 -565
- package/enhance.api.js +0 -129
- package/enhance.data.js +0 -196
- package/index.js +0 -87
- package/index2.js +0 -340
- package/index3.js +0 -264
- package/isArray.js +0 -47
- package/omit.js +0 -60
- package/pick.js +0 -68
- package/toString.js +0 -31
- package/useCgformList.js +0 -470
- package/useExtendComponent.js +0 -5205
- package/useListButton.js +0 -923
- package/useOnlineTest.js +0 -44
- package/useSchemas.js +0 -653
- package/useTableSync.js +0 -117
package/OnlineForm.js
DELETED
|
@@ -1,1016 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
var __async = (__this, __arguments, generator) => {
|
|
18
|
-
return new Promise((resolve, reject) => {
|
|
19
|
-
var fulfilled = (value) => {
|
|
20
|
-
try {
|
|
21
|
-
step(generator.next(value));
|
|
22
|
-
} catch (e) {
|
|
23
|
-
reject(e);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
var rejected = (value) => {
|
|
27
|
-
try {
|
|
28
|
-
step(generator.throw(value));
|
|
29
|
-
} catch (e) {
|
|
30
|
-
reject(e);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
34
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
import * as HOOK_MESSAGE from "/@/hooks/web/useMessage";
|
|
38
|
-
import { useMessage } from "/@/hooks/web/useMessage";
|
|
39
|
-
import * as vue from "vue";
|
|
40
|
-
import { ref, reactive, computed, resolveComponent, openBlock, createElementBlock, createVNode, createCommentVNode, createBlock, withCtx, Fragment, renderList, normalizeStyle, renderSlot, unref, nextTick, toRaw } from "vue";
|
|
41
|
-
import { BasicForm, useForm } from "/@/components/Form/index";
|
|
42
|
-
import { O as OnlineSubForm, a as OnlinePopModal, b as useOnlineFormContext, c as useFormItems, d as useEnhance, l as loadFormFieldsDefVal, g as getRefPromise, V as VALIDATE_FAILED, S as SUBMIT_FLOW_KEY, e as SUBMIT_FLOW_ID, f as ONL_FORM_TABLE_NAME } from "./useExtendComponent.js";
|
|
43
|
-
import * as UTIL_AXIOS from "/@/utils/http/axios";
|
|
44
|
-
import { defHttp } from "/@/utils/http/axios";
|
|
45
|
-
import { sleep, goJmReportViewPage } from "/@/utils";
|
|
46
|
-
import { Loading } from "/@/components/Loading";
|
|
47
|
-
import "/@/components/jeecg/JVxeTable/types";
|
|
48
|
-
import { getToken } from "/@/utils/auth";
|
|
49
|
-
import { PrinterOutlined, DiffOutlined, FormOutlined } from "@ant-design/icons-vue";
|
|
50
|
-
import "/@/hooks/core/useContext";
|
|
51
|
-
import "/@/utils/mitt";
|
|
52
|
-
import { useModal } from "/@/components/Modal";
|
|
53
|
-
import * as UTIL_CACHE from "/@/utils/cache";
|
|
54
|
-
import { randomString } from "/@/utils/common/compUtils";
|
|
55
|
-
import * as HOOK_USERINFO from "/@/store/modules/user";
|
|
56
|
-
import { _ as _export_sfc } from "./index.js";
|
|
57
|
-
import { p as pick } from "./pick.js";
|
|
58
|
-
import { o as omit } from "./omit.js";
|
|
59
|
-
const $exports = {
|
|
60
|
-
vue,
|
|
61
|
-
"@": {
|
|
62
|
-
hooks: {
|
|
63
|
-
useMessage: HOOK_MESSAGE,
|
|
64
|
-
useUserStore: HOOK_USERINFO
|
|
65
|
-
},
|
|
66
|
-
utils: {
|
|
67
|
-
axios: UTIL_AXIOS,
|
|
68
|
-
cache: UTIL_CACHE
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
function useCustomHook(otherExports, context) {
|
|
73
|
-
const assignExports = Object.assign({}, $exports, otherExports);
|
|
74
|
-
function doImport(path) {
|
|
75
|
-
if (path != null && path != "") {
|
|
76
|
-
let paths = path.toString().split("/");
|
|
77
|
-
let result = assignExports[paths[0]];
|
|
78
|
-
for (let i = 1; i < paths.length; i++) {
|
|
79
|
-
result = result[paths[i]];
|
|
80
|
-
}
|
|
81
|
-
return result;
|
|
82
|
-
}
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
85
|
-
function doExport() {
|
|
86
|
-
}
|
|
87
|
-
function executeJsEnhanced(code, row) {
|
|
88
|
-
let randomKey = randomString(6);
|
|
89
|
-
let exportKey = "__export_" + randomKey;
|
|
90
|
-
if (row) {
|
|
91
|
-
const executeCode = `return function (row, customImport, ${exportKey}) {"use strict"; ${code}}`;
|
|
92
|
-
console.group("executeJsEnhanced");
|
|
93
|
-
console.log(executeCode);
|
|
94
|
-
console.groupEnd();
|
|
95
|
-
const fun = new Function(executeCode)();
|
|
96
|
-
fun.call(context, row, doImport, doExport);
|
|
97
|
-
} else {
|
|
98
|
-
const executeCode = `return function (customImport, ${exportKey}) {"use strict"; ${code}}`;
|
|
99
|
-
console.group("executeJsEnhanced");
|
|
100
|
-
console.log(executeCode);
|
|
101
|
-
console.groupEnd();
|
|
102
|
-
const fun = new Function(executeCode)();
|
|
103
|
-
fun.call(context, doImport, doExport);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return {
|
|
107
|
-
executeJsEnhanced
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
const GET_FUN_BODY_REG = /(?:\/\*[\s\S]*?\*\/|\/\/.*?\r?\n|[^{])+\{([\s\S]*)\}$/;
|
|
111
|
-
const urlObject = {
|
|
112
|
-
optPre: "/online/cgform/api/form/",
|
|
113
|
-
urlButtonAction: "/online/cgform/api/doButton"
|
|
114
|
-
};
|
|
115
|
-
const _sfc_main = {
|
|
116
|
-
name: "OnlineForm",
|
|
117
|
-
components: {
|
|
118
|
-
BasicForm,
|
|
119
|
-
Loading,
|
|
120
|
-
OnlineSubForm,
|
|
121
|
-
PrinterOutlined,
|
|
122
|
-
DiffOutlined,
|
|
123
|
-
FormOutlined,
|
|
124
|
-
OnlinePopModal
|
|
125
|
-
},
|
|
126
|
-
props: {
|
|
127
|
-
id: {
|
|
128
|
-
type: String,
|
|
129
|
-
default: ""
|
|
130
|
-
},
|
|
131
|
-
formTemplate: {
|
|
132
|
-
type: Number,
|
|
133
|
-
default: 1
|
|
134
|
-
},
|
|
135
|
-
disabled: {
|
|
136
|
-
type: Boolean,
|
|
137
|
-
default: false
|
|
138
|
-
},
|
|
139
|
-
isTree: {
|
|
140
|
-
type: Boolean,
|
|
141
|
-
default: false
|
|
142
|
-
},
|
|
143
|
-
pidField: {
|
|
144
|
-
type: String,
|
|
145
|
-
default: ""
|
|
146
|
-
},
|
|
147
|
-
submitTip: {
|
|
148
|
-
type: Boolean,
|
|
149
|
-
default: true
|
|
150
|
-
},
|
|
151
|
-
modalClass: {
|
|
152
|
-
type: String,
|
|
153
|
-
default: ""
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
emits: ["success", "rendered"],
|
|
157
|
-
setup(props, { emit }) {
|
|
158
|
-
console.log("onlineForm-setup\u300B\u300B");
|
|
159
|
-
const { createMessage: $message } = useMessage();
|
|
160
|
-
const onlineFormRef = ref(null);
|
|
161
|
-
const single = ref(true);
|
|
162
|
-
const loading = ref(false);
|
|
163
|
-
const tableType = ref(1);
|
|
164
|
-
const customEditSubmitUrl = ref("");
|
|
165
|
-
const submitFlowFlag = ref(false);
|
|
166
|
-
const isUpdate = ref(false);
|
|
167
|
-
const onlineExtConfigJson = reactive({
|
|
168
|
-
reportPrintShow: 0,
|
|
169
|
-
reportPrintUrl: "",
|
|
170
|
-
joinQuery: 0,
|
|
171
|
-
modelFullscreen: 0,
|
|
172
|
-
modalMinWidth: "",
|
|
173
|
-
commentStatus: 0
|
|
174
|
-
});
|
|
175
|
-
const { onlineFormContext, resetContext } = useOnlineFormContext();
|
|
176
|
-
const {
|
|
177
|
-
formSchemas,
|
|
178
|
-
defaultValueFields,
|
|
179
|
-
changeDataIfArray2String,
|
|
180
|
-
tableName,
|
|
181
|
-
dbData,
|
|
182
|
-
checkOnlyFieldValue,
|
|
183
|
-
hasSubTable,
|
|
184
|
-
subTabInfo,
|
|
185
|
-
refMap,
|
|
186
|
-
subDataSource,
|
|
187
|
-
baseColProps,
|
|
188
|
-
createFormSchemas,
|
|
189
|
-
linkDownList,
|
|
190
|
-
fieldDisplayStatus
|
|
191
|
-
} = useFormItems(props, onlineFormRef);
|
|
192
|
-
let { EnhanceJS, initCgEnhanceJs } = useEnhance(onlineFormContext, false);
|
|
193
|
-
const { executeJsEnhanced } = useCustomHook({}, onlineFormContext);
|
|
194
|
-
const [registerForm, { setProps, validate, resetFields, setFieldsValue, updateSchema, getFieldsValue, scrollToField }] = useForm({
|
|
195
|
-
schemas: formSchemas,
|
|
196
|
-
showActionButtonGroup: false,
|
|
197
|
-
baseColProps
|
|
198
|
-
});
|
|
199
|
-
const onlineFormDisabled = ref(false);
|
|
200
|
-
function handleFormDisabled() {
|
|
201
|
-
let flag = props.disabled;
|
|
202
|
-
onlineFormDisabled.value = flag;
|
|
203
|
-
setProps({ disabled: flag });
|
|
204
|
-
}
|
|
205
|
-
function show(status, record, param) {
|
|
206
|
-
return __async(this, null, function* () {
|
|
207
|
-
console.log("\u65B0\u589E\u7F16\u8F91\u8FDB\u5165\u8868\u5355\u300B\u300Bform", record);
|
|
208
|
-
yield updatePidFieldDict();
|
|
209
|
-
customEditSubmitUrl.value = "";
|
|
210
|
-
yield resetFields();
|
|
211
|
-
dbData.value = "";
|
|
212
|
-
let flag = unref(status);
|
|
213
|
-
isUpdate.value = flag;
|
|
214
|
-
if (flag) {
|
|
215
|
-
yield edit(record);
|
|
216
|
-
} else {
|
|
217
|
-
editSubVxeTableData();
|
|
218
|
-
}
|
|
219
|
-
nextTick(() => {
|
|
220
|
-
if (!flag && param) {
|
|
221
|
-
setFieldsValue(param);
|
|
222
|
-
}
|
|
223
|
-
handleDefaultValue();
|
|
224
|
-
handleCgButtonClick("js", "loaded");
|
|
225
|
-
handleFormDisabled();
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
function updatePidFieldDict() {
|
|
230
|
-
return __async(this, null, function* () {
|
|
231
|
-
if (props.isTree === true) {
|
|
232
|
-
let pidFieldName = props.pidField;
|
|
233
|
-
let arr = formSchemas.value;
|
|
234
|
-
if (arr && arr.length > 0) {
|
|
235
|
-
let temp = arr.filter((item) => item.field === pidFieldName);
|
|
236
|
-
if (temp.length > 0) {
|
|
237
|
-
yield updateSchema({
|
|
238
|
-
field: pidFieldName,
|
|
239
|
-
componentProps: {
|
|
240
|
-
reload: new Date().getTime()
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
} else {
|
|
245
|
-
console.log("\u6CA1\u6709\u62FF\u5230\u8868\u5355\u914D\u7F6E\u4FE1\u606F\uFF0C\u53EF\u80FD\u662F\u7B2C\u4E00\u6B21\u6253\u5F00\u65B0\u589E\u9875\u9762");
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
function handleDefaultValue() {
|
|
251
|
-
if (unref(isUpdate) === false) {
|
|
252
|
-
let fieldProperties = toRaw(defaultValueFields[tableName.value]);
|
|
253
|
-
loadFormFieldsDefVal(fieldProperties, (values) => {
|
|
254
|
-
setFieldsValue(values);
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
function handleSubTableDefaultValue(sub, $event) {
|
|
259
|
-
let subFieldProperties = toRaw(defaultValueFields[sub.key]);
|
|
260
|
-
loadFormFieldsDefVal(subFieldProperties, (values) => {
|
|
261
|
-
const { row, target } = $event;
|
|
262
|
-
let v = [{ rowKey: row.id, values: __spreadValues({}, values) }];
|
|
263
|
-
target.setValues(v);
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
function edit(record) {
|
|
267
|
-
return __async(this, null, function* () {
|
|
268
|
-
let formData = yield getFormData(record.id);
|
|
269
|
-
dbData.value = Object.assign({}, record, formData);
|
|
270
|
-
let arr = realFormFieldNames.value;
|
|
271
|
-
let values = pick(formData, ...arr);
|
|
272
|
-
if (props.disabled) {
|
|
273
|
-
Object.keys(values).map((k) => {
|
|
274
|
-
if (!values[k] && values[k] !== 0 && values[k] !== "0") {
|
|
275
|
-
delete values[k];
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
yield setFieldsValue(values);
|
|
280
|
-
editSubVxeTableData(formData);
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
function editSubVxeTableData(record) {
|
|
284
|
-
if (!record) {
|
|
285
|
-
record = {};
|
|
286
|
-
}
|
|
287
|
-
let keys = Object.keys(subDataSource.value);
|
|
288
|
-
if (keys && keys.length > 0) {
|
|
289
|
-
let obj = {};
|
|
290
|
-
for (let key of keys) {
|
|
291
|
-
obj[key] = record[key] || [];
|
|
292
|
-
}
|
|
293
|
-
subDataSource.value = obj;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
let realFormFieldNames = computed(() => {
|
|
297
|
-
let arr = formSchemas.value;
|
|
298
|
-
let names = [];
|
|
299
|
-
for (let a of arr) {
|
|
300
|
-
names.push(a.field);
|
|
301
|
-
}
|
|
302
|
-
return names;
|
|
303
|
-
});
|
|
304
|
-
function getFormData(dataId) {
|
|
305
|
-
let url = `${urlObject.optPre}${props.id}/${dataId}`;
|
|
306
|
-
return new Promise((resolve, reject) => {
|
|
307
|
-
defHttp.get({ url }, { isTransformResponse: false }).then((res) => {
|
|
308
|
-
if (res.success) {
|
|
309
|
-
resolve(res.result);
|
|
310
|
-
} else {
|
|
311
|
-
reject();
|
|
312
|
-
$message.warning(res.message);
|
|
313
|
-
}
|
|
314
|
-
}).catch(() => {
|
|
315
|
-
reject();
|
|
316
|
-
});
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
function createRootProperties(data) {
|
|
320
|
-
return __async(this, null, function* () {
|
|
321
|
-
tableType.value = data.head.tableType;
|
|
322
|
-
tableName.value = data.head.tableName;
|
|
323
|
-
single.value = data.head.tableType == 1;
|
|
324
|
-
handleExtConfigJson(data.head.extConfigJson);
|
|
325
|
-
createFormSchemas(data.schema.properties, data.schema.required, checkOnlyFieldValue);
|
|
326
|
-
EnhanceJS = initCgEnhanceJs(data.enhanceJs);
|
|
327
|
-
emit("rendered", onlineExtConfigJson);
|
|
328
|
-
let formRefObject = yield getRefPromise(onlineFormRef);
|
|
329
|
-
formRefObject.$formValueChange = (field, value, changeFormData) => {
|
|
330
|
-
onValuesChange(field, value);
|
|
331
|
-
if (changeFormData) {
|
|
332
|
-
setFieldsValue(changeFormData);
|
|
333
|
-
}
|
|
334
|
-
onChangeEvent(field, value, changeFormData);
|
|
335
|
-
};
|
|
336
|
-
if (EnhanceJS && EnhanceJS["setup"]) {
|
|
337
|
-
executeEnhanceFormJsHook(EnhanceJS["setup"]);
|
|
338
|
-
}
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
function onChangeEvent(field, value, changeFormData) {
|
|
342
|
-
onlineFormContext.changEvent(field, value, changeFormData);
|
|
343
|
-
}
|
|
344
|
-
function onlineFormValueChange(callback) {
|
|
345
|
-
onlineFormContext.addObject2Context("changEvent", callback);
|
|
346
|
-
}
|
|
347
|
-
function handleExtConfigJson(jsonStr) {
|
|
348
|
-
let extConfigJson = { reportPrintShow: 0, reportPrintUrl: "", joinQuery: 0, modelFullscreen: 0, modalMinWidth: "", commentStatus: 0 };
|
|
349
|
-
if (jsonStr) {
|
|
350
|
-
extConfigJson = JSON.parse(jsonStr);
|
|
351
|
-
}
|
|
352
|
-
Object.keys(extConfigJson).map((k) => {
|
|
353
|
-
onlineExtConfigJson[k] = extConfigJson[k];
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
function handleSubmit() {
|
|
357
|
-
if (single.value === true) {
|
|
358
|
-
handleSingleSubmit();
|
|
359
|
-
} else {
|
|
360
|
-
handleOne2ManySubmit();
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
function handleOne2ManySubmit() {
|
|
364
|
-
validateAll().then((formData) => {
|
|
365
|
-
handleApplyRequest(formData);
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
function validateAll() {
|
|
369
|
-
let temp = {};
|
|
370
|
-
return new Promise((resolve, reject) => {
|
|
371
|
-
validate().then(
|
|
372
|
-
(values) => resolve(values),
|
|
373
|
-
({ errorFields }) => {
|
|
374
|
-
if (errorFields && errorFields.length > 0) {
|
|
375
|
-
scrollToField(errorFields[0][0]);
|
|
376
|
-
}
|
|
377
|
-
reject(VALIDATE_FAILED);
|
|
378
|
-
}
|
|
379
|
-
);
|
|
380
|
-
}).then((result) => {
|
|
381
|
-
Object.assign(temp, changeDataIfArray2String(result));
|
|
382
|
-
return validateSubTableFields();
|
|
383
|
-
}).then((allTableData) => {
|
|
384
|
-
Object.assign(temp, allTableData);
|
|
385
|
-
return Promise.resolve(temp);
|
|
386
|
-
}).catch((e) => {
|
|
387
|
-
if (e === VALIDATE_FAILED || (e == null ? void 0 : e.code) === VALIDATE_FAILED) {
|
|
388
|
-
$message.warning("\u6821\u9A8C\u672A\u901A\u8FC7");
|
|
389
|
-
if (e.key) {
|
|
390
|
-
changeTab(e.key);
|
|
391
|
-
}
|
|
392
|
-
} else {
|
|
393
|
-
console.error(e);
|
|
394
|
-
}
|
|
395
|
-
return Promise.reject(null);
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
function changeTab(key) {
|
|
399
|
-
let arr = subTabInfo.value;
|
|
400
|
-
for (let i = 0; i < arr.length; i++) {
|
|
401
|
-
if (key == arr[i].key) {
|
|
402
|
-
let activeKey = i + "";
|
|
403
|
-
if (subActiveKey.value === activeKey) {
|
|
404
|
-
break;
|
|
405
|
-
}
|
|
406
|
-
subActiveKey.value = activeKey;
|
|
407
|
-
if (arr[i].relationType === 0) {
|
|
408
|
-
let instance = getSubTableInstance(key);
|
|
409
|
-
sleep(300, () => instance == null ? void 0 : instance.validateTable());
|
|
410
|
-
}
|
|
411
|
-
break;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
function validateSubTableFields() {
|
|
416
|
-
return new Promise((resolve, reject) => __async(this, null, function* () {
|
|
417
|
-
let subData = {};
|
|
418
|
-
try {
|
|
419
|
-
let arr = subTabInfo.value;
|
|
420
|
-
for (let i = 0; i < arr.length; i++) {
|
|
421
|
-
let key = arr[i].key;
|
|
422
|
-
let instance = getSubTableInstance(key);
|
|
423
|
-
if (arr[i].relationType == 1) {
|
|
424
|
-
try {
|
|
425
|
-
let subFormData = yield instance.getAll();
|
|
426
|
-
subData[key] = [];
|
|
427
|
-
subData[key].push(subFormData);
|
|
428
|
-
} catch (e) {
|
|
429
|
-
throw { code: VALIDATE_FAILED, key };
|
|
430
|
-
}
|
|
431
|
-
} else {
|
|
432
|
-
let errMap = yield instance.fullValidateTable();
|
|
433
|
-
if (errMap) {
|
|
434
|
-
throw { code: VALIDATE_FAILED, key };
|
|
435
|
-
}
|
|
436
|
-
subData[key] = instance.getTableData();
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
} catch (e) {
|
|
440
|
-
reject(e);
|
|
441
|
-
}
|
|
442
|
-
resolve(subData);
|
|
443
|
-
}));
|
|
444
|
-
}
|
|
445
|
-
function handleSingleSubmit() {
|
|
446
|
-
return __async(this, null, function* () {
|
|
447
|
-
try {
|
|
448
|
-
let values = yield validate();
|
|
449
|
-
values = Object.assign({}, dbData.value, values);
|
|
450
|
-
values = changeDataIfArray2String(values);
|
|
451
|
-
loading.value = true;
|
|
452
|
-
handleApplyRequest(values);
|
|
453
|
-
} finally {
|
|
454
|
-
loading.value = false;
|
|
455
|
-
}
|
|
456
|
-
});
|
|
457
|
-
}
|
|
458
|
-
function handleApplyRequest(formData) {
|
|
459
|
-
customBeforeSubmit(context, formData).then(() => {
|
|
460
|
-
doApplyRequest(formData);
|
|
461
|
-
}).catch((msg) => {
|
|
462
|
-
$message.warning(msg);
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
function doApplyRequest(formData) {
|
|
466
|
-
Object.keys(formData).map((key) => {
|
|
467
|
-
if (Array.isArray(formData[key])) {
|
|
468
|
-
if (formData[key].length == 0) {
|
|
469
|
-
formData[key] = "";
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
});
|
|
473
|
-
console.log("\u63D0\u4EA4\u8868\u5355\u6570\u636E\u300B\u300B\u300Bform:", formData);
|
|
474
|
-
let customUrl = customEditSubmitUrl.value;
|
|
475
|
-
let url = `${urlObject.optPre}${props.id}?tabletype=${tableType.value}`;
|
|
476
|
-
if (customUrl) {
|
|
477
|
-
url = `${customUrl}?tabletype=${tableType.value}`;
|
|
478
|
-
}
|
|
479
|
-
if (submitFlowFlag.value === true) {
|
|
480
|
-
formData[SUBMIT_FLOW_KEY] = 1;
|
|
481
|
-
}
|
|
482
|
-
let method = isUpdate.value === true ? "put" : "post";
|
|
483
|
-
defHttp.request({ url, method, params: formData }, { isTransformResponse: false }).then((res) => {
|
|
484
|
-
if (res.success) {
|
|
485
|
-
if (res.result) {
|
|
486
|
-
formData[SUBMIT_FLOW_ID] = res.result;
|
|
487
|
-
}
|
|
488
|
-
emit("success", formData);
|
|
489
|
-
if (props.submitTip === true) {
|
|
490
|
-
$message.success(res.message);
|
|
491
|
-
}
|
|
492
|
-
} else {
|
|
493
|
-
$message.warning(res.message);
|
|
494
|
-
}
|
|
495
|
-
}).finally(() => {
|
|
496
|
-
loading.value = false;
|
|
497
|
-
});
|
|
498
|
-
}
|
|
499
|
-
function triggleChangeValues(values, id, target) {
|
|
500
|
-
if (id && target) {
|
|
501
|
-
if (target.vxeProps) {
|
|
502
|
-
target.setValues([
|
|
503
|
-
{
|
|
504
|
-
rowKey: id,
|
|
505
|
-
values
|
|
506
|
-
}
|
|
507
|
-
]);
|
|
508
|
-
} else {
|
|
509
|
-
target.setValues(values);
|
|
510
|
-
}
|
|
511
|
-
} else {
|
|
512
|
-
setFieldsValue(values);
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
function triggleChangeValue(field, value) {
|
|
516
|
-
let obj = {};
|
|
517
|
-
obj[field] = value;
|
|
518
|
-
setFieldsValue(obj);
|
|
519
|
-
}
|
|
520
|
-
const subActiveKey = ref("0");
|
|
521
|
-
const subFormHeight = ref(300);
|
|
522
|
-
const subTableHeight = ref(340);
|
|
523
|
-
function getSubTableForeignKeyValue(key) {
|
|
524
|
-
if (isUpdate.value === true) {
|
|
525
|
-
let formData = dbData.value;
|
|
526
|
-
return getValueIgnoreCase(formData, key);
|
|
527
|
-
}
|
|
528
|
-
return "";
|
|
529
|
-
}
|
|
530
|
-
function getValueIgnoreCase(data, key) {
|
|
531
|
-
if (data) {
|
|
532
|
-
let temp = data[key];
|
|
533
|
-
if (!temp && temp !== 0) {
|
|
534
|
-
temp = data[key.toLowerCase()];
|
|
535
|
-
if (!temp && temp !== 0) {
|
|
536
|
-
temp = data[key.toUpperCase()];
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
return temp;
|
|
540
|
-
}
|
|
541
|
-
return "";
|
|
542
|
-
}
|
|
543
|
-
function handleSubFormChange(valueObj, tableKey) {
|
|
544
|
-
if (EnhanceJS && EnhanceJS[tableKey + "_onlChange"]) {
|
|
545
|
-
let tableChangeObj = EnhanceJS[tableKey + "_onlChange"]();
|
|
546
|
-
let columnKey = Object.keys(valueObj)[0];
|
|
547
|
-
if (tableChangeObj[columnKey]) {
|
|
548
|
-
let subRef = getSubTableInstance(tableKey);
|
|
549
|
-
let formEvent = subRef.getFormEvent();
|
|
550
|
-
let event = __spreadValues({
|
|
551
|
-
column: { key: columnKey },
|
|
552
|
-
value: valueObj[columnKey]
|
|
553
|
-
}, formEvent);
|
|
554
|
-
tableChangeObj[columnKey].call(onlineFormContext, onlineFormContext, event);
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
function handleValueChange(event, tableKey) {
|
|
559
|
-
if (EnhanceJS && EnhanceJS[tableKey + "_onlChange"]) {
|
|
560
|
-
let tableChangeObj = EnhanceJS[tableKey + "_onlChange"](onlineFormContext);
|
|
561
|
-
if (event.column === "all") {
|
|
562
|
-
let keys = Object.keys(tableChangeObj);
|
|
563
|
-
if (keys.length > 0) {
|
|
564
|
-
for (let key of keys) {
|
|
565
|
-
tableChangeObj[key].call(onlineFormContext, onlineFormContext, event);
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
} else {
|
|
569
|
-
let columnKey = event.column.key || event.col.key;
|
|
570
|
-
if (tableChangeObj[columnKey]) {
|
|
571
|
-
if (event.row && event.row.id) {
|
|
572
|
-
tableChangeObj[columnKey].call(onlineFormContext, onlineFormContext, event);
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
function handleAdded(sub, event) {
|
|
579
|
-
console.log("handleAdded", sub, event);
|
|
580
|
-
if (!event.isModalData) {
|
|
581
|
-
handleSubTableDefaultValue(sub, event);
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
function getSubTableAuthPre(table) {
|
|
585
|
-
return "online_" + table + ":";
|
|
586
|
-
}
|
|
587
|
-
function onValuesChange(columnKey, value) {
|
|
588
|
-
return __async(this, null, function* () {
|
|
589
|
-
if (!EnhanceJS || !EnhanceJS["onlChange"]) {
|
|
590
|
-
return false;
|
|
591
|
-
}
|
|
592
|
-
if (!columnKey) {
|
|
593
|
-
return false;
|
|
594
|
-
}
|
|
595
|
-
let tableChangeObj = EnhanceJS["onlChange"]();
|
|
596
|
-
if (tableChangeObj[columnKey]) {
|
|
597
|
-
let formData = yield getFieldsValue();
|
|
598
|
-
let event = {
|
|
599
|
-
row: formData,
|
|
600
|
-
column: { key: columnKey },
|
|
601
|
-
value
|
|
602
|
-
};
|
|
603
|
-
tableChangeObj[columnKey].call(onlineFormContext, onlineFormContext, event);
|
|
604
|
-
}
|
|
605
|
-
});
|
|
606
|
-
}
|
|
607
|
-
function executeEnhanceFormJsHook(funStr) {
|
|
608
|
-
let str = funStr.toLocaleString();
|
|
609
|
-
let arr = str.match(GET_FUN_BODY_REG);
|
|
610
|
-
if (arr.length > 1) {
|
|
611
|
-
let temp = arr[1];
|
|
612
|
-
executeJsEnhanced(temp);
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
function handleCgButtonClick(optType, buttonCode) {
|
|
616
|
-
if ("js" == optType) {
|
|
617
|
-
let hookFunName = buttonCode + "_hook";
|
|
618
|
-
if (EnhanceJS && EnhanceJS[buttonCode]) {
|
|
619
|
-
EnhanceJS[buttonCode].call(onlineFormContext, onlineFormContext);
|
|
620
|
-
} else if (EnhanceJS && EnhanceJS[hookFunName]) {
|
|
621
|
-
executeEnhanceFormJsHook(EnhanceJS[hookFunName]);
|
|
622
|
-
}
|
|
623
|
-
} else if ("action" == optType) {
|
|
624
|
-
let formData = dbData.value;
|
|
625
|
-
let params = {
|
|
626
|
-
formId: props.id,
|
|
627
|
-
buttonCode,
|
|
628
|
-
dataId: formData.id,
|
|
629
|
-
uiFormData: Object.assign({}, formData)
|
|
630
|
-
};
|
|
631
|
-
defHttp.post(
|
|
632
|
-
{
|
|
633
|
-
url: `${urlObject.urlButtonAction}`,
|
|
634
|
-
params
|
|
635
|
-
},
|
|
636
|
-
{ isTransformResponse: false }
|
|
637
|
-
).then((res) => {
|
|
638
|
-
if (res.success) {
|
|
639
|
-
$message.success("\u5904\u7406\u5B8C\u6210!");
|
|
640
|
-
} else {
|
|
641
|
-
$message.warning("\u5904\u7406\u5931\u8D25!");
|
|
642
|
-
}
|
|
643
|
-
});
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
function clearSubRows(tbname) {
|
|
647
|
-
let instance = getSubTableInstance(tbname);
|
|
648
|
-
let rows = [...instance.getNewDataWithId(), ...subDataSource.value[tbname]];
|
|
649
|
-
if (!rows || rows.length == 0) {
|
|
650
|
-
return false;
|
|
651
|
-
}
|
|
652
|
-
let ids = [];
|
|
653
|
-
for (let i of rows) {
|
|
654
|
-
ids.push(i.id);
|
|
655
|
-
}
|
|
656
|
-
instance.removeRowsById(ids);
|
|
657
|
-
}
|
|
658
|
-
function addSubRows(tbname, rows) {
|
|
659
|
-
if (!rows) {
|
|
660
|
-
return false;
|
|
661
|
-
}
|
|
662
|
-
let instance = getSubTableInstance(tbname);
|
|
663
|
-
if (typeof rows == "object") {
|
|
664
|
-
instance.addRows(rows, true);
|
|
665
|
-
} else {
|
|
666
|
-
this.$message.error("\u6DFB\u52A0\u5B50\u8868\u6570\u636E,\u53C2\u6570\u4E0D\u8BC6\u522B!");
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
function clearThenAddRows(tbname, rows) {
|
|
670
|
-
clearSubRows(tbname);
|
|
671
|
-
addSubRows(tbname, rows);
|
|
672
|
-
}
|
|
673
|
-
function changeOptions(field, options) {
|
|
674
|
-
if (!options && options.length <= 0) {
|
|
675
|
-
options = [];
|
|
676
|
-
}
|
|
677
|
-
options.map((item) => {
|
|
678
|
-
if (!item.hasOwnProperty("label")) {
|
|
679
|
-
item["label"] = item.text;
|
|
680
|
-
}
|
|
681
|
-
});
|
|
682
|
-
updateSchema({
|
|
683
|
-
field,
|
|
684
|
-
componentProps: {
|
|
685
|
-
options
|
|
686
|
-
}
|
|
687
|
-
});
|
|
688
|
-
}
|
|
689
|
-
function customBeforeSubmit(that, formData) {
|
|
690
|
-
if (EnhanceJS && EnhanceJS["beforeSubmit"]) {
|
|
691
|
-
return EnhanceJS["beforeSubmit"](that, formData);
|
|
692
|
-
} else {
|
|
693
|
-
return Promise.resolve();
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
function handleCustomFormSh(show2, hide) {
|
|
697
|
-
let plain = toRaw(fieldDisplayStatus);
|
|
698
|
-
if (show2 && show2.length > 0) {
|
|
699
|
-
Object.keys(plain).map((k) => {
|
|
700
|
-
if (!k.endsWith("_load") && show2.indexOf(k) < 0) {
|
|
701
|
-
fieldDisplayStatus[k] = false;
|
|
702
|
-
}
|
|
703
|
-
});
|
|
704
|
-
} else if (hide && hide.length > 0) {
|
|
705
|
-
Object.keys(plain).map((k) => {
|
|
706
|
-
if (hide.indexOf(k) >= 0) {
|
|
707
|
-
fieldDisplayStatus[k] = false;
|
|
708
|
-
}
|
|
709
|
-
});
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
function handleCustomFormEdit(record, editSubmitUrl) {
|
|
713
|
-
return __async(this, null, function* () {
|
|
714
|
-
console.log("\u81EA\u5B9A\u4E49\u5F39\u7A97\u6253\u5F00online\u8868\u5355\u300B\u300Bform", record);
|
|
715
|
-
customEditSubmitUrl.value = editSubmitUrl;
|
|
716
|
-
yield resetFields();
|
|
717
|
-
dbData.value = "";
|
|
718
|
-
isUpdate.value = true;
|
|
719
|
-
yield edit(record);
|
|
720
|
-
yield nextTick(() => {
|
|
721
|
-
handleCgButtonClick("js", "loaded");
|
|
722
|
-
});
|
|
723
|
-
});
|
|
724
|
-
}
|
|
725
|
-
function getSubTableInstance(tableName2) {
|
|
726
|
-
let instance = refMap[tableName2].value;
|
|
727
|
-
if (instance instanceof Array) {
|
|
728
|
-
instance = instance[0];
|
|
729
|
-
}
|
|
730
|
-
if (!instance) {
|
|
731
|
-
$message.warning("\u5B50\u8868ref\u627E\u4E0D\u5230:" + tableName2);
|
|
732
|
-
return;
|
|
733
|
-
}
|
|
734
|
-
return instance;
|
|
735
|
-
}
|
|
736
|
-
function onOpenReportPrint() {
|
|
737
|
-
let url = onlineExtConfigJson.reportPrintUrl;
|
|
738
|
-
let id = dbData.value.id;
|
|
739
|
-
let token = getToken();
|
|
740
|
-
goJmReportViewPage(url, id, token);
|
|
741
|
-
}
|
|
742
|
-
const [registerPopModal, { openModal: openPopModal }] = useModal();
|
|
743
|
-
const popTableName = ref("");
|
|
744
|
-
const popModalRequest = ref(true);
|
|
745
|
-
function openSubFormModalForAdd(sub) {
|
|
746
|
-
console.log("openSubFormModalForAdd", sub);
|
|
747
|
-
popTableName.value = sub.id;
|
|
748
|
-
popModalRequest.value = false;
|
|
749
|
-
openPopModal(true, { isUpdate: false, tableType: "3" });
|
|
750
|
-
}
|
|
751
|
-
function openSubFormModalForEdit(sub) {
|
|
752
|
-
let ref2 = getSubTableInstance(sub.key);
|
|
753
|
-
let arr = ref2.getSelectedData();
|
|
754
|
-
if (arr.length != 1) {
|
|
755
|
-
$message.warning("\u8BF7\u9009\u62E9\u4E00\u6761\u6570\u636E");
|
|
756
|
-
return;
|
|
757
|
-
}
|
|
758
|
-
popTableName.value = sub.id;
|
|
759
|
-
popModalRequest.value = false;
|
|
760
|
-
openPopModal(true, { isUpdate: true, record: arr[0] });
|
|
761
|
-
}
|
|
762
|
-
function getPopFormData(data) {
|
|
763
|
-
const tableName2 = data[ONL_FORM_TABLE_NAME];
|
|
764
|
-
let record = omit(data, [ONL_FORM_TABLE_NAME]);
|
|
765
|
-
if (record.id) {
|
|
766
|
-
let values = omit(__spreadValues({}, record), "id");
|
|
767
|
-
let arr = [{ rowKey: record.id, values }];
|
|
768
|
-
let instance = getSubTableInstance(tableName2);
|
|
769
|
-
instance.setValues(arr);
|
|
770
|
-
} else {
|
|
771
|
-
let instance = getSubTableInstance(tableName2);
|
|
772
|
-
instance.addRows(record, { isOnlineJS: false, setActive: false, emitChange: true, isModalData: true });
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
function onCloseModal() {
|
|
776
|
-
let arr = subTabInfo.value;
|
|
777
|
-
if (arr && arr.length > 0) {
|
|
778
|
-
for (let item of arr) {
|
|
779
|
-
if (item.relationType == 1)
|
|
780
|
-
;
|
|
781
|
-
else {
|
|
782
|
-
let inst = getSubTableInstance(item.key);
|
|
783
|
-
if (inst) {
|
|
784
|
-
inst.clearSelection();
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
function executeMainFillRule() {
|
|
791
|
-
let formData = getFieldsValue();
|
|
792
|
-
let fieldProperties = toRaw(defaultValueFields[tableName.value]);
|
|
793
|
-
loadFormFieldsDefVal(fieldProperties, (values) => {
|
|
794
|
-
setFieldsValue(values);
|
|
795
|
-
}, formData);
|
|
796
|
-
}
|
|
797
|
-
function executeSubFillRule(subKey, $event) {
|
|
798
|
-
let subList = subTabInfo.value;
|
|
799
|
-
if (subList && subList.length > 0) {
|
|
800
|
-
let arr = subList.filter((sub) => sub.key === subKey);
|
|
801
|
-
if (arr.length == 0) {
|
|
802
|
-
console.error("\u6CA1\u627E\u5230\u4E0E\u4E4B\u5339\u914D\u7684\u5B50\u8868", subKey);
|
|
803
|
-
return;
|
|
804
|
-
}
|
|
805
|
-
if (arr[0].relationType == 1) {
|
|
806
|
-
let subInstance = getSubTableInstance(subKey);
|
|
807
|
-
subInstance.executeFillRule();
|
|
808
|
-
} else {
|
|
809
|
-
let subFieldProperties = toRaw(defaultValueFields[subKey]);
|
|
810
|
-
let row = toRaw($event.row);
|
|
811
|
-
loadFormFieldsDefVal(subFieldProperties, (values) => {
|
|
812
|
-
const { row: row2, target } = $event;
|
|
813
|
-
let v = [{ rowKey: row2.id, values: __spreadValues({}, values) }];
|
|
814
|
-
target.setValues(v);
|
|
815
|
-
}, row);
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
}
|
|
819
|
-
let context = {
|
|
820
|
-
tableName,
|
|
821
|
-
loading,
|
|
822
|
-
subActiveKey,
|
|
823
|
-
onlineFormRef,
|
|
824
|
-
getFieldsValue,
|
|
825
|
-
setFieldsValue,
|
|
826
|
-
submitFlowFlag,
|
|
827
|
-
subFormHeight,
|
|
828
|
-
subTableHeight,
|
|
829
|
-
refMap,
|
|
830
|
-
triggleChangeValues,
|
|
831
|
-
triggleChangeValue,
|
|
832
|
-
sh: fieldDisplayStatus,
|
|
833
|
-
clearSubRows,
|
|
834
|
-
addSubRows,
|
|
835
|
-
clearThenAddRows,
|
|
836
|
-
changeOptions,
|
|
837
|
-
isUpdate,
|
|
838
|
-
getSubTableInstance,
|
|
839
|
-
updateSchema,
|
|
840
|
-
executeMainFillRule,
|
|
841
|
-
executeSubFillRule,
|
|
842
|
-
changEvent: () => {
|
|
843
|
-
},
|
|
844
|
-
onlineFormValueChange
|
|
845
|
-
};
|
|
846
|
-
resetContext(context);
|
|
847
|
-
return {
|
|
848
|
-
tableName,
|
|
849
|
-
onlineFormRef,
|
|
850
|
-
registerForm,
|
|
851
|
-
loading,
|
|
852
|
-
subActiveKey,
|
|
853
|
-
hasSubTable,
|
|
854
|
-
subTabInfo,
|
|
855
|
-
refMap,
|
|
856
|
-
subFormHeight,
|
|
857
|
-
getSubTableForeignKeyValue,
|
|
858
|
-
isUpdate,
|
|
859
|
-
handleSubFormChange,
|
|
860
|
-
subTableHeight,
|
|
861
|
-
onlineFormDisabled,
|
|
862
|
-
subDataSource,
|
|
863
|
-
getSubTableAuthPre,
|
|
864
|
-
handleAdded,
|
|
865
|
-
handleSubTableDefaultValue,
|
|
866
|
-
handleValueChange,
|
|
867
|
-
openSubFormModalForAdd,
|
|
868
|
-
openSubFormModalForEdit,
|
|
869
|
-
show,
|
|
870
|
-
createRootProperties,
|
|
871
|
-
handleSubmit,
|
|
872
|
-
sh: fieldDisplayStatus,
|
|
873
|
-
handleCgButtonClick,
|
|
874
|
-
handleCustomFormSh,
|
|
875
|
-
handleCustomFormEdit,
|
|
876
|
-
dbData,
|
|
877
|
-
onOpenReportPrint,
|
|
878
|
-
onlineExtConfigJson,
|
|
879
|
-
registerPopModal,
|
|
880
|
-
popTableName,
|
|
881
|
-
getPopFormData,
|
|
882
|
-
popModalRequest,
|
|
883
|
-
onCloseModal
|
|
884
|
-
};
|
|
885
|
-
}
|
|
886
|
-
};
|
|
887
|
-
const _hoisted_1 = ["id"];
|
|
888
|
-
const _hoisted_2 = {
|
|
889
|
-
key: 0,
|
|
890
|
-
style: { "text-align": "right", "position": "absolute", "top": "6px", "right": "20px", "z-index": "999" }
|
|
891
|
-
};
|
|
892
|
-
const _hoisted_3 = { key: 1 };
|
|
893
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
894
|
-
const _component_PrinterOutlined = resolveComponent("PrinterOutlined");
|
|
895
|
-
const _component_BasicForm = resolveComponent("BasicForm");
|
|
896
|
-
const _component_online_sub_form = resolveComponent("online-sub-form");
|
|
897
|
-
const _component_diff_outlined = resolveComponent("diff-outlined");
|
|
898
|
-
const _component_a_button = resolveComponent("a-button");
|
|
899
|
-
const _component_form_outlined = resolveComponent("form-outlined");
|
|
900
|
-
const _component_JVxeTable = resolveComponent("JVxeTable");
|
|
901
|
-
const _component_a_tab_pane = resolveComponent("a-tab-pane");
|
|
902
|
-
const _component_a_tabs = resolveComponent("a-tabs");
|
|
903
|
-
const _component_Loading = resolveComponent("Loading");
|
|
904
|
-
const _component_online_pop_modal = resolveComponent("online-pop-modal");
|
|
905
|
-
return openBlock(), createElementBlock("div", {
|
|
906
|
-
id: $setup.tableName + "_form"
|
|
907
|
-
}, [
|
|
908
|
-
!!$setup.dbData.id && !!$setup.onlineExtConfigJson.reportPrintShow ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
909
|
-
createVNode(_component_PrinterOutlined, {
|
|
910
|
-
title: "\u6253\u5370",
|
|
911
|
-
onClick: $setup.onOpenReportPrint,
|
|
912
|
-
style: { "font-size": "16px" }
|
|
913
|
-
}, null, 8, ["onClick"])
|
|
914
|
-
])) : createCommentVNode("", true),
|
|
915
|
-
createVNode(_component_BasicForm, {
|
|
916
|
-
ref: "onlineFormRef",
|
|
917
|
-
onRegister: $setup.registerForm
|
|
918
|
-
}, null, 8, ["onRegister"]),
|
|
919
|
-
$setup.hasSubTable ? (openBlock(), createBlock(_component_a_tabs, {
|
|
920
|
-
key: 1,
|
|
921
|
-
activeKey: $setup.subActiveKey,
|
|
922
|
-
"onUpdate:activeKey": _cache[0] || (_cache[0] = ($event) => $setup.subActiveKey = $event)
|
|
923
|
-
}, {
|
|
924
|
-
default: withCtx(() => [
|
|
925
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList($setup.subTabInfo, (sub, index) => {
|
|
926
|
-
return openBlock(), createBlock(_component_a_tab_pane, {
|
|
927
|
-
tab: sub.describe,
|
|
928
|
-
key: index + "",
|
|
929
|
-
forceRender: true
|
|
930
|
-
}, {
|
|
931
|
-
default: withCtx(() => [
|
|
932
|
-
sub.relationType == 1 ? (openBlock(), createElementBlock("div", {
|
|
933
|
-
key: 0,
|
|
934
|
-
style: normalizeStyle({ "overflow-y": "auto", "overflow-x": "hidden", "max-height": $setup.subFormHeight + "px" })
|
|
935
|
-
}, [
|
|
936
|
-
createVNode(_component_online_sub_form, {
|
|
937
|
-
ref_for: true,
|
|
938
|
-
ref: $setup.refMap[sub.key],
|
|
939
|
-
table: sub.key,
|
|
940
|
-
disabled: $setup.onlineFormDisabled,
|
|
941
|
-
"form-template": $props.formTemplate,
|
|
942
|
-
"main-id": $setup.getSubTableForeignKeyValue(sub.foreignKey),
|
|
943
|
-
properties: sub.properties,
|
|
944
|
-
"required-fields": sub.requiredFields,
|
|
945
|
-
"is-update": $setup.isUpdate,
|
|
946
|
-
onFormChange: (arg) => $setup.handleSubFormChange(arg, sub.key)
|
|
947
|
-
}, null, 8, ["table", "disabled", "form-template", "main-id", "properties", "required-fields", "is-update", "onFormChange"])
|
|
948
|
-
], 4)) : (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
949
|
-
createVNode(_component_JVxeTable, {
|
|
950
|
-
ref_for: true,
|
|
951
|
-
ref: $setup.refMap[sub.key],
|
|
952
|
-
toolbar: "",
|
|
953
|
-
"keep-source": "",
|
|
954
|
-
"row-number": "",
|
|
955
|
-
"row-selection": "",
|
|
956
|
-
height: $setup.subTableHeight,
|
|
957
|
-
disabled: $setup.onlineFormDisabled,
|
|
958
|
-
columns: sub.columns,
|
|
959
|
-
dataSource: $setup.subDataSource[sub.key],
|
|
960
|
-
onValueChange: (event) => $setup.handleValueChange(event, sub.key),
|
|
961
|
-
authPre: $setup.getSubTableAuthPre(sub.key),
|
|
962
|
-
onAdded: ($event) => $setup.handleAdded(sub, $event),
|
|
963
|
-
onExecuteFillRule: ($event) => $setup.handleSubTableDefaultValue(sub, $event)
|
|
964
|
-
}, {
|
|
965
|
-
toolbarSuffix: withCtx(() => [
|
|
966
|
-
createVNode(_component_a_button, {
|
|
967
|
-
type: "primary",
|
|
968
|
-
onClick: ($event) => $setup.openSubFormModalForAdd(sub)
|
|
969
|
-
}, {
|
|
970
|
-
default: withCtx(() => [
|
|
971
|
-
createVNode(_component_diff_outlined)
|
|
972
|
-
]),
|
|
973
|
-
_: 2
|
|
974
|
-
}, 1032, ["onClick"]),
|
|
975
|
-
createVNode(_component_a_button, {
|
|
976
|
-
type: "primary",
|
|
977
|
-
onClick: ($event) => $setup.openSubFormModalForEdit(sub)
|
|
978
|
-
}, {
|
|
979
|
-
default: withCtx(() => [
|
|
980
|
-
createVNode(_component_form_outlined)
|
|
981
|
-
]),
|
|
982
|
-
_: 2
|
|
983
|
-
}, 1032, ["onClick"])
|
|
984
|
-
]),
|
|
985
|
-
_: 2
|
|
986
|
-
}, 1032, ["height", "disabled", "columns", "dataSource", "onValueChange", "authPre", "onAdded", "onExecuteFillRule"])
|
|
987
|
-
]))
|
|
988
|
-
]),
|
|
989
|
-
_: 2
|
|
990
|
-
}, 1032, ["tab"]);
|
|
991
|
-
}), 128))
|
|
992
|
-
]),
|
|
993
|
-
_: 1
|
|
994
|
-
}, 8, ["activeKey"])) : createCommentVNode("", true),
|
|
995
|
-
createVNode(_component_Loading, {
|
|
996
|
-
loading: $setup.loading,
|
|
997
|
-
absolute: false
|
|
998
|
-
}, null, 8, ["loading"]),
|
|
999
|
-
renderSlot(_ctx.$slots, "bottom"),
|
|
1000
|
-
createVNode(_component_online_pop_modal, {
|
|
1001
|
-
formTableType: "3",
|
|
1002
|
-
request: $setup.popModalRequest,
|
|
1003
|
-
id: $setup.popTableName,
|
|
1004
|
-
onRegister: $setup.registerPopModal,
|
|
1005
|
-
onSuccess: $setup.getPopFormData,
|
|
1006
|
-
topTip: "",
|
|
1007
|
-
isVxeTableData: ""
|
|
1008
|
-
}, null, 8, ["request", "id", "onRegister", "onSuccess"])
|
|
1009
|
-
], 8, _hoisted_1);
|
|
1010
|
-
}
|
|
1011
|
-
var OnlineForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
1012
|
-
var OnlineForm$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1013
|
-
__proto__: null,
|
|
1014
|
-
"default": OnlineForm
|
|
1015
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1016
|
-
export { GET_FUN_BODY_REG as G, OnlineForm as O, OnlineForm$1 as a, useCustomHook as u };
|