@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.
Files changed (163) hide show
  1. package/AuthButtonConfig-b6a674fa.mjs +125 -0
  2. package/AuthButtonTree-09e57bc4.mjs +156 -0
  3. package/AuthDataConfig-6e7e61ec.mjs +212 -0
  4. package/AuthDataTree-e83286c5.mjs +139 -0
  5. package/AuthFieldConfig-f1ec2708.mjs +139 -0
  6. package/AuthFieldTree-bb72e21f.mjs +232 -0
  7. package/AuthManagerDrawer-28a2d108.mjs +114 -0
  8. package/AuthSetterModal-2990d553.mjs +261 -0
  9. package/CgformCopyList-36a4cbf0.mjs +246 -0
  10. package/CgformModal-7399a5ac.mjs +611 -0
  11. package/CgreportModal-2eb9c9e1.mjs +13 -0
  12. package/CgreportModal.vue_vue_type_script_setup_true_lang-c2ceb064.mjs +566 -0
  13. package/CheckDictTable-3a8a54b3.mjs +211 -0
  14. package/CodeFileListModal-72f0d3bb.mjs +158 -0
  15. package/CodeFileViewModal-9eb88c47.mjs +244 -0
  16. package/CodeGeneratorModal-a89958f5.mjs +233 -0
  17. package/CustomButtonList-c44aec5a.mjs +363 -0
  18. package/DBAttributeTable-7d285e8d.mjs +473 -0
  19. package/DbToOnlineModal-d23cbeb1.mjs +160 -0
  20. package/DetailForm-2901d215.mjs +461 -0
  21. package/EnhanceJavaModal-153899a9.mjs +264 -0
  22. package/EnhanceJsHistory-7f5db3b1.mjs +184 -0
  23. package/EnhanceJsModal-c2fb75b8.mjs +311 -0
  24. package/EnhanceSqlModal-965e9b0a.mjs +268 -0
  25. package/ExtendConfigModal-8f08466f.mjs +111 -0
  26. package/FieldExtendJsonModal-adfcf5a7.mjs +219 -0
  27. package/FileSelectModal-432d4521.mjs +103 -0
  28. package/ForeignKeyTable-faab7ccf.mjs +69 -0
  29. package/IndexTable-0a2d3718.mjs +89 -0
  30. package/JModalTip-e1938b49.mjs +46 -0
  31. package/JOnlineSearchSelect-7e908492.mjs +95 -0
  32. package/LeftDepart-54f245b3.mjs +82 -0
  33. package/LeftRole-c138f892.mjs +86 -0
  34. package/LeftUser-9c812f8a.mjs +105 -0
  35. package/LinkTableConfigModal-c2c5c7e6.mjs +230 -0
  36. package/LinkTableFieldConfigModal-a3553b1f.mjs +176 -0
  37. package/LinkTableListPiece-7f793b08.mjs +34 -0
  38. package/ModalFormDemo-65685b0e.mjs +78 -0
  39. package/OnlCgformErpList-52c87ed3.mjs +449 -0
  40. package/OnlCgformErpSubTable-6e7fb17b.mjs +398 -0
  41. package/OnlCgformInnerSubTable-f0727b8f.mjs +248 -0
  42. package/OnlCgformInnerTableList-9f89c173.mjs +430 -0
  43. package/OnlCgformTabList-15516315.mjs +390 -0
  44. package/OnlineAutoList-63a0224f.mjs +474 -0
  45. package/OnlineAutoModal-ffe19c3f.mjs +206 -0
  46. package/OnlineAutoTreeList-317c7105.mjs +495 -0
  47. package/OnlineCustomModal-3939ce78.mjs +227 -0
  48. package/OnlineDetailModal-bfb1375f.mjs +177 -0
  49. package/OnlineForm-069f6092.mjs +749 -0
  50. package/OnlineFormDetail-ad5735fb.mjs +296 -0
  51. package/OnlineQueryForm-0771c80f.mjs +385 -0
  52. package/OnlineSearchFormItem-0db5834f.mjs +348 -0
  53. package/OnlineSelectCascade-a05c30f4.mjs +159 -0
  54. package/OnlineSubFormDetail-583d01eb.mjs +142 -0
  55. package/OnlineTabAutoModal-747e071d.mjs +253 -0
  56. package/OnlineTabDetailModal-887f0174.mjs +222 -0
  57. package/OnlineTabForm-b1dcd4b4.mjs +765 -0
  58. package/OnlineTabFormDetail-8e494a96.mjs +323 -0
  59. package/PageAttributeTable-5966b201.mjs +404 -0
  60. package/ProcessOnlineForm-4382bea7.mjs +177 -0
  61. package/QueryTable-6e8053ad.mjs +115 -0
  62. package/README.md +2 -1
  63. package/SuperQuery-78db6998.mjs +841 -0
  64. package/SuperQueryValComponent-471110b5.mjs +8 -0
  65. package/SuperQueryValComponent.vue_vue_type_script_lang-e3ad7ee8.mjs +101 -0
  66. package/auth.api-d3a6c4b3.mjs +39 -0
  67. package/auth.data-8be5c9e3.mjs +141 -0
  68. package/{cgform.data.js → cgform.data-cbdd88c3.mjs} +93 -62
  69. package/constant-754f1a9d.mjs +9 -0
  70. package/enhance.api-138e6826.mjs +104 -0
  71. package/enhance.data-efc7e155.mjs +175 -0
  72. package/index-0a93652b.mjs +237 -0
  73. package/index-7e9a23f2.mjs +1494 -0
  74. package/index-b70302f2.mjs +56 -0
  75. package/main.index.js +7 -1
  76. package/package.json +1 -1
  77. package/style.css +1 -1
  78. package/useCgformList-0c603af1.mjs +424 -0
  79. package/useCustomHook-acb00837.mjs +53 -0
  80. package/useExtendComponent-aa1cdfc8.mjs +3917 -0
  81. package/useListButton-0f18bf6a.mjs +671 -0
  82. package/useOnlinePopEvent-687070b7.mjs +19 -0
  83. package/useOnlineTest-e4bd8be3.mjs +42 -0
  84. package/useSchemas-43429d80.mjs +685 -0
  85. package/useTableSync-774c3774.mjs +87 -0
  86. package/AuthButtonConfig.js +0 -147
  87. package/AuthButtonTree.js +0 -183
  88. package/AuthDataConfig.js +0 -246
  89. package/AuthDataTree.js +0 -160
  90. package/AuthFieldConfig.js +0 -170
  91. package/AuthFieldTree.js +0 -281
  92. package/AuthManagerDrawer.js +0 -125
  93. package/AuthSetterModal.js +0 -316
  94. package/CgformCopyList.js +0 -266
  95. package/CgformModal.js +0 -780
  96. package/CgreportModal.js +0 -667
  97. package/CheckDictTable.js +0 -242
  98. package/CodeFileListModal.js +0 -175
  99. package/CodeFileViewModal.js +0 -325
  100. package/CodeGeneratorModal.js +0 -297
  101. package/CustomButtonList.js +0 -410
  102. package/DBAttributeTable.js +0 -526
  103. package/DbToOnlineModal.js +0 -192
  104. package/DetailForm.js +0 -608
  105. package/EnhanceJavaModal.js +0 -298
  106. package/EnhanceJsHistory.js +0 -229
  107. package/EnhanceJsModal.js +0 -293
  108. package/EnhanceSqlModal.js +0 -299
  109. package/ExtendConfigModal.js +0 -151
  110. package/FieldExtendJsonModal.js +0 -283
  111. package/FileSelectModal.js +0 -102
  112. package/ForeignKeyTable.js +0 -79
  113. package/IndexTable.js +0 -97
  114. package/JModalTip.js +0 -54
  115. package/JOnlineSearchSelect.js +0 -115
  116. package/LICENSE +0 -9
  117. package/LeftDepart.js +0 -96
  118. package/LeftRole.js +0 -98
  119. package/LeftUser.js +0 -117
  120. package/LinkTableConfigModal.js +0 -289
  121. package/LinkTableFieldConfigModal.js +0 -218
  122. package/LinkTableListPiece.js +0 -36
  123. package/ModalFormDemo.js +0 -85
  124. package/OnlineAutoList.js +0 -523
  125. package/OnlineAutoModal.js +0 -226
  126. package/OnlineAutoTreeList.js +0 -552
  127. package/OnlineCustomModal.js +0 -286
  128. package/OnlineDetailModal.js +0 -190
  129. package/OnlineForm.js +0 -1016
  130. package/OnlineFormDetail.js +0 -347
  131. package/OnlineQueryForm.js +0 -484
  132. package/OnlineSearchFormItem.js +0 -436
  133. package/OnlineSelectCascade.js +0 -228
  134. package/OnlineSubFormDetail.js +0 -166
  135. package/PageAttributeTable.js +0 -486
  136. package/ProcessOnlineForm.js +0 -208
  137. package/QueryTable.js +0 -129
  138. package/SuperQuery.js +0 -1020
  139. package/SuperQueryValComponent.js +0 -8
  140. package/SuperQueryValComponent.vue_vue_type_script_lang.js +0 -168
  141. package/_arrayPush.js +0 -278
  142. package/_baseClone.js +0 -471
  143. package/_baseSlice.js +0 -18
  144. package/_commonjsHelpers.js +0 -5
  145. package/_flatRest.js +0 -174
  146. package/auth.api.js +0 -43
  147. package/auth.data.js +0 -142
  148. package/clipboard.js +0 -565
  149. package/enhance.api.js +0 -129
  150. package/enhance.data.js +0 -196
  151. package/index.js +0 -87
  152. package/index2.js +0 -340
  153. package/index3.js +0 -264
  154. package/isArray.js +0 -47
  155. package/omit.js +0 -60
  156. package/pick.js +0 -68
  157. package/toString.js +0 -31
  158. package/useCgformList.js +0 -470
  159. package/useExtendComponent.js +0 -5205
  160. package/useListButton.js +0 -923
  161. package/useOnlineTest.js +0 -44
  162. package/useSchemas.js +0 -653
  163. package/useTableSync.js +0 -117
@@ -0,0 +1,233 @@
1
+ var C = (t, c, n) => new Promise((u, b) => {
2
+ var h = (a) => {
3
+ try {
4
+ i(n.next(a));
5
+ } catch (o) {
6
+ b(o);
7
+ }
8
+ }, s = (a) => {
9
+ try {
10
+ i(n.throw(a));
11
+ } catch (o) {
12
+ b(o);
13
+ }
14
+ }, i = (a) => a.done ? u(a.value) : Promise.resolve(a.value).then(h, s);
15
+ i((n = n.apply(t, c)).next());
16
+ });
17
+ import { defineComponent as ee, ref as f, computed as P, reactive as S, nextTick as te, resolveComponent as m, openBlock as R, createElementBlock as oe, Fragment as ae, createVNode as g, withCtx as F, createBlock as le, mergeProps as ne, createCommentVNode as ie } from "vue";
18
+ import { defHttp as k } from "/@/utils/http/axios";
19
+ import { BasicForm as re, useForm as se } from "/@/components/Form";
20
+ import { BasicModal as ce, useModalInner as me, useModal as B } from "/@/components/Modal";
21
+ import { JVxeTypes as N } from "/@/components/jeecg/JVxeTable/types";
22
+ import { b as ue } from "./useSchemas-43429d80.mjs";
23
+ import { underLine2CamelCase as O } from "/@/utils/common/compUtils";
24
+ import pe from "./CodeFileListModal-72f0d3bb.mjs";
25
+ import de from "./FileSelectModal-432d4521.mjs";
26
+ import { _ as fe } from "./index-b70302f2.mjs";
27
+ import "ant-design-vue";
28
+ import "@ant-design/icons-vue";
29
+ import "/@/hooks/web/usePermission";
30
+ import "/@/utils/helper/validator";
31
+ import "./CodeFileViewModal-9eb88c47.mjs";
32
+ import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
33
+ import "/@/hooks/web/useMessage";
34
+ import "vue-router";
35
+ import "/@/utils/file/download";
36
+ const ge = ee({
37
+ name: "CodeGenerator",
38
+ components: { BasicForm: re, BasicModal: ce, FileSelectModal: de, CodeFileListModal: pe },
39
+ emits: ["register"],
40
+ setup(t) {
41
+ const c = "JEECG_ONL_PROJECT_PATH", n = f(!0), u = f(), b = P(() => n.value ? 800 : 1200), h = f("代码生成"), s = f(!1), i = f(""), a = S({
42
+ projectPath: "",
43
+ packageStyle: "service",
44
+ jspMode: "",
45
+ jformType: "1",
46
+ tableName_tmp: "",
47
+ ftlDescription: "",
48
+ entityName: "",
49
+ codeTypes: "controller,service,dao,mapper,entity,vue"
50
+ }), o = S({}), M = f([]), p = S({
51
+ dataSource: [],
52
+ columns: [
53
+ {
54
+ title: "子表名",
55
+ key: "tableName",
56
+ type: N.input,
57
+ disabled: !0,
58
+ validateRules: [{ required: !0, message: "请输入${title}" }]
59
+ },
60
+ {
61
+ title: "子表实体",
62
+ key: "entityName",
63
+ type: N.input,
64
+ validateRules: [{ required: !0, message: "请输入${title}" }]
65
+ },
66
+ {
67
+ title: "功能说明",
68
+ key: "ftlDescription",
69
+ type: N.input,
70
+ validateRules: [{ required: !0, message: "请输入${title}" }]
71
+ }
72
+ ]
73
+ }), T = P(() => p.dataSource.length > 0), { formSchemas: D } = ue(
74
+ t,
75
+ {
76
+ onProjectPathChange: X,
77
+ onProjectPathSearch: z,
78
+ jspModeOptions: M
79
+ },
80
+ n
81
+ ), [E, { resetFields: G, setFieldsValue: w, validate: $ }] = se({
82
+ schemas: D,
83
+ showActionButtonGroup: !1,
84
+ labelAlign: "right"
85
+ }), [J, { closeModal: j }] = me((e) => C(this, null, function* () {
86
+ yield G(), i.value = e.code, s.value = !1, p.dataSource = [], M.value = [], Q(), Object.assign(o, a), V();
87
+ }));
88
+ function V() {
89
+ return C(this, null, function* () {
90
+ let { main: e, sub: l, jspModeList: d, projectPath: r } = yield k.get({
91
+ url: "/online/cgform/head/tableInfo",
92
+ params: { code: i.value }
93
+ }), v = [];
94
+ for (let y of d) {
95
+ const { code: L, note: Z } = y;
96
+ L == "many" || v.push({
97
+ label: Z,
98
+ value: L
99
+ });
100
+ }
101
+ M.value = v, e.isTree == "Y" ? o.jspMode = "tree" : o.jspMode = v[0].value, n.value = e.tableType == 1, h.value = "代码生成【" + e.tableName + "】", o.projectPath || (o.projectPath = r, window.localStorage.setItem(c, r)), o.jformType = e.tableType + "", o.tableName_tmp = e.tableName, o.ftlDescription = e.tableTxt;
102
+ let _ = O(e.tableName);
103
+ o.entityName = _.substring(0, 1).toUpperCase() + _.substring(1), yield te(), w(o), l && l.length > 0 && (p.dataSource = l.map((y) => ({
104
+ tableName: y.tableName,
105
+ entityName: x(y.tableName),
106
+ ftlDescription: y.tableTxt
107
+ })));
108
+ });
109
+ }
110
+ const [I, { openModal: A }] = B();
111
+ function H() {
112
+ return C(this, null, function* () {
113
+ try {
114
+ const e = yield $();
115
+ let l = Object.assign({}, e, { code: i.value, tableName: e.tableName_tmp });
116
+ if (T.value) {
117
+ if (yield u.value.validateTable())
118
+ return;
119
+ l.subList = u.value.getTableData();
120
+ }
121
+ s.value = !0;
122
+ let d = yield q(l);
123
+ A(!0, {
124
+ codeList: d.codeList,
125
+ pathKey: d.pathKey,
126
+ tableName: e.tableName_tmp
127
+ }), j();
128
+ } catch (e) {
129
+ } finally {
130
+ s.value = !1;
131
+ }
132
+ });
133
+ }
134
+ function q(e) {
135
+ return new Promise((l, d) => {
136
+ k.post({ url: "/online/cgform/api/codeGenerate", params: e }, { isTransformResponse: !1 }).then((r) => {
137
+ if (r.success) {
138
+ let v = r.result, _ = r.message;
139
+ l({
140
+ codeList: v,
141
+ pathKey: _
142
+ });
143
+ } else
144
+ this.$message.error(r.message), d(r.message);
145
+ });
146
+ });
147
+ }
148
+ function K() {
149
+ j();
150
+ }
151
+ const [U, W] = B();
152
+ function z() {
153
+ W.openModal(!0, {});
154
+ }
155
+ function Y(e) {
156
+ window.localStorage.setItem(c, e), w({ projectPath: e });
157
+ }
158
+ function x(e) {
159
+ let l = O(e);
160
+ return l.substring(0, 1).toUpperCase() + l.substring(1);
161
+ }
162
+ function Q() {
163
+ let e = window.localStorage.getItem(c);
164
+ e && (a.projectPath = e);
165
+ }
166
+ function X(e) {
167
+ e.target.value && window.localStorage.setItem(c, e.target.value);
168
+ }
169
+ return {
170
+ title: h,
171
+ modalWidth: b,
172
+ confirmLoading: s,
173
+ subTable: p,
174
+ showSubTable: T,
175
+ onSubmit: H,
176
+ onCancel: K,
177
+ onFileSelect: Y,
178
+ registerFileSelectModal: U,
179
+ subTableRef: u,
180
+ registerForm: E,
181
+ registerModal: J,
182
+ registerCodeFileListModal: I
183
+ };
184
+ }
185
+ });
186
+ function be(t, c, n, u, b, h) {
187
+ const s = m("BasicForm"), i = m("JVxeTable"), a = m("a-card"), o = m("a-spin"), M = m("BasicModal"), p = m("FileSelectModal"), T = m("code-file-list-modal");
188
+ return R(), oe(ae, null, [
189
+ g(M, {
190
+ onRegister: t.registerModal,
191
+ title: t.title,
192
+ width: t.modalWidth,
193
+ confirmLoading: t.confirmLoading,
194
+ okText: "开始生成",
195
+ cancelText: "取消",
196
+ onOk: t.onSubmit,
197
+ onCancel: t.onCancel
198
+ }, {
199
+ default: F(() => [
200
+ g(o, { spinning: t.confirmLoading }, {
201
+ default: F(() => [
202
+ g(s, { onRegister: t.registerForm }, null, 8, ["onRegister"]),
203
+ t.showSubTable ? (R(), le(a, {
204
+ key: 0,
205
+ title: "子表信息",
206
+ size: "small"
207
+ }, {
208
+ default: F(() => [
209
+ g(i, ne({
210
+ ref: "subTableRef",
211
+ rowNumber: "",
212
+ maxHeight: 580
213
+ }, t.subTable), null, 16)
214
+ ]),
215
+ _: 1
216
+ })) : ie("", !0)
217
+ ]),
218
+ _: 1
219
+ }, 8, ["spinning"])
220
+ ]),
221
+ _: 1
222
+ }, 8, ["onRegister", "title", "width", "confirmLoading", "onOk", "onCancel"]),
223
+ g(p, {
224
+ onRegister: t.registerFileSelectModal,
225
+ onSelect: t.onFileSelect
226
+ }, null, 8, ["onRegister", "onSelect"]),
227
+ g(T, { onRegister: t.registerCodeFileListModal }, null, 8, ["onRegister"])
228
+ ], 64);
229
+ }
230
+ const Ge = /* @__PURE__ */ fe(ge, [["render", be]]);
231
+ export {
232
+ Ge as default
233
+ };
@@ -0,0 +1,363 @@
1
+ var K = Object.defineProperty;
2
+ var I = Object.getOwnPropertySymbols;
3
+ var x = Object.prototype.hasOwnProperty, J = Object.prototype.propertyIsEnumerable;
4
+ var F = (e, o, t) => o in e ? K(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t, R = (e, o) => {
5
+ for (var t in o || (o = {}))
6
+ x.call(o, t) && F(e, t, o[t]);
7
+ if (I)
8
+ for (var t of I(o))
9
+ J.call(o, t) && F(e, t, o[t]);
10
+ return e;
11
+ };
12
+ var _ = (e, o, t) => new Promise((C, f) => {
13
+ var b = (i) => {
14
+ try {
15
+ s(t.next(i));
16
+ } catch (u) {
17
+ f(u);
18
+ }
19
+ }, c = (i) => {
20
+ try {
21
+ s(t.throw(i));
22
+ } catch (u) {
23
+ f(u);
24
+ }
25
+ }, s = (i) => i.done ? C(i.value) : Promise.resolve(i.value).then(b, c);
26
+ s((t = t.apply(e, o)).next());
27
+ });
28
+ import { defineComponent as Q, ref as A, reactive as W, computed as X, nextTick as Y, resolveComponent as r, openBlock as M, createBlock as P, withCtx as l, createVNode as a, createTextVNode as B, createElementBlock as Z, createCommentVNode as S, normalizeProps as ee, guardReactiveProps as oe } from "vue";
29
+ import { u as te } from "./useOnlineTest-e4bd8be3.mjs";
30
+ import { useListPage as ne } from "/@/hooks/system/useListPage";
31
+ import { BasicTable as le, TableAction as ae } from "/@/components/Table";
32
+ import { BasicModal as ie, useModalInner as re, useModal as se } from "/@/components/Modal";
33
+ import { BasicForm as ce, useForm as ue } from "/@/components/Form";
34
+ import { defHttp as v } from "/@/utils/http/axios";
35
+ import { _ as de } from "./index-b70302f2.mjs";
36
+ import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
37
+ import "/@/hooks/web/useMessage";
38
+ import "vue-router";
39
+ const me = (e, o) => v.get({ url: "/online/cgform/button/list/" + e, params: o });
40
+ function D(e) {
41
+ return v.delete(
42
+ {
43
+ url: "/online/cgform/button/deleteBatch",
44
+ params: {
45
+ ids: e.join(",")
46
+ }
47
+ },
48
+ { joinParamsToUrl: !0 }
49
+ );
50
+ }
51
+ const pe = (e, o) => o ? v.put({ url: "/online/cgform/button/edit", params: e }) : v.post({ url: "/online/cgform/button/add", params: e }), fe = [
52
+ { title: "按钮编码", align: "center", dataIndex: "buttonCode" },
53
+ { title: "按钮名称", align: "center", dataIndex: "buttonName" },
54
+ {
55
+ title: "按钮样式",
56
+ align: "center",
57
+ dataIndex: "buttonStyle",
58
+ customRender({ text: e, record: o }) {
59
+ if (e === "form") {
60
+ let t = o.optPosition;
61
+ return e + "(" + (t == "2" ? "底部" : "侧面") + ")";
62
+ } else
63
+ return e;
64
+ }
65
+ },
66
+ { title: "按钮类型", align: "center", dataIndex: "optType" },
67
+ { title: "排序", align: "center", dataIndex: "orderNum" },
68
+ { title: "按钮图标", align: "center", dataIndex: "buttonIcon" },
69
+ { title: "表达式", align: "center", dataIndex: "exp" },
70
+ {
71
+ title: "按钮状态",
72
+ align: "center",
73
+ dataIndex: "buttonStatus",
74
+ customRender({ text: e }) {
75
+ return e == 1 ? "激活" : "未激活";
76
+ }
77
+ }
78
+ ], be = [
79
+ {
80
+ label: "按钮编码",
81
+ field: "buttonCode",
82
+ component: "Input",
83
+ required: !0
84
+ },
85
+ {
86
+ label: "按钮名称",
87
+ field: "buttonName",
88
+ component: "Input",
89
+ required: !0
90
+ },
91
+ {
92
+ label: "按钮样式",
93
+ field: "buttonStyle",
94
+ component: "Select",
95
+ componentProps: {
96
+ options: [
97
+ { label: "Link", value: "link" },
98
+ { label: "Button", value: "button" },
99
+ { label: "Form", value: "form" }
100
+ ]
101
+ },
102
+ defaultValue: "link"
103
+ },
104
+ {
105
+ label: "按钮位置",
106
+ field: "optPosition",
107
+ component: "Select",
108
+ componentProps: {
109
+ options: [
110
+ { label: "侧面", value: "1" },
111
+ { label: "底部", value: "2" }
112
+ ]
113
+ },
114
+ defaultValue: "2",
115
+ show: ({ model: e }) => e.buttonStyle === "form"
116
+ },
117
+ {
118
+ label: "按钮类型",
119
+ field: "optType",
120
+ component: "Select",
121
+ componentProps: {
122
+ options: [
123
+ { label: "Js", value: "js" },
124
+ { label: "Action", value: "action" }
125
+ ]
126
+ },
127
+ defaultValue: "js"
128
+ },
129
+ {
130
+ label: "排序",
131
+ field: "orderNum",
132
+ component: "InputNumber",
133
+ componentProps: {
134
+ style: "width: 100%"
135
+ }
136
+ },
137
+ {
138
+ label: "按钮图标",
139
+ field: "buttonIcon",
140
+ component: "Input",
141
+ helpMessage: "a-icon type"
142
+ },
143
+ {
144
+ label: "表达式",
145
+ field: "exp",
146
+ component: "Input"
147
+ },
148
+ {
149
+ label: "按钮状态",
150
+ field: "buttonStatus",
151
+ component: "RadioButtonGroup",
152
+ componentProps: {
153
+ options: [
154
+ { label: "激活", value: "1" },
155
+ { label: "未激活", value: "0" }
156
+ ]
157
+ },
158
+ defaultValue: "1"
159
+ }
160
+ ], ge = Q({
161
+ name: "CustomButtonList",
162
+ components: { BasicModal: ie, BasicTable: le, TableAction: ae, BasicForm: ce },
163
+ emits: ["register"],
164
+ setup() {
165
+ const e = A(""), { doRequest: o, doDeleteRecord: t, tableContext: C } = ne({
166
+ tableProps: {
167
+ api: (n) => me(e.value, n),
168
+ columns: fe,
169
+ canResize: !1,
170
+ useSearchForm: !1,
171
+ beforeFetch(n) {
172
+ return Object.assign(n, { column: "orderNum", order: "asc" });
173
+ }
174
+ }
175
+ }), [f, { reload: b }, { rowSelection: c, selectedRowKeys: s }] = C, [i, { closeModal: u }] = re((n) => _(this, null, function* () {
176
+ e.value = n.row.id, b();
177
+ })), { aiTestMode: y, genButtons: w } = te(), [k, g] = se(), d = A(!1), m = W({
178
+ onRegister: k,
179
+ title: X(() => d != null && d.value ? "修改" : "新增"),
180
+ width: 800,
181
+ confirmLoading: !1,
182
+ onOk: q,
183
+ onCancel: g.closeModal
184
+ });
185
+ let p = {};
186
+ const [N, { resetFields: E, setFieldsValue: L, validate: V }] = ue({
187
+ schemas: be,
188
+ showActionButtonGroup: !1
189
+ });
190
+ function T(n) {
191
+ return _(this, null, function* () {
192
+ var h;
193
+ d.value = n.isUpdate, p = R({}, (h = n.record) != null ? h : {}), g.openModal(), yield Y(), yield E(), L(p);
194
+ });
195
+ }
196
+ function j() {
197
+ T({ isUpdate: !1 });
198
+ }
199
+ function O(n) {
200
+ T({ isUpdate: !0, record: n });
201
+ }
202
+ function G() {
203
+ u();
204
+ }
205
+ function U() {
206
+ w(e.value);
207
+ }
208
+ function $() {
209
+ return _(this, null, function* () {
210
+ o(() => D(s.value));
211
+ });
212
+ }
213
+ function q() {
214
+ return _(this, null, function* () {
215
+ try {
216
+ m.confirmLoading = !0;
217
+ let n = yield V();
218
+ n = Object.assign({ cgformHeadId: e.value }, p, n), yield pe(n, d.value), b(), g.closeModal();
219
+ } finally {
220
+ m.confirmLoading = !1;
221
+ }
222
+ });
223
+ }
224
+ function z(n) {
225
+ return [
226
+ {
227
+ label: "编辑",
228
+ onClick: () => O(n)
229
+ }
230
+ ];
231
+ }
232
+ function H(n) {
233
+ return [
234
+ {
235
+ label: "删除",
236
+ popConfirm: {
237
+ title: "确定删除吗?",
238
+ placement: "left",
239
+ confirm: () => t(() => D([n.id]))
240
+ }
241
+ }
242
+ ];
243
+ }
244
+ return {
245
+ onAdd: j,
246
+ onBatchDelete: $,
247
+ aiTestMode: y,
248
+ onGenButtons: U,
249
+ registerModal: i,
250
+ registerTable: f,
251
+ selectedRowKeys: s,
252
+ rowSelection: c,
253
+ onCancel: G,
254
+ getTableAction: z,
255
+ getDropDownAction: H,
256
+ registerForm: N,
257
+ formModalProps: m
258
+ };
259
+ }
260
+ }), _e = {
261
+ key: 0,
262
+ style: { float: "left" }
263
+ };
264
+ function Be(e, o, t, C, f, b) {
265
+ const c = r("a-button"), s = r("a-icon"), i = r("a-menu-item"), u = r("a-menu"), y = r("a-dropdown"), w = r("TableAction"), k = r("BasicTable"), g = r("BasicForm"), d = r("a-spin"), m = r("BasicModal");
266
+ return M(), P(m, {
267
+ onRegister: e.registerModal,
268
+ title: "自定义按钮",
269
+ width: 1200,
270
+ defaultFullscreen: "",
271
+ onCancel: e.onCancel
272
+ }, {
273
+ footer: l(() => [
274
+ a(c, { onClick: e.onCancel }, {
275
+ default: l(() => [
276
+ B("关闭")
277
+ ]),
278
+ _: 1
279
+ }, 8, ["onClick"]),
280
+ e.aiTestMode ? (M(), Z("div", _e, [
281
+ a(c, { onClick: e.onGenButtons }, {
282
+ default: l(() => [
283
+ B("生成测试数据")
284
+ ]),
285
+ _: 1
286
+ }, 8, ["onClick"])
287
+ ])) : S("", !0)
288
+ ]),
289
+ default: l(() => [
290
+ a(k, {
291
+ onRegister: e.registerTable,
292
+ rowSelection: e.rowSelection
293
+ }, {
294
+ tableTitle: l(() => [
295
+ a(c, {
296
+ onClick: e.onAdd,
297
+ type: "primary",
298
+ preIcon: "ant-design:plus"
299
+ }, {
300
+ default: l(() => [
301
+ B("新增")
302
+ ]),
303
+ _: 1
304
+ }, 8, ["onClick"]),
305
+ e.selectedRowKeys.length > 0 ? (M(), P(y, { key: 0 }, {
306
+ overlay: l(() => [
307
+ a(u, null, {
308
+ default: l(() => [
309
+ a(i, {
310
+ key: "1",
311
+ onClick: e.onBatchDelete
312
+ }, {
313
+ default: l(() => [
314
+ a(s, { type: "delete" }),
315
+ B(" 删除 ")
316
+ ]),
317
+ _: 1
318
+ }, 8, ["onClick"])
319
+ ]),
320
+ _: 1
321
+ })
322
+ ]),
323
+ default: l(() => [
324
+ a(c, { style: { "margin-left": "8px" } }, {
325
+ default: l(() => [
326
+ B(" 批量操作 "),
327
+ a(s, { type: "down" })
328
+ ]),
329
+ _: 1
330
+ })
331
+ ]),
332
+ _: 1
333
+ })) : S("", !0)
334
+ ]),
335
+ action: l(({ record: p }) => [
336
+ a(w, {
337
+ actions: e.getTableAction(p),
338
+ dropDownActions: e.getDropDownAction(p)
339
+ }, null, 8, ["actions", "dropDownActions"])
340
+ ]),
341
+ _: 1
342
+ }, 8, ["onRegister", "rowSelection"]),
343
+ a(m, ee(oe(e.formModalProps)), {
344
+ default: l(() => [
345
+ a(d, {
346
+ spinning: e.formModalProps.confirmLoading
347
+ }, {
348
+ default: l(() => [
349
+ a(g, { onRegister: e.registerForm }, null, 8, ["onRegister"])
350
+ ]),
351
+ _: 1
352
+ }, 8, ["spinning"])
353
+ ]),
354
+ _: 1
355
+ }, 16)
356
+ ]),
357
+ _: 1
358
+ }, 8, ["onRegister", "onCancel"]);
359
+ }
360
+ const Pe = /* @__PURE__ */ de(ge, [["render", Be]]);
361
+ export {
362
+ Pe as default
363
+ };