@jeecg/online 1.0.1
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 +140 -0
- package/AuthButtonTree.js +183 -0
- package/AuthDataConfig.js +243 -0
- package/AuthDataTree.js +160 -0
- package/AuthFieldConfig.js +167 -0
- package/AuthFieldTree.js +273 -0
- package/AuthManagerDrawer.js +125 -0
- package/AuthSetterModal.js +317 -0
- package/CgformCopyList.js +253 -0
- package/CgformModal.js +748 -0
- package/CgreportModal.js +673 -0
- package/ChartAutoRender.js +69 -0
- package/ChartDoubleRender.js +154 -0
- package/ChartSingleRender.js +132 -0
- package/ChartTabsRender.js +218 -0
- package/CheckDictTable.js +121 -0
- package/CodeGeneratorModal.js +293 -0
- package/CustomButtonList.js +413 -0
- package/DBAttributeTable.js +278 -0
- package/DbToOnlineModal.js +190 -0
- package/EnhanceJavaModal.js +304 -0
- package/EnhanceJsHistory.js +231 -0
- package/EnhanceJsModal.js +293 -0
- package/EnhanceSqlModal.js +305 -0
- package/ErrorTip.js +21 -0
- package/ExtendConfigModal.js +142 -0
- package/FieldTable.js +185 -0
- package/FileSelectModal.js +102 -0
- package/ForeignKeyTable.js +78 -0
- package/FormSchemaFactory.js +938 -0
- package/GraphreportAutoChart.js +352 -0
- package/GraphreportList.js +239 -0
- package/GraphreportModal.js +559 -0
- package/IndexTable.js +96 -0
- package/JOnlineSearchSelect.js +107 -0
- package/LICENSE +7 -0
- package/LeftDepart.js +96 -0
- package/LeftRole.js +95 -0
- package/LeftUser.js +114 -0
- package/ModalFormDemo.js +84 -0
- package/OnlineAutoList.js +410 -0
- package/OnlineAutoModal.js +265 -0
- package/OnlineAutoTreeList.js +513 -0
- package/OnlineCustomModal.js +269 -0
- package/OnlineForm.js +809 -0
- package/OnlineQueryForm.js +442 -0
- package/OnlineSearchFormItem.js +428 -0
- package/OnlineSelectCascade.js +217 -0
- package/OnlineSubForm.js +200 -0
- package/OnlineSuperQuery.js +912 -0
- package/OnlineSuperQueryValComponent.js +8 -0
- package/OnlineSuperQueryValComponent.vue_vue_type_script_lang.js +172 -0
- package/PageAttributeTable.js +242 -0
- package/ParamsTable.js +71 -0
- package/ProcessOnlineForm.js +183 -0
- package/QueryTable.js +128 -0
- package/README.md +23 -0
- package/_arrayPush.js +276 -0
- package/auth.api.js +43 -0
- package/auth.data.js +144 -0
- package/cgform.data.js +235 -0
- package/cloneDeep.js +475 -0
- package/enhance.api.js +120 -0
- package/enhance.data.js +196 -0
- package/graphreport.api.js +23 -0
- package/index.js +64 -0
- package/index2.js +336 -0
- package/index3.js +799 -0
- package/isArray.js +47 -0
- package/main.index.js +6 -0
- package/package.json +6 -0
- package/pick.js +238 -0
- package/style.css +1 -0
- package/toString.js +31 -0
- package/useAutoForm.js +4274 -0
- package/useCgformList.js +353 -0
- package/useChartRender.js +405 -0
- package/useMessageOnline.js +71 -0
- package/useOnlineTest.js +26866 -0
- package/useSchemas.js +505 -0
- package/useTableColumns.js +1154 -0
- package/useTableSync.js +105 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { defineComponent, ref, nextTick, watch, reactive, markRaw, defineAsyncComponent, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createVNode, resolveDynamicComponent, createTextVNode } from "vue";
|
|
22
|
+
import { BasicModal, useModalInner } from "/@/components/Modal";
|
|
23
|
+
import { g as getRefPromise } from "./useAutoForm.js";
|
|
24
|
+
import { defHttp } from "/@/utils/http/axios";
|
|
25
|
+
import { O as OnlineForm } from "./OnlineForm.js";
|
|
26
|
+
import { _ as _export_sfc } from "./index.js";
|
|
27
|
+
import "./FormSchemaFactory.js";
|
|
28
|
+
import "/@/components/Form/src/jeecg/components/JUpload";
|
|
29
|
+
import "/@/views/system/user/user.api";
|
|
30
|
+
import "/@/store/modules/user";
|
|
31
|
+
import "/@/utils";
|
|
32
|
+
import "/@/utils/desform/customExpression";
|
|
33
|
+
import "/@/components/Form/src/componentMap";
|
|
34
|
+
import "./OnlineSelectCascade.js";
|
|
35
|
+
import "/@/hooks/web/useMessage";
|
|
36
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
37
|
+
import "vue-router";
|
|
38
|
+
import "/@/components/Form/index";
|
|
39
|
+
import "/@/components/Loading";
|
|
40
|
+
import "./OnlineSubForm.js";
|
|
41
|
+
import "./pick.js";
|
|
42
|
+
import "./isArray.js";
|
|
43
|
+
import "./toString.js";
|
|
44
|
+
import "./_arrayPush.js";
|
|
45
|
+
const DEF_CONFIG = {
|
|
46
|
+
code: "",
|
|
47
|
+
title: "\u81EA\u5B9A\u4E49\u5F39\u6846",
|
|
48
|
+
width: 600,
|
|
49
|
+
row: {},
|
|
50
|
+
hide: [],
|
|
51
|
+
show: [],
|
|
52
|
+
requestUrl: "",
|
|
53
|
+
tableType: "",
|
|
54
|
+
foreignKeys: "",
|
|
55
|
+
formComponent: ""
|
|
56
|
+
};
|
|
57
|
+
const _sfc_main = defineComponent({
|
|
58
|
+
name: "OnlineCustomModal",
|
|
59
|
+
components: {
|
|
60
|
+
OnlineForm,
|
|
61
|
+
BasicModal
|
|
62
|
+
},
|
|
63
|
+
setup(_props, { emit }) {
|
|
64
|
+
const onlineFormCompRef = ref();
|
|
65
|
+
const id = ref("");
|
|
66
|
+
const title = ref("\u81EA\u5B9A\u4E49\u5F39\u6846");
|
|
67
|
+
const width = ref(600);
|
|
68
|
+
let onlineHideFields = [];
|
|
69
|
+
let onlineShowFields = [];
|
|
70
|
+
let onlineFormEditUrl = "";
|
|
71
|
+
let currentRowData = {};
|
|
72
|
+
const url = {
|
|
73
|
+
loadFormItems: "/online/cgform/api/getFormItem/",
|
|
74
|
+
optPre: "/online/cgform/api/form/"
|
|
75
|
+
};
|
|
76
|
+
const modalStyle = { "position": "relative" };
|
|
77
|
+
const confirmLoading = ref(false);
|
|
78
|
+
const formRendered = ref(false);
|
|
79
|
+
function renderSuccess() {
|
|
80
|
+
formRendered.value = true;
|
|
81
|
+
}
|
|
82
|
+
const isOnlineForm = ref(true);
|
|
83
|
+
const [registerModal, { setModalProps, closeModal }] = useModalInner((params) => __async(this, null, function* () {
|
|
84
|
+
setModalProps({ confirmLoading: false });
|
|
85
|
+
resetParams(params);
|
|
86
|
+
yield nextTick(() => __async(this, null, function* () {
|
|
87
|
+
if (!params.formComponent) {
|
|
88
|
+
yield showOnlineForm();
|
|
89
|
+
} else {
|
|
90
|
+
showCustomForm(params.formComponent);
|
|
91
|
+
}
|
|
92
|
+
}));
|
|
93
|
+
}));
|
|
94
|
+
function resetParams(params) {
|
|
95
|
+
let options = Object.assign({}, DEF_CONFIG, params);
|
|
96
|
+
id.value = options.code;
|
|
97
|
+
title.value = options.title;
|
|
98
|
+
width.value = options.width;
|
|
99
|
+
onlineHideFields = options.hide || [];
|
|
100
|
+
onlineShowFields = options.show || [];
|
|
101
|
+
onlineFormEditUrl = getOnlineFormEditUrl(options.requestUrl);
|
|
102
|
+
currentRowData = options.row;
|
|
103
|
+
}
|
|
104
|
+
function getOnlineFormEditUrl(requestUrl) {
|
|
105
|
+
if (requestUrl) {
|
|
106
|
+
return requestUrl;
|
|
107
|
+
} else {
|
|
108
|
+
return url.optPre + id.value;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const submitLoading = ref(false);
|
|
112
|
+
function handleSubmit() {
|
|
113
|
+
submitLoading.value = true;
|
|
114
|
+
if (isOnlineForm.value === true) {
|
|
115
|
+
onlineFormCompRef.value.handleSubmit();
|
|
116
|
+
} else {
|
|
117
|
+
customFormRef.value.handleSubmit();
|
|
118
|
+
}
|
|
119
|
+
setTimeout(() => {
|
|
120
|
+
submitLoading.value = true;
|
|
121
|
+
}, 3500);
|
|
122
|
+
}
|
|
123
|
+
function handleCancel() {
|
|
124
|
+
closeModal();
|
|
125
|
+
}
|
|
126
|
+
function handleSuccess(formData) {
|
|
127
|
+
emit("success", formData);
|
|
128
|
+
closeModal();
|
|
129
|
+
}
|
|
130
|
+
function showOnlineForm() {
|
|
131
|
+
return __async(this, null, function* () {
|
|
132
|
+
isOnlineForm.value = true;
|
|
133
|
+
yield getRefPromise(formRendered);
|
|
134
|
+
onlineFormCompRef.value.handleCustomFormSh(onlineShowFields, onlineHideFields);
|
|
135
|
+
onlineFormCompRef.value.handleCustomFormEdit(currentRowData, onlineFormEditUrl);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
const formTemplate = ref(1);
|
|
139
|
+
watch(id, renderFormItems, { immediate: true });
|
|
140
|
+
function renderFormItems() {
|
|
141
|
+
return __async(this, null, function* () {
|
|
142
|
+
formRendered.value = false;
|
|
143
|
+
if (!id.value) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
console.log("\u91CD\u65B0\u6E32\u67D3\u8868\u5355\u300B\u300B\u300B\u300Bmodal");
|
|
147
|
+
let result = yield loadFormItems();
|
|
148
|
+
let dataFormTemplate = result.head.formTemplate;
|
|
149
|
+
formTemplate.value = dataFormTemplate ? Number(dataFormTemplate) : 1;
|
|
150
|
+
nextTick(() => __async(this, null, function* () {
|
|
151
|
+
let myForm = yield getRefPromise(onlineFormCompRef);
|
|
152
|
+
myForm.createRootProperties(result);
|
|
153
|
+
}));
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function loadFormItems() {
|
|
157
|
+
let url2 = `/online/cgform/api/getFormItem/${id.value}`;
|
|
158
|
+
return new Promise((resolve, reject) => {
|
|
159
|
+
defHttp.get({ url: url2 }, { isTransformResponse: false }).then((res) => {
|
|
160
|
+
console.log("\u8868\u5355\u7ED3\u679C\u300B\u300Bmodal:", res);
|
|
161
|
+
if (res.success) {
|
|
162
|
+
resolve(res.result);
|
|
163
|
+
} else {
|
|
164
|
+
reject(res.message);
|
|
165
|
+
}
|
|
166
|
+
}).catch(() => {
|
|
167
|
+
reject();
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
const customFormRef = ref();
|
|
172
|
+
const customFormComponent = reactive({
|
|
173
|
+
url: "",
|
|
174
|
+
is: "",
|
|
175
|
+
row: {}
|
|
176
|
+
});
|
|
177
|
+
function showCustomForm(formComponent) {
|
|
178
|
+
isOnlineForm.value = false;
|
|
179
|
+
customFormComponent.url = onlineFormEditUrl;
|
|
180
|
+
customFormComponent.row = currentRowData;
|
|
181
|
+
customFormComponent.is = markRaw(defineAsyncComponent(() => import(
|
|
182
|
+
/* @vite-ignore */
|
|
183
|
+
"/@/views/" + formComponent
|
|
184
|
+
)));
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
registerModal,
|
|
188
|
+
title,
|
|
189
|
+
width,
|
|
190
|
+
modalStyle,
|
|
191
|
+
handleSubmit,
|
|
192
|
+
handleCancel,
|
|
193
|
+
id,
|
|
194
|
+
onlineFormCompRef,
|
|
195
|
+
formTemplate,
|
|
196
|
+
renderSuccess,
|
|
197
|
+
customFormRef,
|
|
198
|
+
customFormComponent,
|
|
199
|
+
open,
|
|
200
|
+
isOnlineForm,
|
|
201
|
+
confirmLoading,
|
|
202
|
+
submitLoading,
|
|
203
|
+
handleSuccess
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
const _hoisted_1 = /* @__PURE__ */ createTextVNode("\u786E\u5B9A");
|
|
208
|
+
const _hoisted_2 = /* @__PURE__ */ createTextVNode("\u5173\u95ED");
|
|
209
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
210
|
+
const _component_a_button = resolveComponent("a-button");
|
|
211
|
+
const _component_online_form = resolveComponent("online-form");
|
|
212
|
+
const _component_a_spin = resolveComponent("a-spin");
|
|
213
|
+
const _component_BasicModal = resolveComponent("BasicModal");
|
|
214
|
+
return openBlock(), createBlock(_component_BasicModal, mergeProps({
|
|
215
|
+
title: _ctx.title,
|
|
216
|
+
width: _ctx.width
|
|
217
|
+
}, _ctx.$attrs, {
|
|
218
|
+
style: _ctx.modalStyle,
|
|
219
|
+
onRegister: _ctx.registerModal,
|
|
220
|
+
wrapClassName: "jeecg-online-modal",
|
|
221
|
+
onOk: _ctx.handleSubmit
|
|
222
|
+
}), {
|
|
223
|
+
footer: withCtx(() => [
|
|
224
|
+
createVNode(_component_a_button, {
|
|
225
|
+
key: "submit",
|
|
226
|
+
type: "primary",
|
|
227
|
+
onClick: _ctx.handleSubmit
|
|
228
|
+
}, {
|
|
229
|
+
default: withCtx(() => [
|
|
230
|
+
_hoisted_1
|
|
231
|
+
]),
|
|
232
|
+
_: 1
|
|
233
|
+
}, 8, ["onClick"]),
|
|
234
|
+
createVNode(_component_a_button, {
|
|
235
|
+
key: "back",
|
|
236
|
+
onClick: _ctx.handleCancel
|
|
237
|
+
}, {
|
|
238
|
+
default: withCtx(() => [
|
|
239
|
+
_hoisted_2
|
|
240
|
+
]),
|
|
241
|
+
_: 1
|
|
242
|
+
}, 8, ["onClick"])
|
|
243
|
+
]),
|
|
244
|
+
default: withCtx(() => [
|
|
245
|
+
createVNode(_component_a_spin, { spinning: _ctx.confirmLoading }, {
|
|
246
|
+
default: withCtx(() => [
|
|
247
|
+
_ctx.isOnlineForm ? (openBlock(), createBlock(_component_online_form, {
|
|
248
|
+
key: 0,
|
|
249
|
+
ref: "onlineFormCompRef",
|
|
250
|
+
id: _ctx.id,
|
|
251
|
+
"form-template": _ctx.formTemplate,
|
|
252
|
+
onRendered: _ctx.renderSuccess,
|
|
253
|
+
onSuccess: _ctx.handleSuccess
|
|
254
|
+
}, null, 8, ["id", "form-template", "onRendered", "onSuccess"])) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.customFormComponent.is), {
|
|
255
|
+
key: 1,
|
|
256
|
+
ref: "customFormRef",
|
|
257
|
+
url: _ctx.customFormComponent.url,
|
|
258
|
+
row: _ctx.customFormComponent.row,
|
|
259
|
+
onClose: _ctx.handleSuccess
|
|
260
|
+
}, null, 40, ["url", "row", "onClose"]))
|
|
261
|
+
]),
|
|
262
|
+
_: 1
|
|
263
|
+
}, 8, ["spinning"])
|
|
264
|
+
]),
|
|
265
|
+
_: 1
|
|
266
|
+
}, 16, ["title", "width", "style", "onRegister", "onOk"]);
|
|
267
|
+
}
|
|
268
|
+
var OnlineCustomModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
269
|
+
export { OnlineCustomModal as default };
|