@jeecg/online 3.8.2-beta → 3.9.0-beta2
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/{AccountLoginForm-79fa7b01.mjs → AccountLoginForm-634a76b1.mjs} +1 -1
- package/{AiModal-942b59ec.mjs → AiModal-204a2146.mjs} +1 -1
- package/{AppForgetPassword-d762e5b3.mjs → AppForgetPassword-f9a6258a.mjs} +2 -2
- package/{AppLogin-41372985.mjs → AppLogin-bf783eab.mjs} +9 -9
- package/{AppLoginHeader-3b6fa33d.mjs → AppLoginHeader-55594326.mjs} +1 -1
- package/{AppNameEmail-8dfbad62.mjs → AppNameEmail-54026ea8.mjs} +2 -2
- package/{AppRegister-433c54db.mjs → AppRegister-043efc45.mjs} +3 -3
- package/{AppTenant-e49dfa9b.mjs → AppTenant-c7bb8700.mjs} +2 -2
- package/{AppThirdForm-7b75b4fc.mjs → AppThirdForm-5e7e1144.mjs} +1 -1
- package/{AuthButtonConfig-a0f59cb5.mjs → AuthButtonConfig-4887be0d.mjs} +1 -1
- package/{AuthButtonTree-f0a5cc0b.mjs → AuthButtonTree-7e47b44b.mjs} +1 -1
- package/{AuthDataConfig-647c4a27.mjs → AuthDataConfig-3cd10ca2.mjs} +1 -1
- package/{AuthDataTree-b80a3ea5.mjs → AuthDataTree-714c259c.mjs} +1 -1
- package/{AuthFieldConfig-d36a1b2d.mjs → AuthFieldConfig-bb65f78b.mjs} +1 -1
- package/{AuthFieldTree-dba6af79.mjs → AuthFieldTree-3e38b12b.mjs} +1 -1
- package/{AuthManagerDrawer-5acbd451.mjs → AuthManagerDrawer-dee39b07.mjs} +4 -4
- package/{AuthSetterModal-95b5f616.mjs → AuthSetterModal-f176c221.mjs} +7 -7
- package/{CgformAddressModal-5d889870.mjs → CgformAddressModal-a3903b24.mjs} +1 -1
- package/{CgformCopyList-cc5f76cd.mjs → CgformCopyList-4be1000f.mjs} +37 -37
- package/{CgformModal-cebc698b.mjs → CgformModal-115710a6.mjs} +10 -10
- package/{CgreportAigcModal-d1e62385.mjs → CgreportAigcModal-3bef8abe.mjs} +1 -1
- package/{CgreportModal-2e4421e6.mjs → CgreportModal-0cc48587.mjs} +143 -139
- package/{CheckDictTable-8fb7299c.mjs → CheckDictTable-65157c48.mjs} +1 -1
- package/{CodeFileListModal-25fad54f.mjs → CodeFileListModal-305c1a62.mjs} +2 -2
- package/CodeFileViewModal-320d7acf.mjs +269 -0
- package/CodeGeneratorModal-2ba18bd1.mjs +298 -0
- package/{CustomButtonList-26490688.mjs → CustomButtonList-98db8fd2.mjs} +1 -1
- package/{DBAttributeTable-dea8ab11.mjs → DBAttributeTable-56701599.mjs} +40 -39
- package/{DbToOnlineModal-60317a16.mjs → DbToOnlineModal-a82cdeb5.mjs} +1 -1
- package/{DetailForm-b92a5e9d.mjs → DetailForm-7d4f630e.mjs} +163 -152
- package/{DropMenuItem-82213be6.mjs → DropMenuItem-b3a9cd6a.mjs} +1 -1
- package/{EnhanceJavaModal-6ebefc8b.mjs → EnhanceJavaModal-469e645e.mjs} +1 -1
- package/{EnhanceJsHistory-8d9b86ca.mjs → EnhanceJsHistory-bb6ba865.mjs} +1 -1
- package/{EnhanceJsModal-9439e6f8.mjs → EnhanceJsModal-b0527cbf.mjs} +2 -2
- package/{EnhanceSqlModal-ea4592bf.mjs → EnhanceSqlModal-c6e8bce1.mjs} +1 -1
- package/{ExtendConfigModal-f509db46.mjs → ExtendConfigModal-7b00b49a.mjs} +1 -1
- package/{FieldExtendJsonModal-73bab5b5.mjs → FieldExtendJsonModal-536e6d5b.mjs} +2 -2
- package/{FileSelectModal-49d6dade.mjs → FileSelectModal-eb026170.mjs} +1 -1
- package/{ForeignKeyTable-330963c1.mjs → ForeignKeyTable-97a5827f.mjs} +1 -1
- package/{IndexTable-c0478faa.mjs → IndexTable-4d350e4e.mjs} +1 -1
- package/{JModalTip-b1d19eaa.mjs → JModalTip-c3e6726c.mjs} +1 -1
- package/{JOnlineSearchSelect-97662e1b.mjs → JOnlineSearchSelect-ffeac61d.mjs} +1 -1
- package/{LeftDepart-4b1003f0.mjs → LeftDepart-a727aab7.mjs} +1 -1
- package/{LeftRole-8486ba4f.mjs → LeftRole-b533dcf6.mjs} +1 -1
- package/{LeftUser-09894a2f.mjs → LeftUser-aaac52cb.mjs} +1 -1
- package/{LinkTableConfigModal-cd0980e9.mjs → LinkTableConfigModal-4053b62d.mjs} +1 -1
- package/{LinkTableFieldConfigModal-f4106ab7.mjs → LinkTableFieldConfigModal-93552099.mjs} +1 -1
- package/{LinkTableListPiece-4187ad7d.mjs → LinkTableListPiece-0f4ca559.mjs} +1 -1
- package/{ModalFormDemo-4ec79769.mjs → ModalFormDemo-b8478356.mjs} +1 -1
- package/OnlCgformErpList-b0605798.mjs +527 -0
- package/{OnlCgformErpSubTable-421e2051.mjs → OnlCgformErpSubTable-89699bc9.mjs} +42 -41
- package/{OnlCgformInnerSubTable-9616ebf2.mjs → OnlCgformInnerSubTable-f2722f77.mjs} +105 -102
- package/{OnlCgformInnerTableList-5ed887e4.mjs → OnlCgformInnerTableList-992aa7e9.mjs} +20 -19
- package/{OnlCgformTabList-c03a1d0a.mjs → OnlCgformTabList-882a0e0c.mjs} +20 -19
- package/{OnlineAutoList-e5a61211.mjs → OnlineAutoList-caedb54a.mjs} +19 -18
- package/{OnlineAutoModal-38f2d522.mjs → OnlineAutoModal-a0d1a6b8.mjs} +7 -7
- package/{OnlineAutoTreeList-16fa962f.mjs → OnlineAutoTreeList-624106c1.mjs} +19 -18
- package/OnlineCustomModal-f4e17bed.mjs +246 -0
- package/{OnlineDetailModal-79085ba8.mjs → OnlineDetailModal-35394778.mjs} +44 -43
- package/OnlineForm-86b5966d.mjs +1079 -0
- package/OnlineFormDetail-4b3ad130.mjs +349 -0
- package/{OnlineFormUrlAdd-2e05ba0f.mjs → OnlineFormUrlAdd-708c91fb.mjs} +9 -9
- package/{OnlineFormUrlDetail-06b2d9e6.mjs → OnlineFormUrlDetail-5c8efaeb.mjs} +14 -13
- package/{OnlineFormUrlEdit-77ac4bba.mjs → OnlineFormUrlEdit-8f08474e.mjs} +9 -9
- package/{OnlineFormUrlSuccess-cb3f7be4.mjs → OnlineFormUrlSuccess-0c2431a4.mjs} +1 -1
- package/{OnlineQueryForm-528af6ed.mjs → OnlineQueryForm-3017a4ca.mjs} +119 -120
- package/{OnlineSearchFormItem-51eefaf4.mjs → OnlineSearchFormItem-1b54585f.mjs} +2 -2
- package/{OnlineSelectCascade-b218691c.mjs → OnlineSelectCascade-fab4426d.mjs} +61 -55
- package/{OnlineSubFormDetail-a1b7f33f.mjs → OnlineSubFormDetail-bbc48c3e.mjs} +48 -45
- package/{OnlineTabAutoModal-1c7c4ed2.mjs → OnlineTabAutoModal-b0f9fce8.mjs} +6 -6
- package/{OnlineTabDetailModal-7c45e727.mjs → OnlineTabDetailModal-401a26ad.mjs} +38 -37
- package/{OnlineTabForm-9682158f.mjs → OnlineTabForm-5c04cbc5.mjs} +22 -22
- package/OnlineTabFormDetail-2a28febf.mjs +328 -0
- package/{PageAttributeTable-21314341.mjs → PageAttributeTable-18aabf81.mjs} +5 -5
- package/{PhoneLoginForm-c3c16f16.mjs → PhoneLoginForm-4a9d7869.mjs} +18 -18
- package/ProcessOnlineForm-0ddce4fb.mjs +218 -0
- package/{QueryTable-413d1366.mjs → QueryTable-342fd89a.mjs} +1 -1
- package/{SetSwitchOptions-82fd6265.mjs → SetSwitchOptions-e1d5a6b4.mjs} +1 -1
- package/{ShareAddView-a2dba2ef.mjs → ShareAddView-a5154da3.mjs} +22 -21
- package/{ShareEditView-ecd590dc.mjs → ShareEditView-cf761cf3.mjs} +22 -21
- package/{ShareView-84f333e7.mjs → ShareView-3b2f5457.mjs} +20 -19
- package/{ShareView.vue_vue_type_script_setup_true_lang-9a3a259e.mjs → ShareView.vue_vue_type_script_setup_true_lang-9ea579c2.mjs} +2 -2
- package/{SingleView-d4f29169.mjs → SingleView-3cab20a9.mjs} +15 -14
- package/{SingleView.vue_vue_type_style_index_0_lang-40ea7e64.mjs → SingleView.vue_vue_type_style_index_0_lang-24d417dc.mjs} +4 -4
- package/{SuperQuery-290f5080.mjs → SuperQuery-270b0968.mjs} +39 -39
- package/TaskOpinionList-60cf4080.mjs +13 -0
- package/{aiModal-6e338c79.mjs → aiModal-e7362c3f.mjs} +2 -2
- package/{index-bc0d747e.mjs → index-6d1a78e2.mjs} +2 -2
- package/index-740b2c4a.mjs +57 -0
- package/{index-7bab525f.mjs → index-8fd12d0f.mjs} +3 -3
- package/{index-7890e2b4.mjs → index-b5fe9bd4.mjs} +1 -1
- package/{index-9bebbfe5.mjs → index-b811abb9.mjs} +2 -2
- package/{index-c5737cbb.mjs → index-d95bb7c2.mjs} +4 -4
- package/{index-254a82b7.mjs → index-e2c3e6f3.mjs} +129 -123
- package/main.index.js +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/useCgformList-6d5547ff.mjs +410 -0
- package/{useExtendComponent-d1db211d.mjs → useExtendComponent-95ce0719.mjs} +405 -405
- package/{useListButton-7f9674a0.mjs → useListButton-73071548.mjs} +21 -21
- package/CodeFileViewModal-12299ab5.mjs +0 -253
- package/CodeGeneratorModal-791b1695.mjs +0 -281
- package/OnlCgformErpList-63089149.mjs +0 -498
- package/OnlineCustomModal-7e31297e.mjs +0 -232
- package/OnlineForm-0438f4bf.mjs +0 -1012
- package/OnlineFormDetail-76d243ed.mjs +0 -348
- package/OnlineTabFormDetail-b8650175.mjs +0 -327
- package/ProcessOnlineForm-d6113dec.mjs +0 -188
- package/README.md +0 -26
- package/index-30c0a14f.mjs +0 -57
- package/useCgformList-52631580.mjs +0 -395
- /package/{OnlineForm.vue_vue_type_style_index_0_scoped_3f26e7bd_lang-4ed993c7.mjs → OnlineForm.vue_vue_type_style_index_0_scoped_60bd1850_lang-4ed993c7.mjs} +0 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
var D = (o, a, f) => new Promise((y, C) => {
|
|
2
|
+
var F = (r) => {
|
|
3
|
+
try {
|
|
4
|
+
c(f.next(r));
|
|
5
|
+
} catch (s) {
|
|
6
|
+
C(s);
|
|
7
|
+
}
|
|
8
|
+
}, E = (r) => {
|
|
9
|
+
try {
|
|
10
|
+
c(f.throw(r));
|
|
11
|
+
} catch (s) {
|
|
12
|
+
C(s);
|
|
13
|
+
}
|
|
14
|
+
}, c = (r) => r.done ? y(r.value) : Promise.resolve(r.value).then(F, E);
|
|
15
|
+
c((f = f.apply(o, a)).next());
|
|
16
|
+
});
|
|
17
|
+
import { defineComponent as Y, ref as p, reactive as X, resolveComponent as g, openBlock as L, createBlock as b, withCtx as w, createVNode as B, createTextVNode as V, createElementVNode as M, normalizeStyle as $, createCommentVNode as Q } from "vue";
|
|
18
|
+
import { defHttp as Z } from "/@/utils/http/axios";
|
|
19
|
+
import { BasicModal as ee, useModalInner as te } from "/@/components/Modal";
|
|
20
|
+
import { InfoCircleTwoTone as ne } from "@ant-design/icons-vue";
|
|
21
|
+
import { message as H } from "ant-design-vue";
|
|
22
|
+
import { JCodeEditor as oe } from "/@/components/Form";
|
|
23
|
+
import { useDesign as le } from "/@/hooks/web/useDesign";
|
|
24
|
+
import { _ as ie } from "./index-740b2c4a.mjs";
|
|
25
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
26
|
+
import "/@/hooks/web/useMessage";
|
|
27
|
+
import "vue-router";
|
|
28
|
+
const ae = Y({
|
|
29
|
+
name: "CodeFileViewModal",
|
|
30
|
+
components: {
|
|
31
|
+
BasicModal: ee,
|
|
32
|
+
InfoCircleTwoTone: ne,
|
|
33
|
+
JCodeEditor: oe
|
|
34
|
+
},
|
|
35
|
+
emits: ["download", "register", "close"],
|
|
36
|
+
setup(o, { emit: a }) {
|
|
37
|
+
const f = p([]), y = p(""), C = p([]), F = p(!1), E = window.innerHeight - 142, c = p("java"), r = p("");
|
|
38
|
+
let s = X({});
|
|
39
|
+
const [T, { closeModal: k }] = te((t) => D(this, null, function* () {
|
|
40
|
+
s = X({}), r.value = "", f.value = t.codeList, y.value = t.pathKey, N(), U(), F.value = !0;
|
|
41
|
+
})), { prefixCls: W } = le("online-codeFileViewModal");
|
|
42
|
+
function N() {
|
|
43
|
+
let t = I(), l = t[0];
|
|
44
|
+
z(l, t);
|
|
45
|
+
let n = [];
|
|
46
|
+
const e = function(d) {
|
|
47
|
+
if (d.children) {
|
|
48
|
+
let i = d.children;
|
|
49
|
+
i.length == 1 ? e(i[0]) : i.length > 1 && n.push(d);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
e(l), C.value = n, setTimeout(() => {
|
|
53
|
+
G(l);
|
|
54
|
+
}, 300);
|
|
55
|
+
}
|
|
56
|
+
function G(t) {
|
|
57
|
+
return D(this, null, function* () {
|
|
58
|
+
const l = function(e) {
|
|
59
|
+
if (e.isLeaf === !0)
|
|
60
|
+
return e;
|
|
61
|
+
if (e.children)
|
|
62
|
+
return l(e.children[0]);
|
|
63
|
+
};
|
|
64
|
+
let n = l(t);
|
|
65
|
+
if (n && n.isLeaf === !0) {
|
|
66
|
+
let e = n.path;
|
|
67
|
+
s[e] || (yield S(e)), c.value = K(e), r.value = s[e];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function z(t, l) {
|
|
72
|
+
for (let n of l)
|
|
73
|
+
t.key == n.pid && (t.children || (t.children = []), t.children.push(n), z(n, l));
|
|
74
|
+
}
|
|
75
|
+
function A(t, l) {
|
|
76
|
+
let n = 0, e = "";
|
|
77
|
+
for (; n <= l; )
|
|
78
|
+
e += t[n], n++;
|
|
79
|
+
return e;
|
|
80
|
+
}
|
|
81
|
+
function I() {
|
|
82
|
+
let t = [], l = [], n = f.value;
|
|
83
|
+
for (let e of n) {
|
|
84
|
+
let d = e.replace(new RegExp("\\\\", "g"), "/").replace("生成成功:", "").trim();
|
|
85
|
+
if (d) {
|
|
86
|
+
let i = d.split("/");
|
|
87
|
+
for (let u = 0; u < i.length; u++) {
|
|
88
|
+
let h = i[u], v = A(i, u);
|
|
89
|
+
if (h) {
|
|
90
|
+
let m = {
|
|
91
|
+
title: h,
|
|
92
|
+
key: v
|
|
93
|
+
};
|
|
94
|
+
if (h != 0) {
|
|
95
|
+
let x = A(i, u - 1);
|
|
96
|
+
x && (m.pid = x);
|
|
97
|
+
}
|
|
98
|
+
u == i.length - 1 && (m.isLeaf = !0, m.path = d), (l.indexOf(v) < 0 || u == i.length - 1) && (t.push(m), l.push(v));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return t;
|
|
104
|
+
}
|
|
105
|
+
function J() {
|
|
106
|
+
k(), a("close");
|
|
107
|
+
}
|
|
108
|
+
function O() {
|
|
109
|
+
a("download");
|
|
110
|
+
}
|
|
111
|
+
function K(t) {
|
|
112
|
+
return t.endsWith("xml") ? "application/xml" : t.endsWith("sql") ? "text/x-sql" : t.endsWith("vue") ? "text/x-vue" : t.endsWith("ts") ? "text/typescript" : "text/x-java";
|
|
113
|
+
}
|
|
114
|
+
function P(t, l) {
|
|
115
|
+
return D(this, null, function* () {
|
|
116
|
+
let n = l.node.dataRef;
|
|
117
|
+
if (n.isLeaf) {
|
|
118
|
+
let e = n.path;
|
|
119
|
+
s[e] || (yield S(e)), c.value = K(e), r.value = s[e];
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function S(t) {
|
|
124
|
+
return new Promise((l) => {
|
|
125
|
+
let n = {
|
|
126
|
+
path: encodeURI(t),
|
|
127
|
+
pathKey: y.value
|
|
128
|
+
};
|
|
129
|
+
Z.get({ url: "/online/cgform/api/codeView", params: n }, { isTransformResponse: !1 }).then((e) => {
|
|
130
|
+
if (!e || e.size === 0) {
|
|
131
|
+
H.warning("文件下载失败");
|
|
132
|
+
return;
|
|
133
|
+
} else if (e.message) {
|
|
134
|
+
H.warning(e.message);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
let d = new Blob([e]), i = new FileReader();
|
|
138
|
+
i.readAsText(d, "utf8"), i.onload = function() {
|
|
139
|
+
let u = this.result;
|
|
140
|
+
s[t] = u, l(1);
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
const R = p(24), j = p(14), q = p(30);
|
|
146
|
+
function U() {
|
|
147
|
+
let t = document.getElementsByClassName("resize"), l = document.getElementsByClassName("code-gen"), n = document.getElementsByClassName("left");
|
|
148
|
+
for (let e = 0; e < t.length; e++)
|
|
149
|
+
t[e].onmousedown = function(d) {
|
|
150
|
+
let i = l[e].offsetWidth, u = n[e].offsetWidth, h = d.clientX;
|
|
151
|
+
return document.onmousemove = function(v) {
|
|
152
|
+
let m = v.clientX, x = Math.abs(m - h);
|
|
153
|
+
if (m > h) {
|
|
154
|
+
let _ = parseFloat(((u + x) / i * 100).toFixed(4));
|
|
155
|
+
parseFloat("100") - _ > q.value && (R.value = _);
|
|
156
|
+
}
|
|
157
|
+
if (m < h) {
|
|
158
|
+
let _ = parseFloat(((u - x) / i * 100).toFixed(4));
|
|
159
|
+
_ > j.value && (R.value = _);
|
|
160
|
+
}
|
|
161
|
+
}, document.onmouseup = function(v) {
|
|
162
|
+
document.onmousemove = null, document.onmouseup = null, t[e].releaseCapture && t[e].releaseCapture();
|
|
163
|
+
}, t[e].setCapture && t[e].setCapture(), !1;
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
registerModal: T,
|
|
168
|
+
codeList: f,
|
|
169
|
+
onDownloadGenerateCode: O,
|
|
170
|
+
handleClose: J,
|
|
171
|
+
treeData: C,
|
|
172
|
+
showCodeContent: P,
|
|
173
|
+
activeCodeContent: r,
|
|
174
|
+
expandStatus: F,
|
|
175
|
+
height: E,
|
|
176
|
+
language: c,
|
|
177
|
+
prefixCls: W,
|
|
178
|
+
modalHeight: 1e3,
|
|
179
|
+
defaultLeftWidthRate: R
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
function re(o, a, f, y, C, F) {
|
|
184
|
+
const E = g("info-circle-two-tone"), c = g("a-directory-tree"), r = g("JCodeEditor"), s = g("a-empty"), T = g("a-row"), k = g("a-button"), W = g("BasicModal");
|
|
185
|
+
return L(), b(W, {
|
|
186
|
+
height: o.modalHeight,
|
|
187
|
+
onRegister: o.registerModal,
|
|
188
|
+
okText: "",
|
|
189
|
+
cancelText: "关闭",
|
|
190
|
+
width: 1200,
|
|
191
|
+
defaultFullscreen: !0,
|
|
192
|
+
canFullscreen: !1,
|
|
193
|
+
onOk: o.onDownloadGenerateCode,
|
|
194
|
+
wrapClassName: o.prefixCls
|
|
195
|
+
}, {
|
|
196
|
+
title: w(() => [
|
|
197
|
+
B(E),
|
|
198
|
+
a[1] || (a[1] = V(" 代码在线预览 "))
|
|
199
|
+
]),
|
|
200
|
+
footer: w(() => [
|
|
201
|
+
B(k, { onClick: o.handleClose }, {
|
|
202
|
+
default: w(() => a[3] || (a[3] = [
|
|
203
|
+
V("关闭")
|
|
204
|
+
])),
|
|
205
|
+
_: 1
|
|
206
|
+
}, 8, ["onClick"]),
|
|
207
|
+
B(k, {
|
|
208
|
+
type: "primary",
|
|
209
|
+
onClick: o.onDownloadGenerateCode
|
|
210
|
+
}, {
|
|
211
|
+
default: w(() => a[4] || (a[4] = [
|
|
212
|
+
V("下载到本地")
|
|
213
|
+
])),
|
|
214
|
+
_: 1
|
|
215
|
+
}, 8, ["onClick"])
|
|
216
|
+
]),
|
|
217
|
+
default: w(() => [
|
|
218
|
+
M("div", null, [
|
|
219
|
+
B(T, { class: "code-gen" }, {
|
|
220
|
+
default: w(() => [
|
|
221
|
+
M("div", {
|
|
222
|
+
class: "left",
|
|
223
|
+
style: $([{ "border-right": "1px solid #eee" }, { width: `calc(${o.defaultLeftWidthRate}% - 2px)` }])
|
|
224
|
+
}, [
|
|
225
|
+
M("div", {
|
|
226
|
+
style: $({ height: o.height + "px", overflowY: "auto" })
|
|
227
|
+
}, [
|
|
228
|
+
o.treeData.length ? (L(), b(c, {
|
|
229
|
+
key: 0,
|
|
230
|
+
defaultExpandAll: !0,
|
|
231
|
+
"tree-data": o.treeData,
|
|
232
|
+
onSelect: o.showCodeContent
|
|
233
|
+
}, null, 8, ["tree-data", "onSelect"])) : Q("", !0)
|
|
234
|
+
], 4)
|
|
235
|
+
], 4),
|
|
236
|
+
a[2] || (a[2] = M("div", { class: "resize" }, null, -1)),
|
|
237
|
+
M("div", {
|
|
238
|
+
class: "right",
|
|
239
|
+
style: $({ width: `calc(100% - ${o.defaultLeftWidthRate}% - 2px)` })
|
|
240
|
+
}, [
|
|
241
|
+
o.activeCodeContent ? (L(), b(r, {
|
|
242
|
+
key: 0,
|
|
243
|
+
value: o.activeCodeContent,
|
|
244
|
+
"onUpdate:value": a[0] || (a[0] = (N) => o.activeCodeContent = N),
|
|
245
|
+
theme: "idea",
|
|
246
|
+
language: o.language,
|
|
247
|
+
fullScreen: !1,
|
|
248
|
+
lineNumbers: !0,
|
|
249
|
+
height: o.height + "px",
|
|
250
|
+
disabled: !0,
|
|
251
|
+
"language-change": !0
|
|
252
|
+
}, null, 8, ["value", "language", "height"])) : (L(), b(s, {
|
|
253
|
+
key: 1,
|
|
254
|
+
style: { "margin-top": "50px" },
|
|
255
|
+
description: "请选择左侧文件,显示详细代码"
|
|
256
|
+
}))
|
|
257
|
+
], 4)
|
|
258
|
+
]),
|
|
259
|
+
_: 1
|
|
260
|
+
})
|
|
261
|
+
])
|
|
262
|
+
]),
|
|
263
|
+
_: 1
|
|
264
|
+
}, 8, ["height", "onRegister", "onOk", "wrapClassName"]);
|
|
265
|
+
}
|
|
266
|
+
const Fe = /* @__PURE__ */ ie(ae, [["render", re]]);
|
|
267
|
+
export {
|
|
268
|
+
Fe as default
|
|
269
|
+
};
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
var E = (t, o, p) => new Promise((C, d) => {
|
|
2
|
+
var h = (s) => {
|
|
3
|
+
try {
|
|
4
|
+
l(p.next(s));
|
|
5
|
+
} catch (g) {
|
|
6
|
+
d(g);
|
|
7
|
+
}
|
|
8
|
+
}, f = (s) => {
|
|
9
|
+
try {
|
|
10
|
+
l(p.throw(s));
|
|
11
|
+
} catch (g) {
|
|
12
|
+
d(g);
|
|
13
|
+
}
|
|
14
|
+
}, l = (s) => s.done ? C(s.value) : Promise.resolve(s.value).then(h, f);
|
|
15
|
+
l((p = p.apply(t, o)).next());
|
|
16
|
+
});
|
|
17
|
+
import { defineComponent as ue, ref as y, computed as V, reactive as P, nextTick as ce, h as L, resolveComponent as u, openBlock as R, createElementBlock as me, Fragment as pe, createVNode as c, withCtx as r, createElementVNode as G, createTextVNode as $, createBlock as I, createCommentVNode as U, mergeProps as de } from "vue";
|
|
18
|
+
import { defHttp as H } from "/@/utils/http/axios";
|
|
19
|
+
import { BasicForm as fe, useForm as ge } from "/@/components/Form";
|
|
20
|
+
import { BasicModal as be, useModalInner as Fe, useModal as q } from "/@/components/Modal";
|
|
21
|
+
import { JVxeTypes as k } from "/@/components/jeecg/JVxeTable/types";
|
|
22
|
+
import { b as Ce } from "./useSchemas-b074f3a1.mjs";
|
|
23
|
+
import { underLine2CamelCase as K } from "/@/utils/common/compUtils";
|
|
24
|
+
import _e from "./CodeFileListModal-305c1a62.mjs";
|
|
25
|
+
import ve from "./FileSelectModal-eb026170.mjs";
|
|
26
|
+
import { message as ye } from "ant-design-vue";
|
|
27
|
+
import { useDesign as Me } from "/@/hooks/web/useDesign";
|
|
28
|
+
import { createLocalStorage as Ne } from "/@/utils/cache";
|
|
29
|
+
import { useMessage as he } from "/@/hooks/web/useMessage";
|
|
30
|
+
import { _ as Te } from "./index-740b2c4a.mjs";
|
|
31
|
+
import "@ant-design/icons-vue";
|
|
32
|
+
import "/@/hooks/web/usePermission";
|
|
33
|
+
import "/@/utils/helper/validator";
|
|
34
|
+
import "./CodeFileViewModal-320d7acf.mjs";
|
|
35
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
36
|
+
import "vue-router";
|
|
37
|
+
import "/@/utils/file/download";
|
|
38
|
+
const we = Ne(), { notification: Se } = he(), Be = ue({
|
|
39
|
+
name: "CodeGenerator",
|
|
40
|
+
components: { BasicForm: fe, BasicModal: be, FileSelectModal: ve, CodeFileListModal: _e },
|
|
41
|
+
emits: ["register"],
|
|
42
|
+
setup(t) {
|
|
43
|
+
const o = "JEECG_ONL_PROJECT_PATH", p = "JEECG_ONL_PROJECT_NAME", C = y(!0), d = y(), h = V(() => C.value ? 800 : 1200), f = y("代码生成"), l = y(!1), { prefixCls: s } = Me("code-generator-modal"), g = s, M = y(""), T = P({
|
|
44
|
+
projectPath: "",
|
|
45
|
+
packageStyle: "service",
|
|
46
|
+
jspMode: "",
|
|
47
|
+
jformType: "1",
|
|
48
|
+
tableName_tmp: "",
|
|
49
|
+
ftlDescription: "",
|
|
50
|
+
entityName: "",
|
|
51
|
+
codeTypes: "controller,service,dao,mapper,entity,vue"
|
|
52
|
+
}), a = P({}), N = y([]), _ = P({
|
|
53
|
+
dataSource: [],
|
|
54
|
+
columns: [
|
|
55
|
+
{
|
|
56
|
+
title: "子表名",
|
|
57
|
+
key: "tableName",
|
|
58
|
+
type: k.input,
|
|
59
|
+
disabled: !0,
|
|
60
|
+
validateRules: [{ required: !0, message: "请输入${title}" }]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
title: "子表实体",
|
|
64
|
+
key: "entityName",
|
|
65
|
+
type: k.input,
|
|
66
|
+
validateRules: [{ required: !0, message: "请输入${title}" }]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
title: "功能说明",
|
|
70
|
+
key: "ftlDescription",
|
|
71
|
+
type: k.input,
|
|
72
|
+
validateRules: [{ required: !0, message: "请输入${title}" }]
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}), w = V(() => _.dataSource.length > 0), { formSchemas: v } = Ce(
|
|
76
|
+
t,
|
|
77
|
+
{
|
|
78
|
+
onProjectPathChange: re,
|
|
79
|
+
onProjectPathSearch: ae,
|
|
80
|
+
jspModeOptions: N
|
|
81
|
+
},
|
|
82
|
+
C
|
|
83
|
+
), [S, { resetFields: j, setFieldsValue: J, validate: x }] = ge({
|
|
84
|
+
schemas: v,
|
|
85
|
+
showActionButtonGroup: !1,
|
|
86
|
+
labelAlign: "right"
|
|
87
|
+
}), [W, { closeModal: O }] = Fe((e) => E(this, null, function* () {
|
|
88
|
+
yield j(), M.value = e.code, l.value = !1, _.dataSource = [], N.value = [], ne(), Object.assign(a, T), z();
|
|
89
|
+
}));
|
|
90
|
+
function z() {
|
|
91
|
+
return E(this, null, function* () {
|
|
92
|
+
let { main: e, sub: n, jspModeList: b, projectPath: m } = yield H.get({
|
|
93
|
+
url: "/online/cgform/head/tableInfo",
|
|
94
|
+
params: { code: M.value }
|
|
95
|
+
}), i = [];
|
|
96
|
+
for (let F of b) {
|
|
97
|
+
const { code: D, note: ie } = F;
|
|
98
|
+
D == "many" || i.push({
|
|
99
|
+
label: ie,
|
|
100
|
+
value: D
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
N.value = i, e.isTree == "Y" ? a.jspMode = "tree" : i.find((F) => F.value === e.themeTemplate) ? a.jspMode = e.themeTemplate : a.jspMode = i[0].value, C.value = e.tableType == 1, f.value = "代码生成【" + e.tableName + "】", a.projectPath || (a.projectPath = m, window.localStorage.setItem(o, m));
|
|
104
|
+
const B = localStorage.getItem(p);
|
|
105
|
+
B && (a.entityPackage = B), a.jformType = e.tableType + "", a.tableName_tmp = e.tableName, a.ftlDescription = e.tableTxt;
|
|
106
|
+
let A = K(e.tableName);
|
|
107
|
+
a.entityName = A.substring(0, 1).toUpperCase() + A.substring(1), yield ce(), J(a), n && n.length > 0 && (_.dataSource = n.map((F) => ({
|
|
108
|
+
tableName: F.tableName,
|
|
109
|
+
entityName: se(F.tableName),
|
|
110
|
+
ftlDescription: F.tableTxt
|
|
111
|
+
})));
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
const [Q, { openModal: Y }] = q();
|
|
115
|
+
function X() {
|
|
116
|
+
return E(this, null, function* () {
|
|
117
|
+
try {
|
|
118
|
+
const e = yield x();
|
|
119
|
+
let n = Object.assign({}, e, { code: M.value, tableName: e.tableName_tmp });
|
|
120
|
+
if (w.value) {
|
|
121
|
+
if (yield d.value.validateTable())
|
|
122
|
+
return;
|
|
123
|
+
n.subList = d.value.getTableData();
|
|
124
|
+
}
|
|
125
|
+
l.value = !0;
|
|
126
|
+
let b = yield Z(n);
|
|
127
|
+
Y(!0, {
|
|
128
|
+
codeList: b.codeList,
|
|
129
|
+
pathKey: b.pathKey,
|
|
130
|
+
tableName: e.tableName_tmp
|
|
131
|
+
}), b.codeList.some(
|
|
132
|
+
(i) => i.includes("src/views/") || i.includes("src\\views\\")
|
|
133
|
+
) ? we.set(
|
|
134
|
+
"code.genenrate.success.msg",
|
|
135
|
+
`表【${e.tableName_tmp}】代码生成成功!前端代码已自动刷新,Java后台需重启生效!`,
|
|
136
|
+
15
|
|
137
|
+
) : Se.success({
|
|
138
|
+
message: `表【${e.tableName_tmp}】代码生成成功`,
|
|
139
|
+
description: L("div", [
|
|
140
|
+
"1. 前端代码请迁移到 VUE3项目",
|
|
141
|
+
L("br"),
|
|
142
|
+
"2. 菜单SQL放到jeecg-system-start的flyway目录",
|
|
143
|
+
L("br"),
|
|
144
|
+
"3. Java 后台需重启生效"
|
|
145
|
+
]),
|
|
146
|
+
duration: 5
|
|
147
|
+
}), O(), localStorage.setItem(p, e.entityPackage);
|
|
148
|
+
} catch (e) {
|
|
149
|
+
} finally {
|
|
150
|
+
l.value = !1;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function Z(e) {
|
|
155
|
+
return new Promise((n, b) => {
|
|
156
|
+
H.post({ url: "/online/cgform/api/codeGenerate", params: e }, { isTransformResponse: !1 }).then((m) => {
|
|
157
|
+
if (m.success) {
|
|
158
|
+
let i = m.result, B = m.message;
|
|
159
|
+
n({
|
|
160
|
+
codeList: i,
|
|
161
|
+
pathKey: B
|
|
162
|
+
});
|
|
163
|
+
} else
|
|
164
|
+
ye.error(m.message), b(m.message);
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function ee() {
|
|
169
|
+
O();
|
|
170
|
+
}
|
|
171
|
+
const [te, oe] = q();
|
|
172
|
+
function ae() {
|
|
173
|
+
oe.openModal(!0, {});
|
|
174
|
+
}
|
|
175
|
+
function le(e) {
|
|
176
|
+
window.localStorage.setItem(o, e), J({ projectPath: e });
|
|
177
|
+
}
|
|
178
|
+
function se(e) {
|
|
179
|
+
let n = K(e);
|
|
180
|
+
return n.substring(0, 1).toUpperCase() + n.substring(1);
|
|
181
|
+
}
|
|
182
|
+
function ne() {
|
|
183
|
+
let e = window.localStorage.getItem(o);
|
|
184
|
+
e && (T.projectPath = e);
|
|
185
|
+
}
|
|
186
|
+
function re(e) {
|
|
187
|
+
e.target.value && window.localStorage.setItem(o, e.target.value);
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
title: f,
|
|
191
|
+
modalWidth: h,
|
|
192
|
+
confirmLoading: l,
|
|
193
|
+
subTable: _,
|
|
194
|
+
showSubTable: w,
|
|
195
|
+
onSubmit: X,
|
|
196
|
+
onCancel: ee,
|
|
197
|
+
onFileSelect: le,
|
|
198
|
+
registerFileSelectModal: te,
|
|
199
|
+
subTableRef: d,
|
|
200
|
+
registerForm: S,
|
|
201
|
+
registerModal: W,
|
|
202
|
+
registerCodeFileListModal: Q,
|
|
203
|
+
wrapClassName: g
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
function Ee(t, o, p, C, d, h) {
|
|
208
|
+
const f = u("a-radio"), l = u("a-tooltip"), s = u("a-radio-group"), g = u("BasicForm"), M = u("JVxeTable"), T = u("a-card"), a = u("a-spin"), N = u("BasicModal"), _ = u("FileSelectModal"), w = u("code-file-list-modal");
|
|
209
|
+
return R(), me(pe, null, [
|
|
210
|
+
c(N, {
|
|
211
|
+
onRegister: t.registerModal,
|
|
212
|
+
title: t.title,
|
|
213
|
+
width: t.modalWidth,
|
|
214
|
+
confirmLoading: t.confirmLoading,
|
|
215
|
+
okText: "开始生成",
|
|
216
|
+
cancelText: "取消",
|
|
217
|
+
onOk: t.onSubmit,
|
|
218
|
+
onCancel: t.onCancel,
|
|
219
|
+
wrapClassName: t.wrapClassName
|
|
220
|
+
}, {
|
|
221
|
+
default: r(() => [
|
|
222
|
+
c(a, { spinning: t.confirmLoading }, {
|
|
223
|
+
default: r(() => [
|
|
224
|
+
c(g, { onRegister: t.registerForm }, {
|
|
225
|
+
pageCode: r(({ model: v, field: S }) => [
|
|
226
|
+
c(s, {
|
|
227
|
+
value: v[S],
|
|
228
|
+
"onUpdate:value": (j) => v[S] = j
|
|
229
|
+
}, {
|
|
230
|
+
default: r(() => [
|
|
231
|
+
c(l, { placement: "top" }, {
|
|
232
|
+
title: r(() => o[0] || (o[0] = [
|
|
233
|
+
G("span", null, "深度封装表单,用户只需定义字段json即可渲染表单,优点简单便捷,缺点扩展有难度", -1)
|
|
234
|
+
])),
|
|
235
|
+
default: r(() => [
|
|
236
|
+
c(f, { value: "vue3" }, {
|
|
237
|
+
default: r(() => o[1] || (o[1] = [
|
|
238
|
+
$("封装表单(BasicForm)")
|
|
239
|
+
])),
|
|
240
|
+
_: 1
|
|
241
|
+
})
|
|
242
|
+
]),
|
|
243
|
+
_: 1
|
|
244
|
+
}),
|
|
245
|
+
c(l, { placement: "top" }, {
|
|
246
|
+
title: r(() => o[2] || (o[2] = [
|
|
247
|
+
G("span", null, "antd的原生表单,所有字段都需要硬编码,缺点编码繁琐,优点扩展容易", -1)
|
|
248
|
+
])),
|
|
249
|
+
default: r(() => [
|
|
250
|
+
v.jspMode == "innerTable" || v.jspMode == "tab" ? U("", !0) : (R(), I(f, {
|
|
251
|
+
key: 0,
|
|
252
|
+
value: "vue3Native"
|
|
253
|
+
}, {
|
|
254
|
+
default: r(() => o[3] || (o[3] = [
|
|
255
|
+
$("原生表单(a-form)")
|
|
256
|
+
])),
|
|
257
|
+
_: 1
|
|
258
|
+
}))
|
|
259
|
+
]),
|
|
260
|
+
_: 2
|
|
261
|
+
}, 1024)
|
|
262
|
+
]),
|
|
263
|
+
_: 2
|
|
264
|
+
}, 1032, ["value", "onUpdate:value"])
|
|
265
|
+
]),
|
|
266
|
+
_: 1
|
|
267
|
+
}, 8, ["onRegister"]),
|
|
268
|
+
t.showSubTable ? (R(), I(T, {
|
|
269
|
+
key: 0,
|
|
270
|
+
title: "子表信息",
|
|
271
|
+
size: "small"
|
|
272
|
+
}, {
|
|
273
|
+
default: r(() => [
|
|
274
|
+
c(M, de({
|
|
275
|
+
ref: "subTableRef",
|
|
276
|
+
rowNumber: "",
|
|
277
|
+
maxHeight: 580
|
|
278
|
+
}, t.subTable), null, 16)
|
|
279
|
+
]),
|
|
280
|
+
_: 1
|
|
281
|
+
})) : U("", !0)
|
|
282
|
+
]),
|
|
283
|
+
_: 1
|
|
284
|
+
}, 8, ["spinning"])
|
|
285
|
+
]),
|
|
286
|
+
_: 1
|
|
287
|
+
}, 8, ["onRegister", "title", "width", "confirmLoading", "onOk", "onCancel", "wrapClassName"]),
|
|
288
|
+
c(_, {
|
|
289
|
+
onRegister: t.registerFileSelectModal,
|
|
290
|
+
onSelect: t.onFileSelect
|
|
291
|
+
}, null, 8, ["onRegister", "onSelect"]),
|
|
292
|
+
c(w, { onRegister: t.registerCodeFileListModal }, null, 8, ["onRegister"])
|
|
293
|
+
], 64);
|
|
294
|
+
}
|
|
295
|
+
const Xe = /* @__PURE__ */ Te(Be, [["render", Ee]]);
|
|
296
|
+
export {
|
|
297
|
+
Xe as default
|
|
298
|
+
};
|
|
@@ -33,7 +33,7 @@ import { BasicModal as me, useModalInner as pe, useModal as S } from "/@/compone
|
|
|
33
33
|
import { BasicForm as fe, useForm as ge } from "/@/components/Form";
|
|
34
34
|
import { _ as Be, l as Ce, c as Me, f as _e, s as we, d as $ } from "./BuiltInButtonList.vue_vue_type_script_setup_true_lang-07d0b7d0.mjs";
|
|
35
35
|
import { useMessage as be } from "/@/hooks/web/useMessage";
|
|
36
|
-
import { _ as ke } from "./index-
|
|
36
|
+
import { _ as ke } from "./index-740b2c4a.mjs";
|
|
37
37
|
import "/@/utils/http/axios";
|
|
38
38
|
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
39
39
|
import "vue-router";
|