zzz-pc-view 0.0.138 → 0.0.140

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zzz-pc-view",
3
- "version": "0.0.138",
3
+ "version": "0.0.140",
4
4
  "main": "src/index.umd.js",
5
5
  "module": "src/index.es.js",
6
6
  "types": "src/index.d.ts",
@@ -1,5 +1,6 @@
1
1
  import { AxiosResponse } from 'axios';
2
- import { httpRequest, KeyMatch } from '../../utils';
2
+ import { ZUtils } from '../../index-decorators';
3
+ import { KeyMatch } from '../../utils';
3
4
  import { TypeWithPrototype, TypeWithPrototypeWithoutNew } from '../DeclareType';
4
5
  import { Reactive } from 'vue';
5
6
  /**
@@ -139,41 +140,41 @@ export declare class CurdApi<T extends object = object, P extends PaginationResp
139
140
  * @param {T | Reactive<T>} [query] - 查询参数,可以是普通对象或Vue的响应式对象。
140
141
  * @returns {Promise<T[]>} - 返回一个包含列表数据的Promise。
141
142
  */
142
- getList(query?: T | Reactive<T>): httpRequest.HttpRequestPromise<T[]>;
143
+ getList(query?: T | Reactive<T>): ZUtils.httpRequest.HttpRequestPromise<T[]>;
143
144
  /**
144
145
  * 分页获取列表数据。
145
146
  * @param {object} pagination - 分页参数。
146
147
  * @param {T | Reactive<T>} [query] - 查询参数。
147
148
  * @returns {Promise<P>} - 返回一个包含分页数据的 Promise。
148
149
  */
149
- getListByPage(pagination: object, query?: T | Reactive<T>): httpRequest.HttpRequestPromise<Awaited<P>>;
150
+ getListByPage(pagination: object, query?: T | Reactive<T>): ZUtils.httpRequest.HttpRequestPromise<Awaited<P>>;
150
151
  /**
151
152
  * 获取指定数据的详细信息。
152
153
  * 这个方法会根据传入的数据对象的ID,从API获取该数据的详细信息,并将其绑定到目标类。
153
154
  * @param {T} data - 包含ID的数据对象。
154
155
  * @returns {Promise<T>} - 返回一个包含详细信息的Promise。
155
156
  */
156
- getDetail(data: T): httpRequest.HttpRequestPromise<Awaited<T>>;
157
+ getDetail(data: T): ZUtils.httpRequest.HttpRequestPromise<Awaited<T>>;
157
158
  /**
158
159
  * 保存数据。
159
160
  * @param {T} data - 要保存的数据对象。
160
161
  * @param {EditTypeId} saveTypeId - 保存类型的 ID。
161
162
  * @returns {Promise<any>} - 返回一个包含保存结果的 Promise。
162
163
  */
163
- save(data: T, saveTypeId: EditTypeId): httpRequest.HttpRequestPromise<T>;
164
+ save(data: T, saveTypeId: EditTypeId): ZUtils.httpRequest.HttpRequestPromise<T>;
164
165
  /**
165
166
  * 删除数据。
166
167
  * @param {T} data - 包含 ID 的数据对象。
167
168
  * @returns {Promise<any>} - 返回一个包含删除结果的 Promise。
168
169
  */
169
- delete(data: T): httpRequest.HttpRequestPromise<unknown>;
170
+ delete(data: T): ZUtils.httpRequest.HttpRequestPromise<unknown>;
170
171
  /**
171
172
  * 更改数据状态。
172
173
  * @param {T} data - 包含 ID 的数据对象。
173
174
  * @param {number | boolean} state - 新的状态值。
174
175
  * @returns {Promise<any>} - 返回一个包含更改结果的 Promise。
175
176
  */
176
- changeState(data: T, state: number | boolean): httpRequest.HttpRequestPromise<unknown>;
177
+ changeState(data: T, state: number | boolean): ZUtils.httpRequest.HttpRequestPromise<unknown>;
177
178
  /**
178
179
  * 导出数据。
179
180
  * 该方法用于从API导出数据,并将其作为Blob对象返回。
@@ -182,7 +183,7 @@ export declare class CurdApi<T extends object = object, P extends PaginationResp
182
183
  * @param {T | Reactive<T>} [query] - 查询参数,可以是普通对象或Vue的响应式对象。
183
184
  * @returns {Promise<any>} - 返回一个包含导出结果的Promise。
184
185
  */
185
- export(query?: T | Reactive<T>): httpRequest.HttpRequestPromise<void>;
186
+ export(query?: T | Reactive<T>): ZUtils.httpRequest.HttpRequestPromise<void>;
186
187
  /**
187
188
  * 生成 API 请求的完整路径。
188
189
  * 该方法会将基础路径和可选的子路径拼接起来,形成一个完整的 API 请求路径。
@@ -195,13 +196,13 @@ export declare class CurdApi<T extends object = object, P extends PaginationResp
195
196
  * @param {T} data - 包含ID的数据对象。
196
197
  * @returns {any} - 返回数据对象的ID。
197
198
  */
198
- protected getId(data: T): never;
199
+ protected getId(data: T): ZUtils.KeyValType | never;
199
200
  /**
200
201
  * 获取目标类的主键。
201
202
  * @returns {string} - 返回主键的属性名。
202
203
  * @throws {Error} - 如果主键未定义,则抛出错误。
203
204
  */
204
- protected getPrimaryKey(): KeyMatch<T, PropertyKey>;
205
+ protected getPrimaryKey(): KeyMatch<T, ZUtils.KeyValType>;
205
206
  /**
206
207
  * 构造函数,用于初始化 CurdApi 实例。
207
208
  * @param {Object} options - 构造函数的参数对象。