@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,87 @@
1
+ var p = (f, v, e) => new Promise((o, u) => {
2
+ var n = (t) => {
3
+ try {
4
+ r(e.next(t));
5
+ } catch (b) {
6
+ u(b);
7
+ }
8
+ }, m = (t) => {
9
+ try {
10
+ r(e.throw(t));
11
+ } catch (b) {
12
+ u(b);
13
+ }
14
+ }, r = (t) => t.done ? o(t.value) : Promise.resolve(t.value).then(n, m);
15
+ r((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
+ })), r = g(() => ["id"].concat(f.value.map((l) => l.key))), t = g(() => ({
27
+ // 针对Online表单对虚拟滚动做出优化
28
+ // 虚拟滚动配置,y轴(行数)大于xx条数据时启用虚拟滚动
29
+ // update-begin--author:liaozhiyang---date:20231025---for:【QQYUN-6808】online编辑字段多了卡顿
30
+ scrollY: {
31
+ enabled: !0,
32
+ gt: 15
33
+ },
34
+ // 列数
35
+ scrollX: {
36
+ enabled: !0,
37
+ gt: 20
38
+ }
39
+ // update-begin--author:liaozhiyang---date:20231025---for:【QQYUN-6808】online编辑字段多了卡顿
40
+ }));
41
+ function b(l) {
42
+ return p(this, null, function* () {
43
+ let a = o.value;
44
+ if (yield a.fullValidateTable())
45
+ throw { code: N, activeKey: l };
46
+ let T = a.getTableData().map((c) => A(c, r.value)), D = a.getDeleteData().map((c) => c.id);
47
+ return { tableData: T, deleteIds: D };
48
+ });
49
+ }
50
+ function k(l, a = !1) {
51
+ return p(this, null, function* () {
52
+ a ? (n.value = [], yield w(), yield o.value.addOrInsert(l, 0, null, { setActive: !1 }), yield w(), o.value.recalcDisableRows()) : n.value = l;
53
+ });
54
+ }
55
+ function E(l) {
56
+ let a = o.value, x = l.value.tableRef, T = l.value.getRemoveIds(), D = x.getXTable().internalData.tableFullData, c = a.getXTable().internalData.tableFullData;
57
+ return D.forEach((s) => {
58
+ let F = !1;
59
+ if (c.forEach((d) => {
60
+ if (s.id === d.id) {
61
+ let i = d.dbFieldName, I = d.dbFieldTxt;
62
+ (s.dbFieldName !== i || s.dbFieldTxt !== I) && a.setValues([
63
+ {
64
+ rowKey: d.id,
65
+ values: {
66
+ dbFieldName: s.dbFieldName,
67
+ dbFieldTxt: s.dbFieldTxt
68
+ }
69
+ }
70
+ ]), F = !0;
71
+ } else
72
+ T.forEach((i) => {
73
+ i === d.id && (a.removeRowsById(i), F = !0);
74
+ });
75
+ }), !F) {
76
+ let d = Object.assign({}, s);
77
+ f.value.forEach((i) => {
78
+ i.key !== "dbFieldName" && i.key !== "dbFieldTxt" && (d[i.key] = i.defaultValue);
79
+ }), a.addRows(d);
80
+ }
81
+ }), w();
82
+ }
83
+ return { tables: v, tableRef: o, loading: u, dataSource: n, columnKeys: r, tableHeight: m, tableProps: t, syncTable: E, validateData: b, setDataSource: k };
84
+ }
85
+ export {
86
+ L as u
87
+ };
@@ -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 };