@airpower/web 0.0.37 → 0.0.38
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 +30 -7
- package/dist/controller/DetailController.d.ts +8 -4
- package/dist/controller/EditorController.d.ts +1 -4
- package/dist/controller/interface/IDetailControllerOption.d.ts +1 -0
- package/dist/controller/interface/ITableControllerOption.d.ts +1 -0
- package/dist/controller/interface/ITableTreeControllerOption.d.ts +1 -0
- package/dist/controller/interface/IUseEditorOption.d.ts +2 -1
- package/dist/controller/table/BaseTableController.d.ts +8 -0
- package/dist/controller/table/TableController.d.ts +1 -0
- package/dist/controller/table/TableTreeController.d.ts +1 -3
- package/dist/decorator/@table/IElementTableColumn.d.ts +1 -0
- package/dist/decorator/@table/ITableFieldConfig.d.ts +1 -0
- package/dist/helper/WebAccessToken.d.ts +1 -0
- package/dist/helper/WebI18n.d.ts +15 -11
- package/package.json +2 -2
package/dist/airpower.web.js
CHANGED
|
@@ -111,18 +111,34 @@ class WebAccessToken {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
class WebI18n extends AirI18n {
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
constructor() {
|
|
115
|
+
super(...arguments);
|
|
116
|
+
__publicField(this, "Detail", "详情");
|
|
117
|
+
__publicField(this, "Edit", "编辑");
|
|
118
|
+
__publicField(this, "Add", "添加");
|
|
119
|
+
__publicField(this, "EditSuccess", "编辑成功");
|
|
120
|
+
__publicField(this, "AddSuccess", "添加成功");
|
|
121
|
+
__publicField(this, "DeleteSuccess", "删除成功");
|
|
122
|
+
__publicField(this, "SelectPlease", "请选择");
|
|
123
|
+
__publicField(this, "DisableSuccess", "禁用成功");
|
|
124
|
+
__publicField(this, "EnableSuccess", "启用成功");
|
|
116
125
|
}
|
|
117
126
|
}
|
|
118
127
|
class DetailController {
|
|
119
128
|
constructor() {
|
|
120
129
|
__publicField(this, "isLoading", ref(false));
|
|
121
130
|
__publicField(this, "formData");
|
|
122
|
-
__publicField(this, "title", ref(WebI18n.get().Detail
|
|
131
|
+
__publicField(this, "title", ref(WebI18n.get().Detail));
|
|
123
132
|
__publicField(this, "service");
|
|
124
133
|
__publicField(this, "option", {});
|
|
125
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* ### 创建详情控制器
|
|
137
|
+
* @param props `defineProps` 的返回值
|
|
138
|
+
* @param entityClass 详情使用的实体类
|
|
139
|
+
* @param serviceClass 详情使用的 `Service`
|
|
140
|
+
* @param option `可选` 更多的配置
|
|
141
|
+
*/
|
|
126
142
|
static create(props, entityClass, serviceClass, option = {}) {
|
|
127
143
|
const instance = new this();
|
|
128
144
|
instance.service = AirClassTransformer.newInstance(serviceClass);
|
|
@@ -149,11 +165,15 @@ class DetailController {
|
|
|
149
165
|
}
|
|
150
166
|
class EditorController extends DetailController {
|
|
151
167
|
async getDetail() {
|
|
152
|
-
this.title.value = this.formData.value.id ? WebI18n.get().Edit
|
|
168
|
+
this.title.value = this.formData.value.id ? WebI18n.get().Edit : WebI18n.get().Add;
|
|
153
169
|
return super.getDetail();
|
|
154
170
|
}
|
|
155
171
|
}
|
|
156
172
|
class BaseTableController {
|
|
173
|
+
/**
|
|
174
|
+
* ### 创建表格控制器
|
|
175
|
+
* @param ServiceClass 服务类
|
|
176
|
+
*/
|
|
157
177
|
constructor(ServiceClass) {
|
|
158
178
|
__publicField(this, "request");
|
|
159
179
|
__publicField(this, "response", ref(new QueryPageResponse()));
|
|
@@ -268,6 +288,9 @@ class BaseTableController {
|
|
|
268
288
|
this.request.value.page = page;
|
|
269
289
|
this.getList();
|
|
270
290
|
}
|
|
291
|
+
/**
|
|
292
|
+
* ### 初始化
|
|
293
|
+
*/
|
|
271
294
|
init() {
|
|
272
295
|
this.service.setLoading(this.isLoading);
|
|
273
296
|
this.getList();
|
|
@@ -294,7 +317,7 @@ class TableController extends BaseTableController {
|
|
|
294
317
|
* @param row 行数据
|
|
295
318
|
*/
|
|
296
319
|
async delete(row) {
|
|
297
|
-
await this.service.delete(row.id, WebI18n.get().DeleteSuccess
|
|
320
|
+
await this.service.delete(row.id, WebI18n.get().DeleteSuccess);
|
|
298
321
|
this.getList();
|
|
299
322
|
}
|
|
300
323
|
/**
|
|
@@ -311,7 +334,7 @@ class TableController extends BaseTableController {
|
|
|
311
334
|
type: "warning"
|
|
312
335
|
}
|
|
313
336
|
);
|
|
314
|
-
await this.service.disable(row.id, WebI18n.get().DisableSuccess
|
|
337
|
+
await this.service.disable(row.id, WebI18n.get().DisableSuccess);
|
|
315
338
|
this.getList();
|
|
316
339
|
}
|
|
317
340
|
/**
|
|
@@ -328,7 +351,7 @@ class TableController extends BaseTableController {
|
|
|
328
351
|
type: "warning"
|
|
329
352
|
}
|
|
330
353
|
);
|
|
331
|
-
await this.service.enable(row.id, WebI18n.get().EnableSuccess
|
|
354
|
+
await this.service.enable(row.id, WebI18n.get().EnableSuccess);
|
|
332
355
|
this.getList();
|
|
333
356
|
}
|
|
334
357
|
}
|
|
@@ -4,10 +4,7 @@ import { AbstractWebService } from '../service';
|
|
|
4
4
|
import { IDetailControllerOption } from './interface';
|
|
5
5
|
/**
|
|
6
6
|
* # 详情控制器
|
|
7
|
-
*
|
|
8
|
-
* @param entityClass 详情使用的实体类
|
|
9
|
-
* @param serviceClass 详情使用的 `Service`
|
|
10
|
-
* @param option `可选` 更多的配置
|
|
7
|
+
*
|
|
11
8
|
* @author Hamm.cn
|
|
12
9
|
*/
|
|
13
10
|
export declare class DetailController<E extends AirEntity, S extends AbstractWebService<E>, O extends IDetailControllerOption<E> = IDetailControllerOption<E>> {
|
|
@@ -16,6 +13,13 @@ export declare class DetailController<E extends AirEntity, S extends AbstractWeb
|
|
|
16
13
|
title: Ref<string, string>;
|
|
17
14
|
protected service: S;
|
|
18
15
|
protected option: O;
|
|
16
|
+
/**
|
|
17
|
+
* ### 创建详情控制器
|
|
18
|
+
* @param props `defineProps` 的返回值
|
|
19
|
+
* @param entityClass 详情使用的实体类
|
|
20
|
+
* @param serviceClass 详情使用的 `Service`
|
|
21
|
+
* @param option `可选` 更多的配置
|
|
22
|
+
*/
|
|
19
23
|
static create<T extends DetailController<E, S>, E extends AirEntity, S extends AbstractWebService<E>>(this: ClassConstructor<T>, props: IJson, entityClass: ClassConstructor<E>, serviceClass: ClassConstructor<S>, option?: IDetailControllerOption<E>): T;
|
|
20
24
|
/**
|
|
21
25
|
* ### 查询详情方法
|
|
@@ -3,10 +3,7 @@ import { AbstractWebService } from '../service';
|
|
|
3
3
|
import { DetailController } from './DetailController';
|
|
4
4
|
/**
|
|
5
5
|
* # 编辑器控制器
|
|
6
|
-
*
|
|
7
|
-
* @param entityClass `Editor`使用的实体类
|
|
8
|
-
* @param serviceClass `Editor`使用的`Service`
|
|
9
|
-
* @param option `可选` 更多的配置
|
|
6
|
+
*
|
|
10
7
|
* @author Hamm.cn
|
|
11
8
|
*/
|
|
12
9
|
export declare class EditorController<E extends AirEntity, S extends AbstractWebService<E>> extends DetailController<E, S> {
|
|
@@ -2,6 +2,7 @@ import { AirEntity, ITree } from '@airpower/core';
|
|
|
2
2
|
import { ITableControllerOption } from './ITableControllerOption';
|
|
3
3
|
/**
|
|
4
4
|
* # 表格树控制器配置项
|
|
5
|
+
*
|
|
5
6
|
* @author Hamm.cn
|
|
6
7
|
*/
|
|
7
8
|
export interface ITableTreeControllerOption<T extends ITree & AirEntity> extends ITableControllerOption<T> {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AirEntity } from '@airpower/core';
|
|
2
2
|
import { IDetailControllerOption } from './IDetailControllerOption';
|
|
3
3
|
/**
|
|
4
|
-
* #
|
|
4
|
+
* # 编辑控制器的可选配置
|
|
5
|
+
*
|
|
5
6
|
* @author Hamm.cn
|
|
6
7
|
*/
|
|
7
8
|
export interface IUseEditorOption<E extends AirEntity> extends IDetailControllerOption<E> {
|
|
@@ -4,6 +4,7 @@ import { AbstractWebService } from '../../service';
|
|
|
4
4
|
import { ITableControllerOption } from '../interface';
|
|
5
5
|
/**
|
|
6
6
|
* # 表格控制器基类
|
|
7
|
+
*
|
|
7
8
|
* @author Hamm.cn
|
|
8
9
|
*/
|
|
9
10
|
export declare class BaseTableController<E extends AirEntity, S extends AbstractWebService<E>, O extends ITableControllerOption<E> = ITableControllerOption<E>> {
|
|
@@ -14,6 +15,10 @@ export declare class BaseTableController<E extends AirEntity, S extends Abstract
|
|
|
14
15
|
isLoading: Ref<boolean, boolean>;
|
|
15
16
|
protected service: S;
|
|
16
17
|
protected option: O;
|
|
18
|
+
/**
|
|
19
|
+
* ### 创建表格控制器
|
|
20
|
+
* @param ServiceClass 服务类
|
|
21
|
+
*/
|
|
17
22
|
constructor(ServiceClass: new () => S & {
|
|
18
23
|
entityClass: new () => E;
|
|
19
24
|
});
|
|
@@ -60,5 +65,8 @@ export declare class BaseTableController<E extends AirEntity, S extends Abstract
|
|
|
60
65
|
* @param page 分页对象
|
|
61
66
|
*/
|
|
62
67
|
pageChanged(page: Page): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* ### 初始化
|
|
70
|
+
*/
|
|
63
71
|
private init;
|
|
64
72
|
}
|
|
@@ -4,6 +4,7 @@ import { ITableControllerOption } from '../interface';
|
|
|
4
4
|
import { BaseTableController } from './BaseTableController';
|
|
5
5
|
/**
|
|
6
6
|
* # 表格控制器
|
|
7
|
+
*
|
|
7
8
|
* @author Hamm.cn
|
|
8
9
|
*/
|
|
9
10
|
export declare class TableController<E extends AirEntity, S extends AbstractWebService<E>, O extends ITableControllerOption<E> = ITableControllerOption<E>> extends BaseTableController<E, S, O> {
|
|
@@ -4,9 +4,7 @@ import { ITableTreeControllerOption } from '../interface';
|
|
|
4
4
|
import { TableController } from './TableController';
|
|
5
5
|
/**
|
|
6
6
|
* # 表格控制器
|
|
7
|
-
*
|
|
8
|
-
* @param serviceClass 表格使用的`Service`类
|
|
9
|
-
* @param option `可选` 更多配置
|
|
7
|
+
*
|
|
10
8
|
* @author Hamm.cn
|
|
11
9
|
*/
|
|
12
10
|
export declare class TableTreeController<E extends ITree & AirEntity, S extends AbstractWebService<E>> extends TableController<E, S, ITableTreeControllerOption<E>> {
|
package/dist/helper/WebI18n.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { AirI18n } from '@airpower/core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
/**
|
|
3
|
+
* # Web端默认语言包
|
|
4
|
+
*
|
|
5
|
+
* @author Hamm.cn
|
|
6
|
+
*/
|
|
7
|
+
export declare class WebI18n extends AirI18n {
|
|
8
|
+
Detail: string;
|
|
9
|
+
Edit: string;
|
|
10
|
+
Add: string;
|
|
11
|
+
EditSuccess: string;
|
|
12
|
+
AddSuccess: string;
|
|
13
|
+
DeleteSuccess: string;
|
|
14
|
+
SelectPlease: string;
|
|
15
|
+
DisableSuccess: string;
|
|
16
|
+
EnableSuccess: string;
|
|
13
17
|
}
|
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.38",
|
|
5
5
|
"description": "AirPower-Web",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Hamm",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"vue": "^3.5.13"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@airpower/core": "^0.1.
|
|
47
|
+
"@airpower/core": "^0.1.15",
|
|
48
48
|
"axios": "^1.8.4",
|
|
49
49
|
"element-plus": "^2.9.7",
|
|
50
50
|
"vue": "^3.5.13"
|