@airpower/web 0.0.31 → 0.0.33
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/dist/airpower.web.js +44 -13
- package/dist/{config/WebConfig.d.ts → helper/WebAccessToken.d.ts} +2 -2
- package/dist/helper/index.d.ts +2 -0
- package/dist/http/WebHttp.d.ts +11 -2
- package/dist/index.d.ts +1 -1
- package/dist/service/AbstractWebService.d.ts +12 -1
- package/package.json +4 -4
- package/dist/config/index.d.ts +0 -2
- /package/dist/{config → helper}/WebI18n.d.ts +0 -0
package/dist/airpower.web.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import { defineComponent, computed, createBlock, openBlock, unref, mergeProps, toHandlers, withCtx, createElementBlock, Fragment, renderList, ref } from "vue";
|
|
2
5
|
import { AirDecorator, getFieldConfig, AirClassTransformer, CoreConfig, AirI18n, QueryPageRequest, QueryPageResponse, Page, AbstractHttp, HttpResponse, AbstractEntityService } from "@airpower/core";
|
|
3
6
|
export * from "@airpower/core";
|
|
4
7
|
import { ElTable, ElTableColumn, ElMessageBox, ElMessage } from "element-plus";
|
|
@@ -64,13 +67,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
64
67
|
return props.columns;
|
|
65
68
|
}
|
|
66
69
|
const instance = AirClassTransformer.newInstance(props.clazz);
|
|
67
|
-
|
|
68
|
-
const list = getTableConfigList(instance, []);
|
|
69
|
-
console.warn("[table]: list:", list);
|
|
70
|
-
return list;
|
|
71
|
-
});
|
|
72
|
-
watch(props.data, () => {
|
|
73
|
-
console.warn("[table]: data:", props.data);
|
|
70
|
+
return getTableConfigList(instance, []);
|
|
74
71
|
});
|
|
75
72
|
return (_ctx, _cache) => {
|
|
76
73
|
return openBlock(), createBlock(unref(ElTable), mergeProps({
|
|
@@ -91,7 +88,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
91
88
|
};
|
|
92
89
|
}
|
|
93
90
|
});
|
|
94
|
-
class
|
|
91
|
+
class WebAccessToken {
|
|
95
92
|
/**
|
|
96
93
|
* ### 获取AccessToken
|
|
97
94
|
*/
|
|
@@ -363,8 +360,12 @@ function useTableTree(entityClass, serviceClass, option = {}) {
|
|
|
363
360
|
});
|
|
364
361
|
}
|
|
365
362
|
class WebHttp extends AbstractHttp {
|
|
366
|
-
|
|
367
|
-
|
|
363
|
+
constructor() {
|
|
364
|
+
super(...arguments);
|
|
365
|
+
/**
|
|
366
|
+
* ### 加载状态
|
|
367
|
+
*/
|
|
368
|
+
__publicField(this, "loading", ref(false));
|
|
368
369
|
}
|
|
369
370
|
async request(body) {
|
|
370
371
|
const axiosConfig = {};
|
|
@@ -393,12 +394,42 @@ class WebHttp extends AbstractHttp {
|
|
|
393
394
|
return response;
|
|
394
395
|
}
|
|
395
396
|
}
|
|
397
|
+
/**
|
|
398
|
+
* # 获取AccessToken
|
|
399
|
+
*/
|
|
400
|
+
getAccessToken() {
|
|
401
|
+
return WebAccessToken.getAccessToken();
|
|
402
|
+
}
|
|
403
|
+
startLoading() {
|
|
404
|
+
this.loading.value = true;
|
|
405
|
+
}
|
|
406
|
+
stopLoading() {
|
|
407
|
+
this.loading.value = false;
|
|
408
|
+
}
|
|
396
409
|
}
|
|
397
410
|
class AbstractWebService extends AbstractEntityService {
|
|
411
|
+
constructor() {
|
|
412
|
+
super(...arguments);
|
|
413
|
+
/**
|
|
414
|
+
* ### 是否正在加载中
|
|
415
|
+
*/
|
|
416
|
+
__publicField(this, "loading", ref(false));
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* ### 创建一个 `Service` 对象
|
|
420
|
+
* @param loading 加载状态
|
|
421
|
+
*/
|
|
422
|
+
static createWithLoading(loading) {
|
|
423
|
+
const service = super.create();
|
|
424
|
+
service.loading = loading;
|
|
425
|
+
return service;
|
|
426
|
+
}
|
|
398
427
|
createHttp(url) {
|
|
399
|
-
|
|
428
|
+
const http = WebHttp.create(url, (error) => {
|
|
400
429
|
ElMessage.error(error.message);
|
|
401
430
|
});
|
|
431
|
+
http.loading = this.loading;
|
|
432
|
+
return http;
|
|
402
433
|
}
|
|
403
434
|
showSuccess(successMessage) {
|
|
404
435
|
ElMessage.success(successMessage);
|
|
@@ -410,7 +441,7 @@ class AbstractWebService extends AbstractEntityService {
|
|
|
410
441
|
export {
|
|
411
442
|
AbstractWebService,
|
|
412
443
|
Table,
|
|
413
|
-
|
|
444
|
+
WebAccessToken,
|
|
414
445
|
WebHttp,
|
|
415
446
|
WebI18n,
|
|
416
447
|
_sfc_main as WebTable,
|
package/dist/http/WebHttp.d.ts
CHANGED
|
@@ -4,6 +4,15 @@ import { AbstractHttp, HttpResponse } from '@airpower/core';
|
|
|
4
4
|
* @author Hamm.cn
|
|
5
5
|
*/
|
|
6
6
|
export declare class WebHttp extends AbstractHttp {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* ### 加载状态
|
|
9
|
+
*/
|
|
10
|
+
loading: import('vue').Ref<boolean, boolean>;
|
|
11
|
+
protected request(body?: unknown): Promise<HttpResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* # 获取AccessToken
|
|
14
|
+
*/
|
|
15
|
+
protected getAccessToken(): string;
|
|
16
|
+
protected startLoading(): void;
|
|
17
|
+
protected stopLoading(): void;
|
|
9
18
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { AbstractHttp, AirEntity, AbstractEntityService } from '@airpower/core';
|
|
2
|
+
import { ClassConstructor } from 'airpower';
|
|
3
|
+
import { Ref } from 'vue';
|
|
2
4
|
/**
|
|
3
5
|
* # 实体 `API` 服务超类
|
|
4
6
|
* 包含了常用的增删改查等方法
|
|
@@ -7,7 +9,16 @@ import { AbstractHttp, AirEntity, AbstractEntityService } from '@airpower/core';
|
|
|
7
9
|
* @author Hamm.cn
|
|
8
10
|
*/
|
|
9
11
|
export declare abstract class AbstractWebService<E extends AirEntity> extends AbstractEntityService<E> {
|
|
10
|
-
|
|
12
|
+
/**
|
|
13
|
+
* ### 是否正在加载中
|
|
14
|
+
*/
|
|
15
|
+
loading: Ref<boolean, boolean>;
|
|
16
|
+
/**
|
|
17
|
+
* ### 创建一个 `Service` 对象
|
|
18
|
+
* @param loading 加载状态
|
|
19
|
+
*/
|
|
20
|
+
static createWithLoading<S extends AbstractWebService<E>, E extends AirEntity>(this: ClassConstructor<S>, loading: Ref<boolean>): S;
|
|
21
|
+
protected createHttp(url: string): AbstractHttp;
|
|
11
22
|
protected showSuccess(successMessage: string): void;
|
|
12
23
|
protected showError(errorMessage: string): void;
|
|
13
24
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airpower/web",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.33",
|
|
5
5
|
"description": "AirPower-Web",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Hamm",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"preview": "vite preview"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@airpower/core": "^0.1.
|
|
39
|
+
"@airpower/core": "^0.1.9",
|
|
40
40
|
"axios": "^1.8.4",
|
|
41
41
|
"element-plus": "^2.9.7",
|
|
42
|
-
"vue": "^3.
|
|
42
|
+
"vue": "^3.5.13"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"axios": "^1.8.4",
|
|
46
46
|
"element-plus": "^2.9.7",
|
|
47
|
-
"vue": "^3.
|
|
47
|
+
"vue": "^3.5.13"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@antfu/eslint-config": "^4.11.0",
|
package/dist/config/index.d.ts
DELETED
|
File without changes
|