@kengic/uni 0.7.13-beta.4 → 0.7.13-beta.5
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/package.json +1 -1
- package/page/PageMy.vue +122 -0
package/package.json
CHANGED
package/page/PageMy.vue
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="setting-container">
|
|
3
|
+
<UniList class="uni-list-setting">
|
|
4
|
+
<UniListItem :right-text="kgWarehouse.warehouse.value?.whDsc ?? kgWarehouse.warehouse.value?.whId ?? ''" link title="仓库" @click="openKgWarehouse" />
|
|
5
|
+
<UniListItem link title="工作站 / 工作区" :right-text="stationText" @click="openKgStation" />
|
|
6
|
+
<UniListItem link title="后端服务地址" :right-text="apiUrl" />
|
|
7
|
+
|
|
8
|
+
<!--#ifdef APP-PLUS-->
|
|
9
|
+
<UniListItem link title="当前版本" :right-text="currentVersion" @click="checkForUpdate" />
|
|
10
|
+
<UniListItem class="list-item-check-for-update" clickable title="检查更新" @click="checkForUpdate" />
|
|
11
|
+
<!--#endif-->
|
|
12
|
+
|
|
13
|
+
<UniListItem class="list-item-logout" clickable title="退出系统" @click="logout" />
|
|
14
|
+
</UniList>
|
|
15
|
+
</view>
|
|
16
|
+
<KgWarehouse ref="kgWarehouseRef"></KgWarehouse>
|
|
17
|
+
<KgStation ref="kgStationRef"></KgStation>
|
|
18
|
+
<!--#ifdef APP-PLUS-->
|
|
19
|
+
<KgUpdatePopup />
|
|
20
|
+
<!--#endif-->
|
|
21
|
+
<KgTabBar />
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script setup lang="ts">
|
|
25
|
+
import { computed, ref } from 'vue';
|
|
26
|
+
import { useAppStore } from '../store/app.store';
|
|
27
|
+
import { KgStation, KgTabBar, KgUpdatePopup, KgWarehouse, useKgStation, useKgWarehouse } from '../component';
|
|
28
|
+
import { UniList, UniListItem } from '../uni-ui';
|
|
29
|
+
import { KgUtil } from '../util';
|
|
30
|
+
|
|
31
|
+
const appStore = useAppStore();
|
|
32
|
+
const kgWarehouse = useKgWarehouse();
|
|
33
|
+
const kgStation = useKgStation();
|
|
34
|
+
|
|
35
|
+
const kgWarehouseRef = ref<any>(null);
|
|
36
|
+
const kgStationRef = ref<any>(null);
|
|
37
|
+
|
|
38
|
+
//region DATA
|
|
39
|
+
// ----------------------------------------------------------------------------------------------------
|
|
40
|
+
/**
|
|
41
|
+
* 工作站的显示文本.
|
|
42
|
+
*/
|
|
43
|
+
const stationText = computed<string>(() => {
|
|
44
|
+
let text = kgStation.station.value?.devcodDsc ?? kgStation.station.value?.devcod ?? '';
|
|
45
|
+
|
|
46
|
+
// 如果选择了工作区, 才显示工作区, 否则只显示工作站,
|
|
47
|
+
if (kgStation.area.value) {
|
|
48
|
+
text += ' / ' + ((kgStation.area.value.wrkareDsc || kgStation.area.value.wrkare) ?? '');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return text;
|
|
52
|
+
});
|
|
53
|
+
// ----------------------------------------------------------------------------------------------------
|
|
54
|
+
//endregion
|
|
55
|
+
|
|
56
|
+
/** 退出登录. */
|
|
57
|
+
function logout() {
|
|
58
|
+
uni.showModal({
|
|
59
|
+
title: '是否退出系统 ?',
|
|
60
|
+
success: function (res) {
|
|
61
|
+
if (res.confirm) {
|
|
62
|
+
appStore.logout();
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 打开仓库选择弹窗.
|
|
70
|
+
*/
|
|
71
|
+
function openKgWarehouse() {
|
|
72
|
+
kgWarehouseRef.value?.open();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 打开工作站选择弹窗.
|
|
77
|
+
*/
|
|
78
|
+
function openKgStation() {
|
|
79
|
+
kgStationRef.value?.open();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const apiUrl = computed<string>(() => appStore.getApiUrl ?? '');
|
|
83
|
+
|
|
84
|
+
/* #ifdef APP-PLUS */
|
|
85
|
+
/** 当前版本. */
|
|
86
|
+
const currentVersion = computed<string>(() => plus.runtime.version ?? '');
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* 检查更新.
|
|
90
|
+
*/
|
|
91
|
+
function checkForUpdate() {
|
|
92
|
+
KgUtil.checkForUpdate(true, false);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* #endif */
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<style lang="scss" scoped>
|
|
99
|
+
.uni-list-setting {
|
|
100
|
+
background-color: #e0e0e0;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.list-item-check-for-update {
|
|
104
|
+
text-align: center;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.list-item-check-for-update :deep .uni-list-item__content-title {
|
|
108
|
+
color: #2979ff;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.list-item-logout {
|
|
112
|
+
text-align: center;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.list-item-logout :deep .uni-list-item__content-title {
|
|
116
|
+
color: red;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
:deep .uni-list-item__content-title {
|
|
120
|
+
font-size: 13px;
|
|
121
|
+
}
|
|
122
|
+
</style>
|