@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,83 @@
1
+ var p = (f, v, e) => new Promise((o, u) => {
2
+ var n = (t) => {
3
+ try {
4
+ s(e.next(t));
5
+ } catch (b) {
6
+ u(b);
7
+ }
8
+ }, m = (t) => {
9
+ try {
10
+ s(e.throw(t));
11
+ } catch (b) {
12
+ u(b);
13
+ }
14
+ }, s = (t) => t.done ? o(t.value) : Promise.resolve(t.value).then(n, m);
15
+ s((e = e.apply(f, v)).next());
16
+ });
17
+ import { inject as h, ref as y, computed as g, nextTick as w } from "vue";
18
+ import { V as N } from "./cgform.data-cbdd88c3.mjs";
19
+ import { pick as A } from "lodash-es";
20
+ function L(f) {
21
+ const v = h("tables"), e = h("fullScreenRef"), o = y(), u = y(!1), n = y([]), m = g(() => ({
22
+ // 正常表格高度
23
+ normal: e != null && e.value ? 430 : 260,
24
+ // 没有 toolbar 的表格高度
25
+ noToolbar: e != null && e.value ? 480 : 320
26
+ })), s = g(() => ["id"].concat(f.value.map((l) => l.key))), t = g(() => ({
27
+ // 针对Online表单对虚拟滚动做出优化
28
+ // 虚拟滚动配置,y轴(行数)大于xx条数据时启用虚拟滚动
29
+ scrollY: {
30
+ gt: 15
31
+ },
32
+ // 列数
33
+ scrollX: {
34
+ gt: 20
35
+ }
36
+ }));
37
+ function b(l) {
38
+ return p(this, null, function* () {
39
+ let a = o.value;
40
+ if (yield a.fullValidateTable())
41
+ throw { code: N, activeKey: l };
42
+ let T = a.getTableData().map((c) => A(c, s.value)), D = a.getDeleteData().map((c) => c.id);
43
+ return { tableData: T, deleteIds: D };
44
+ });
45
+ }
46
+ function k(l, a = !1) {
47
+ return p(this, null, function* () {
48
+ a ? (n.value = [], yield w(), yield o.value.addOrInsert(l, 0, null, { setActive: !1 }), yield w(), o.value.recalcDisableRows()) : n.value = l;
49
+ });
50
+ }
51
+ function E(l) {
52
+ let a = o.value, x = l.value.tableRef, T = l.value.getRemoveIds(), D = x.getXTable().internalData.tableFullData, c = a.getXTable().internalData.tableFullData;
53
+ return D.forEach((r) => {
54
+ let F = !1;
55
+ if (c.forEach((d) => {
56
+ if (r.id === d.id) {
57
+ let i = d.dbFieldName, I = d.dbFieldTxt;
58
+ (r.dbFieldName !== i || r.dbFieldTxt !== I) && a.setValues([
59
+ {
60
+ rowKey: d.id,
61
+ values: {
62
+ dbFieldName: r.dbFieldName,
63
+ dbFieldTxt: r.dbFieldTxt
64
+ }
65
+ }
66
+ ]), F = !0;
67
+ } else
68
+ T.forEach((i) => {
69
+ i === d.id && (a.removeRowsById(i), F = !0);
70
+ });
71
+ }), !F) {
72
+ let d = Object.assign({}, r);
73
+ f.value.forEach((i) => {
74
+ i.key !== "dbFieldName" && i.key !== "dbFieldTxt" && (d[i.key] = i.defaultValue);
75
+ }), a.addRows(d);
76
+ }
77
+ }), w();
78
+ }
79
+ return { tables: v, tableRef: o, loading: u, dataSource: n, columnKeys: s, tableHeight: m, tableProps: t, syncTable: E, validateData: b, setDataSource: k };
80
+ }
81
+ export {
82
+ L as u
83
+ };
@@ -1,147 +0,0 @@
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, watch, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createTextVNode } from "vue";
22
- import { BasicTable, useTable } from "/@/components/Table";
23
- import { d as authButtonLoadData, e as authButtonEnable, f as authButtonDisable } from "./auth.api.js";
24
- import { b as authButtonColumns, c as authButtonFixedList } from "./auth.data.js";
25
- import { _ as _export_sfc } from "./index.js";
26
- import { b as baseClone } from "./_baseClone.js";
27
- import "/@/utils/http/axios";
28
- import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
29
- import "/@/hooks/web/useMessage";
30
- import "vue-router";
31
- import "./_arrayPush.js";
32
- import "./isArray.js";
33
- var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4;
34
- function cloneDeep(value) {
35
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
36
- }
37
- const _sfc_main = defineComponent({
38
- name: "AuthButtonConfig",
39
- components: { BasicTable },
40
- props: {
41
- headId: {
42
- type: String,
43
- default: "",
44
- required: true
45
- }
46
- },
47
- setup(props) {
48
- const cgformId = ref("");
49
- const pageType = ref(2);
50
- const pageControlList = ref(3);
51
- const pageControlForm = ref(5);
52
- const [registerTable, { reload }] = useTable({
53
- api: loadData,
54
- rowKey: "code",
55
- bordered: true,
56
- columns: authButtonColumns,
57
- showIndexColumn: false
58
- });
59
- watch(
60
- () => props.headId,
61
- (headId) => {
62
- cgformId.value = headId.split("?")[0];
63
- reload().catch(() => null);
64
- },
65
- { immediate: true }
66
- );
67
- function loadData(params) {
68
- return __async(this, null, function* () {
69
- let result = yield authButtonLoadData(cgformId.value, params);
70
- let { authList, buttonList } = result;
71
- let dataSource = [];
72
- for (let btn of cloneDeep(authButtonFixedList)) {
73
- let item = {
74
- status: 0,
75
- page: pageControlList.value
76
- };
77
- let auth = authList.find((auth2) => auth2.code == btn.code);
78
- Object.assign(btn, item, auth);
79
- dataSource.push(btn);
80
- }
81
- return concatCustomButton(authList, buttonList, dataSource);
82
- });
83
- }
84
- function concatCustomButton(authList, buttonList, dataSource) {
85
- for (let btn of buttonList) {
86
- let auth = authList.find((auth2) => auth2.code == btn.buttonCode);
87
- let item = {
88
- code: btn.buttonCode,
89
- title: btn.buttonName,
90
- status: 0,
91
- page: btn.buttonStyle == "form" ? pageControlForm.value : pageControlList.value
92
- };
93
- dataSource.push(Object.assign(item, auth));
94
- }
95
- return dataSource;
96
- }
97
- function onUpdateStatus(flag, record) {
98
- return __async(this, null, function* () {
99
- flag ? doEnableAuthButton(record) : doDisableAuthButton(record);
100
- });
101
- }
102
- function doEnableAuthButton(record) {
103
- return __async(this, null, function* () {
104
- let result = yield authButtonEnable({
105
- id: record.id,
106
- code: record.code,
107
- page: record.page,
108
- cgformId: cgformId.value,
109
- type: pageType.value,
110
- control: 5,
111
- status: 1
112
- });
113
- record.id = result.id;
114
- record.status = 1;
115
- });
116
- }
117
- function doDisableAuthButton(record) {
118
- return __async(this, null, function* () {
119
- yield authButtonDisable(record.id);
120
- record.status = 0;
121
- });
122
- }
123
- return { registerTable, onUpdateStatus };
124
- }
125
- });
126
- const _hoisted_1 = { class: "auth-field-config" };
127
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
128
- const _component_a_switch = resolveComponent("a-switch");
129
- const _component_BasicTable = resolveComponent("BasicTable");
130
- return openBlock(), createElementBlock("div", _hoisted_1, [
131
- createVNode(_component_BasicTable, { onRegister: _ctx.registerTable }, {
132
- switch: withCtx(({ text, record }) => [
133
- createVNode(_component_a_switch, {
134
- size: "small",
135
- checked: record.status === 1,
136
- onChange: (flag) => _ctx.onUpdateStatus(flag, record)
137
- }, null, 8, ["checked", "onChange"])
138
- ]),
139
- control: withCtx(() => [
140
- createTextVNode(" \u53EF\u89C1 ")
141
- ]),
142
- _: 1
143
- }, 8, ["onRegister"])
144
- ]);
145
- }
146
- var AuthButtonConfig = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
147
- export { AuthButtonConfig as default };
package/AuthButtonTree.js DELETED
@@ -1,183 +0,0 @@
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, computed, watch, resolveComponent, openBlock, createElementBlock, createBlock, Fragment, createElementVNode, createVNode, withCtx, createTextVNode } from "vue";
22
- import { useMessage } from "/@/hooks/web/useMessage";
23
- import { c as authButtonFixedList } from "./auth.data.js";
24
- import { m as authButtonLoadTree, l as loadRoleAuthChecked, n as saveAuthButton } from "./auth.api.js";
25
- import { _ as _export_sfc } from "./index.js";
26
- import "/@/utils/http/axios";
27
- import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
28
- import "vue-router";
29
- var AuthButtonTree_vue_vue_type_style_index_0_scoped_true_lang = "";
30
- const _sfc_main = defineComponent({
31
- name: "AuthButtonTree",
32
- props: {
33
- cgformId: { type: String, required: true }
34
- },
35
- setup(props) {
36
- const { createMessage: $message } = useMessage();
37
- const roleId = ref("");
38
- const authType = ref(2);
39
- const autoExpandParent = ref(true);
40
- const expandedKeys = ref([]);
41
- const checkedKeys = ref([]);
42
- const treeData = ref([]);
43
- const authMode = ref("");
44
- const disabled = computed(() => !roleId.value);
45
- watch(() => props.cgformId, loadTree, { immediate: true });
46
- function loadTree() {
47
- return __async(this, null, function* () {
48
- if (!props.cgformId)
49
- return;
50
- let result = yield authButtonLoadTree(props.cgformId, authType.value);
51
- result.forEach((item) => {
52
- for (const btn of authButtonFixedList) {
53
- if (item.code == btn.code) {
54
- item["title"] = btn.title;
55
- break;
56
- }
57
- }
58
- });
59
- let trees = [];
60
- for (let item of result) {
61
- let title = getTreeNodeTitle(item);
62
- trees.push({ key: item.id, title });
63
- }
64
- treeData.value = trees;
65
- });
66
- }
67
- function onRefresh() {
68
- loadTree();
69
- loadChecked(roleId.value, authMode.value);
70
- }
71
- function loadChecked($roleId, $authMode) {
72
- return __async(this, null, function* () {
73
- roleId.value = $roleId;
74
- authMode.value = $authMode;
75
- checkedKeys.value = [];
76
- yield loadTree();
77
- let result = yield loadRoleAuthChecked({
78
- roleId: $roleId,
79
- cgformId: props.cgformId,
80
- type: authType.value,
81
- authMode: $authMode
82
- });
83
- checkedKeys.value = result.map((item) => item.authId);
84
- });
85
- }
86
- function clearChecked() {
87
- roleId.value = "";
88
- loadTree();
89
- }
90
- function onSave() {
91
- return __async(this, null, function* () {
92
- yield saveAuthButton(roleId.value, props.cgformId, {
93
- authId: JSON.stringify(checkedKeys.value),
94
- authMode: authMode.value
95
- });
96
- $message.success("\u4FDD\u5B58\u6210\u529F");
97
- });
98
- }
99
- function getTreeNodeTitle(item) {
100
- let str = item.title + "-";
101
- if (item.page == 3) {
102
- str += "\u5217\u8868\u53EF\u89C1";
103
- } else if (item.page == 5) {
104
- str += "\u8868\u5355\u53EF\u89C1";
105
- }
106
- return str;
107
- }
108
- function onExpand($expandedKeys) {
109
- expandedKeys.value = $expandedKeys;
110
- autoExpandParent.value = false;
111
- }
112
- function clear() {
113
- roleId.value = "";
114
- checkedKeys.value = [];
115
- }
116
- return {
117
- loadChecked,
118
- clear,
119
- expandedKeys,
120
- autoExpandParent,
121
- checkedKeys,
122
- treeData,
123
- disabled,
124
- onSave,
125
- onExpand,
126
- onRefresh,
127
- clearChecked
128
- };
129
- }
130
- });
131
- const _hoisted_1 = { class: "onl-auth-tree-btns" };
132
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
133
- const _component_a_empty = resolveComponent("a-empty");
134
- const _component_a_button = resolveComponent("a-button");
135
- const _component_a_tree = resolveComponent("a-tree");
136
- return openBlock(), createElementBlock("div", null, [
137
- _ctx.disabled ? (openBlock(), createBlock(_component_a_empty, {
138
- key: 0,
139
- description: "\u8BF7\u5148\u9009\u4E2D\u5DE6\u4FA7\u89D2\u8272/\u90E8\u95E8/\u7528\u6237"
140
- })) : _ctx.treeData.length === 0 ? (openBlock(), createBlock(_component_a_empty, {
141
- key: 1,
142
- description: "\u65E0\u6743\u9650\u4FE1\u606F"
143
- })) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
144
- createElementVNode("div", _hoisted_1, [
145
- createVNode(_component_a_button, {
146
- onClick: _ctx.onRefresh,
147
- size: "small",
148
- type: "primary",
149
- preIcon: "ant-design:redo",
150
- ghost: ""
151
- }, {
152
- default: withCtx(() => [
153
- createTextVNode("\u5237\u65B0")
154
- ]),
155
- _: 1
156
- }, 8, ["onClick"]),
157
- createVNode(_component_a_button, {
158
- onClick: _ctx.onSave,
159
- size: "small",
160
- type: "primary",
161
- preIcon: "ant-design:save",
162
- ghost: ""
163
- }, {
164
- default: withCtx(() => [
165
- createTextVNode("\u4FDD\u5B58")
166
- ]),
167
- _: 1
168
- }, 8, ["onClick"])
169
- ]),
170
- createVNode(_component_a_tree, {
171
- checkable: "",
172
- checkedKeys: _ctx.checkedKeys,
173
- "onUpdate:checkedKeys": _cache[0] || (_cache[0] = ($event) => _ctx.checkedKeys = $event),
174
- expandedKeys: _ctx.expandedKeys,
175
- autoExpandParent: _ctx.autoExpandParent,
176
- treeData: _ctx.treeData,
177
- onExpand: _ctx.onExpand
178
- }, null, 8, ["checkedKeys", "expandedKeys", "autoExpandParent", "treeData", "onExpand"])
179
- ], 64))
180
- ]);
181
- }
182
- var AuthButtonTree = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-0e98e024"]]);
183
- export { AuthButtonTree as default };
package/AuthDataConfig.js DELETED
@@ -1,246 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __async = (__this, __arguments, generator) => {
21
- return new Promise((resolve, reject) => {
22
- var fulfilled = (value) => {
23
- try {
24
- step(generator.next(value));
25
- } catch (e) {
26
- reject(e);
27
- }
28
- };
29
- var rejected = (value) => {
30
- try {
31
- step(generator.throw(value));
32
- } catch (e) {
33
- reject(e);
34
- }
35
- };
36
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
37
- step((generator = generator.apply(__this, __arguments)).next());
38
- });
39
- };
40
- import { defineComponent, ref, watch, reactive, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createTextVNode, normalizeProps, guardReactiveProps, nextTick } from "vue";
41
- import { BasicTable, TableAction, useTable } from "/@/components/Table";
42
- import { BasicModal, useModal } from "/@/components/Modal";
43
- import { BasicForm, useForm } from "/@/components/Form";
44
- import { g as authDataLoadData, h as authDataSaveOrUpdate, i as authDataUpdateStatus, j as authDataDelete } from "./auth.api.js";
45
- import { d as authDataColumns, u as useAuthDataFormSchemas, U as USE_SQL_RULES } from "./auth.data.js";
46
- import { _ as _export_sfc } from "./index.js";
47
- import "/@/utils/http/axios";
48
- import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
49
- import "/@/hooks/web/useMessage";
50
- import "vue-router";
51
- const _sfc_main = defineComponent({
52
- name: "AuthDataConfig",
53
- components: { BasicTable, TableAction, BasicModal, BasicForm },
54
- props: {
55
- cgformId: { type: String, required: true },
56
- authFields: { type: Array, required: true }
57
- },
58
- setup(props) {
59
- const loading = ref(false);
60
- const [registerTable, { reload, setLoading }] = useTable({
61
- api: (params) => authDataLoadData(props.cgformId, params),
62
- rowKey: "id",
63
- bordered: true,
64
- columns: authDataColumns,
65
- showIndexColumn: false,
66
- actionColumn: {
67
- width: 120,
68
- title: "\u64CD\u4F5C",
69
- fixed: false,
70
- dataIndex: "action",
71
- slots: { customRender: "action" }
72
- }
73
- });
74
- watch(loading, (l) => setLoading(l));
75
- const [registerModal, { openModal, closeModal }] = useModal();
76
- const formModalProps = reactive({
77
- title: "",
78
- width: 800,
79
- confirmLoading: false,
80
- onOk: onSubmit,
81
- onCancel: closeModal,
82
- onRegister: registerModal
83
- });
84
- let isUpdate = false;
85
- let formRecord = {};
86
- const { formSchemas } = useAuthDataFormSchemas(props, {
87
- onRuleOperatorChange
88
- });
89
- const [registerForm, { validate, resetFields, setFieldsValue }] = useForm({
90
- schemas: formSchemas,
91
- showActionButtonGroup: false,
92
- labelAlign: "right"
93
- });
94
- watch(
95
- () => props.cgformId,
96
- () => {
97
- reload().catch(() => null);
98
- },
99
- { immediate: true }
100
- );
101
- function openFormModal(data) {
102
- return __async(this, null, function* () {
103
- var _a;
104
- isUpdate = (_a = data.isUpdate) != null ? _a : false;
105
- formModalProps.title = data.title;
106
- openModal();
107
- yield nextTick();
108
- yield resetFields();
109
- formRecord = Object.assign({}, data.record);
110
- yield setFieldsValue(formRecord);
111
- });
112
- }
113
- function onAdd() {
114
- openFormModal({ title: "\u65B0\u589E" });
115
- }
116
- function onEdit(record) {
117
- openFormModal({ title: "\u7F16\u8F91", record, isUpdate: true });
118
- }
119
- function onDelete(id) {
120
- loading.value = true;
121
- authDataDelete(id).then(reload).finally(() => loading.value = false);
122
- }
123
- function onSubmit() {
124
- return __async(this, null, function* () {
125
- try {
126
- formModalProps.confirmLoading = true;
127
- let formData = yield validate();
128
- formData = Object.assign({}, formRecord, formData);
129
- if (formData.ruleOperator == USE_SQL_RULES) {
130
- formData.ruleColumn = "";
131
- }
132
- formData.cgformId = props.cgformId;
133
- yield authDataSaveOrUpdate(formData, isUpdate);
134
- reload();
135
- closeModal();
136
- } finally {
137
- formModalProps.confirmLoading = false;
138
- }
139
- });
140
- }
141
- function onUpdateStatus(record) {
142
- loading.value = true;
143
- let status = Math.abs(record.status - 1);
144
- authDataUpdateStatus(__spreadProps(__spreadValues({}, record), { status })).then(() => {
145
- record.status = status;
146
- }).finally(() => {
147
- loading.value = false;
148
- });
149
- }
150
- function onRuleOperatorChange(val) {
151
- if (val == USE_SQL_RULES) {
152
- setFieldsValue({
153
- ruleColumn: ""
154
- });
155
- }
156
- }
157
- function getTableAction(record) {
158
- return [
159
- {
160
- label: "\u7F16\u8F91",
161
- onClick: () => onEdit(record)
162
- }
163
- ];
164
- }
165
- function getDropDownAction(record) {
166
- return [
167
- {
168
- label: "\u5220\u9664",
169
- popConfirm: {
170
- title: "\u786E\u5B9A\u5220\u9664\u5417\uFF1F",
171
- placement: "left",
172
- confirm: () => onDelete(record.id)
173
- }
174
- }
175
- ];
176
- }
177
- return {
178
- loading,
179
- formModalProps,
180
- onAdd,
181
- onUpdateStatus,
182
- getTableAction,
183
- getDropDownAction,
184
- registerTable,
185
- registerModal,
186
- registerForm
187
- };
188
- }
189
- });
190
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
191
- const _component_a_button = resolveComponent("a-button");
192
- const _component_a_switch = resolveComponent("a-switch");
193
- const _component_TableAction = resolveComponent("TableAction");
194
- const _component_BasicTable = resolveComponent("BasicTable");
195
- const _component_BasicForm = resolveComponent("BasicForm");
196
- const _component_a_spin = resolveComponent("a-spin");
197
- const _component_BasicModal = resolveComponent("BasicModal");
198
- return openBlock(), createElementBlock("div", null, [
199
- createVNode(_component_BasicTable, {
200
- onRegister: _ctx.registerTable,
201
- loading: _ctx.loading
202
- }, {
203
- tableTitle: withCtx(() => [
204
- createVNode(_component_a_button, {
205
- onClick: _ctx.onAdd,
206
- type: "primary",
207
- preIcon: "ant-design:plus"
208
- }, {
209
- default: withCtx(() => [
210
- createTextVNode("\u65B0\u589E")
211
- ]),
212
- _: 1
213
- }, 8, ["onClick"])
214
- ]),
215
- switch: withCtx(({ text, record }) => [
216
- createVNode(_component_a_switch, {
217
- size: "small",
218
- checked: record.status === 1,
219
- onClick: () => _ctx.onUpdateStatus(record)
220
- }, null, 8, ["checked", "onClick"])
221
- ]),
222
- action: withCtx(({ record }) => [
223
- createVNode(_component_TableAction, {
224
- actions: _ctx.getTableAction(record),
225
- dropDownActions: _ctx.getDropDownAction(record)
226
- }, null, 8, ["actions", "dropDownActions"])
227
- ]),
228
- _: 1
229
- }, 8, ["onRegister", "loading"]),
230
- createVNode(_component_BasicModal, normalizeProps(guardReactiveProps(_ctx.formModalProps)), {
231
- default: withCtx(() => [
232
- createVNode(_component_a_spin, {
233
- spinning: _ctx.formModalProps.confirmLoading
234
- }, {
235
- default: withCtx(() => [
236
- createVNode(_component_BasicForm, { onRegister: _ctx.registerForm }, null, 8, ["onRegister"])
237
- ]),
238
- _: 1
239
- }, 8, ["spinning"])
240
- ]),
241
- _: 1
242
- }, 16)
243
- ]);
244
- }
245
- var AuthDataConfig = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
246
- export { AuthDataConfig as default };