@skyfox2000/webui 1.5.21 → 1.5.23

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.
@@ -3,6 +3,7 @@ import {
3
3
  ApiResponse,
4
4
  fieldMapping,
5
5
  httpPost,
6
+ httpGet,
6
7
  IUrlInfo,
7
8
  parseFieldTemplate,
8
9
  ReqParams,
@@ -165,7 +166,9 @@ const queryOptions = <T>(
165
166
  if (!params.Query) params.Query = {};
166
167
  optionCtrl.optionQuery = params;
167
168
  optionCtrl.isOptionLoading.value = true;
168
- return httpPost<T>(optionUrl, params)
169
+ // 根据method选择合适的HTTP方法,查询操作通常使用GET
170
+ const httpMethod = optionUrl.method === 'GET' ? httpGet : httpPost;
171
+ return httpMethod<T>(optionUrl, params)
169
172
  .then((result: ApiResponse<T> | null) => {
170
173
  if (result?.status === ResStatus.SUCCESS) {
171
174
  if (result.data) {
@@ -114,7 +114,11 @@ export const gridQueryFind = <T>(gridCtrl: GridControl<T>): Promise<FindResult>
114
114
 
115
115
  return doQuery<FindResult>(gridCtrl, {
116
116
  urlKey,
117
- url: gridCtrl.gridUrl,
117
+ url: {
118
+ url: gridCtrl.gridUrl?.url || '',
119
+ ...gridCtrl.gridUrl,
120
+ loadingText: gridCtrl.gridUrl?.loadingText || $t('webui.common.dataLoading'),
121
+ },
118
122
  params: gridCtrl.gridQuery,
119
123
  loadingState: gridCtrl.isGridLoading,
120
124
  loadingText: gridCtrl.gridUrl?.loadingText === false ? false : (gridCtrl.gridUrl?.loadingText || $t('webui.common.dataLoading')),