Commit 903f93b92fb604c2966aa51fbc52a3d325545448

Authored by xp.Huang
2 parents 2ca927eb 32765446

Merge branch 'feat/i18n-support' into 'main_dev'

Feat/i18n support

See merge request yunteng/thingskit-app!162
Showing 60 changed files with 2155 additions and 891 deletions

Too many changes to show.

To preserve performance only 60 of 95 files are displayed.

... ... @@ -7,6 +7,7 @@
7 7 openId: ''
8 8 },
9 9 onLaunch(e) {
  10 + this.setI18nLocale()
10 11 // #ifdef APP-PLUS
11 12 uni.reLaunch({
12 13 url: '/pages/index/splash'
... ... @@ -28,6 +29,26 @@
28 29 const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || localStorage.getItem('userInfo'));
29 30 // #endif
30 31 return userInfo.isThirdLogin
  32 + },
  33 +
  34 + // 判断i18n是中文还是英文
  35 + async setI18nLocale(){
  36 + // uni.setLocale('en')
  37 + try{
  38 + const {appLanguage} = (await uni.getSystemInfo())?.[1] || {}
  39 + if(appLanguage){
  40 + const i18n = appLanguage.includes('zh')?'zh-CN':'en'
  41 +
  42 + this.$i18n.locale = i18n
  43 + uni.setLocale(appLanguage.includes('zh')?'zh-Hans':'en')
  44 + return
  45 + }
  46 + this.$i18n.locale = 'zh-CN'
  47 + uni.setLocale('zh-Hans')
  48 + }catch{
  49 + this.$i18n.locale = uni.getLocale()
  50 + uni.setLocale('zh-Hans')
  51 + }
31 52 }
32 53 }
33 54 };
... ...
... ... @@ -3,15 +3,16 @@
3 3 <!-- 公共组件-每个页面必须引入 -->
4 4 <public-module></public-module>
5 5 <view class="alarm-detail-column">
6   - <view class="u-flex detail-column">
7   - <view class="column-line" v-for="(item,index) in alarmDetail" :key="index">
8   - <view class="column">
9   - <text class="text-org-bold">{{item.label}}</text>
  6 + <view class="detail-column">
  7 + <view class="column-line" v-for="(item, index) in alarmDetail" :key="index">
  8 + <view class="column" style="display: flex;justify-content: space-between;">
  9 + <text class="text-org-bold-alarm">{{ $t(item.label )}}</text>
10 10 <text class="text-device-muted text-clip alarm-text"
11   - :style="{color:hasColor.includes(item.label)?'#DE4437':''}">
12   - {{item.label===hasColor[0]? setAlarmStatus(item.value):item.label===hasColor[1]?setAlarmSeverity(item.value):
13   - item.label==='触发值:'?formatAlarmValueText:item.label==='触发条件:'?formatAlarmConditionText
14   - :item.label==='触发属性:'?formatAttrText:item.label==='告警设备:'?formatDeviceText:item.value}}
  11 + :style="{ color: hasColor.includes(item.label) ? '#DE4437' : '' }">
  12 + {{ item.label === hasColor[0] ?
  13 + setAlarmStatus(item.value) : item.label === hasColor[1] ? setAlarmSeverity(item.value) :
  14 + item.label === 'alarm.value' ? formatAlarmValueText : item.label === 'alarm.condition' ? formatAlarmConditionText
  15 + : item.label === 'alarm.attribute' ? formatAttrText : item.label === 'alarm.device' ? formatDeviceText : item.value }}
15 16 </text>
16 17 </view>
17 18 <view class="bottom-line"></view>
... ... @@ -19,13 +20,13 @@
19 20 </view>
20 21 </view>
21 22 <!-- #ifdef MP -->
22   - <view class="handle-result text-org-bold" style="">处理结果</view>
  23 + <view class="handle-result text-org-bold" style="">{{ $t('alarm.processResult') }}</view>
23 24 <view class="hanle-main">
24 25 <u--form :label-style="{ 'font-size': '0rpx' }" style="padding-left: 26rpx;" labelPosition="left"
25 26 :model="formModel" ref="form1">
26 27 <u-form-item label="." prop="result" ref="item3">
27 28 <view style="position: relative;left: -60rpx;">
28   - <u--textarea border="none" height="96" placeholder="请输入处理结果" v-model="formModel.result" count>
  29 + <u--textarea border="none" height="96" :placeholder="$t('alarm.pleaseResult')" v-model="formModel.result" count>
29 30 </u--textarea>
30 31 </view>
31 32 </u-form-item>
... ... @@ -33,212 +34,230 @@
33 34 </view>
34 35 <!-- #endif -->
35 36 <!-- #ifdef APP-PLUS -->
36   - <view class="handle-result text-org-bold">处理结果</view>
  37 + <view class="handle-result text-org-bold">{{ $t('alarm.processResult') }}</view>
37 38 <view class="hanle-main">
38 39 <view>
39   - <u--textarea border="none" height="96" placeholder="请输入处理结果" v-model="formModel.result" count>
  40 + <u--textarea border="none" height="96" :placeholder="$t('alarm.pleaseResult')" v-model="formModel.result" count>
40 41 </u--textarea>
41 42 </view>
42 43 </view>
43 44 <!-- #endif -->
44 45 <view class="bottom-button">
45 46 <view v-if="handleText.includes(alarmDetail[8].value)" class="u-flex button-item">
46   - <u-button @click="handleSubmit" type="primary" shape="circle" text="处理"></u-button>
  47 + <u-button @click="handleSubmit" type="primary" shape="circle" :text="$t('alarm.handle')"></u-button>
47 48 </view>
48 49 <view v-if="clearText.includes(alarmDetail[8].value)" class="u-flex button-item">
49   - <u-button @click="handleRemove" type="error" shape="circle" text="清除"></u-button>
  50 + <u-button @click="handleRemove" type="error" shape="circle" :text="$t('alarm.cleanUp')"></u-button>
50 51 </view>
51 52 </view>
52 53 </view>
53 54 </template>
54 55
55 56 <script>
56   - import {
57   - mapActions
58   - } from 'vuex'
59   - import api from '@/api/index.js'
60   - import {
61   - alarmSeverity,
62   - alarmStatus,
63   - operationNumberOrDate,
64   - operationString,
65   - operationBoolean
66   - } from '@/pages/alarm/config/data.js';
67   - import {
68   - useShowToast,
69   - useNavigateBack
70   - } from '@/plugins/utils.js'
  57 +import {
  58 + mapActions
  59 +} from 'vuex'
  60 +import api from '@/api/index.js'
  61 +import {
  62 + alarmSeverity,
  63 + alarmStatus,
  64 + operationNumberOrDate,
  65 + operationString,
  66 + operationBoolean
  67 +} from '@/pages/alarm/config/data.js';
  68 +import {
  69 + useShowToast,
  70 + useNavigateBack
  71 +} from '@/plugins/utils.js'
71 72
72   - export default {
73   - data() {
74   - return {
75   - handleText: ['ACTIVE_UNACK', 'CLEARED_UNACK'],
76   - clearText: [ 'ACTIVE_ACK'],
77   - hasColor: ['告警级别:', '告警状态:'],
78   - alarmSeverity,
79   - alarmStatus,
80   - operationNumberOrDate,
81   - operationString,
82   - operationBoolean,
83   - formModel: {
84   - result: ''
85   - },
86   - detailId: '',
87   - alarmDetail: [],
88   - formatDeviceText: '',
89   - formatAlarmValueText: '',
90   - formatAlarmConditionText: '',
91   - formatAttrText:'',
92   - };
  73 +export default {
  74 + data() {
  75 + return {
  76 + handleText: ['ACTIVE_UNACK', 'CLEARED_UNACK'],
  77 + clearText: ['ACTIVE_ACK'],
  78 + hasColor: ['alarm.level', 'alarm.status'],
  79 + alarmSeverity,
  80 + alarmStatus,
  81 + operationNumberOrDate,
  82 + operationString,
  83 + operationBoolean,
  84 + formModel: {
  85 + result: ''
  86 + },
  87 + detailId: '',
  88 + alarmDetail: [],
  89 + formatDeviceText: '',
  90 + formatAlarmValueText: '',
  91 + formatAlarmConditionText: '',
  92 + formatAttrText: '',
  93 + };
  94 + },
  95 + onShow() {
  96 + this.$nextTick(() => {
  97 + uni.setNavigationBarTitle({
  98 + title: this.$t('menu.alarmDetail')
  99 + })
  100 + })
  101 + },
  102 + async onLoad(e) {
  103 + if (e.data !== null) {
  104 + let params = JSON.parse(decodeURIComponent(e.data));
  105 + const { deviceName, severity, organizationName, details, type, createdTime, status, id } = params
  106 +
  107 + this.detailId = id
  108 + this.alarmDetail = [
  109 + { label: 'alarm.scenario', value: type },
  110 + { label: 'alarm.level', value: severity },
  111 + { label: 'alarm.organization', value: organizationName },
  112 + { label: 'alarm.device', value: '' },
  113 + { label: 'alarm.attribute', value: '' },
  114 + { label: 'alarm.condition', value: '' },
  115 + { label: 'alarm.value', value: '' },
  116 + { label: 'alarm.time', value: createdTime },
  117 + { label: 'alarm.status', value: status },]
  118 +
  119 + const keys = Object.keys(details)
  120 + const dataFormat = await this.handleAlarmDetailFormat(keys);
  121 + this.formatAlarmDevice(details, dataFormat)
  122 + this.formatAlarmValue(details, dataFormat)
  123 + this.formatAlarmCondition(details, dataFormat)
  124 + this.formatAttr(details, dataFormat)
  125 + }
  126 + // 隐藏原生的tabbar
  127 + uni.hideTabBar();
  128 + },
  129 + methods: {
  130 + ...mapActions(['updateBadgeTotal']),
  131 + setAlarmStatus(value) {
  132 + const values = this.alarmSeverity.find(item => item.value === value).label
  133 + return values?this.$t(values):values
  134 + },
  135 + setAlarmSeverity(value) {
  136 + const values = this.alarmStatus.find(item => item.value === value).label
  137 + return values?this.$t(values):''
  138 + },
  139 + returnPrevPage(title) {
  140 + useShowToast(title)
  141 + let pages = getCurrentPages(); //获取所有页面栈实例列表
  142 + let nowPage = pages[pages.length - 1]; //当前页页面实例
  143 + let prevPage = pages[pages.length - 2]; //上一页页面实例
  144 + prevPage.$vm.detailStatus = true;
93 145 },
94   - async onLoad(e) {
95   - if (e.data !== null) {
96   - let params = JSON.parse(decodeURIComponent(e.data));
97   - const {deviceName,severity,organizationName,details,type,createdTime,status,id} = params
98   -
99   - this.detailId = id
100   - this.alarmDetail = [{label: '告警场景:',value: type},{label: '告警级别:',value: severity},{label: '所属组织:',value: organizationName},{label: '告警设备:',value: ''},{label:'触发属性:',value:''},{label: '触发条件:',value: ''},{label: '触发值:',value: ''},{label: '告警时间:',value: createdTime},{label: '告警状态:',value: status},]
101   -
102   - const keys = Object.keys(details)
103   - const dataFormat = await this.handleAlarmDetailFormat(keys);
104   - this.formatAlarmDevice(details,dataFormat)
105   - this.formatAlarmValue(details,dataFormat)
106   - this.formatAlarmCondition(details,dataFormat)
107   - this.formatAttr(details,dataFormat)
  146 + async handleSubmit() {
  147 + if (this.formModel.result == '') return uni.$u.toast(this.$t('alarm.pleaseResult'));
  148 + const res = await api.alarmApi.postAlarmAckApi(this.detailId)
  149 + if (res == '') {
  150 + this.returnPrevPage(this.$t('common.processSuccess'))
  151 + setTimeout(() => {
  152 + useNavigateBack(1)
  153 + }, 500);
108 154 }
109   - // 隐藏原生的tabbar
110   - uni.hideTabBar();
111 155 },
112   - methods: {
113   - ...mapActions(['updateBadgeTotal']),
114   - setAlarmStatus(value) {
115   - return this.alarmSeverity.find(item => item.value === value).label
116   - },
117   - setAlarmSeverity(value) {
118   - return this.alarmStatus.find(item => item.value === value).label
119   - },
120   - returnPrevPage(title) {
121   - useShowToast(title)
122   - let pages = getCurrentPages(); //获取所有页面栈实例列表
123   - let nowPage = pages[pages.length - 1]; //当前页页面实例
124   - let prevPage = pages[pages.length - 2]; //上一页页面实例
125   - prevPage.$vm.detailStatus = true;
126   - },
127   - async handleSubmit() {
128   - if (this.formModel.result == '') return uni.$u.toast('请输入处理结果');
129   - const res = await api.alarmApi.postAlarmAckApi(this.detailId)
130   - if (res == '') {
131   - this.returnPrevPage('处理成功~')
132   - setTimeout(() => {
133   - useNavigateBack(1)
134   - }, 500);
135   - }
136   - },
137   - async handleRemove() {
138   - const res = await api.alarmApi.postAlarmClearApi(this.detailId)
139   - if (res == '') {
140   - this.returnPrevPage('清除成功~')
141   - setTimeout(async () => {
142   - useNavigateBack(1)
143   - const res = await uni.$u.http.get('/yt/homepage/app?login=true');
144   - if (res) {
145   - //异步实时更新告警徽标数
146   - await this.updateBadgeTotal(res.totalAlarm?.activedAlarm);
147   - }
148   - }, 500);
149   - }
150   - },
151   - //触发值处理
152   - formatAlarmValue(e,dataFormat) {
153   - const keys = Object.keys(e)
154   - const values = keys.reduce((acc, curr) => {
155   - const items = e[curr]?.triggerData
156   - dataFormat.forEach((dataItem => {
157   - if (dataItem.tbDeviceId === curr) {
158   - if(!items?.realValue) return
159   - acc.push(
160   - `${items.realValue}`
161   - )
162   - }
163   - }))
164   - return acc
165   - }, [])
166   - this.formatAlarmValueText = values.join(',')
167   - },
168   - //触发条件处理
169   - formatAlarmCondition(e) {
170   - const keys = Object.keys(e)
171   - const values = keys.reduce((acc, curr) => {
172   - acc.push({
173   - login: e[curr]?.triggerData?.logic,
174   - logicValue: e[curr]?.triggerData?.logicValue
175   - })
176   - return acc
177   - }, [])
178   - const operation = [...operationNumberOrDate, ...operationString, ...operationBoolean]
179   - const format = values.map(item => {
180   - const findOperation = operation.find(findItem => findItem.value === item.login)?.symbol
181   - return findOperation + item.logicValue
  156 + async handleRemove() {
  157 + const res = await api.alarmApi.postAlarmClearApi(this.detailId)
  158 + if (res == '') {
  159 + this.returnPrevPage(this.$t('common.clearSuccess'))
  160 + setTimeout(async () => {
  161 + useNavigateBack(1)
  162 + const res = await uni.$u.http.get('/yt/homepage/app?login=true');
  163 + if (res) {
  164 + //异步实时更新告警徽标数
  165 + await this.updateBadgeTotal(res.totalAlarm?.activedAlarm);
  166 + }
  167 + }, 500);
  168 + }
  169 + },
  170 + //触发值处理
  171 + formatAlarmValue(e, dataFormat) {
  172 + const keys = Object.keys(e)
  173 + const values = keys.reduce((acc, curr) => {
  174 + const items = e[curr]?.triggerData
  175 + dataFormat.forEach((dataItem => {
  176 + if (dataItem.tbDeviceId === curr) {
  177 + if (!items?.realValue) return
  178 + acc.push(
  179 + `${items.realValue}`
  180 + )
  181 + }
  182 + }))
  183 + return acc
  184 + }, [])
  185 + this.formatAlarmValueText = values.join(',')
  186 + },
  187 + //触发条件处理
  188 + formatAlarmCondition(e) {
  189 + const keys = Object.keys(e)
  190 + const values = keys.reduce((acc, curr) => {
  191 + acc.push({
  192 + login: e[curr]?.triggerData?.logic,
  193 + logicValue: e[curr]?.triggerData?.logicValue
182 194 })
183   - this.formatAlarmConditionText = format.filter(Boolean).join(',')
184   - },
185   - // 触发属性
186   - formatAttr(e,dataFormat){
187   - const keys = Object.keys(e)
188   - const values = keys.reduce((acc, curr) => {
189   - const items = e[curr]?.triggerData
190   - dataFormat.forEach((dataItem => {
191   - if (dataItem.tbDeviceId === curr) {
192   - const findAttribute = dataItem.attribute.find(findItem => findItem.identifier === items?.key)
193   - if(!findAttribute?.name && !items?.key) return
194   - acc.push(`${findAttribute?.name || items?.key || ' '}`)
195   - }
196   - }))
197   - return acc
198   - }, [])
199   - this.formatAttrText = values.join(',')
200   - },
201   - //告警设备处理
202   - async formatAlarmDevice(e,dataFormat) {
203   - if (!dataFormat) this.formatDeviceText = ''
204   - if (Array.isArray(dataFormat) && dataFormat.length === 0) this.formatDeviceText = ''
205   - this.formatDeviceText = dataFormat.map(item => item.name).join(',')
206   - },
207   - async handleAlarmDetailFormat(keys) {
208   - const temp = [];
209   - for (let item of keys) {
210   - if (item === 'key' || item === 'data') return; //旧数据则终止
211   - const deviceDetailRes = await api.deviceApi.getDeviceDetail(item);
212   - const { deviceProfileId } = deviceDetailRes;
213   - if (!deviceProfileId) return;
214   - const attributeRes = await api.deviceApi.getAttribute(deviceProfileId);
215   - const dataFormat = this.handleDataFormat(deviceDetailRes, attributeRes);
216   - temp.push(dataFormat);
217   - }
218   - return temp;
219   - },
220   - handleDataFormat(deviceDetail, attributes) {
221   - const { name,tbDeviceId } = deviceDetail;
222   - const attribute = attributes.map((item) => ({
223   - identifier: item.identifier,
224   - name: item.name,
225   - detail: item.detail
226   - }));
227   - return {
228   - name,
229   - tbDeviceId,
230   - attribute,
231   - };
  195 + return acc
  196 + }, [])
  197 + const operation = [...operationNumberOrDate, ...operationString, ...operationBoolean]
  198 + const format = values.map(item => {
  199 + const findOperation = operation.find(findItem => findItem.value === item.login)?.symbol
  200 + return findOperation + item.logicValue
  201 + })
  202 + this.formatAlarmConditionText = format.filter(Boolean).join(',')
  203 + },
  204 + // 触发属性
  205 + formatAttr(e, dataFormat) {
  206 + const keys = Object.keys(e)
  207 + const values = keys.reduce((acc, curr) => {
  208 + const items = e[curr]?.triggerData
  209 + dataFormat.forEach((dataItem => {
  210 + if (dataItem.tbDeviceId === curr) {
  211 + const findAttribute = dataItem.attribute.find(findItem => findItem.identifier === items?.key)
  212 + if (!findAttribute?.name && !items?.key) return
  213 + acc.push(`${findAttribute?.name || items?.key || ' '}`)
  214 + }
  215 + }))
  216 + return acc
  217 + }, [])
  218 + this.formatAttrText = values.join(',')
  219 + },
  220 + //告警设备处理
  221 + async formatAlarmDevice(e, dataFormat) {
  222 + if (!dataFormat) this.formatDeviceText = ''
  223 + if (Array.isArray(dataFormat) && dataFormat.length === 0) this.formatDeviceText = ''
  224 + this.formatDeviceText = dataFormat.map(item => item.name).join(',')
  225 + },
  226 + async handleAlarmDetailFormat(keys) {
  227 + const temp = [];
  228 + for (let item of keys) {
  229 + if (item === 'key' || item === 'data') return; //旧数据则终止
  230 + const deviceDetailRes = await api.deviceApi.getDeviceDetail(item);
  231 + const { deviceProfileId } = deviceDetailRes;
  232 + if (!deviceProfileId) return;
  233 + const attributeRes = await api.deviceApi.getAttribute(deviceProfileId);
  234 + const dataFormat = this.handleDataFormat(deviceDetailRes, attributeRes);
  235 + temp.push(dataFormat);
232 236 }
  237 + return temp;
  238 + },
  239 + handleDataFormat(deviceDetail, attributes) {
  240 + const { name, tbDeviceId } = deviceDetail;
  241 + const attribute = attributes.map((item) => ({
  242 + identifier: item.identifier,
  243 + name: item.name,
  244 + detail: item.detail
  245 + }));
  246 + return {
  247 + name,
  248 + tbDeviceId,
  249 + attribute,
  250 + };
233 251 }
234   - };
  252 + }
  253 +};
235 254 </script>
236 255
237 256 <style lang="scss" scoped>
238   - @import './static/alarmDetail.scss';
  257 +@import './static/alarmDetail.scss';
239 258
240   - /deep/ .u-button--primary {
241   - background-color: #377dff !important;
242   - border-color: #377dff !important;
243   - }
  259 +/deep/ .u-button--primary {
  260 + background-color: #377dff !important;
  261 + border-color: #377dff !important;
  262 +}
244 263 </style>
... ...
... ... @@ -3,15 +3,23 @@
3 3 height: 100vh;
4 4 background-color: #f8f9fa;
5 5 }
  6 +.text-org-bold-alarm {
  7 + min-width:200rpx;
  8 + color: #333333;
  9 + font-family: PingFangSC-Medium, PingFang SC;
  10 + font-weight: 400;
  11 + font-size: 15px;
  12 +}
6 13 .alarm-detail-column {
7 14 border-radius: 10px;
8 15 width: 688rpx;
9 16 height: 780rpx;
10 17 background-color: #ffffff;
11 18 .detail-column {
12   - width:750rpx;
  19 + width:688rpx;
13 20 flex-direction: column;
14 21 align-items: center;
  22 + padding:0 12rpx;
15 23 .column-line{
16 24 display:flex;
17 25 flex-direction: column;
... ... @@ -19,15 +27,16 @@
19 27 display:flex;
20 28 margin-top: 10rpx;
21 29 line-height: 68rpx;
22   - width:700rpx;
  30 + width:664rpx;
23 31 height: 74rpx;
24 32 align-items: center;
25 33 .device-name{
26 34 width:222rpx;
27 35 }
28 36 .alarm-text{
29   - width:460rpx;
  37 + width:330rpx;
30 38 overflow-x: scroll;
  39 + text-overflow: ellipsis;
31 40 }
32 41
33 42 .text {
... ...
1 1 <template>
2 2 <view class="header-org" @click="$emit('openOrg')">
3 3 <view class="org-item">
4   - <view class="u-flex org-contact"><text class="text">组织关系</text></view>
  4 + <view class="u-flex org-contact"><text class="text">{{ $t('common.organizationalRelation') }}</text></view>
5 5 <view class="u-flex org-device">
6 6 <image class="device-image" :src="imageSrc"></image>
7 7 <text class="device-text">{{title}} {{ total }}</text>
... ... @@ -37,7 +37,7 @@
37 37 // top: 75rpx;
38 38
39 39 .org-item {
40   - width: 350rpx;
  40 + // width: 350rpx;
41 41 height: 200rpx;
42 42
43 43 .org-contact {
... ...
... ... @@ -8,13 +8,13 @@
8 8 </view>
9 9 </view>
10 10 <view @click="$emit('openSearchDialog')" class="search-right">
11   - <text>筛选</text>
  11 + <text>{{ $t('common.screen') }}</text>
12 12 <image src="../../static/shaixuan.png" />
13 13 </view>
14 14 </view>
15 15 <u-line />
16 16 <view class="org">
17   - <u-cell @click="$emit('openOrg')" isLink title="组织关系" :border="false">
  17 + <u-cell @click="$emit('openOrg')" isLink :title="$t('common.organizationalRelateion')" :border="false">
18 18 <view slot="label" class="label" style="display: flex; align-items: center;margin-top: 20rpx;">
19 19 <image src="../../static/org.png" style="width: 24rpx;height: 28rpx;"></image>
20 20 <view style="margin-left: 10rpx; color: #666;">
... ... @@ -94,4 +94,4 @@
94 94 }
95 95 }
96 96 }
97   -</style>
\ No newline at end of file
  97 +</style>
... ...
... ... @@ -11,7 +11,7 @@
11 11 </view>
12 12 </view>
13 13 <!-- 加载动画结束 -->
14   - <view class="title">加载中...</view>
  14 + <view class="title">{{ $t('common.loading') }}</view>
15 15 </view>
16 16 </template>
17 17
... ...
... ... @@ -6,7 +6,7 @@
6 6 :safeAreaInsetBottom="false" :activeColor="activeColor" :inactiveColor="inactiveColor" :border="border">
7 7 <block v-for="(item, index) in list" :key="index">
8 8 <!-- 自定义icon -->
9   - <u-tabbar-item :text="item.name" :badge="item.badge" :dot="item.dot" :badgeStyle="item.badgeStyle">
  9 + <u-tabbar-item :text="$t(item.name)" :badge="item.badge" :dot="item.dot" :badgeStyle="item.badgeStyle">
10 10 <view slot="active-icon">
11 11 <image style="width:50rpx;height: 50rpx;" :src="item.iconFill" mode=""></image>
12 12 </view>
... ... @@ -81,26 +81,26 @@
81 81 path: '', //当前路径
82 82 //#ifdef MP
83 83 list: [{
84   - name: '首页',
  84 + name: 'menu.homePage',
85 85 url: 'pages/index/index',
86 86 icon: '../../../static/home-un.png',
87 87 iconFill: '../../../static/home-yes.png'
88 88 },
89 89 {
90   - name: '设备',
  90 + name: 'menu.device',
91 91 url: 'pages/device/device',
92 92 icon: '../../../static/device-un.png',
93 93 iconFill: '../../../static/device-yes.png'
94 94 },
95 95 {
96   - name: '告警',
  96 + name: 'menu.alarm',
97 97 url: 'pages/alarm/alarm',
98 98 icon: '../../../static/alert-un.png',
99 99 iconFill: '../../../static/alert-yes.png',
100 100 badge: this.$store.state.badgeInfo
101 101 },
102 102 {
103   - name: '我的',
  103 + name: 'menu.my',
104 104 url: 'pages/personal/personal',
105 105 icon: '../../../static/my-un.png',
106 106 iconFill: '../../../static/my-yes.png'
... ... @@ -109,26 +109,26 @@
109 109 //#endif
110 110 //#ifdef APP-PLUS
111 111 list: [{
112   - name: '首页',
  112 + name: 'menu.homePage',
113 113 url: 'pages/index/index',
114 114 icon: '/static/home-un.png',
115 115 iconFill: '/static/home-yes.png'
116 116 },
117 117 {
118   - name: '设备',
  118 + name: 'menu.device',
119 119 url: 'pages/device/device',
120 120 icon: '/static/device-un.png',
121 121 iconFill: '/static/device-yes.png'
122 122 },
123 123 {
124   - name: '告警',
  124 + name: 'menu.alarm',
125 125 url: 'pages/alarm/alarm',
126 126 icon: '/static/alert-un.png',
127 127 iconFill: '/static/alert-yes.png',
128 128 badge: this.$store.state.badgeInfo
129 129 },
130 130 {
131   - name: '我的',
  131 + name: 'menu.my',
132 132 url: 'pages/personal/personal',
133 133 icon: '/static/my-un.png',
134 134 iconFill: '/static/my-yes.png'
... ... @@ -189,4 +189,4 @@
189 189 right: 0;
190 190 z-index: 1000;
191 191 }
192   -</style>
  192 +</style>
... ...
1   -import {
2   - getTabbarHeight
3   -} from "@/plugins/utils";
  1 +import { getTabbarHeight } from '@/plugins/utils'
4 2 /**
5 3 * 服务端配置项
6 4 * baseUrl 服务端 api地址
... ... @@ -9,49 +7,50 @@ import {
9 7 * baseWebSocketUrl 服务端 websocket地址
10 8 * socketPrefix websocket前缀 ((https, wss),( http, ws))
11 9 */
12   -const baseUrl = "http://localhost:8080/api";
13   -const baseVisualUrl = "http://localhost:9527"
  10 +const baseUrl = 'http://localhost:8080/api'
  11 +// const baseUrl = 'http://192.168.1.9:8080/api'
  12 +const baseVisualUrl = 'http://localhost:9527'
14 13 // const baseVisualUrl = "http://192.168.1.4:8083"
15   -const baseDrawioUrl = "http://localhost:9527/thingskit-scada";
16   -const baseWebSocketUrl = "localhost:8080";
17   -const socketPrefix = "ws";
  14 +const baseDrawioUrl = 'http://localhost:9527/thingskit-scada'
  15 +const baseWebSocketUrl = 'localhost:8080'
  16 +const socketPrefix = 'ws'
18 17
19 18 let systemInfo = {
20   - ...getTabbarHeight(),
21   - // #ifdef MP-ALIPAY
22   - navBarH: uni.getSystemInfoSync().statusBarHeight +
23   - uni.getSystemInfoSync().titleBarHeight, //菜单栏总高度--单位px
24   - titleBarHeight: uni.getSystemInfoSync().titleBarHeight, //标题栏高度--单位px
25   - // #endif
26   - // #ifndef MP-ALIPAY
27   - navBarH: uni.getSystemInfoSync().statusBarHeight + 44, //菜单栏总高度--单位px
28   - titleBarHeight: 44, //标题栏高度--单位px
29   - // #endif
30   -};
  19 + ...getTabbarHeight(),
  20 + // #ifdef MP-ALIPAY
  21 + navBarH: uni.getSystemInfoSync().statusBarHeight + uni.getSystemInfoSync().titleBarHeight, //菜单栏总高度--单位px
  22 + titleBarHeight: uni.getSystemInfoSync().titleBarHeight, //标题栏高度--单位px
  23 + // #endif
  24 + // #ifndef MP-ALIPAY
  25 + navBarH: uni.getSystemInfoSync().statusBarHeight + 44, //菜单栏总高度--单位px
  26 + titleBarHeight: 44, //标题栏高度--单位px
  27 + // #endif
  28 +}
31 29 // 平台
32 30 // #ifdef MP-WEIXIN
33   -systemInfo.platform = "weixin";
  31 +systemInfo.platform = 'weixin'
34 32 // #endif
35 33 // #ifdef MP-ALIPAY
36   -systemInfo.platform = "alipay";
  34 +systemInfo.platform = 'alipay'
37 35 // #endif
38 36 // #ifdef MP-TOUTIAO
39   -systemInfo.platform = "toutiao";
  37 +systemInfo.platform = 'toutiao'
40 38 // #endif
41 39 // #ifdef APP-PLUS
42   -systemInfo.platform = "plus";
  40 +systemInfo.platform = 'plus'
43 41 // #endif
44 42 const courtConfig = {
45   - publicAppId: "", //公众号appId
46   - baseUrl, //服务端地址
47   - baseVisualUrl,//服务端看板地址
48   - baseDrawioUrl, //服务端组态地址
49   - baseWebSocketUrl, //服务端websocket地址
50   - socketPrefix, //websocket前缀
51   - systemInfo: systemInfo, //系统信息
52   - mapData: {
53   - key: "", //地图key
54   - sk: "",
55   - },
56   -};
57   -export default Object.assign({}, courtConfig);
  43 + publicAppId: '', //公众号appId
  44 + baseUrl, //服务端地址
  45 + baseVisualUrl, //服务端看板地址
  46 + baseDrawioUrl, //服务端组态地址
  47 + baseWebSocketUrl, //服务端websocket地址
  48 + socketPrefix, //websocket前缀
  49 + systemInfo: systemInfo, //系统信息
  50 + mapData: {
  51 + key: '', //地图key
  52 + sk: '',
  53 + },
  54 +}
  55 +export default Object.assign({}, courtConfig)
  56 +
... ...
  1 +import Vue from 'vue'
  2 +import VueI18n from 'vue-i18n'
  3 +import zh from '@/locale/lang/zh-CN'
  4 +import en from '@/locale/lang/en'
  5 +Vue.use(VueI18n)
  6 +let i18n = new VueI18n({
  7 + locale: uni.getLocale() || 'zh-CN',
  8 + messages: {
  9 + 'zh-CN': zh,
  10 + 'en': en
  11 + }
  12 +})
  13 +
  14 +export default i18n
... ...
1 1 import base from "@/config/baseUrl";
2 2 import store from "@/store";
  3 +import i18n from '@/config/i18n.js'
3 4 import {
4 5 judgeLogin
5 6 } from "@/config/login";
6 7
  8 +const BackEndLocaleMapping = {
  9 + 'en': 'en_US ',
  10 + 'zhCN': 'zh_CN',
  11 + 'zh-Hans': 'zh_CN'
  12 +};
  13 +
7 14 // 初始化请求配置
8 15 uni.$u.http.setConfig((config) => {
9 16 const token =
... ... @@ -49,6 +56,7 @@ uni.$u.http.interceptors.request.use(
49 56 "Bearer " + store.state.userInfo.isToken ||
50 57 uni.getStorageSync("userInfo").isToken ||
51 58 undefined;
  59 + config.header['Language'] = BackEndLocaleMapping[uni.getLocale()] || 'zh_CN'
52 60 config.baseURL =
53 61 getConfiguration == true ? base.baseDrawioUrl : base.baseUrl;
54 62 }
... ... @@ -83,20 +91,25 @@ uni.$u.http.interceptors.response.use(
83 91 store.commit("emptyUserInfo");
84 92 // 20秒节流,弹窗登录
85 93 uni.$u.throttle(judgeLogin(), 20000);
86   - return new Promise(() => {});
87   - } else {}
  94 + return new Promise(() => { });
  95 + } else { }
88 96 },
89 97 (response) => {
  98 + console.log(response, 'response2', i18n.t('common.cancelText'))
  99 + if (!response) {
  100 + uni.$u.toast(i18n.t('login.pleaseNetwork'))
  101 + return
  102 + }
90 103 // 关闭加载动画
91 104 store.commit("setLoadingShow", false);
92 105 let show = true;
93   - let errorData = "请检查网络或服务器";
  106 + let errorData = i18n.t('login.pleaseNetwork');
94 107 let message =
95 108 response.data?.message || response.data?.msg || response?.errMsg;
96 109 if (message == "request:fail url not in domain list") {
97   - errorData = "检查请求域名是否添加了域名白名单";
  110 + errorData = i18n.t('login.inspectDomain');
98 111 } else if (message == "request:fail timeout") {
99   - errorData = "请求超时:请检查网络";
  112 + errorData = i18n.t('login.requestTimeout');
100 113 } else if (response.data.status == 401) {
101 114 const isLoginFlag = uni.getStorageSync("userInfo");
102 115 if (!store.state.userInfo.isThirdLogin) {
... ... @@ -125,10 +138,10 @@ uni.$u.http.interceptors.response.use(
125 138 errorData = message || "";
126 139 }
127 140 // console.log('errorData', errorData);
128   - if(message != "request:ok"){
  141 + if (message != "request:ok") {
129 142 uni.$u.toast(message);
130 143 }
131 144 // if (show) uni.$u.toast(errorData);
132 145 return Promise.reject(response);
133 146 }
134   -);
  147 +);
... ...
... ... @@ -2,7 +2,7 @@
2 2 <view class="alert-page">
3 3 <!-- 告警头部 -->
4 4 <view class="filter-button" @click="openSearchDialog">
5   - <text>筛选</text>
  5 + <text>{{ $t('common.screen') }}</text>
6 6 <image src="/static/shaixuan.png" />
7 7 </view>
8 8 <!-- 告警分页 -->
... ... @@ -159,4 +159,4 @@
159 159 margin-left: 4rpx;
160 160 }
161 161 }
162   -</style>
\ No newline at end of file
  162 +</style>
... ...
... ... @@ -20,39 +20,39 @@
20 20 <view class="mr-2"
21 21 v-if="deviceDetail.deviceState === 'ONLINE' && deviceDetail.transportType !== deviceTypeNum.GBT">
22 22 <view class="cu-item" @tap="handleAppShowModal" data-target="Modal">
23   - <text>命令下发</text>
  23 + <text>{{ $t('device.commandIssuance') }}</text>
24 24 </view>
25 25 </view>
26 26 </view>
27 27 <!-- 设备详情 -->
28 28 <view class="detail">
29 29 <view class="detail-item">
30   - <view class="detail-label">设备编号</view>
  30 + <view class="detail-label">{{ $t('device.deviceNumber') }}</view>
31 31 <view class="detail-value">{{ deviceDetail.sn }}</view>
32 32 </view>
33 33 <u-line length="90%" margin="0 auto"></u-line>
34 34 <view class="detail-item">
35   - <view class="detail-label">设备类型</view>
  35 + <view class="detail-label">{{ $t('device.deviceType') }}</view>
36 36 <view class="detail-value">{{ deviceType }}</view>
37 37 </view>
38 38 <u-line length="90%" margin="0 auto"></u-line>
39 39 <view class="detail-item">
40   - <view class="detail-label">所属组织</view>
  40 + <view class="detail-label">{{ $t('common.belongingOrganization') }}</view>
41 41 <view class="detail-value">{{ deviceDetail.organizationDTO.name }}</view>
42 42 </view>
43 43 <u-line length="90%" margin="0 auto"></u-line>
44 44 <view class="detail-item">
45   - <view class="detail-label">最后连接时间</view>
  45 + <view class="detail-label">{{ $t('device.lastConnectionTime') }}</view>
46 46 <view class="detail-value">{{ formatLastOnlineTime }}</view>
47 47 </view>
48 48 <u-line length="90%" margin="0 auto"></u-line>
49 49 <view class="detail-item">
50   - <view class="detail-label">是否告警</view>
  50 + <view class="detail-label">{{ $t('device.isAlarm') }}</view>
51 51 <view class="detail-value">{{ alarmStatus }}</view>
52 52 </view>
53 53 <u-line length="90%" margin="0 auto"></u-line>
54 54 <view class="detail-item">
55   - <view class="detail-label">设备描述</view>
  55 + <view class="detail-label">{{ $t('device.deviceRemark') }}</view>
56 56 <view class="detail-value">{{ deviceDetail.description }}</view>
57 57 </view>
58 58 </view>
... ... @@ -118,20 +118,20 @@
118 118 },
119 119 computed: {
120 120 deviceStatus() {
121   - return this.deviceDetail.deviceState === 'INACTIVE' ? '待激活' : this.deviceDetail.deviceState === 'ONLINE' ?
122   - '在线' : '离线';
  121 + return this.deviceDetail.deviceState === 'INACTIVE' ? this.$t('common.toBeActivated') : this.deviceDetail.deviceState === 'ONLINE' ?
  122 + this.$t('common.onLine') : this.$t('common.offLine');
123 123 },
124 124 deviceType() {
125 125 return this.deviceDetail.deviceType === 'DIRECT_CONNECTION' ?
126   - '直连设备' :
  126 + this.$t('common.directlyDevice') :
127 127 this.deviceDetail.deviceType === 'GATEWAY' ?
128   - '网关设备' :
  128 + this.$t('common.gatewayDevice') :
129 129 this.deviceDetail.deviceType === 'SENSOR' ?
130   - '网关子设备' :
  130 + this.$t('common.sensorDevice') :
131 131 '';
132 132 },
133 133 alarmStatus() {
134   - return this.deviceDetail.alarmStatus === '0' ? '否' : '是';
  134 + return this.deviceDetail.alarmStatus === '0' ? this.$t('common.noText') : this.$t('common.yesText');
135 135 },
136 136 formatLastOnlineTime() {
137 137 return formatToDate(Number(this.deviceDetail.lastOnlineTime), 'YYYY-MM-DD HH:mm:ss');
... ... @@ -147,12 +147,12 @@
147 147 },
148 148 methods: {
149 149 handleCopy(value) {
150   - useShowModal(JSON.stringify(value), '命令下发', '复制内容').then(res => {
  150 + useShowModal(JSON.stringify(value), this.$t('device.commandIssuance'), this.$t('common.copyContent')).then(res => {
151 151 uni.setClipboardData({
152 152 data: JSON.stringify(value),
153 153 success: () => {
154 154 uni.showToast({
155   - title: '复制成功'
  155 + title: this.$t('common.copyOk')
156 156 })
157 157 }
158 158 });
... ... @@ -216,12 +216,12 @@
216 216 this.handleCommand(this.commandTypeStr, this.commandTypeStr, this.inputCommandContent)
217 217 },
218 218 async handleCommand(commandType, callType, values) {
219   - if (!values) return uni.$u.toast('请输入下发内容~');
  219 + if (!values) return uni.$u.toast(this.$t('device.pleaseEnterCommandContent'));
220 220 if (callType == 'TwoWay') {
221 221 const result = await api.deviceApi.getDeviceActiveTime(this.deviceDetail.tbDeviceId)
222 222 const [firsetItem] = result || []
223 223 if (!firsetItem.value) {
224   - return uni.$u.toast('当前设备不在线~')
  224 + return uni.$u.toast(this.$t('device.currentDeviceNotOnLine'))
225 225 }
226 226 }
227 227
... ... @@ -236,7 +236,7 @@
236 236 //TCP的格式只能是字符串
237 237 const zg = /^[0-9a-zA-Z]*$/;
238 238 if (!zg.test(values)) {
239   - uni.$u.toast('输入的内容只能是字母和数字的组合');
  239 + uni.$u.toast(this.$t('device.pleaseCommandRule'));
240 240 return;
241 241 }
242 242 this.commandValue.params = values;
... ... @@ -247,7 +247,7 @@
247 247
248 248 await api.deviceApi.issueCommand(callType, this.deviceDetail.tbDeviceId, this.commandValue);
249 249 this.cancelCommand();
250   - uni.$u.toast('下发成功~');
  250 + uni.$u.toast(this.$t('device.issuedSuccess'));
251 251 },
252 252
253 253 }
... ... @@ -392,4 +392,4 @@
392 392 /deep/ .u-modal__content {
393 393 padding: 30rpx 0 !important;
394 394 }
395   -</style>
\ No newline at end of file
  395 +</style>
... ...
... ... @@ -3,47 +3,47 @@
3 3 <view class="detail-top">{{ commandDetail.deviceName }}</view>
4 4 <view class="detail">
5 5 <view class="detail-item">
6   - <view class="detail-label">设备类型</view>
7   - <view class="detail-value">{{ deviceType }}</view>
  6 + <view class="detail-label">{{ $t('device.deviceType') }}</view>
  7 + <view class="detail-value">{{ $t(deviceType) }}</view>
8 8 </view>
9 9 <u-line length="90%" margin="0 auto"></u-line>
10 10 <view class="detail-item">
11   - <view class="detail-label">设备编号</view>
  11 + <view class="detail-label">{{$t('device.deviceNumber')}}</view>
12 12 <view class="detail-value">{{ commandDetail.deviceSn }}</view>
13 13 </view>
14 14 <u-line length="90%" margin="0 auto"></u-line>
15   - <view class="detail-item">
16   - <view class="detail-label">所属组织</view>
  15 + <view class="detail-item">s
  16 + <view class="detail-label">{{ $t('common.belongingOrganization') }}</view>
17 17 <view class="detail-value">{{ commandDetail.organizationName }}</view>
18 18 </view>
19 19 <u-line length="90%" margin="0 auto"></u-line>
20 20 <view class="detail-item">
21   - <view class="detail-label">命令下发时间</view>
  21 + <view class="detail-label">{{ $t('device.commandTime') }}</view>
22 22 <view class="detail-value">{{ format(commandDetail.createTime) }}</view>
23 23 </view>
24 24 <u-line length="90%" margin="0 auto"></u-line>
25 25 <view class="detail-item">
26   - <view class="detail-label">命令类型</view>
27   - <view class="detail-value">{{ commandDetail.additionalInfo.cmdType===1?'服务':'自定义' }}</view>
  26 + <view class="detail-label">{{ $t('device.commandType') }}</view>
  27 + <view class="detail-value">{{ commandDetail.additionalInfo.cmdType===1?$t('device.service'):$t('common.customText') }}</view>
28 28 </view>
29 29 <u-line length="90%" margin="0 auto" v-if="commandDetail.additionalInfo.cmdType"></u-line>
30 30 <view class="detail-item">
31   - <view class="detail-label">响应类型</view>
32   - <view class="detail-value">{{ commandDetail.request.oneway ? '单向' : '双向' }}</view>
  31 + <view class="detail-label">{{ $t('device.responseType') }}</view>
  32 + <view class="detail-value">{{ commandDetail.request.oneway ? $t('device.oneWay') : $t('device.twoWay') }}</view>
33 33 </view>
34 34 <u-line length="90%" margin="0 auto"></u-line>
35 35 <view class="detail-item">
36   - <view class="detail-label">命令状态</view>
  36 + <view class="detail-label">{{ $t('device.commandStatus') }}</view>
37 37 <view class="detail-value">{{ commandDetail.statusName }}</view>
38 38 </view>
39 39 <u-line length="90%" margin="0 auto"></u-line>
40 40 <view class="detail-item" v-if="!commandDetail.request.oneway">
41   - <view class="detail-label">响应结果</view>
42   - <view class="detail-value">{{ commandDetail.response?JSON.stringify(commandDetail.response):'无' }}
  41 + <view class="detail-label">{{ $t('device.responseResults') }}</view>
  42 + <view class="detail-value">{{ commandDetail.response?JSON.stringify(commandDetail.response):$t('common.noText') }}
43 43 </view>
44 44 </view>
45 45 </view>
46   - <view class="command">命令内容</view>
  46 + <view class="command">{{ $t('device.commandContent') }}</view>
47 47 <u-textarea :value="formatValue(commandDetail.request.body)" disabled></u-textarea>
48 48 <view style="height: 50rpx;"></view>
49 49 </view>
... ... @@ -62,12 +62,13 @@
62 62 },
63 63 computed: {
64 64 deviceType() {
  65 +
65 66 return this.commandDetail.deviceType === 'DIRECT_CONNECTION' ?
66   - '直连设备' :
  67 + 'common.directlyDevice' :
67 68 this.commandDetail.deviceType === 'GATEWAY' ?
68   - '网关设备' :
  69 + 'common.gatewayDevice' :
69 70 this.commandDetail.deviceType === 'SENSOR' ?
70   - '网关子设备' :
  71 + 'common.sensorDevice' :
71 72 '';
72 73 }
73 74 },
... ... @@ -90,6 +91,13 @@
90 91 }
91 92 }
92 93 },
  94 + onShow(){
  95 + this.$nextTick(()=>{
  96 + uni.setNavigationBarTitle({
  97 + title:this.$t('menu.commandDetail')
  98 + })
  99 + })
  100 + },
93 101 onLoad(options) {
94 102 const { data } = options;
95 103 this.commandDetail = JSON.parse(decodeURIComponent(data));
... ... @@ -101,4 +109,4 @@
101 109
102 110 <style lang="scss" scoped>
103 111 @import "../static/command-detail.scss";
104   -</style>
\ No newline at end of file
  112 +</style>
... ...
... ... @@ -2,26 +2,26 @@
2 2 <view class="w-100 modal-content">
3 3 <view>
4 4 <view style="max-height: 560rpx; overflow-y: scroll">
5   - <view class="header-title">命令下发</view>
  5 + <view class="header-title">{{ $t('device.commandIssuance') }}</view>
6 6 <view class="u-flex">
7   - <text class="type-text">下发类型:</text>
  7 + <text class="type-text">{{ $t('device.issuanceType') }}:</text>
8 8 <u-radio-group v-model="commandType" placement="row" @change="handleCommand">
9 9 <u-radio :customStyle="{ marginRight: '20rpx' }" v-for="item in commandTypeList"
10 10 activeColor="#3388FF" :label="item.label" :name="item.value" :key="item.value"></u-radio>
11 11 </u-radio-group>
12 12 </view>
13 13 <view class="u-flex" style="margin-top: 28rpx" v-if="commandType == 0">
14   - <text class="type-text">单向/双向:</text>
  14 + <text class="type-text">{{ $t('device.oneTwoWay') }}:</text>
15 15 <u-radio-group v-model="callType" placement="row">
16   - <u-radio activeColor="#3388FF" label="单向" name="OneWay"></u-radio>
  16 + <u-radio activeColor="#3388FF" :label="$t('device.oneWay')" name="OneWay"></u-radio>
17 17 <view style="margin: 0 20rpx"></view>
18   - <u-radio activeColor="#3388FF" label="双向" name="TwoWay"></u-radio>
  18 + <u-radio activeColor="#3388FF" :label="$t('device.twoWay')" name="TwoWay"></u-radio>
19 19 </u-radio-group>
20 20 </view>
21 21 <view class="u-flex" style="margin-top: 28rpx" v-else>
22   - <text class="type-text">服务:</text>
  22 + <text class="type-text">{{ $t('device.service') }}:</text>
23 23 <view @click="openService">
24   - <u-input shape="circle" v-model="serviceName" placeholder="请选择服务" disabled disabledColor="#fff"
  24 + <u-input shape="circle" v-model="serviceName" :placeholder="$t('device.pleaseSelectService')" disabled disabledColor="#fff"
25 25 suffixIcon="arrow-down" />
26 26 </view>
27 27 </view>
... ... @@ -30,14 +30,14 @@
30 30 flex-direction: column;
31 31 align-items: flex-start;
32 32 " v-if="isShowServiceFunctionName && commandType == 1">
33   - <text class="type-text">输入参数:</text>
  33 + <text class="type-text">{{ $t('device.inputParameter') }}:</text>
34 34 <seriesForm ref="seriesFormRef" :seriesInputData="seriesInputData" :isTCPTransport="isTCPTransport">
35 35 </seriesForm>
36 36 </view>
37 37 <view class="content-body" v-if="commandType == 0">
38 38 <div class="u-flex u-row-between">
39   - <u--textarea :placeholder="`请输入下发内容${
40   - isShowTCP ? '(字符串格式)' : '(json格式)'
  39 + <u--textarea :placeholder="`${$t('device.pleaseEnterCommandContent')}${
  40 + isShowTCP ? `${$t('device.stringFormat')}` : `${$t('device.jsonFormat')}`
41 41 }`" v-model="inputCommandVal" />
42 42 <u-icon v-if="!isShowTCP" @click="handleCopy(copyTextValue)" name="question-circle"
43 43 color="#2979ff" size="28" class="ml-10">
... ... @@ -47,16 +47,16 @@
47 47 </view>
48 48 <view class="button-group">
49 49 <view>
50   - <u-button :customStyle="{ color: '#333' }" color="#e3e3e5" shape="circle" text="取消"
  50 + <u-button :customStyle="{ color: '#333' }" color="#e3e3e5" shape="circle" :text="$t('common.cancelText')"
51 51 @click="cancelCommand"></u-button>
52 52 </view>
53 53 <view>
54   - <u-button color="#3388ff" shape="circle" text="确认" @click="confirmCommand"></u-button>
  54 + <u-button color="#3388ff" shape="circle" :text="$t('common.confirm')" @click="confirmCommand"></u-button>
55 55 </view>
56 56 </view>
57 57 </view>
58 58 <u-picker :show="isShowService" :columns="[
59   - seriesList.map((item) => ({
  59 + (seriesList || []).map((item) => ({
60 60 label: item.functionName,
61 61 value: item.identifier,
62 62 callType: item.callType,
... ... @@ -100,7 +100,7 @@
100 100 },
101 101 },
102 102 commandTypeList: [{
103   - label: "自定义",
  103 + label:this.$t('common.customText'),
104 104 value: 0
105 105 }],
106 106 seriesList: [], //服务下拉框的数据
... ... @@ -150,16 +150,18 @@
150 150 }
151 151 },
152 152 handleCopy(value) {
153   - useShowModal(JSON.stringify(value), "命令下发", "复制内容").then(
  153 + useShowModal(JSON.stringify(value), this.$t('device.commandIssuance'), this.$t('common.copyContent')).then(
154 154 (res) => {
155   - uni.setClipboardData({
  155 + if(res?.confirm){
  156 + uni.setClipboardData({
156 157 data: JSON.stringify(value),
157 158 success: () => {
158 159 uni.showToast({
159   - title: "复制成功",
  160 + title: this.$t('common.copyOk'),
160 161 });
161 162 },
162 163 });
  164 + }
163 165 }
164 166 );
165 167 },
... ... @@ -187,7 +189,7 @@
187 189 this.commandTypeList;
188 190 } else {
189 191 this.commandTypeList.push({
190   - label: "服务",
  192 + label: this.$t('device.service'),
191 193 value: 1
192 194 });
193 195 this.seriesList = await api.deviceApi.getModelServices(
... ... @@ -283,4 +285,4 @@
283 285 }
284 286 }
285 287 }
286   -</style>
\ No newline at end of file
  288 +</style>
... ...
... ... @@ -2,7 +2,7 @@
2 2 <view class="command-record">
3 3 <!-- 命令记录筛选-->
4 4 <view class="filter-button" @click="openSearchDialog">
5   - <text>筛选</text>
  5 + <text>{{ $t('common.screen') }}</text>
6 6 <image src="/static/shaixuan.png" />
7 7 </view>
8 8 <!-- 命令记录分页 -->
... ... @@ -14,24 +14,24 @@
14 14 <text>{{ item.deviceName }}</text>
15 15 <!-- 业务 单向是没有响应状态 -->
16 16 <view v-if="!item.request.oneway">
17   - <view class="item-right item-success" v-if="item.response">响应成功</view>
18   - <view class="item-right item-fail" v-else>响应失败</view>
  17 + <view class="item-right item-success" v-if="item.response">{{ $t('device.responseSuccess') }}</view>
  18 + <view class="item-right item-fail" v-else>{{ $t('device.ResponseFailed') }}</view>
19 19 </view>
20 20 </view>
21 21 <view>
22   - 命令类型:
23   - <text class="ml-16">{{ item.additionalInfo.cmdType===1?'服务':'自定义' }}</text>
  22 + {{$t('device.commandType')}}:
  23 + <text class="ml-16">{{ item.additionalInfo.cmdType===1?$t('device.service'):$t('common.customText') }}</text>
24 24 </view>
25 25 <view v-if="item.statusName">
26   - 命令状态:
  26 + {{ $t('device.commandStatus') }}:
27 27 <text :style="{color:formatCommandStatus(item.status)}" class="ml-16">
28 28 {{ item.statusName }}
29 29 </text>
30 30 </view>
31 31 <view class="item-first">
32 32 <view>
33   - 响应类型:
34   - <text class="ml-16">{{ !item.request.oneway?'双向':'单向' }}</text>
  33 + {{ $t('device.responseType') }}:
  34 + <text class="ml-16">{{ !item.request.oneway?$t('device.twoWay'):$t('device.oneWay') }}</text>
35 35 </view>
36 36 <view class="time">{{ format(item.createTime) }}</view>
37 37 </view>
... ... @@ -41,24 +41,24 @@
41 41 <!-- 命令记录弹窗筛选 -->
42 42 <u-popup @close="close" closeable bgColor="#fff" :show="show" mode="bottom" :round="20">
43 43 <view class="filter" @touchmove.stop.prevent="disabledScroll">
44   - <view class="filter-title"><text>筛选条件</text></view>
45   - <query-item :filterList="issueStatus" title="下发状态"
  44 + <view class="filter-title"><text>{{ $t('common.filterCriteria') }}</text></view>
  45 + <query-item :filterList="issueStatus" :title="$t('device.issuanceStatus')"
46 46 @clickTag="currentIndex => handleClickTag(currentIndex, issueStatus)"></query-item>
47 47 <view class="flex-column">
48   - <view class="mt-3 command-time-text">命令下发时间</view>
  48 + <view class="mt-3 command-time-text">{{ $t('device.commandTime') }}</view>
49 49 <view class="mt-3">
50 50 <uni-datetime-picker return-type="timestamp" v-model="range" type="datetimerange"
51   - rangeSeparator="至" />
  51 + :rangeSeparator="$t('common.toText')" />
52 52 </view>
53 53 </view>
54 54 <view class="h-30"></view>
55 55 <view class="button-group">
56 56 <view>
57   - <u-button :customStyle="{ color: '#333' }" color="#e3e3e5" shape="circle" text="重置"
  57 + <u-button :customStyle="{ color: '#333' }" color="#e3e3e5" shape="circle" :text="$t('common.resetting')"
58 58 @click="resetFilter"></u-button>
59 59 </view>
60 60 <view>
61   - <u-button color="#3388ff" shape="circle" text="确认" @click="confirmFilter"></u-button>
  61 + <u-button color="#3388ff" shape="circle" :text="$t('common.confirm')" @click="confirmFilter"></u-button>
62 62 </view>
63 63 </view>
64 64 </view>
... ... @@ -232,4 +232,4 @@
232 232
233 233 <style lang="scss" scoped>
234 234 @import "../static/command-record.scss";
235   -</style>
\ No newline at end of file
  235 +</style>
... ...
... ... @@ -5,7 +5,7 @@
5 5 <view class="historyData-top">
6 6 <u-form :label-style="{ 'font-size': '0rpx' }">
7 7 <u-form-item @click="openCalendar">
8   - <u-input v-model="timeData.selectTime" disabled disabledColor="#fff" placeholder="请选择日期"
  8 + <u-input v-model="timeData.selectTime" disabled disabledColor="#fff" :placeholder="$t('device.pleaseSelectDate')"
9 9 border="none" suffixIcon="arrow-down">
10 10 <template slot="prefix">
11 11 <image class="icon" src="../../../static/can-der.png"></image>
... ... @@ -13,7 +13,7 @@
13 13 </u-input>
14 14 </u-form-item>
15 15 <u-form-item @click="openTimeGap">
16   - <u-input v-model="timeData.getTimeGap" disabled disabledColor="#fff" placeholder="请选择时间区间"
  16 + <u-input v-model="timeData.getTimeGap" disabled disabledColor="#fff" :placeholder="$t('device.pleaseSelectTimeInterval')"
17 17 border="none" suffixIcon="arrow-down">
18 18 <template slot="prefix">
19 19 <image class="icon" src="../../../static/time.png"></image>
... ... @@ -21,18 +21,18 @@
21 21 </u-input>
22 22 </u-form-item>
23 23 <u-form-item @click="openAvg">
24   - <u-input shape="circle" v-model="aggText" placeholder="请选择数据聚合功能" disabled disabledColor="#377DFF0D"
  24 + <u-input shape="circle" v-model="aggText" :placeholder="$t('device.pleaseSelectDataAgg')" disabled disabledColor="#377DFF0D"
25 25 suffixIcon="arrow-down" />
26 26 </u-form-item>
27 27 <u-form-item @click="openTimeGap" v-if="limitFlag">
28 28 <view class="u-flex">
29   - <text>最大条数</text>
  29 + <text>{{ $t('device.maximumNumber') }}</text>
30 30 <u-number-box style="margin-left:30rpx" class="ml-10" v-model="timeData.limit" :min="7"
31 31 :max="50000"></u-number-box>
32 32 </view>
33 33 </u-form-item>
34 34 <u-form-item @click="openType">
35   - <u-input shape="circle" v-model="timeData.getType" placeholder="请选择属性" disabled
  35 + <u-input shape="circle" v-model="timeData.getType" :placeholder="$t('device.pleaseSelectAttribute')" disabled
36 36 disabledColor="#377DFF0D" suffixIcon="arrow-down" />
37 37 </u-form-item>
38 38 </u-form>
... ... @@ -47,8 +47,8 @@
47 47 <view class="historyData-bottom" v-show="historyData.length">
48 48 <view class="table">
49 49 <view class="tr bg-w" v-if="historyData.length">
50   - <view class="th">变量值</view>
51   - <view class="th">更新时间</view>
  50 + <view class="th">{{ $t('device.variableValue') }}</view>
  51 + <view class="th">{{ $t('device.updateTime') }}</view>
52 52 </view>
53 53 <view class="tr bg-g" :class="{ odd: index % 2 === 0 }" v-for="(item, index) in historyData"
54 54 :key="index">
... ... @@ -57,14 +57,15 @@
57 57 </view>
58 58 </view>
59 59 </view>
60   - <u-calendar :show="showCalendar" :defaultDate="defaultDate" closeOnClickOverlay mode="range" startText="开始时间"
61   - endText="结束时间" confirmDisabledText="请选择日期" :minDate="minDate" :maxDate="maxDate" @confirm="calendarConfirm"
  60 + <!-- :cancelText="$t('common.cancelText')" :confirmText="$('common.confirm')" -->
  61 + <u-calendar :show="showCalendar" :title="$t('components.calender.title')" :confirmText="$t('components.calender.confirmText')" :defaultDate="defaultDate" closeOnClickOverlay mode="range" :startText="$t('device.startTime')"
  62 + :endText="$t('device.entTime')" :confirmDisabledText="$t('device.pleaseSelectDate')" :minDate="minDate" :maxDate="maxDate" @confirm="calendarConfirm"
62 63 @close="calendarClose"></u-calendar>
63   - <u-picker :show="showTimeGap" :columns="columns" keyName="label" closeOnClickOverlay @confirm="confirmTimeGap"
  64 + <u-picker :cancelText="$t('common.cancelText')" :confirmText="$t('common.confirm')" :show="showTimeGap" :columns="columns" keyName="label" closeOnClickOverlay @confirm="confirmTimeGap"
64 65 @cancel="cancelTimeGap" @close="cancelTimeGap" :defaultIndex="[3]"></u-picker>
65   - <u-picker :show="showSelectType" :columns="[keys.map(item=>({label:item.name,value:item.identifier}))]" keyName="label" closeOnClickOverlay @confirm="confirmTypeGap"
  66 + <u-picker :cancelText="$t('common.cancelText')" :confirmText="$t('common.confirm')" :show="showSelectType" :columns="[keys.map(item=>({label:item.name,value:item.identifier}))]" keyName="label" closeOnClickOverlay @confirm="confirmTypeGap"
66 67 @cancel="cancelTypeGap" @close="cancelTypeGap"></u-picker>
67   - <u-picker :show="showSelectAvg" :columns="avgColumns" keyName="label" closeOnClickOverlay
  68 + <u-picker :cancelText="$t('common.cancelText')" :confirmText="$t('common.confirm')" :show="showSelectAvg" :columns="avgColumns" keyName="label" closeOnClickOverlay
68 69 @confirm="confirmAvgGap" @cancel="showSelectAvg=false" @close="showSelectAvg=false"></u-picker>
69 70 </view>
70 71 </template>
... ... @@ -127,26 +128,26 @@
127 128 limitFlag: true,
128 129 avgColumns: [
129 130 [{
130   - label: '最小值',
  131 + label: this.$t('common.minText'),
131 132 value: 'MIN'
132 133 }, {
133   - label: '最大值',
  134 + label: this.$t('common.maxText'),
134 135 value: 'MAX'
135 136 },
136 137 {
137   - label: '平均值',
  138 + label: this.$t('common.averageText'),
138 139 value: 'AVG'
139 140 },
140 141 {
141   - label: '求和',
  142 + label: this.$t('common.summationText'),
142 143 value: 'SUM'
143 144 },
144 145 {
145   - label: '计数',
  146 + label: this.$t('common.countText'),
146 147 value: 'COUNT'
147 148 },
148 149 {
149   - label: '空',
  150 + label: this.$t('common.emptyText'),
150 151 value: 'NONE'
151 152 },
152 153 ]
... ... @@ -169,41 +170,41 @@
169 170 },
170 171 columns: [
171 172 [{
172   - label: '5分钟',
  173 + label: '5' + this.$t('common.minuteText'),
173 174 value: 300000
174 175 },
175 176
176 177
177 178 {
178   - label: '10分钟',
  179 + label: '10' + this.$t('common.minuteText'),
179 180 value: 600000
180 181 },
181 182 {
182   - label: '15分钟',
  183 + label: '15' + this.$t('common.minuteText'),
183 184 value: 900000
184 185 },
185 186 {
186   - label: '30分钟',
  187 + label: '30' + this.$t('common.minuteText'),
187 188 value: 1800000
188 189 },
189 190 {
190   - label: '1小时',
  191 + label: '1' + this.$t('common.hourText'),
191 192 value: 3600000
192 193 },
193 194 {
194   - label: '2小时',
  195 + label: '2' + this.$t('common.hourText'),
195 196 value: 7200000
196 197 }
197 198 ]
198 199 ],
199 200 timeData: {
200   - selectTime: this.yesterday + ' 至 ' + this.today,
  201 + selectTime: this.yesterday + this.$t('common.toText') + this.today,
201 202 getTimeGap: this.timeDiff,
202 203 getType: this.keys[0].name,
203 204 limit: 7,
204 205 agg: 'NONE'
205 206 },
206   - aggText: '空'
  207 + aggText: this.$t('common.emptyText')
207 208 };
208 209 },
209 210 watch: {
... ... @@ -227,27 +228,27 @@
227 228 // 小于7天
228 229 return [
229 230 [{
230   - label: '5分钟',
  231 + label: '5' + this.$t('common.minuteText'),
231 232 value: 300000
232 233 },
233 234 {
234   - label: '10分钟',
  235 + label: '10' + this.$t('common.minuteText'),
235 236 value: 600000
236 237 },
237 238 {
238   - label: '15分钟',
  239 + label: '15' + this.$t('common.minuteText'),
239 240 value: 900000
240 241 },
241 242 {
242   - label: '30分钟',
  243 + label: '30' + this.$t('common.minuteText'),
243 244 value: 1800000
244 245 },
245 246 {
246   - label: '1小时',
  247 + label: '1' + this.$t('common.hourText'),
247 248 value: 3600000
248 249 },
249 250 {
250   - label: '2小时',
  251 + label: '2' + this.$t('common.hourText'),
251 252 value: 7200000
252 253 }
253 254 ]
... ... @@ -256,31 +257,31 @@
256 257 // 小于30天
257 258 return [
258 259 [{
259   - label: '30分钟',
  260 + label: '30' + this.$t('common.minuteText'),
260 261 value: 1800000
261 262 },
262 263 {
263   - label: '1小时',
  264 + label: '1' + this.$t('common.hourText'),
264 265 value: 3600000
265 266 },
266 267 {
267   - label: '2小时',
  268 + label: '2' + this.$t('common.hourText'),
268 269 value: 7200000
269 270 },
270 271 {
271   - label: '5小时',
  272 + label: '5' + this.$t('common.hourText'),
272 273 value: 18000000
273 274 },
274 275 {
275   - label: '10小时',
  276 + label: '10' + this.$t('common.hourText'),
276 277 value: 36000000
277 278 },
278 279 {
279   - label: '12小时',
  280 + label: '12' + this.$t('common.hourText'),
280 281 value: 43200000
281 282 },
282 283 {
283   - label: '1天',
  284 + label: '1' + this.$t('common.dayText'),
284 285 value: 86400000
285 286 }
286 287 ]
... ... @@ -289,23 +290,23 @@
289 290 // 大于30天
290 291 return [
291 292 [{
292   - label: '2小时',
  293 + label: '2' + this.$t('common.hourText'),
293 294 value: 7200000
294 295 },
295 296 {
296   - label: '5小时',
  297 + label: '5' + this.$t('common.hourText'),
297 298 value: 18000000
298 299 },
299 300 {
300   - label: '10小时',
  301 + label: '10' + this.$t('common.hourText'),
301 302 value: 36000000
302 303 },
303 304 {
304   - label: '12小时',
  305 + label: '12' + this.$t('common.hourText'),
305 306 value: 43200000
306 307 },
307 308 {
308   - label: '1天',
  309 + label: '1' + this.$t('common.dayText'),
309 310 value: 86400000
310 311 }
311 312 ]
... ...
... ... @@ -10,7 +10,7 @@
10 10 shape="circle"
11 11 type="number"
12 12 v-model.number="seriesForm[item.identifier]"
13   - :placeholder="`请输入${item.functionName}`"
  13 + :placeholder="`${$t('common.inputText')}${item.functionName}`"
14 14 @blur="(e)=>handleBlur(e,item.identifier)"
15 15 />
16 16 <u-input v-if="item.dataType.type == 'TEXT'" shape="circle" type="text" v-model="seriesForm[item.identifier]" :placeholder="`请输入${item.functionName}`" />
... ... @@ -18,7 +18,7 @@
18 18 <u-input
19 19 shape="circle"
20 20 v-model="seriesForm[item.identifier]"
21   - :placeholder="`请选择${item.functionName}`"
  21 + :placeholder="`${$t('common.chooseText')}${item.functionName}`"
22 22 disabled
23 23 disabledColor="#fff"
24 24 suffixIcon="arrow-down"
... ... @@ -36,7 +36,7 @@
36 36 <u-input
37 37 shape="circle"
38 38 v-model="seriesForm[item.identifier]"
39   - :placeholder="`请选择${item.functionName}`"
  39 + :placeholder="`${$t('common.chooseText')}${item.functionName}`"
40 40 disabled
41 41 disabledColor="#fff"
42 42 suffixIcon="arrow-down"
... ... @@ -55,7 +55,7 @@
55 55 </template>
56 56 </view>
57 57 <view v-else class="positionLeft" style=" border: 1px dashed #f0f0f0; padding: 20rpx;">
58   - <view class="text">服务命令</view>
  58 + <view class="text">{{ $t('device.serviceCommand') }}</view>
59 59 <u-input v-model="seriesForm.serviceCommand" type="text" shape="circle" :disabled="true"></u-input>
60 60 </view>
61 61 </u-form-item>
... ... @@ -139,15 +139,15 @@ export default {
139 139 const { max = 2147483647, min = -2147483647 } = valueRange || {}
140 140 if (type !== 'STRUCT') {
141 141 this.seriesRules[identifier] = [
142   - { required: true, message: type == 'BOOL' || type == 'ENUM' ? '请选择' : '请输入' + functionName },
  142 + { required: true, message: type == 'BOOL' || type == 'ENUM' ? this.$t('common.chooseText') : this.$t('common.inputText') + functionName },
143 143 type == 'INT' || type == 'DOUBLE'
144 144 ? {
145 145 type: 'number',
146 146 trigger: 'change',
147 147 validator: (_rule, value) => {
148 148 const reg = /^[0-9]*$/
149   - if (!reg.test(value)) return Promise.reject(new Error(`${functionName}不是一个有效的数字`))
150   - if (value < min || value > max) return Promise.reject(new Error(`${functionName}取值范围在${min}~${max}之间`))
  149 + if (!reg.test(value)) return Promise.reject(new Error(`${functionName}${this.$t('device.notANumber')}`))
  150 + if (value < min || value > max) return Promise.reject(new Error(`${functionName}${this.$t('device.rangeValues',{min,max})}`))
151 151
152 152 return Promise.resolve(value)
153 153 },
... ... @@ -157,7 +157,7 @@ export default {
157 157 type: 'string',
158 158 trigger: 'change',
159 159 validator: (_rule, value) => {
160   - if ((value?.length || 0) > length) return Promise.reject(new Error(`${functionName}数据长度应该小于${length}`))
  160 + if ((value?.length || 0) > length) return Promise.reject(new Error(`${functionName}${this.$t('device.dataLengthLess')}${length}`))
161 161
162 162 return Promise.resolve(value)
163 163 },
... ... @@ -186,7 +186,7 @@ export default {
186 186 const { specs } = dataType || {}
187 187 const { boolClose, boolOpen } = specs || {}
188 188 if(!boolClose&&!boolOpen){
189   - uni.$u.toast(`暂无可选的${name}`)
  189 + uni.$u.toast(this.$t('device.noCurrently') + name)
190 190 this.boolList = []
191 191 return
192 192 }
... ... @@ -217,7 +217,7 @@ export default {
217 217 this.enumList = specsList || []
218 218 console.log(this.enumList,'enumInfo')
219 219 if(!this.enumList.length){
220   - return uni.$u.toast(`暂无可选的${name}`)
  220 + return uni.$u.toast(this.$t('device.noCurrently') + name)
221 221 }
222 222 this.seriesFunctionList.forEach((item, index) => {
223 223 if (index == num) {
... ...
1 1 const list = [
2 2 {
3   - name: '基础信息',
  3 + name: 'device.basicInfo',
4 4 },
5 5 {
6   - name: '实时数据',
  6 + name: 'device.realTime',
7 7 },
8 8 {
9   - name: '历史数据',
  9 + name: 'device.historyTime',
10 10 },
11 11 {
12   - name: '告警记录',
  12 + name: 'device.alarmLog',
13 13 },
14 14 ]
15 15
16 16 const issueStatus = [
17 17 {
18 18 checked: true,
19   - name: '全部',
  19 + name: 'common.allText',
20 20 type: '',
21 21 },
22 22 {
23 23 checked: false,
24   - name: '队列中',
  24 + name: 'device.inQueue',
25 25 type: 'QUEUED',
26 26 },
27 27 {
28 28 checked: false,
29   - name: '已发送',
  29 + name: 'device.hasBeenSent',
30 30 type: 'SENT',
31 31 },
32 32 {
33 33 checked: false,
34   - name: '发送成功',
  34 + name: 'device.successSent',
35 35 type: 'DELIVERED',
36 36 },
37 37 {
38 38 checked: false,
39   - name: '响应成功',
  39 + name: 'device.responseSuccess',
40 40 type: 'SUCCESSFUL',
41 41 },
42 42 {
43 43 checked: false,
44   - name: '超时',
  44 + name: 'device.timeout',
45 45 type: 'TIMEOUT',
46 46 },
47 47 {
48 48 checked: false,
49   - name: '已过期',
  49 + name: 'device.expired',
50 50 type: 'EXPIRED',
51 51 },
52 52 {
53 53 checked: false,
54   - name: '响应失败',
  54 + name: 'device.ResponseFailed',
55 55 type: 'FAILED',
56 56 },
57 57 {
58 58 checked: false,
59   - name: '已删除',
  59 + name: 'device.deletedText',
60 60 type: 'DELETED',
61 61 },
62 62 ]
... ... @@ -64,11 +64,11 @@ const issueStatus = [
64 64 const commandTypeList = [
65 65 {
66 66 value: 'OneWay',
67   - name: '单向',
  67 + name: 'device.onwWay',
68 68 },
69 69 {
70 70 value: 'TwoWay',
71   - name: '双向',
  71 + name: 'device.twoWay',
72 72 },
73 73 ]
74 74
... ...
... ... @@ -3,13 +3,13 @@
3 3 <!-- 公共组件-每个页面必须引入 -->
4 4 <public-module></public-module>
5 5 <u-sticky :bgColor="bgColor">
6   - <u-tabs :list="list" :current="currentTab" :lineWidth="transportType == deviceTypeNum.GBT?0:30" @click=" handleTabClick " :activeStyle="{activeColor}"
  6 + <u-tabs :list="list.map(item=>({...item,name:$t(item.name)}))" :current="currentTab" :lineWidth="transportType == deviceTypeNum.GBT?0:30" @click=" handleTabClick " :activeStyle="{activeColor}"
7 7 :inactiveStyle="inActiveColor" :scrollable="isScrollable" itemStyle="padding: 0 11px;display:flex;flex-direction:row;align-items:center;justify-content:start;height:44px" />
8 8 </u-sticky>
9 9 <view class="mt-3">
10   - <basic-info v-show=" currentTab == 0 " :deviceDetail=" deviceDetail " />
  10 + <basic-info v-show="currentTab == 0" :deviceDetail=" deviceDetail " />
11 11 <realtime-data v-show=" currentTab === 1 " :recordList=" recordList " />
12   - <history-data v-if=" currentTab === 2 " :keys=" keys " :yesterday=" yesterday " :today=" today " :timeDiff=" timeDiff "
  12 + <history-data v-if=" currentTab === 2 " :keys=" keys " :yesterday=" yesterday " :today=" today " :timeDiff="timeDiff"
13 13 :historyData=" historyData " :entityId=" entityId " :start=" startTs " :end=" endTs " @update=" handleUpdate " />
14 14 <alarm-history v-show=" currentTab === 3 " :deviceId=" deviceId " />
15 15 <commond-record v-if=" currentTab === 4 " :tbDeviceId=" entityId " />
... ... @@ -77,6 +77,13 @@ export default {
77 77 // 页面关闭时,销毁webSocket连接,否则第二次会存在连接不到的情况
78 78 uni.closeSocket();
79 79 },
  80 + onShow(){
  81 + this.$nextTick(()=>{
  82 + uni.setNavigationBarTitle({
  83 + title:this.$t('menu.deviceDetail')
  84 + })
  85 + })
  86 + },
80 87 async onLoad(options) {
81 88 const { id, alarmStatus, lastOnlineTime, tbDeviceId, deviceProfileId, transportType } = options;
82 89 this.deviceId = id;
... ... @@ -92,17 +99,17 @@ export default {
92 99 // 设备类型不是网关子设备的添加一个命令记录的选项卡
93 100 if (this.deviceDetail.deviceType !== "SENSOR") {
94 101 this.list.push({
95   - name: "命令记录",
  102 + name: 'device.commandRecord',
96 103 });
97 104 const res = new Map()
98 105 this.list = this.list.filter((item) => !res.has(item.name) && res.set(item.name, 1))
99 106 } else {
100   - this.list = this.list.filter(item => item.name !== '命令记录')
  107 + this.list = this.list.filter(item => item.name !== 'device.commandRecord')
101 108 }
102 109 if (transportType === deviceTypeNum.GBT) {
103   - this.list = this.list.filter(item => item.name == '基础信息')
  110 + this.list = this.list.filter(item => item.name == 'device.basicInfo')
104 111 }
105   - this.isScrollable = this.list.length > 4;
  112 + this.isScrollable =this.$i18n.locale!=='en'?this.list.length > 4:true;
106 113 if (res.deviceProfileId) {
107 114 this.getAttrList = await api.deviceApi.getAttribute(res.deviceProfileId)
108 115 if (Array.isArray(this.getAttrList)) {
... ... @@ -199,7 +206,7 @@ export default {
199 206 limit: 7,
200 207 agg: 'NONE'
201 208 });
202   - this.timeDiff = "30分钟";
  209 + this.timeDiff = 30 + this.$t('common.minuteText');
203 210 if (!Object.keys(data).length) return;
204 211 this.historyData = data[keys[0]].map((item) => {
205 212 return {
... ...
... ... @@ -38,6 +38,13 @@ export default {
38 38 ]
39 39 };
40 40 },
  41 + onShow(){
  42 + this.$nextTick(()=>{
  43 + uni.setNavigationBarTitle({
  44 + title:this.$t('menu.deviceLocation')
  45 + })
  46 + })
  47 + },
41 48 onLoad(e) {
42 49 let params = null;
43 50 if (e.data !== null) {
... ...
... ... @@ -65,7 +65,7 @@
65 65
66 66 .item-fail {
67 67 color: #848383;
68   - background-color: #84838325;
  68 + // background-color: #84838325;
69 69 }
70 70
71 71 .item.success {
... ... @@ -101,4 +101,4 @@
101 101 font-size: 14px;
102 102 font-weight: 700;
103 103 }
104   - }
\ No newline at end of file
  104 + }
... ...
1   -const rules = {
2   - 'feedbackInfo.title': {
3   - type: 'string',
4   - required: true,
5   - message: '请输入主题',
6   - trigger: ['blur', 'change']
7   - },
8   - 'feedbackInfo.name': {
9   - type: 'string',
10   - required: true,
11   - message: '请输入姓名',
12   - trigger: ['blur', 'change']
13   - },
14   - 'feedbackInfo.message': {
15   - type: 'string',
16   - required: true,
17   - message: '请输入意见反馈',
18   - trigger: ['blur', 'change']
19   - }
20   -}
21   -export {
22   - rules
23   -}
\ No newline at end of file
... ... @@ -4,33 +4,33 @@
4 4 <!-- 公共组件-每个页面必须引入 -->
5 5 <public-module></public-module>
6 6 <view class="form-page">
7   - <u--form labelPosition="left" :model="feedbackData" :rules="rules" ref="myfeedBackFormRef">
8   - <u-form-item required label="主题" prop="feedbackInfo.title" borderBottom>
9   - <u--input placeholder="请输入主题" v-model="feedbackData.feedbackInfo.title" border="none">
  7 + <u--form :labelStyle="{minWidth:'120rpx'}" :labelWidth="60" labelPosition="left" :model="feedbackData" :rules="rules" ref="myfeedBackFormRef">
  8 + <u-form-item required :label="$t('userCenter.theme')" prop="feedbackInfo.title" borderBottom>
  9 + <u--input :placeholder="$t('userCenter.pleaseEnterTheme')" v-model="feedbackData.feedbackInfo.title" border="none">
10 10 </u--input>
11 11 </u-form-item>
12   - <u-form-item required label="姓名" prop="feedbackInfo.name" borderBottom>
13   - <u--input placeholder="请输入姓名" v-model="feedbackData.feedbackInfo.name" border="none"></u--input>
  12 + <u-form-item required :label="$t('userCenter.fullName')" prop="feedbackInfo.name" borderBottom>
  13 + <u--input :placeholder="$t('userCenter.pleaseEnterName')" v-model="feedbackData.feedbackInfo.name" border="none"></u--input>
14 14 </u-form-item>
15   - <u-form-item required label="反馈" prop="feedbackInfo.message" borderBottom>
16   - <u--textarea placeholder="请输入反馈信息" v-model="feedbackData.feedbackInfo.message" count>
  15 + <u-form-item required :label="$t('userCenter.feedText')" prop="feedbackInfo.message" borderBottom>
  16 + <u--textarea :placeholder="$t('userCenter.pleaseFeed')" v-model="feedbackData.feedbackInfo.message" count>
17 17 </u--textarea>
18 18 </u-form-item>
19   - <view class="feed-back-text upload-text">上传图片(最多6张)</view>
  19 + <view class="feed-back-text upload-text">{{ $t('userCenter.uploadImage6') }}</view>
20 20 <view class="info">
21 21 <view class="info-contain">
22   - <u-form-item label="图片" prop="feedbackInfo.images" borderBottom>
  22 + <u-form-item :label="$t('userCenter.image')" prop="feedbackInfo.images" borderBottom>
23 23 <u-upload :capture="capture" :fileList="fileList1" @afterRead="afterRead"
24 24 @delete="deletePic" name="1" multiple :maxCount="6"></u-upload>
25 25 </u-form-item>
26 26 </view>
27 27 <view class="info-button">
28 28 <!-- #ifdef MP -->
29   - <u-button class="buttonSty button-sty" shape="circle" type="primary" text="提交"
  29 + <u-button class="buttonSty button-sty" shape="circle" type="primary" :text="$t('userCenter.submit')"
30 30 customStyle="margin-top: 280rpx" @click="submit"></u-button>
31 31 <!-- #endif -->
32 32 <!-- #ifdef APP-PLUS -->
33   - <u-button class="buttonSty button-sty" shape="circle" type="primary" text="提交"
  33 + <u-button class="buttonSty button-sty" shape="circle" type="primary" :text="$t('userCenter.submit')"
34 34 customStyle="margin-top: 880rpx" @click="submit"></u-button>
35 35 <!-- #endif -->
36 36 </view>
... ... @@ -46,7 +46,6 @@
46 46 </view>
47 47 <view style="height: 20rpx;"></view>
48 48 </view>
49   - </view>
50 49 </template>
51 50
52 51 <script>
... ... @@ -55,7 +54,6 @@
55 54 mapState
56 55 } from 'vuex';
57 56 import api from '@/api/index.js'
58   - import { rules } from './config/data.js'
59 57 import { UPLOAD_FILE_SIZE } from '@/constant/index.js'
60 58
61 59 export default {
... ... @@ -71,9 +69,16 @@
71 69 }
72 70 },
73 71 fileList1: [],
74   - rules
  72 + rules:{}
75 73 };
76 74 },
  75 + onShow(){
  76 + this.$nextTick(()=>{
  77 + uni.setNavigationBarTitle({
  78 + title:this.$t('menu.feedback')
  79 + })
  80 + })
  81 + },
77 82 onReady() {
78 83 // 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则
79 84 this.$refs.myfeedBackFormRef.setRules(this.rules);
... ... @@ -81,6 +86,26 @@
81 86 onLoad() {
82 87 // 隐藏原生的tabbar
83 88 uni.hideTabBar();
  89 + this.rules ={
  90 + 'feedbackInfo.title': {
  91 + type: 'string',
  92 + required: true,
  93 + message: this.$t('userCenter.pleaseEnterTheme'),
  94 + trigger: ['blur', 'change']
  95 + },
  96 + 'feedbackInfo.name': {
  97 + type: 'string',
  98 + required: true,
  99 + message: this.$t('userCenter.pleaseEnterName'),
  100 + trigger: ['blur', 'change']
  101 + },
  102 + 'feedbackInfo.message': {
  103 + type: 'string',
  104 + required: true,
  105 + message: this.$t('userCenter.pleaseFeed'),
  106 + trigger: ['blur', 'change']
  107 + }
  108 + }
84 109 },
85 110 computed: {
86 111 ...mapState(['userInfo'])
... ... @@ -99,20 +124,20 @@
99 124 this[`fileList${event.name}`].push({
100 125 ...item,
101 126 status: 'error',
102   - message: '上传失败'
  127 + message: this.$t('userCenter.uploadFailed')
103 128 });
104 129 } else {
105 130 this[`fileList${event.name}`].push({
106 131 ...item,
107 132 status: 'uploading',
108   - message: '上传中'
  133 + message: this.$t('userCenter.uploading')
109 134 });
110 135 }
111 136 });
112 137 for (let i = 0; i < lists.length; i++) {
113 138 const judgeImageSize = lists[0].size
114 139 if (judgeImageSize > UPLOAD_FILE_SIZE) {
115   - return uni.$u.toast('图片限定5M')
  140 + return uni.$u.toast(this.$t('userCenter.image5m'))
116 141 } else {
117 142 const result = await this.uploadFilePromise(lists[i].url);
118 143 let item = this[`fileList${event.name}`][fileListLen];
... ... @@ -135,7 +160,7 @@
135 160 // #ifdef H5
136 161 token = window.sessionStorage.getItem('userInfo').isToken;
137 162 // #endif
138   - if (!token) return uni.$u.toast('请登录后上传图片');
  163 + if (!token) return uni.$u.toast(this.$t('userCenter.pleaseLogUpload'));
139 164 return new Promise((resolve, reject) => {
140 165 uni.uploadFile({
141 166 url: `${baseUrl.baseUrl}/yt/oss/upload`,
... ... @@ -158,7 +183,7 @@
158 183 resolve(res.data?.fileStaticUri);
159 184 }
160 185 } else {
161   - return uni.$u.toast('图片上传失败')
  186 + return uni.$u.toast(this.$t('userCenter.imageUploadFail'))
162 187 }
163 188 }, 1000);
164 189 }
... ... @@ -179,14 +204,14 @@
179 204 message: this.feedbackData.feedbackInfo.message
180 205 };
181 206 const res = await api.feedbackApi.postFeedBackApi(data)
182   - uni.$u.toast('意见反馈提交成功~');
  207 + uni.$u.toast(this.$t('userCenter.feedbacksubmitSuccess'));
183 208 setTimeout(() => {
184 209 uni.navigateBack();
185 210 }, 500);
186 211 }
187 212 })
188 213 .catch(errors => {
189   - uni.$u.toast('请填写或者请填写正确格式的数据');
  214 + uni.$u.toast(this.$t('userCenter.pleaseEnterformatCorrect'));
190 215 });
191 216 }
192 217 }
... ... @@ -202,4 +227,4 @@
202 227 }
203 228
204 229 //#endif
205   -</style>
\ No newline at end of file
  230 +</style>
... ...
  1 +{
  2 + "homePage": "Home page",
  3 + "device": "Device",
  4 + "alarm": "Alarm",
  5 + "userCenter": "Personal Center",
  6 + "viewCamera": "View camera",
  7 + "viewConfiguration": "View configuration",
  8 + "configurationDetail": "Configuration details",
  9 + "organizationScreening": "Organizational screening",
  10 + "viewBoard": "View bulletin board",
  11 + "boardDetail": "Bulletin board detail",
  12 + "languageSetting": "Language settings",
  13 + "alarmDetail": "Alarm details",
  14 + "deviceDetail": "Device detail",
  15 + "commandDetail": "Command detail",
  16 + "deviceLocation": "Geographical location of equipment",
  17 + "systemNot": "System notification",
  18 + "notDetails": "Notification Details",
  19 + "feedback": "Feedback",
  20 + "login": "Login",
  21 + "personalData": "Personal data",
  22 + "phoneLogin": "Mobile verification code login",
  23 + "forgotPassword": "Forgot password",
  24 + "my": "mine"
  25 +}
... ...
  1 +export default {
  2 + scenario: 'Alarm scenario:',
  3 + level: 'Alarm level:',
  4 + organization: 'Belonging organization:',
  5 + device: 'Alarm device:',
  6 + attribute: 'Trigger attribute:',
  7 + condition: 'Trigger condition:',
  8 + value: 'Trigger value:',
  9 + time: 'Alarm time:',
  10 + status: 'Alarm status:',
  11 + pleaseResult: 'Please enter the processing result',
  12 + processResult: 'Processing results',
  13 + handle: 'Handle',
  14 + cleanUp: 'Clean up',
  15 + alarmNum: 'Number of alarms',
  16 + pleaseEnterDevice: 'Please enter the alarm device',
  17 +
  18 +}
... ...
  1 +export default {
  2 + inputText: 'Please enter',
  3 + chooseText: 'Please select',
  4 + belongingOrganization: 'Organization',
  5 + filterCriteria: 'Filter Criteria',
  6 + confirm: 'Confirm',
  7 + resetting: 'Resetting',
  8 + allText: 'All',
  9 + onLine: 'Online',
  10 + offLine: 'Offline',
  11 + toBeActivated: 'To be toBeActivated',
  12 + alarm: 'Alarm',
  13 + normal: 'Normal',
  14 + directlyDevice: 'Directly connected devices',
  15 + gatewayDevice: 'Gateway device',
  16 + sensorDevice: 'Internet gateway sub device',
  17 + yesText: 'Yes',
  18 + noText: 'No',
  19 + screen: 'Screen',
  20 + copyContent: 'Copy content',
  21 + copyOk: 'Copy Ok',
  22 + organizationalRelateion: 'Organizational relationships',
  23 + pleaseEnterContent: 'Please enter search content',
  24 + issuedSuccess: 'Issued successfully',
  25 + cancelText: 'Cancel',
  26 + customText: 'Custom',
  27 + minText: 'Minimum',
  28 + maxText: 'Maximum',
  29 + averageText: 'Average value',
  30 + summationText: 'Sumation',
  31 + countText: 'Count',
  32 + emptyText: 'Empty',
  33 + minuteText: 'Minute',
  34 + hourText: 'Hour',
  35 + hour: 'Hour',
  36 + minute: 'Minute',
  37 + toText: 'To',
  38 + dayText: 'Day',
  39 + attributeText: 'Attribute',
  40 + noData: 'No Data',
  41 + organizationalRelation: 'Organizational relationships',
  42 + one: 'one',
  43 + two: 'two',
  44 + three: 'three',
  45 + four: 'four',
  46 + five: 'five',
  47 + six: 'six',
  48 + day: 'day',
  49 + year: 'Year',
  50 + month: 'Month',
  51 + processSuccess: 'Processing successful',
  52 + clearSuccess: 'Clear successfully',
  53 + pleaseBindAccount: 'Please bind your account',
  54 + loading: 'Loading...',
  55 + refreshSuccess: 'Dropdown refresh successful',
  56 + noText: '无'
  57 +
  58 +
  59 +}
... ...
  1 +export default {
  2 + calender: {
  3 + title: 'Date selection',
  4 + startText: 'Start',
  5 + endText: 'End',
  6 + confirmText: 'Determine',
  7 + confirmDisabledText: 'Determine'
  8 + }
  9 +}
... ...
  1 +export default {
  2 + pleaseEnterDeviceName: 'Please enter the device name or alias to search',
  3 + deviceNum: 'Device number',
  4 + pleaseBindAccount: 'Please bind your account',
  5 + deviceNumber: 'Device Number',
  6 + deviceStatus: 'Device status',
  7 + alarmStatus: 'Alarm status',
  8 + deviceType: 'Device type',
  9 + isDeviceCollect: 'Is the device collect',
  10 + basicInfo: 'Basic information',
  11 + realTime: 'Real time Data',
  12 + historyTime: 'History time Data',
  13 + alarmLog: 'Alarm log',
  14 + commandRecord: 'Command record',
  15 + inQueue: 'In Queue',
  16 + hasBeenSent: 'Has been sent',
  17 + successSent: 'Successfully sent',
  18 + responseSuccess: 'Response successful',
  19 + timeout: 'Timeout',
  20 + expired: 'Expired',
  21 + ResponseFailed: "Response failed",
  22 + deletedText: 'Deleted',
  23 + oneWay: 'One-way',
  24 + twoWay: 'Two-way',
  25 + lastConnectionTime: 'Last connection time',
  26 + isAlarm: 'Is there an alarm',
  27 + deviceRemark: 'Device Description',
  28 + commandIssuance: 'Command issuance',
  29 + issuanceType: 'Type of issuance',
  30 + pleaseEnterCommandContent: 'Please enter the content to be issued',
  31 + currentDeviceNotOnLine: 'The current device is not online',
  32 + pleaseCommandRule: "pleaseCommandRule",
  33 + issuedSuccess: 'Issued successfully',
  34 + oneTwoWay: 'One/Two way',
  35 + service: 'Service',
  36 + inputParameter: "input parameter",
  37 + stringFormat: 'String format',
  38 + jsonFormat: 'JSON format',
  39 + pleaseSelectService: 'Please select a service',
  40 + pleaseSelectDate: 'Please select a date',
  41 + pleaseSelectTimeInterval: 'Please select a time interval',
  42 + pleaseSelectDataAgg: 'Please select the data aggregation function',
  43 + pleaseSelectAttribute: 'Please select attributes',
  44 + variableValue: 'Variable value',
  45 + updateTime: 'Update time',
  46 + startTime: 'Start time',
  47 + entTime: 'End time',
  48 + maximumNumber: 'Maximum number of items',
  49 + triggerAttribute: 'Trigger attribute',
  50 + triggerCondition: 'Trigger condition',
  51 + triggerValue: 'Trigger value',
  52 + rangeValues: 'The value range is between {min} and {max}',
  53 + dataLengthLess: 'The data length should be less than',
  54 + noCurrently: 'There are currently no options available',
  55 + serviceCommand: 'Service command',
  56 + alarmStatus: 'Alarm status :',
  57 + activationNotConfirmed: "Activation not confirmed",
  58 + activationConfirmed: 'Activation confirmed',
  59 + clearUnconfirmed: 'Clear unconfirmed',
  60 + clearConfirmed: 'Clear Confirmed',
  61 + urgent: 'Urgent',
  62 + important: 'Important',
  63 + secondary: 'Secondary',
  64 + warning: 'Warning',
  65 + uncertain: 'Uncertain',
  66 + equal: 'be equal to',
  67 + notEqual: 'Not equal to',
  68 + less: 'less than',
  69 + lessOfEqual: 'Less than or equal to',
  70 + greater: 'greater than',
  71 + greaterOrEqual: 'Greater than or equal to',
  72 + starting: 'Starting from',
  73 + ending: 'Ending at',
  74 + contain: 'contain',
  75 + notIncluded: 'Not included',
  76 + minutes30: '30 Minutes',
  77 + hour1: '1 hour',
  78 + hours2: '2 hours',
  79 + pastDay: 'In the past day',
  80 + alarmFiltering: 'Alarm filtering',
  81 + selectDate: 'Select Date',
  82 + alarmLevel: 'Alarm level',
  83 + selectTime: 'Select time',
  84 + commandType: 'Command type',
  85 + commandStatus: 'Command status',
  86 + responseType: 'Response type',
  87 + issuanceStatus: 'Issuance status',
  88 + commandTime: 'Command issuance time',
  89 + responseResults: 'Response results',
  90 + commandContent: 'Command content'
  91 +}
... ...
  1 +export default {
  2 + basicstatistics: 'Basic statistics',
  3 + deviceStatistics: 'Device statistics',
  4 + deviceLabel: {
  5 + onLine: 'Online',
  6 + offLine: 'Offline',
  7 + beActivated: 'Inactive',
  8 + },
  9 + alarmStatistics: 'Alarm statistics',
  10 + alarmLabel: {
  11 + untreated: 'Untreated',
  12 + processed: 'Processed',
  13 + falseAlarm: 'False alarm',
  14 + },
  15 + cameraManagement: 'Camera management',
  16 + configuration: 'Configuration',
  17 + bulletinBoard: 'Bulletin board',
  18 + cameraNum: 'Number of cameras:',
  19 + configurationNum: 'Number of configurations:',
  20 + pleaseConfigurationname: 'Please enter the configuration name',
  21 + bulletionBoard: "Number of bulletin boards:",
  22 + pleaseVisualBoard: 'Please enter the name of the board'
  23 +}
... ...
  1 +import homePage from './homePage'
  2 +import common from './common'
  3 +import login from './login'
  4 +import device from './device'
  5 +import menu from './menu'
  6 +import components from './components'
  7 +import alarm from './alarm'
  8 +import userCenter from './userCenter'
  9 +export default {
  10 + homePage, common, login, device, menu, components, alarm, userCenter,
  11 + spreadTail: 'Connecting the world to create value'
  12 +}
... ...
  1 +export default {
  2 + hello: 'Hello!',
  3 + welcomeTo: 'welcome to',
  4 + pleaseEnterAccount: 'Please enter your login account',
  5 + pleaseEnterPassword: 'Please enter your login password',
  6 + login: 'Login',
  7 + phoneLogin: 'Mobile verification code login',
  8 + forgotPassword: 'Forgot password',
  9 + thirdAccountLogin: 'Third party account login',
  10 + passwordRule: 'The password format is incorrect (at least one uppercase English letter, at least one lowercase English letter, at least one digit, at least one special character, at least eight characters)',
  11 + loginSuccess: 'Login succeeded',
  12 + thirdAccountLoginSuccess: 'Third party account login successful',
  13 + isLoginPut: 'Are you sure you want to log out?',
  14 + loginOut: 'Log out and log in',
  15 + bindAccount: 'Bind account',
  16 + pleaseClickLogin: 'Please click login',
  17 + accountOut: 'Exit account',
  18 + phoneBind: 'Mobile binding',
  19 + PleaseEnterPhone: 'Please enter your phone number',
  20 + PleaseEnterCode: "Please enter the verification code",
  21 + accountBind: 'Account binding',
  22 + obtainCode: 'Obtain verification code',
  23 + accountBindSuccess: 'Account binding successful',
  24 + phoneFormatFail: 'The format of the phone number is incorrect',
  25 + codeFormatFail: 'The verification code format is incorrect',
  26 + phoneBindSuccess: 'Mobile phone binding successful',
  27 + codeAfterSeconds: 'Retrieve after {number} seconds',
  28 + codeBeenSend: 'Verification code has been sent',
  29 + accountPasswordLogin: 'Account password login',
  30 + sendCode: 'Send verification code',
  31 + verifyPhone: 'Verify phone number',
  32 + settingsNewPassword: 'Set a new password',
  33 + pleaseSettingsPassword: 'Please set a new login password of 6-20 characters',
  34 + pleaseNewPassword: 'Please enter the new login password again',
  35 + pleasePassword: 'Please input a password',
  36 + twoPasswordFail: 'The password entered twice is inconsistent',
  37 + resetPasswordSuccess: 'Reset password successful',
  38 + nextStep: 'Next step',
  39 + pleaseNetwork: 'Please check the network or server',
  40 + inspectDomain: 'Check if the requested domain name has been added to the domain whitelist',
  41 + requestTimeout: 'Request timeout: Please check the network'
  42 +}
... ...
  1 +export default {
  2 + homePage: 'Home page',
  3 + device: 'Device',
  4 + alarm: 'Alarm',
  5 + userCenter: 'Personal Center',
  6 + viewCamera: 'View camera',
  7 + viewConfiguration: 'View configuration',
  8 + configurationDetail: 'Configuration details',
  9 + organizationScreening: 'Organizational screening',
  10 + viewBoard: 'View bulletin board',
  11 + boardDetail: 'Bulletin board detail',
  12 + languageSettings: 'Language settings',
  13 + alarmDetail: 'Alarm details',
  14 + deviceDetail: 'Device detail',
  15 + commandDetail: 'Command detail',
  16 + deviceLocation: 'Geographical location of equipment',
  17 + systemNot: 'System notification',
  18 + notDetails: 'Notification Details',
  19 + feedback: 'Feedback',
  20 + login: 'Login',
  21 + personalData: 'Personal data',
  22 + phoneLogin: 'Mobile verification code login',
  23 + forgotPassword: 'Forgot password',
  24 + my: 'mine'
  25 +}
... ...
  1 +export default {
  2 + basicInfomation: 'Basic Information',
  3 + realName: 'Real name',
  4 + phoneNumber: 'phone number',
  5 + userAccount: 'User account',
  6 + periodValidity: 'term of validity',
  7 + emailAddress: 'e-mail address',
  8 + unBind: 'Unbind',
  9 + isUnbind: 'Do you need to unbind the account?',
  10 + camera: 'camera',
  11 + album: 'album',
  12 + pleaseEnterCCorrectPhone: 'Please enter the correct phone number',
  13 + permissionUseRequired: 'The following permissions are required for normal use',
  14 + goToOpen: 'Go to Open',
  15 + pleaseLogUpload: 'Please log in and upload pictures',
  16 + avatarUploadSuccess: 'Avatar uploaded successfully',
  17 + youCancelImage: 'You have unselected the image',
  18 + unbindSuccess: 'Unbind successfully',
  19 + unbindFail: 'Unbinding failed',
  20 + cameraPermission: 'Camera permission (for shooting avatars)',
  21 + storagePermission: 'Storage permission (read album)',
  22 + uploadInfoSuccess: 'Successfully updated personal information',
  23 + validationFail: 'Verification failed',
  24 + systemNotification: 'System notification',
  25 + feedback: 'Feedback on opinions',
  26 + languageSettings: 'Language settings',
  27 + pleaseSelectType: 'Please select type',
  28 + meeting: 'Meeting',
  29 + notice: 'Notice',
  30 + other: 'other',
  31 + theme: 'theme',
  32 + pleaseEnterTheme: 'Please enter the theme',
  33 + fullName: 'Name',
  34 + pleaseEnterName: 'Please enter your name',
  35 + feedText: 'Feedback',
  36 + pleaseFeed: 'Please enter feedback information',
  37 + uploadImage6: 'Upload images (up to 6)',
  38 + image: 'picture',
  39 + submit: 'Submit',
  40 + uploadFailed: 'Upload failed',
  41 + uploading: 'Uploading in progress',
  42 + image5m: 'Image limited to 5M',
  43 + imageUploadFail: 'Image upload failed',
  44 + feedbacksubmitSuccess: 'Feedback submitted successfully',
  45 + pleaseEnterformatCorrect: 'Please fill in or provide data in the correct format',
  46 + switchLanguages: 'Switching languages ...',
  47 + switchRestLanguage: 'Switching languages requires restarting the application. Do you want to switch'
  48 +}
... ...
  1 +export default {
  2 + scenario: '告警场景:',
  3 + level: '告警级别:',
  4 + organization: '所属组织:',
  5 + device: '告警设备:',
  6 + attribute: '触发属性:',
  7 + condition: '触发条件:',
  8 + value: '触发值:',
  9 + time: '告警时间:',
  10 + status: '告警状态:',
  11 + pleaseResult: '请输入处理结果',
  12 + processResult: '处理结果',
  13 + handle: '处理',
  14 + cleanUp: '清除',
  15 + alarmNum: '告警数:',
  16 + pleaseEnterDevice: '请输入告警设备',
  17 +}
... ...
  1 +export default {
  2 + inputText: '请输入',
  3 + chooseText: '请选择',
  4 + belongingOrganization: '所属组织',
  5 + filterCriteria: '筛选条件',
  6 + resetting: '重置',
  7 + confirm: '确认',
  8 + allText: '全部',
  9 + onLine: '在线',
  10 + offLine: '离线',
  11 + toBeActivated: '待激活',
  12 + alarm: '告警',
  13 + normal: '正常',
  14 + directlyDevice: '直连设备',
  15 + gatewayDevice: '网关设备',
  16 + sensorDevice: '网关子设备',
  17 + yesText: '是',
  18 + noText: '否',
  19 + screen: '筛选',
  20 + copyContent: '复制内容',
  21 + copyOk: '复制成功',
  22 + organizationalRelateion: '组织关系',
  23 + pleaseEnterContent: '请输入搜索内容',
  24 + issuedSuccess: "下发成功",
  25 + cancelText: '取消',
  26 + customText: '自定义',
  27 + minText: '最小值',
  28 + maxText: '最大值',
  29 + averageText: '平均值',
  30 + summationText: '求和',
  31 + countText: '计数',
  32 + emptyText: '空',
  33 + minuteText: '分钟',
  34 + hourText: '小时',
  35 + hour: '时',
  36 + minute: '分',
  37 + toText: '至',
  38 + dayText: '天',
  39 + attributeText: '属性',
  40 + noData: '暂无数据',
  41 + organizationalRelation: '组织关系',
  42 + one: '一',
  43 + two: '二',
  44 + three: '三',
  45 + four: '四',
  46 + five: '五',
  47 + six: '六',
  48 + day: '日',
  49 + year: '年',
  50 + month: '月',
  51 + processSuccess: '处理成功',
  52 + clearSuccess: '清除成功',
  53 + pleaseBindAccount: '请进行账号绑定',
  54 + loading: '加载中...',
  55 + refreshSuccess: '下拉刷新成功',
  56 + noText: '无'
  57 +}
... ...
  1 +export default {
  2 + calender: {
  3 + title: '日期选择',
  4 + startText: '开始',
  5 + endText: '结束',
  6 + confirmText: '确定',
  7 + confirmDisabledText: '确定'
  8 + }
  9 +}
... ...
  1 +export default {
  2 + pleaseEnterDeviceName: '请输入设备名称或别名搜索',//Please enter the device name or alias to search
  3 + deviceNum: '设备数',
  4 + pleaseBindAccount: '请进行账号绑定',
  5 + deviceNumber: '设备编号',
  6 + deviceStatus: '设备状态',
  7 + alarmStatus: '告警状态',
  8 + deviceType: '设备类型',
  9 + isDeviceCollect: '设备是否收藏',
  10 + basicInfo: '基础信息',
  11 + realTime: '实时数据',
  12 + historyTime: '历史数据',
  13 + alarmLog: '告警记录',
  14 + commandRecord: '命令记录',
  15 + inQueue: '队列中',
  16 + hasBeenSent: '已发送',
  17 + successSent: '发送成功',
  18 + responseSuccess: '响应成功',
  19 + timeout: '超时',
  20 + expired: '已过期',
  21 + ResponseFailed: "响应失败",
  22 + deletedText: '已删除',
  23 + oneWay: '单向',
  24 + twoWay: '双向',
  25 + lastConnectionTime: '最后连接时间',
  26 + isAlarm: '是否告警',
  27 + deviceRemark: '设备描述',
  28 + commandIssuance: '命令下发',
  29 + issuanceType: '下发类型',
  30 + pleaseEnterCommandContent: '请输入下发内容',
  31 + currentDeviceNotOnLine: '当前设备不在线',
  32 + pleaseCommandRule: '输入的内容只能是字母和数字的组合',
  33 + issuedSuccess: "下发成功",
  34 + oneTwoWay: '单向/双向',
  35 + service: '服务',
  36 + inputParameter: '输入参数',
  37 + stringFormat: '字符串格式',
  38 + jsonFormat: 'JSON格式',
  39 + pleaseSelectService: '请选择服务',
  40 + pleaseSelectDate: '请选择日期',
  41 + pleaseSelectTimeInterval: '请选择时间区间',
  42 + pleaseSelectDataAgg: '请选择数据聚合功能',
  43 + pleaseSelectAttribute: '请选择属性',
  44 + variableValue: '变量值',
  45 + updateTime: '更新时间',
  46 + startTime: '开始时间',
  47 + entTime: '结束时间',
  48 + maximumNumber: '最大条数',
  49 + triggerAttribute: '触发属性',
  50 + triggerCondition: '触发条件',
  51 + triggerValue: '触发值',
  52 + notANumber: '不是一个有效的数字',
  53 + rangeValues: '取值范围在{min}~{max}之间',
  54 + dataLengthLess: '数据长度应该小于',
  55 + noCurrently: '暂无可选的',
  56 + serviceCommand: '服务命令',
  57 + alarmStatus: '告警状态:',
  58 + activationNotConfirmed: "激活未确认",
  59 + activationConfirmed: '激活已确认',
  60 + clearUnconfirmed: '清除未确认',
  61 + clearConfirmed: '清除已确认',
  62 + urgent: '紧急',
  63 + important: '重要',
  64 + secondary: '次要',
  65 + warning: '警告',
  66 + uncertain: '不确定',
  67 + equal: '等于',
  68 + notEqual: '不等于',
  69 + less: '小于',
  70 + lessOfEqual: '小于等于',
  71 + greater: '大于',
  72 + greaterOrEqual: '大于等于',
  73 + starting: '开始于',
  74 + ending: '结束于',
  75 + contain: '包含',
  76 + notIncluded: '不包含',
  77 + minutes30: '30分钟',
  78 + hour1: '1小时',
  79 + hours2: '2小时',
  80 + pastDay: '近一天',
  81 + alarmFiltering: '告警筛选',
  82 + selectDate: '选择日期',
  83 + alarmLevel: '告警等级',
  84 + selectTime: '选择时间',
  85 + commandType: '命令类型',
  86 + commandStatus: '命令状态',
  87 + responseType: '响应类型',
  88 + issuanceStatus: '下发状态',
  89 + commandTime: '命令下发时间',
  90 + responseResults: '响应结果',
  91 + commandContent: '命令内容',
  92 +}
... ...
  1 +export default {
  2 + basicstatistics: '基础统计',
  3 + deviceStatistics: '设备统计',
  4 + deviceLabel: {
  5 + onLine: '在线',
  6 + offLine: '离线',
  7 + beActivated: '待激活',//To be activated
  8 + },
  9 + alarmStatistics: '告警统计',
  10 + alarmLabel: {
  11 + untreated: '未处理',
  12 + processed: '已处理',
  13 + falseAlarm: '误报',
  14 + },
  15 + cameraManagement: '摄像头管理',
  16 + configuration: '组态',
  17 + bulletinBoard: '看板',
  18 + cameraNum: '摄像头数:',
  19 + configurationNum: '组态数:',
  20 + pleaseConfigurationname: '请输入组态名称',
  21 + bulletionBoard: '看板数:',
  22 + pleaseVisualBoard: '请输入看板名称',
  23 +}
... ...
  1 +import homePage from './homePage'
  2 +import common from './common'
  3 +import login from './login'
  4 +import device from './device'
  5 +import menu from './menu'
  6 +import components from './components'
  7 +import alarm from './alarm'
  8 +import userCenter from './userCenter'
  9 +export default {
  10 + homePage, common, login, device, menu, components, alarm, userCenter,
  11 + spreadTail: '连接世界 创造价值',
  12 +}
... ...
  1 +export default {
  2 + hello: '您好,',
  3 + welcomeTo: '欢迎来到',
  4 + pleaseEnterAccount: '请输入登录账号',
  5 + pleaseEnterPassword: '请输入登录密码',
  6 + login: '登录',
  7 + phoneLogin: '手机验证码登录',
  8 + forgotPassword: '忘记密码',
  9 + thirdAccountLogin: '第三方账号登录',
  10 + passwordRule: '密码格式不正确(至少一个大写英文字母、至少一个小写英文字母、至少一位数字、至少一个特殊字符、最少八个字符)',
  11 + loginSuccess: '登录成功',
  12 + thirdAccountLoginSuccess: '第三方账号登录成功',
  13 + isLoginPut: '您确定要退出登录吗?',
  14 + loginOut: '退出登录',
  15 + bindAccount: '绑定账号',
  16 + pleaseClickLogin: '请点击登录',
  17 + accountOut: '退出账号',
  18 + phoneBind: '手机绑定',
  19 + PleaseEnterPhone: '请输入手机号码',
  20 + PleaseEnterCode: "请输入验证码",
  21 + accountBind: '账号绑定',
  22 + obtainCode: '获取验证码',
  23 + accountBindSuccess: '账号绑定成功',
  24 + phoneFormatFail: '手机号格式不正确',
  25 + codeFormatFail: '验证码格式不正确',
  26 + phoneBindSuccess: '手机绑定成功',
  27 + codeAfterSeconds: '{number}S后重新获取',
  28 + codeBeenSend: '验证码已发送',
  29 + accountPasswordLogin: '账号密码登录',
  30 + sendCode: '发送验证码',
  31 + switchLanguages: '切换语言中...',
  32 + verifyPhone: '验证手机号码',
  33 + settingsNewPassword: '设置新密码',
  34 + pleaseSettingsPassword: '请设置6-20位新的登录密码',
  35 + pleaseNewPassword: '请再次输入新的登录密码',
  36 + pleasePassword: '请输入密码',
  37 + twoPasswordFail: '两次输入密码不一致',
  38 + resetPasswordSuccess: '重置密码成功',
  39 + nextStep: '下一步',
  40 + pleaseNetwork: '请检查网络或服务器',
  41 + inspectDomain: '检查请求域名是否添加了域名白名单',
  42 + requestTimeout: '请求超时:请检查网络',
  43 +
  44 +}
... ...
  1 +export default {
  2 + homePage: '首页',
  3 + device: '设备',
  4 + alarm: '告警',
  5 + userCenter: '个人中心',
  6 + viewCamera: '查看摄像头',
  7 + viewConfiguration: '查看组态',
  8 + configurationDetail: "组态详情",
  9 + organizationScreening: '组织筛选',
  10 + viewBoard: '查看看板',
  11 + boardDetail: '看板详情',
  12 + languageSettings: '语言设置',
  13 + alarmDetail: '告警详情',
  14 + deviceDetail: '设备详情',
  15 + commandDetail: '命令详情',
  16 + deviceLocation: '设备地理位置',
  17 + systemNot: '系统通知',
  18 + notDetails: '通知详情',
  19 + feedback: '意见反馈',
  20 + login: '登录',
  21 + personalData: '个人资料',
  22 + phoneLogin: '手机验证码登录',
  23 + forgotPassword: '忘记密码',
  24 + my: "我的",
  25 +}
... ...
  1 +export default {
  2 + basicInfomation: '基本资料',
  3 + realName: '真实姓名',
  4 + phoneNumber: '手机号码',
  5 + userAccount: '用户账号',
  6 + periodValidity: '有效期',
  7 + emailAddress: '邮箱地址',
  8 + unBind: '解绑',
  9 + isUnbind: '是否需要解除绑定的账号?',
  10 + camera: '相机',
  11 + album: '相册',
  12 + pleaseEnterCCorrectPhone: '请输入正确的手机号码',
  13 + permissionUseRequired: '需要下列权限才可以正常使用',
  14 + goToOpen: '前往开启',
  15 + pleaseLogUpload: '请登录后上传图片',
  16 + avatarUploadSuccess: '头像上传成功',
  17 + youCancelImage: '您取消选择图片',
  18 + unbindSuccess: '解绑成功',
  19 + unbindFail: '解绑失败',
  20 + cameraPermission: '摄像头权限(拍摄头像)',
  21 + storagePermission: '存储权限(读取相册)',
  22 + uploadInfoSuccess: '更新个人资料成功',
  23 + validationFail: '校验失败',
  24 + systemNotification: '系统通知',
  25 + feedback: '意见反馈',
  26 + languageSettings: '切换语言',
  27 + pleaseSelectType: '请选择类型',
  28 + meeting: '会议',
  29 + notice: '公告',
  30 + other: '其他',
  31 + theme: '主题',
  32 + pleaseEnterTheme: '请输入主题',
  33 + fullName: '姓名',
  34 + pleaseEnterName: '请输入姓名',
  35 + feedText: '反馈',
  36 + pleaseFeed: '请输入反馈信息',
  37 + uploadImage6: '上传图片(最多6张)',
  38 + image: '图片',
  39 + submit: '提交',
  40 + uploadFailed: '上传失败',
  41 + uploading: '上传中',
  42 + image5m: '图片限定5M',
  43 + imageUploadFail: '图片上传失败',
  44 + feedbacksubmitSuccess: '意见反馈提交成功',
  45 + pleaseEnterformatCorrect: '请填写或者请填写正确格式的数据',
  46 + switchRestLanguage: '切换语言需要重启应用,是否切换',
  47 +}
... ...
  1 + {
  2 + "homePage": "首页",
  3 + "device": "设备",
  4 + "alarm": "告警",
  5 + "userCenter": "个人中心",
  6 + "viewCamera": "查看摄像头",
  7 + "viewConfiguration": "查看组态",
  8 + "configurationDetail": "组态详情",
  9 + "organizationScreening": "组织筛选",
  10 + "viewBoard": "查看看板",
  11 + "boardDetail": "看板详情",
  12 + "languageSettings": "语言设置",
  13 + "alarmDetail": "告警详情",
  14 + "deviceDetail": "设备详情",
  15 + "commandDetail": "命令详情",
  16 + "deviceLocation": "设备地理位置",
  17 + "systemNot": "系统通知",
  18 + "notDetails": "通知详情",
  19 + "feedback": "意见反馈",
  20 + "login": "登录",
  21 + "personalData": "个人资料",
  22 + "phoneLogin": "手机验证码登录",
  23 + "forgotPassword": "忘记密码",
  24 + "my": "我的"
  25 +}
... ...
... ... @@ -5,21 +5,21 @@
5 5 <view class="login-body">
6 6 <view class="login-phone">
7 7 <view class="phone-main">
8   - <text class="text">手机验证码登录</text>
  8 + <text class="text">{{ $t('login.phoneLogin') }}</text>
9 9 <view class="circleStyle"></view>
10 10 </view>
11   - <view class="form-row"><u-input v-model="loginForm.phoneNumber" type="number" placeholder="请输入手机号码"
  11 + <view class="form-row"><u-input v-model="loginForm.phoneNumber" type="number" :placeholder="$t('login.PleaseEnterPhone')"
12 12 border="bottom"></u-input></view>
13 13 <view class="form-row">
14   - <u-input type="number" v-model="loginForm.code" placeholder="请输入验证码" border="bottom">
  14 + <u-input type="number" v-model="loginForm.code" :placeholder="$t('login.PleaseEnterCode')" border="bottom">
15 15 <template slot="suffix">
16 16 <view @click="getVerifyCode" class="verify-code">{{ codeText }}</view>
17 17 </template>
18 18 </u-input>
19 19 </view>
20   - <button class="submit" size="default" @click="onSubmit"><text class="text">登录</text></button>
  20 + <button class="submit" size="default" @click="onSubmit"><text class="text">{{ $t('login.login') }}</text></button>
21 21 <view class="u-flex account-style">
22   - <view class="content" @click="openAccountFunc">账号密码登录</view>
  22 + <view class="content" @click="openAccountFunc">{{ $t('login.accountPasswordLogin') }}</view>
23 23 </view>
24 24 <view class="circleStyleBottom"></view>
25 25 </view>
... ... @@ -41,9 +41,19 @@
41 41 code: ''
42 42 },
43 43 readonly: false,
44   - codeText: '发送验证码',
  44 + codeText:'',
45 45 };
46 46 },
  47 + onShow(){
  48 + this.$nextTick(()=>{
  49 + uni.setNavigationBarTitle({
  50 + title:this.$t('menu.phoneLogin')
  51 + })
  52 + })
  53 + },
  54 + onLoad(){
  55 + this.codeText = this.$t('login.obtainCode')
  56 + },
47 57 methods: {
48 58 ...mapMutations(['setUserInfo']),
49 59 ...mapActions(['updateBadgeTotal']),
... ... @@ -51,14 +61,14 @@
51 61 codeCountdownText() {
52 62 const _this = this;
53 63 this.readonly = true;
54   - this.codeText = '60s后重新获取';
  64 + this.codeText = this.$t('login.codeAfterSeconds',{number:60});
55 65 var s = 60;
56 66 clear = setInterval(() => {
57 67 s--;
58   - _this.codeText = s + 's后重新获取';
  68 + _this.codeText = this.$t('login.codeAfterSeconds',{number:s});
59 69 if (s <= 0) {
60 70 clearInterval(clear);
61   - _this.codeText = '发送验证码';
  71 + _this.codeText = this.$t('login.obtainCode');
62 72 _this.readonly = false;
63 73 }
64 74 }, 1000);
... ... @@ -71,10 +81,10 @@
71 81 return
72 82 }
73 83 if (!this.loginForm.phoneNumber) {
74   - return useShowToast('请输入手机号~')
  84 + return useShowToast(this.$t('login.PleaseEnterPhone'))
75 85 }
76 86 if (!phoneRegular.test(this.loginForm.phoneNumber)) {
77   - return useShowToast('手机号格式不正确~')
  87 + return useShowToast(this.$t('login.phoneFormatFail'))
78 88 }
79 89 // 获取验证码接口
80 90 await api.loginApi.postPhoneCodeApi(this.loginForm.phoneNumber)
... ... @@ -84,10 +94,10 @@
84 94 const phoneRegular = /^1\d{10}$/;
85 95 const verifyCodeReg = /^\d{6}$/;
86 96 const validateValue = Object.values(this.loginForm)
87   - if (!validateValue[0]) return uni.$u.toast("请输入手机号码~");
88   - if (!validateValue[1]) return uni.$u.toast("请输入验证码~");
89   - if (!phoneRegular.test(validateValue[0])) return uni.$u.toast("手机号格式不正确~");
90   - if (!verifyCodeReg.test(validateValue[1])) return uni.$u.toast("验证码格式不正确~");
  97 + if (!validateValue[0]) return uni.$u.toast(this.$t('login.PleaseEnterPhone'));
  98 + if (!validateValue[1]) return uni.$u.toast(this.$t('login.PleaseEnterCode'));
  99 + if (!phoneRegular.test(validateValue[0])) return uni.$u.toast(this.$t('login.phoneFormatFail'));
  100 + if (!verifyCodeReg.test(validateValue[1])) return uni.$u.toast(this.$t('login.codeFormatFail'));
91 101 const res = await api.loginApi.postPhoneLoginApi(this.loginForm)
92 102 if (res) {
93 103 // 储存登录信息
... ... @@ -103,7 +113,7 @@
103 113 if (userInfo.token) {
104 114 this.setUserInfo(userInfo);
105 115 }
106   - useShowToast('登录成功~').then(async (res) => {
  116 + useShowToast(this.$t('login.loginSuccess')).then(async (res) => {
107 117 this.saveUserInfo();
108 118 await this.getAlarmTotalData();
109 119 useReLaunch("/pages/index/index")
... ...
... ... @@ -2,28 +2,28 @@
2 2 <view class="find-password-page">
3 3 <public-module></public-module>
4 4 <view class="top u-flex">
5   - <view @click="showPhone" :style="{ color: phoneNumberColor }" class="item">1.验证手机号码</view>
6   - <view :style="{ color: passwordColor }" class="item">2.设置新密码</view>
  5 + <view @click="showPhone" :style="{ color: phoneNumberColor }" class="item">1.{{ $t('login.verifyPhone') }}</view>
  6 + <view :style="{ color: passwordColor }" class="item">2.{{ $t('login.settingsNewPassword') }}</view>
7 7 </view>
8 8 <view v-if="!nextStatus" class="login-body">
9 9 <view class="login-phone">
10 10 <view class="form-row">
11   - <u-input v-model="forgetForm.phone" type="number" placeholder="请输入手机号码" border="bottom" />
  11 + <u-input v-model="forgetForm.phone" type="number" :placeholder="$t('login.PleaseEnterPhone')" border="bottom" />
12 12 </view>
13 13 <view class="form-row">
14   - <u-input type="number" v-model="forgetForm.verifyCode" placeholder="请输入验证码" border="bottom">
  14 + <u-input type="number" v-model="forgetForm.verifyCode" :placeholder="$t('login.PleaseEnterCode')" border="bottom">
15 15 <template slot="suffix">
16 16 <view @click="getVerifyCode" class="verify-code">{{ codeText }}</view>
17 17 </template>
18 18 </u-input>
19 19 </view>
20   - <button class="submit" size="default" @click="onNextSubmit"><text style="color:#fff">下一步</text></button>
  20 + <button class="submit" size="default" @click="onNextSubmit"><text style="color:#fff">{{ $t('login.nextStep') }}</text></button>
21 21 </view>
22 22 </view>
23 23 <view v-else class="login-body">
24 24 <view class="login-phone">
25 25 <view class="form-row u-flex">
26   - <u-input v-model="forgetForm.password" :password="showPassword" placeholder="请设置6-20位新的登录密码" border="bottom">
  26 + <u-input v-model="forgetForm.password" :password="showPassword" :placeholder="$t('login.pleaseSettingsPassword')" border="bottom">
27 27 <template slot="suffix">
28 28 <view @click="showPasswordMode" style="padding: 10rpx">
29 29 <u-icon width="18" height="14" :name="passwordModeIcon"></u-icon>
... ... @@ -32,7 +32,7 @@
32 32 </u-input>
33 33 </view>
34 34 <view class="form-row u-flex">
35   - <u-input v-model="forgetForm.repeatPassword" :password="showPasswordRepeat" placeholder="请再次输入新的登录密码" border="bottom">
  35 + <u-input v-model="forgetForm.repeatPassword" :password="showPasswordRepeat" :placeholder="$t('login.pleaseNewPassword')" border="bottom">
36 36 <template slot="suffix">
37 37 <view @click="showPasswordModeRepeat" style="padding: 10rpx">
38 38 <u-icon width="18" height="14" :name="passwordModeRepeatIcon"></u-icon>
... ... @@ -40,7 +40,7 @@
40 40 </template>
41 41 </u-input>
42 42 </view>
43   - <button class="submit" size="default" @click="onSubmit"><text style="color:#fff">确定</text></button>
  43 + <button class="submit" size="default" @click="onSubmit"><text style="color:#fff">{{ $t('common.confirm') }}</text></button>
44 44 </view>
45 45 </view>
46 46 </view>
... ... @@ -62,7 +62,7 @@
62 62 repeatPassword: '',
63 63 },
64 64 readonly: false,
65   - codeText: '发送验证码',
  65 + codeText: '',
66 66 nextStatus: false,
67 67 showPassword: true,
68 68 showPasswordRepeat: true
... ... @@ -82,19 +82,29 @@
82 82 return this.showPasswordRepeat ? '/static/eye-hide.png' : '/static/eye.png'
83 83 }
84 84 },
  85 + onShow(){
  86 + this.$nextTick(()=>{
  87 + uni.setNavigationBarTitle({
  88 + title:this.$t('menu.forgotPassword')
  89 + })
  90 + })
  91 + },
  92 + onLoad(){
  93 + this.codeText = this.$t('login.sendCode')
  94 + },
85 95 methods: {
86 96 //验证码按钮文字状态
87 97 verifyCodeCountDown() {
88 98 const _this = this;
89 99 this.readonly = true;
90   - this.codeText = '60s后重新获取';
  100 + this.codeText = this.$t('login.codeAfterSeconds',{number:60});
91 101 var s = 60;
92 102 clear = setInterval(() => {
93 103 s--;
94   - _this.codeText = s + 's后重新获取';
  104 + _this.codeText = this.$t('login.codeAfterSeconds',{number:s});
95 105 if (s <= 0) {
96 106 clearInterval(clear);
97   - _this.codeText = '发送验证码';
  107 + _this.codeText = this.$t('login.sendCode');
98 108 _this.readonly = false;
99 109 }
100 110 }, 1000);
... ... @@ -103,14 +113,13 @@
103 113 getVerifyCode() {
104 114 const phoneRegular = /^1\d{10}$/;
105 115 if (this.readonly) {
106   - useShowToast('验证码已发送~')
  116 + useShowToast(this.$t('login.codeBeenSend'))
107 117 }
108   - console.log(this.forgetForm.phone);
109 118 if (!this.forgetForm.phone) {
110   - return useShowToast('请输入手机号~')
  119 + return useShowToast(this.$t('login.PleaseEnterPhone'))
111 120 }
112 121 if (!phoneRegular.test(this.forgetForm.phone)) {
113   - return useShowToast('手机号格式不正确~')
  122 + return useShowToast(this.$t('login.phoneFormatFail'))
114 123 }
115 124 api.loginApi.postCodeApi(this.forgetForm.phone)
116 125 .then(res => {
... ... @@ -121,10 +130,10 @@
121 130 const phoneRegular = /^1\d{10}$/;
122 131 const verifyCodeReg=/^\d{6}$/;
123 132 const validateValue = Object.values(this.forgetForm)
124   - if(!validateValue[0]) return uni.$u.toast("请输入手机号码~");
125   - if(!validateValue[1]) return uni.$u.toast("请输入验证码~");
126   - if(!phoneRegular.test(validateValue[0])) return uni.$u.toast("手机号格式不正确~");
127   - if(!verifyCodeReg.test(validateValue[1])) return uni.$u.toast("验证码格式不正确~");
  133 + if(!validateValue[0]) return uni.$u.toast(this.$t('login.PleaseEnterPhone'));
  134 + if(!validateValue[1]) return uni.$u.toast(this.$t('login.PleaseEnterCode'));
  135 + if(!phoneRegular.test(validateValue[0])) return uni.$u.toast(this.$t('login.phoneFormatFail'));
  136 + if(!verifyCodeReg.test(validateValue[1])) return uni.$u.toast(this.$t('login.codeFormatFail'));
128 137 this.nextStatus = true;
129 138 },
130 139 showPhone() {
... ... @@ -132,11 +141,11 @@
132 141 },
133 142 onSubmit() {
134 143 const validateValue = Object.values(this.forgetForm)
135   - if(!validateValue[2]) return uni.$u.toast("请输入密码~");
136   - if(!validateValue[3]) return uni.$u.toast("请输入密码~");
137   - if(!loginPasswordReg.test(validateValue[2])) return useShowModal('密码格式不正确(至少一个大写英文字母、至少一个小写英文字母、至少一位数字、至少一个特殊字符、最少八个字符)~')
138   - if(!loginPasswordReg.test(validateValue[3])) return useShowModal('密码格式不正确(至少一个大写英文字母、至少一个小写英文字母、至少一位数字、至少一个特殊字符、最少八个字符)~')
139   - if (validateValue[2] !== validateValue[3]) return uni.$u.toast('两次输入密码不一致');
  144 + if(!validateValue[2]) return uni.$u.toast(this.$t('login.pleasePassword'));
  145 + if(!validateValue[3]) return uni.$u.toast(this.$t('login.pleasePassword'));
  146 + if(!loginPasswordReg.test(validateValue[2])) return useShowModal(this.$t('login.passwordRule'))
  147 + if(!loginPasswordReg.test(validateValue[3])) return useShowModal(this.$t('login.passwordRule'))
  148 + if (validateValue[2] !== validateValue[3]) return uni.$u.toast(this.$t('login.twoPasswordFail'));
140 149 let httpData = {
141 150 password: this.forgetForm.password,
142 151 phoneNumber: this.forgetForm.phone,
... ... @@ -144,7 +153,7 @@
144 153 };
145 154 const res = api.loginApi.postResetCodeApi(this.forgetForm.phone, httpData)
146 155 if (res) {
147   - useShowToast( '重置密码成功~').then(res => {
  156 + useShowToast(this.$t('login.resetPasswordSuccess')).then(res => {
148 157 useReLaunch('/publicLoginSubPage/public/login')
149 158 });
150 159 }
... ...
... ... @@ -23,37 +23,37 @@
23 23 </view>
24 24 </view>
25 25 <!-- #endif -->
26   - <view class="u-m-t-20 basic-text"><text class="text">基本资料</text></view>
  26 + <view class="u-m-t-20 basic-text"><text class="text">{{$t('userCenter.basicInfomation')}}</text></view>
27 27 <view class="basic-main">
28 28 <u--form labelPosition="left" :model="myInfoModel" ref="myForm">
29   - <u-form-item labelWidth="80px" label="真实姓名" prop="realName" borderBottom>
30   - <u--input placeholder="请输入真实姓名" v-model="myInfoModel.realName" border="none"></u--input>
  29 + <u-form-item labelWidth="80px" :label="$t('userCenter.realName')" prop="realName" borderBottom>
  30 + <u--input :placeholder="$t('common.inputText') + $t('userCenter.realName')" v-model="myInfoModel.realName" border="none"></u--input>
31 31 </u-form-item>
32   - <u-form-item labelWidth="80px" label="手机号码" prop="phoneNumber" borderBottom>
33   - <u--input placeholder="请输入手机号码" v-model="myInfoModel.phoneNumber" border="none"></u--input>
  32 + <u-form-item labelWidth="80px" :label="$t('userCenter.phoneNumber')" prop="phoneNumber" borderBottom>
  33 + <u--input :placeholder="$t('common.inputText') + $t('userCenter.phoneNumber')" v-model="myInfoModel.phoneNumber" border="none"></u--input>
34 34 </u-form-item>
35   - <u-form-item labelWidth="80px" label="用户账号" prop="username" borderBottom>
36   - <u--input disabled placeholder="请输入用户账号 " v-model="myInfoModel.username" border="none"></u--input>
  35 + <u-form-item labelWidth="80px" :label="$t('userCenter.userAccount')" prop="username" borderBottom>
  36 + <u--input disabled :placeholder="$t('common.inputText') + $t('userCenter.userAccount')" v-model="myInfoModel.username" border="none"></u--input>
37 37 </u-form-item>
38   - <u-form-item labelWidth="80px" label="有效期" prop="accountExpireTime" borderBottom>
  38 + <u-form-item labelWidth="80px" :label="$t('userCenter.periodValidity')" prop="accountExpireTime" borderBottom>
39 39 <u--input disabled v-model="myInfoModel.accountExpireTime" border="none"></u--input>
40 40 </u-form-item>
41   - <u-form-item labelWidth="80px" label="邮箱地址" prop="email" borderBottom>
42   - <u--input placeholder="请输入邮箱地址" v-model="myInfoModel.email" border="none"></u--input>
  41 + <u-form-item labelWidth="80px" :label="$t('userCenter.emailAddress')" prop="email" borderBottom>
  42 + <u--input :placeholder="$t('common.inputText') + $t('userCenter.emailAddress')" v-model="myInfoModel.email" border="none"></u--input>
43 43 </u-form-item>
44 44 </u--form>
45 45 </view>
46 46 <view class="basic-bottom u-flex">
47 47 <view class="item" v-if="info.data.isThirdLoginAndNoDind && isJudgeBindBtn">
48 48 <button class="submit" size="default" @click="clearAccountFunc" :style="{ background: InfoColor }"><text
49   - class="un-bind-text">解绑</text></button>
  49 + class="un-bind-text">{{ $t('userCenter.unBind') }}</text></button>
50 50 </view>
51 51 <view class="item" style="margin-right: 60rpx;" :style="[
52 52 { position: info.data.isThirdLoginAndNoDind && isJudgeBindBtn ? '' : 'relative' },
53 53 { right: info.data.isThirdLoginAndNoDind && isJudgeBindBtn ? '' : '-190rpx' }
54 54 ]">
55 55 <button class="submit" size="default" @click="onSubmitFunc" :style="{ background: PrimaryColor }"><text
56   - class="un-bind-text">确认</text></button>
  56 + class="un-bind-text">{{$t('common.confirm')}}</text></button>
57 57 </view>
58 58 </view>
59 59 <!-- #ifdef MP-WEIXIN -->
... ... @@ -63,14 +63,14 @@
63 63 <view>
64 64 <u-popup bgColor="transparent" :overlay="true" :show="showBind" mode="bottom">
65 65 <view class="u-flex logout-main">
66   - <view class="main"><text style="color: #999999">是否需要解除绑定的账号?</text></view>
67   - <view @click="confrimBind(info)" class="main"><text style="color: #f95e5a">是</text></view>
68   - <view @click="showBind = false" class="main1"><text style="color: #3478f7">否</text></view>
  66 + <view class="main"><text style="color: #999999">{{ $t('userCenter.isUnbind') }}</text></view>
  67 + <view @click="confrimBind(info)" class="main"><text style="color: #f95e5a">{{ $t('common.yesText') }}</text></view>
  68 + <view @click="showBind = false" class="main1"><text style="color: #3478f7">{{ $t('common.noText') }}</text></view>
69 69 </view>
70 70 </u-popup>
71 71 </view>
72 72 <!-- 解绑账号 -->
73   - <u-picker :show="showSelectType" :columns="avgColumns" keyName="label" closeOnClickOverlay
  73 + <u-picker :show="showSelectType" :columns="avgColumns.map(item=>({...item,label:$t(item.label)}))" keyName="label" closeOnClickOverlay
74 74 @confirm="confirmAvgGap" @cancel="showSelectType=false" @close="showSelectType=false"></u-picker>
75 75 </view>
76 76 </template>
... ... @@ -90,10 +90,10 @@
90 90 return {
91 91 avgColumns: [
92 92 [{
93   - label: '相机',
  93 + label: 'userCenter.camera',
94 94 value: 1
95 95 }, {
96   - label: '相册',
  96 + label: 'userCenter.album',
97 97 value: 2
98 98 }, ]
99 99 ],
... ... @@ -108,28 +108,6 @@
108 108 email: '',
109 109 accountExpireTime: ''
110 110 },
111   - rules: {
112   - phoneNumber: [{
113   - required: true,
114   - message: '请输入正确的手机号码',
115   - trigger: 'change'
116   - },
117   - {
118   - pattern: /^1[3-9][0-9]{9}$/,
119   - message: '请输入正确的手机号码'
120   - }
121   - ],
122   - // email: [{
123   - // required: true,
124   - // message: '请输入正确的邮箱号',
125   - // trigger: 'change'
126   - // },
127   - // {
128   - // pattern: /^[0-9a-zA-Z]+@(([0-9a-zA-Z]+)[.])+[a-z]{3}$/,
129   - // message: '请输入正确的邮箱号'
130   - // }
131   - // ]
132   - },
133 111 showDate: false,
134 112 dateTime: Number(new Date()),
135 113 avatar: '',
... ... @@ -142,7 +120,29 @@
142 120 };
143 121 },
144 122 onReady() {
145   - this.$refs.myForm.setRules(this.rules);
  123 + // const rules = {
  124 + // phoneNumber: [{
  125 + // required: true,
  126 + // message: this.$t('userCenter.pleaseEnterCCorrectPhone'),
  127 + // trigger: 'change'
  128 + // },
  129 + // {
  130 + // pattern: /^1[3-9][0-9]{9}$/,
  131 + // message: this.$t('userCenter.pleaseEnterCCorrectPhone')
  132 + // }
  133 + // ],
  134 + // // email: [{
  135 + // // required: true,
  136 + // // message: '请输入正确的邮箱号',
  137 + // // trigger: 'change'
  138 + // // },
  139 + // // {
  140 + // // pattern: /^[0-9a-zA-Z]+@(([0-9a-zA-Z]+)[.])+[a-z]{3}$/,
  141 + // // message: '请输入正确的邮箱号'
  142 + // // }
  143 + // // ]
  144 + // }
  145 + // this.$refs.myForm.setRules(rules);
146 146 },
147 147 onLoad(e) {
148 148 if (e.data !== null) {
... ... @@ -154,6 +154,11 @@
154 154 }
155 155 },
156 156 onShow() {
  157 + this.$nextTick(()=>{
  158 + uni.setNavigationBarTitle({
  159 + title:this.$t('menu.personalData')
  160 + })
  161 + })
157 162 let getOpenId = getApp().globalData.openId;
158 163 if (getOpenId) {
159 164 this.openIds = getOpenId;
... ... @@ -168,7 +173,7 @@
168 173 ...mapState(['userInfo']),
169 174 ...mapMutations(['setUserInfo', 'emptyUserInfo']),
170 175 modify() {
171   - useShowModal(this.modify_content, '需要下列权限才可以正常使用', '前往开启').then((res) => {
  176 + useShowModal(this.modify_content, this.$t('userCenter.permissionUseRequired'), this.$t('userCenter.goToOpen')).then((res) => {
172 177 if (res.confirm) {
173 178 permission.gotoAppPermissionSetting(); //动态修改权限
174 179 }
... ... @@ -193,7 +198,7 @@
193 198 // #ifdef H5
194 199 token = window.sessionStorage.getItem('userInfo').isToken;
195 200 // #endif
196   - if (!token) return uni.$u.toast('请登录后上传图片');
  201 + if (!token) return uni.$u.toast(this.$t('userCenter.pleaseLogUpload'));
197 202 var cmr = plus.camera.getCamera();
198 203 var res = cmr.supportedImageResolutions[0];
199 204 var fmt = cmr.supportedImageFormats[0];
... ... @@ -207,7 +212,7 @@
207 212 .then(res => {
208 213 let objImage = JSON.parse(res.data);
209 214 this.avatar = objImage.fileStaticUri;
210   - uni.$u.toast('头像上传成功');
  215 + uni.$u.toast(this.$t('userCenter.avatarUploadSuccess'));
211 216 })
212 217 },
213 218 function(error) {
... ... @@ -225,7 +230,7 @@
225 230 // #ifdef H5
226 231 token = window.sessionStorage.getItem('userInfo').isToken;
227 232 // #endif
228   - if (!token) return uni.$u.toast('请登录后上传图片');
  233 + if (!token) return uni.$u.toast(this.$t('userCenter.pleaseLogUpload'));
229 234 plus.gallery.pick(
230 235 (path) => {
231 236 this.showSelectType = false
... ... @@ -236,11 +241,11 @@
236 241 .then(res => {
237 242 let objImage = JSON.parse(res.data);
238 243 this.avatar = objImage.fileStaticUri;
239   - uni.$u.toast('头像上传成功');
  244 + uni.$u.toast(this.$t('userCenter.avatarUploadSuccess'));
240 245 })
241 246 },
242 247 function(e) {
243   - uni.$u.toast('您取消选择图片');
  248 + uni.$u.toast(this.$t('userCenter.youCancelImage'));
244 249 }, {
245 250 filter: 'image'
246 251 }
... ... @@ -255,7 +260,7 @@
255 260 };
256 261 api.loginApi.deleteBindApi(httpData).then(res => {
257 262 if (res) {
258   - uni.$u.toast('解绑成功');
  263 + uni.$u.toast(this.$t('userCenter.unbindSuccess'));
259 264 this.showBind = false;
260 265 this.isJudgeBindBtn = false;
261 266 uni.reLaunch({
... ... @@ -263,7 +268,7 @@
263 268 });
264 269 this.emptyUserInfo();
265 270 } else {
266   - uni.$u.toast('解绑失败');
  271 + uni.$u.toast(this.$t('userCenter.unbindFail'));
267 272 this.showBind = false;
268 273 }
269 274 });
... ... @@ -277,7 +282,7 @@
277 282 },
278 283 confirmAvgGap(e) {
279 284 if (e.value[0].value == 1) {
280   - this.modify_content = '摄像头权限(拍摄头像)';
  285 + this.modify_content = this.$t('userCenter.cameraPermission');
281 286 //相机
282 287 switch (uni.getSystemInfoSync().platform) {
283 288 case 'android':
... ... @@ -285,7 +290,7 @@
285 290 break;
286 291 }
287 292 } else {
288   - this.modify_content = '存储权限(读取相册)';
  293 + this.modify_content = this.$t('userCenter.storagePermission');
289 294 //相册
290 295 switch (uni.getSystemInfoSync().platform) {
291 296 case 'android':
... ... @@ -303,7 +308,7 @@
303 308 // #ifdef H5
304 309 token = window.sessionStorage.getItem('userInfo').isToken;
305 310 // #endif
306   - if (!token) return uni.$u.toast('请登录后上传图片');
  311 + if (!token) return uni.$u.toast(this.$t('userCenter.pleaseLogUpload'));
307 312 useChooseImage({
308 313 count: 1,
309 314 sizeType: ['compressed'],
... ... @@ -317,7 +322,7 @@
317 322 .then(res => {
318 323 let objImage = JSON.parse(res.data);
319 324 this.avatar = objImage.fileStaticUri;
320   - uni.$u.toast('头像上传成功');
  325 + uni.$u.toast(this.$t('userCenter.avatarUploadSuccess'));
321 326 })
322 327 })
323 328 },
... ... @@ -338,11 +343,11 @@
338 343 uni.navigateBack({
339 344 delta: 1
340 345 });
341   - uni.$u.toast('更新个人资料成功~');
  346 + uni.$u.toast(this.$t('userCenter.uploadInfoSuccess'));
342 347 }
343 348 })
344 349 .catch(errors => {
345   - uni.$u.toast('校验失败');
  350 + uni.$u.toast(this.$t('userCenter.validationFail'));
346 351 });
347 352 },
348 353 dateClose() {
... ... @@ -354,19 +359,19 @@
354 359 },
355 360 formatter(type, value) {
356 361 if (type === 'year') {
357   - return `${value}`;
  362 + return `${value} ${this.$t('common.year')}`;
358 363 }
359 364 if (type === 'month') {
360   - return `${value}`;
  365 + return `${value} ${this.$t('common.month')}`;
361 366 }
362 367 if (type === 'day') {
363   - return `${value}`;
  368 + return `${value} ${this.$t('common.day')}`;
364 369 }
365 370 if (type === 'hour') {
366   - return `${value}`;
  371 + return `${value}${this.$t('common.hour')}`;
367 372 }
368 373 if (type === 'minute') {
369   - return `${value}`;
  374 + return `${value}${this.$t('common.minute')}`;
370 375 }
371 376 return value;
372 377 },
... ...
... ... @@ -4,20 +4,20 @@
4 4 <public-module></public-module>
5 5 <view class="u-flex login-main">
6 6 <view class="content">
7   - <view class="hello login-text-muted">您好,</view>
8   - <view style="width: 587rpx;" class="text-clip hello-welcome login-text-muted">欢迎来到{{setHeadTitle}}!
  7 + <view class="hello login-text-muted">{{ $t('login.hello') }}</view>
  8 + <view style="width: 587rpx;" class="text-clip hello-welcome login-text-muted">{{$t('login.welcomeTo')}} {{setHeadTitle}}
9 9 </view>
10 10 </view>
11 11 </view>
12 12 <view class="login-body">
13 13 <view class="login-phone">
14 14 <view class="form-row u-flex">
15   - <u-input :adjust-position="false" v-model="loginForm.username" type="text" placeholder="请输入登录账号"
  15 + <u-input :adjust-position="false" v-model="loginForm.username" type="text" :placeholder="$t('login.pleaseEnterAccount')"
16 16 border="bottom" />
17 17 </view>
18 18 <view class="form-row u-flex">
19 19 <u-input :adjust-position="false" v-model="loginForm.password" :password="showPassword"
20   - placeholder="请输入登录密码" border="bottom">
  20 + :placeholder="$t('login.pleaseEnterPassword')" border="bottom">
21 21 <template slot="suffix">
22 22 <view @click="showPasswordMode" style="padding: 10rpx">
23 23 <u-icon width="18" height="14" :name="passwordIcon"></u-icon>
... ... @@ -26,15 +26,15 @@
26 26 </u-input>
27 27 </view>
28 28 <button class="submit" size="default" @click="onSubmitFunc">
29   - <text class="text">登录</text>
  29 + <text class="text">{{ $t('login.login') }}</text>
30 30 </button>
31 31 <view class="u-flex row-item">
32   - <view class="row-phone login-text-gray" @click="openCodeFunc">手机验证码登录</view>
33   - <view class="row-reset login-text-gray" @click="findPassrordFunc">忘记密码</view>
  32 + <view class="row-phone login-text-gray" @click="openCodeFunc">{{ $t('login.phoneLogin') }}</view>
  33 + <view class="row-reset login-text-gray" @click="findPassrordFunc">{{ $t('login.forgotPassword') }}</view>
34 34 </view>
35 35 <view class="u-flex link-login">
36 36 <!-- #ifdef MP-WEIXIN -->
37   - <view class="link-text login-text-gray">第三方账号登录</view>
  37 + <view class="link-text login-text-gray">{{ $t('login.thirdAccountLogin') }}</view>
38 38 <view style="height: 20rpx"></view>
39 39 <button class="link-image" @tap="handleWenxinAuthorization">
40 40 <image class="image" src="/static/weixin.png" mode="aspectFill"></image>
... ... @@ -91,6 +91,11 @@
91 91 }
92 92 },
93 93 onShow() {
  94 + this.$nextTick(()=>{
  95 + uni.setNavigationBarTitle({
  96 + title:this.$t('menu.login')
  97 + })
  98 + })
94 99 uni.setStorageSync('getConfiguration', {
95 100 isConfiguration: false
96 101 });
... ... @@ -161,7 +166,7 @@
161 166 useReLaunch("/pages/index/index")
162 167 } else {
163 168 // 不需要绑定,直接第三方登录使用
164   - this.saveLoginInfo(res, true, null, "第三方账号登录成功")
  169 + this.saveLoginInfo(res, true, null, this.$t('login.thirdAccountLoginSuccess'))
165 170 }
166 171 }
167 172 },
... ... @@ -187,14 +192,13 @@
187 192 },
188 193 async onSubmitFunc() {
189 194 const validateValue = Object.values(this.loginForm)
190   - if (!validateValue[0]) return uni.$u.toast("请输入登录账号~");
191   - if (!validateValue[1]) return uni.$u.toast("请输入登录密码~");
192   - if (!loginPasswordReg.test(validateValue[1])) return useShowModal(
193   - "密码格式不正确(至少一个大写英文字母、至少一个小写英文字母、至少一位数字、至少一个特殊字符、最少八个字符)~", )
  195 + if (!validateValue[0]) return uni.$u.toast(this.$t('login.pleaseEnterAccount'));
  196 + if (!validateValue[1]) return uni.$u.toast($t('login.pleaseEnterPassword'));
  197 + if (!loginPasswordReg.test(validateValue[1])) return useShowModal(this.$t('login.passwordRule'))
194 198 const res = await api.loginApi.postLoginApi(this.loginForm)
195 199 if (res) {
196 200 // 储存登录信息
197   - this.saveLoginInfo(res, false, false, "登录成功~")
  201 + this.saveLoginInfo(res, false, false, this.$t('login.loginSuccess'))
198 202 }
199 203 },
200 204 openCodeFunc() {
... ...
... ... @@ -26,6 +26,9 @@ Vue.use(f_show_modal)
26 26 import uView from '@/uni_modules/uview-ui'
27 27 Vue.use(uView)
28 28
  29 +//i18n
  30 +import i18n from '@/config/i18n.js'
  31 +
29 32 // 公共组件注册
30 33 import publicModule from "@/components/common/public-module.vue";
31 34 Vue.component("public-module", publicModule);
... ... @@ -37,6 +40,7 @@ App.mpType = 'app'
37 40
38 41 const app = new Vue({
39 42 store,
  43 + i18n,
40 44 ...App
41 45 })
42 46
... ...
... ... @@ -105,7 +105,7 @@
105 105 },
106 106 "quickapp" : {},
107 107 "mp-weixin" : {
108   - "appid" : "wx3a36e5189b607150",
  108 + "appid" : "wx99c411dc3c5571ef",
109 109 "setting" : {
110 110 "urlCheck" : false,
111 111 "minified" : true,
... ...
  1 +{
  2 + "name": "thingskit-app",
  3 + "version": "1.0.0",
  4 + "lockfileVersion": 3,
  5 + "requires": true,
  6 + "packages": {
  7 + "": {
  8 + "name": "thingskit-app",
  9 + "version": "1.0.0",
  10 + "license": "ISC",
  11 + "dependencies": {
  12 + "moment": "^2.29.2",
  13 + "vue-i18n": "^9.1.9"
  14 + }
  15 + },
  16 + "node_modules/@babel/helper-string-parser": {
  17 + "version": "7.25.7",
  18 + "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz",
  19 + "integrity": "sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==",
  20 + "peer": true,
  21 + "engines": {
  22 + "node": ">=6.9.0"
  23 + }
  24 + },
  25 + "node_modules/@babel/helper-validator-identifier": {
  26 + "version": "7.25.7",
  27 + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz",
  28 + "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==",
  29 + "peer": true,
  30 + "engines": {
  31 + "node": ">=6.9.0"
  32 + }
  33 + },
  34 + "node_modules/@babel/parser": {
  35 + "version": "7.25.8",
  36 + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.25.8.tgz",
  37 + "integrity": "sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ==",
  38 + "peer": true,
  39 + "dependencies": {
  40 + "@babel/types": "^7.25.8"
  41 + },
  42 + "bin": {
  43 + "parser": "bin/babel-parser.js"
  44 + },
  45 + "engines": {
  46 + "node": ">=6.0.0"
  47 + }
  48 + },
  49 + "node_modules/@babel/types": {
  50 + "version": "7.25.8",
  51 + "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.25.8.tgz",
  52 + "integrity": "sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==",
  53 + "peer": true,
  54 + "dependencies": {
  55 + "@babel/helper-string-parser": "^7.25.7",
  56 + "@babel/helper-validator-identifier": "^7.25.7",
  57 + "to-fast-properties": "^2.0.0"
  58 + },
  59 + "engines": {
  60 + "node": ">=6.9.0"
  61 + }
  62 + },
  63 + "node_modules/@intlify/core-base": {
  64 + "version": "9.1.9",
  65 + "resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-9.1.9.tgz",
  66 + "integrity": "sha512-x5T0p/Ja0S8hs5xs+ImKyYckVkL4CzcEXykVYYV6rcbXxJTe2o58IquSqX9bdncVKbRZP7GlBU1EcRaQEEJ+vw==",
  67 + "dependencies": {
  68 + "@intlify/devtools-if": "9.1.9",
  69 + "@intlify/message-compiler": "9.1.9",
  70 + "@intlify/message-resolver": "9.1.9",
  71 + "@intlify/runtime": "9.1.9",
  72 + "@intlify/shared": "9.1.9",
  73 + "@intlify/vue-devtools": "9.1.9"
  74 + },
  75 + "engines": {
  76 + "node": ">= 10"
  77 + }
  78 + },
  79 + "node_modules/@intlify/devtools-if": {
  80 + "version": "9.1.9",
  81 + "resolved": "https://registry.npmmirror.com/@intlify/devtools-if/-/devtools-if-9.1.9.tgz",
  82 + "integrity": "sha512-oKSMKjttG3Ut/1UGEZjSdghuP3fwA15zpDPcjkf/1FjlOIm6uIBGMNS5jXzsZy593u+P/YcnrZD6cD3IVFz9vQ==",
  83 + "dependencies": {
  84 + "@intlify/shared": "9.1.9"
  85 + },
  86 + "engines": {
  87 + "node": ">= 10"
  88 + }
  89 + },
  90 + "node_modules/@intlify/message-compiler": {
  91 + "version": "9.1.9",
  92 + "resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-9.1.9.tgz",
  93 + "integrity": "sha512-6YgCMF46Xd0IH2hMRLCssZI3gFG4aywidoWQ3QP4RGYQXQYYfFC54DxhSgfIPpVoPLQ+4AD29eoYmhiHZ+qLFQ==",
  94 + "dependencies": {
  95 + "@intlify/message-resolver": "9.1.9",
  96 + "@intlify/shared": "9.1.9",
  97 + "source-map": "0.6.1"
  98 + },
  99 + "engines": {
  100 + "node": ">= 10"
  101 + }
  102 + },
  103 + "node_modules/@intlify/message-resolver": {
  104 + "version": "9.1.9",
  105 + "resolved": "https://registry.npmmirror.com/@intlify/message-resolver/-/message-resolver-9.1.9.tgz",
  106 + "integrity": "sha512-Lx/DBpigeK0sz2BBbzv5mu9/dAlt98HxwbG7xLawC3O2xMF9MNWU5FtOziwYG6TDIjNq0O/3ZbOJAxwITIWXEA==",
  107 + "engines": {
  108 + "node": ">= 10"
  109 + }
  110 + },
  111 + "node_modules/@intlify/runtime": {
  112 + "version": "9.1.9",
  113 + "resolved": "https://registry.npmmirror.com/@intlify/runtime/-/runtime-9.1.9.tgz",
  114 + "integrity": "sha512-XgPw8+UlHCiie3fI41HPVa/VDJb3/aSH7bLhY1hJvlvNV713PFtb4p4Jo+rlE0gAoMsMCGcsiT982fImolSltg==",
  115 + "dependencies": {
  116 + "@intlify/message-compiler": "9.1.9",
  117 + "@intlify/message-resolver": "9.1.9",
  118 + "@intlify/shared": "9.1.9"
  119 + },
  120 + "engines": {
  121 + "node": ">= 10"
  122 + }
  123 + },
  124 + "node_modules/@intlify/shared": {
  125 + "version": "9.1.9",
  126 + "resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-9.1.9.tgz",
  127 + "integrity": "sha512-xKGM1d0EAxdDFCWedcYXOm6V5Pfw/TMudd6/qCdEb4tv0hk9EKeg7lwQF1azE0dP2phvx0yXxrt7UQK+IZjNdw==",
  128 + "engines": {
  129 + "node": ">= 10"
  130 + }
  131 + },
  132 + "node_modules/@intlify/vue-devtools": {
  133 + "version": "9.1.9",
  134 + "resolved": "https://registry.npmmirror.com/@intlify/vue-devtools/-/vue-devtools-9.1.9.tgz",
  135 + "integrity": "sha512-YPehH9uL4vZcGXky4Ev5qQIITnHKIvsD2GKGXgqf+05osMUI6WSEQHaN9USRa318Rs8RyyPCiDfmA0hRu3k7og==",
  136 + "dependencies": {
  137 + "@intlify/message-resolver": "9.1.9",
  138 + "@intlify/runtime": "9.1.9",
  139 + "@intlify/shared": "9.1.9"
  140 + },
  141 + "engines": {
  142 + "node": ">= 10"
  143 + }
  144 + },
  145 + "node_modules/@jridgewell/sourcemap-codec": {
  146 + "version": "1.5.0",
  147 + "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
  148 + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==",
  149 + "peer": true
  150 + },
  151 + "node_modules/@vue/compiler-core": {
  152 + "version": "3.5.11",
  153 + "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.5.11.tgz",
  154 + "integrity": "sha512-PwAdxs7/9Hc3ieBO12tXzmTD+Ln4qhT/56S+8DvrrZ4kLDn4Z/AMUr8tXJD0axiJBS0RKIoNaR0yMuQB9v9Udg==",
  155 + "peer": true,
  156 + "dependencies": {
  157 + "@babel/parser": "^7.25.3",
  158 + "@vue/shared": "3.5.11",
  159 + "entities": "^4.5.0",
  160 + "estree-walker": "^2.0.2",
  161 + "source-map-js": "^1.2.0"
  162 + }
  163 + },
  164 + "node_modules/@vue/compiler-dom": {
  165 + "version": "3.5.11",
  166 + "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.5.11.tgz",
  167 + "integrity": "sha512-pyGf8zdbDDRkBrEzf8p7BQlMKNNF5Fk/Cf/fQ6PiUz9at4OaUfyXW0dGJTo2Vl1f5U9jSLCNf0EZJEogLXoeew==",
  168 + "peer": true,
  169 + "dependencies": {
  170 + "@vue/compiler-core": "3.5.11",
  171 + "@vue/shared": "3.5.11"
  172 + }
  173 + },
  174 + "node_modules/@vue/compiler-sfc": {
  175 + "version": "3.5.11",
  176 + "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.5.11.tgz",
  177 + "integrity": "sha512-gsbBtT4N9ANXXepprle+X9YLg2htQk1sqH/qGJ/EApl+dgpUBdTv3yP7YlR535uHZY3n6XaR0/bKo0BgwwDniw==",
  178 + "peer": true,
  179 + "dependencies": {
  180 + "@babel/parser": "^7.25.3",
  181 + "@vue/compiler-core": "3.5.11",
  182 + "@vue/compiler-dom": "3.5.11",
  183 + "@vue/compiler-ssr": "3.5.11",
  184 + "@vue/shared": "3.5.11",
  185 + "estree-walker": "^2.0.2",
  186 + "magic-string": "^0.30.11",
  187 + "postcss": "^8.4.47",
  188 + "source-map-js": "^1.2.0"
  189 + }
  190 + },
  191 + "node_modules/@vue/compiler-ssr": {
  192 + "version": "3.5.11",
  193 + "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.5.11.tgz",
  194 + "integrity": "sha512-P4+GPjOuC2aFTk1Z4WANvEhyOykcvEd5bIj2KVNGKGfM745LaXGr++5njpdBTzVz5pZifdlR1kpYSJJpIlSePA==",
  195 + "peer": true,
  196 + "dependencies": {
  197 + "@vue/compiler-dom": "3.5.11",
  198 + "@vue/shared": "3.5.11"
  199 + }
  200 + },
  201 + "node_modules/@vue/devtools-api": {
  202 + "version": "6.6.4",
  203 + "resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz",
  204 + "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g=="
  205 + },
  206 + "node_modules/@vue/reactivity": {
  207 + "version": "3.5.11",
  208 + "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.5.11.tgz",
  209 + "integrity": "sha512-Nqo5VZEn8MJWlCce8XoyVqHZbd5P2NH+yuAaFzuNSR96I+y1cnuUiq7xfSG+kyvLSiWmaHTKP1r3OZY4mMD50w==",
  210 + "peer": true,
  211 + "dependencies": {
  212 + "@vue/shared": "3.5.11"
  213 + }
  214 + },
  215 + "node_modules/@vue/runtime-core": {
  216 + "version": "3.5.11",
  217 + "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.5.11.tgz",
  218 + "integrity": "sha512-7PsxFGqwfDhfhh0OcDWBG1DaIQIVOLgkwA5q6MtkPiDFjp5gohVnJEahSktwSFLq7R5PtxDKy6WKURVN1UDbzA==",
  219 + "peer": true,
  220 + "dependencies": {
  221 + "@vue/reactivity": "3.5.11",
  222 + "@vue/shared": "3.5.11"
  223 + }
  224 + },
  225 + "node_modules/@vue/runtime-dom": {
  226 + "version": "3.5.11",
  227 + "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.5.11.tgz",
  228 + "integrity": "sha512-GNghjecT6IrGf0UhuYmpgaOlN7kxzQBhxWEn08c/SQDxv1yy4IXI1bn81JgEpQ4IXjRxWtPyI8x0/7TF5rPfYQ==",
  229 + "peer": true,
  230 + "dependencies": {
  231 + "@vue/reactivity": "3.5.11",
  232 + "@vue/runtime-core": "3.5.11",
  233 + "@vue/shared": "3.5.11",
  234 + "csstype": "^3.1.3"
  235 + }
  236 + },
  237 + "node_modules/@vue/server-renderer": {
  238 + "version": "3.5.11",
  239 + "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.5.11.tgz",
  240 + "integrity": "sha512-cVOwYBxR7Wb1B1FoxYvtjJD8X/9E5nlH4VSkJy2uMA1MzYNdzAAB//l8nrmN9py/4aP+3NjWukf9PZ3TeWULaA==",
  241 + "peer": true,
  242 + "dependencies": {
  243 + "@vue/compiler-ssr": "3.5.11",
  244 + "@vue/shared": "3.5.11"
  245 + },
  246 + "peerDependencies": {
  247 + "vue": "3.5.11"
  248 + }
  249 + },
  250 + "node_modules/@vue/shared": {
  251 + "version": "3.5.11",
  252 + "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.5.11.tgz",
  253 + "integrity": "sha512-W8GgysJVnFo81FthhzurdRAWP/byq3q2qIw70e0JWblzVhjgOMiC2GyovXrZTFQJnFVryYaKGP3Tc9vYzYm6PQ==",
  254 + "peer": true
  255 + },
  256 + "node_modules/csstype": {
  257 + "version": "3.1.3",
  258 + "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz",
  259 + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
  260 + "peer": true
  261 + },
  262 + "node_modules/entities": {
  263 + "version": "4.5.0",
  264 + "resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz",
  265 + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
  266 + "peer": true,
  267 + "engines": {
  268 + "node": ">=0.12"
  269 + },
  270 + "funding": {
  271 + "url": "https://github.com/fb55/entities?sponsor=1"
  272 + }
  273 + },
  274 + "node_modules/estree-walker": {
  275 + "version": "2.0.2",
  276 + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz",
  277 + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
  278 + "peer": true
  279 + },
  280 + "node_modules/magic-string": {
  281 + "version": "0.30.11",
  282 + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.11.tgz",
  283 + "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==",
  284 + "peer": true,
  285 + "dependencies": {
  286 + "@jridgewell/sourcemap-codec": "^1.5.0"
  287 + }
  288 + },
  289 + "node_modules/moment": {
  290 + "version": "2.30.1",
  291 + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz",
  292 + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==",
  293 + "engines": {
  294 + "node": "*"
  295 + }
  296 + },
  297 + "node_modules/nanoid": {
  298 + "version": "3.3.7",
  299 + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.7.tgz",
  300 + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
  301 + "funding": [
  302 + {
  303 + "type": "github",
  304 + "url": "https://github.com/sponsors/ai"
  305 + }
  306 + ],
  307 + "peer": true,
  308 + "bin": {
  309 + "nanoid": "bin/nanoid.cjs"
  310 + },
  311 + "engines": {
  312 + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
  313 + }
  314 + },
  315 + "node_modules/picocolors": {
  316 + "version": "1.1.0",
  317 + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.0.tgz",
  318 + "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==",
  319 + "peer": true
  320 + },
  321 + "node_modules/postcss": {
  322 + "version": "8.4.47",
  323 + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.47.tgz",
  324 + "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==",
  325 + "funding": [
  326 + {
  327 + "type": "opencollective",
  328 + "url": "https://opencollective.com/postcss/"
  329 + },
  330 + {
  331 + "type": "tidelift",
  332 + "url": "https://tidelift.com/funding/github/npm/postcss"
  333 + },
  334 + {
  335 + "type": "github",
  336 + "url": "https://github.com/sponsors/ai"
  337 + }
  338 + ],
  339 + "peer": true,
  340 + "dependencies": {
  341 + "nanoid": "^3.3.7",
  342 + "picocolors": "^1.1.0",
  343 + "source-map-js": "^1.2.1"
  344 + },
  345 + "engines": {
  346 + "node": "^10 || ^12 || >=14"
  347 + }
  348 + },
  349 + "node_modules/source-map": {
  350 + "version": "0.6.1",
  351 + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz",
  352 + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
  353 + "engines": {
  354 + "node": ">=0.10.0"
  355 + }
  356 + },
  357 + "node_modules/source-map-js": {
  358 + "version": "1.2.1",
  359 + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz",
  360 + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
  361 + "peer": true,
  362 + "engines": {
  363 + "node": ">=0.10.0"
  364 + }
  365 + },
  366 + "node_modules/to-fast-properties": {
  367 + "version": "2.0.0",
  368 + "resolved": "https://registry.npmmirror.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
  369 + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==",
  370 + "peer": true,
  371 + "engines": {
  372 + "node": ">=4"
  373 + }
  374 + },
  375 + "node_modules/vue": {
  376 + "version": "3.5.11",
  377 + "resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.11.tgz",
  378 + "integrity": "sha512-/8Wurrd9J3lb72FTQS7gRMNQD4nztTtKPmuDuPuhqXmmpD6+skVjAeahNpVzsuky6Sy9gy7wn8UadqPtt9SQIg==",
  379 + "peer": true,
  380 + "dependencies": {
  381 + "@vue/compiler-dom": "3.5.11",
  382 + "@vue/compiler-sfc": "3.5.11",
  383 + "@vue/runtime-dom": "3.5.11",
  384 + "@vue/server-renderer": "3.5.11",
  385 + "@vue/shared": "3.5.11"
  386 + },
  387 + "peerDependencies": {
  388 + "typescript": "*"
  389 + },
  390 + "peerDependenciesMeta": {
  391 + "typescript": {
  392 + "optional": true
  393 + }
  394 + }
  395 + },
  396 + "node_modules/vue-i18n": {
  397 + "version": "9.1.9",
  398 + "resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.1.9.tgz",
  399 + "integrity": "sha512-JeRdNVxS2OGp1E+pye5XB6+M6BBkHwAv9C80Q7+kzoMdUDGRna06tjC0vCB/jDX9aWrl5swxOMFcyAr7or8XTA==",
  400 + "dependencies": {
  401 + "@intlify/core-base": "9.1.9",
  402 + "@intlify/shared": "9.1.9",
  403 + "@intlify/vue-devtools": "9.1.9",
  404 + "@vue/devtools-api": "^6.0.0-beta.7"
  405 + },
  406 + "engines": {
  407 + "node": ">= 10"
  408 + },
  409 + "peerDependencies": {
  410 + "vue": "^3.0.0"
  411 + }
  412 + }
  413 + }
  414 +}
... ...
... ... @@ -12,6 +12,7 @@
12 12 "author": "",
13 13 "license": "ISC",
14 14 "dependencies": {
15   - "moment": "^2.29.2"
  15 + "moment": "^2.29.2",
  16 + "vue-i18n": "^9.1.9"
16 17 }
17 18 }
... ...
... ... @@ -15,63 +15,69 @@
15 15 {
16 16 "path": "pages/index/index",
17 17 "style": {
18   - "navigationBarTitleText": "首页",
  18 + "navigationBarTitleText": "",
19 19 "enablePullDownRefresh": true
20 20 }
21 21 },
22 22 {
23 23 "path": "pages/device/device",
24 24 "style": {
25   - "navigationBarTitleText": "设备"
  25 + "navigationBarTitleText": ""
26 26 }
27 27 },
28 28 {
29 29 "path": "pages/alarm/alarm",
30 30 "style": {
31   - "navigationBarTitleText": "告警"
  31 + "navigationBarTitleText": ""
32 32 }
33 33 },
34 34 {
35 35 "path": "pages/personal/personal",
36 36 "style": {
37   - "navigationBarTitleText": "个人中心",
  37 + "navigationBarTitleText": "",
38 38 "disableScroll": true
39 39 }
40 40 },
41 41 {
42 42 "path": "pages/index/components/camera/camera",
43 43 "style": {
44   - "navigationBarTitleText": "查看摄像头"
  44 + "navigationBarTitleText": ""
45 45 }
46 46 },
47 47 {
48 48 "path": "pages/index/components/configuration/configuration",
49 49 "style": {
50   - "navigationBarTitleText": "查看组态"
  50 + "navigationBarTitleText": ""
51 51 }
52 52 },
53 53 {
54 54 "path": "pages/index/components/configuration/configuration-detail",
55 55 "style": {
56   - "navigationBarTitleText": "组态详情"
  56 + "navigationBarTitleText": ""
57 57 }
58 58 },
59 59 {
60 60 "path": "pages/organization/organization",
61 61 "style": {
62   - "navigationBarTitleText": "组织筛选"
  62 + "navigationBarTitleText": ""
63 63 }
64 64 },
65 65 {
66 66 "path": "pages/index/components/visualBoard/index",
67 67 "style": {
68   - "navigationBarTitleText": "查看看板"
  68 + "navigationBarTitleText": ""
69 69 }
70 70 },
71 71 {
72 72 "path": "pages/index/components/visualBoard/detail",
73 73 "style": {
74   - "navigationBarTitleText": "看板详情"
  74 + "navigationBarTitleText": ""
  75 + }
  76 + },
  77 + {
  78 + "path": "pages/personal/components/switchLocales",
  79 + "style": {
  80 + "navigationBarTitleText": ""
75 81 }
76 82 }
77 83 ],
... ... @@ -80,7 +86,7 @@
80 86 "pages": [{
81 87 "path": "alarm-detail/alarm-detail",
82 88 "style": {
83   - "navigationBarTitleText": "告警详情"
  89 + "navigationBarTitleText": ""
84 90 }
85 91 }]
86 92 },
... ... @@ -89,19 +95,19 @@
89 95 "pages": [{
90 96 "path": "device-detail/device-detail",
91 97 "style": {
92   - "navigationBarTitleText": "设备详情"
  98 + "navigationBarTitleText": ""
93 99 }
94 100 },
95 101 {
96 102 "path": "device-detail/components/command-detail",
97 103 "style": {
98   - "navigationBarTitleText": "命令详情"
  104 + "navigationBarTitleText": ""
99 105 }
100 106 },
101 107 {
102 108 "path": "device-detail/device-position",
103 109 "style": {
104   - "navigationBarTitleText": "设备地理位置"
  110 + "navigationBarTitleText": ""
105 111 },
106 112 "permission": {
107 113 "scope.userLocation": {
... ... @@ -119,13 +125,13 @@
119 125 "pages": [{
120 126 "path": "sys-notify/system-notify",
121 127 "style": {
122   - "navigationBarTitleText": "系统通知"
  128 + "navigationBarTitleText": ""
123 129 }
124 130 },
125 131 {
126 132 "path": "sys-notify/notify-detail",
127 133 "style": {
128   - "navigationBarTitleText": "通知详情"
  134 + "navigationBarTitleText": ""
129 135 }
130 136 }
131 137 ]
... ... @@ -135,7 +141,7 @@
135 141 "pages": [{
136 142 "path": "feedback/feedback",
137 143 "style": {
138   - "navigationBarTitleText": "意见反馈"
  144 + "navigationBarTitleText": ""
139 145 }
140 146 }]
141 147 },
... ... @@ -144,25 +150,25 @@
144 150 "pages": [{
145 151 "path": "public/login",
146 152 "style": {
147   - "navigationBarTitleText": "登录"
  153 + "navigationBarTitleText": ""
148 154 }
149 155 },
150 156 {
151 157 "path": "other/set",
152 158 "style": {
153   - "navigationBarTitleText": "个人资料"
  159 + "navigationBarTitleText": ""
154 160 }
155 161 },
156 162 {
157 163 "path": "other/code",
158 164 "style": {
159   - "navigationBarTitleText": "手机验证码登录"
  165 + "navigationBarTitleText": ""
160 166 }
161 167 },
162 168 {
163 169 "path": "other/find-password",
164 170 "style": {
165   - "navigationBarTitleText": "忘记密码"
  171 + "navigationBarTitleText": ""
166 172 }
167 173 }
168 174 ]
... ...
... ... @@ -4,9 +4,9 @@
4 4 <public-module></public-module>
5 5 <!-- 告警头部 -->
6 6 <header-search @openOrg="openOrg" @openSearchDialog="openSearchDialog" :total="alarmTotal"
7   - :totalText="totalText">
  7 + :totalText="$t(totalText)">
8 8 <!-- 不能写在封装组件里传placeholder,mp-wenxin端编译要报错 -->
9   - <u--input prefixIcon="search" placeholder="请输入告警设备" shape="circle" @change="inputChanged">
  9 + <u--input prefixIcon="search" :placeholder="$t('alarm.pleaseEnterDevice')" shape="circle" @change="inputChanged">
10 10 </u--input>
11 11 </header-search>
12 12 <!-- 告警分页 -->
... ... @@ -44,7 +44,7 @@ import {mapActions } from 'vuex'
44 44 },
45 45 data() {
46 46 return {
47   - totalText: '告警数:',
  47 + totalText: 'alarm.alarmNum',
48 48 page: {
49 49 num: 0,
50 50 size: 10
... ... @@ -67,6 +67,11 @@ import {mapActions } from 'vuex'
67 67 };
68 68 },
69 69 onShow() {
  70 + this.$nextTick(()=>{
  71 + uni.setNavigationBarTitle({
  72 + title:this.$t('menu.alarm')
  73 + })
  74 + })
70 75 if (getApp().getBindNot()) {
71 76 return
72 77 }
... ... @@ -218,7 +223,7 @@ import {mapActions } from 'vuex'
218 223 },
219 224 openSearchDialog() {
220 225 if (getApp().getBindNot()) {
221   - uni.$u.toast('请进行账号绑定')
  226 + uni.$u.toast(this.$t('common.pleaseBindAccount'))
222 227 return
223 228 }
224 229 this.show = true;
... ... @@ -228,7 +233,7 @@ import {mapActions } from 'vuex'
228 233 },
229 234 openOrg() {
230 235 if (getApp().getBindNot()) {
231   - uni.$u.toast('请进行账号绑定')
  236 + uni.$u.toast(this.$t('common.pleaseBindAccount'))
232 237 return
233 238 }
234 239 useNavigateTo('/pages/organization/organization')
... ...
... ... @@ -3,20 +3,20 @@
3 3 <view @click="$emit('openAlertDetail',item)" class="list-item" v-for="(item, index) in list" :key="index">
4 4 <view class="u-flex item">
5 5 <view class="item-text text-clip">
6   - <text class="text-bold">{{ item.deviceAlias || item.deviceName || '暂无数据' }}</text>
  6 + <text class="text-bold">{{ item.deviceAlias || item.deviceName || $t('common.noData') }}</text>
7 7 </view>
8 8 <view class="item-text text-clip">
9   - <text class="text-muted">{{ item.details == null ? '暂无数据' : getAttrText(item.details) }}</text>
  9 + <text class="text-muted">{{ item.details == null ? $t('common.noData') : getAttrText(item.details) }}</text>
10 10 </view>
11 11 <view class="item-text text-clip">
12   - <text class="text-muted">{{ item.details == null ? '暂无数据' : getConditionText(item.details) }}</text>
  12 + <text class="text-muted">{{ item.details == null ? $t('common.noData') : getConditionText(item.details) }}</text>
13 13 </view>
14 14 <view class="item-text text-clip">
15   - <text class="text-muted">{{ item.details == null ? '暂无数据' : getValuesText(item.details) }}</text>
  15 + <text class="text-muted">{{ item.details == null ? $t('common.noData') : getValuesText(item.details) }}</text>
16 16 </view>
17 17 <view class="item-text">
18 18 <text class="text-muted">
19   - 告警状态:{{item.status | setAlarmStatus(alarmStatus)}}
  19 + {{$t('device.alarmStatus')}} {{ setAlarmStatus(item.status,alarmStatus)}}
20 20 </text>
21 21 </view>
22 22 <view class="item-text">
... ... @@ -28,7 +28,7 @@
28 28 <image class="right-image" :src="bindImageUrl(item.severity)"></image>
29 29 <view class="right-text">
30 30 <text class="text-no-color" :style="[setAlarmSeverityColor(item.severity,alarmSeverity)]">
31   - {{item.severity | setAlarmSeverity(alarmSeverity)}}
  31 + {{ setAlarmSeverity(item.severity,alarmSeverity)}}
32 32 </text>
33 33 </view>
34 34 </view>
... ... @@ -57,15 +57,14 @@
57 57 alarmStatus
58 58 }
59 59 },
60   - filters: {
  60 + methods: {
  61 +
61 62 setAlarmStatus(value, list) {
62   - return list.find(item => item.value === value).label
  63 + return this.$t(list.find(item => item.value === value).label)
63 64 },
64 65 setAlarmSeverity(value, list) {
65   - return list.find(item => item.value === value).label
66   - }
67   - },
68   - methods: {
  66 + return this.$t(list.find(item => item.value === value).label)
  67 + },
69 68 setAlarmSeverityColor(value, list) {
70 69 return {
71 70 color: list.find(item => item.value === value).color
... ... @@ -91,11 +90,11 @@
91 90 const items = details[curr]?.triggerData
92 91 if(items?.key && items?.logicValue && items.realValue){
93 92 if(type==0){
94   - acc.push(`触发属性:${items.key ||'暂无数据'}`)
  93 + acc.push(`${this.$t('device.triggerAttribute')}:${items.key || this.$t('common.noData')}`)
95 94 }else if (type ==1){
96   - acc.push(`触发条件:${findLogin(items)+items.logicValue || '暂无数据'}`)
  95 + acc.push(`${this.$t('device.triggerCondition')}:${findLogin(items)+items.logicValue || this.$t('common.noData')}`)
97 96 }else if(type==2){
98   - acc.push(`触发值:${items?.realValue || '暂无数据'}`)
  97 + acc.push(`${this.$t('device.triggerValue')}:${items?.realValue || this.$t('common.noData')}`)
99 98 }
100 99 }
101 100 return acc
... ...
1 1 <template>
2   - <u-popup @close="$emit('close')" closeable bgColor="transparent" :overlay="true" :show="show" mode="bottom">
  2 + <u-popup @close="$emit('close')" closeable bgColor="transparent" :overlay="true" :show="show" mode="bottom">
3 3 <view class="popup-page">
4   - <view class="popup-text"><text class="text">告警筛选</text></view>
  4 + <view class="popup-text"><text class="text">{{$t('device.alarmFiltering')}}</text></view>
5 5 <view class="popup-alarm-page u-flex">
6 6 <view>
7   - <query-item ref="queryItemAlarmStatusRef" :leftText="leftAlarmStatusText" :queryStatus="alertStatus"
  7 + <query-item ref="queryItemAlarmStatusRef" :leftText="$t(leftAlarmStatusText)" :queryStatus="alertStatus.map(item=>({...item,name:$t(item.name)}))"
8 8 @currentClick="getAlarmStatus"></query-item>
9   - <query-item ref="queryDeviceTypeStatusRef" :leftText="leftDeviceTypeText" :queryStatus="deviceType"
  9 + <query-item ref="queryDeviceTypeStatusRef" :leftText="$t(leftDeviceTypeText)" :queryStatus="deviceType.map(item=>({...item,name:$t(item.name)}))"
10 10 @currentClick="getDeviceType"></query-item>
11   - <query-item ref="queryItemAlarmLevelRef" :leftText="leftAlarmLevelText" :queryStatus="alertLevel"
  11 + <query-item ref="queryItemAlarmLevelRef" :leftText="$t(leftAlarmLevelText)" :queryStatus="alertLevel.map(item=>({...item,name:$t(item.name)}))"
12 12 @currentClick="getAlarmLevel"></query-item>
13   - <query-item ref="queryItemSelectTimeRef" :leftText="leftSelectTimeText" :queryStatus="timeArea"
  13 + <query-item ref="queryItemSelectTimeRef" :leftText="$t(leftSelectTimeText)" :queryStatus="timeArea.map(item=>({...item,name:$t(item.name)}))"
14 14 @currentClick="getSelectTime"></query-item>
15 15 <view class="select-date">
16   - <view class="home-text-muted">选择日期</view>
  16 + <view class="home-text-muted">{{ $t('device.selectDate') }}</view>
17 17 <view class="datetime-picker">
18 18 <uni-datetime-picker return-type="timestamp" v-model="range" type="datetimerange"
19   - rangeSeparator="至" />
  19 + :rangeSeparator="$t('common.toText')" />
20 20 </view>
21 21 </view>
22 22 <view class="h-30"></view>
23 23 <view class="u-flex bottom-button">
24 24 <view class="button-item">
25   - <u-button @click="resetQuery" type="info" shape="circle" text="重置">
  25 + <u-button @click="resetQuery" type="info" shape="circle" :text="$t('common.resetting')">
26 26 </u-button>
27 27 </view>
28 28 <view class="button-item" style="margin-left: 46rpx">
29   - <u-button @click="confirmQuery" type="primary" shape="circle" text="确认">
  29 + <u-button @click="confirmQuery" type="primary" shape="circle" :text="$t('common.confirm')">
30 30 </u-button>
31 31 </view>
32 32 </view>
... ... @@ -56,10 +56,10 @@
56 56 data() {
57 57 return {
58 58 totalText: '告警数:',
59   - leftAlarmStatusText: '告警状态',
60   - leftDeviceTypeText: '设备类型',
61   - leftAlarmLevelText: '告警等级',
62   - leftSelectTimeText: '选择时间',
  59 + leftAlarmStatusText: 'device.alarmStatus',
  60 + leftDeviceTypeText: 'device.deviceType',
  61 + leftAlarmLevelText: 'device.alarmLevel',
  62 + leftSelectTimeText: 'device.selectTime',
63 63 range: [],
64 64 alertStatus,
65 65 deviceType,
... ... @@ -176,4 +176,4 @@
176 176 }
177 177 }
178 178 }
179   -</style>
\ No newline at end of file
  179 +</style>
... ...
... ... @@ -8,7 +8,7 @@
8 8 class="text">{{ item.name }}</text>
9 9 </view>
10 10 </view>
11   - <view style="height:180rpx"></view>
  11 + <!-- <view style="height:180rpx"></view> -->
12 12 </view>
13 13 </template>
14 14
... ... @@ -57,7 +57,7 @@
57 57 .popup-alarm-child {
58 58 margin-top: 15rpx;
59 59 width: 750rpx;
60   - height: 60rpx;
  60 + min-height: 60rpx;
61 61 flex-wrap: wrap;
62 62 margin-left: -10rpx;
63 63
... ... @@ -65,7 +65,8 @@
65 65 margin: 25rpx;
66 66 line-height: 50rpx;
67 67 text-align: center;
68   - width: 180rpx;
  68 + min-width: 168rpx;
  69 + padding: 0 12rpx;
69 70 height: 60rpx;
70 71 background-color: #f6f6f6;
71 72 border-radius: 32px;
... ... @@ -76,4 +77,4 @@
76 77 }
77 78 }
78 79 }
79   -</style>
\ No newline at end of file
  80 +</style>
... ...
1 1 const alertStatus = [{
2   - index: 0,
3   - name: '全部',
4   - value: '',
5   - bgColor: '#377DFF',
6   - textColor: '#377DFF'
7   - },
8   - {
9   - index: 1,
10   - name: '激活未确认',
11   - value: 'ACTIVE_UNACK',
12   - bgColor: '#F6F6F6',
13   - textColor: '#F6F6F6'
14   - },
15   - {
16   - index: 2,
17   - name: '激活已确认',
18   - value: 'ACTIVE_ACK',
19   - bgColor: '#F6F6F6',
20   - textColor: '#F6F6F6'
21   - },
22   - {
23   - index: 3,
24   - name: '清除未确认',
25   - value: 'CLEARED_UNACK',
26   - bgColor: '#F6F6F6',
27   - textColor: '#F6F6F6'
28   - },
29   - {
30   - index: 4,
31   - name: '清除已确认',
32   - value: 'CLEARED_ACK',
33   - bgColor: '#F6F6F6',
34   - textColor: '#F6F6F6'
35   - },
  2 + index: 0,
  3 + name: 'common.allText',
  4 + value: '',
  5 + bgColor: '#377DFF',
  6 + textColor: '#377DFF'
  7 +},
  8 +{
  9 + index: 1,
  10 + name: 'device.activationNotConfirmed',
  11 + value: 'ACTIVE_UNACK',
  12 + bgColor: '#F6F6F6',
  13 + textColor: '#F6F6F6'
  14 +},
  15 +{
  16 + index: 2,
  17 + name: 'device.activationConfirmed',
  18 + value: 'ACTIVE_ACK',
  19 + bgColor: '#F6F6F6',
  20 + textColor: '#F6F6F6'
  21 +},
  22 +{
  23 + index: 3,
  24 + name: 'device.clearUnconfirmed',
  25 + value: 'CLEARED_UNACK',
  26 + bgColor: '#F6F6F6',
  27 + textColor: '#F6F6F6'
  28 +},
  29 +{
  30 + index: 4,
  31 + name: 'device.clearConfirmed',
  32 + value: 'CLEARED_ACK',
  33 + bgColor: '#F6F6F6',
  34 + textColor: '#F6F6F6'
  35 +},
36 36 ]
37 37 const deviceType = [{
38   - index: 1,
39   - name: '全部',
40   - value: '',
41   - bgColor: '#377DFF',
42   - textColor: '#377DFF'
43   - },
44   - {
45   - index: 2,
46   - name: '网关设备',
47   - value: 'GATEWAY',
48   - bgColor: '#F6F6F6',
49   - textColor: '#F6F6F6'
50   - },
51   - {
52   - index: 3,
53   - name: '网关子设备',
54   - value: 'SENSOR',
55   - bgColor: '#F6F6F6',
56   - textColor: '#F6F6F6'
57   - },
58   - {
59   - index: 4,
60   - name: '直连设备',
61   - value: 'DIRECT_CONNECTION',
62   - bgColor: '#F6F6F6',
63   - textColor: '#F6F6F6'
64   - }
  38 + index: 1,
  39 + name: 'common.allText',
  40 + value: '',
  41 + bgColor: '#377DFF',
  42 + textColor: '#377DFF'
  43 +},
  44 +{
  45 + index: 2,
  46 + name: 'common.gatewayDevice',
  47 + value: 'GATEWAY',
  48 + bgColor: '#F6F6F6',
  49 + textColor: '#F6F6F6'
  50 +},
  51 +{
  52 + index: 3,
  53 + name: 'common.sensorDevice',
  54 + value: 'SENSOR',
  55 + bgColor: '#F6F6F6',
  56 + textColor: '#F6F6F6'
  57 +},
  58 +{
  59 + index: 4,
  60 + name: 'common.directlyDevice',
  61 + value: 'DIRECT_CONNECTION',
  62 + bgColor: '#F6F6F6',
  63 + textColor: '#F6F6F6'
  64 +}
65 65 ]
66 66 const alertLevel = [{
67   - index: 1,
68   - name: '全部',
69   - value: '',
70   - bgColor: '#377DFF',
71   - textColor: '#377DFF'
72   - },
73   - {
74   - index: 2,
75   - name: '紧急',
76   - value: 'CRITICAL',
77   - bgColor: '#F6F6F6',
78   - textColor: '#F6F6F6'
79   - },
80   - {
81   - index: 3,
82   - name: '重要',
83   - value: 'MAJOR',
84   - bgColor: '#F6F6F6',
85   - textColor: '#F6F6F6'
86   - },
87   - {
88   - index: 4,
89   - name: '次要',
90   - value: 'MINOR',
91   - bgColor: '#F6F6F6',
92   - textColor: '#F6F6F6'
93   - },
94   - {
95   - index: 5,
96   - name: '警告',
97   - value: 'WARNING',
98   - bgColor: '#F6F6F6',
99   - textColor: '#F6F6F6'
100   - },
101   - {
102   - index: 6,
103   - name: '不确定',
104   - value: 'INDETERMINATE',
105   - bgColor: '#F6F6F6',
106   - textColor: '#F6F6F6'
107   - }
  67 + index: 1,
  68 + name: 'common.allText',
  69 + value: '',
  70 + bgColor: '#377DFF',
  71 + textColor: '#377DFF'
  72 +},
  73 +{
  74 + index: 2,
  75 + name: 'device.urgent',
  76 + value: 'CRITICAL',
  77 + bgColor: '#F6F6F6',
  78 + textColor: '#F6F6F6'
  79 +},
  80 +{
  81 + index: 3,
  82 + name: 'device.important',
  83 + value: 'MAJOR',
  84 + bgColor: '#F6F6F6',
  85 + textColor: '#F6F6F6'
  86 +},
  87 +{
  88 + index: 4,
  89 + name: 'device.secondary',
  90 + value: 'MINOR',
  91 + bgColor: '#F6F6F6',
  92 + textColor: '#F6F6F6'
  93 +},
  94 +{
  95 + index: 5,
  96 + name: 'device.warning',
  97 + value: 'WARNING',
  98 + bgColor: '#F6F6F6',
  99 + textColor: '#F6F6F6'
  100 +},
  101 +{
  102 + index: 6,
  103 + name: 'device.uncertain',
  104 + value: 'INDETERMINATE',
  105 + bgColor: '#F6F6F6',
  106 + textColor: '#F6F6F6'
  107 +}
108 108 ]
109 109
110 110 const timeArea = [{
111   - index: 1,
112   - name: '全部',
113   - value: 0,
114   - bgColor: '#F6F6F6',
115   - textColor: '#F6F6F6'
116   - },
117   - {
118   - index: 2,
119   - name: '30分钟',
120   - value: 30,
121   - bgColor: '#F6F6F6',
122   - textColor: '#F6F6F6'
123   - },
124   - {
125   - index: 3,
126   - name: '1小时',
127   - value: 60,
128   - bgColor: '#F6F6F6',
129   - textColor: '#F6F6F6'
130   - },
131   - {
132   - index: 4,
133   - name: '2小时',
134   - value: 120,
135   - bgColor: '#F6F6F6',
136   - textColor: '#F6F6F6'
137   - },
138   - {
139   - index: 5,
140   - name: '近一天',
141   - value: 1440,
142   - bgColor: '#F6F6F6',
143   - textColor: '#F6F6F6'
144   - }
  111 + index: 1,
  112 + name: 'common.allText',
  113 + value: 0,
  114 + bgColor: '#F6F6F6',
  115 + textColor: '#F6F6F6'
  116 +},
  117 +{
  118 + index: 2,
  119 + name: 'device.minutes30',
  120 + value: 30,
  121 + bgColor: '#F6F6F6',
  122 + textColor: '#F6F6F6'
  123 +},
  124 +{
  125 + index: 3,
  126 + name: 'device.hour1',
  127 + value: 60,
  128 + bgColor: '#F6F6F6',
  129 + textColor: '#F6F6F6'
  130 +},
  131 +{
  132 + index: 4,
  133 + name: 'device.hours2',
  134 + value: 120,
  135 + bgColor: '#F6F6F6',
  136 + textColor: '#F6F6F6'
  137 +},
  138 +{
  139 + index: 5,
  140 + name: 'device.pastDay',
  141 + value: 1440,
  142 + bgColor: '#F6F6F6',
  143 + textColor: '#F6F6F6'
  144 +}
145 145 ]
146 146
147 147 const alarmSeverity = [{
148   - label: '紧急',
149   - value: 'CRITICAL',
150   - color: '#DE4437',
151   - icon: '/static/danger.png',
152   - },
153   - {
154   - label: '重要',
155   - value: 'MAJOR',
156   - color: '#DE7337',
157   - icon: '/static/major.png',
158   - },
159   - {
160   - label: '次要',
161   - value: 'MINOR',
162   - color: '#FFC107',
163   - icon: '/static/secondary.png',
164   - },
165   - {
166   - label: '警告',
167   - value: 'WARNING',
168   - color: '#DE4437',
169   - icon: '/static/danger.png',
170   - },
171   - {
172   - label: '不确定',
173   - value: 'INDETERMINATE',
174   - color: '#00C9A7',
175   - icon: '/static/noshue.png',
176   - },
  148 + label: 'device.urgent',
  149 + value: 'CRITICAL',
  150 + color: '#DE4437',
  151 + icon: '/static/danger.png',
  152 +},
  153 +{
  154 + label: 'device.important',
  155 + value: 'MAJOR',
  156 + color: '#DE7337',
  157 + icon: '/static/major.png',
  158 +},
  159 +{
  160 + label: 'device.secondary',
  161 + value: 'MINOR',
  162 + color: '#FFC107',
  163 + icon: '/static/secondary.png',
  164 +},
  165 +{
  166 + label: 'device.warning',
  167 + value: 'WARNING',
  168 + color: '#DE4437',
  169 + icon: '/static/danger.png',
  170 +},
  171 +{
  172 + label: 'device.uncertain',
  173 + value: 'INDETERMINATE',
  174 + color: '#00C9A7',
  175 + icon: '/static/noshue.png',
  176 +},
177 177 ]
178 178
179 179 const alarmStatus = [{
180   - label: '清除未确认',
181   - value: 'CLEARED_UNACK'
182   - },
183   - {
184   - label: '激活未确认',
185   - value: 'ACTIVE_UNACK'
186   - },
187   - {
188   - label: '清除已确认',
189   - value: 'CLEARED_ACK'
190   - },
191   - {
192   - label: '激活已确认',
193   - value: 'ACTIVE_ACK'
194   - },
  180 + label: 'device.clearUnconfirmed',
  181 + value: 'CLEARED_UNACK'
  182 +},
  183 +{
  184 + label: 'device.activationNotConfirmed',
  185 + value: 'ACTIVE_UNACK'
  186 +},
  187 +{
  188 + label: 'device.clearConfirmed',
  189 + value: 'CLEARED_ACK'
  190 +},
  191 +{
  192 + label: 'device.activationConfirmed',
  193 + value: 'ACTIVE_ACK'
  194 +},
195 195 ]
196 196
197 197 const operationNumberOrDate = [{
198   - label: '等于',
199   - value: 'EQUAL',
200   - symbol: '='
201   - },
202   - {
203   - label: '不等于',
204   - value: 'NOT_EQUAL',
205   - symbol: '!='
206   - },
207   - {
208   - label: '小于',
209   - value: 'LESS',
210   - symbol: '<'
211   - },
212   - {
213   - label: '小于等于',
214   - value: 'LESS_OR_EQUAL',
215   - symbol: '<='
216   - },
217   - {
218   - label: '大于',
219   - value: 'GREATER',
220   - symbol: '>'
221   - },
222   - {
223   - label: '大于等于',
224   - value: 'GREATER_OR_EQUAL',
225   - symbol: '>='
226   - },
  198 + label: 'device.equal',
  199 + value: 'EQUAL',
  200 + symbol: '='
  201 +},
  202 +{
  203 + label: 'device.notEqual',
  204 + value: 'NOT_EQUAL',
  205 + symbol: '!='
  206 +},
  207 +{
  208 + label: 'device.less',
  209 + value: 'LESS',
  210 + symbol: '<'
  211 +},
  212 +{
  213 + label: 'device.lessOfEqual',
  214 + value: 'LESS_OR_EQUAL',
  215 + symbol: '<='
  216 +},
  217 +{
  218 + label: 'device.greater',
  219 + value: 'GREATER',
  220 + symbol: '>'
  221 +},
  222 +{
  223 + label: 'device.greaterOrEqual',
  224 + value: 'GREATER_OR_EQUAL',
  225 + symbol: '>='
  226 +},
227 227 ];
228 228
229 229 const operationString = [{
230   - label: '等于',
231   - value: 'EQUAL',
232   - symbol: '='
233   - },
234   - {
235   - label: '不等于',
236   - value: 'NOT_EQUAL',
237   - symbol: '!='
238   - },
239   - {
240   - label: '开始于',
241   - value: 'STARTS_WITH',
242   - symbol: '开始于'
243   - },
244   - {
245   - label: '结束于',
246   - value: 'ENDS_WITH',
247   - symbol: '结束于'
248   - },
249   - {
250   - label: '包含',
251   - value: 'CONTAINS',
252   - symbol: '包含'
253   - },
254   - {
255   - label: '不包含',
256   - value: 'NOT_CONTAINS',
257   - symbol: '不包含'
258   - },
  230 + label: 'device.equal',
  231 + value: 'EQUAL',
  232 + symbol: '='
  233 +},
  234 +{
  235 + label: 'device.notEqual',
  236 + value: 'NOT_EQUAL',
  237 + symbol: '!='
  238 +},
  239 +{
  240 + label: 'device.starting',
  241 + value: 'STARTS_WITH',
  242 + symbol: 'device.starting'
  243 +},
  244 +{
  245 + label: 'device.ending',
  246 + value: 'ENDS_WITH',
  247 + symbol: 'device.ending'
  248 +},
  249 +{
  250 + label: 'device.contain',
  251 + value: 'CONTAINS',
  252 + symbol: 'device.contain'
  253 +},
  254 +{
  255 + label: 'device.notIncluded',
  256 + value: 'NOT_CONTAINS',
  257 + symbol: 'device.notIncluded'
  258 +},
259 259 ];
260 260
261 261 const operationBoolean = [{
262   - label: '等于',
263   - value: 'EQUAL',
264   - symbol: '='
265   - },
266   - {
267   - label: '不等于',
268   - value: 'NOT_EQUAL',
269   - symbol: '!='
270   - },
  262 + label: 'device.equal',
  263 + value: 'EQUAL',
  264 + symbol: '='
  265 +},
  266 +{
  267 + label: 'device.notEqual',
  268 + value: 'NOT_EQUAL',
  269 + symbol: '!='
  270 +},
271 271 ];
272 272
273 273 export {
... ... @@ -280,4 +280,4 @@ export {
280 280 operationNumberOrDate,
281 281 operationString,
282 282 operationBoolean
283   -}
\ No newline at end of file
  283 +}
... ...
... ... @@ -10,13 +10,13 @@
10 10 </view>
11 11 <view class="item-text text-clip">
12 12 <view class="text-container">
13   - 设备编号:
  13 + {{$t('device.deviceNumber')}}:
14 14 <text class="text-span">{{ item.sn }}</text>
15 15 </view>
16 16 </view>
17 17 <view class="item-text text-clip">
18 18 <view class="text-container">
19   - 所属组织:
  19 + {{$t('common.belongingOrganization')}}:
20 20 <text class="text-span">{{ item.organizationDTO.name }}</text>
21 21 </view>
22 22 </view>
... ... @@ -52,7 +52,7 @@
52 52 '/static/baojing.png'
53 53 },
54 54 formatText(deviceState) {
55   - return deviceState === 'ONLINE' ? '在线' : deviceState === 'INACTIVE' ? '待激活' : '离线'
  55 + return deviceState === 'ONLINE' ? this.$t('homePage.deviceLabel.onLine') : deviceState === 'INACTIVE' ? this.$t('homePage.deviceLabel.beActivated') : this.$t('homePage.deviceLabel.offLine')
56 56 },
57 57 formatColor(deviceState) {
58 58 return deviceState === 'ONLINE' ? '#377DFF' : deviceState === 'INACTIVE' ? '#666666' : '#DE4437'
... ... @@ -82,7 +82,7 @@
82 82 justify-content: space-between;
83 83
84 84 .item-text {
85   - width: 450rpx;
  85 + width: 480rpx;
86 86
87 87 .text-container {
88 88 display: flex;
... ...
... ... @@ -2,22 +2,22 @@
2 2 <u-popup @close="$emit('close')" closeable bgColor="#fff" :show="show" mode="bottom" :round="20"
3 3 @touchmove.stop.prevent="disabledScroll">
4 4 <view class="filter" @touchmove.stop.prevent="disabledScroll">
5   - <view class="filter-title"><text>筛选条件</text></view>
6   - <query-item :filterList="deviceStatus" title="设备状态"
  5 + <view class="filter-title"><text>{{ $t('common.filterCriteria') }}</text></view>
  6 + <query-item :filterList="deviceStatus" :title="$t('device.deviceStatus')"
7 7 @clickTag="currentIndex => handleClickTag(currentIndex, deviceStatus)"></query-item>
8   - <query-item :filterList="alarmStatus" title="告警状态"
  8 + <query-item :filterList="alarmStatus" :title="$t('device.alarmStatus')"
9 9 @clickTag="currentIndex => handleClickTag(currentIndex, alarmStatus)"></query-item>
10   - <query-item :filterList="typeStatus" title="设备类型"
  10 + <query-item :filterList="typeStatus" :title="$t('device.deviceType')"
11 11 @clickTag="currentIndex => handleClickTag(currentIndex, typeStatus)"></query-item>
12   - <query-item :filterList="collectStatus" title="设备是否收藏"
  12 + <query-item :filterList="collectStatus" :title="$t('device.isDeviceCollect')"
13 13 @clickTag="currentIndex => handleClickTag(currentIndex, collectStatus)"></query-item>
14 14 <view class="button-group">
15 15 <view>
16   - <u-button :customStyle="{ color: '#333' }" color="#e3e3e5" shape="circle" text="重置"
  16 + <u-button :customStyle="{ color: '#333' }" color="#e3e3e5" shape="circle" :text="$t('common.resetting')"
17 17 @click="resetFilter"></u-button>
18 18 </view>
19 19 <view>
20   - <u-button color="#3388ff" shape="circle" text="确认" @click="confirmFilter"></u-button>
  20 + <u-button color="#3388ff" shape="circle" :text="$t('common.confirm')" @click="confirmFilter"></u-button>
21 21 </view>
22 22 </view>
23 23 </view>
... ...
... ... @@ -6,7 +6,7 @@
6 6 <view class="query-list">
7 7 <view v-for="(item, index) in filterList" :key="index" @click="itemClick(index)"
8 8 :class="['tag-item', { checked: item.checked, 'mr-30': (index + 1) % 3 !== 0 }]">
9   - {{ item.name }}
  9 + {{ $t(item.name) }}
10 10 </view>
11 11 </view>
12 12 </view>
... ... @@ -48,7 +48,8 @@
48 48
49 49 .tag-item {
50 50 margin-top: 30rpx;
51   - width: 210rpx;
  51 + min-width: 198rpx;
  52 + padding: 0 12rpx;
52 53 height: 68rpx;
53 54 border-radius: 32rpx;
54 55 display: flex;
... ... @@ -71,4 +72,4 @@
71 72 }
72 73 }
73 74 }
74   -</style>
\ No newline at end of file
  75 +</style>
... ...