@jari-ace/element-plus-component 0.1.9 → 0.2.0

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 (140) hide show
  1. package/README.md +18 -18
  2. package/dist/components/userPicker/src/UserPicker.vue.d.ts +17 -0
  3. package/dist/components/userPicker/src/UserPicker.vue.d.ts.map +1 -1
  4. package/dist/components/userPicker/src/UserPicker.vue.js +15 -0
  5. package/dist/components/userPicker/src/UserPicker.vue.js.map +1 -1
  6. package/dist/components/userSelectDialog/src/userSelectDialog.vue.d.ts +17 -0
  7. package/dist/components/userSelectDialog/src/userSelectDialog.vue.d.ts.map +1 -1
  8. package/dist/components/userSelectDialog/src/userSelectDialog.vue.js +15 -0
  9. package/dist/components/userSelectDialog/src/userSelectDialog.vue.js.map +1 -1
  10. package/dist/hooks/useClassificationLevels.d.ts +21 -0
  11. package/dist/hooks/useClassificationLevels.d.ts.map +1 -0
  12. package/dist/hooks/useClassificationLevels.js +55 -0
  13. package/dist/hooks/useClassificationLevels.js.map +1 -0
  14. package/dist/hooks/useUserRefQuery.d.ts +6 -0
  15. package/dist/hooks/useUserRefQuery.d.ts.map +1 -1
  16. package/dist/hooks/useUserRefQuery.js +4 -0
  17. package/dist/hooks/useUserRefQuery.js.map +1 -1
  18. package/dist/index.d.ts +0 -1
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +0 -1
  21. package/dist/index.js.map +1 -1
  22. package/lib/index.css +1 -1
  23. package/lib/index.js +740 -723
  24. package/lib/index.umd.cjs +2 -2
  25. package/package.json +61 -61
  26. package/packages/components/autoComplete/JaAutoComplete.vue +47 -47
  27. package/packages/components/autoComplete/index.ts +5 -5
  28. package/packages/components/avatar/JaAvatar.vue +126 -126
  29. package/packages/components/avatar/avatarToken.ts +11 -11
  30. package/packages/components/avatar/defaultImg.ts +14 -14
  31. package/packages/components/avatar/index.ts +7 -7
  32. package/packages/components/button/JaButton.vue +51 -51
  33. package/packages/components/button/index.ts +4 -4
  34. package/packages/components/channelPicker/index.ts +7 -7
  35. package/packages/components/channelPicker/src/ChannelPicker.vue +43 -43
  36. package/packages/components/channelPicker/src/JaChannelPicker.vue +42 -42
  37. package/packages/components/checkbox/JaCheckbox.vue +73 -73
  38. package/packages/components/checkbox/index.ts +4 -4
  39. package/packages/components/checkboxGroup/JaCheckboxGroup.vue +45 -45
  40. package/packages/components/checkboxGroup/index.ts +4 -4
  41. package/packages/components/customGroupTree/index.ts +10 -10
  42. package/packages/components/customGroupTree/src/customGroupTree.vue +91 -91
  43. package/packages/components/datePicker/JaDatePicker.vue +52 -52
  44. package/packages/components/datePicker/index.ts +4 -4
  45. package/packages/components/departmentPicker/index.ts +4 -4
  46. package/packages/components/departmentPicker/src/DepartmentPicker.vue +107 -107
  47. package/packages/components/departmentPicker/src/consts.ts +2 -2
  48. package/packages/components/departmentTree/index.ts +10 -10
  49. package/packages/components/departmentTree/src/departmentTree.vue +135 -135
  50. package/packages/components/dropdownButton/JaDropdownButton.vue +59 -59
  51. package/packages/components/dropdownButton/index.ts +4 -4
  52. package/packages/components/enumList/EnumListInput.vue +107 -107
  53. package/packages/components/enumList/JaEnumList.vue +39 -39
  54. package/packages/components/enumList/index.ts +7 -7
  55. package/packages/components/enumPicker/index.ts +5 -5
  56. package/packages/components/enumPicker/src/EnumPicker.vue +103 -103
  57. package/packages/components/form/JaForm.vue +186 -186
  58. package/packages/components/form/index.ts +5 -5
  59. package/packages/components/form/types.ts +4 -4
  60. package/packages/components/formItem/JaFormItem.vue +68 -68
  61. package/packages/components/formItem/index.ts +4 -4
  62. package/packages/components/index.ts +34 -34
  63. package/packages/components/input/JaInput.vue +143 -143
  64. package/packages/components/input/index.ts +4 -4
  65. package/packages/components/inputI18n/I18nBundleEditor.vue +76 -76
  66. package/packages/components/inputI18n/InputI18n.vue +146 -146
  67. package/packages/components/inputI18n/JaInputI18n.vue +50 -50
  68. package/packages/components/inputI18n/index.ts +8 -8
  69. package/packages/components/inputNumber/JaInputNumber.vue +98 -98
  70. package/packages/components/inputNumber/index.ts +4 -4
  71. package/packages/components/mapItemList/JaMapItemList.vue +35 -35
  72. package/packages/components/mapItemList/MapItemListInput.vue +191 -191
  73. package/packages/components/mapItemList/index.ts +7 -7
  74. package/packages/components/numberList/JaNumberList.vue +36 -36
  75. package/packages/components/numberList/NumberListInput.vue +111 -111
  76. package/packages/components/numberList/index.ts +7 -7
  77. package/packages/components/properyPicker/JaPropertyPicker.vue +38 -38
  78. package/packages/components/properyPicker/PropertyPicker.vue +314 -314
  79. package/packages/components/properyPicker/index.ts +7 -7
  80. package/packages/components/radioGroup/JaRadioGroup.vue +50 -50
  81. package/packages/components/radioGroup/index.ts +4 -4
  82. package/packages/components/rolePicker/RoleEditor.vue +129 -129
  83. package/packages/components/rolePicker/RolePicker.vue +44 -44
  84. package/packages/components/rolePicker/RolePickerRaw.vue +56 -56
  85. package/packages/components/rolePicker/baseRolePicker.vue +87 -87
  86. package/packages/components/rolePicker/index.ts +10 -10
  87. package/packages/components/scrollbar/Scrollbar.vue +89 -89
  88. package/packages/components/scrollbar/index.ts +5 -5
  89. package/packages/components/scrollbar/utils.ts +17 -17
  90. package/packages/components/select/JaSelect.vue +48 -48
  91. package/packages/components/select/index.ts +4 -4
  92. package/packages/components/stringList/JaStringList.vue +36 -36
  93. package/packages/components/stringList/StringListInput.vue +96 -96
  94. package/packages/components/stringList/index.ts +7 -7
  95. package/packages/components/switch/JaSwitch.vue +50 -50
  96. package/packages/components/switch/index.ts +4 -4
  97. package/packages/components/timePicker/JaTimePicker.vue +52 -52
  98. package/packages/components/timePicker/index.ts +5 -5
  99. package/packages/components/tip/index.ts +4 -4
  100. package/packages/components/tip/src/AceTip.vue +43 -43
  101. package/packages/components/upload/index.ts +6 -6
  102. package/packages/components/upload/src/Upload.vue +25 -25
  103. package/packages/components/upload/src/type.ts +3 -3
  104. package/packages/components/userGroupPicker/index.ts +4 -4
  105. package/packages/components/userGroupPicker/src/UserGroupPicker.vue +94 -94
  106. package/packages/components/userGroupTree/index.ts +10 -10
  107. package/packages/components/userGroupTree/src/userGroupTree.vue +149 -149
  108. package/packages/components/userPicker/index.ts +10 -10
  109. package/packages/components/userPicker/src/CustomGroupManager.vue +189 -189
  110. package/packages/components/userPicker/src/JaUserList.vue +283 -283
  111. package/packages/components/userPicker/src/JaUserPicker.vue +37 -37
  112. package/packages/components/userPicker/src/UserPicker.vue +376 -368
  113. package/packages/components/userSelectDialog/index.ts +6 -6
  114. package/packages/components/userSelectDialog/src/userSelectDialog.vue +462 -455
  115. package/packages/components/userTag/UserInfoTag.vue +397 -397
  116. package/packages/components/userTag/index.ts +6 -6
  117. package/packages/components/userTag/sharedAxios.ts +8 -8
  118. package/packages/directives/auth/index.ts +41 -41
  119. package/packages/directives/autofocus/index.ts +29 -29
  120. package/packages/directives/index.ts +10 -10
  121. package/packages/directives/shortcut/index.ts +192 -192
  122. package/packages/hooks/useAppInstances.ts +34 -34
  123. package/packages/hooks/useBridage.ts +157 -157
  124. package/packages/hooks/useClassificationLevels.ts +62 -0
  125. package/packages/hooks/useDateTimeShortCuts.ts +65 -65
  126. package/packages/hooks/useRealms.ts +28 -28
  127. package/packages/hooks/useTreeData.ts +45 -45
  128. package/packages/hooks/useUserRefQuery.ts +232 -224
  129. package/packages/index.ts +21 -22
  130. package/packages/list.json +7 -7
  131. package/packages/types/custom.d.ts +13 -13
  132. package/packages/types/window.d.ts +16 -16
  133. package/packages/utils/install.ts +43 -43
  134. package/packages/utils/objectUtils.ts +31 -31
  135. package/theme-style/fonts/iconfont.json +5196 -5196
  136. package/theme-style/index.scss +10 -10
  137. package/theme-style/styles/element-plus-var.scss +1419 -1419
  138. package/theme-style/styles/iconfont.css +2979 -2979
  139. package/theme-style/styles/theme-var.scss +72 -72
  140. package/theme-style/styles/transition.scss +122 -122
@@ -1,224 +1,232 @@
1
- import {ref, watch} from 'vue';
2
- import {
3
- type BooleanResultExpression,
4
- createAxiosWithoutCache,
5
- type IAceAxios,
6
- QUser,
7
- type SortDescriptor,
8
- useLoading,
9
- type UserReference,
10
- useUserApi,
11
- useUserQueryBuilder
12
- } from "@jari-ace/app-bolts";
13
- import type {TreeNodeType} from "./useTreeData";
14
- import {ALL_DEPARTMENT, NO_DEPARTMENT} from "../components/departmentPicker/src/consts";
15
- import debounce from "lodash-es/debounce";
16
- import { useRealms } from "./useRealms";
17
-
18
- /**
19
- * 用户查询hook,当查询参数变化时,会自动查询,订阅结果即可
20
- * @param queryPrerequisites 执行查询的前提条件,只有此方法返回true时,查询才会执行
21
- * @param customFilter 自定义查询过滤条件,可以通过这个回调方法,通过程序方式添加自定义的过滤条件
22
- * @param onQueryResultReturned 查询成功时的回调方法,接收Page<UserReference>类型参数
23
- * @param scroll 是否滚动模式,滚动模式下,翻页后新页数据会追加到queryState.users集合中,而不是直接赋予queryState.users
24
- * @param axios 自定义axios实例
25
- * @param notPaged 不分页
26
- */
27
- export function useUserRefQuery(
28
- queryPrerequisites?: () => boolean,
29
- customFilter?: (qUser: InstanceType<typeof QUser>) => BooleanResultExpression,
30
- onQueryResultReturned?: (result?: UserReference[], paramsChanged?: boolean) => void,
31
- scroll?: boolean,
32
- axios?: IAceAxios,
33
- notPaged?: boolean) {
34
- const queryParams = ref<{
35
- /**
36
- * 用户域Id查询参数
37
- */
38
- realmId?: string,
39
- /**
40
- * 部门查询参数
41
- */
42
- currentDept?: TreeNodeType,
43
- /**
44
- * 用户姓名、用户名或用户拼音过滤参数
45
- */
46
- name?: string,
47
- /**
48
- * 排序描述符
49
- */
50
- currentSort?: SortDescriptor,
51
- /**
52
- * 用户组查询参数
53
- */
54
- currentGroup?: TreeNodeType,
55
- /**
56
- * 自定义组查询参数
57
- */
58
- currentCustomGroup?: TreeNodeType
59
- }>({})
60
-
61
- const pageParams = ref<{
62
- /**
63
- * 当前页码
64
- */
65
- currentPage: number,
66
- /**
67
- * 页内数据行数
68
- */
69
- pageSize: number
70
- }>({
71
- currentPage: 1,
72
- pageSize: 50
73
- })
74
-
75
- const queryResult = ref<{
76
- /**
77
- * 总数据量
78
- */
79
- total: number,
80
- /**
81
- * 查询结果集
82
- */
83
- users: UserReference[]
84
- }>({
85
- total: 0,
86
- users: []
87
- })
88
-
89
- if (!axios) axios = createAxiosWithoutCache();
90
- const userApi = useUserApi(axios);
91
- const loading = useLoading(axios);
92
- const queryParamChanged = ref<boolean>(false)
93
-
94
- function doQuery() {
95
- queryUsers().then(r => {
96
- if (onQueryResultReturned) {
97
- onQueryResultReturned(r, queryParamChanged.value);
98
- }
99
- queryParamChanged.value = false;
100
- })
101
- }
102
-
103
- const debounceDoQuery = debounce(doQuery, 300)
104
-
105
- function queryOnParamsChanged() {
106
- queryResult.value.total = 0;
107
- queryResult.value.users = [];
108
- if (pageParams.value.currentPage !== 1) {
109
- pageParams.value.currentPage = 1;
110
- } else {
111
- debounceDoQuery();
112
- }
113
- }
114
-
115
- watch(queryParams, () => {
116
- queryParamChanged.value = true;
117
- queryOnParamsChanged();
118
- }, {
119
- deep: true
120
- })
121
-
122
- watch(() => pageParams.value.pageSize, () => {
123
- queryParamChanged.value = true;
124
- queryOnParamsChanged();
125
- })
126
-
127
- watch(() => pageParams.value.currentPage, () => {
128
- queryUsers().then(r => {
129
- if (onQueryResultReturned) {
130
- onQueryResultReturned(r, queryParamChanged.value);
131
- }
132
- queryParamChanged.value = false;
133
- });
134
- })
135
-
136
- async function queryUsers() {
137
- if (queryPrerequisites && !queryPrerequisites()) {
138
- return Promise.resolve(undefined);
139
- }
140
- if (!queryParams.value.realmId) {
141
- const defaultRealm = await useRealms().getDefaultRealm();
142
- queryParams.value.realmId = defaultRealm.id;
143
- }
144
- const builder = useUserQueryBuilder();
145
- const qUser = builder.getQEntity();
146
- builder.and(qUser.realm.id.eq(queryParams.value.realmId)).and(qUser.recycled.eq(false));
147
- const currentDept = queryParams.value.currentDept;
148
- if (currentDept) {
149
- // 1=1 and user.department.id = currentDepartmentId
150
- if (currentDept.id == NO_DEPARTMENT) {
151
- builder.and(qUser.department.isNull())
152
- } else if (currentDept.id !== ALL_DEPARTMENT) {
153
- builder.and(qUser.department.sortPath.startWith(currentDept.sortPath));
154
- }
155
- }
156
- const currentGroup = queryParams.value.currentGroup;
157
- if (currentGroup) {
158
- builder.and(qUser.userGroups.any().group.sortPath.startWith(currentGroup.sortPath));
159
- }
160
- const currentCustomGroup = queryParams.value.currentCustomGroup;
161
- if (currentCustomGroup) {
162
- builder.and(qUser.customGroups.any().customGroup.sortPath
163
- .startWith(currentCustomGroup.sortPath));
164
- }
165
- const name = queryParams.value.name;
166
- if (name) {
167
- // and (user.username like %nameQuery% or user.fullName like %nameQuery% or user.pinYinName like %nameQuery%
168
- const queryText = "%" + name.split('').join('%') + "%"
169
- builder.and(qUser.username.like(queryText)
170
- .or(qUser.fullName.like(queryText))
171
- .or(qUser.pinYinName.like(queryText))
172
- .or(qUser.mobile.like(queryText)))
173
- }
174
- if (customFilter) {
175
- builder.and(customFilter(qUser));
176
- }
177
- const currentSort = queryParams.value.currentSort;
178
- if (currentSort) {
179
- builder.orderBy(currentSort)
180
- }
181
- const filter = builder.build();
182
- if (notPaged) {
183
- return userApi.queryUserRefs(filter).then(res => {
184
- queryResult.value.users = res;
185
- return res;
186
- })
187
- } else {
188
- const currentPage = pageParams.value.currentPage - 1;
189
- return userApi.queryUserRefsPaged(filter, currentPage, pageParams.value.pageSize)
190
- .then(res => {
191
- if (scroll && currentPage > 0) {
192
- queryResult.value.users.push(...res.content);
193
- } else {
194
- queryResult.value.users = res.content;
195
- }
196
- queryResult.value.total = res.totalElements;
197
- return res.content;
198
- })
199
- }
200
- }
201
-
202
- return {
203
- /**
204
- * 查询的参数
205
- */
206
- queryParams,
207
- /**
208
- * 分页参数
209
- */
210
- pageParams,
211
- /**
212
- * 查询结果
213
- */
214
- queryResult,
215
- /**
216
- * 查询方法
217
- */
218
- queryUsers,
219
- /**
220
- * loading状态
221
- */
222
- loading
223
- }
224
- }
1
+ import {ref, watch} from 'vue';
2
+ import {
3
+ type BooleanResultExpression,
4
+ createAxiosWithoutCache,
5
+ type IAceAxios,
6
+ QUser,
7
+ type SortDescriptor,
8
+ useLoading,
9
+ type UserReference,
10
+ useUserApi,
11
+ useUserQueryBuilder
12
+ } from "@jari-ace/app-bolts";
13
+ import type {TreeNodeType} from "./useTreeData";
14
+ import {ALL_DEPARTMENT, NO_DEPARTMENT} from "../components/departmentPicker/src/consts";
15
+ import debounce from "lodash-es/debounce";
16
+ import { useRealms } from "./useRealms";
17
+
18
+ /**
19
+ * 用户查询hook,当查询参数变化时,会自动查询,订阅结果即可
20
+ * @param queryPrerequisites 执行查询的前提条件,只有此方法返回true时,查询才会执行
21
+ * @param customFilter 自定义查询过滤条件,可以通过这个回调方法,通过程序方式添加自定义的过滤条件
22
+ * @param onQueryResultReturned 查询成功时的回调方法,接收Page<UserReference>类型参数
23
+ * @param scroll 是否滚动模式,滚动模式下,翻页后新页数据会追加到queryState.users集合中,而不是直接赋予queryState.users
24
+ * @param axios 自定义axios实例
25
+ * @param notPaged 不分页
26
+ */
27
+ export function useUserRefQuery(
28
+ queryPrerequisites?: () => boolean,
29
+ customFilter?: (qUser: InstanceType<typeof QUser>) => BooleanResultExpression,
30
+ onQueryResultReturned?: (result?: UserReference[], paramsChanged?: boolean) => void,
31
+ scroll?: boolean,
32
+ axios?: IAceAxios,
33
+ notPaged?: boolean) {
34
+ const queryParams = ref<{
35
+ /**
36
+ * 用户域Id查询参数
37
+ */
38
+ realmId?: string,
39
+ /**
40
+ * 部门查询参数
41
+ */
42
+ currentDept?: TreeNodeType,
43
+ /**
44
+ * 用户姓名、用户名或用户拼音过滤参数
45
+ */
46
+ name?: string,
47
+ /**
48
+ * 排序描述符
49
+ */
50
+ currentSort?: SortDescriptor,
51
+ /**
52
+ * 用户组查询参数
53
+ */
54
+ currentGroup?: TreeNodeType,
55
+ /**
56
+ * 自定义组查询参数
57
+ */
58
+ currentCustomGroup?: TreeNodeType,
59
+ /**
60
+ * 密级过滤
61
+ */
62
+ classificationLevel?: number,
63
+ }>({})
64
+
65
+ const pageParams = ref<{
66
+ /**
67
+ * 当前页码
68
+ */
69
+ currentPage: number,
70
+ /**
71
+ * 页内数据行数
72
+ */
73
+ pageSize: number
74
+ }>({
75
+ currentPage: 1,
76
+ pageSize: 50
77
+ })
78
+
79
+ const queryResult = ref<{
80
+ /**
81
+ * 总数据量
82
+ */
83
+ total: number,
84
+ /**
85
+ * 查询结果集
86
+ */
87
+ users: UserReference[]
88
+ }>({
89
+ total: 0,
90
+ users: []
91
+ })
92
+
93
+ if (!axios) axios = createAxiosWithoutCache();
94
+ const userApi = useUserApi(axios);
95
+ const loading = useLoading(axios);
96
+ const queryParamChanged = ref<boolean>(false)
97
+
98
+ function doQuery() {
99
+ queryUsers().then(r => {
100
+ if (onQueryResultReturned) {
101
+ onQueryResultReturned(r, queryParamChanged.value);
102
+ }
103
+ queryParamChanged.value = false;
104
+ })
105
+ }
106
+
107
+ const debounceDoQuery = debounce(doQuery, 300)
108
+
109
+ function queryOnParamsChanged() {
110
+ queryResult.value.total = 0;
111
+ queryResult.value.users = [];
112
+ if (pageParams.value.currentPage !== 1) {
113
+ pageParams.value.currentPage = 1;
114
+ } else {
115
+ debounceDoQuery();
116
+ }
117
+ }
118
+
119
+ watch(queryParams, () => {
120
+ queryParamChanged.value = true;
121
+ queryOnParamsChanged();
122
+ }, {
123
+ deep: true
124
+ })
125
+
126
+ watch(() => pageParams.value.pageSize, () => {
127
+ queryParamChanged.value = true;
128
+ queryOnParamsChanged();
129
+ })
130
+
131
+ watch(() => pageParams.value.currentPage, () => {
132
+ queryUsers().then(r => {
133
+ if (onQueryResultReturned) {
134
+ onQueryResultReturned(r, queryParamChanged.value);
135
+ }
136
+ queryParamChanged.value = false;
137
+ });
138
+ })
139
+
140
+ async function queryUsers() {
141
+ if (queryPrerequisites && !queryPrerequisites()) {
142
+ return Promise.resolve(undefined);
143
+ }
144
+ if (!queryParams.value.realmId) {
145
+ const defaultRealm = await useRealms().getDefaultRealm();
146
+ queryParams.value.realmId = defaultRealm.id;
147
+ }
148
+ const builder = useUserQueryBuilder();
149
+ const qUser = builder.getQEntity();
150
+ builder.and(qUser.realm.id.eq(queryParams.value.realmId)).and(qUser.recycled.eq(false));
151
+ const currentDept = queryParams.value.currentDept;
152
+ if (currentDept) {
153
+ // 1=1 and user.department.id = currentDepartmentId
154
+ if (currentDept.id == NO_DEPARTMENT) {
155
+ builder.and(qUser.department.isNull())
156
+ } else if (currentDept.id !== ALL_DEPARTMENT) {
157
+ builder.and(qUser.department.sortPath.startWith(currentDept.sortPath));
158
+ }
159
+ }
160
+ const classificationLevel = queryParams.value.classificationLevel;
161
+ if (classificationLevel) {
162
+ builder.and(qUser.classifiedLevel.loe(classificationLevel))
163
+ }
164
+ const currentGroup = queryParams.value.currentGroup;
165
+ if (currentGroup) {
166
+ builder.and(qUser.userGroups.any().group.sortPath.startWith(currentGroup.sortPath));
167
+ }
168
+ const currentCustomGroup = queryParams.value.currentCustomGroup;
169
+ if (currentCustomGroup) {
170
+ builder.and(qUser.customGroups.any().customGroup.sortPath
171
+ .startWith(currentCustomGroup.sortPath));
172
+ }
173
+ const name = queryParams.value.name;
174
+ if (name) {
175
+ // and (user.username like %nameQuery% or user.fullName like %nameQuery% or user.pinYinName like %nameQuery%
176
+ const queryText = "%" + name.split('').join('%') + "%"
177
+ builder.and(qUser.username.like(queryText)
178
+ .or(qUser.fullName.like(queryText))
179
+ .or(qUser.pinYinName.like(queryText))
180
+ .or(qUser.mobile.like(queryText)))
181
+ }
182
+ if (customFilter) {
183
+ builder.and(customFilter(qUser));
184
+ }
185
+ const currentSort = queryParams.value.currentSort;
186
+ if (currentSort) {
187
+ builder.orderBy(currentSort)
188
+ }
189
+ const filter = builder.build();
190
+ if (notPaged) {
191
+ return userApi.queryUserRefs(filter).then(res => {
192
+ queryResult.value.users = res;
193
+ return res;
194
+ })
195
+ } else {
196
+ const currentPage = pageParams.value.currentPage - 1;
197
+ return userApi.queryUserRefsPaged(filter, currentPage, pageParams.value.pageSize)
198
+ .then(res => {
199
+ if (scroll && currentPage > 0) {
200
+ queryResult.value.users.push(...res.content);
201
+ } else {
202
+ queryResult.value.users = res.content;
203
+ }
204
+ queryResult.value.total = res.totalElements;
205
+ return res.content;
206
+ })
207
+ }
208
+ }
209
+
210
+ return {
211
+ /**
212
+ * 查询的参数
213
+ */
214
+ queryParams,
215
+ /**
216
+ * 分页参数
217
+ */
218
+ pageParams,
219
+ /**
220
+ * 查询结果
221
+ */
222
+ queryResult,
223
+ /**
224
+ * 查询方法
225
+ */
226
+ queryUsers,
227
+ /**
228
+ * loading状态
229
+ */
230
+ loading
231
+ }
232
+ }
package/packages/index.ts CHANGED
@@ -1,22 +1,21 @@
1
- import {type App, type Plugin} from "vue";
2
- import * as components from "./components";
3
- import {installDirectives} from "./directives";
4
-
5
- export * from "./components";
6
- export const AceVueUI: Plugin = {
7
- install(app: App<Element>) {
8
- for (const [key, comp] of Object.entries(components)) {
9
- app.component(key, comp);
10
- }
11
- installDirectives(app)
12
- },
13
- };
14
-
15
- export * from "./hooks/useBackendValidations"
16
- export * from "./hooks/useTreeData"
17
- export * from "./hooks/useAppInstances"
18
- export * from "./directives"
19
- export * from "./hooks/useDateTimeShortCuts"
20
- export * from "./components/scrollbar/utils"
21
- export * from "./hooks/useBridage"
22
- export * from "./hooks/useRealms"
1
+ import {type App, type Plugin} from "vue";
2
+ import * as components from "./components";
3
+ import {installDirectives} from "./directives";
4
+
5
+ export * from "./components";
6
+ export const AceVueUI: Plugin = {
7
+ install(app: App<Element>) {
8
+ for (const [key, comp] of Object.entries(components)) {
9
+ app.component(key, comp);
10
+ }
11
+ installDirectives(app)
12
+ },
13
+ };
14
+
15
+ export * from "./hooks/useBackendValidations"
16
+ export * from "./hooks/useTreeData"
17
+ export * from "./hooks/useAppInstances"
18
+ export * from "./directives"
19
+ export * from "./hooks/useDateTimeShortCuts"
20
+ export * from "./components/scrollbar/utils"
21
+ export * from "./hooks/useBridage"
@@ -1,8 +1,8 @@
1
- [
2
- {
3
- "compName": "DemoComponent",
4
- "compZhName": "示例",
5
- "compDesc": "这是一个示例组件",
6
- "compClassName": "button"
7
- }
1
+ [
2
+ {
3
+ "compName": "DemoComponent",
4
+ "compZhName": "示例",
5
+ "compDesc": "这是一个示例组件",
6
+ "compClassName": "button"
7
+ }
8
8
  ]
@@ -1,13 +1,13 @@
1
- type ShortcutHandlerType = (event: KeyboardEvent) => void;
2
-
3
- interface ShortcutHandlerStackItem {
4
- keys: string;
5
- el: HTMLElement;
6
- handler: ShortcutHandlerType;
7
- prev?: ShortcutHandlerStackItem
8
- }
9
-
10
- interface HTMLElement {
11
- __vueShortcutHandler__?: ShortcutHandlerStackItem;
12
- __visibilityObserver__?: IntersectionObserver;
13
- }
1
+ type ShortcutHandlerType = (event: KeyboardEvent) => void;
2
+
3
+ interface ShortcutHandlerStackItem {
4
+ keys: string;
5
+ el: HTMLElement;
6
+ handler: ShortcutHandlerType;
7
+ prev?: ShortcutHandlerStackItem
8
+ }
9
+
10
+ interface HTMLElement {
11
+ __vueShortcutHandler__?: ShortcutHandlerStackItem;
12
+ __visibilityObserver__?: IntersectionObserver;
13
+ }
@@ -1,16 +1,16 @@
1
- import {type GlobalData, Jari, type MicroAppContext} from "@jari-ace/app-bolts";
2
-
3
-
4
- declare global {
5
- interface Window {
6
- appContext?: MicroAppContext;
7
- microApp?: {
8
- getGlobalData: () => GlobalData;
9
- addGlobalDataListener: (data: (data: MicroAppContext) => void) => void;
10
- addDataListener:any
11
- } & any,
12
- __MICRO_APP_ENVIRONMENT__: boolean,
13
- rawWindow: Window,
14
- appDescriptor: Jari.Ace.ApplicationDescriptor;
15
- }
16
- }
1
+ import {type GlobalData, Jari, type MicroAppContext} from "@jari-ace/app-bolts";
2
+
3
+
4
+ declare global {
5
+ interface Window {
6
+ appContext?: MicroAppContext;
7
+ microApp?: {
8
+ getGlobalData: () => GlobalData;
9
+ addGlobalDataListener: (data: (data: MicroAppContext) => void) => void;
10
+ addDataListener:any
11
+ } & any,
12
+ __MICRO_APP_ENVIRONMENT__: boolean,
13
+ rawWindow: Window,
14
+ appDescriptor: Jari.Ace.ApplicationDescriptor;
15
+ }
16
+ }