@kengic/uni 0.7.14-beta.1 → 0.7.14-beta.10
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/api/WMS/Controllers/CommonController/GetLatestApkVersion.ts +21 -21
- package/api/WMS/Controllers/CommonController/index.ts +1 -1
- package/api/WMS/Controllers/LoginController/GetUserInfo.ts +21 -21
- package/api/WMS/Controllers/LoginController/Logout.ts +21 -21
- package/api/WMS/Controllers/LoginController/index.ts +2 -2
- package/api/WMS/Controllers/WorkstationController/List.ts +45 -45
- package/api/WMS/Controllers/WorkstationController/index.ts +1 -1
- package/api/WMS/index.ts +2 -2
- package/api/api.ts +1 -1
- package/api/def.ts +1 -1
- package/api/index.ts +2 -2
- package/component/KgApiUil/KgApiUil.vue +146 -0
- package/component/KgApiUil/index.ts +1 -0
- package/component/KgLocale/KgLocale.vue +139 -0
- package/component/KgLocale/index.ts +1 -0
- package/component/KgNavBar/KgNavBar.vue +6 -6
- package/component/KgTabBar/KgTabBar.vue +32 -20
- package/component/{KgUpdatePopup/KgUpdatePopup.vue → KgUpdate/KgUpdate.vue} +9 -8
- package/component/KgUpdate/index.ts +6 -0
- package/component/KgWarehouse/KgWarehouse.vue +44 -21
- package/component/KgWarehouse/index.hooks.ts +1 -2
- package/component/KgWarehouse/index.ts +3 -1
- package/component/{KgStation/KgStation.vue → KgWorkStation/KgWorkStation.vue} +17 -16
- package/component/KgWorkStation/index.ts +9 -0
- package/component/index.ts +4 -2
- package/{store → config}/app.store.ts +8 -19
- package/config/config.hooks.ts +9 -20
- package/config/config.store.ts +187 -94
- package/config/index.ts +80 -3
- package/index.css +68 -7
- package/index.ts +0 -1
- package/model/index.ts +17 -6
- package/package.json +3 -2
- package/page/KgPageIndex.vue +28 -0
- package/page/KgPageMy.vue +32 -61
- package/service/http-client.ts +17 -15
- package/uni-ui/uni-popup/i18n/en.json +2 -2
- package/util/kg.util.ts +8 -6
- package/component/KgStation/index.ts +0 -4
- package/component/KgUpdatePopup/index.ts +0 -1
- /package/component/{KgStation → KgWorkStation}/index.hooks.ts +0 -0
- /package/component/{KgStation → KgWorkStation}/index.store.ts +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
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<string> {
|
|
17
|
-
return httpClient().request({ method: GetLatestApkVersion.method, url: GetLatestApkVersion.url, ...(config ?? {}) }, option);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
GetLatestApkVersion.method = 'GET' as const;
|
|
21
|
-
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<string> {
|
|
17
|
+
return httpClient().request({ method: GetLatestApkVersion.method, url: GetLatestApkVersion.url, ...(config ?? {}) }, option);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
GetLatestApkVersion.method = 'GET' as const;
|
|
21
|
+
GetLatestApkVersion.url = '/sys/common/getLatestApkVersion';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { GetLatestApkVersion, GetLatestApkVersionQuery } from './GetLatestApkVersion';
|
|
1
|
+
export { GetLatestApkVersion, GetLatestApkVersionQuery } from './GetLatestApkVersion';
|
|
@@ -1,21 +1,21 @@
|
|
|
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 GetUserInfoQuery {}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* 获取用户信息.
|
|
12
|
-
*
|
|
13
|
-
* @param config 请求配置.
|
|
14
|
-
* @param option 请求选项.
|
|
15
|
-
*/
|
|
16
|
-
export function GetUserInfo(config?: IRequestConfig<GetUserInfoQuery, {}>, option?: IRequestOptions): Promise<Record<any, any>> {
|
|
17
|
-
return httpClient().request({ method: GetUserInfo.method, url: GetUserInfo.url, ...(config ?? {}) }, option);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
GetUserInfo.method = 'GET' as const;
|
|
21
|
-
GetUserInfo.url = '/sys/getUserInfo';
|
|
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 GetUserInfoQuery {}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 获取用户信息.
|
|
12
|
+
*
|
|
13
|
+
* @param config 请求配置.
|
|
14
|
+
* @param option 请求选项.
|
|
15
|
+
*/
|
|
16
|
+
export function GetUserInfo(config?: IRequestConfig<GetUserInfoQuery, {}>, option?: IRequestOptions): Promise<Record<any, any>> {
|
|
17
|
+
return httpClient().request({ method: GetUserInfo.method, url: GetUserInfo.url, ...(config ?? {}) }, option);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
GetUserInfo.method = 'GET' as const;
|
|
21
|
+
GetUserInfo.url = '/sys/getUserInfo';
|
|
@@ -1,21 +1,21 @@
|
|
|
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({ method: Logout.method, url: Logout.url, ...(config ?? {}) }, option);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
Logout.method = 'GET' as const;
|
|
21
|
-
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({ method: Logout.method, url: Logout.url, ...(config ?? {}) }, option);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
Logout.method = 'GET' as const;
|
|
21
|
+
Logout.url = '/sys/logout';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { GetUserInfo, GetUserInfoQuery } from './GetUserInfo';
|
|
2
|
-
export { Logout, LogoutQuery } from './Logout';
|
|
1
|
+
export { GetUserInfo, GetUserInfoQuery } from './GetUserInfo';
|
|
2
|
+
export { Logout, LogoutQuery } from './Logout';
|
|
@@ -1,45 +1,45 @@
|
|
|
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 ListQuery {
|
|
9
|
-
/** 排序字段. */
|
|
10
|
-
public column?: string | null;
|
|
11
|
-
/** 排序方式. */
|
|
12
|
-
public order?: 'asc' | 'desc' | null;
|
|
13
|
-
/** 当前页数. */
|
|
14
|
-
public pageNo?: number | null;
|
|
15
|
-
/** 每页条数. */
|
|
16
|
-
public pageSize?: number | null;
|
|
17
|
-
|
|
18
|
-
public constructor(obj?: ListQuery) {
|
|
19
|
-
keys(obj ?? {}).forEach((key: PropertyKey) => {
|
|
20
|
-
switch (key) {
|
|
21
|
-
case 'column':
|
|
22
|
-
case 'order':
|
|
23
|
-
case 'pageNo':
|
|
24
|
-
case 'pageSize':
|
|
25
|
-
Reflect.set(this, key, Reflect.get(obj ?? {}, key));
|
|
26
|
-
break;
|
|
27
|
-
default:
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* 工作站-分页列表查询.
|
|
36
|
-
*
|
|
37
|
-
* @param config 请求配置.
|
|
38
|
-
* @param option 请求选项.
|
|
39
|
-
*/
|
|
40
|
-
export function List(config?: IRequestConfig<ListQuery, {}>, option?: IRequestOptions): Promise<DEF.WMS.IPage<DEF.WMS.WorkstationDTO>> {
|
|
41
|
-
return httpClient().request({ method: List.method, url: List.url, ...(config ?? {}) }, option);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
List.method = 'GET' as const;
|
|
45
|
-
List.url = '/workstation/workstation/list';
|
|
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 ListQuery {
|
|
9
|
+
/** 排序字段. */
|
|
10
|
+
public column?: string | null;
|
|
11
|
+
/** 排序方式. */
|
|
12
|
+
public order?: 'asc' | 'desc' | null;
|
|
13
|
+
/** 当前页数. */
|
|
14
|
+
public pageNo?: number | null;
|
|
15
|
+
/** 每页条数. */
|
|
16
|
+
public pageSize?: number | null;
|
|
17
|
+
|
|
18
|
+
public constructor(obj?: ListQuery) {
|
|
19
|
+
keys(obj ?? {}).forEach((key: PropertyKey) => {
|
|
20
|
+
switch (key) {
|
|
21
|
+
case 'column':
|
|
22
|
+
case 'order':
|
|
23
|
+
case 'pageNo':
|
|
24
|
+
case 'pageSize':
|
|
25
|
+
Reflect.set(this, key, Reflect.get(obj ?? {}, key));
|
|
26
|
+
break;
|
|
27
|
+
default:
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 工作站-分页列表查询.
|
|
36
|
+
*
|
|
37
|
+
* @param config 请求配置.
|
|
38
|
+
* @param option 请求选项.
|
|
39
|
+
*/
|
|
40
|
+
export function List(config?: IRequestConfig<ListQuery, {}>, option?: IRequestOptions): Promise<DEF.WMS.IPage<DEF.WMS.WorkstationDTO>> {
|
|
41
|
+
return httpClient().request({ method: List.method, url: List.url, ...(config ?? {}) }, option);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
List.method = 'GET' as const;
|
|
45
|
+
List.url = '/workstation/workstation/list';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { List, ListQuery } from './List';
|
|
1
|
+
export { List, ListQuery } from './List';
|
package/api/WMS/index.ts
CHANGED
|
@@ -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';
|
package/api/api.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { WMSAPI as WMS } from './WMS';
|
|
1
|
+
export { WMSAPI as WMS } from './WMS';
|
package/api/def.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { WMSDEF as WMS } from './WMS';
|
|
1
|
+
export { WMSDEF as WMS } from './WMS';
|
package/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';
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UniPopup ref="popupRef$" :isMaskClick="false" class="kg-api-url" type="bottom">
|
|
3
|
+
<UniCard :isFull="true" class="popupCard" :title="kg.t('pda.KgApiUil.Title', {}, '配置后端服务地址')">
|
|
4
|
+
<view>
|
|
5
|
+
<view class="body">
|
|
6
|
+
<UniEasyinput v-model="apiUrl$" :clearSize="24" :disabled="isRequestDoing$" :focus="true" placeholder="http://127.0.0.1:8080/" trim></UniEasyinput>
|
|
7
|
+
</view>
|
|
8
|
+
<view class="buttons">
|
|
9
|
+
<button :disabled="isRequestDoing$" :type="'default' as any" class="btn btn-cancel" @tap.stop="onCancel()">{{ kg.t('kg.cancel02', {}, '取消') }}</button>
|
|
10
|
+
<button :disabled="isRequestDoing$" :type="'primary' as any" class="btn btn-ok" @tap.stop="onOk">{{ kg.t('kg.ok', {}, '确认') }}{{ isRequestDoing$ ? ' ...' : '' }}</button>
|
|
11
|
+
</view>
|
|
12
|
+
</view>
|
|
13
|
+
</UniCard>
|
|
14
|
+
</UniPopup>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<!--配置后端服务地址-->
|
|
18
|
+
<script lang="ts" name="KgApiUil" setup>
|
|
19
|
+
import { UniCard, UniEasyinput, UniPopup } from '../../uni-ui';
|
|
20
|
+
import { ref } from 'vue';
|
|
21
|
+
import { useAppStore, useKg } from '../../config';
|
|
22
|
+
import { KG } from '../../model';
|
|
23
|
+
|
|
24
|
+
const kg = useKg();
|
|
25
|
+
const appStore = useAppStore();
|
|
26
|
+
|
|
27
|
+
//region DATA
|
|
28
|
+
//----------------------------------------------------------------------------------------------------
|
|
29
|
+
const apiUrl$ = ref<string>('');
|
|
30
|
+
const popupRef$ = ref<any>(null);
|
|
31
|
+
const isRequestDoing$ = ref<boolean>(false);
|
|
32
|
+
//----------------------------------------------------------------------------------------------------
|
|
33
|
+
//endregion
|
|
34
|
+
|
|
35
|
+
//region FUNCTION
|
|
36
|
+
//----------------------------------------------------------------------------------------------------
|
|
37
|
+
function open() {
|
|
38
|
+
let storeApiUrl = uni.getStorageSync(KG.STORAGE_KEY__API_URL);
|
|
39
|
+
if (storeApiUrl != '' || storeApiUrl != null) {
|
|
40
|
+
apiUrl$.value = storeApiUrl;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
popupRef$.value?.open();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function onCancel() {
|
|
47
|
+
popupRef$.value?.close();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function onOk() {
|
|
51
|
+
isRequestDoing$.value = true;
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
appStore.setApiUrl(apiUrl$.value!);
|
|
55
|
+
|
|
56
|
+
await kg.requestVarConfigDescriptionList();
|
|
57
|
+
|
|
58
|
+
uni.showToast({ icon: 'none', title: kg.t('pda.KgApiUil.SuccessMessage', {}, '配置成功') });
|
|
59
|
+
|
|
60
|
+
uni.showModal({
|
|
61
|
+
title: kg.t('kg.tip02', {}, '提示'),
|
|
62
|
+
content: kg.t('pda.KgApiUil.RelaunchContent', {}, '翻译加载成功, 需要重启应用.'),
|
|
63
|
+
confirmText: kg.t('pda.KgApiUil.RelaunchOkText', {}, '立即重启'),
|
|
64
|
+
showCancel: false,
|
|
65
|
+
success: function (result) {
|
|
66
|
+
if (result.confirm) {
|
|
67
|
+
kg.setLocale(kg.locale);
|
|
68
|
+
|
|
69
|
+
/* #ifdef H5 */
|
|
70
|
+
window.location.reload();
|
|
71
|
+
/* #endif */
|
|
72
|
+
|
|
73
|
+
/* #ifdef APP-PLUS */
|
|
74
|
+
popupRef$.value?.close();
|
|
75
|
+
/* #endif */
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
} finally {
|
|
80
|
+
isRequestDoing$.value = false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//----------------------------------------------------------------------------------------------------
|
|
84
|
+
//endregion
|
|
85
|
+
|
|
86
|
+
defineExpose({ open });
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<style>
|
|
90
|
+
.kg-api-url :deep .uni-card {
|
|
91
|
+
margin: 0 2px 1px 1px !important;
|
|
92
|
+
box-shadow: none !important;
|
|
93
|
+
border-radius: 3px !important;
|
|
94
|
+
border-left-width: 1px !important;
|
|
95
|
+
padding: 0px !important;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.kg-api-url :deep .uni-card .uni-card__header {
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.kg-api-url :deep .uni-card .uni-card__content {
|
|
102
|
+
padding: 0px !important;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.kg-api-url :deep .uni-card .uni-card__content .body {
|
|
106
|
+
padding: 1px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.kg-api-url :deep .uni-card .uni-card__content .body .uni-easyinput .uniui-clear {
|
|
110
|
+
width: 32px;
|
|
111
|
+
height: 32px;
|
|
112
|
+
padding: 0;
|
|
113
|
+
margin: 0;
|
|
114
|
+
background: #dcdfe6;
|
|
115
|
+
border-radius: 0 2px 2px 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.kg-api-url :deep .uni-card .uni-card__content .body .uni-easyinput .uniui-clear:before {
|
|
119
|
+
color: #fff;
|
|
120
|
+
content: '\e66c' !important;
|
|
121
|
+
font-size: 12px !important;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.kg-api-url :deep .uni-card .uni-card__content .body .uni-easyinput .uni-easyinput__content {
|
|
125
|
+
line-height: 32px !important;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.kg-api-url :deep .uni-card .uni-card__content .body .uni-easyinput .uni-easyinput__content .uni-easyinput__content-input {
|
|
129
|
+
height: 32px !important;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.kg-api-url :deep .uni-card .uni-card__content .buttons {
|
|
133
|
+
display: flex;
|
|
134
|
+
align-items: center;
|
|
135
|
+
justify-content: space-between;
|
|
136
|
+
padding: 0px 1px 1px 1px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.kg-api-url :deep .uni-card .uni-card__content .buttons uni-button {
|
|
140
|
+
flex: 1;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.kg-api-url :deep .uni-card .uni-card__content .buttons uni-button + uni-button {
|
|
144
|
+
margin-left: 1px;
|
|
145
|
+
}
|
|
146
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as KgApiUil } from './KgApiUil.vue';
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<UniPopup ref="popupRef$" :type="'bottom'" class="kg-locale">
|
|
3
|
+
<UniCard :isFull="true" :title="kg.t('pda.KgLocale.Language', {}, '选择语言')">
|
|
4
|
+
<view>
|
|
5
|
+
<view class="body">
|
|
6
|
+
<UniDataCheckbox v-model="currentLocale$" :localdata="localeDataList$$" />
|
|
7
|
+
</view>
|
|
8
|
+
<view class="buttons">
|
|
9
|
+
<button class="btn btn-cancel" @tap.stop="onCancel()">{{ kg.t('kg.cancel02', {}, '取消') }}</button>
|
|
10
|
+
<button :type="'primary' as any" class="btn btn-ok" @tap.stop="onOk">{{ kg.t('kg.ok', {}, '确认') }}</button>
|
|
11
|
+
</view>
|
|
12
|
+
</view>
|
|
13
|
+
</UniCard>
|
|
14
|
+
</UniPopup>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<!--语言选择-->
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
import { UniCard, UniDataCheckbox, UniPopup } from '../../uni-ui';
|
|
20
|
+
import { computed, ref } from 'vue';
|
|
21
|
+
import { KG } from '../../model';
|
|
22
|
+
import { useKg } from '../../config';
|
|
23
|
+
|
|
24
|
+
const kg = useKg();
|
|
25
|
+
|
|
26
|
+
//region DATA
|
|
27
|
+
//----------------------------------------------------------------------------------------------------
|
|
28
|
+
const popupRef$ = ref<any>(null);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 当前选中语言.
|
|
32
|
+
*/
|
|
33
|
+
const currentLocale$ = ref<string>(kg.locale);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 语言数据列表.
|
|
37
|
+
*/
|
|
38
|
+
const localeDataList$$ = computed<Array<{ text: string; value: string }>>(() => {
|
|
39
|
+
return KG.LOCALE_DATA_LIST.map((i) => ({ text: i.text, value: i.code }));
|
|
40
|
+
});
|
|
41
|
+
//----------------------------------------------------------------------------------------------------
|
|
42
|
+
//endregion
|
|
43
|
+
|
|
44
|
+
//region FUNCTION
|
|
45
|
+
//----------------------------------------------------------------------------------------------------
|
|
46
|
+
/**
|
|
47
|
+
* 取消.
|
|
48
|
+
*/
|
|
49
|
+
function onCancel() {
|
|
50
|
+
popupRef$.value?.close();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 确定.
|
|
55
|
+
*/
|
|
56
|
+
function onOk() {
|
|
57
|
+
if (kg.locale === currentLocale$.value) {
|
|
58
|
+
popupRef$.value?.close();
|
|
59
|
+
} else {
|
|
60
|
+
uni.showModal({
|
|
61
|
+
title: kg.t('kg.tip02', {}, '提示'),
|
|
62
|
+
content: kg.t('pda.KgLocale.RelaunchContent', {}, '语言切换成功, 需要重启应用.'),
|
|
63
|
+
confirmText: kg.t('pda.KgLocale.RelaunchOkText', {}, '立即重启'),
|
|
64
|
+
showCancel: false,
|
|
65
|
+
success: function (result) {
|
|
66
|
+
if (result.confirm) {
|
|
67
|
+
kg.setLocale(currentLocale$.value);
|
|
68
|
+
|
|
69
|
+
/* #ifdef H5 */
|
|
70
|
+
window.location.reload();
|
|
71
|
+
/* #endif */
|
|
72
|
+
|
|
73
|
+
/* #ifdef APP-PLUS */
|
|
74
|
+
popupRef$.value?.close();
|
|
75
|
+
/* #endif */
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* 打开弹窗.
|
|
84
|
+
*/
|
|
85
|
+
function open() {
|
|
86
|
+
// 每次打开弹窗之前, 将当前选中语言重置为应用当前语言,
|
|
87
|
+
currentLocale$.value = kg.locale;
|
|
88
|
+
popupRef$.value?.open();
|
|
89
|
+
}
|
|
90
|
+
//----------------------------------------------------------------------------------------------------
|
|
91
|
+
//endregion
|
|
92
|
+
|
|
93
|
+
defineExpose({ open });
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<style>
|
|
97
|
+
.kg-locale :deep(.uni-card) {
|
|
98
|
+
margin: 0 2px 1px 1px !important;
|
|
99
|
+
box-shadow: none !important;
|
|
100
|
+
border-radius: 3px !important;
|
|
101
|
+
border-left-width: 1px !important;
|
|
102
|
+
padding: 0px !important;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.kg-locale :deep(.uni-card) .uni-card__header {
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.kg-locale :deep(.uni-card) .uni-card__content {
|
|
109
|
+
padding: 0px !important;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.kg-locale :deep(.uni-card) .body {
|
|
113
|
+
border-bottom: 1px solid #eeeeee;
|
|
114
|
+
margin-bottom: 1px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.kg-locale :deep(.uni-card) .body .uni-data-checklist .checklist-group {
|
|
118
|
+
flex-direction: column;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.kg-locale :deep(.uni-card) .body .uni-data-checklist .checklist-group .checklist-box {
|
|
122
|
+
margin: 0;
|
|
123
|
+
padding: 12px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.kg-locale :deep(.uni-card) .buttons {
|
|
127
|
+
display: flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
justify-content: space-between;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.kg-locale :deep(.uni-card) .buttons uni-button {
|
|
133
|
+
flex: 1;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.kg-locale :deep(.uni-card) .buttons uni-button + uni-button {
|
|
137
|
+
margin-left: 1px;
|
|
138
|
+
}
|
|
139
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as KgLocale } from './KgLocale.vue';
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
</UniNavBar>
|
|
10
10
|
|
|
11
11
|
<!--#ifdef APP-PLUS-->
|
|
12
|
-
<
|
|
12
|
+
<KgUpdate v-if="isCustomNavigationBar" />
|
|
13
13
|
<!--#endif-->
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
|
+
<!--页面顶部标题-->
|
|
16
17
|
<script lang="ts" name="KgNavBar" setup>
|
|
17
18
|
import { computed, ref } from 'vue';
|
|
18
19
|
import { UniIcons, UniNavBar } from '../../uni-ui';
|
|
19
20
|
import { KgUtil } from '../../util';
|
|
20
|
-
import {
|
|
21
|
+
import { KgUpdate } from '../KgUpdate';
|
|
22
|
+
import { useKg } from '../../config';
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
* 顶部标题栏.
|
|
24
|
-
*/
|
|
24
|
+
const kg = useKg();
|
|
25
25
|
|
|
26
26
|
//region DATA
|
|
27
27
|
// ----------------------------------------------------------------------------------------------------
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* 回到首页.
|
|
37
37
|
*/
|
|
38
38
|
function gotoHomePage() {
|
|
39
|
-
uni.redirectTo({ url:
|
|
39
|
+
uni.redirectTo({ url: `/${kg.homePagePath}` });
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
//endregion
|