@kengic/uni 0.3.7-beta.0 → 0.4.0

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.
@@ -1,28 +1,28 @@
1
- // noinspection ES6UnusedImports
2
-
3
- import { httpClient, IRequestConfig, IRequestOptions } from '../../../../service';
4
- import * as DEF from '../../../def';
5
- import { keys } from '../../models';
6
-
7
- /** 请求参数. */
8
- export class GetLatestApkVersionQuery {}
9
-
10
- /**
11
- * 获取 APK 最新的版本号.
12
- *
13
- * @param config 请求配置.
14
- * @param option 请求选项.
15
- */
16
- export function GetLatestApkVersion(config?: IRequestConfig<GetLatestApkVersionQuery, {}>, option?: IRequestOptions): Promise<number> {
17
- return httpClient().request(
18
- {
19
- method: GetLatestApkVersion.method,
20
- url: `${option?.mock ? '/mock' : ''}${GetLatestApkVersion.url}`,
21
- ...(config ?? {}),
22
- },
23
- option,
24
- );
25
- }
26
-
27
- GetLatestApkVersion.method = 'GET' as const;
28
- GetLatestApkVersion.url = '/sys/common/getLatestApkVersion';
1
+ // noinspection ES6UnusedImports
2
+
3
+ import { httpClient, IRequestConfig, IRequestOptions } from '../../../../service';
4
+ import * as DEF from '../../../def';
5
+ import { keys } from '../../models';
6
+
7
+ /** 请求参数. */
8
+ export class GetLatestApkVersionQuery {}
9
+
10
+ /**
11
+ * 获取 APK 最新的版本号.
12
+ *
13
+ * @param config 请求配置.
14
+ * @param option 请求选项.
15
+ */
16
+ export function GetLatestApkVersion(config?: IRequestConfig<GetLatestApkVersionQuery, {}>, option?: IRequestOptions): Promise<number> {
17
+ return httpClient().request(
18
+ {
19
+ method: GetLatestApkVersion.method,
20
+ url: `${option?.mock ? '/mock' : ''}${GetLatestApkVersion.url}`,
21
+ ...(config ?? {}),
22
+ },
23
+ option,
24
+ );
25
+ }
26
+
27
+ GetLatestApkVersion.method = 'GET' as const;
28
+ GetLatestApkVersion.url = '/sys/common/getLatestApkVersion';
@@ -1 +1 @@
1
- export { GetLatestApkVersion, GetLatestApkVersionQuery } from './GetLatestApkVersion';
1
+ export { GetLatestApkVersion, GetLatestApkVersionQuery } from './GetLatestApkVersion';
@@ -1,28 +1,28 @@
1
- // noinspection ES6UnusedImports
2
-
3
- import { httpClient, IRequestConfig, IRequestOptions } from '../../../../service';
4
- import * as DEF from '../../../def';
5
- import { keys } from '../../models';
6
-
7
- /** 请求参数. */
8
- export class LogoutQuery {}
9
-
10
- /**
11
- * 退出登录.
12
- *
13
- * @param config 请求配置.
14
- * @param option 请求选项.
15
- */
16
- export function Logout(config?: IRequestConfig<LogoutQuery, {}>, option?: IRequestOptions): Promise<Record<any, any>> {
17
- return httpClient().request(
18
- {
19
- method: Logout.method,
20
- url: `${option?.mock ? '/mock' : ''}${Logout.url}`,
21
- ...(config ?? {}),
22
- },
23
- option,
24
- );
25
- }
26
-
27
- Logout.method = 'GET' as const;
28
- Logout.url = '/sys/logout';
1
+ // noinspection ES6UnusedImports
2
+
3
+ import { httpClient, IRequestConfig, IRequestOptions } from '../../../../service';
4
+ import * as DEF from '../../../def';
5
+ import { keys } from '../../models';
6
+
7
+ /** 请求参数. */
8
+ export class LogoutQuery {}
9
+
10
+ /**
11
+ * 退出登录.
12
+ *
13
+ * @param config 请求配置.
14
+ * @param option 请求选项.
15
+ */
16
+ export function Logout(config?: IRequestConfig<LogoutQuery, {}>, option?: IRequestOptions): Promise<Record<any, any>> {
17
+ return httpClient().request(
18
+ {
19
+ method: Logout.method,
20
+ url: `${option?.mock ? '/mock' : ''}${Logout.url}`,
21
+ ...(config ?? {}),
22
+ },
23
+ option,
24
+ );
25
+ }
26
+
27
+ Logout.method = 'GET' as const;
28
+ Logout.url = '/sys/logout';
@@ -1 +1 @@
1
- export { Logout, LogoutQuery } from './Logout';
1
+ export { Logout, LogoutQuery } from './Logout';
@@ -1,92 +1,92 @@
1
- // noinspection ES6UnusedImports
2
-
3
- import { httpClient, IRequestConfig, IRequestOptions } from '../../../../service';
4
- import * as DEF from '../../../def';
5
- import { keys } from '../../models';
6
-
7
- /** 请求参数. */
8
- export class ListVOQuery {
9
- /** 是否可用 */
10
- public activeFlg?: number | null;
11
- /** 地址编号 */
12
- public adrId?: string | null;
13
- /** 地址名 */
14
- public adrnam?: string | null;
15
- /** 公司代码 */
16
- public comCod?: string | null;
17
- /** 默认仓库 */
18
- public defWhFlg?: number | null;
19
- /** 主键. */
20
- public id?: string | null;
21
- /** 所属地/国编号 */
22
- public orgcod?: string | null;
23
- /** 永久调整托盘 */
24
- public permAdjLod?: string | null;
25
- /** 永久调整箱 */
26
- public permAdjSub?: string | null;
27
- /** 永久创建托盘 */
28
- public permCreLod?: string | null;
29
- /** 永久创建箱 */
30
- public permCreSub?: string | null;
31
- /** 仓库名称 */
32
- public whDsc?: string | null;
33
- /** 仓库编号 */
34
- public whId?: string | null;
35
- /** 排序字段. */
36
- public column?: string | null;
37
- /** 排序方式. */
38
- public order?: 'asc' | 'desc' | null;
39
- /** 当前页数. */
40
- public pageNo?: number | null;
41
- /** 每页条数. */
42
- public pageSize?: number | null;
43
-
44
- public constructor(obj?: ListVOQuery) {
45
- keys(obj ?? {}).forEach((key: PropertyKey) => {
46
- switch (key) {
47
- case 'activeFlg':
48
- case 'adrId':
49
- case 'adrnam':
50
- case 'comCod':
51
- case 'defWhFlg':
52
- case 'id':
53
- case 'orgcod':
54
- case 'permAdjLod':
55
- case 'permAdjSub':
56
- case 'permCreLod':
57
- case 'permCreSub':
58
- case 'whDsc':
59
- case 'whId':
60
- case 'column':
61
- case 'order':
62
- case 'pageNo':
63
- case 'pageSize':
64
- Reflect.set(this, key, Reflect.get(obj ?? {}, key));
65
- break;
66
- default:
67
- break;
68
- }
69
- });
70
- }
71
- }
72
-
73
- /**
74
- * wh-分页列表查询VO
75
- wh-分页列表查询VO
76
- *
77
- * @param config 请求配置.
78
- * @param option 请求选项.
79
- */
80
- export function ListVO(config?: IRequestConfig<ListVOQuery, {}>, option?: IRequestOptions): Promise<DEF.WMS.IPage<DEF.WMS.WhDTO>> {
81
- return httpClient().request(
82
- {
83
- method: ListVO.method,
84
- url: `${option?.mock ? '/mock' : ''}${ListVO.url}`,
85
- ...(config ?? {}),
86
- },
87
- option,
88
- );
89
- }
90
-
91
- ListVO.method = 'GET' as const;
92
- ListVO.url = '/wh/wh/listVO';
1
+ // noinspection ES6UnusedImports
2
+
3
+ import { httpClient, IRequestConfig, IRequestOptions } from '../../../../service';
4
+ import * as DEF from '../../../def';
5
+ import { keys } from '../../models';
6
+
7
+ /** 请求参数. */
8
+ export class ListVOQuery {
9
+ /** 是否可用 */
10
+ public activeFlg?: number | null;
11
+ /** 地址编号 */
12
+ public adrId?: string | null;
13
+ /** 地址名 */
14
+ public adrnam?: string | null;
15
+ /** 公司代码 */
16
+ public comCod?: string | null;
17
+ /** 默认仓库 */
18
+ public defWhFlg?: number | null;
19
+ /** 主键. */
20
+ public id?: string | null;
21
+ /** 所属地/国编号 */
22
+ public orgcod?: string | null;
23
+ /** 永久调整托盘 */
24
+ public permAdjLod?: string | null;
25
+ /** 永久调整箱 */
26
+ public permAdjSub?: string | null;
27
+ /** 永久创建托盘 */
28
+ public permCreLod?: string | null;
29
+ /** 永久创建箱 */
30
+ public permCreSub?: string | null;
31
+ /** 仓库名称 */
32
+ public whDsc?: string | null;
33
+ /** 仓库编号 */
34
+ public whId?: string | null;
35
+ /** 排序字段. */
36
+ public column?: string | null;
37
+ /** 排序方式. */
38
+ public order?: 'asc' | 'desc' | null;
39
+ /** 当前页数. */
40
+ public pageNo?: number | null;
41
+ /** 每页条数. */
42
+ public pageSize?: number | null;
43
+
44
+ public constructor(obj?: ListVOQuery) {
45
+ keys(obj ?? {}).forEach((key: PropertyKey) => {
46
+ switch (key) {
47
+ case 'activeFlg':
48
+ case 'adrId':
49
+ case 'adrnam':
50
+ case 'comCod':
51
+ case 'defWhFlg':
52
+ case 'id':
53
+ case 'orgcod':
54
+ case 'permAdjLod':
55
+ case 'permAdjSub':
56
+ case 'permCreLod':
57
+ case 'permCreSub':
58
+ case 'whDsc':
59
+ case 'whId':
60
+ case 'column':
61
+ case 'order':
62
+ case 'pageNo':
63
+ case 'pageSize':
64
+ Reflect.set(this, key, Reflect.get(obj ?? {}, key));
65
+ break;
66
+ default:
67
+ break;
68
+ }
69
+ });
70
+ }
71
+ }
72
+
73
+ /**
74
+ * wh-分页列表查询VO
75
+ wh-分页列表查询VO
76
+ *
77
+ * @param config 请求配置.
78
+ * @param option 请求选项.
79
+ */
80
+ export function ListVO(config?: IRequestConfig<ListVOQuery, {}>, option?: IRequestOptions): Promise<DEF.WMS.IPage<DEF.WMS.WhDTO>> {
81
+ return httpClient().request(
82
+ {
83
+ method: ListVO.method,
84
+ url: `${option?.mock ? '/mock' : ''}${ListVO.url}`,
85
+ ...(config ?? {}),
86
+ },
87
+ option,
88
+ );
89
+ }
90
+
91
+ ListVO.method = 'GET' as const;
92
+ ListVO.url = '/wh/wh/listVO';
@@ -1 +1 @@
1
- export { ListVO, ListVOQuery } from './ListVO';
1
+ export { ListVO, ListVOQuery } from './ListVO';
@@ -1,3 +1,3 @@
1
- export * as CommonController from './CommonController';
2
- export * as LoginController from './LoginController';
3
- export * as WhController from './WhController';
1
+ export * as CommonController from './CommonController';
2
+ export * as LoginController from './LoginController';
3
+ export * as WhController from './WhController';
@@ -1,2 +1,2 @@
1
- export * as WMSAPI from './Controllers';
2
- export * as WMSDEF from './models';
1
+ export * as WMSAPI from './Controllers';
2
+ export * as WMSDEF from './models';
@@ -1,192 +1,192 @@
1
- export class IPage<T0> {
2
- /** Current. */
3
- public current?: number | null;
4
- /** Pages. */
5
- public pages?: number | null;
6
- /** Records. */
7
- public records?: Array<T0> | null;
8
- /** Size. */
9
- public size?: number | null;
10
- /** Total. */
11
- public total?: number | null;
12
-
13
- public constructor(obj?: IPage<T0>) {
14
- keys(obj ?? {}).forEach((key: PropertyKey) => {
15
- switch (key) {
16
- case 'current':
17
- case 'pages':
18
- case 'records':
19
- case 'size':
20
- case 'total':
21
- Reflect.set(this, key, Reflect.get(obj ?? {}, key));
22
- break;
23
- default:
24
- break;
25
- }
26
- });
27
- }
28
- }
29
-
30
- /** 用户. */
31
- export class SysUser {
32
- /** Activiti Sync. */
33
- public activitiSync?: number | null;
34
- /** 头像. */
35
- public avatar?: string | null;
36
- /** Birthday. */
37
- public birthday?: string | null;
38
- /** Client Id. */
39
- public clientId?: string | null;
40
- /** Create By. */
41
- public createBy?: string | null;
42
- /** Create Time. */
43
- public createTime?: string | null;
44
- /** Del Flag. */
45
- public delFlag?: number | null;
46
- /** Depart Ids. */
47
- public departIds?: string | null;
48
- /** 邮件. */
49
- public email?: string | null;
50
- /** Home Path. */
51
- public homePath?: string | null;
52
- /** Id. */
53
- public id?: string | null;
54
- /** Org Code. */
55
- public orgCode?: string | null;
56
- /** Org Code Txt. */
57
- public orgCodeTxt?: string | null;
58
- /** Password. */
59
- public password?: string | null;
60
- /** 电话. */
61
- public phone?: string | null;
62
- /** Post. */
63
- public post?: string | null;
64
- /** 姓名. */
65
- public realname?: string | null;
66
- /** Rel Tenant Ids. */
67
- public relTenantIds?: string | null;
68
- /** Salt. */
69
- public salt?: string | null;
70
- /** Sex. */
71
- public sex?: number | null;
72
- /** 状态. */
73
- public status?: number | null;
74
- /** Telephone. */
75
- public telephone?: string | null;
76
- /** Update By. */
77
- public updateBy?: string | null;
78
- /** Update Time. */
79
- public updateTime?: string | null;
80
- /** User Identity. */
81
- public userIdentity?: number | null;
82
- /** 账号. */
83
- public username?: string | null;
84
- /** 工号. */
85
- public workNo?: string | null;
86
-
87
- public constructor(obj?: SysUser) {
88
- keys(obj ?? {}).forEach((key: PropertyKey) => {
89
- switch (key) {
90
- case 'activitiSync':
91
- case 'avatar':
92
- case 'birthday':
93
- case 'clientId':
94
- case 'createBy':
95
- case 'createTime':
96
- case 'delFlag':
97
- case 'departIds':
98
- case 'email':
99
- case 'homePath':
100
- case 'id':
101
- case 'orgCode':
102
- case 'orgCodeTxt':
103
- case 'password':
104
- case 'phone':
105
- case 'post':
106
- case 'realname':
107
- case 'relTenantIds':
108
- case 'salt':
109
- case 'sex':
110
- case 'status':
111
- case 'telephone':
112
- case 'updateBy':
113
- case 'updateTime':
114
- case 'userIdentity':
115
- case 'username':
116
- case 'workNo':
117
- Reflect.set(this, key, Reflect.get(obj ?? {}, key));
118
- break;
119
- default:
120
- break;
121
- }
122
- });
123
- }
124
- }
125
-
126
- /** 仓库数据传输对象 */
127
- export class WhDTO {
128
- /** 是否可用 */
129
- public activeFlg?: number | null;
130
- /** 地址编号 */
131
- public adrId?: string | null;
132
- /** 地址名 */
133
- public adrnam?: string | null;
134
- /** 公司代码 */
135
- public comCod?: string | null;
136
- /** 默认仓库 */
137
- public defWhFlg?: number | null;
138
- /** 主键. */
139
- public id?: string | null;
140
- /** 所属地/国编号 */
141
- public orgcod?: string | null;
142
- /** 永久调整托盘 */
143
- public permAdjLod?: string | null;
144
- /** 永久调整箱 */
145
- public permAdjSub?: string | null;
146
- /** 永久创建托盘 */
147
- public permCreLod?: string | null;
148
- /** 永久创建箱 */
149
- public permCreSub?: string | null;
150
- /** 仓库名称 */
151
- public whDsc?: string | null;
152
- /** 仓库编号 */
153
- public whId?: string | null;
154
-
155
- public constructor(obj?: WhDTO) {
156
- keys(obj ?? {}).forEach((key: PropertyKey) => {
157
- switch (key) {
158
- case 'activeFlg':
159
- case 'adrId':
160
- case 'adrnam':
161
- case 'comCod':
162
- case 'defWhFlg':
163
- case 'id':
164
- case 'orgcod':
165
- case 'permAdjLod':
166
- case 'permAdjSub':
167
- case 'permCreLod':
168
- case 'permCreSub':
169
- case 'whDsc':
170
- case 'whId':
171
- Reflect.set(this, key, Reflect.get(obj ?? {}, key));
172
- break;
173
- default:
174
- break;
175
- }
176
- });
177
- }
178
- }
179
-
180
- /**
181
- * 获取对象的属性名数组.
182
- * @param obj 对象.
183
- */
184
- export function keys<C extends object>(obj: C): Array<keyof C> {
185
- const type = typeof obj;
186
-
187
- if (!(obj != null && (type === 'object' || type === 'function'))) {
188
- return [];
189
- }
190
-
191
- return Reflect.ownKeys(obj) as Array<keyof C>;
192
- }
1
+ export class IPage<T0> {
2
+ /** Current. */
3
+ public current?: number | null;
4
+ /** Pages. */
5
+ public pages?: number | null;
6
+ /** Records. */
7
+ public records?: Array<T0> | null;
8
+ /** Size. */
9
+ public size?: number | null;
10
+ /** Total. */
11
+ public total?: number | null;
12
+
13
+ public constructor(obj?: IPage<T0>) {
14
+ keys(obj ?? {}).forEach((key: PropertyKey) => {
15
+ switch (key) {
16
+ case 'current':
17
+ case 'pages':
18
+ case 'records':
19
+ case 'size':
20
+ case 'total':
21
+ Reflect.set(this, key, Reflect.get(obj ?? {}, key));
22
+ break;
23
+ default:
24
+ break;
25
+ }
26
+ });
27
+ }
28
+ }
29
+
30
+ /** 用户. */
31
+ export class SysUser {
32
+ /** Activiti Sync. */
33
+ public activitiSync?: number | null;
34
+ /** 头像. */
35
+ public avatar?: string | null;
36
+ /** Birthday. */
37
+ public birthday?: string | null;
38
+ /** Client Id. */
39
+ public clientId?: string | null;
40
+ /** Create By. */
41
+ public createBy?: string | null;
42
+ /** Create Time. */
43
+ public createTime?: string | null;
44
+ /** Del Flag. */
45
+ public delFlag?: number | null;
46
+ /** Depart Ids. */
47
+ public departIds?: string | null;
48
+ /** 邮件. */
49
+ public email?: string | null;
50
+ /** Home Path. */
51
+ public homePath?: string | null;
52
+ /** Id. */
53
+ public id?: string | null;
54
+ /** Org Code. */
55
+ public orgCode?: string | null;
56
+ /** Org Code Txt. */
57
+ public orgCodeTxt?: string | null;
58
+ /** Password. */
59
+ public password?: string | null;
60
+ /** 电话. */
61
+ public phone?: string | null;
62
+ /** Post. */
63
+ public post?: string | null;
64
+ /** 姓名. */
65
+ public realname?: string | null;
66
+ /** Rel Tenant Ids. */
67
+ public relTenantIds?: string | null;
68
+ /** Salt. */
69
+ public salt?: string | null;
70
+ /** Sex. */
71
+ public sex?: number | null;
72
+ /** 状态. */
73
+ public status?: number | null;
74
+ /** Telephone. */
75
+ public telephone?: string | null;
76
+ /** Update By. */
77
+ public updateBy?: string | null;
78
+ /** Update Time. */
79
+ public updateTime?: string | null;
80
+ /** User Identity. */
81
+ public userIdentity?: number | null;
82
+ /** 账号. */
83
+ public username?: string | null;
84
+ /** 工号. */
85
+ public workNo?: string | null;
86
+
87
+ public constructor(obj?: SysUser) {
88
+ keys(obj ?? {}).forEach((key: PropertyKey) => {
89
+ switch (key) {
90
+ case 'activitiSync':
91
+ case 'avatar':
92
+ case 'birthday':
93
+ case 'clientId':
94
+ case 'createBy':
95
+ case 'createTime':
96
+ case 'delFlag':
97
+ case 'departIds':
98
+ case 'email':
99
+ case 'homePath':
100
+ case 'id':
101
+ case 'orgCode':
102
+ case 'orgCodeTxt':
103
+ case 'password':
104
+ case 'phone':
105
+ case 'post':
106
+ case 'realname':
107
+ case 'relTenantIds':
108
+ case 'salt':
109
+ case 'sex':
110
+ case 'status':
111
+ case 'telephone':
112
+ case 'updateBy':
113
+ case 'updateTime':
114
+ case 'userIdentity':
115
+ case 'username':
116
+ case 'workNo':
117
+ Reflect.set(this, key, Reflect.get(obj ?? {}, key));
118
+ break;
119
+ default:
120
+ break;
121
+ }
122
+ });
123
+ }
124
+ }
125
+
126
+ /** 仓库数据传输对象 */
127
+ export class WhDTO {
128
+ /** 是否可用 */
129
+ public activeFlg?: number | null;
130
+ /** 地址编号 */
131
+ public adrId?: string | null;
132
+ /** 地址名 */
133
+ public adrnam?: string | null;
134
+ /** 公司代码 */
135
+ public comCod?: string | null;
136
+ /** 默认仓库 */
137
+ public defWhFlg?: number | null;
138
+ /** 主键. */
139
+ public id?: string | null;
140
+ /** 所属地/国编号 */
141
+ public orgcod?: string | null;
142
+ /** 永久调整托盘 */
143
+ public permAdjLod?: string | null;
144
+ /** 永久调整箱 */
145
+ public permAdjSub?: string | null;
146
+ /** 永久创建托盘 */
147
+ public permCreLod?: string | null;
148
+ /** 永久创建箱 */
149
+ public permCreSub?: string | null;
150
+ /** 仓库名称 */
151
+ public whDsc?: string | null;
152
+ /** 仓库编号 */
153
+ public whId?: string | null;
154
+
155
+ public constructor(obj?: WhDTO) {
156
+ keys(obj ?? {}).forEach((key: PropertyKey) => {
157
+ switch (key) {
158
+ case 'activeFlg':
159
+ case 'adrId':
160
+ case 'adrnam':
161
+ case 'comCod':
162
+ case 'defWhFlg':
163
+ case 'id':
164
+ case 'orgcod':
165
+ case 'permAdjLod':
166
+ case 'permAdjSub':
167
+ case 'permCreLod':
168
+ case 'permCreSub':
169
+ case 'whDsc':
170
+ case 'whId':
171
+ Reflect.set(this, key, Reflect.get(obj ?? {}, key));
172
+ break;
173
+ default:
174
+ break;
175
+ }
176
+ });
177
+ }
178
+ }
179
+
180
+ /**
181
+ * 获取对象的属性名数组.
182
+ * @param obj 对象.
183
+ */
184
+ export function keys<C extends object>(obj: C): Array<keyof C> {
185
+ const type = typeof obj;
186
+
187
+ if (!(obj != null && (type === 'object' || type === 'function'))) {
188
+ return [];
189
+ }
190
+
191
+ return Reflect.ownKeys(obj) as Array<keyof C>;
192
+ }
package/dist/api/api.ts CHANGED
@@ -1 +1 @@
1
- export { WMSAPI as WMS } from './WMS';
1
+ export { WMSAPI as WMS } from './WMS';
package/dist/api/def.ts CHANGED
@@ -1 +1 @@
1
- export { WMSDEF as WMS } from './WMS';
1
+ export { WMSDEF as WMS } from './WMS';
package/dist/api/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * as API from './api';
2
- export * as DEF from './def';
1
+ export * as API from './api';
2
+ export * as DEF from './def';
@@ -7,12 +7,17 @@
7
7
  </template>
8
8
  <template v-slot:right></template>
9
9
  </UniNavBar>
10
+
11
+ <!--#ifdef APP-PLUS-->
12
+ <KgUpdatePopup />
13
+ <!--#endif-->
10
14
  </template>
11
15
 
12
16
  <script lang="ts" name="KgNavBar" setup>
13
17
  import { computed } from 'vue';
14
18
  import { UniIcons, UniNavBar } from '../../uni';
15
19
  import { Kg } from '../../util';
20
+ import { KgUpdatePopup } from '../KgUpdatePopup';
16
21
 
17
22
  /**
18
23
  * 顶部标题栏.
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="kg-update-popup">
2
+ <view :class="getClass">
3
3
  <UniPopup ref="popupRef" type="dialog">
4
4
  <UniPopupDialog
5
5
  :beforeClose="true"
@@ -11,7 +11,7 @@
11
11
  >
12
12
  <template v-slot>
13
13
  <progress v-if="downloadTask" :percent="downloadProgress" show-info />
14
- <text v-else class="message">优化用户体验,修复已知问题</text>
14
+ <text v-else class="message">优化用户体验, 修复已知问题.</text>
15
15
  </template>
16
16
  </UniPopupDialog>
17
17
  </UniPopup>
@@ -19,14 +19,22 @@
19
19
  </template>
20
20
 
21
21
  <script lang="ts" name="KgUpdatePopup" setup>
22
- import { onMounted, onUnmounted, ref } from 'vue';
22
+ import { computed, onMounted, onUnmounted, PropType, ref } from 'vue';
23
23
  import { UniPopup, UniPopupDialog } from '../../uni';
24
24
  import { useAppStore } from '../../store/app.store';
25
+ import { Kg } from '../../util';
25
26
 
26
27
  /**
27
28
  * 版本升级弹窗.
28
29
  */
29
30
 
31
+ const props = defineProps({
32
+ /**
33
+ * 是否允许取消升级. 默认为 false, 即不允许取消升级, 必须安装新版才能继续使用.
34
+ */
35
+ kgAllowCancel: Boolean as PropType<boolean>,
36
+ });
37
+
30
38
  const appStore = useAppStore();
31
39
 
32
40
  //region DATA
@@ -34,14 +42,24 @@
34
42
  const popupRef = ref<any>(null);
35
43
  /** 下载任务. */
36
44
  const downloadTask = ref<UniNamespace.DownloadTask | null>(null);
37
- /** 下载进度. */
45
+ /** 下载进度. [0, 100] 之间的某个数值, 表示百分比的分子. */
38
46
  const downloadProgress = ref<number>(0);
39
47
  /** 最新版本. */
40
48
  const version = ref<number>(0);
41
- /** 更新下载进度的计时器, 用来模拟下载进度. */
49
+ /** 下载进度的计时器, 用来模拟下载进度. */
42
50
  const downloadProgressTimer = ref<number>(-1);
43
51
  /** 退订弹窗打开事件. */
44
52
  const unsubscribe = ref<(() => void) | null>(null);
53
+ /** 样式. */
54
+ const getClass = computed(() => {
55
+ let _class = 'kg-update-popup';
56
+
57
+ if (props.kgAllowCancel !== true) {
58
+ _class += ' kg-update-popup--not-allow-cancel';
59
+ }
60
+
61
+ return _class;
62
+ });
45
63
  //endregion
46
64
 
47
65
  //region FUNCTION
@@ -117,6 +135,8 @@
117
135
  //endregion
118
136
 
119
137
  onMounted(() => {
138
+ Kg.checkForUpdate(false, false);
139
+
120
140
  unsubscribe.value = appStore.$onAction(async ({ name, args }) => {
121
141
  switch (name) {
122
142
  case 'openKgUpdatePopup':
@@ -145,4 +165,8 @@
145
165
  .kg-update-popup .message {
146
166
  font-size: 14px;
147
167
  }
168
+
169
+ .kg-update-popup.kg-update-popup--not-allow-cancel :deep(.uni-dialog-button:not(.uni-border-left)) {
170
+ display: none;
171
+ }
148
172
  </style>
package/dist/util/kg.ts CHANGED
@@ -76,7 +76,13 @@ export class Kg {
76
76
  /**
77
77
  * 检查更新.
78
78
  * @param isShowToast 是否显示消息提示.
79
- * @param isRespectCancel 是否检查「取消本次更新」.
79
+ * 如果为 true, 并且检查之后发现没有新版, 则会显示提示消息, 说'已是最新版本',
80
+ * 如果为 false, 并且检查之后发现没有新版, 则不会显示提示消息,
81
+ * 默认为 true.
82
+ * @param isRespectCancel 是否检查「取消本次更新」这个状态.
83
+ * 如果为 true 表示要检查, 也就是会先去看上次是否取消了升级, 如果上次取消了, 这次就会直接跳过检查更新,
84
+ * 如果为 false 表示不检查, 也就是无论上次是否取消了升级, 这次都会检查更新,
85
+ * 默认为 false.
80
86
  * @return {boolean} 是否有新版本.
81
87
  */
82
88
  public static async checkForUpdate(isShowToast: boolean = true, isRespectCancel: boolean = false): Promise<boolean> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/uni",
3
- "version": "0.3.7-beta.0",
3
+ "version": "0.4.0",
4
4
  "scripts": {
5
5
  "build": "npm run switch-node-version && rimraf dist && vue-tsc && vite build",
6
6
  "------ -------------------------------------------": "",
@@ -18,7 +18,7 @@
18
18
  "-- -----------------------------------------------": "",
19
19
  "cnpm:sync": "cnpm sync @kengic/uni",
20
20
  "--- ----------------------------------------------": "",
21
- "switch-node-version": "nvm use 20.11.0 && corepack enable && corepack prepare pnpm@7.30.5",
21
+ "switch-node-version": "nvm use 20.11.0 && corepack enable && corepack prepare pnpm@7.30.5 --activate",
22
22
  "---- ---------------------------------------------": "",
23
23
  "bump-version:beta": "npm run switch-node-version && node scripts/bump.mjs beta --experimental-default-type=module",
24
24
  "bump-version:major": "npm run switch-node-version && node scripts/bump.mjs major --experimental-default-type=module",