@airpower/web 0.0.30 → 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 +59 -21
- package/dist/components/index.d.ts +1 -1
- package/dist/decorator/{Table.d.ts → @table/Table.d.ts} +1 -1
- package/dist/decorator/{config/table → @table}/index.d.ts +1 -0
- package/dist/decorator/index.d.ts +1 -2
- 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/decorator/config/index.d.ts +0 -1
- /package/dist/components/{Table.vue.d.ts → WebTable.vue.d.ts} +0 -0
- /package/dist/decorator/{config/table → @table}/IElementTableColumn.d.ts +0 -0
- /package/dist/decorator/{config/table → @table}/ITableFieldConfig.d.ts +0 -0
- /package/dist/decorator/{config/table → @table}/TableType.d.ts +0 -0
- /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";
|
|
@@ -34,15 +37,24 @@ function getTableConfigList(target, keyList) {
|
|
|
34
37
|
});
|
|
35
38
|
}
|
|
36
39
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
37
|
-
__name: "
|
|
40
|
+
__name: "WebTable",
|
|
38
41
|
props: {
|
|
42
|
+
/**
|
|
43
|
+
* ### 表格列配置
|
|
44
|
+
*/
|
|
39
45
|
columns: {
|
|
40
46
|
type: Array
|
|
41
47
|
},
|
|
48
|
+
/**
|
|
49
|
+
* ### 表格数据
|
|
50
|
+
*/
|
|
42
51
|
data: {
|
|
43
52
|
type: Array,
|
|
44
53
|
required: true
|
|
45
54
|
},
|
|
55
|
+
/**
|
|
56
|
+
* ### 表格实体类
|
|
57
|
+
*/
|
|
46
58
|
clazz: {
|
|
47
59
|
type: Function,
|
|
48
60
|
required: true
|
|
@@ -55,10 +67,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
55
67
|
return props.columns;
|
|
56
68
|
}
|
|
57
69
|
const instance = AirClassTransformer.newInstance(props.clazz);
|
|
58
|
-
|
|
59
|
-
const list = getTableConfigList(instance, []);
|
|
60
|
-
console.warn("[table]: list:", list);
|
|
61
|
-
return list;
|
|
70
|
+
return getTableConfigList(instance, []);
|
|
62
71
|
});
|
|
63
72
|
return (_ctx, _cache) => {
|
|
64
73
|
return openBlock(), createBlock(unref(ElTable), mergeProps({
|
|
@@ -67,16 +76,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
67
76
|
}, _ctx.$attrs, toHandlers(_ctx.$attrs)), {
|
|
68
77
|
default: withCtx(() => [
|
|
69
78
|
(openBlock(true), createElementBlock(Fragment, null, renderList(tableColumns.value, (item) => {
|
|
70
|
-
return openBlock(),
|
|
71
|
-
key: item.key
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
], 64)) : (openBlock(), createBlock(unref(ElTableColumn), mergeProps({
|
|
76
|
-
key: 1,
|
|
77
|
-
ref_for: true
|
|
78
|
-
}, item), null, 16))
|
|
79
|
-
], 64);
|
|
79
|
+
return openBlock(), createBlock(unref(ElTableColumn), mergeProps({
|
|
80
|
+
key: item.key,
|
|
81
|
+
prop: item.key,
|
|
82
|
+
ref_for: true
|
|
83
|
+
}, item), null, 16, ["prop"]);
|
|
80
84
|
}), 128))
|
|
81
85
|
]),
|
|
82
86
|
_: 1
|
|
@@ -84,7 +88,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
84
88
|
};
|
|
85
89
|
}
|
|
86
90
|
});
|
|
87
|
-
class
|
|
91
|
+
class WebAccessToken {
|
|
88
92
|
/**
|
|
89
93
|
* ### 获取AccessToken
|
|
90
94
|
*/
|
|
@@ -356,8 +360,12 @@ function useTableTree(entityClass, serviceClass, option = {}) {
|
|
|
356
360
|
});
|
|
357
361
|
}
|
|
358
362
|
class WebHttp extends AbstractHttp {
|
|
359
|
-
|
|
360
|
-
|
|
363
|
+
constructor() {
|
|
364
|
+
super(...arguments);
|
|
365
|
+
/**
|
|
366
|
+
* ### 加载状态
|
|
367
|
+
*/
|
|
368
|
+
__publicField(this, "loading", ref(false));
|
|
361
369
|
}
|
|
362
370
|
async request(body) {
|
|
363
371
|
const axiosConfig = {};
|
|
@@ -386,12 +394,42 @@ class WebHttp extends AbstractHttp {
|
|
|
386
394
|
return response;
|
|
387
395
|
}
|
|
388
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
|
+
}
|
|
389
409
|
}
|
|
390
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
|
+
}
|
|
391
427
|
createHttp(url) {
|
|
392
|
-
|
|
428
|
+
const http = WebHttp.create(url, (error) => {
|
|
393
429
|
ElMessage.error(error.message);
|
|
394
430
|
});
|
|
431
|
+
http.loading = this.loading;
|
|
432
|
+
return http;
|
|
395
433
|
}
|
|
396
434
|
showSuccess(successMessage) {
|
|
397
435
|
ElMessage.success(successMessage);
|
|
@@ -403,7 +441,7 @@ class AbstractWebService extends AbstractEntityService {
|
|
|
403
441
|
export {
|
|
404
442
|
AbstractWebService,
|
|
405
443
|
Table,
|
|
406
|
-
|
|
444
|
+
WebAccessToken,
|
|
407
445
|
WebHttp,
|
|
408
446
|
WebI18n,
|
|
409
447
|
_sfc_main as WebTable,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { default as WebTable } from './
|
|
1
|
+
import { default as WebTable } from './WebTable.vue';
|
|
2
2
|
export { WebTable, };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from './Table';
|
|
1
|
+
export * from './@table';
|
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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './table';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|