@jeecg/online 3.5.3-beta2 → 3.5.3-vite4

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 (154) hide show
  1. package/AuthButtonConfig-2f71787c.mjs +125 -0
  2. package/AuthButtonTree-d73bccf5.mjs +156 -0
  3. package/AuthDataConfig-32cf23d2.mjs +212 -0
  4. package/AuthDataTree-03d62d3f.mjs +139 -0
  5. package/AuthFieldConfig-b1217a0c.mjs +139 -0
  6. package/AuthFieldTree-888e04a9.mjs +232 -0
  7. package/AuthManagerDrawer-f127b8a2.mjs +114 -0
  8. package/AuthSetterModal-37da78ed.mjs +261 -0
  9. package/CgformCopyList-3adab58f.mjs +245 -0
  10. package/CgformModal-6938d8c2.mjs +613 -0
  11. package/CgreportModal-77ec8c17.mjs +12 -0
  12. package/CgreportModal.vue_vue_type_script_setup_true_lang-52dcec5e.mjs +567 -0
  13. package/CheckDictTable-414313f2.mjs +211 -0
  14. package/CodeFileListModal-4831ce3d.mjs +158 -0
  15. package/CodeFileViewModal-5990dac4.mjs +244 -0
  16. package/CodeGeneratorModal-7df9e25d.mjs +234 -0
  17. package/CustomButtonList-1c9bd859.mjs +363 -0
  18. package/DBAttributeTable-cd1c41e5.mjs +473 -0
  19. package/DbToOnlineModal-dc5d2030.mjs +160 -0
  20. package/DetailForm-e4538e7a.mjs +446 -0
  21. package/EnhanceJavaModal-7f53d2ca.mjs +260 -0
  22. package/EnhanceJsHistory-c30805ce.mjs +184 -0
  23. package/EnhanceJsModal-0b133341.mjs +233 -0
  24. package/EnhanceSqlModal-33a94c83.mjs +259 -0
  25. package/ExtendConfigModal-60f2cf86.mjs +111 -0
  26. package/FieldExtendJsonModal-48f7d67f.mjs +220 -0
  27. package/FileSelectModal-64aaf623.mjs +91 -0
  28. package/ForeignKeyTable-cb1abd1d.mjs +69 -0
  29. package/IndexTable-4e94cd1f.mjs +89 -0
  30. package/JModalTip-abe1515a.mjs +46 -0
  31. package/JOnlineSearchSelect-5608a5cf.mjs +94 -0
  32. package/LeftDepart-ca7a7375.mjs +82 -0
  33. package/LeftRole-d0fa8398.mjs +86 -0
  34. package/LeftUser-0c88c240.mjs +105 -0
  35. package/LinkTableConfigModal-77d7c0b9.mjs +230 -0
  36. package/LinkTableFieldConfigModal-c5689ab0.mjs +178 -0
  37. package/LinkTableListPiece-34266919.mjs +34 -0
  38. package/ModalFormDemo-0eeea994.mjs +78 -0
  39. package/OnlCgformErpList-7a0388d8.mjs +425 -0
  40. package/OnlCgformErpSubTable-fc6ade76.mjs +388 -0
  41. package/OnlineAutoList-85e6a30d.mjs +472 -0
  42. package/OnlineAutoModal-2a146238.mjs +206 -0
  43. package/OnlineAutoTreeList-f8d0e100.mjs +495 -0
  44. package/OnlineCustomModal-456a85a6.mjs +227 -0
  45. package/OnlineDetailModal-f967f080.mjs +177 -0
  46. package/OnlineForm-630a22c2.mjs +778 -0
  47. package/OnlineFormDetail-1b216792.mjs +296 -0
  48. package/OnlineQueryForm-1c5949a7.mjs +378 -0
  49. package/OnlineSearchFormItem-7c2ea9ed.mjs +352 -0
  50. package/OnlineSelectCascade-c7baf52b.mjs +160 -0
  51. package/OnlineSubFormDetail-0aa4966c.mjs +140 -0
  52. package/PageAttributeTable-811185fd.mjs +404 -0
  53. package/ProcessOnlineForm-27be6f6f.mjs +177 -0
  54. package/QueryTable-4ba771ef.mjs +115 -0
  55. package/SuperQuery-3821f984.mjs +845 -0
  56. package/SuperQueryValComponent-471110b5.mjs +8 -0
  57. package/SuperQueryValComponent.vue_vue_type_script_lang-e3ad7ee8.mjs +101 -0
  58. package/auth.api-d3a6c4b3.mjs +39 -0
  59. package/auth.data-8be5c9e3.mjs +141 -0
  60. package/{cgform.data.js → cgform.data-cbdd88c3.mjs} +93 -62
  61. package/constant-fe20103a.mjs +6 -0
  62. package/enhance.api-138e6826.mjs +104 -0
  63. package/enhance.data-efc7e155.mjs +175 -0
  64. package/index-074b92e5.mjs +236 -0
  65. package/index-6a09a912.mjs +58 -0
  66. package/index-9d32ae88.mjs +313 -0
  67. package/main.index.js +7 -1
  68. package/package.json +1 -1
  69. package/style.css +1 -1
  70. package/useCgformList-2d6a5955.mjs +388 -0
  71. package/useExtendComponent-48d37d9b.mjs +3919 -0
  72. package/useListButton-cef1371a.mjs +656 -0
  73. package/useOnlinePopEvent-e9a042f8.mjs +19 -0
  74. package/useOnlineTest-0df0ae86.mjs +43 -0
  75. package/useSchemas-fc8d97ce.mjs +669 -0
  76. package/useTableSync-dc333087.mjs +83 -0
  77. package/AuthButtonConfig.js +0 -147
  78. package/AuthButtonTree.js +0 -183
  79. package/AuthDataConfig.js +0 -246
  80. package/AuthDataTree.js +0 -160
  81. package/AuthFieldConfig.js +0 -170
  82. package/AuthFieldTree.js +0 -281
  83. package/AuthManagerDrawer.js +0 -125
  84. package/AuthSetterModal.js +0 -316
  85. package/CgformCopyList.js +0 -266
  86. package/CgformModal.js +0 -780
  87. package/CgreportModal.js +0 -667
  88. package/CheckDictTable.js +0 -242
  89. package/CodeFileListModal.js +0 -175
  90. package/CodeFileViewModal.js +0 -325
  91. package/CodeGeneratorModal.js +0 -297
  92. package/CustomButtonList.js +0 -410
  93. package/DBAttributeTable.js +0 -526
  94. package/DbToOnlineModal.js +0 -192
  95. package/DetailForm.js +0 -608
  96. package/EnhanceJavaModal.js +0 -298
  97. package/EnhanceJsHistory.js +0 -229
  98. package/EnhanceJsModal.js +0 -293
  99. package/EnhanceSqlModal.js +0 -299
  100. package/ExtendConfigModal.js +0 -151
  101. package/FieldExtendJsonModal.js +0 -283
  102. package/FileSelectModal.js +0 -102
  103. package/ForeignKeyTable.js +0 -79
  104. package/IndexTable.js +0 -97
  105. package/JModalTip.js +0 -54
  106. package/JOnlineSearchSelect.js +0 -115
  107. package/LICENSE +0 -9
  108. package/LeftDepart.js +0 -96
  109. package/LeftRole.js +0 -98
  110. package/LeftUser.js +0 -117
  111. package/LinkTableConfigModal.js +0 -289
  112. package/LinkTableFieldConfigModal.js +0 -218
  113. package/LinkTableListPiece.js +0 -36
  114. package/ModalFormDemo.js +0 -85
  115. package/OnlineAutoList.js +0 -524
  116. package/OnlineAutoModal.js +0 -226
  117. package/OnlineAutoTreeList.js +0 -553
  118. package/OnlineCustomModal.js +0 -286
  119. package/OnlineDetailModal.js +0 -190
  120. package/OnlineForm.js +0 -1018
  121. package/OnlineFormDetail.js +0 -347
  122. package/OnlineQueryForm.js +0 -484
  123. package/OnlineSearchFormItem.js +0 -436
  124. package/OnlineSelectCascade.js +0 -228
  125. package/OnlineSubFormDetail.js +0 -166
  126. package/PageAttributeTable.js +0 -486
  127. package/ProcessOnlineForm.js +0 -208
  128. package/QueryTable.js +0 -129
  129. package/SuperQuery.js +0 -1021
  130. package/SuperQueryValComponent.js +0 -9
  131. package/SuperQueryValComponent.vue_vue_type_script_lang.js +0 -162
  132. package/_arrayPush.js +0 -278
  133. package/_baseClone.js +0 -471
  134. package/_baseSlice.js +0 -18
  135. package/_commonjsHelpers.js +0 -5
  136. package/_flatRest.js +0 -174
  137. package/auth.api.js +0 -43
  138. package/auth.data.js +0 -142
  139. package/clipboard.js +0 -565
  140. package/enhance.api.js +0 -129
  141. package/enhance.data.js +0 -196
  142. package/index.js +0 -87
  143. package/index2.js +0 -340
  144. package/index3.js +0 -264
  145. package/isArray.js +0 -47
  146. package/omit.js +0 -60
  147. package/pick.js +0 -68
  148. package/toString.js +0 -31
  149. package/useCgformList.js +0 -470
  150. package/useExtendComponent.js +0 -5205
  151. package/useListButton.js +0 -923
  152. package/useOnlineTest.js +0 -44
  153. package/useSchemas.js +0 -653
  154. package/useTableSync.js +0 -117
@@ -0,0 +1,234 @@
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-fc8d97ce.mjs";
23
+ import { underLine2CamelCase as O } from "/@/utils/common/compUtils";
24
+ import pe from "./CodeFileListModal-4831ce3d.mjs";
25
+ import de from "./FileSelectModal-64aaf623.mjs";
26
+ import { _ as fe } from "./index-6a09a912.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-5990dac4.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
+ console.error(e);
130
+ } finally {
131
+ s.value = !1;
132
+ }
133
+ });
134
+ }
135
+ function q(e) {
136
+ return new Promise((l, d) => {
137
+ k.post({ url: "/online/cgform/api/codeGenerate", params: e }, { isTransformResponse: !1 }).then((r) => {
138
+ if (r.success) {
139
+ let v = r.result, _ = r.message;
140
+ l({
141
+ codeList: v,
142
+ pathKey: _
143
+ });
144
+ } else
145
+ this.$message.error(r.message), d(r.message);
146
+ });
147
+ });
148
+ }
149
+ function K() {
150
+ j();
151
+ }
152
+ const [U, W] = B();
153
+ function z() {
154
+ W.openModal(!0, {});
155
+ }
156
+ function Y(e) {
157
+ window.localStorage.setItem(c, e), w({ projectPath: e });
158
+ }
159
+ function x(e) {
160
+ let l = O(e);
161
+ return l.substring(0, 1).toUpperCase() + l.substring(1);
162
+ }
163
+ function Q() {
164
+ let e = window.localStorage.getItem(c);
165
+ e && (a.projectPath = e);
166
+ }
167
+ function X(e) {
168
+ e.target.value && window.localStorage.setItem(c, e.target.value);
169
+ }
170
+ return {
171
+ title: h,
172
+ modalWidth: b,
173
+ confirmLoading: s,
174
+ subTable: p,
175
+ showSubTable: T,
176
+ onSubmit: H,
177
+ onCancel: K,
178
+ onFileSelect: Y,
179
+ registerFileSelectModal: U,
180
+ subTableRef: u,
181
+ registerForm: E,
182
+ registerModal: J,
183
+ registerCodeFileListModal: I
184
+ };
185
+ }
186
+ });
187
+ function be(t, c, n, u, b, h) {
188
+ 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");
189
+ return R(), oe(ae, null, [
190
+ g(M, {
191
+ onRegister: t.registerModal,
192
+ title: t.title,
193
+ width: t.modalWidth,
194
+ confirmLoading: t.confirmLoading,
195
+ okText: "开始生成",
196
+ cancelText: "取消",
197
+ onOk: t.onSubmit,
198
+ onCancel: t.onCancel
199
+ }, {
200
+ default: F(() => [
201
+ g(o, { spinning: t.confirmLoading }, {
202
+ default: F(() => [
203
+ g(s, { onRegister: t.registerForm }, null, 8, ["onRegister"]),
204
+ t.showSubTable ? (R(), le(a, {
205
+ key: 0,
206
+ title: "子表信息",
207
+ size: "small"
208
+ }, {
209
+ default: F(() => [
210
+ g(i, ne({
211
+ ref: "subTableRef",
212
+ rowNumber: "",
213
+ maxHeight: 580
214
+ }, t.subTable), null, 16)
215
+ ]),
216
+ _: 1
217
+ })) : ie("", !0)
218
+ ]),
219
+ _: 1
220
+ }, 8, ["spinning"])
221
+ ]),
222
+ _: 1
223
+ }, 8, ["onRegister", "title", "width", "confirmLoading", "onOk", "onCancel"]),
224
+ g(p, {
225
+ onRegister: t.registerFileSelectModal,
226
+ onSelect: t.onFileSelect
227
+ }, null, 8, ["onRegister", "onSelect"]),
228
+ g(T, { onRegister: t.registerCodeFileListModal }, null, 8, ["onRegister"])
229
+ ], 64);
230
+ }
231
+ const Ge = /* @__PURE__ */ fe(ge, [["render", be]]);
232
+ export {
233
+ Ge as default
234
+ };
@@ -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-0df0ae86.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-6a09a912.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
+ };