@airpower/web 0.0.35 → 0.0.36
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/README.md
CHANGED
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
13
|
-
<a href="https://
|
|
13
|
+
<a href="https://github.com/AirPowerTeam/AirPower-Web">Github</a> /
|
|
14
|
+
<a href="https://gitee.com/air-power/AirPower-Web">Gitee</a> /
|
|
15
|
+
<a href="https://www.npmjs.com/package/@airpower/web">NPM</a>
|
|
14
16
|
</p>
|
|
15
17
|
|
|
16
18
|
## 🎉 项目介绍
|
package/dist/airpower.web.js
CHANGED
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { defineComponent, computed, createBlock, openBlock, unref, mergeProps, toHandlers, withCtx, createElementBlock, Fragment, renderList, ref } from "vue";
|
|
5
|
-
import { AirDecorator, getFieldConfig, AirClassTransformer,
|
|
5
|
+
import { AirDecorator, getFieldConfig, AirClassTransformer, HttpConfig, AirI18n, QueryPageRequest, QueryPageResponse, Page, AbstractHttp, HttpResponse, HttpStatus, AbstractEntityService } from "@airpower/core";
|
|
6
6
|
export * from "@airpower/core";
|
|
7
7
|
import { ElTable, ElTableColumn, ElMessageBox, ElMessage } from "element-plus";
|
|
8
8
|
import axios from "axios";
|
|
@@ -94,20 +94,20 @@ class WebAccessToken {
|
|
|
94
94
|
*/
|
|
95
95
|
static getAccessToken() {
|
|
96
96
|
var _a;
|
|
97
|
-
return ((_a = localStorage.getItem(
|
|
97
|
+
return ((_a = localStorage.getItem(HttpConfig.authorizationHeaderKey)) == null ? void 0 : _a.toString()) || "";
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
100
100
|
* ### 设置AccessToken
|
|
101
101
|
* @param accessToken AccessToken
|
|
102
102
|
*/
|
|
103
103
|
static setAccessToken(accessToken) {
|
|
104
|
-
localStorage.setItem(
|
|
104
|
+
localStorage.setItem(HttpConfig.authorizationHeaderKey, accessToken);
|
|
105
105
|
}
|
|
106
106
|
/**
|
|
107
107
|
* ### 移除AccessToken
|
|
108
108
|
*/
|
|
109
109
|
static removeAccessToken() {
|
|
110
|
-
localStorage.removeItem(
|
|
110
|
+
localStorage.removeItem(HttpConfig.authorizationHeaderKey);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
class WebI18n extends AirI18n {
|
|
@@ -377,7 +377,7 @@ class WebHttp extends AbstractHttp {
|
|
|
377
377
|
const response = new HttpResponse();
|
|
378
378
|
try {
|
|
379
379
|
const res = await axios.request(axiosConfig);
|
|
380
|
-
if (res.status !==
|
|
380
|
+
if (res.status !== HttpStatus.OK) {
|
|
381
381
|
response.code = res.status;
|
|
382
382
|
response.message = res.statusText;
|
|
383
383
|
response.data = res;
|
|
@@ -388,7 +388,7 @@ class WebHttp extends AbstractHttp {
|
|
|
388
388
|
response.data = res.data.data;
|
|
389
389
|
return response;
|
|
390
390
|
} catch (e) {
|
|
391
|
-
response.code =
|
|
391
|
+
response.code = HttpStatus.INTERNAL_SERVER_ERROR;
|
|
392
392
|
response.message = e.message;
|
|
393
393
|
response.data = e;
|
|
394
394
|
return response;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ITree } from '@airpower/core';
|
|
1
|
+
import { AirEntity, ITree } from '@airpower/core';
|
|
2
2
|
import { IUseTableOption } from './IUseTableOption';
|
|
3
3
|
/**
|
|
4
4
|
* # `TableTreeList` 的 `Hook` 可选配置
|
|
5
5
|
* @author Hamm.cn
|
|
6
6
|
*/
|
|
7
|
-
export interface IUseTableTreeOption<T extends ITree> extends IUseTableOption<T> {
|
|
7
|
+
export interface IUseTableTreeOption<T extends ITree & AirEntity> extends IUseTableOption<T> {
|
|
8
8
|
/**
|
|
9
9
|
* ### 添加行的子项的前置拦截方法
|
|
10
10
|
* 参数为发起请求的数据,请处理后返回 `param`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClassConstructor, ITree } from '@airpower/core';
|
|
1
|
+
import { AirEntity, ClassConstructor, ITree } from '@airpower/core';
|
|
2
2
|
import { AbstractWebService } from '../service';
|
|
3
3
|
import { IUseTableTreeOption, IUseTableTreeResult } from './interface';
|
|
4
4
|
/**
|
|
@@ -8,4 +8,4 @@ import { IUseTableTreeOption, IUseTableTreeResult } from './interface';
|
|
|
8
8
|
* @param option `可选` 更多配置
|
|
9
9
|
* @author Hamm.cn
|
|
10
10
|
*/
|
|
11
|
-
export declare function useTableTree<E extends ITree, S extends AbstractWebService<E>>(entityClass: ClassConstructor<E>, serviceClass: ClassConstructor<S>, option?: IUseTableTreeOption<E>): IUseTableTreeResult<E, S>;
|
|
11
|
+
export declare function useTableTree<E extends ITree & AirEntity, S extends AbstractWebService<E>>(entityClass: ClassConstructor<E>, serviceClass: ClassConstructor<S>, option?: IUseTableTreeOption<E>): IUseTableTreeResult<E, S>;
|
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.36",
|
|
5
5
|
"description": "AirPower-Web",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Hamm",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"preview": "vite preview"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@airpower/core": "^0.1.
|
|
42
|
+
"@airpower/core": "^0.1.13",
|
|
43
43
|
"axios": "^1.8.4",
|
|
44
44
|
"element-plus": "^2.9.7",
|
|
45
45
|
"vue": "^3.5.13"
|