Commit 61340a53a9e3cd40bb8912c77cbbe2a84168c5f9
Merge branch 'main_dev' into 'main'
Main dev See merge request yunteng/thingskit-app!167
Showing
96 changed files
with
2967 additions
and
1460 deletions
| @@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||
| 7 | openId: '' | 7 | openId: '' |
| 8 | }, | 8 | }, |
| 9 | onLaunch(e) { | 9 | onLaunch(e) { |
| 10 | + this.setI18nLocale() | ||
| 10 | // #ifdef APP-PLUS | 11 | // #ifdef APP-PLUS |
| 11 | uni.reLaunch({ | 12 | uni.reLaunch({ |
| 12 | url: '/pages/index/splash' | 13 | url: '/pages/index/splash' |
| @@ -28,6 +29,26 @@ | @@ -28,6 +29,26 @@ | ||
| 28 | const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || localStorage.getItem('userInfo')); | 29 | const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || localStorage.getItem('userInfo')); |
| 29 | // #endif | 30 | // #endif |
| 30 | return userInfo.isThirdLogin | 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,15 +3,16 @@ | ||
| 3 | <!-- 公共组件-每个页面必须引入 --> | 3 | <!-- 公共组件-每个页面必须引入 --> |
| 4 | <public-module></public-module> | 4 | <public-module></public-module> |
| 5 | <view class="alarm-detail-column"> | 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 | <text class="text-device-muted text-clip alarm-text" | 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 | </text> | 16 | </text> |
| 16 | </view> | 17 | </view> |
| 17 | <view class="bottom-line"></view> | 18 | <view class="bottom-line"></view> |
| @@ -19,13 +20,13 @@ | @@ -19,13 +20,13 @@ | ||
| 19 | </view> | 20 | </view> |
| 20 | </view> | 21 | </view> |
| 21 | <!-- #ifdef MP --> | 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 | <view class="hanle-main"> | 24 | <view class="hanle-main"> |
| 24 | <u--form :label-style="{ 'font-size': '0rpx' }" style="padding-left: 26rpx;" labelPosition="left" | 25 | <u--form :label-style="{ 'font-size': '0rpx' }" style="padding-left: 26rpx;" labelPosition="left" |
| 25 | :model="formModel" ref="form1"> | 26 | :model="formModel" ref="form1"> |
| 26 | <u-form-item label="." prop="result" ref="item3"> | 27 | <u-form-item label="." prop="result" ref="item3"> |
| 27 | <view style="position: relative;left: -60rpx;"> | 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 | </u--textarea> | 30 | </u--textarea> |
| 30 | </view> | 31 | </view> |
| 31 | </u-form-item> | 32 | </u-form-item> |
| @@ -33,212 +34,230 @@ | @@ -33,212 +34,230 @@ | ||
| 33 | </view> | 34 | </view> |
| 34 | <!-- #endif --> | 35 | <!-- #endif --> |
| 35 | <!-- #ifdef APP-PLUS --> | 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 | <view class="hanle-main"> | 38 | <view class="hanle-main"> |
| 38 | <view> | 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 | </u--textarea> | 41 | </u--textarea> |
| 41 | </view> | 42 | </view> |
| 42 | </view> | 43 | </view> |
| 43 | <!-- #endif --> | 44 | <!-- #endif --> |
| 44 | <view class="bottom-button"> | 45 | <view class="bottom-button"> |
| 45 | <view v-if="handleText.includes(alarmDetail[8].value)" class="u-flex button-item"> | 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 | </view> | 48 | </view> |
| 48 | <view v-if="clearText.includes(alarmDetail[8].value)" class="u-flex button-item"> | 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 | </view> | 51 | </view> |
| 51 | </view> | 52 | </view> |
| 52 | </view> | 53 | </view> |
| 53 | </template> | 54 | </template> |
| 54 | 55 | ||
| 55 | <script> | 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 | </script> | 254 | </script> |
| 236 | 255 | ||
| 237 | <style lang="scss" scoped> | 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 | </style> | 263 | </style> |
| @@ -3,15 +3,23 @@ | @@ -3,15 +3,23 @@ | ||
| 3 | height: 100vh; | 3 | height: 100vh; |
| 4 | background-color: #f8f9fa; | 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 | .alarm-detail-column { | 13 | .alarm-detail-column { |
| 7 | border-radius: 10px; | 14 | border-radius: 10px; |
| 8 | width: 688rpx; | 15 | width: 688rpx; |
| 9 | height: 780rpx; | 16 | height: 780rpx; |
| 10 | background-color: #ffffff; | 17 | background-color: #ffffff; |
| 11 | .detail-column { | 18 | .detail-column { |
| 12 | - width:750rpx; | 19 | + width:688rpx; |
| 13 | flex-direction: column; | 20 | flex-direction: column; |
| 14 | align-items: center; | 21 | align-items: center; |
| 22 | + padding:0 12rpx; | ||
| 15 | .column-line{ | 23 | .column-line{ |
| 16 | display:flex; | 24 | display:flex; |
| 17 | flex-direction: column; | 25 | flex-direction: column; |
| @@ -19,15 +27,16 @@ | @@ -19,15 +27,16 @@ | ||
| 19 | display:flex; | 27 | display:flex; |
| 20 | margin-top: 10rpx; | 28 | margin-top: 10rpx; |
| 21 | line-height: 68rpx; | 29 | line-height: 68rpx; |
| 22 | - width:700rpx; | 30 | + width:664rpx; |
| 23 | height: 74rpx; | 31 | height: 74rpx; |
| 24 | align-items: center; | 32 | align-items: center; |
| 25 | .device-name{ | 33 | .device-name{ |
| 26 | width:222rpx; | 34 | width:222rpx; |
| 27 | } | 35 | } |
| 28 | .alarm-text{ | 36 | .alarm-text{ |
| 29 | - width:460rpx; | 37 | + width:330rpx; |
| 30 | overflow-x: scroll; | 38 | overflow-x: scroll; |
| 39 | + text-overflow: ellipsis; | ||
| 31 | } | 40 | } |
| 32 | 41 | ||
| 33 | .text { | 42 | .text { |
| 1 | <template> | 1 | <template> |
| 2 | <view class="header-org" @click="$emit('openOrg')"> | 2 | <view class="header-org" @click="$emit('openOrg')"> |
| 3 | <view class="org-item"> | 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 | <view class="u-flex org-device"> | 5 | <view class="u-flex org-device"> |
| 6 | <image class="device-image" :src="imageSrc"></image> | 6 | <image class="device-image" :src="imageSrc"></image> |
| 7 | <text class="device-text">{{title}} {{ total }}</text> | 7 | <text class="device-text">{{title}} {{ total }}</text> |
| @@ -37,7 +37,7 @@ | @@ -37,7 +37,7 @@ | ||
| 37 | // top: 75rpx; | 37 | // top: 75rpx; |
| 38 | 38 | ||
| 39 | .org-item { | 39 | .org-item { |
| 40 | - width: 350rpx; | 40 | + // width: 350rpx; |
| 41 | height: 200rpx; | 41 | height: 200rpx; |
| 42 | 42 | ||
| 43 | .org-contact { | 43 | .org-contact { |
| @@ -8,13 +8,13 @@ | @@ -8,13 +8,13 @@ | ||
| 8 | </view> | 8 | </view> |
| 9 | </view> | 9 | </view> |
| 10 | <view @click="$emit('openSearchDialog')" class="search-right"> | 10 | <view @click="$emit('openSearchDialog')" class="search-right"> |
| 11 | - <text>筛选</text> | 11 | + <text>{{ $t('common.screen') }}</text> |
| 12 | <image src="../../static/shaixuan.png" /> | 12 | <image src="../../static/shaixuan.png" /> |
| 13 | </view> | 13 | </view> |
| 14 | </view> | 14 | </view> |
| 15 | <u-line /> | 15 | <u-line /> |
| 16 | <view class="org"> | 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 | <view slot="label" class="label" style="display: flex; align-items: center;margin-top: 20rpx;"> | 18 | <view slot="label" class="label" style="display: flex; align-items: center;margin-top: 20rpx;"> |
| 19 | <image src="../../static/org.png" style="width: 24rpx;height: 28rpx;"></image> | 19 | <image src="../../static/org.png" style="width: 24rpx;height: 28rpx;"></image> |
| 20 | <view style="margin-left: 10rpx; color: #666;"> | 20 | <view style="margin-left: 10rpx; color: #666;"> |
| @@ -94,4 +94,4 @@ | @@ -94,4 +94,4 @@ | ||
| 94 | } | 94 | } |
| 95 | } | 95 | } |
| 96 | } | 96 | } |
| 97 | -</style> | ||
| 97 | +</style> |
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | :safeAreaInsetBottom="false" :activeColor="activeColor" :inactiveColor="inactiveColor" :border="border"> | 6 | :safeAreaInsetBottom="false" :activeColor="activeColor" :inactiveColor="inactiveColor" :border="border"> |
| 7 | <block v-for="(item, index) in list" :key="index"> | 7 | <block v-for="(item, index) in list" :key="index"> |
| 8 | <!-- 自定义icon --> | 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 | <view slot="active-icon"> | 10 | <view slot="active-icon"> |
| 11 | <image style="width:50rpx;height: 50rpx;" :src="item.iconFill" mode=""></image> | 11 | <image style="width:50rpx;height: 50rpx;" :src="item.iconFill" mode=""></image> |
| 12 | </view> | 12 | </view> |
| @@ -81,26 +81,26 @@ | @@ -81,26 +81,26 @@ | ||
| 81 | path: '', //当前路径 | 81 | path: '', //当前路径 |
| 82 | //#ifdef MP | 82 | //#ifdef MP |
| 83 | list: [{ | 83 | list: [{ |
| 84 | - name: '首页', | 84 | + name: 'menu.homePage', |
| 85 | url: 'pages/index/index', | 85 | url: 'pages/index/index', |
| 86 | icon: '../../../static/home-un.png', | 86 | icon: '../../../static/home-un.png', |
| 87 | iconFill: '../../../static/home-yes.png' | 87 | iconFill: '../../../static/home-yes.png' |
| 88 | }, | 88 | }, |
| 89 | { | 89 | { |
| 90 | - name: '设备', | 90 | + name: 'menu.device', |
| 91 | url: 'pages/device/device', | 91 | url: 'pages/device/device', |
| 92 | icon: '../../../static/device-un.png', | 92 | icon: '../../../static/device-un.png', |
| 93 | iconFill: '../../../static/device-yes.png' | 93 | iconFill: '../../../static/device-yes.png' |
| 94 | }, | 94 | }, |
| 95 | { | 95 | { |
| 96 | - name: '告警', | 96 | + name: 'menu.alarm', |
| 97 | url: 'pages/alarm/alarm', | 97 | url: 'pages/alarm/alarm', |
| 98 | icon: '../../../static/alert-un.png', | 98 | icon: '../../../static/alert-un.png', |
| 99 | iconFill: '../../../static/alert-yes.png', | 99 | iconFill: '../../../static/alert-yes.png', |
| 100 | badge: this.$store.state.badgeInfo | 100 | badge: this.$store.state.badgeInfo |
| 101 | }, | 101 | }, |
| 102 | { | 102 | { |
| 103 | - name: '我的', | 103 | + name: 'menu.my', |
| 104 | url: 'pages/personal/personal', | 104 | url: 'pages/personal/personal', |
| 105 | icon: '../../../static/my-un.png', | 105 | icon: '../../../static/my-un.png', |
| 106 | iconFill: '../../../static/my-yes.png' | 106 | iconFill: '../../../static/my-yes.png' |
| @@ -109,26 +109,26 @@ | @@ -109,26 +109,26 @@ | ||
| 109 | //#endif | 109 | //#endif |
| 110 | //#ifdef APP-PLUS | 110 | //#ifdef APP-PLUS |
| 111 | list: [{ | 111 | list: [{ |
| 112 | - name: '首页', | 112 | + name: 'menu.homePage', |
| 113 | url: 'pages/index/index', | 113 | url: 'pages/index/index', |
| 114 | icon: '/static/home-un.png', | 114 | icon: '/static/home-un.png', |
| 115 | iconFill: '/static/home-yes.png' | 115 | iconFill: '/static/home-yes.png' |
| 116 | }, | 116 | }, |
| 117 | { | 117 | { |
| 118 | - name: '设备', | 118 | + name: 'menu.device', |
| 119 | url: 'pages/device/device', | 119 | url: 'pages/device/device', |
| 120 | icon: '/static/device-un.png', | 120 | icon: '/static/device-un.png', |
| 121 | iconFill: '/static/device-yes.png' | 121 | iconFill: '/static/device-yes.png' |
| 122 | }, | 122 | }, |
| 123 | { | 123 | { |
| 124 | - name: '告警', | 124 | + name: 'menu.alarm', |
| 125 | url: 'pages/alarm/alarm', | 125 | url: 'pages/alarm/alarm', |
| 126 | icon: '/static/alert-un.png', | 126 | icon: '/static/alert-un.png', |
| 127 | iconFill: '/static/alert-yes.png', | 127 | iconFill: '/static/alert-yes.png', |
| 128 | badge: this.$store.state.badgeInfo | 128 | badge: this.$store.state.badgeInfo |
| 129 | }, | 129 | }, |
| 130 | { | 130 | { |
| 131 | - name: '我的', | 131 | + name: 'menu.my', |
| 132 | url: 'pages/personal/personal', | 132 | url: 'pages/personal/personal', |
| 133 | icon: '/static/my-un.png', | 133 | icon: '/static/my-un.png', |
| 134 | iconFill: '/static/my-yes.png' | 134 | iconFill: '/static/my-yes.png' |
| @@ -189,4 +189,4 @@ | @@ -189,4 +189,4 @@ | ||
| 189 | right: 0; | 189 | right: 0; |
| 190 | z-index: 1000; | 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 | * baseUrl 服务端 api地址 | 4 | * baseUrl 服务端 api地址 |
| @@ -9,49 +7,50 @@ import { | @@ -9,49 +7,50 @@ import { | ||
| 9 | * baseWebSocketUrl 服务端 websocket地址 | 7 | * baseWebSocketUrl 服务端 websocket地址 |
| 10 | * socketPrefix websocket前缀 ((https, wss),( http, ws)) | 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 | // const baseVisualUrl = "http://192.168.1.4:8083" | 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 | let systemInfo = { | 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 | // #ifdef MP-WEIXIN | 30 | // #ifdef MP-WEIXIN |
| 33 | -systemInfo.platform = "weixin"; | 31 | +systemInfo.platform = 'weixin' |
| 34 | // #endif | 32 | // #endif |
| 35 | // #ifdef MP-ALIPAY | 33 | // #ifdef MP-ALIPAY |
| 36 | -systemInfo.platform = "alipay"; | 34 | +systemInfo.platform = 'alipay' |
| 37 | // #endif | 35 | // #endif |
| 38 | // #ifdef MP-TOUTIAO | 36 | // #ifdef MP-TOUTIAO |
| 39 | -systemInfo.platform = "toutiao"; | 37 | +systemInfo.platform = 'toutiao' |
| 40 | // #endif | 38 | // #endif |
| 41 | // #ifdef APP-PLUS | 39 | // #ifdef APP-PLUS |
| 42 | -systemInfo.platform = "plus"; | 40 | +systemInfo.platform = 'plus' |
| 43 | // #endif | 41 | // #endif |
| 44 | const courtConfig = { | 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 | + |
config/i18n.js
0 → 100644
| 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 | import base from "@/config/baseUrl"; | 1 | import base from "@/config/baseUrl"; |
| 2 | import store from "@/store"; | 2 | import store from "@/store"; |
| 3 | +import i18n from '@/config/i18n.js' | ||
| 3 | import { | 4 | import { |
| 4 | judgeLogin | 5 | judgeLogin |
| 5 | } from "@/config/login"; | 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 | uni.$u.http.setConfig((config) => { | 15 | uni.$u.http.setConfig((config) => { |
| 9 | const token = | 16 | const token = |
| @@ -49,6 +56,7 @@ uni.$u.http.interceptors.request.use( | @@ -49,6 +56,7 @@ uni.$u.http.interceptors.request.use( | ||
| 49 | "Bearer " + store.state.userInfo.isToken || | 56 | "Bearer " + store.state.userInfo.isToken || |
| 50 | uni.getStorageSync("userInfo").isToken || | 57 | uni.getStorageSync("userInfo").isToken || |
| 51 | undefined; | 58 | undefined; |
| 59 | + config.header['Language'] = BackEndLocaleMapping[uni.getLocale()] || 'zh_CN' | ||
| 52 | config.baseURL = | 60 | config.baseURL = |
| 53 | getConfiguration == true ? base.baseDrawioUrl : base.baseUrl; | 61 | getConfiguration == true ? base.baseDrawioUrl : base.baseUrl; |
| 54 | } | 62 | } |
| @@ -83,20 +91,25 @@ uni.$u.http.interceptors.response.use( | @@ -83,20 +91,25 @@ uni.$u.http.interceptors.response.use( | ||
| 83 | store.commit("emptyUserInfo"); | 91 | store.commit("emptyUserInfo"); |
| 84 | // 20秒节流,弹窗登录 | 92 | // 20秒节流,弹窗登录 |
| 85 | uni.$u.throttle(judgeLogin(), 20000); | 93 | uni.$u.throttle(judgeLogin(), 20000); |
| 86 | - return new Promise(() => {}); | ||
| 87 | - } else {} | 94 | + return new Promise(() => { }); |
| 95 | + } else { } | ||
| 88 | }, | 96 | }, |
| 89 | (response) => { | 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 | store.commit("setLoadingShow", false); | 104 | store.commit("setLoadingShow", false); |
| 92 | let show = true; | 105 | let show = true; |
| 93 | - let errorData = "请检查网络或服务器"; | 106 | + let errorData = i18n.t('login.pleaseNetwork'); |
| 94 | let message = | 107 | let message = |
| 95 | response.data?.message || response.data?.msg || response?.errMsg; | 108 | response.data?.message || response.data?.msg || response?.errMsg; |
| 96 | if (message == "request:fail url not in domain list") { | 109 | if (message == "request:fail url not in domain list") { |
| 97 | - errorData = "检查请求域名是否添加了域名白名单"; | 110 | + errorData = i18n.t('login.inspectDomain'); |
| 98 | } else if (message == "request:fail timeout") { | 111 | } else if (message == "request:fail timeout") { |
| 99 | - errorData = "请求超时:请检查网络"; | 112 | + errorData = i18n.t('login.requestTimeout'); |
| 100 | } else if (response.data.status == 401) { | 113 | } else if (response.data.status == 401) { |
| 101 | const isLoginFlag = uni.getStorageSync("userInfo"); | 114 | const isLoginFlag = uni.getStorageSync("userInfo"); |
| 102 | if (!store.state.userInfo.isThirdLogin) { | 115 | if (!store.state.userInfo.isThirdLogin) { |
| @@ -125,10 +138,10 @@ uni.$u.http.interceptors.response.use( | @@ -125,10 +138,10 @@ uni.$u.http.interceptors.response.use( | ||
| 125 | errorData = message || ""; | 138 | errorData = message || ""; |
| 126 | } | 139 | } |
| 127 | // console.log('errorData', errorData); | 140 | // console.log('errorData', errorData); |
| 128 | - if(message != "request:ok"){ | 141 | + if (message != "request:ok") { |
| 129 | uni.$u.toast(message); | 142 | uni.$u.toast(message); |
| 130 | } | 143 | } |
| 131 | // if (show) uni.$u.toast(errorData); | 144 | // if (show) uni.$u.toast(errorData); |
| 132 | return Promise.reject(response); | 145 | return Promise.reject(response); |
| 133 | } | 146 | } |
| 134 | -); | 147 | +); |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <view class="alert-page"> | 2 | <view class="alert-page"> |
| 3 | <!-- 告警头部 --> | 3 | <!-- 告警头部 --> |
| 4 | <view class="filter-button" @click="openSearchDialog"> | 4 | <view class="filter-button" @click="openSearchDialog"> |
| 5 | - <text>筛选</text> | 5 | + <text>{{ $t('common.screen') }}</text> |
| 6 | <image src="/static/shaixuan.png" /> | 6 | <image src="/static/shaixuan.png" /> |
| 7 | </view> | 7 | </view> |
| 8 | <!-- 告警分页 --> | 8 | <!-- 告警分页 --> |
| @@ -159,4 +159,4 @@ | @@ -159,4 +159,4 @@ | ||
| 159 | margin-left: 4rpx; | 159 | margin-left: 4rpx; |
| 160 | } | 160 | } |
| 161 | } | 161 | } |
| 162 | -</style> | ||
| 162 | +</style> |
| @@ -20,39 +20,39 @@ | @@ -20,39 +20,39 @@ | ||
| 20 | <view class="mr-2" | 20 | <view class="mr-2" |
| 21 | v-if="deviceDetail.deviceState === 'ONLINE' && deviceDetail.transportType !== deviceTypeNum.GBT"> | 21 | v-if="deviceDetail.deviceState === 'ONLINE' && deviceDetail.transportType !== deviceTypeNum.GBT"> |
| 22 | <view class="cu-item" @tap="handleAppShowModal" data-target="Modal"> | 22 | <view class="cu-item" @tap="handleAppShowModal" data-target="Modal"> |
| 23 | - <text>命令下发</text> | 23 | + <text>{{ $t('device.commandIssuance') }}</text> |
| 24 | </view> | 24 | </view> |
| 25 | </view> | 25 | </view> |
| 26 | </view> | 26 | </view> |
| 27 | <!-- 设备详情 --> | 27 | <!-- 设备详情 --> |
| 28 | <view class="detail"> | 28 | <view class="detail"> |
| 29 | <view class="detail-item"> | 29 | <view class="detail-item"> |
| 30 | - <view class="detail-label">设备编号</view> | 30 | + <view class="detail-label">{{ $t('device.deviceNumber') }}</view> |
| 31 | <view class="detail-value">{{ deviceDetail.sn }}</view> | 31 | <view class="detail-value">{{ deviceDetail.sn }}</view> |
| 32 | </view> | 32 | </view> |
| 33 | <u-line length="90%" margin="0 auto"></u-line> | 33 | <u-line length="90%" margin="0 auto"></u-line> |
| 34 | <view class="detail-item"> | 34 | <view class="detail-item"> |
| 35 | - <view class="detail-label">设备类型</view> | 35 | + <view class="detail-label">{{ $t('device.deviceType') }}</view> |
| 36 | <view class="detail-value">{{ deviceType }}</view> | 36 | <view class="detail-value">{{ deviceType }}</view> |
| 37 | </view> | 37 | </view> |
| 38 | <u-line length="90%" margin="0 auto"></u-line> | 38 | <u-line length="90%" margin="0 auto"></u-line> |
| 39 | <view class="detail-item"> | 39 | <view class="detail-item"> |
| 40 | - <view class="detail-label">所属组织</view> | 40 | + <view class="detail-label">{{ $t('common.belongingOrganization') }}</view> |
| 41 | <view class="detail-value">{{ deviceDetail.organizationDTO.name }}</view> | 41 | <view class="detail-value">{{ deviceDetail.organizationDTO.name }}</view> |
| 42 | </view> | 42 | </view> |
| 43 | <u-line length="90%" margin="0 auto"></u-line> | 43 | <u-line length="90%" margin="0 auto"></u-line> |
| 44 | <view class="detail-item"> | 44 | <view class="detail-item"> |
| 45 | - <view class="detail-label">最后连接时间</view> | 45 | + <view class="detail-label">{{ $t('device.lastConnectionTime') }}</view> |
| 46 | <view class="detail-value">{{ formatLastOnlineTime }}</view> | 46 | <view class="detail-value">{{ formatLastOnlineTime }}</view> |
| 47 | </view> | 47 | </view> |
| 48 | <u-line length="90%" margin="0 auto"></u-line> | 48 | <u-line length="90%" margin="0 auto"></u-line> |
| 49 | <view class="detail-item"> | 49 | <view class="detail-item"> |
| 50 | - <view class="detail-label">是否告警</view> | 50 | + <view class="detail-label">{{ $t('device.isAlarm') }}</view> |
| 51 | <view class="detail-value">{{ alarmStatus }}</view> | 51 | <view class="detail-value">{{ alarmStatus }}</view> |
| 52 | </view> | 52 | </view> |
| 53 | <u-line length="90%" margin="0 auto"></u-line> | 53 | <u-line length="90%" margin="0 auto"></u-line> |
| 54 | <view class="detail-item"> | 54 | <view class="detail-item"> |
| 55 | - <view class="detail-label">设备描述</view> | 55 | + <view class="detail-label">{{ $t('device.deviceRemark') }}</view> |
| 56 | <view class="detail-value">{{ deviceDetail.description }}</view> | 56 | <view class="detail-value">{{ deviceDetail.description }}</view> |
| 57 | </view> | 57 | </view> |
| 58 | </view> | 58 | </view> |
| @@ -118,20 +118,20 @@ | @@ -118,20 +118,20 @@ | ||
| 118 | }, | 118 | }, |
| 119 | computed: { | 119 | computed: { |
| 120 | deviceStatus() { | 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 | deviceType() { | 124 | deviceType() { |
| 125 | return this.deviceDetail.deviceType === 'DIRECT_CONNECTION' ? | 125 | return this.deviceDetail.deviceType === 'DIRECT_CONNECTION' ? |
| 126 | - '直连设备' : | 126 | + this.$t('common.directlyDevice') : |
| 127 | this.deviceDetail.deviceType === 'GATEWAY' ? | 127 | this.deviceDetail.deviceType === 'GATEWAY' ? |
| 128 | - '网关设备' : | 128 | + this.$t('common.gatewayDevice') : |
| 129 | this.deviceDetail.deviceType === 'SENSOR' ? | 129 | this.deviceDetail.deviceType === 'SENSOR' ? |
| 130 | - '网关子设备' : | 130 | + this.$t('common.sensorDevice') : |
| 131 | ''; | 131 | ''; |
| 132 | }, | 132 | }, |
| 133 | alarmStatus() { | 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 | formatLastOnlineTime() { | 136 | formatLastOnlineTime() { |
| 137 | return formatToDate(Number(this.deviceDetail.lastOnlineTime), 'YYYY-MM-DD HH:mm:ss'); | 137 | return formatToDate(Number(this.deviceDetail.lastOnlineTime), 'YYYY-MM-DD HH:mm:ss'); |
| @@ -147,12 +147,12 @@ | @@ -147,12 +147,12 @@ | ||
| 147 | }, | 147 | }, |
| 148 | methods: { | 148 | methods: { |
| 149 | handleCopy(value) { | 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 | uni.setClipboardData({ | 151 | uni.setClipboardData({ |
| 152 | data: JSON.stringify(value), | 152 | data: JSON.stringify(value), |
| 153 | success: () => { | 153 | success: () => { |
| 154 | uni.showToast({ | 154 | uni.showToast({ |
| 155 | - title: '复制成功' | 155 | + title: this.$t('common.copyOk') |
| 156 | }) | 156 | }) |
| 157 | } | 157 | } |
| 158 | }); | 158 | }); |
| @@ -216,12 +216,12 @@ | @@ -216,12 +216,12 @@ | ||
| 216 | this.handleCommand(this.commandTypeStr, this.commandTypeStr, this.inputCommandContent) | 216 | this.handleCommand(this.commandTypeStr, this.commandTypeStr, this.inputCommandContent) |
| 217 | }, | 217 | }, |
| 218 | async handleCommand(commandType, callType, values) { | 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 | if (callType == 'TwoWay') { | 220 | if (callType == 'TwoWay') { |
| 221 | const result = await api.deviceApi.getDeviceActiveTime(this.deviceDetail.tbDeviceId) | 221 | const result = await api.deviceApi.getDeviceActiveTime(this.deviceDetail.tbDeviceId) |
| 222 | const [firsetItem] = result || [] | 222 | const [firsetItem] = result || [] |
| 223 | if (!firsetItem.value) { | 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,7 +236,7 @@ | ||
| 236 | //TCP的格式只能是字符串 | 236 | //TCP的格式只能是字符串 |
| 237 | const zg = /^[0-9a-zA-Z]*$/; | 237 | const zg = /^[0-9a-zA-Z]*$/; |
| 238 | if (!zg.test(values)) { | 238 | if (!zg.test(values)) { |
| 239 | - uni.$u.toast('输入的内容只能是字母和数字的组合'); | 239 | + uni.$u.toast(this.$t('device.pleaseCommandRule')); |
| 240 | return; | 240 | return; |
| 241 | } | 241 | } |
| 242 | this.commandValue.params = values; | 242 | this.commandValue.params = values; |
| @@ -247,7 +247,7 @@ | @@ -247,7 +247,7 @@ | ||
| 247 | 247 | ||
| 248 | await api.deviceApi.issueCommand(callType, this.deviceDetail.tbDeviceId, this.commandValue); | 248 | await api.deviceApi.issueCommand(callType, this.deviceDetail.tbDeviceId, this.commandValue); |
| 249 | this.cancelCommand(); | 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,4 +392,4 @@ | ||
| 392 | /deep/ .u-modal__content { | 392 | /deep/ .u-modal__content { |
| 393 | padding: 30rpx 0 !important; | 393 | padding: 30rpx 0 !important; |
| 394 | } | 394 | } |
| 395 | -</style> | ||
| 395 | +</style> |
| @@ -3,47 +3,47 @@ | @@ -3,47 +3,47 @@ | ||
| 3 | <view class="detail-top">{{ commandDetail.deviceName }}</view> | 3 | <view class="detail-top">{{ commandDetail.deviceName }}</view> |
| 4 | <view class="detail"> | 4 | <view class="detail"> |
| 5 | <view class="detail-item"> | 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 | </view> | 8 | </view> |
| 9 | <u-line length="90%" margin="0 auto"></u-line> | 9 | <u-line length="90%" margin="0 auto"></u-line> |
| 10 | <view class="detail-item"> | 10 | <view class="detail-item"> |
| 11 | - <view class="detail-label">设备编号</view> | 11 | + <view class="detail-label">{{$t('device.deviceNumber')}}</view> |
| 12 | <view class="detail-value">{{ commandDetail.deviceSn }}</view> | 12 | <view class="detail-value">{{ commandDetail.deviceSn }}</view> |
| 13 | </view> | 13 | </view> |
| 14 | <u-line length="90%" margin="0 auto"></u-line> | 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 | <view class="detail-value">{{ commandDetail.organizationName }}</view> | 17 | <view class="detail-value">{{ commandDetail.organizationName }}</view> |
| 18 | </view> | 18 | </view> |
| 19 | <u-line length="90%" margin="0 auto"></u-line> | 19 | <u-line length="90%" margin="0 auto"></u-line> |
| 20 | <view class="detail-item"> | 20 | <view class="detail-item"> |
| 21 | - <view class="detail-label">命令下发时间</view> | 21 | + <view class="detail-label">{{ $t('device.commandTime') }}</view> |
| 22 | <view class="detail-value">{{ format(commandDetail.createTime) }}</view> | 22 | <view class="detail-value">{{ format(commandDetail.createTime) }}</view> |
| 23 | </view> | 23 | </view> |
| 24 | <u-line length="90%" margin="0 auto"></u-line> | 24 | <u-line length="90%" margin="0 auto"></u-line> |
| 25 | <view class="detail-item"> | 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 | </view> | 28 | </view> |
| 29 | <u-line length="90%" margin="0 auto" v-if="commandDetail.additionalInfo.cmdType"></u-line> | 29 | <u-line length="90%" margin="0 auto" v-if="commandDetail.additionalInfo.cmdType"></u-line> |
| 30 | <view class="detail-item"> | 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 | </view> | 33 | </view> |
| 34 | <u-line length="90%" margin="0 auto"></u-line> | 34 | <u-line length="90%" margin="0 auto"></u-line> |
| 35 | <view class="detail-item"> | 35 | <view class="detail-item"> |
| 36 | - <view class="detail-label">命令状态</view> | 36 | + <view class="detail-label">{{ $t('device.commandStatus') }}</view> |
| 37 | <view class="detail-value">{{ commandDetail.statusName }}</view> | 37 | <view class="detail-value">{{ commandDetail.statusName }}</view> |
| 38 | </view> | 38 | </view> |
| 39 | <u-line length="90%" margin="0 auto"></u-line> | 39 | <u-line length="90%" margin="0 auto"></u-line> |
| 40 | <view class="detail-item" v-if="!commandDetail.request.oneway"> | 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 | </view> | 43 | </view> |
| 44 | </view> | 44 | </view> |
| 45 | </view> | 45 | </view> |
| 46 | - <view class="command">命令内容</view> | 46 | + <view class="command">{{ $t('device.commandContent') }}</view> |
| 47 | <u-textarea :value="formatValue(commandDetail.request.body)" disabled></u-textarea> | 47 | <u-textarea :value="formatValue(commandDetail.request.body)" disabled></u-textarea> |
| 48 | <view style="height: 50rpx;"></view> | 48 | <view style="height: 50rpx;"></view> |
| 49 | </view> | 49 | </view> |
| @@ -62,12 +62,13 @@ | @@ -62,12 +62,13 @@ | ||
| 62 | }, | 62 | }, |
| 63 | computed: { | 63 | computed: { |
| 64 | deviceType() { | 64 | deviceType() { |
| 65 | + | ||
| 65 | return this.commandDetail.deviceType === 'DIRECT_CONNECTION' ? | 66 | return this.commandDetail.deviceType === 'DIRECT_CONNECTION' ? |
| 66 | - '直连设备' : | 67 | + 'common.directlyDevice' : |
| 67 | this.commandDetail.deviceType === 'GATEWAY' ? | 68 | this.commandDetail.deviceType === 'GATEWAY' ? |
| 68 | - '网关设备' : | 69 | + 'common.gatewayDevice' : |
| 69 | this.commandDetail.deviceType === 'SENSOR' ? | 70 | this.commandDetail.deviceType === 'SENSOR' ? |
| 70 | - '网关子设备' : | 71 | + 'common.sensorDevice' : |
| 71 | ''; | 72 | ''; |
| 72 | } | 73 | } |
| 73 | }, | 74 | }, |
| @@ -90,6 +91,13 @@ | @@ -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 | onLoad(options) { | 101 | onLoad(options) { |
| 94 | const { data } = options; | 102 | const { data } = options; |
| 95 | this.commandDetail = JSON.parse(decodeURIComponent(data)); | 103 | this.commandDetail = JSON.parse(decodeURIComponent(data)); |
| @@ -101,4 +109,4 @@ | @@ -101,4 +109,4 @@ | ||
| 101 | 109 | ||
| 102 | <style lang="scss" scoped> | 110 | <style lang="scss" scoped> |
| 103 | @import "../static/command-detail.scss"; | 111 | @import "../static/command-detail.scss"; |
| 104 | -</style> | ||
| 112 | +</style> |
| @@ -2,26 +2,26 @@ | @@ -2,26 +2,26 @@ | ||
| 2 | <view class="w-100 modal-content"> | 2 | <view class="w-100 modal-content"> |
| 3 | <view> | 3 | <view> |
| 4 | <view style="max-height: 560rpx; overflow-y: scroll"> | 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 | <view class="u-flex"> | 6 | <view class="u-flex"> |
| 7 | - <text class="type-text">下发类型:</text> | 7 | + <text class="type-text">{{ $t('device.issuanceType') }}:</text> |
| 8 | <u-radio-group v-model="commandType" placement="row" @change="handleCommand"> | 8 | <u-radio-group v-model="commandType" placement="row" @change="handleCommand"> |
| 9 | <u-radio :customStyle="{ marginRight: '20rpx' }" v-for="item in commandTypeList" | 9 | <u-radio :customStyle="{ marginRight: '20rpx' }" v-for="item in commandTypeList" |
| 10 | activeColor="#3388FF" :label="item.label" :name="item.value" :key="item.value"></u-radio> | 10 | activeColor="#3388FF" :label="item.label" :name="item.value" :key="item.value"></u-radio> |
| 11 | </u-radio-group> | 11 | </u-radio-group> |
| 12 | </view> | 12 | </view> |
| 13 | <view class="u-flex" style="margin-top: 28rpx" v-if="commandType == 0"> | 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 | <u-radio-group v-model="callType" placement="row"> | 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 | <view style="margin: 0 20rpx"></view> | 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 | </u-radio-group> | 19 | </u-radio-group> |
| 20 | </view> | 20 | </view> |
| 21 | <view class="u-flex" style="margin-top: 28rpx" v-else> | 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 | <view @click="openService"> | 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 | suffixIcon="arrow-down" /> | 25 | suffixIcon="arrow-down" /> |
| 26 | </view> | 26 | </view> |
| 27 | </view> | 27 | </view> |
| @@ -30,14 +30,14 @@ | @@ -30,14 +30,14 @@ | ||
| 30 | flex-direction: column; | 30 | flex-direction: column; |
| 31 | align-items: flex-start; | 31 | align-items: flex-start; |
| 32 | " v-if="isShowServiceFunctionName && commandType == 1"> | 32 | " v-if="isShowServiceFunctionName && commandType == 1"> |
| 33 | - <text class="type-text">输入参数:</text> | 33 | + <text class="type-text">{{ $t('device.inputParameter') }}:</text> |
| 34 | <seriesForm ref="seriesFormRef" :seriesInputData="seriesInputData" :isTCPTransport="isTCPTransport"> | 34 | <seriesForm ref="seriesFormRef" :seriesInputData="seriesInputData" :isTCPTransport="isTCPTransport"> |
| 35 | </seriesForm> | 35 | </seriesForm> |
| 36 | </view> | 36 | </view> |
| 37 | <view class="content-body" v-if="commandType == 0"> | 37 | <view class="content-body" v-if="commandType == 0"> |
| 38 | <div class="u-flex u-row-between"> | 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 | }`" v-model="inputCommandVal" /> | 41 | }`" v-model="inputCommandVal" /> |
| 42 | <u-icon v-if="!isShowTCP" @click="handleCopy(copyTextValue)" name="question-circle" | 42 | <u-icon v-if="!isShowTCP" @click="handleCopy(copyTextValue)" name="question-circle" |
| 43 | color="#2979ff" size="28" class="ml-10"> | 43 | color="#2979ff" size="28" class="ml-10"> |
| @@ -47,16 +47,16 @@ | @@ -47,16 +47,16 @@ | ||
| 47 | </view> | 47 | </view> |
| 48 | <view class="button-group"> | 48 | <view class="button-group"> |
| 49 | <view> | 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 | @click="cancelCommand"></u-button> | 51 | @click="cancelCommand"></u-button> |
| 52 | </view> | 52 | </view> |
| 53 | <view> | 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 | </view> | 55 | </view> |
| 56 | </view> | 56 | </view> |
| 57 | </view> | 57 | </view> |
| 58 | <u-picker :show="isShowService" :columns="[ | 58 | <u-picker :show="isShowService" :columns="[ |
| 59 | - seriesList.map((item) => ({ | 59 | + (seriesList || []).map((item) => ({ |
| 60 | label: item.functionName, | 60 | label: item.functionName, |
| 61 | value: item.identifier, | 61 | value: item.identifier, |
| 62 | callType: item.callType, | 62 | callType: item.callType, |
| @@ -100,7 +100,7 @@ | @@ -100,7 +100,7 @@ | ||
| 100 | }, | 100 | }, |
| 101 | }, | 101 | }, |
| 102 | commandTypeList: [{ | 102 | commandTypeList: [{ |
| 103 | - label: "自定义", | 103 | + label:this.$t('common.customText'), |
| 104 | value: 0 | 104 | value: 0 |
| 105 | }], | 105 | }], |
| 106 | seriesList: [], //服务下拉框的数据 | 106 | seriesList: [], //服务下拉框的数据 |
| @@ -150,16 +150,18 @@ | @@ -150,16 +150,18 @@ | ||
| 150 | } | 150 | } |
| 151 | }, | 151 | }, |
| 152 | handleCopy(value) { | 152 | handleCopy(value) { |
| 153 | - useShowModal(JSON.stringify(value), "命令下发", "复制内容").then( | 153 | + useShowModal(JSON.stringify(value), this.$t('device.commandIssuance'), this.$t('common.copyContent')).then( |
| 154 | (res) => { | 154 | (res) => { |
| 155 | - uni.setClipboardData({ | 155 | + if(res?.confirm){ |
| 156 | + uni.setClipboardData({ | ||
| 156 | data: JSON.stringify(value), | 157 | data: JSON.stringify(value), |
| 157 | success: () => { | 158 | success: () => { |
| 158 | uni.showToast({ | 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,7 +189,7 @@ | ||
| 187 | this.commandTypeList; | 189 | this.commandTypeList; |
| 188 | } else { | 190 | } else { |
| 189 | this.commandTypeList.push({ | 191 | this.commandTypeList.push({ |
| 190 | - label: "服务", | 192 | + label: this.$t('device.service'), |
| 191 | value: 1 | 193 | value: 1 |
| 192 | }); | 194 | }); |
| 193 | this.seriesList = await api.deviceApi.getModelServices( | 195 | this.seriesList = await api.deviceApi.getModelServices( |
| @@ -283,4 +285,4 @@ | @@ -283,4 +285,4 @@ | ||
| 283 | } | 285 | } |
| 284 | } | 286 | } |
| 285 | } | 287 | } |
| 286 | -</style> | ||
| 288 | +</style> |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <view class="command-record"> | 2 | <view class="command-record"> |
| 3 | <!-- 命令记录筛选--> | 3 | <!-- 命令记录筛选--> |
| 4 | <view class="filter-button" @click="openSearchDialog"> | 4 | <view class="filter-button" @click="openSearchDialog"> |
| 5 | - <text>筛选</text> | 5 | + <text>{{ $t('common.screen') }}</text> |
| 6 | <image src="/static/shaixuan.png" /> | 6 | <image src="/static/shaixuan.png" /> |
| 7 | </view> | 7 | </view> |
| 8 | <!-- 命令记录分页 --> | 8 | <!-- 命令记录分页 --> |
| @@ -14,24 +14,24 @@ | @@ -14,24 +14,24 @@ | ||
| 14 | <text>{{ item.deviceName }}</text> | 14 | <text>{{ item.deviceName }}</text> |
| 15 | <!-- 业务 单向是没有响应状态 --> | 15 | <!-- 业务 单向是没有响应状态 --> |
| 16 | <view v-if="!item.request.oneway"> | 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 | </view> | 19 | </view> |
| 20 | </view> | 20 | </view> |
| 21 | <view> | 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 | </view> | 24 | </view> |
| 25 | <view v-if="item.statusName"> | 25 | <view v-if="item.statusName"> |
| 26 | - 命令状态: | 26 | + {{ $t('device.commandStatus') }}: |
| 27 | <text :style="{color:formatCommandStatus(item.status)}" class="ml-16"> | 27 | <text :style="{color:formatCommandStatus(item.status)}" class="ml-16"> |
| 28 | - {{ item.statusName }} | 28 | + {{ statusEnum[item.status]?$t(statusEnum[item.status]):item.statusName }} |
| 29 | </text> | 29 | </text> |
| 30 | </view> | 30 | </view> |
| 31 | <view class="item-first"> | 31 | <view class="item-first"> |
| 32 | <view> | 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 | </view> | 35 | </view> |
| 36 | <view class="time">{{ format(item.createTime) }}</view> | 36 | <view class="time">{{ format(item.createTime) }}</view> |
| 37 | </view> | 37 | </view> |
| @@ -41,24 +41,24 @@ | @@ -41,24 +41,24 @@ | ||
| 41 | <!-- 命令记录弹窗筛选 --> | 41 | <!-- 命令记录弹窗筛选 --> |
| 42 | <u-popup @close="close" closeable bgColor="#fff" :show="show" mode="bottom" :round="20"> | 42 | <u-popup @close="close" closeable bgColor="#fff" :show="show" mode="bottom" :round="20"> |
| 43 | <view class="filter" @touchmove.stop.prevent="disabledScroll"> | 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 | @clickTag="currentIndex => handleClickTag(currentIndex, issueStatus)"></query-item> | 46 | @clickTag="currentIndex => handleClickTag(currentIndex, issueStatus)"></query-item> |
| 47 | <view class="flex-column"> | 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 | <view class="mt-3"> | 49 | <view class="mt-3"> |
| 50 | <uni-datetime-picker return-type="timestamp" v-model="range" type="datetimerange" | 50 | <uni-datetime-picker return-type="timestamp" v-model="range" type="datetimerange" |
| 51 | - rangeSeparator="至" /> | 51 | + :rangeSeparator="$t('common.toText')" /> |
| 52 | </view> | 52 | </view> |
| 53 | </view> | 53 | </view> |
| 54 | <view class="h-30"></view> | 54 | <view class="h-30"></view> |
| 55 | <view class="button-group"> | 55 | <view class="button-group"> |
| 56 | <view> | 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 | @click="resetFilter"></u-button> | 58 | @click="resetFilter"></u-button> |
| 59 | </view> | 59 | </view> |
| 60 | <view> | 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 | </view> | 62 | </view> |
| 63 | </view> | 63 | </view> |
| 64 | </view> | 64 | </view> |
| @@ -112,6 +112,11 @@ | @@ -112,6 +112,11 @@ | ||
| 112 | page: { | 112 | page: { |
| 113 | num: 0, | 113 | num: 0, |
| 114 | size: 10 | 114 | size: 10 |
| 115 | + }, | ||
| 116 | + statusEnum:{ | ||
| 117 | + SUCCESSFUL:'device.responseSuccess', | ||
| 118 | + EXPIRED:'device.expired', | ||
| 119 | + DELIVERED:'device.successSent', | ||
| 115 | } | 120 | } |
| 116 | }; | 121 | }; |
| 117 | }, | 122 | }, |
| @@ -232,4 +237,4 @@ | @@ -232,4 +237,4 @@ | ||
| 232 | 237 | ||
| 233 | <style lang="scss" scoped> | 238 | <style lang="scss" scoped> |
| 234 | @import "../static/command-record.scss"; | 239 | @import "../static/command-record.scss"; |
| 235 | -</style> | ||
| 240 | +</style> |
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | <view class="historyData-top"> | 5 | <view class="historyData-top"> |
| 6 | <u-form :label-style="{ 'font-size': '0rpx' }"> | 6 | <u-form :label-style="{ 'font-size': '0rpx' }"> |
| 7 | <u-form-item @click="openCalendar"> | 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 | border="none" suffixIcon="arrow-down"> | 9 | border="none" suffixIcon="arrow-down"> |
| 10 | <template slot="prefix"> | 10 | <template slot="prefix"> |
| 11 | <image class="icon" src="../../../static/can-der.png"></image> | 11 | <image class="icon" src="../../../static/can-der.png"></image> |
| @@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
| 13 | </u-input> | 13 | </u-input> |
| 14 | </u-form-item> | 14 | </u-form-item> |
| 15 | <u-form-item @click="openTimeGap"> | 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 | border="none" suffixIcon="arrow-down"> | 17 | border="none" suffixIcon="arrow-down"> |
| 18 | <template slot="prefix"> | 18 | <template slot="prefix"> |
| 19 | <image class="icon" src="../../../static/time.png"></image> | 19 | <image class="icon" src="../../../static/time.png"></image> |
| @@ -21,18 +21,18 @@ | @@ -21,18 +21,18 @@ | ||
| 21 | </u-input> | 21 | </u-input> |
| 22 | </u-form-item> | 22 | </u-form-item> |
| 23 | <u-form-item @click="openAvg"> | 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 | suffixIcon="arrow-down" /> | 25 | suffixIcon="arrow-down" /> |
| 26 | </u-form-item> | 26 | </u-form-item> |
| 27 | <u-form-item @click="openTimeGap" v-if="limitFlag"> | 27 | <u-form-item @click="openTimeGap" v-if="limitFlag"> |
| 28 | <view class="u-flex"> | 28 | <view class="u-flex"> |
| 29 | - <text>最大条数</text> | 29 | + <text>{{ $t('device.maximumNumber') }}</text> |
| 30 | <u-number-box style="margin-left:30rpx" class="ml-10" v-model="timeData.limit" :min="7" | 30 | <u-number-box style="margin-left:30rpx" class="ml-10" v-model="timeData.limit" :min="7" |
| 31 | :max="50000"></u-number-box> | 31 | :max="50000"></u-number-box> |
| 32 | </view> | 32 | </view> |
| 33 | </u-form-item> | 33 | </u-form-item> |
| 34 | <u-form-item @click="openType"> | 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 | disabledColor="#377DFF0D" suffixIcon="arrow-down" /> | 36 | disabledColor="#377DFF0D" suffixIcon="arrow-down" /> |
| 37 | </u-form-item> | 37 | </u-form-item> |
| 38 | </u-form> | 38 | </u-form> |
| @@ -47,8 +47,8 @@ | @@ -47,8 +47,8 @@ | ||
| 47 | <view class="historyData-bottom" v-show="historyData.length"> | 47 | <view class="historyData-bottom" v-show="historyData.length"> |
| 48 | <view class="table"> | 48 | <view class="table"> |
| 49 | <view class="tr bg-w" v-if="historyData.length"> | 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 | </view> | 52 | </view> |
| 53 | <view class="tr bg-g" :class="{ odd: index % 2 === 0 }" v-for="(item, index) in historyData" | 53 | <view class="tr bg-g" :class="{ odd: index % 2 === 0 }" v-for="(item, index) in historyData" |
| 54 | :key="index"> | 54 | :key="index"> |
| @@ -57,14 +57,15 @@ | @@ -57,14 +57,15 @@ | ||
| 57 | </view> | 57 | </view> |
| 58 | </view> | 58 | </view> |
| 59 | </view> | 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 | @close="calendarClose"></u-calendar> | 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 | @cancel="cancelTimeGap" @close="cancelTimeGap" :defaultIndex="[3]"></u-picker> | 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 | @cancel="cancelTypeGap" @close="cancelTypeGap"></u-picker> | 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 | @confirm="confirmAvgGap" @cancel="showSelectAvg=false" @close="showSelectAvg=false"></u-picker> | 69 | @confirm="confirmAvgGap" @cancel="showSelectAvg=false" @close="showSelectAvg=false"></u-picker> |
| 69 | </view> | 70 | </view> |
| 70 | </template> | 71 | </template> |
| @@ -127,26 +128,26 @@ | @@ -127,26 +128,26 @@ | ||
| 127 | limitFlag: true, | 128 | limitFlag: true, |
| 128 | avgColumns: [ | 129 | avgColumns: [ |
| 129 | [{ | 130 | [{ |
| 130 | - label: '最小值', | 131 | + label: this.$t('common.minText'), |
| 131 | value: 'MIN' | 132 | value: 'MIN' |
| 132 | }, { | 133 | }, { |
| 133 | - label: '最大值', | 134 | + label: this.$t('common.maxText'), |
| 134 | value: 'MAX' | 135 | value: 'MAX' |
| 135 | }, | 136 | }, |
| 136 | { | 137 | { |
| 137 | - label: '平均值', | 138 | + label: this.$t('common.averageText'), |
| 138 | value: 'AVG' | 139 | value: 'AVG' |
| 139 | }, | 140 | }, |
| 140 | { | 141 | { |
| 141 | - label: '求和', | 142 | + label: this.$t('common.summationText'), |
| 142 | value: 'SUM' | 143 | value: 'SUM' |
| 143 | }, | 144 | }, |
| 144 | { | 145 | { |
| 145 | - label: '计数', | 146 | + label: this.$t('common.countText'), |
| 146 | value: 'COUNT' | 147 | value: 'COUNT' |
| 147 | }, | 148 | }, |
| 148 | { | 149 | { |
| 149 | - label: '空', | 150 | + label: this.$t('common.emptyText'), |
| 150 | value: 'NONE' | 151 | value: 'NONE' |
| 151 | }, | 152 | }, |
| 152 | ] | 153 | ] |
| @@ -169,41 +170,41 @@ | @@ -169,41 +170,41 @@ | ||
| 169 | }, | 170 | }, |
| 170 | columns: [ | 171 | columns: [ |
| 171 | [{ | 172 | [{ |
| 172 | - label: '5分钟', | 173 | + label: '5' + this.$t('common.minuteText'), |
| 173 | value: 300000 | 174 | value: 300000 |
| 174 | }, | 175 | }, |
| 175 | 176 | ||
| 176 | 177 | ||
| 177 | { | 178 | { |
| 178 | - label: '10分钟', | 179 | + label: '10' + this.$t('common.minuteText'), |
| 179 | value: 600000 | 180 | value: 600000 |
| 180 | }, | 181 | }, |
| 181 | { | 182 | { |
| 182 | - label: '15分钟', | 183 | + label: '15' + this.$t('common.minuteText'), |
| 183 | value: 900000 | 184 | value: 900000 |
| 184 | }, | 185 | }, |
| 185 | { | 186 | { |
| 186 | - label: '30分钟', | 187 | + label: '30' + this.$t('common.minuteText'), |
| 187 | value: 1800000 | 188 | value: 1800000 |
| 188 | }, | 189 | }, |
| 189 | { | 190 | { |
| 190 | - label: '1小时', | 191 | + label: '1' + this.$t('common.hourText'), |
| 191 | value: 3600000 | 192 | value: 3600000 |
| 192 | }, | 193 | }, |
| 193 | { | 194 | { |
| 194 | - label: '2小时', | 195 | + label: '2' + this.$t('common.hourText'), |
| 195 | value: 7200000 | 196 | value: 7200000 |
| 196 | } | 197 | } |
| 197 | ] | 198 | ] |
| 198 | ], | 199 | ], |
| 199 | timeData: { | 200 | timeData: { |
| 200 | - selectTime: this.yesterday + ' 至 ' + this.today, | 201 | + selectTime: this.yesterday + this.$t('common.toText') + this.today, |
| 201 | getTimeGap: this.timeDiff, | 202 | getTimeGap: this.timeDiff, |
| 202 | getType: this.keys[0].name, | 203 | getType: this.keys[0].name, |
| 203 | limit: 7, | 204 | limit: 7, |
| 204 | agg: 'NONE' | 205 | agg: 'NONE' |
| 205 | }, | 206 | }, |
| 206 | - aggText: '空' | 207 | + aggText: this.$t('common.emptyText') |
| 207 | }; | 208 | }; |
| 208 | }, | 209 | }, |
| 209 | watch: { | 210 | watch: { |
| @@ -227,27 +228,27 @@ | @@ -227,27 +228,27 @@ | ||
| 227 | // 小于7天 | 228 | // 小于7天 |
| 228 | return [ | 229 | return [ |
| 229 | [{ | 230 | [{ |
| 230 | - label: '5分钟', | 231 | + label: '5' + this.$t('common.minuteText'), |
| 231 | value: 300000 | 232 | value: 300000 |
| 232 | }, | 233 | }, |
| 233 | { | 234 | { |
| 234 | - label: '10分钟', | 235 | + label: '10' + this.$t('common.minuteText'), |
| 235 | value: 600000 | 236 | value: 600000 |
| 236 | }, | 237 | }, |
| 237 | { | 238 | { |
| 238 | - label: '15分钟', | 239 | + label: '15' + this.$t('common.minuteText'), |
| 239 | value: 900000 | 240 | value: 900000 |
| 240 | }, | 241 | }, |
| 241 | { | 242 | { |
| 242 | - label: '30分钟', | 243 | + label: '30' + this.$t('common.minuteText'), |
| 243 | value: 1800000 | 244 | value: 1800000 |
| 244 | }, | 245 | }, |
| 245 | { | 246 | { |
| 246 | - label: '1小时', | 247 | + label: '1' + this.$t('common.hourText'), |
| 247 | value: 3600000 | 248 | value: 3600000 |
| 248 | }, | 249 | }, |
| 249 | { | 250 | { |
| 250 | - label: '2小时', | 251 | + label: '2' + this.$t('common.hourText'), |
| 251 | value: 7200000 | 252 | value: 7200000 |
| 252 | } | 253 | } |
| 253 | ] | 254 | ] |
| @@ -256,31 +257,31 @@ | @@ -256,31 +257,31 @@ | ||
| 256 | // 小于30天 | 257 | // 小于30天 |
| 257 | return [ | 258 | return [ |
| 258 | [{ | 259 | [{ |
| 259 | - label: '30分钟', | 260 | + label: '30' + this.$t('common.minuteText'), |
| 260 | value: 1800000 | 261 | value: 1800000 |
| 261 | }, | 262 | }, |
| 262 | { | 263 | { |
| 263 | - label: '1小时', | 264 | + label: '1' + this.$t('common.hourText'), |
| 264 | value: 3600000 | 265 | value: 3600000 |
| 265 | }, | 266 | }, |
| 266 | { | 267 | { |
| 267 | - label: '2小时', | 268 | + label: '2' + this.$t('common.hourText'), |
| 268 | value: 7200000 | 269 | value: 7200000 |
| 269 | }, | 270 | }, |
| 270 | { | 271 | { |
| 271 | - label: '5小时', | 272 | + label: '5' + this.$t('common.hourText'), |
| 272 | value: 18000000 | 273 | value: 18000000 |
| 273 | }, | 274 | }, |
| 274 | { | 275 | { |
| 275 | - label: '10小时', | 276 | + label: '10' + this.$t('common.hourText'), |
| 276 | value: 36000000 | 277 | value: 36000000 |
| 277 | }, | 278 | }, |
| 278 | { | 279 | { |
| 279 | - label: '12小时', | 280 | + label: '12' + this.$t('common.hourText'), |
| 280 | value: 43200000 | 281 | value: 43200000 |
| 281 | }, | 282 | }, |
| 282 | { | 283 | { |
| 283 | - label: '1天', | 284 | + label: '1' + this.$t('common.dayText'), |
| 284 | value: 86400000 | 285 | value: 86400000 |
| 285 | } | 286 | } |
| 286 | ] | 287 | ] |
| @@ -289,23 +290,23 @@ | @@ -289,23 +290,23 @@ | ||
| 289 | // 大于30天 | 290 | // 大于30天 |
| 290 | return [ | 291 | return [ |
| 291 | [{ | 292 | [{ |
| 292 | - label: '2小时', | 293 | + label: '2' + this.$t('common.hourText'), |
| 293 | value: 7200000 | 294 | value: 7200000 |
| 294 | }, | 295 | }, |
| 295 | { | 296 | { |
| 296 | - label: '5小时', | 297 | + label: '5' + this.$t('common.hourText'), |
| 297 | value: 18000000 | 298 | value: 18000000 |
| 298 | }, | 299 | }, |
| 299 | { | 300 | { |
| 300 | - label: '10小时', | 301 | + label: '10' + this.$t('common.hourText'), |
| 301 | value: 36000000 | 302 | value: 36000000 |
| 302 | }, | 303 | }, |
| 303 | { | 304 | { |
| 304 | - label: '12小时', | 305 | + label: '12' + this.$t('common.hourText'), |
| 305 | value: 43200000 | 306 | value: 43200000 |
| 306 | }, | 307 | }, |
| 307 | { | 308 | { |
| 308 | - label: '1天', | 309 | + label: '1' + this.$t('common.dayText'), |
| 309 | value: 86400000 | 310 | value: 86400000 |
| 310 | } | 311 | } |
| 311 | ] | 312 | ] |
| @@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
| 10 | shape="circle" | 10 | shape="circle" |
| 11 | type="number" | 11 | type="number" |
| 12 | v-model.number="seriesForm[item.identifier]" | 12 | v-model.number="seriesForm[item.identifier]" |
| 13 | - :placeholder="`请输入${item.functionName}`" | 13 | + :placeholder="`${$t('common.inputText')}${item.functionName}`" |
| 14 | @blur="(e)=>handleBlur(e,item.identifier)" | 14 | @blur="(e)=>handleBlur(e,item.identifier)" |
| 15 | /> | 15 | /> |
| 16 | <u-input v-if="item.dataType.type == 'TEXT'" shape="circle" type="text" v-model="seriesForm[item.identifier]" :placeholder="`请输入${item.functionName}`" /> | 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,7 +18,7 @@ | ||
| 18 | <u-input | 18 | <u-input |
| 19 | shape="circle" | 19 | shape="circle" |
| 20 | v-model="seriesForm[item.identifier]" | 20 | v-model="seriesForm[item.identifier]" |
| 21 | - :placeholder="`请选择${item.functionName}`" | 21 | + :placeholder="`${$t('common.chooseText')}${item.functionName}`" |
| 22 | disabled | 22 | disabled |
| 23 | disabledColor="#fff" | 23 | disabledColor="#fff" |
| 24 | suffixIcon="arrow-down" | 24 | suffixIcon="arrow-down" |
| @@ -36,7 +36,7 @@ | @@ -36,7 +36,7 @@ | ||
| 36 | <u-input | 36 | <u-input |
| 37 | shape="circle" | 37 | shape="circle" |
| 38 | v-model="seriesForm[item.identifier]" | 38 | v-model="seriesForm[item.identifier]" |
| 39 | - :placeholder="`请选择${item.functionName}`" | 39 | + :placeholder="`${$t('common.chooseText')}${item.functionName}`" |
| 40 | disabled | 40 | disabled |
| 41 | disabledColor="#fff" | 41 | disabledColor="#fff" |
| 42 | suffixIcon="arrow-down" | 42 | suffixIcon="arrow-down" |
| @@ -55,7 +55,7 @@ | @@ -55,7 +55,7 @@ | ||
| 55 | </template> | 55 | </template> |
| 56 | </view> | 56 | </view> |
| 57 | <view v-else class="positionLeft" style=" border: 1px dashed #f0f0f0; padding: 20rpx;"> | 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 | <u-input v-model="seriesForm.serviceCommand" type="text" shape="circle" :disabled="true"></u-input> | 59 | <u-input v-model="seriesForm.serviceCommand" type="text" shape="circle" :disabled="true"></u-input> |
| 60 | </view> | 60 | </view> |
| 61 | </u-form-item> | 61 | </u-form-item> |
| @@ -139,15 +139,15 @@ export default { | @@ -139,15 +139,15 @@ export default { | ||
| 139 | const { max = 2147483647, min = -2147483647 } = valueRange || {} | 139 | const { max = 2147483647, min = -2147483647 } = valueRange || {} |
| 140 | if (type !== 'STRUCT') { | 140 | if (type !== 'STRUCT') { |
| 141 | this.seriesRules[identifier] = [ | 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 | type == 'INT' || type == 'DOUBLE' | 143 | type == 'INT' || type == 'DOUBLE' |
| 144 | ? { | 144 | ? { |
| 145 | type: 'number', | 145 | type: 'number', |
| 146 | trigger: 'change', | 146 | trigger: 'change', |
| 147 | validator: (_rule, value) => { | 147 | validator: (_rule, value) => { |
| 148 | const reg = /^[0-9]*$/ | 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 | return Promise.resolve(value) | 152 | return Promise.resolve(value) |
| 153 | }, | 153 | }, |
| @@ -157,7 +157,7 @@ export default { | @@ -157,7 +157,7 @@ export default { | ||
| 157 | type: 'string', | 157 | type: 'string', |
| 158 | trigger: 'change', | 158 | trigger: 'change', |
| 159 | validator: (_rule, value) => { | 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 | return Promise.resolve(value) | 162 | return Promise.resolve(value) |
| 163 | }, | 163 | }, |
| @@ -186,7 +186,7 @@ export default { | @@ -186,7 +186,7 @@ export default { | ||
| 186 | const { specs } = dataType || {} | 186 | const { specs } = dataType || {} |
| 187 | const { boolClose, boolOpen } = specs || {} | 187 | const { boolClose, boolOpen } = specs || {} |
| 188 | if(!boolClose&&!boolOpen){ | 188 | if(!boolClose&&!boolOpen){ |
| 189 | - uni.$u.toast(`暂无可选的${name}`) | 189 | + uni.$u.toast(this.$t('device.noCurrently') + name) |
| 190 | this.boolList = [] | 190 | this.boolList = [] |
| 191 | return | 191 | return |
| 192 | } | 192 | } |
| @@ -217,7 +217,7 @@ export default { | @@ -217,7 +217,7 @@ export default { | ||
| 217 | this.enumList = specsList || [] | 217 | this.enumList = specsList || [] |
| 218 | console.log(this.enumList,'enumInfo') | 218 | console.log(this.enumList,'enumInfo') |
| 219 | if(!this.enumList.length){ | 219 | if(!this.enumList.length){ |
| 220 | - return uni.$u.toast(`暂无可选的${name}`) | 220 | + return uni.$u.toast(this.$t('device.noCurrently') + name) |
| 221 | } | 221 | } |
| 222 | this.seriesFunctionList.forEach((item, index) => { | 222 | this.seriesFunctionList.forEach((item, index) => { |
| 223 | if (index == num) { | 223 | if (index == num) { |
| 1 | const list = [ | 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 | const issueStatus = [ | 16 | const issueStatus = [ |
| 17 | { | 17 | { |
| 18 | checked: true, | 18 | checked: true, |
| 19 | - name: '全部', | 19 | + name: 'common.allText', |
| 20 | type: '', | 20 | type: '', |
| 21 | }, | 21 | }, |
| 22 | { | 22 | { |
| 23 | checked: false, | 23 | checked: false, |
| 24 | - name: '队列中', | 24 | + name: 'device.inQueue', |
| 25 | type: 'QUEUED', | 25 | type: 'QUEUED', |
| 26 | }, | 26 | }, |
| 27 | { | 27 | { |
| 28 | checked: false, | 28 | checked: false, |
| 29 | - name: '已发送', | 29 | + name: 'device.hasBeenSent', |
| 30 | type: 'SENT', | 30 | type: 'SENT', |
| 31 | }, | 31 | }, |
| 32 | { | 32 | { |
| 33 | checked: false, | 33 | checked: false, |
| 34 | - name: '发送成功', | 34 | + name: 'device.successSent', |
| 35 | type: 'DELIVERED', | 35 | type: 'DELIVERED', |
| 36 | }, | 36 | }, |
| 37 | { | 37 | { |
| 38 | checked: false, | 38 | checked: false, |
| 39 | - name: '响应成功', | 39 | + name: 'device.responseSuccess', |
| 40 | type: 'SUCCESSFUL', | 40 | type: 'SUCCESSFUL', |
| 41 | }, | 41 | }, |
| 42 | { | 42 | { |
| 43 | checked: false, | 43 | checked: false, |
| 44 | - name: '超时', | 44 | + name: 'device.timeout', |
| 45 | type: 'TIMEOUT', | 45 | type: 'TIMEOUT', |
| 46 | }, | 46 | }, |
| 47 | { | 47 | { |
| 48 | checked: false, | 48 | checked: false, |
| 49 | - name: '已过期', | 49 | + name: 'device.expired', |
| 50 | type: 'EXPIRED', | 50 | type: 'EXPIRED', |
| 51 | }, | 51 | }, |
| 52 | { | 52 | { |
| 53 | checked: false, | 53 | checked: false, |
| 54 | - name: '响应失败', | 54 | + name: 'device.ResponseFailed', |
| 55 | type: 'FAILED', | 55 | type: 'FAILED', |
| 56 | }, | 56 | }, |
| 57 | { | 57 | { |
| 58 | checked: false, | 58 | checked: false, |
| 59 | - name: '已删除', | 59 | + name: 'device.deletedText', |
| 60 | type: 'DELETED', | 60 | type: 'DELETED', |
| 61 | }, | 61 | }, |
| 62 | ] | 62 | ] |
| @@ -64,11 +64,11 @@ const issueStatus = [ | @@ -64,11 +64,11 @@ const issueStatus = [ | ||
| 64 | const commandTypeList = [ | 64 | const commandTypeList = [ |
| 65 | { | 65 | { |
| 66 | value: 'OneWay', | 66 | value: 'OneWay', |
| 67 | - name: '单向', | 67 | + name: 'device.onwWay', |
| 68 | }, | 68 | }, |
| 69 | { | 69 | { |
| 70 | value: 'TwoWay', | 70 | value: 'TwoWay', |
| 71 | - name: '双向', | 71 | + name: 'device.twoWay', |
| 72 | }, | 72 | }, |
| 73 | ] | 73 | ] |
| 74 | 74 |
| @@ -3,13 +3,13 @@ | @@ -3,13 +3,13 @@ | ||
| 3 | <!-- 公共组件-每个页面必须引入 --> | 3 | <!-- 公共组件-每个页面必须引入 --> |
| 4 | <public-module></public-module> | 4 | <public-module></public-module> |
| 5 | <u-sticky :bgColor="bgColor"> | 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 | :inactiveStyle="inActiveColor" :scrollable="isScrollable" itemStyle="padding: 0 11px;display:flex;flex-direction:row;align-items:center;justify-content:start;height:44px" /> | 7 | :inactiveStyle="inActiveColor" :scrollable="isScrollable" itemStyle="padding: 0 11px;display:flex;flex-direction:row;align-items:center;justify-content:start;height:44px" /> |
| 8 | </u-sticky> | 8 | </u-sticky> |
| 9 | <view class="mt-3"> | 9 | <view class="mt-3"> |
| 10 | - <basic-info v-show=" currentTab == 0 " :deviceDetail=" deviceDetail " /> | 10 | + <basic-info v-show="currentTab == 0" :deviceDetail=" deviceDetail " /> |
| 11 | <realtime-data v-show=" currentTab === 1 " :recordList=" recordList " /> | 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 | :historyData=" historyData " :entityId=" entityId " :start=" startTs " :end=" endTs " @update=" handleUpdate " /> | 13 | :historyData=" historyData " :entityId=" entityId " :start=" startTs " :end=" endTs " @update=" handleUpdate " /> |
| 14 | <alarm-history v-show=" currentTab === 3 " :deviceId=" deviceId " /> | 14 | <alarm-history v-show=" currentTab === 3 " :deviceId=" deviceId " /> |
| 15 | <commond-record v-if=" currentTab === 4 " :tbDeviceId=" entityId " /> | 15 | <commond-record v-if=" currentTab === 4 " :tbDeviceId=" entityId " /> |
| @@ -77,6 +77,13 @@ export default { | @@ -77,6 +77,13 @@ export default { | ||
| 77 | // 页面关闭时,销毁webSocket连接,否则第二次会存在连接不到的情况 | 77 | // 页面关闭时,销毁webSocket连接,否则第二次会存在连接不到的情况 |
| 78 | uni.closeSocket(); | 78 | uni.closeSocket(); |
| 79 | }, | 79 | }, |
| 80 | + onShow(){ | ||
| 81 | + this.$nextTick(()=>{ | ||
| 82 | + uni.setNavigationBarTitle({ | ||
| 83 | + title:this.$t('menu.deviceDetail') | ||
| 84 | + }) | ||
| 85 | + }) | ||
| 86 | + }, | ||
| 80 | async onLoad(options) { | 87 | async onLoad(options) { |
| 81 | const { id, alarmStatus, lastOnlineTime, tbDeviceId, deviceProfileId, transportType } = options; | 88 | const { id, alarmStatus, lastOnlineTime, tbDeviceId, deviceProfileId, transportType } = options; |
| 82 | this.deviceId = id; | 89 | this.deviceId = id; |
| @@ -92,17 +99,17 @@ export default { | @@ -92,17 +99,17 @@ export default { | ||
| 92 | // 设备类型不是网关子设备的添加一个命令记录的选项卡 | 99 | // 设备类型不是网关子设备的添加一个命令记录的选项卡 |
| 93 | if (this.deviceDetail.deviceType !== "SENSOR") { | 100 | if (this.deviceDetail.deviceType !== "SENSOR") { |
| 94 | this.list.push({ | 101 | this.list.push({ |
| 95 | - name: "命令记录", | 102 | + name: 'device.commandRecord', |
| 96 | }); | 103 | }); |
| 97 | const res = new Map() | 104 | const res = new Map() |
| 98 | this.list = this.list.filter((item) => !res.has(item.name) && res.set(item.name, 1)) | 105 | this.list = this.list.filter((item) => !res.has(item.name) && res.set(item.name, 1)) |
| 99 | } else { | 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 | if (transportType === deviceTypeNum.GBT) { | 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 | if (res.deviceProfileId) { | 113 | if (res.deviceProfileId) { |
| 107 | this.getAttrList = await api.deviceApi.getAttribute(res.deviceProfileId) | 114 | this.getAttrList = await api.deviceApi.getAttribute(res.deviceProfileId) |
| 108 | if (Array.isArray(this.getAttrList)) { | 115 | if (Array.isArray(this.getAttrList)) { |
| @@ -199,7 +206,7 @@ export default { | @@ -199,7 +206,7 @@ export default { | ||
| 199 | limit: 7, | 206 | limit: 7, |
| 200 | agg: 'NONE' | 207 | agg: 'NONE' |
| 201 | }); | 208 | }); |
| 202 | - this.timeDiff = "30分钟"; | 209 | + this.timeDiff = 30 + this.$t('common.minuteText'); |
| 203 | if (!Object.keys(data).length) return; | 210 | if (!Object.keys(data).length) return; |
| 204 | this.historyData = data[keys[0]].map((item) => { | 211 | this.historyData = data[keys[0]].map((item) => { |
| 205 | return { | 212 | return { |
| @@ -38,6 +38,13 @@ export default { | @@ -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 | onLoad(e) { | 48 | onLoad(e) { |
| 42 | let params = null; | 49 | let params = null; |
| 43 | if (e.data !== null) { | 50 | if (e.data !== null) { |
| @@ -65,7 +65,7 @@ | @@ -65,7 +65,7 @@ | ||
| 65 | 65 | ||
| 66 | .item-fail { | 66 | .item-fail { |
| 67 | color: #848383; | 67 | color: #848383; |
| 68 | - background-color: #84838325; | 68 | + // background-color: #84838325; |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | .item.success { | 71 | .item.success { |
| @@ -101,4 +101,4 @@ | @@ -101,4 +101,4 @@ | ||
| 101 | font-size: 14px; | 101 | font-size: 14px; |
| 102 | font-weight: 700; | 102 | font-weight: 700; |
| 103 | } | 103 | } |
| 104 | - } | ||
| 104 | + } |
feedback-subpackage/feedback/config/data.js
deleted
100644 → 0
| 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 | -} |
| @@ -4,33 +4,33 @@ | @@ -4,33 +4,33 @@ | ||
| 4 | <!-- 公共组件-每个页面必须引入 --> | 4 | <!-- 公共组件-每个页面必须引入 --> |
| 5 | <public-module></public-module> | 5 | <public-module></public-module> |
| 6 | <view class="form-page"> | 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 | </u--input> | 10 | </u--input> |
| 11 | </u-form-item> | 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 | </u-form-item> | 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 | </u--textarea> | 17 | </u--textarea> |
| 18 | </u-form-item> | 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 | <view class="info"> | 20 | <view class="info"> |
| 21 | <view class="info-contain"> | 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 | <u-upload :capture="capture" :fileList="fileList1" @afterRead="afterRead" | 23 | <u-upload :capture="capture" :fileList="fileList1" @afterRead="afterRead" |
| 24 | @delete="deletePic" name="1" multiple :maxCount="6"></u-upload> | 24 | @delete="deletePic" name="1" multiple :maxCount="6"></u-upload> |
| 25 | </u-form-item> | 25 | </u-form-item> |
| 26 | </view> | 26 | </view> |
| 27 | <view class="info-button"> | 27 | <view class="info-button"> |
| 28 | <!-- #ifdef MP --> | 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 | customStyle="margin-top: 280rpx" @click="submit"></u-button> | 30 | customStyle="margin-top: 280rpx" @click="submit"></u-button> |
| 31 | <!-- #endif --> | 31 | <!-- #endif --> |
| 32 | <!-- #ifdef APP-PLUS --> | 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 | customStyle="margin-top: 880rpx" @click="submit"></u-button> | 34 | customStyle="margin-top: 880rpx" @click="submit"></u-button> |
| 35 | <!-- #endif --> | 35 | <!-- #endif --> |
| 36 | </view> | 36 | </view> |
| @@ -46,7 +46,6 @@ | @@ -46,7 +46,6 @@ | ||
| 46 | </view> | 46 | </view> |
| 47 | <view style="height: 20rpx;"></view> | 47 | <view style="height: 20rpx;"></view> |
| 48 | </view> | 48 | </view> |
| 49 | - </view> | ||
| 50 | </template> | 49 | </template> |
| 51 | 50 | ||
| 52 | <script> | 51 | <script> |
| @@ -55,7 +54,6 @@ | @@ -55,7 +54,6 @@ | ||
| 55 | mapState | 54 | mapState |
| 56 | } from 'vuex'; | 55 | } from 'vuex'; |
| 57 | import api from '@/api/index.js' | 56 | import api from '@/api/index.js' |
| 58 | - import { rules } from './config/data.js' | ||
| 59 | import { UPLOAD_FILE_SIZE } from '@/constant/index.js' | 57 | import { UPLOAD_FILE_SIZE } from '@/constant/index.js' |
| 60 | 58 | ||
| 61 | export default { | 59 | export default { |
| @@ -71,9 +69,16 @@ | @@ -71,9 +69,16 @@ | ||
| 71 | } | 69 | } |
| 72 | }, | 70 | }, |
| 73 | fileList1: [], | 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 | onReady() { | 82 | onReady() { |
| 78 | // 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则 | 83 | // 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则 |
| 79 | this.$refs.myfeedBackFormRef.setRules(this.rules); | 84 | this.$refs.myfeedBackFormRef.setRules(this.rules); |
| @@ -81,6 +86,26 @@ | @@ -81,6 +86,26 @@ | ||
| 81 | onLoad() { | 86 | onLoad() { |
| 82 | // 隐藏原生的tabbar | 87 | // 隐藏原生的tabbar |
| 83 | uni.hideTabBar(); | 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 | computed: { | 110 | computed: { |
| 86 | ...mapState(['userInfo']) | 111 | ...mapState(['userInfo']) |
| @@ -99,20 +124,20 @@ | @@ -99,20 +124,20 @@ | ||
| 99 | this[`fileList${event.name}`].push({ | 124 | this[`fileList${event.name}`].push({ |
| 100 | ...item, | 125 | ...item, |
| 101 | status: 'error', | 126 | status: 'error', |
| 102 | - message: '上传失败' | 127 | + message: this.$t('userCenter.uploadFailed') |
| 103 | }); | 128 | }); |
| 104 | } else { | 129 | } else { |
| 105 | this[`fileList${event.name}`].push({ | 130 | this[`fileList${event.name}`].push({ |
| 106 | ...item, | 131 | ...item, |
| 107 | status: 'uploading', | 132 | status: 'uploading', |
| 108 | - message: '上传中' | 133 | + message: this.$t('userCenter.uploading') |
| 109 | }); | 134 | }); |
| 110 | } | 135 | } |
| 111 | }); | 136 | }); |
| 112 | for (let i = 0; i < lists.length; i++) { | 137 | for (let i = 0; i < lists.length; i++) { |
| 113 | const judgeImageSize = lists[0].size | 138 | const judgeImageSize = lists[0].size |
| 114 | if (judgeImageSize > UPLOAD_FILE_SIZE) { | 139 | if (judgeImageSize > UPLOAD_FILE_SIZE) { |
| 115 | - return uni.$u.toast('图片限定5M') | 140 | + return uni.$u.toast(this.$t('userCenter.image5m')) |
| 116 | } else { | 141 | } else { |
| 117 | const result = await this.uploadFilePromise(lists[i].url); | 142 | const result = await this.uploadFilePromise(lists[i].url); |
| 118 | let item = this[`fileList${event.name}`][fileListLen]; | 143 | let item = this[`fileList${event.name}`][fileListLen]; |
| @@ -135,7 +160,7 @@ | @@ -135,7 +160,7 @@ | ||
| 135 | // #ifdef H5 | 160 | // #ifdef H5 |
| 136 | token = window.sessionStorage.getItem('userInfo').isToken; | 161 | token = window.sessionStorage.getItem('userInfo').isToken; |
| 137 | // #endif | 162 | // #endif |
| 138 | - if (!token) return uni.$u.toast('请登录后上传图片'); | 163 | + if (!token) return uni.$u.toast(this.$t('userCenter.pleaseLogUpload')); |
| 139 | return new Promise((resolve, reject) => { | 164 | return new Promise((resolve, reject) => { |
| 140 | uni.uploadFile({ | 165 | uni.uploadFile({ |
| 141 | url: `${baseUrl.baseUrl}/yt/oss/upload`, | 166 | url: `${baseUrl.baseUrl}/yt/oss/upload`, |
| @@ -158,7 +183,7 @@ | @@ -158,7 +183,7 @@ | ||
| 158 | resolve(res.data?.fileStaticUri); | 183 | resolve(res.data?.fileStaticUri); |
| 159 | } | 184 | } |
| 160 | } else { | 185 | } else { |
| 161 | - return uni.$u.toast('图片上传失败') | 186 | + return uni.$u.toast(this.$t('userCenter.imageUploadFail')) |
| 162 | } | 187 | } |
| 163 | }, 1000); | 188 | }, 1000); |
| 164 | } | 189 | } |
| @@ -179,14 +204,14 @@ | @@ -179,14 +204,14 @@ | ||
| 179 | message: this.feedbackData.feedbackInfo.message | 204 | message: this.feedbackData.feedbackInfo.message |
| 180 | }; | 205 | }; |
| 181 | const res = await api.feedbackApi.postFeedBackApi(data) | 206 | const res = await api.feedbackApi.postFeedBackApi(data) |
| 182 | - uni.$u.toast('意见反馈提交成功~'); | 207 | + uni.$u.toast(this.$t('userCenter.feedbacksubmitSuccess')); |
| 183 | setTimeout(() => { | 208 | setTimeout(() => { |
| 184 | uni.navigateBack(); | 209 | uni.navigateBack(); |
| 185 | }, 500); | 210 | }, 500); |
| 186 | } | 211 | } |
| 187 | }) | 212 | }) |
| 188 | .catch(errors => { | 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,4 +227,4 @@ | ||
| 202 | } | 227 | } |
| 203 | 228 | ||
| 204 | //#endif | 229 | //#endif |
| 205 | -</style> | ||
| 230 | +</style> |
locale/en.json
0 → 100644
| 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 | +} |
locale/lang/en/alarm.js
0 → 100644
| 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 | +} |
locale/lang/en/common.js
0 → 100644
| 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: 'No' | ||
| 57 | + | ||
| 58 | + | ||
| 59 | +} |
locale/lang/en/components.js
0 → 100644
locale/lang/en/device.js
0 → 100644
| 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 | +} |
locale/lang/en/homePage.js
0 → 100644
| 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 | +} |
locale/lang/en/index.js
0 → 100644
| 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 | +} |
locale/lang/en/login.js
0 → 100644
| 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 | +} |
locale/lang/en/menu.js
0 → 100644
| 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 | +} |
locale/lang/en/userCenter.js
0 → 100644
| 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 | +} |
locale/lang/zh-CN/alarm.js
0 → 100644
| 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 | +} |
locale/lang/zh-CN/common.js
0 → 100644
| 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 | +} |
locale/lang/zh-CN/components.js
0 → 100644
locale/lang/zh-CN/device.js
0 → 100644
| 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 | +} |
locale/lang/zh-CN/homePage.js
0 → 100644
| 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 | +} |
locale/lang/zh-CN/index.js
0 → 100644
| 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 | +} |
locale/lang/zh-CN/login.js
0 → 100644
| 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 | +} |
locale/lang/zh-CN/menu.js
0 → 100644
| 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 | +} |
locale/lang/zh-CN/userCenter.js
0 → 100644
| 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 | +} |
locale/zh-Hans.json
0 → 100644
| 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,21 +5,21 @@ | ||
| 5 | <view class="login-body"> | 5 | <view class="login-body"> |
| 6 | <view class="login-phone"> | 6 | <view class="login-phone"> |
| 7 | <view class="phone-main"> | 7 | <view class="phone-main"> |
| 8 | - <text class="text">手机验证码登录</text> | 8 | + <text class="text">{{ $t('login.phoneLogin') }}</text> |
| 9 | <view class="circleStyle"></view> | 9 | <view class="circleStyle"></view> |
| 10 | </view> | 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 | border="bottom"></u-input></view> | 12 | border="bottom"></u-input></view> |
| 13 | <view class="form-row"> | 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 | <template slot="suffix"> | 15 | <template slot="suffix"> |
| 16 | <view @click="getVerifyCode" class="verify-code">{{ codeText }}</view> | 16 | <view @click="getVerifyCode" class="verify-code">{{ codeText }}</view> |
| 17 | </template> | 17 | </template> |
| 18 | </u-input> | 18 | </u-input> |
| 19 | </view> | 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 | <view class="u-flex account-style"> | 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 | </view> | 23 | </view> |
| 24 | <view class="circleStyleBottom"></view> | 24 | <view class="circleStyleBottom"></view> |
| 25 | </view> | 25 | </view> |
| @@ -41,9 +41,19 @@ | @@ -41,9 +41,19 @@ | ||
| 41 | code: '' | 41 | code: '' |
| 42 | }, | 42 | }, |
| 43 | readonly: false, | 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 | methods: { | 57 | methods: { |
| 48 | ...mapMutations(['setUserInfo']), | 58 | ...mapMutations(['setUserInfo']), |
| 49 | ...mapActions(['updateBadgeTotal']), | 59 | ...mapActions(['updateBadgeTotal']), |
| @@ -51,14 +61,14 @@ | @@ -51,14 +61,14 @@ | ||
| 51 | codeCountdownText() { | 61 | codeCountdownText() { |
| 52 | const _this = this; | 62 | const _this = this; |
| 53 | this.readonly = true; | 63 | this.readonly = true; |
| 54 | - this.codeText = '60s后重新获取'; | 64 | + this.codeText = this.$t('login.codeAfterSeconds',{number:60}); |
| 55 | var s = 60; | 65 | var s = 60; |
| 56 | clear = setInterval(() => { | 66 | clear = setInterval(() => { |
| 57 | s--; | 67 | s--; |
| 58 | - _this.codeText = s + 's后重新获取'; | 68 | + _this.codeText = this.$t('login.codeAfterSeconds',{number:s}); |
| 59 | if (s <= 0) { | 69 | if (s <= 0) { |
| 60 | clearInterval(clear); | 70 | clearInterval(clear); |
| 61 | - _this.codeText = '发送验证码'; | 71 | + _this.codeText = this.$t('login.obtainCode'); |
| 62 | _this.readonly = false; | 72 | _this.readonly = false; |
| 63 | } | 73 | } |
| 64 | }, 1000); | 74 | }, 1000); |
| @@ -71,10 +81,10 @@ | @@ -71,10 +81,10 @@ | ||
| 71 | return | 81 | return |
| 72 | } | 82 | } |
| 73 | if (!this.loginForm.phoneNumber) { | 83 | if (!this.loginForm.phoneNumber) { |
| 74 | - return useShowToast('请输入手机号~') | 84 | + return useShowToast(this.$t('login.PleaseEnterPhone')) |
| 75 | } | 85 | } |
| 76 | if (!phoneRegular.test(this.loginForm.phoneNumber)) { | 86 | if (!phoneRegular.test(this.loginForm.phoneNumber)) { |
| 77 | - return useShowToast('手机号格式不正确~') | 87 | + return useShowToast(this.$t('login.phoneFormatFail')) |
| 78 | } | 88 | } |
| 79 | // 获取验证码接口 | 89 | // 获取验证码接口 |
| 80 | await api.loginApi.postPhoneCodeApi(this.loginForm.phoneNumber) | 90 | await api.loginApi.postPhoneCodeApi(this.loginForm.phoneNumber) |
| @@ -84,10 +94,10 @@ | @@ -84,10 +94,10 @@ | ||
| 84 | const phoneRegular = /^1\d{10}$/; | 94 | const phoneRegular = /^1\d{10}$/; |
| 85 | const verifyCodeReg = /^\d{6}$/; | 95 | const verifyCodeReg = /^\d{6}$/; |
| 86 | const validateValue = Object.values(this.loginForm) | 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 | const res = await api.loginApi.postPhoneLoginApi(this.loginForm) | 101 | const res = await api.loginApi.postPhoneLoginApi(this.loginForm) |
| 92 | if (res) { | 102 | if (res) { |
| 93 | // 储存登录信息 | 103 | // 储存登录信息 |
| @@ -103,7 +113,7 @@ | @@ -103,7 +113,7 @@ | ||
| 103 | if (userInfo.token) { | 113 | if (userInfo.token) { |
| 104 | this.setUserInfo(userInfo); | 114 | this.setUserInfo(userInfo); |
| 105 | } | 115 | } |
| 106 | - useShowToast('登录成功~').then(async (res) => { | 116 | + useShowToast(this.$t('login.loginSuccess')).then(async (res) => { |
| 107 | this.saveUserInfo(); | 117 | this.saveUserInfo(); |
| 108 | await this.getAlarmTotalData(); | 118 | await this.getAlarmTotalData(); |
| 109 | useReLaunch("/pages/index/index") | 119 | useReLaunch("/pages/index/index") |
| @@ -2,28 +2,28 @@ | @@ -2,28 +2,28 @@ | ||
| 2 | <view class="find-password-page"> | 2 | <view class="find-password-page"> |
| 3 | <public-module></public-module> | 3 | <public-module></public-module> |
| 4 | <view class="top u-flex"> | 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 | </view> | 7 | </view> |
| 8 | <view v-if="!nextStatus" class="login-body"> | 8 | <view v-if="!nextStatus" class="login-body"> |
| 9 | <view class="login-phone"> | 9 | <view class="login-phone"> |
| 10 | <view class="form-row"> | 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 | </view> | 12 | </view> |
| 13 | <view class="form-row"> | 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 | <template slot="suffix"> | 15 | <template slot="suffix"> |
| 16 | <view @click="getVerifyCode" class="verify-code">{{ codeText }}</view> | 16 | <view @click="getVerifyCode" class="verify-code">{{ codeText }}</view> |
| 17 | </template> | 17 | </template> |
| 18 | </u-input> | 18 | </u-input> |
| 19 | </view> | 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 | </view> | 21 | </view> |
| 22 | </view> | 22 | </view> |
| 23 | <view v-else class="login-body"> | 23 | <view v-else class="login-body"> |
| 24 | <view class="login-phone"> | 24 | <view class="login-phone"> |
| 25 | <view class="form-row u-flex"> | 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 | <template slot="suffix"> | 27 | <template slot="suffix"> |
| 28 | <view @click="showPasswordMode" style="padding: 10rpx"> | 28 | <view @click="showPasswordMode" style="padding: 10rpx"> |
| 29 | <u-icon width="18" height="14" :name="passwordModeIcon"></u-icon> | 29 | <u-icon width="18" height="14" :name="passwordModeIcon"></u-icon> |
| @@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
| 32 | </u-input> | 32 | </u-input> |
| 33 | </view> | 33 | </view> |
| 34 | <view class="form-row u-flex"> | 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 | <template slot="suffix"> | 36 | <template slot="suffix"> |
| 37 | <view @click="showPasswordModeRepeat" style="padding: 10rpx"> | 37 | <view @click="showPasswordModeRepeat" style="padding: 10rpx"> |
| 38 | <u-icon width="18" height="14" :name="passwordModeRepeatIcon"></u-icon> | 38 | <u-icon width="18" height="14" :name="passwordModeRepeatIcon"></u-icon> |
| @@ -40,7 +40,7 @@ | @@ -40,7 +40,7 @@ | ||
| 40 | </template> | 40 | </template> |
| 41 | </u-input> | 41 | </u-input> |
| 42 | </view> | 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 | </view> | 44 | </view> |
| 45 | </view> | 45 | </view> |
| 46 | </view> | 46 | </view> |
| @@ -62,7 +62,7 @@ | @@ -62,7 +62,7 @@ | ||
| 62 | repeatPassword: '', | 62 | repeatPassword: '', |
| 63 | }, | 63 | }, |
| 64 | readonly: false, | 64 | readonly: false, |
| 65 | - codeText: '发送验证码', | 65 | + codeText: '', |
| 66 | nextStatus: false, | 66 | nextStatus: false, |
| 67 | showPassword: true, | 67 | showPassword: true, |
| 68 | showPasswordRepeat: true | 68 | showPasswordRepeat: true |
| @@ -82,19 +82,29 @@ | @@ -82,19 +82,29 @@ | ||
| 82 | return this.showPasswordRepeat ? '/static/eye-hide.png' : '/static/eye.png' | 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 | methods: { | 95 | methods: { |
| 86 | //验证码按钮文字状态 | 96 | //验证码按钮文字状态 |
| 87 | verifyCodeCountDown() { | 97 | verifyCodeCountDown() { |
| 88 | const _this = this; | 98 | const _this = this; |
| 89 | this.readonly = true; | 99 | this.readonly = true; |
| 90 | - this.codeText = '60s后重新获取'; | 100 | + this.codeText = this.$t('login.codeAfterSeconds',{number:60}); |
| 91 | var s = 60; | 101 | var s = 60; |
| 92 | clear = setInterval(() => { | 102 | clear = setInterval(() => { |
| 93 | s--; | 103 | s--; |
| 94 | - _this.codeText = s + 's后重新获取'; | 104 | + _this.codeText = this.$t('login.codeAfterSeconds',{number:s}); |
| 95 | if (s <= 0) { | 105 | if (s <= 0) { |
| 96 | clearInterval(clear); | 106 | clearInterval(clear); |
| 97 | - _this.codeText = '发送验证码'; | 107 | + _this.codeText = this.$t('login.sendCode'); |
| 98 | _this.readonly = false; | 108 | _this.readonly = false; |
| 99 | } | 109 | } |
| 100 | }, 1000); | 110 | }, 1000); |
| @@ -103,14 +113,13 @@ | @@ -103,14 +113,13 @@ | ||
| 103 | getVerifyCode() { | 113 | getVerifyCode() { |
| 104 | const phoneRegular = /^1\d{10}$/; | 114 | const phoneRegular = /^1\d{10}$/; |
| 105 | if (this.readonly) { | 115 | if (this.readonly) { |
| 106 | - useShowToast('验证码已发送~') | 116 | + useShowToast(this.$t('login.codeBeenSend')) |
| 107 | } | 117 | } |
| 108 | - console.log(this.forgetForm.phone); | ||
| 109 | if (!this.forgetForm.phone) { | 118 | if (!this.forgetForm.phone) { |
| 110 | - return useShowToast('请输入手机号~') | 119 | + return useShowToast(this.$t('login.PleaseEnterPhone')) |
| 111 | } | 120 | } |
| 112 | if (!phoneRegular.test(this.forgetForm.phone)) { | 121 | if (!phoneRegular.test(this.forgetForm.phone)) { |
| 113 | - return useShowToast('手机号格式不正确~') | 122 | + return useShowToast(this.$t('login.phoneFormatFail')) |
| 114 | } | 123 | } |
| 115 | api.loginApi.postCodeApi(this.forgetForm.phone) | 124 | api.loginApi.postCodeApi(this.forgetForm.phone) |
| 116 | .then(res => { | 125 | .then(res => { |
| @@ -121,10 +130,10 @@ | @@ -121,10 +130,10 @@ | ||
| 121 | const phoneRegular = /^1\d{10}$/; | 130 | const phoneRegular = /^1\d{10}$/; |
| 122 | const verifyCodeReg=/^\d{6}$/; | 131 | const verifyCodeReg=/^\d{6}$/; |
| 123 | const validateValue = Object.values(this.forgetForm) | 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 | this.nextStatus = true; | 137 | this.nextStatus = true; |
| 129 | }, | 138 | }, |
| 130 | showPhone() { | 139 | showPhone() { |
| @@ -132,11 +141,11 @@ | @@ -132,11 +141,11 @@ | ||
| 132 | }, | 141 | }, |
| 133 | onSubmit() { | 142 | onSubmit() { |
| 134 | const validateValue = Object.values(this.forgetForm) | 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 | let httpData = { | 149 | let httpData = { |
| 141 | password: this.forgetForm.password, | 150 | password: this.forgetForm.password, |
| 142 | phoneNumber: this.forgetForm.phone, | 151 | phoneNumber: this.forgetForm.phone, |
| @@ -144,7 +153,7 @@ | @@ -144,7 +153,7 @@ | ||
| 144 | }; | 153 | }; |
| 145 | const res = api.loginApi.postResetCodeApi(this.forgetForm.phone, httpData) | 154 | const res = api.loginApi.postResetCodeApi(this.forgetForm.phone, httpData) |
| 146 | if (res) { | 155 | if (res) { |
| 147 | - useShowToast( '重置密码成功~').then(res => { | 156 | + useShowToast(this.$t('login.resetPasswordSuccess')).then(res => { |
| 148 | useReLaunch('/publicLoginSubPage/public/login') | 157 | useReLaunch('/publicLoginSubPage/public/login') |
| 149 | }); | 158 | }); |
| 150 | } | 159 | } |
| @@ -23,37 +23,37 @@ | @@ -23,37 +23,37 @@ | ||
| 23 | </view> | 23 | </view> |
| 24 | </view> | 24 | </view> |
| 25 | <!-- #endif --> | 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 | <view class="basic-main"> | 27 | <view class="basic-main"> |
| 28 | <u--form labelPosition="left" :model="myInfoModel" ref="myForm"> | 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 | </u-form-item> | 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 | </u-form-item> | 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 | </u-form-item> | 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 | <u--input disabled v-model="myInfoModel.accountExpireTime" border="none"></u--input> | 39 | <u--input disabled v-model="myInfoModel.accountExpireTime" border="none"></u--input> |
| 40 | </u-form-item> | 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 | </u-form-item> | 43 | </u-form-item> |
| 44 | </u--form> | 44 | </u--form> |
| 45 | </view> | 45 | </view> |
| 46 | <view class="basic-bottom u-flex"> | 46 | <view class="basic-bottom u-flex"> |
| 47 | <view class="item" v-if="info.data.isThirdLoginAndNoDind && isJudgeBindBtn"> | 47 | <view class="item" v-if="info.data.isThirdLoginAndNoDind && isJudgeBindBtn"> |
| 48 | <button class="submit" size="default" @click="clearAccountFunc" :style="{ background: InfoColor }"><text | 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 | </view> | 50 | </view> |
| 51 | <view class="item" style="margin-right: 60rpx;" :style="[ | 51 | <view class="item" style="margin-right: 60rpx;" :style="[ |
| 52 | { position: info.data.isThirdLoginAndNoDind && isJudgeBindBtn ? '' : 'relative' }, | 52 | { position: info.data.isThirdLoginAndNoDind && isJudgeBindBtn ? '' : 'relative' }, |
| 53 | { right: info.data.isThirdLoginAndNoDind && isJudgeBindBtn ? '' : '-190rpx' } | 53 | { right: info.data.isThirdLoginAndNoDind && isJudgeBindBtn ? '' : '-190rpx' } |
| 54 | ]"> | 54 | ]"> |
| 55 | <button class="submit" size="default" @click="onSubmitFunc" :style="{ background: PrimaryColor }"><text | 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 | </view> | 57 | </view> |
| 58 | </view> | 58 | </view> |
| 59 | <!-- #ifdef MP-WEIXIN --> | 59 | <!-- #ifdef MP-WEIXIN --> |
| @@ -63,14 +63,14 @@ | @@ -63,14 +63,14 @@ | ||
| 63 | <view> | 63 | <view> |
| 64 | <u-popup bgColor="transparent" :overlay="true" :show="showBind" mode="bottom"> | 64 | <u-popup bgColor="transparent" :overlay="true" :show="showBind" mode="bottom"> |
| 65 | <view class="u-flex logout-main"> | 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 | </view> | 69 | </view> |
| 70 | </u-popup> | 70 | </u-popup> |
| 71 | </view> | 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 | @confirm="confirmAvgGap" @cancel="showSelectType=false" @close="showSelectType=false"></u-picker> | 74 | @confirm="confirmAvgGap" @cancel="showSelectType=false" @close="showSelectType=false"></u-picker> |
| 75 | </view> | 75 | </view> |
| 76 | </template> | 76 | </template> |
| @@ -90,10 +90,10 @@ | @@ -90,10 +90,10 @@ | ||
| 90 | return { | 90 | return { |
| 91 | avgColumns: [ | 91 | avgColumns: [ |
| 92 | [{ | 92 | [{ |
| 93 | - label: '相机', | 93 | + label: 'userCenter.camera', |
| 94 | value: 1 | 94 | value: 1 |
| 95 | }, { | 95 | }, { |
| 96 | - label: '相册', | 96 | + label: 'userCenter.album', |
| 97 | value: 2 | 97 | value: 2 |
| 98 | }, ] | 98 | }, ] |
| 99 | ], | 99 | ], |
| @@ -108,28 +108,6 @@ | @@ -108,28 +108,6 @@ | ||
| 108 | email: '', | 108 | email: '', |
| 109 | accountExpireTime: '' | 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 | showDate: false, | 111 | showDate: false, |
| 134 | dateTime: Number(new Date()), | 112 | dateTime: Number(new Date()), |
| 135 | avatar: '', | 113 | avatar: '', |
| @@ -142,7 +120,29 @@ | @@ -142,7 +120,29 @@ | ||
| 142 | }; | 120 | }; |
| 143 | }, | 121 | }, |
| 144 | onReady() { | 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 | onLoad(e) { | 147 | onLoad(e) { |
| 148 | if (e.data !== null) { | 148 | if (e.data !== null) { |
| @@ -154,6 +154,11 @@ | @@ -154,6 +154,11 @@ | ||
| 154 | } | 154 | } |
| 155 | }, | 155 | }, |
| 156 | onShow() { | 156 | onShow() { |
| 157 | + this.$nextTick(()=>{ | ||
| 158 | + uni.setNavigationBarTitle({ | ||
| 159 | + title:this.$t('menu.personalData') | ||
| 160 | + }) | ||
| 161 | + }) | ||
| 157 | let getOpenId = getApp().globalData.openId; | 162 | let getOpenId = getApp().globalData.openId; |
| 158 | if (getOpenId) { | 163 | if (getOpenId) { |
| 159 | this.openIds = getOpenId; | 164 | this.openIds = getOpenId; |
| @@ -168,7 +173,7 @@ | @@ -168,7 +173,7 @@ | ||
| 168 | ...mapState(['userInfo']), | 173 | ...mapState(['userInfo']), |
| 169 | ...mapMutations(['setUserInfo', 'emptyUserInfo']), | 174 | ...mapMutations(['setUserInfo', 'emptyUserInfo']), |
| 170 | modify() { | 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 | if (res.confirm) { | 177 | if (res.confirm) { |
| 173 | permission.gotoAppPermissionSetting(); //动态修改权限 | 178 | permission.gotoAppPermissionSetting(); //动态修改权限 |
| 174 | } | 179 | } |
| @@ -193,7 +198,7 @@ | @@ -193,7 +198,7 @@ | ||
| 193 | // #ifdef H5 | 198 | // #ifdef H5 |
| 194 | token = window.sessionStorage.getItem('userInfo').isToken; | 199 | token = window.sessionStorage.getItem('userInfo').isToken; |
| 195 | // #endif | 200 | // #endif |
| 196 | - if (!token) return uni.$u.toast('请登录后上传图片'); | 201 | + if (!token) return uni.$u.toast(this.$t('userCenter.pleaseLogUpload')); |
| 197 | var cmr = plus.camera.getCamera(); | 202 | var cmr = plus.camera.getCamera(); |
| 198 | var res = cmr.supportedImageResolutions[0]; | 203 | var res = cmr.supportedImageResolutions[0]; |
| 199 | var fmt = cmr.supportedImageFormats[0]; | 204 | var fmt = cmr.supportedImageFormats[0]; |
| @@ -207,7 +212,7 @@ | @@ -207,7 +212,7 @@ | ||
| 207 | .then(res => { | 212 | .then(res => { |
| 208 | let objImage = JSON.parse(res.data); | 213 | let objImage = JSON.parse(res.data); |
| 209 | this.avatar = objImage.fileStaticUri; | 214 | this.avatar = objImage.fileStaticUri; |
| 210 | - uni.$u.toast('头像上传成功'); | 215 | + uni.$u.toast(this.$t('userCenter.avatarUploadSuccess')); |
| 211 | }) | 216 | }) |
| 212 | }, | 217 | }, |
| 213 | function(error) { | 218 | function(error) { |
| @@ -225,7 +230,7 @@ | @@ -225,7 +230,7 @@ | ||
| 225 | // #ifdef H5 | 230 | // #ifdef H5 |
| 226 | token = window.sessionStorage.getItem('userInfo').isToken; | 231 | token = window.sessionStorage.getItem('userInfo').isToken; |
| 227 | // #endif | 232 | // #endif |
| 228 | - if (!token) return uni.$u.toast('请登录后上传图片'); | 233 | + if (!token) return uni.$u.toast(this.$t('userCenter.pleaseLogUpload')); |
| 229 | plus.gallery.pick( | 234 | plus.gallery.pick( |
| 230 | (path) => { | 235 | (path) => { |
| 231 | this.showSelectType = false | 236 | this.showSelectType = false |
| @@ -236,11 +241,11 @@ | @@ -236,11 +241,11 @@ | ||
| 236 | .then(res => { | 241 | .then(res => { |
| 237 | let objImage = JSON.parse(res.data); | 242 | let objImage = JSON.parse(res.data); |
| 238 | this.avatar = objImage.fileStaticUri; | 243 | this.avatar = objImage.fileStaticUri; |
| 239 | - uni.$u.toast('头像上传成功'); | 244 | + uni.$u.toast(this.$t('userCenter.avatarUploadSuccess')); |
| 240 | }) | 245 | }) |
| 241 | }, | 246 | }, |
| 242 | function(e) { | 247 | function(e) { |
| 243 | - uni.$u.toast('您取消选择图片'); | 248 | + uni.$u.toast(this.$t('userCenter.youCancelImage')); |
| 244 | }, { | 249 | }, { |
| 245 | filter: 'image' | 250 | filter: 'image' |
| 246 | } | 251 | } |
| @@ -255,7 +260,7 @@ | @@ -255,7 +260,7 @@ | ||
| 255 | }; | 260 | }; |
| 256 | api.loginApi.deleteBindApi(httpData).then(res => { | 261 | api.loginApi.deleteBindApi(httpData).then(res => { |
| 257 | if (res) { | 262 | if (res) { |
| 258 | - uni.$u.toast('解绑成功'); | 263 | + uni.$u.toast(this.$t('userCenter.unbindSuccess')); |
| 259 | this.showBind = false; | 264 | this.showBind = false; |
| 260 | this.isJudgeBindBtn = false; | 265 | this.isJudgeBindBtn = false; |
| 261 | uni.reLaunch({ | 266 | uni.reLaunch({ |
| @@ -263,7 +268,7 @@ | @@ -263,7 +268,7 @@ | ||
| 263 | }); | 268 | }); |
| 264 | this.emptyUserInfo(); | 269 | this.emptyUserInfo(); |
| 265 | } else { | 270 | } else { |
| 266 | - uni.$u.toast('解绑失败'); | 271 | + uni.$u.toast(this.$t('userCenter.unbindFail')); |
| 267 | this.showBind = false; | 272 | this.showBind = false; |
| 268 | } | 273 | } |
| 269 | }); | 274 | }); |
| @@ -277,7 +282,7 @@ | @@ -277,7 +282,7 @@ | ||
| 277 | }, | 282 | }, |
| 278 | confirmAvgGap(e) { | 283 | confirmAvgGap(e) { |
| 279 | if (e.value[0].value == 1) { | 284 | if (e.value[0].value == 1) { |
| 280 | - this.modify_content = '摄像头权限(拍摄头像)'; | 285 | + this.modify_content = this.$t('userCenter.cameraPermission'); |
| 281 | //相机 | 286 | //相机 |
| 282 | switch (uni.getSystemInfoSync().platform) { | 287 | switch (uni.getSystemInfoSync().platform) { |
| 283 | case 'android': | 288 | case 'android': |
| @@ -285,7 +290,7 @@ | @@ -285,7 +290,7 @@ | ||
| 285 | break; | 290 | break; |
| 286 | } | 291 | } |
| 287 | } else { | 292 | } else { |
| 288 | - this.modify_content = '存储权限(读取相册)'; | 293 | + this.modify_content = this.$t('userCenter.storagePermission'); |
| 289 | //相册 | 294 | //相册 |
| 290 | switch (uni.getSystemInfoSync().platform) { | 295 | switch (uni.getSystemInfoSync().platform) { |
| 291 | case 'android': | 296 | case 'android': |
| @@ -303,7 +308,7 @@ | @@ -303,7 +308,7 @@ | ||
| 303 | // #ifdef H5 | 308 | // #ifdef H5 |
| 304 | token = window.sessionStorage.getItem('userInfo').isToken; | 309 | token = window.sessionStorage.getItem('userInfo').isToken; |
| 305 | // #endif | 310 | // #endif |
| 306 | - if (!token) return uni.$u.toast('请登录后上传图片'); | 311 | + if (!token) return uni.$u.toast(this.$t('userCenter.pleaseLogUpload')); |
| 307 | useChooseImage({ | 312 | useChooseImage({ |
| 308 | count: 1, | 313 | count: 1, |
| 309 | sizeType: ['compressed'], | 314 | sizeType: ['compressed'], |
| @@ -317,7 +322,7 @@ | @@ -317,7 +322,7 @@ | ||
| 317 | .then(res => { | 322 | .then(res => { |
| 318 | let objImage = JSON.parse(res.data); | 323 | let objImage = JSON.parse(res.data); |
| 319 | this.avatar = objImage.fileStaticUri; | 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,11 +343,11 @@ | ||
| 338 | uni.navigateBack({ | 343 | uni.navigateBack({ |
| 339 | delta: 1 | 344 | delta: 1 |
| 340 | }); | 345 | }); |
| 341 | - uni.$u.toast('更新个人资料成功~'); | 346 | + uni.$u.toast(this.$t('userCenter.uploadInfoSuccess')); |
| 342 | } | 347 | } |
| 343 | }) | 348 | }) |
| 344 | .catch(errors => { | 349 | .catch(errors => { |
| 345 | - uni.$u.toast('校验失败'); | 350 | + uni.$u.toast(this.$t('userCenter.validationFail')); |
| 346 | }); | 351 | }); |
| 347 | }, | 352 | }, |
| 348 | dateClose() { | 353 | dateClose() { |
| @@ -354,19 +359,19 @@ | @@ -354,19 +359,19 @@ | ||
| 354 | }, | 359 | }, |
| 355 | formatter(type, value) { | 360 | formatter(type, value) { |
| 356 | if (type === 'year') { | 361 | if (type === 'year') { |
| 357 | - return `${value}年`; | 362 | + return `${value} ${this.$t('common.year')}`; |
| 358 | } | 363 | } |
| 359 | if (type === 'month') { | 364 | if (type === 'month') { |
| 360 | - return `${value}月`; | 365 | + return `${value} ${this.$t('common.month')}`; |
| 361 | } | 366 | } |
| 362 | if (type === 'day') { | 367 | if (type === 'day') { |
| 363 | - return `${value}日`; | 368 | + return `${value} ${this.$t('common.day')}`; |
| 364 | } | 369 | } |
| 365 | if (type === 'hour') { | 370 | if (type === 'hour') { |
| 366 | - return `${value}时`; | 371 | + return `${value}${this.$t('common.hour')}`; |
| 367 | } | 372 | } |
| 368 | if (type === 'minute') { | 373 | if (type === 'minute') { |
| 369 | - return `${value}分`; | 374 | + return `${value}${this.$t('common.minute')}`; |
| 370 | } | 375 | } |
| 371 | return value; | 376 | return value; |
| 372 | }, | 377 | }, |
| @@ -4,20 +4,20 @@ | @@ -4,20 +4,20 @@ | ||
| 4 | <public-module></public-module> | 4 | <public-module></public-module> |
| 5 | <view class="u-flex login-main"> | 5 | <view class="u-flex login-main"> |
| 6 | <view class="content"> | 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 | </view> | 9 | </view> |
| 10 | </view> | 10 | </view> |
| 11 | </view> | 11 | </view> |
| 12 | <view class="login-body"> | 12 | <view class="login-body"> |
| 13 | <view class="login-phone"> | 13 | <view class="login-phone"> |
| 14 | <view class="form-row u-flex"> | 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 | border="bottom" /> | 16 | border="bottom" /> |
| 17 | </view> | 17 | </view> |
| 18 | <view class="form-row u-flex"> | 18 | <view class="form-row u-flex"> |
| 19 | <u-input :adjust-position="false" v-model="loginForm.password" :password="showPassword" | 19 | <u-input :adjust-position="false" v-model="loginForm.password" :password="showPassword" |
| 20 | - placeholder="请输入登录密码" border="bottom"> | 20 | + :placeholder="$t('login.pleaseEnterPassword')" border="bottom"> |
| 21 | <template slot="suffix"> | 21 | <template slot="suffix"> |
| 22 | <view @click="showPasswordMode" style="padding: 10rpx"> | 22 | <view @click="showPasswordMode" style="padding: 10rpx"> |
| 23 | <u-icon width="18" height="14" :name="passwordIcon"></u-icon> | 23 | <u-icon width="18" height="14" :name="passwordIcon"></u-icon> |
| @@ -26,15 +26,15 @@ | @@ -26,15 +26,15 @@ | ||
| 26 | </u-input> | 26 | </u-input> |
| 27 | </view> | 27 | </view> |
| 28 | <button class="submit" size="default" @click="onSubmitFunc"> | 28 | <button class="submit" size="default" @click="onSubmitFunc"> |
| 29 | - <text class="text">登录</text> | 29 | + <text class="text">{{ $t('login.login') }}</text> |
| 30 | </button> | 30 | </button> |
| 31 | <view class="u-flex row-item"> | 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 | </view> | 34 | </view> |
| 35 | <view class="u-flex link-login"> | 35 | <view class="u-flex link-login"> |
| 36 | <!-- #ifdef MP-WEIXIN --> | 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 | <view style="height: 20rpx"></view> | 38 | <view style="height: 20rpx"></view> |
| 39 | <button class="link-image" @tap="handleWenxinAuthorization"> | 39 | <button class="link-image" @tap="handleWenxinAuthorization"> |
| 40 | <image class="image" src="/static/weixin.png" mode="aspectFill"></image> | 40 | <image class="image" src="/static/weixin.png" mode="aspectFill"></image> |
| @@ -91,6 +91,11 @@ | @@ -91,6 +91,11 @@ | ||
| 91 | } | 91 | } |
| 92 | }, | 92 | }, |
| 93 | onShow() { | 93 | onShow() { |
| 94 | + this.$nextTick(()=>{ | ||
| 95 | + uni.setNavigationBarTitle({ | ||
| 96 | + title:this.$t('menu.login') | ||
| 97 | + }) | ||
| 98 | + }) | ||
| 94 | uni.setStorageSync('getConfiguration', { | 99 | uni.setStorageSync('getConfiguration', { |
| 95 | isConfiguration: false | 100 | isConfiguration: false |
| 96 | }); | 101 | }); |
| @@ -161,7 +166,7 @@ | @@ -161,7 +166,7 @@ | ||
| 161 | useReLaunch("/pages/index/index") | 166 | useReLaunch("/pages/index/index") |
| 162 | } else { | 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,14 +192,13 @@ | ||
| 187 | }, | 192 | }, |
| 188 | async onSubmitFunc() { | 193 | async onSubmitFunc() { |
| 189 | const validateValue = Object.values(this.loginForm) | 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 | const res = await api.loginApi.postLoginApi(this.loginForm) | 198 | const res = await api.loginApi.postLoginApi(this.loginForm) |
| 195 | if (res) { | 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 | openCodeFunc() { | 204 | openCodeFunc() { |
| @@ -26,6 +26,9 @@ Vue.use(f_show_modal) | @@ -26,6 +26,9 @@ Vue.use(f_show_modal) | ||
| 26 | import uView from '@/uni_modules/uview-ui' | 26 | import uView from '@/uni_modules/uview-ui' |
| 27 | Vue.use(uView) | 27 | Vue.use(uView) |
| 28 | 28 | ||
| 29 | +//i18n | ||
| 30 | +import i18n from '@/config/i18n.js' | ||
| 31 | + | ||
| 29 | // 公共组件注册 | 32 | // 公共组件注册 |
| 30 | import publicModule from "@/components/common/public-module.vue"; | 33 | import publicModule from "@/components/common/public-module.vue"; |
| 31 | Vue.component("public-module", publicModule); | 34 | Vue.component("public-module", publicModule); |
| @@ -37,6 +40,7 @@ App.mpType = 'app' | @@ -37,6 +40,7 @@ App.mpType = 'app' | ||
| 37 | 40 | ||
| 38 | const app = new Vue({ | 41 | const app = new Vue({ |
| 39 | store, | 42 | store, |
| 43 | + i18n, | ||
| 40 | ...App | 44 | ...App |
| 41 | }) | 45 | }) |
| 42 | 46 |
| @@ -105,7 +105,7 @@ | @@ -105,7 +105,7 @@ | ||
| 105 | }, | 105 | }, |
| 106 | "quickapp" : {}, | 106 | "quickapp" : {}, |
| 107 | "mp-weixin" : { | 107 | "mp-weixin" : { |
| 108 | - "appid" : "wx3a36e5189b607150", | 108 | + "appid" : "wx99c411dc3c5571ef", |
| 109 | "setting" : { | 109 | "setting" : { |
| 110 | "urlCheck" : false, | 110 | "urlCheck" : false, |
| 111 | "minified" : true, | 111 | "minified" : true, |
package-lock.json
0 → 100644
| 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 | +} |
| @@ -15,63 +15,69 @@ | @@ -15,63 +15,69 @@ | ||
| 15 | { | 15 | { |
| 16 | "path": "pages/index/index", | 16 | "path": "pages/index/index", |
| 17 | "style": { | 17 | "style": { |
| 18 | - "navigationBarTitleText": "首页", | 18 | + "navigationBarTitleText": "", |
| 19 | "enablePullDownRefresh": true | 19 | "enablePullDownRefresh": true |
| 20 | } | 20 | } |
| 21 | }, | 21 | }, |
| 22 | { | 22 | { |
| 23 | "path": "pages/device/device", | 23 | "path": "pages/device/device", |
| 24 | "style": { | 24 | "style": { |
| 25 | - "navigationBarTitleText": "设备" | 25 | + "navigationBarTitleText": "" |
| 26 | } | 26 | } |
| 27 | }, | 27 | }, |
| 28 | { | 28 | { |
| 29 | "path": "pages/alarm/alarm", | 29 | "path": "pages/alarm/alarm", |
| 30 | "style": { | 30 | "style": { |
| 31 | - "navigationBarTitleText": "告警" | 31 | + "navigationBarTitleText": "" |
| 32 | } | 32 | } |
| 33 | }, | 33 | }, |
| 34 | { | 34 | { |
| 35 | "path": "pages/personal/personal", | 35 | "path": "pages/personal/personal", |
| 36 | "style": { | 36 | "style": { |
| 37 | - "navigationBarTitleText": "个人中心", | 37 | + "navigationBarTitleText": "", |
| 38 | "disableScroll": true | 38 | "disableScroll": true |
| 39 | } | 39 | } |
| 40 | }, | 40 | }, |
| 41 | { | 41 | { |
| 42 | "path": "pages/index/components/camera/camera", | 42 | "path": "pages/index/components/camera/camera", |
| 43 | "style": { | 43 | "style": { |
| 44 | - "navigationBarTitleText": "查看摄像头" | 44 | + "navigationBarTitleText": "" |
| 45 | } | 45 | } |
| 46 | }, | 46 | }, |
| 47 | { | 47 | { |
| 48 | "path": "pages/index/components/configuration/configuration", | 48 | "path": "pages/index/components/configuration/configuration", |
| 49 | "style": { | 49 | "style": { |
| 50 | - "navigationBarTitleText": "查看组态" | 50 | + "navigationBarTitleText": "" |
| 51 | } | 51 | } |
| 52 | }, | 52 | }, |
| 53 | { | 53 | { |
| 54 | "path": "pages/index/components/configuration/configuration-detail", | 54 | "path": "pages/index/components/configuration/configuration-detail", |
| 55 | "style": { | 55 | "style": { |
| 56 | - "navigationBarTitleText": "组态详情" | 56 | + "navigationBarTitleText": "" |
| 57 | } | 57 | } |
| 58 | }, | 58 | }, |
| 59 | { | 59 | { |
| 60 | "path": "pages/organization/organization", | 60 | "path": "pages/organization/organization", |
| 61 | "style": { | 61 | "style": { |
| 62 | - "navigationBarTitleText": "组织筛选" | 62 | + "navigationBarTitleText": "" |
| 63 | } | 63 | } |
| 64 | }, | 64 | }, |
| 65 | { | 65 | { |
| 66 | "path": "pages/index/components/visualBoard/index", | 66 | "path": "pages/index/components/visualBoard/index", |
| 67 | "style": { | 67 | "style": { |
| 68 | - "navigationBarTitleText": "查看看板" | 68 | + "navigationBarTitleText": "" |
| 69 | } | 69 | } |
| 70 | }, | 70 | }, |
| 71 | { | 71 | { |
| 72 | "path": "pages/index/components/visualBoard/detail", | 72 | "path": "pages/index/components/visualBoard/detail", |
| 73 | "style": { | 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,7 +86,7 @@ | ||
| 80 | "pages": [{ | 86 | "pages": [{ |
| 81 | "path": "alarm-detail/alarm-detail", | 87 | "path": "alarm-detail/alarm-detail", |
| 82 | "style": { | 88 | "style": { |
| 83 | - "navigationBarTitleText": "告警详情" | 89 | + "navigationBarTitleText": "" |
| 84 | } | 90 | } |
| 85 | }] | 91 | }] |
| 86 | }, | 92 | }, |
| @@ -89,19 +95,19 @@ | @@ -89,19 +95,19 @@ | ||
| 89 | "pages": [{ | 95 | "pages": [{ |
| 90 | "path": "device-detail/device-detail", | 96 | "path": "device-detail/device-detail", |
| 91 | "style": { | 97 | "style": { |
| 92 | - "navigationBarTitleText": "设备详情" | 98 | + "navigationBarTitleText": "" |
| 93 | } | 99 | } |
| 94 | }, | 100 | }, |
| 95 | { | 101 | { |
| 96 | "path": "device-detail/components/command-detail", | 102 | "path": "device-detail/components/command-detail", |
| 97 | "style": { | 103 | "style": { |
| 98 | - "navigationBarTitleText": "命令详情" | 104 | + "navigationBarTitleText": "" |
| 99 | } | 105 | } |
| 100 | }, | 106 | }, |
| 101 | { | 107 | { |
| 102 | "path": "device-detail/device-position", | 108 | "path": "device-detail/device-position", |
| 103 | "style": { | 109 | "style": { |
| 104 | - "navigationBarTitleText": "设备地理位置" | 110 | + "navigationBarTitleText": "" |
| 105 | }, | 111 | }, |
| 106 | "permission": { | 112 | "permission": { |
| 107 | "scope.userLocation": { | 113 | "scope.userLocation": { |
| @@ -119,13 +125,13 @@ | @@ -119,13 +125,13 @@ | ||
| 119 | "pages": [{ | 125 | "pages": [{ |
| 120 | "path": "sys-notify/system-notify", | 126 | "path": "sys-notify/system-notify", |
| 121 | "style": { | 127 | "style": { |
| 122 | - "navigationBarTitleText": "系统通知" | 128 | + "navigationBarTitleText": "" |
| 123 | } | 129 | } |
| 124 | }, | 130 | }, |
| 125 | { | 131 | { |
| 126 | "path": "sys-notify/notify-detail", | 132 | "path": "sys-notify/notify-detail", |
| 127 | "style": { | 133 | "style": { |
| 128 | - "navigationBarTitleText": "通知详情" | 134 | + "navigationBarTitleText": "" |
| 129 | } | 135 | } |
| 130 | } | 136 | } |
| 131 | ] | 137 | ] |
| @@ -135,7 +141,7 @@ | @@ -135,7 +141,7 @@ | ||
| 135 | "pages": [{ | 141 | "pages": [{ |
| 136 | "path": "feedback/feedback", | 142 | "path": "feedback/feedback", |
| 137 | "style": { | 143 | "style": { |
| 138 | - "navigationBarTitleText": "意见反馈" | 144 | + "navigationBarTitleText": "" |
| 139 | } | 145 | } |
| 140 | }] | 146 | }] |
| 141 | }, | 147 | }, |
| @@ -144,25 +150,25 @@ | @@ -144,25 +150,25 @@ | ||
| 144 | "pages": [{ | 150 | "pages": [{ |
| 145 | "path": "public/login", | 151 | "path": "public/login", |
| 146 | "style": { | 152 | "style": { |
| 147 | - "navigationBarTitleText": "登录" | 153 | + "navigationBarTitleText": "" |
| 148 | } | 154 | } |
| 149 | }, | 155 | }, |
| 150 | { | 156 | { |
| 151 | "path": "other/set", | 157 | "path": "other/set", |
| 152 | "style": { | 158 | "style": { |
| 153 | - "navigationBarTitleText": "个人资料" | 159 | + "navigationBarTitleText": "" |
| 154 | } | 160 | } |
| 155 | }, | 161 | }, |
| 156 | { | 162 | { |
| 157 | "path": "other/code", | 163 | "path": "other/code", |
| 158 | "style": { | 164 | "style": { |
| 159 | - "navigationBarTitleText": "手机验证码登录" | 165 | + "navigationBarTitleText": "" |
| 160 | } | 166 | } |
| 161 | }, | 167 | }, |
| 162 | { | 168 | { |
| 163 | "path": "other/find-password", | 169 | "path": "other/find-password", |
| 164 | "style": { | 170 | "style": { |
| 165 | - "navigationBarTitleText": "忘记密码" | 171 | + "navigationBarTitleText": "" |
| 166 | } | 172 | } |
| 167 | } | 173 | } |
| 168 | ] | 174 | ] |
| @@ -4,9 +4,9 @@ | @@ -4,9 +4,9 @@ | ||
| 4 | <public-module></public-module> | 4 | <public-module></public-module> |
| 5 | <!-- 告警头部 --> | 5 | <!-- 告警头部 --> |
| 6 | <header-search @openOrg="openOrg" @openSearchDialog="openSearchDialog" :total="alarmTotal" | 6 | <header-search @openOrg="openOrg" @openSearchDialog="openSearchDialog" :total="alarmTotal" |
| 7 | - :totalText="totalText"> | 7 | + :totalText="$t(totalText)"> |
| 8 | <!-- 不能写在封装组件里传placeholder,mp-wenxin端编译要报错 --> | 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 | </u--input> | 10 | </u--input> |
| 11 | </header-search> | 11 | </header-search> |
| 12 | <!-- 告警分页 --> | 12 | <!-- 告警分页 --> |
| @@ -44,7 +44,7 @@ import {mapActions } from 'vuex' | @@ -44,7 +44,7 @@ import {mapActions } from 'vuex' | ||
| 44 | }, | 44 | }, |
| 45 | data() { | 45 | data() { |
| 46 | return { | 46 | return { |
| 47 | - totalText: '告警数:', | 47 | + totalText: 'alarm.alarmNum', |
| 48 | page: { | 48 | page: { |
| 49 | num: 0, | 49 | num: 0, |
| 50 | size: 10 | 50 | size: 10 |
| @@ -67,6 +67,11 @@ import {mapActions } from 'vuex' | @@ -67,6 +67,11 @@ import {mapActions } from 'vuex' | ||
| 67 | }; | 67 | }; |
| 68 | }, | 68 | }, |
| 69 | onShow() { | 69 | onShow() { |
| 70 | + this.$nextTick(()=>{ | ||
| 71 | + uni.setNavigationBarTitle({ | ||
| 72 | + title:this.$t('menu.alarm') | ||
| 73 | + }) | ||
| 74 | + }) | ||
| 70 | if (getApp().getBindNot()) { | 75 | if (getApp().getBindNot()) { |
| 71 | return | 76 | return |
| 72 | } | 77 | } |
| @@ -218,7 +223,7 @@ import {mapActions } from 'vuex' | @@ -218,7 +223,7 @@ import {mapActions } from 'vuex' | ||
| 218 | }, | 223 | }, |
| 219 | openSearchDialog() { | 224 | openSearchDialog() { |
| 220 | if (getApp().getBindNot()) { | 225 | if (getApp().getBindNot()) { |
| 221 | - uni.$u.toast('请进行账号绑定') | 226 | + uni.$u.toast(this.$t('common.pleaseBindAccount')) |
| 222 | return | 227 | return |
| 223 | } | 228 | } |
| 224 | this.show = true; | 229 | this.show = true; |
| @@ -228,7 +233,7 @@ import {mapActions } from 'vuex' | @@ -228,7 +233,7 @@ import {mapActions } from 'vuex' | ||
| 228 | }, | 233 | }, |
| 229 | openOrg() { | 234 | openOrg() { |
| 230 | if (getApp().getBindNot()) { | 235 | if (getApp().getBindNot()) { |
| 231 | - uni.$u.toast('请进行账号绑定') | 236 | + uni.$u.toast(this.$t('common.pleaseBindAccount')) |
| 232 | return | 237 | return |
| 233 | } | 238 | } |
| 234 | useNavigateTo('/pages/organization/organization') | 239 | useNavigateTo('/pages/organization/organization') |
| @@ -3,20 +3,20 @@ | @@ -3,20 +3,20 @@ | ||
| 3 | <view @click="$emit('openAlertDetail',item)" class="list-item" v-for="(item, index) in list" :key="index"> | 3 | <view @click="$emit('openAlertDetail',item)" class="list-item" v-for="(item, index) in list" :key="index"> |
| 4 | <view class="u-flex item"> | 4 | <view class="u-flex item"> |
| 5 | <view class="item-text text-clip"> | 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 | </view> | 7 | </view> |
| 8 | <view class="item-text text-clip"> | 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 | </view> | 10 | </view> |
| 11 | <view class="item-text text-clip"> | 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 | </view> | 13 | </view> |
| 14 | <view class="item-text text-clip"> | 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 | </view> | 16 | </view> |
| 17 | <view class="item-text"> | 17 | <view class="item-text"> |
| 18 | <text class="text-muted"> | 18 | <text class="text-muted"> |
| 19 | - 告警状态:{{item.status | setAlarmStatus(alarmStatus)}} | 19 | + {{$t('device.alarmStatus')}} {{ setAlarmStatus(item.status,alarmStatus)}} |
| 20 | </text> | 20 | </text> |
| 21 | </view> | 21 | </view> |
| 22 | <view class="item-text"> | 22 | <view class="item-text"> |
| @@ -28,7 +28,7 @@ | @@ -28,7 +28,7 @@ | ||
| 28 | <image class="right-image" :src="bindImageUrl(item.severity)"></image> | 28 | <image class="right-image" :src="bindImageUrl(item.severity)"></image> |
| 29 | <view class="right-text"> | 29 | <view class="right-text"> |
| 30 | <text class="text-no-color" :style="[setAlarmSeverityColor(item.severity,alarmSeverity)]"> | 30 | <text class="text-no-color" :style="[setAlarmSeverityColor(item.severity,alarmSeverity)]"> |
| 31 | - {{item.severity | setAlarmSeverity(alarmSeverity)}} | 31 | + {{ setAlarmSeverity(item.severity,alarmSeverity)}} |
| 32 | </text> | 32 | </text> |
| 33 | </view> | 33 | </view> |
| 34 | </view> | 34 | </view> |
| @@ -57,15 +57,14 @@ | @@ -57,15 +57,14 @@ | ||
| 57 | alarmStatus | 57 | alarmStatus |
| 58 | } | 58 | } |
| 59 | }, | 59 | }, |
| 60 | - filters: { | 60 | + methods: { |
| 61 | + | ||
| 61 | setAlarmStatus(value, list) { | 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 | setAlarmSeverity(value, list) { | 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 | setAlarmSeverityColor(value, list) { | 68 | setAlarmSeverityColor(value, list) { |
| 70 | return { | 69 | return { |
| 71 | color: list.find(item => item.value === value).color | 70 | color: list.find(item => item.value === value).color |
| @@ -91,11 +90,11 @@ | @@ -91,11 +90,11 @@ | ||
| 91 | const items = details[curr]?.triggerData | 90 | const items = details[curr]?.triggerData |
| 92 | if(items?.key && items?.logicValue && items.realValue){ | 91 | if(items?.key && items?.logicValue && items.realValue){ |
| 93 | if(type==0){ | 92 | if(type==0){ |
| 94 | - acc.push(`触发属性:${items.key ||'暂无数据'}`) | 93 | + acc.push(`${this.$t('device.triggerAttribute')}:${items.key || this.$t('common.noData')}`) |
| 95 | }else if (type ==1){ | 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 | }else if(type==2){ | 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 | return acc | 100 | return acc |
| @@ -136,6 +135,9 @@ | @@ -136,6 +135,9 @@ | ||
| 136 | text-align: left; | 135 | text-align: left; |
| 137 | margin-top: 13rpx; | 136 | margin-top: 13rpx; |
| 138 | line-height: 40rpx; | 137 | line-height: 40rpx; |
| 138 | + overflow: hidden; | ||
| 139 | + text-overflow: ellipsis; | ||
| 140 | + white-space: nowrap; | ||
| 139 | 141 | ||
| 140 | .text { | 142 | .text { |
| 141 | color: #666666; | 143 | color: #666666; |
| 1 | <template> | 1 | <template> |
| 2 | - <u-popup @close="$emit('close')" closeable bgColor="transparent" :overlay="true" :show="show" mode="bottom"> | 2 | + <u-popup @close="$emit('close')" closeable :safeAreaInsetBottom="false" bgColor="transparent" :overlay="true" :show="show" mode="bottom"> |
| 3 | <view class="popup-page"> | 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 | <view class="popup-alarm-page u-flex"> | 5 | <view class="popup-alarm-page u-flex"> |
| 6 | <view> | 6 | <view> |
| 7 | - <query-item ref="queryItemAlarmStatusRef" :leftText="leftAlarmStatusText" :queryStatus="alertStatus" | 7 | + <view style="margin-left:98rpx"> |
| 8 | + <query-item ref="queryItemAlarmStatusRef" :leftText="$t(leftAlarmStatusText)" :queryStatus="alertStatus.map(item=>({...item,name:$t(item.name)}))" | ||
| 8 | @currentClick="getAlarmStatus"></query-item> | 9 | @currentClick="getAlarmStatus"></query-item> |
| 9 | - <query-item ref="queryDeviceTypeStatusRef" :leftText="leftDeviceTypeText" :queryStatus="deviceType" | ||
| 10 | - @currentClick="getDeviceType"></query-item> | ||
| 11 | - <query-item ref="queryItemAlarmLevelRef" :leftText="leftAlarmLevelText" :queryStatus="alertLevel" | ||
| 12 | - @currentClick="getAlarmLevel"></query-item> | ||
| 13 | - <query-item ref="queryItemSelectTimeRef" :leftText="leftSelectTimeText" :queryStatus="timeArea" | ||
| 14 | - @currentClick="getSelectTime"></query-item> | ||
| 15 | - <view class="select-date"> | ||
| 16 | - <view class="home-text-muted">选择日期</view> | ||
| 17 | - <view class="datetime-picker"> | ||
| 18 | - <uni-datetime-picker return-type="timestamp" v-model="range" type="datetimerange" | ||
| 19 | - rangeSeparator="至" /> | 10 | + <query-item ref="queryDeviceTypeStatusRef" :leftText="$t(leftDeviceTypeText)" :queryStatus="deviceType.map(item=>({...item,name:$t(item.name)}))" |
| 11 | + @currentClick="getDeviceType"></query-item> | ||
| 12 | + <query-item ref="queryItemAlarmLevelRef" :leftText="$t(leftAlarmLevelText)" :queryStatus="alertLevel.map(item=>({...item,name:$t(item.name)}))" | ||
| 13 | + @currentClick="getAlarmLevel"></query-item> | ||
| 14 | + <query-item ref="queryItemSelectTimeRef" :leftText="$t(leftSelectTimeText)" :queryStatus="timeArea.map(item=>({...item,name:$t(item.name)}))" | ||
| 15 | + @currentClick="getSelectTime"></query-item> | ||
| 16 | + <view class="select-date"> | ||
| 17 | + <view class="home-text-muted">{{ $t('device.selectDate') }}</view> | ||
| 18 | + <view class="datetime-picker"> | ||
| 19 | + <uni-datetime-picker return-type="timestamp" v-model="range" type="datetimerange" | ||
| 20 | + :rangeSeparator="$t('common.toText')" /> | ||
| 21 | + </view> | ||
| 20 | </view> | 22 | </view> |
| 21 | </view> | 23 | </view> |
| 22 | - <view class="h-30"></view> | ||
| 23 | - <view class="u-flex bottom-button"> | 24 | + <view class="h-45" :style="{paddingBottom:paddingBottom + 'px' }"></view> |
| 25 | + <view class="u-flex bottom-button " :style="{paddingBottom:paddingBottom + 'px',background:'#fff' }"> | ||
| 24 | <view class="button-item"> | 26 | <view class="button-item"> |
| 25 | - <u-button @click="resetQuery" type="info" shape="circle" text="重置"> | 27 | + <u-button @click="resetQuery" type="info" shape="circle" :text="$t('common.resetting')"> |
| 26 | </u-button> | 28 | </u-button> |
| 27 | </view> | 29 | </view> |
| 28 | <view class="button-item" style="margin-left: 46rpx"> | 30 | <view class="button-item" style="margin-left: 46rpx"> |
| 29 | - <u-button @click="confirmQuery" type="primary" shape="circle" text="确认"> | 31 | + <u-button @click="confirmQuery" type="primary" shape="circle" :text="$t('common.confirm')"> |
| 30 | </u-button> | 32 | </u-button> |
| 31 | </view> | 33 | </view> |
| 32 | </view> | 34 | </view> |
| @@ -45,6 +47,7 @@ | @@ -45,6 +47,7 @@ | ||
| 45 | timeArea | 47 | timeArea |
| 46 | } from '../config/data.js'; | 48 | } from '../config/data.js'; |
| 47 | import queryItem from './query-item.vue' | 49 | import queryItem from './query-item.vue' |
| 50 | + import base from '@/config/baseUrl.js'; | ||
| 48 | 51 | ||
| 49 | export default { | 52 | export default { |
| 50 | components: { | 53 | components: { |
| @@ -56,10 +59,10 @@ | @@ -56,10 +59,10 @@ | ||
| 56 | data() { | 59 | data() { |
| 57 | return { | 60 | return { |
| 58 | totalText: '告警数:', | 61 | totalText: '告警数:', |
| 59 | - leftAlarmStatusText: '告警状态', | ||
| 60 | - leftDeviceTypeText: '设备类型', | ||
| 61 | - leftAlarmLevelText: '告警等级', | ||
| 62 | - leftSelectTimeText: '选择时间', | 62 | + leftAlarmStatusText: 'device.alarmStatus', |
| 63 | + leftDeviceTypeText: 'device.deviceType', | ||
| 64 | + leftAlarmLevelText: 'device.alarmLevel', | ||
| 65 | + leftSelectTimeText: 'device.selectTime', | ||
| 63 | range: [], | 66 | range: [], |
| 64 | alertStatus, | 67 | alertStatus, |
| 65 | deviceType, | 68 | deviceType, |
| @@ -72,6 +75,7 @@ | @@ -72,6 +75,7 @@ | ||
| 72 | startTime: 0, | 75 | startTime: 0, |
| 73 | endTime: 0, | 76 | endTime: 0, |
| 74 | }, | 77 | }, |
| 78 | + paddingBottom: uni.$u?.sys?.()?.safeAreaInsets?.bottom || base?.systemInfo?.tabbarPaddingB, | ||
| 75 | 79 | ||
| 76 | }; | 80 | }; |
| 77 | }, | 81 | }, |
| @@ -145,7 +149,6 @@ | @@ -145,7 +149,6 @@ | ||
| 145 | 149 | ||
| 146 | .popup-alarm-page { | 150 | .popup-alarm-page { |
| 147 | margin-top: 97rpx; | 151 | margin-top: 97rpx; |
| 148 | - margin-left: 98rpx; | ||
| 149 | flex-direction: column; | 152 | flex-direction: column; |
| 150 | justify-content: space-between; | 153 | justify-content: space-between; |
| 151 | 154 | ||
| @@ -164,16 +167,19 @@ | @@ -164,16 +167,19 @@ | ||
| 164 | 167 | ||
| 165 | .bottom-button { | 168 | .bottom-button { |
| 166 | position: fixed; | 169 | position: fixed; |
| 167 | - bottom: 10rpx; | 170 | + bottom: -6rpx; |
| 168 | z-index: 9999; | 171 | z-index: 9999; |
| 169 | flex-direction: row; | 172 | flex-direction: row; |
| 170 | margin-top: 128rpx; | 173 | margin-top: 128rpx; |
| 171 | - margin-left: 10rpx; | ||
| 172 | - | 174 | + margin-left: 98rpx; |
| 173 | .button-item { | 175 | .button-item { |
| 174 | width: 300rpx | 176 | width: 300rpx |
| 175 | } | 177 | } |
| 178 | + // display: flex; | ||
| 179 | + // justify-content: center; | ||
| 180 | + width: 100%; | ||
| 181 | + padding-top:12rpx | ||
| 176 | } | 182 | } |
| 177 | } | 183 | } |
| 178 | } | 184 | } |
| 179 | -</style> | ||
| 185 | +</style> |
| @@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
| 8 | class="text">{{ item.name }}</text> | 8 | class="text">{{ item.name }}</text> |
| 9 | </view> | 9 | </view> |
| 10 | </view> | 10 | </view> |
| 11 | - <view style="height:180rpx"></view> | 11 | + <!-- <view style="height:180rpx"></view> --> |
| 12 | </view> | 12 | </view> |
| 13 | </template> | 13 | </template> |
| 14 | 14 | ||
| @@ -57,7 +57,7 @@ | @@ -57,7 +57,7 @@ | ||
| 57 | .popup-alarm-child { | 57 | .popup-alarm-child { |
| 58 | margin-top: 15rpx; | 58 | margin-top: 15rpx; |
| 59 | width: 750rpx; | 59 | width: 750rpx; |
| 60 | - height: 60rpx; | 60 | + min-height: 60rpx; |
| 61 | flex-wrap: wrap; | 61 | flex-wrap: wrap; |
| 62 | margin-left: -10rpx; | 62 | margin-left: -10rpx; |
| 63 | 63 | ||
| @@ -65,7 +65,8 @@ | @@ -65,7 +65,8 @@ | ||
| 65 | margin: 25rpx; | 65 | margin: 25rpx; |
| 66 | line-height: 50rpx; | 66 | line-height: 50rpx; |
| 67 | text-align: center; | 67 | text-align: center; |
| 68 | - width: 180rpx; | 68 | + min-width: 168rpx; |
| 69 | + padding: 0 12rpx; | ||
| 69 | height: 60rpx; | 70 | height: 60rpx; |
| 70 | background-color: #f6f6f6; | 71 | background-color: #f6f6f6; |
| 71 | border-radius: 32px; | 72 | border-radius: 32px; |
| @@ -76,4 +77,4 @@ | @@ -76,4 +77,4 @@ | ||
| 76 | } | 77 | } |
| 77 | } | 78 | } |
| 78 | } | 79 | } |
| 79 | -</style> | ||
| 80 | +</style> |
| 1 | const alertStatus = [{ | 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 | const deviceType = [{ | 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 | const alertLevel = [{ | 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 | const timeArea = [{ | 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 | const alarmSeverity = [{ | 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 | const alarmStatus = [{ | 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 | const operationNumberOrDate = [{ | 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 | const operationString = [{ | 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 | const operationBoolean = [{ | 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 | export { | 273 | export { |
| @@ -280,4 +280,4 @@ export { | @@ -280,4 +280,4 @@ export { | ||
| 280 | operationNumberOrDate, | 280 | operationNumberOrDate, |
| 281 | operationString, | 281 | operationString, |
| 282 | operationBoolean | 282 | operationBoolean |
| 283 | -} | ||
| 283 | +} |
| @@ -10,13 +10,13 @@ | @@ -10,13 +10,13 @@ | ||
| 10 | </view> | 10 | </view> |
| 11 | <view class="item-text text-clip"> | 11 | <view class="item-text text-clip"> |
| 12 | <view class="text-container"> | 12 | <view class="text-container"> |
| 13 | - 设备编号: | 13 | + {{$t('device.deviceNumber')}}: |
| 14 | <text class="text-span">{{ item.sn }}</text> | 14 | <text class="text-span">{{ item.sn }}</text> |
| 15 | </view> | 15 | </view> |
| 16 | </view> | 16 | </view> |
| 17 | <view class="item-text text-clip"> | 17 | <view class="item-text text-clip"> |
| 18 | <view class="text-container"> | 18 | <view class="text-container"> |
| 19 | - 所属组织: | 19 | + {{$t('common.belongingOrganization')}}: |
| 20 | <text class="text-span">{{ item.organizationDTO.name }}</text> | 20 | <text class="text-span">{{ item.organizationDTO.name }}</text> |
| 21 | </view> | 21 | </view> |
| 22 | </view> | 22 | </view> |
| @@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
| 52 | '/static/baojing.png' | 52 | '/static/baojing.png' |
| 53 | }, | 53 | }, |
| 54 | formatText(deviceState) { | 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 | formatColor(deviceState) { | 57 | formatColor(deviceState) { |
| 58 | return deviceState === 'ONLINE' ? '#377DFF' : deviceState === 'INACTIVE' ? '#666666' : '#DE4437' | 58 | return deviceState === 'ONLINE' ? '#377DFF' : deviceState === 'INACTIVE' ? '#666666' : '#DE4437' |
| @@ -82,7 +82,7 @@ | @@ -82,7 +82,7 @@ | ||
| 82 | justify-content: space-between; | 82 | justify-content: space-between; |
| 83 | 83 | ||
| 84 | .item-text { | 84 | .item-text { |
| 85 | - width: 450rpx; | 85 | + width: 480rpx; |
| 86 | 86 | ||
| 87 | .text-container { | 87 | .text-container { |
| 88 | display: flex; | 88 | display: flex; |
| @@ -2,22 +2,22 @@ | @@ -2,22 +2,22 @@ | ||
| 2 | <u-popup @close="$emit('close')" closeable bgColor="#fff" :show="show" mode="bottom" :round="20" | 2 | <u-popup @close="$emit('close')" closeable bgColor="#fff" :show="show" mode="bottom" :round="20" |
| 3 | @touchmove.stop.prevent="disabledScroll"> | 3 | @touchmove.stop.prevent="disabledScroll"> |
| 4 | <view class="filter" @touchmove.stop.prevent="disabledScroll"> | 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 | @clickTag="currentIndex => handleClickTag(currentIndex, deviceStatus)"></query-item> | 7 | @clickTag="currentIndex => handleClickTag(currentIndex, deviceStatus)"></query-item> |
| 8 | - <query-item :filterList="alarmStatus" title="告警状态" | 8 | + <query-item :filterList="alarmStatus" :title="$t('device.alarmStatus')" |
| 9 | @clickTag="currentIndex => handleClickTag(currentIndex, alarmStatus)"></query-item> | 9 | @clickTag="currentIndex => handleClickTag(currentIndex, alarmStatus)"></query-item> |
| 10 | - <query-item :filterList="typeStatus" title="设备类型" | 10 | + <query-item :filterList="typeStatus" :title="$t('device.deviceType')" |
| 11 | @clickTag="currentIndex => handleClickTag(currentIndex, typeStatus)"></query-item> | 11 | @clickTag="currentIndex => handleClickTag(currentIndex, typeStatus)"></query-item> |
| 12 | - <query-item :filterList="collectStatus" title="设备是否收藏" | 12 | + <query-item :filterList="collectStatus" :title="$t('device.isDeviceCollect')" |
| 13 | @clickTag="currentIndex => handleClickTag(currentIndex, collectStatus)"></query-item> | 13 | @clickTag="currentIndex => handleClickTag(currentIndex, collectStatus)"></query-item> |
| 14 | <view class="button-group"> | 14 | <view class="button-group"> |
| 15 | <view> | 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 | @click="resetFilter"></u-button> | 17 | @click="resetFilter"></u-button> |
| 18 | </view> | 18 | </view> |
| 19 | <view> | 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 | </view> | 21 | </view> |
| 22 | </view> | 22 | </view> |
| 23 | </view> | 23 | </view> |
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | <view class="query-list"> | 6 | <view class="query-list"> |
| 7 | <view v-for="(item, index) in filterList" :key="index" @click="itemClick(index)" | 7 | <view v-for="(item, index) in filterList" :key="index" @click="itemClick(index)" |
| 8 | :class="['tag-item', { checked: item.checked, 'mr-30': (index + 1) % 3 !== 0 }]"> | 8 | :class="['tag-item', { checked: item.checked, 'mr-30': (index + 1) % 3 !== 0 }]"> |
| 9 | - {{ item.name }} | 9 | + {{ $t(item.name) }} |
| 10 | </view> | 10 | </view> |
| 11 | </view> | 11 | </view> |
| 12 | </view> | 12 | </view> |
| @@ -48,7 +48,8 @@ | @@ -48,7 +48,8 @@ | ||
| 48 | 48 | ||
| 49 | .tag-item { | 49 | .tag-item { |
| 50 | margin-top: 30rpx; | 50 | margin-top: 30rpx; |
| 51 | - width: 210rpx; | 51 | + min-width: 198rpx; |
| 52 | + padding: 0 12rpx; | ||
| 52 | height: 68rpx; | 53 | height: 68rpx; |
| 53 | border-radius: 32rpx; | 54 | border-radius: 32rpx; |
| 54 | display: flex; | 55 | display: flex; |
| @@ -71,4 +72,4 @@ | @@ -71,4 +72,4 @@ | ||
| 71 | } | 72 | } |
| 72 | } | 73 | } |
| 73 | } | 74 | } |
| 74 | -</style> | ||
| 75 | +</style> |
| 1 | const deviceStatus = [{ | 1 | const deviceStatus = [{ |
| 2 | - checked: true, | ||
| 3 | - name: '全部', | ||
| 4 | - type: '' | ||
| 5 | - }, | ||
| 6 | - { | ||
| 7 | - checked: false, | ||
| 8 | - name: '在线', | ||
| 9 | - type: 'ONLINE' | ||
| 10 | - }, | ||
| 11 | - { | ||
| 12 | - checked: false, | ||
| 13 | - name: '离线', | ||
| 14 | - type: 'OFFLINE' | ||
| 15 | - }, | ||
| 16 | - { | ||
| 17 | - checked: false, | ||
| 18 | - name: '待激活', | ||
| 19 | - type: 'INACTIVE' | ||
| 20 | - } | 2 | + checked: true, |
| 3 | + name: 'common.allText', | ||
| 4 | + type: '' | ||
| 5 | +}, | ||
| 6 | +{ | ||
| 7 | + checked: false, | ||
| 8 | + name: 'common.onLine', | ||
| 9 | + type: 'ONLINE' | ||
| 10 | +}, | ||
| 11 | +{ | ||
| 12 | + checked: false, | ||
| 13 | + name: 'common.offLine', | ||
| 14 | + type: 'OFFLINE' | ||
| 15 | +}, | ||
| 16 | +{ | ||
| 17 | + checked: false, | ||
| 18 | + name: 'common.toBeActivated', | ||
| 19 | + type: 'INACTIVE' | ||
| 20 | +} | ||
| 21 | ] | 21 | ] |
| 22 | const alarmStatus = [{ | 22 | const alarmStatus = [{ |
| 23 | - checked: true, | ||
| 24 | - name: '全部', | ||
| 25 | - type: '' | ||
| 26 | - }, | ||
| 27 | - { | ||
| 28 | - checked: false, | ||
| 29 | - name: '告警', | ||
| 30 | - type: 1 | ||
| 31 | - }, | ||
| 32 | - { | ||
| 33 | - checked: false, | ||
| 34 | - name: '正常', | ||
| 35 | - type: 0 | ||
| 36 | - } | 23 | + checked: true, |
| 24 | + name: 'common.allText', | ||
| 25 | + type: '' | ||
| 26 | +}, | ||
| 27 | +{ | ||
| 28 | + checked: false, | ||
| 29 | + name: 'common.alarm', | ||
| 30 | + type: 1 | ||
| 31 | +}, | ||
| 32 | +{ | ||
| 33 | + checked: false, | ||
| 34 | + name: 'common.normal', | ||
| 35 | + type: 0 | ||
| 36 | +} | ||
| 37 | ] | 37 | ] |
| 38 | const typeStatus = [{ | 38 | const typeStatus = [{ |
| 39 | - checked: true, | ||
| 40 | - name: '全部', | ||
| 41 | - type: '' | ||
| 42 | - }, | 39 | + checked: true, |
| 40 | + name: 'common.allText', | ||
| 41 | + type: '' | ||
| 42 | +}, | ||
| 43 | 43 | ||
| 44 | - { | ||
| 45 | - checked: false, | ||
| 46 | - name: '直连设备', | ||
| 47 | - type: 'DIRECT_CONNECTION' | ||
| 48 | - }, | ||
| 49 | - { | ||
| 50 | - checked: false, | ||
| 51 | - name: '网关设备', | ||
| 52 | - type: 'GATEWAY' | ||
| 53 | - }, | ||
| 54 | - { | ||
| 55 | - checked: false, | ||
| 56 | - name: '网关子设备', | ||
| 57 | - type: 'SENSOR' | ||
| 58 | - } | 44 | +{ |
| 45 | + checked: false, | ||
| 46 | + name: 'common.directlyDevice', | ||
| 47 | + type: 'DIRECT_CONNECTION' | ||
| 48 | +}, | ||
| 49 | +{ | ||
| 50 | + checked: false, | ||
| 51 | + name: 'common.gatewayDevice', | ||
| 52 | + type: 'GATEWAY' | ||
| 53 | +}, | ||
| 54 | +{ | ||
| 55 | + checked: false, | ||
| 56 | + name: 'common.sensorDevice', | ||
| 57 | + type: 'SENSOR' | ||
| 58 | +} | ||
| 59 | ] | 59 | ] |
| 60 | const collectStatus = [ | 60 | const collectStatus = [ |
| 61 | { | 61 | { |
| 62 | checked: true, | 62 | checked: true, |
| 63 | - name: '全部', | 63 | + name: 'common.allText', |
| 64 | type: '' | 64 | type: '' |
| 65 | }, | 65 | }, |
| 66 | { | 66 | { |
| 67 | checked: false, | 67 | checked: false, |
| 68 | - name: '是', | 68 | + name: 'common.yesText', |
| 69 | type: '1' | 69 | type: '1' |
| 70 | }, | 70 | }, |
| 71 | { | 71 | { |
| 72 | checked: false, | 72 | checked: false, |
| 73 | - name: '否', | 73 | + name: 'common.noText', |
| 74 | type: '0' | 74 | type: '0' |
| 75 | }, | 75 | }, |
| 76 | ] | 76 | ] |
| 1 | <template> | 1 | <template> |
| 2 | <view class="device-page"> | 2 | <view class="device-page"> |
| 3 | <!-- 设备头部 --> | 3 | <!-- 设备头部 --> |
| 4 | - <header-search @openOrg="openOrg" @openSearchDialog="openSearchDialog" :total="total" :totalText="totalText"> | 4 | + <header-search @openOrg="openOrg" @openSearchDialog="openSearchDialog" :total="total" :totalText="$t(totalText)"> |
| 5 | <!-- 不能写在封装组件里传placeholder,mp-wenxin端编译要报错 --> | 5 | <!-- 不能写在封装组件里传placeholder,mp-wenxin端编译要报错 --> |
| 6 | - <u--input prefixIcon="search" placeholder="请输入设备名称或别名搜索" shape="circle" @change="inputChanged"> | 6 | + <u--input prefixIcon="search" :placeholder="$t('device.pleaseEnterDeviceName')" shape="circle" |
| 7 | + @change="inputChanged"> | ||
| 7 | </u--input> | 8 | </u--input> |
| 8 | </header-search> | 9 | </header-search> |
| 9 | <!-- 设备分页 --> | 10 | <!-- 设备分页 --> |
| @@ -13,237 +14,240 @@ | @@ -13,237 +14,240 @@ | ||
| 13 | </mescroll-body> | 14 | </mescroll-body> |
| 14 | <view style="height: 20rpx"></view> | 15 | <view style="height: 20rpx"></view> |
| 15 | <!-- 设备筛选 --> | 16 | <!-- 设备筛选 --> |
| 16 | - <device-popup ref="devicePopupRef" :show="show" @close="close" | ||
| 17 | - @queryCondition="getQueryCondition"></device-popup> | 17 | + <device-popup ref="devicePopupRef" :show="show" @close="close" @queryCondition="getQueryCondition"></device-popup> |
| 18 | <f-tabbar></f-tabbar> | 18 | <f-tabbar></f-tabbar> |
| 19 | </view> | 19 | </view> |
| 20 | </template> | 20 | </template> |
| 21 | 21 | ||
| 22 | <script> | 22 | <script> |
| 23 | - import fTabbar from '@/components/module/f-tabbar/f-tabbar'; | ||
| 24 | - import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js'; | ||
| 25 | - import api from '@/api/index.js' | ||
| 26 | - import { | ||
| 27 | - useNavigateTo | ||
| 28 | - } from '@/plugins/utils.js' | ||
| 29 | - import deviceItem from './components/device-item.vue' | ||
| 30 | - import devicePopup from './components/device-popup.vue' | 23 | +import fTabbar from '@/components/module/f-tabbar/f-tabbar'; |
| 24 | +import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js'; | ||
| 25 | +import api from '@/api/index.js' | ||
| 26 | +import { | ||
| 27 | + useNavigateTo | ||
| 28 | +} from '@/plugins/utils.js' | ||
| 29 | +import deviceItem from './components/device-item.vue' | ||
| 30 | +import devicePopup from './components/device-popup.vue' | ||
| 31 | 31 | ||
| 32 | - export default { | ||
| 33 | - mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件) | ||
| 34 | - components: { | ||
| 35 | - fTabbar, | ||
| 36 | - deviceItem, | ||
| 37 | - devicePopup | ||
| 38 | - }, | ||
| 39 | - data() { | ||
| 40 | - return { | ||
| 41 | - totalText: '设备数', | ||
| 42 | - downOption: { | ||
| 43 | - auto: false //是否在初始化后,自动执行downCallback; 默认true | ||
| 44 | - }, | ||
| 45 | - upOption: { | ||
| 46 | - isBounce: false, | ||
| 47 | - auto: false // 不自动加载 | ||
| 48 | - }, | ||
| 49 | - show: false, | ||
| 50 | - total: 0, | ||
| 51 | - list: [], | ||
| 52 | - page: { | ||
| 53 | - num: 0, | ||
| 54 | - size: 10 | ||
| 55 | - }, | ||
| 56 | - deviceName: '', | ||
| 57 | - ordId: '', | ||
| 58 | - conditions: {} | ||
| 59 | - }; | ||
| 60 | - }, | ||
| 61 | - onLoad(e) { | ||
| 62 | - // 隐藏原生的tabbar | ||
| 63 | - uni.hideTabBar(); | 32 | +export default { |
| 33 | + mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件) | ||
| 34 | + components: { | ||
| 35 | + fTabbar, | ||
| 36 | + deviceItem, | ||
| 37 | + devicePopup | ||
| 38 | + }, | ||
| 39 | + data() { | ||
| 40 | + return { | ||
| 41 | + totalText: 'device.deviceNum', | ||
| 42 | + downOption: { | ||
| 43 | + auto: false //是否在初始化后,自动执行downCallback; 默认true | ||
| 44 | + }, | ||
| 45 | + upOption: { | ||
| 46 | + isBounce: false, | ||
| 47 | + auto: false // 不自动加载 | ||
| 48 | + }, | ||
| 49 | + show: false, | ||
| 50 | + total: 0, | ||
| 51 | + list: [], | ||
| 52 | + page: { | ||
| 53 | + num: 0, | ||
| 54 | + size: 10 | ||
| 55 | + }, | ||
| 56 | + deviceName: '', | ||
| 57 | + ordId: '', | ||
| 58 | + conditions: {} | ||
| 59 | + }; | ||
| 60 | + }, | ||
| 61 | + onLoad(e) { | ||
| 62 | + // 隐藏原生的tabbar | ||
| 63 | + uni.hideTabBar(); | ||
| 64 | + if (getApp().getBindNot()) { | ||
| 65 | + return | ||
| 66 | + } | ||
| 67 | + if (e.deviceState) { | ||
| 68 | + let params = JSON.parse(e.deviceState); | ||
| 69 | + this.conditions = { | ||
| 70 | + deviceState: params | ||
| 71 | + } | ||
| 72 | + // this.loadData(1, { | ||
| 73 | + // deviceState: params | ||
| 74 | + // }); | ||
| 75 | + } | ||
| 76 | + }, | ||
| 77 | + onShow() { | ||
| 78 | + this.$nextTick(()=>{ | ||
| 79 | + uni.setNavigationBarTitle({ | ||
| 80 | + title:this.$t('menu.device') | ||
| 81 | + }) | ||
| 82 | + }) | ||
| 83 | + if (getApp().getBindNot()) { | ||
| 84 | + return | ||
| 85 | + } | ||
| 86 | + this.page.num = 1 | ||
| 87 | + if (this.ordId) { | ||
| 88 | + this.loadData(1, { | ||
| 89 | + organizationId: this.ordId | ||
| 90 | + }); | ||
| 91 | + this.conditions = { | ||
| 92 | + organizationId: this.ordId | ||
| 93 | + } | ||
| 94 | + return | ||
| 95 | + } | ||
| 96 | + this.loadData(this.page.num, this.conditions); | ||
| 97 | + }, | ||
| 98 | + methods: { | ||
| 99 | + inputChanged(e) { | ||
| 64 | if (getApp().getBindNot()) { | 100 | if (getApp().getBindNot()) { |
| 65 | return | 101 | return |
| 66 | } | 102 | } |
| 67 | - if (e.deviceState) { | ||
| 68 | - let params = JSON.parse(e.deviceState); | ||
| 69 | - this.conditions = { | ||
| 70 | - deviceState: params | ||
| 71 | - } | ||
| 72 | - // this.loadData(1, { | ||
| 73 | - // deviceState: params | ||
| 74 | - // }); | 103 | + this.page.num = 1; |
| 104 | + this.deviceName = e; | ||
| 105 | + this.conditions = { | ||
| 106 | + deviceName: e | ||
| 75 | } | 107 | } |
| 108 | + this.loadData(1, { | ||
| 109 | + name: this.deviceName | ||
| 110 | + }); | ||
| 76 | }, | 111 | }, |
| 77 | - onShow() { | ||
| 78 | - console.log(2) | 112 | + resetQuery() { |
| 113 | + this.$refs.devicePopupRef.resetFilter() | ||
| 114 | + this.ordId = '' | ||
| 115 | + this.deviceName = '' | ||
| 116 | + this.conditions = {} | ||
| 117 | + }, | ||
| 118 | + getQueryCondition(value) { | ||
| 119 | + const condition = Object.values(value) | ||
| 120 | + this.page.num = 1; | ||
| 121 | + this.loadData(this.page.num, value); | ||
| 122 | + this.conditions = value | ||
| 123 | + this.close() | ||
| 124 | + }, | ||
| 125 | + downCallback() { | ||
| 79 | if (getApp().getBindNot()) { | 126 | if (getApp().getBindNot()) { |
| 127 | + setTimeout(() => { | ||
| 128 | + this.mescroll.endByPage(0, 0) | ||
| 129 | + }, 200) | ||
| 80 | return | 130 | return |
| 81 | } | 131 | } |
| 82 | - this.page.num=1 | ||
| 83 | - if (this.ordId) { | ||
| 84 | - this.loadData(1, { | ||
| 85 | - organizationId: this.ordId | ||
| 86 | - }); | ||
| 87 | - this.conditions = { | ||
| 88 | - organizationId: this.ordId | ||
| 89 | - } | 132 | + this.list = []; |
| 133 | + this.page.num = 1; | ||
| 134 | + this.loadData(this.page.num); | ||
| 135 | + this.resetQuery(); | ||
| 136 | + }, | ||
| 137 | + upCallback() { | ||
| 138 | + if (getApp().getBindNot()) { | ||
| 139 | + setTimeout(() => { | ||
| 140 | + this.mescroll.endByPage(0, 0) | ||
| 141 | + }, 200) | ||
| 90 | return | 142 | return |
| 91 | } | 143 | } |
| 92 | - this.loadData(this.page.num,this.conditions); | ||
| 93 | - }, | ||
| 94 | - methods: { | ||
| 95 | - inputChanged(e) { | ||
| 96 | - if (getApp().getBindNot()) { | ||
| 97 | - return | ||
| 98 | - } | ||
| 99 | - this.page.num = 1; | ||
| 100 | - this.deviceName = e; | ||
| 101 | - this.conditions = { | ||
| 102 | - deviceName: e | ||
| 103 | - } | ||
| 104 | - this.loadData(1, { | ||
| 105 | - name: this.deviceName | ||
| 106 | - }); | ||
| 107 | - }, | ||
| 108 | - resetQuery() { | ||
| 109 | - this.$refs.devicePopupRef.resetFilter() | ||
| 110 | - this.ordId = '' | ||
| 111 | - this.deviceName = '' | ||
| 112 | - this.conditions = {} | ||
| 113 | - }, | ||
| 114 | - getQueryCondition(value) { | ||
| 115 | - const condition = Object.values(value) | ||
| 116 | - this.page.num = 1; | ||
| 117 | - this.loadData(this.page.num, value); | ||
| 118 | - this.conditions = value | ||
| 119 | - this.close() | ||
| 120 | - }, | ||
| 121 | - downCallback() { | ||
| 122 | - if (getApp().getBindNot()) { | ||
| 123 | - setTimeout(()=>{ | ||
| 124 | - this.mescroll.endByPage(0,0) | ||
| 125 | - },200) | ||
| 126 | - return | ||
| 127 | - } | ||
| 128 | - this.list = []; | ||
| 129 | - this.page.num = 1; | 144 | + const condition = Object.values(this.conditions) |
| 145 | + if (condition.length === 0) { | ||
| 146 | + this.page.num += 1; | ||
| 130 | this.loadData(this.page.num); | 147 | this.loadData(this.page.num); |
| 131 | - this.resetQuery(); | ||
| 132 | - }, | ||
| 133 | - upCallback() { | ||
| 134 | - if (getApp().getBindNot()) { | ||
| 135 | - setTimeout(()=>{ | ||
| 136 | - this.mescroll.endByPage(0,0) | ||
| 137 | - },200) | ||
| 138 | - return | 148 | + } else if (condition.filter(Boolean).length > 0) { |
| 149 | + this.page.num += 1; | ||
| 150 | + this.loadData(this.page.num, this.conditions); | ||
| 151 | + } else { | ||
| 152 | + this.page.num += 1; | ||
| 153 | + this.loadData(this.page.num); | ||
| 154 | + } | ||
| 155 | + }, | ||
| 156 | + //获取设备 | ||
| 157 | + async loadData(pageNo, params = {}) { | ||
| 158 | + try { | ||
| 159 | + let httpData = { | ||
| 160 | + page: pageNo, | ||
| 161 | + pageSize: 10, | ||
| 162 | + custom: { | ||
| 163 | + load: false | ||
| 164 | + }, | ||
| 165 | + }; | ||
| 166 | + const httpPostData = { | ||
| 167 | + "deviceProfileIds": null, | ||
| 168 | + ...params | ||
| 139 | } | 169 | } |
| 140 | - const condition = Object.values(this.conditions) | ||
| 141 | - if (condition.length === 0) { | ||
| 142 | - this.page.num += 1; | ||
| 143 | - this.loadData(this.page.num); | ||
| 144 | - } else if (condition.filter(Boolean).length > 0) { | ||
| 145 | - this.page.num += 1; | ||
| 146 | - this.loadData(this.page.num, this.conditions); | 170 | + const { |
| 171 | + total, | ||
| 172 | + items | ||
| 173 | + } = await api.deviceApi.getDeviceApi(httpData, httpPostData) | ||
| 174 | + this.total = total; | ||
| 175 | + uni.stopPullDownRefresh(); | ||
| 176 | + this.mescroll.endByPage(items.length, total); //必传参数(当前页的数据个数, 总页数) | ||
| 177 | + if (pageNo == 1) { | ||
| 178 | + this.list = items; | ||
| 147 | } else { | 179 | } else { |
| 148 | - this.page.num += 1; | ||
| 149 | - this.loadData(this.page.num); | ||
| 150 | - } | ||
| 151 | - }, | ||
| 152 | - //获取设备 | ||
| 153 | - async loadData(pageNo, params = {}) { | ||
| 154 | - try { | ||
| 155 | - let httpData = { | ||
| 156 | - page: pageNo, | ||
| 157 | - pageSize: 10, | ||
| 158 | - custom: { | ||
| 159 | - load: false | ||
| 160 | - }, | ||
| 161 | - }; | ||
| 162 | - const httpPostData = { | ||
| 163 | - "deviceProfileIds": null, | ||
| 164 | - ...params | ||
| 165 | - } | ||
| 166 | - const { | ||
| 167 | - total, | ||
| 168 | - items | ||
| 169 | - } = await api.deviceApi.getDeviceApi(httpData, httpPostData) | ||
| 170 | - this.total = total; | ||
| 171 | - uni.stopPullDownRefresh(); | ||
| 172 | - this.mescroll.endByPage(items.length, total); //必传参数(当前页的数据个数, 总页数) | ||
| 173 | - if (pageNo == 1) { | ||
| 174 | - this.list = items; | ||
| 175 | - } else { | ||
| 176 | - this.list = this.list.concat(items); | ||
| 177 | - } | ||
| 178 | - } catch { | ||
| 179 | - this.mescroll.endErr(); | 180 | + this.list = this.list.concat(items); |
| 180 | } | 181 | } |
| 181 | - }, | ||
| 182 | - openOrg() { | ||
| 183 | - if (getApp().getBindNot()) { | ||
| 184 | - uni.$u.toast('请进行账号绑定') | ||
| 185 | - return | ||
| 186 | - } | ||
| 187 | - useNavigateTo('/pages/organization/organization') | ||
| 188 | - }, | ||
| 189 | - close() { | ||
| 190 | - this.show = false; | ||
| 191 | - }, | ||
| 192 | - openSearchDialog() { | ||
| 193 | - if (getApp().getBindNot()) { | ||
| 194 | - uni.$u.toast('请进行账号绑定') | ||
| 195 | - return | ||
| 196 | - } | ||
| 197 | - this.show = true; | ||
| 198 | - this.$nextTick(() => { | ||
| 199 | - this.resetQuery(); | ||
| 200 | - }) | ||
| 201 | - }, | ||
| 202 | - openDeviceDetail(values) { | ||
| 203 | - const {id, alarmStatus, lastOnlineTime, tbDeviceId,transportType} = values || {} | ||
| 204 | - uni.navigateTo({ | ||
| 205 | - url: `/device-subpackage/device-detail/device-detail?id=${id}&alarmStatus=${alarmStatus}&lastOnlineTime=${lastOnlineTime}&tbDeviceId=${tbDeviceId}&transportType=${transportType}` | ||
| 206 | - }); | ||
| 207 | - }, | ||
| 208 | - } | ||
| 209 | - }; | 182 | + } catch { |
| 183 | + this.mescroll.endErr(); | ||
| 184 | + } | ||
| 185 | + }, | ||
| 186 | + openOrg() { | ||
| 187 | + if (getApp().getBindNot()) { | ||
| 188 | + uni.$u.toast(this.$t('device.pleaseBindAccount')) | ||
| 189 | + return | ||
| 190 | + } | ||
| 191 | + useNavigateTo('/pages/organization/organization') | ||
| 192 | + }, | ||
| 193 | + close() { | ||
| 194 | + this.show = false; | ||
| 195 | + }, | ||
| 196 | + openSearchDialog() { | ||
| 197 | + if (getApp().getBindNot()) { | ||
| 198 | + uni.$u.toast(this.$t('device.pleaseBindAccount')) | ||
| 199 | + return | ||
| 200 | + } | ||
| 201 | + this.show = true; | ||
| 202 | + this.$nextTick(() => { | ||
| 203 | + this.resetQuery(); | ||
| 204 | + }) | ||
| 205 | + }, | ||
| 206 | + openDeviceDetail(values) { | ||
| 207 | + const { id, alarmStatus, lastOnlineTime, tbDeviceId, transportType } = values || {} | ||
| 208 | + uni.navigateTo({ | ||
| 209 | + url: `/device-subpackage/device-detail/device-detail?id=${id}&alarmStatus=${alarmStatus}&lastOnlineTime=${lastOnlineTime}&tbDeviceId=${tbDeviceId}&transportType=${transportType}` | ||
| 210 | + }); | ||
| 211 | + }, | ||
| 212 | + } | ||
| 213 | +}; | ||
| 210 | </script> | 214 | </script> |
| 211 | 215 | ||
| 212 | <style lang="scss" scoped> | 216 | <style lang="scss" scoped> |
| 213 | - .device-page { | ||
| 214 | - min-height: 100vh; | ||
| 215 | - background-color: #f8f9fa; | ||
| 216 | - } | 217 | +.device-page { |
| 218 | + min-height: 100vh; | ||
| 219 | + background-color: #f8f9fa; | ||
| 220 | +} | ||
| 217 | 221 | ||
| 218 | - .device-top { | ||
| 219 | - padding: 10rpx 30rpx; | ||
| 220 | - background-color: #fff; | 222 | +.device-top { |
| 223 | + padding: 10rpx 30rpx; | ||
| 224 | + background-color: #fff; | ||
| 221 | 225 | ||
| 222 | - .search { | ||
| 223 | - display: flex; | ||
| 224 | - justify-content: space-between; | ||
| 225 | - padding-bottom: 10rpx; | 226 | + .search { |
| 227 | + display: flex; | ||
| 228 | + justify-content: space-between; | ||
| 229 | + padding-bottom: 10rpx; | ||
| 226 | 230 | ||
| 227 | - .search-left { | ||
| 228 | - width: 580rpx; | ||
| 229 | - background-color: #f8f9fa; | ||
| 230 | - border-radius: 200rpx; | ||
| 231 | - } | 231 | + .search-left { |
| 232 | + width: 580rpx; | ||
| 233 | + background-color: #f8f9fa; | ||
| 234 | + border-radius: 200rpx; | ||
| 235 | + } | ||
| 232 | 236 | ||
| 233 | - .search-right { | ||
| 234 | - display: flex; | ||
| 235 | - align-items: center; | 237 | + .search-right { |
| 238 | + display: flex; | ||
| 239 | + align-items: center; | ||
| 236 | 240 | ||
| 237 | - text { | ||
| 238 | - color: #333; | ||
| 239 | - font-size: 14px; | ||
| 240 | - } | 241 | + text { |
| 242 | + color: #333; | ||
| 243 | + font-size: 14px; | ||
| 244 | + } | ||
| 241 | 245 | ||
| 242 | - image { | ||
| 243 | - width: 40rpx; | ||
| 244 | - height: 40rpx; | ||
| 245 | - } | 246 | + image { |
| 247 | + width: 40rpx; | ||
| 248 | + height: 40rpx; | ||
| 246 | } | 249 | } |
| 247 | } | 250 | } |
| 248 | } | 251 | } |
| 252 | +} | ||
| 249 | </style> | 253 | </style> |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | <view class="camera-page"> | 2 | <view class="camera-page"> |
| 3 | <!-- 公共组件-每个页面必须引入 --> | 3 | <!-- 公共组件-每个页面必须引入 --> |
| 4 | <public-module></public-module> | 4 | <public-module></public-module> |
| 5 | - <header-org @openOrg="openOrg" :total="cameraTotal" title="摄像头数:" :imageSrc="imageSrc"></header-org> | 5 | + <header-org @openOrg="openOrg" :total="cameraTotal" :title="$t('homePage.cameraNum')" :imageSrc="imageSrc"></header-org> |
| 6 | <view style="height: 150rpx"></view> | 6 | <view style="height: 150rpx"></view> |
| 7 | <!-- 自带分页组件 --> | 7 | <!-- 自带分页组件 --> |
| 8 | <mescroll-body height="80%" ref="mescrollRef" :up="upOption" @init="mescrollInit" :down="downOption" | 8 | <mescroll-body height="80%" ref="mescrollRef" :up="upOption" @init="mescrollInit" :down="downOption" |
| @@ -72,6 +72,12 @@ export default { | @@ -72,6 +72,12 @@ export default { | ||
| 72 | } | 72 | } |
| 73 | }, | 73 | }, |
| 74 | onShow() { | 74 | onShow() { |
| 75 | + this.$nextTick(()=>{ | ||
| 76 | + uni.setNavigationBarTitle({ | ||
| 77 | + title:this.$t('menu.viewCamera') | ||
| 78 | + }) | ||
| 79 | + }) | ||
| 80 | + | ||
| 75 | if (this.ordId) { | 81 | if (this.ordId) { |
| 76 | this.loadData(1, this.ordId) | 82 | this.loadData(1, this.ordId) |
| 77 | } | 83 | } |
| @@ -147,8 +153,21 @@ export default { | @@ -147,8 +153,21 @@ export default { | ||
| 147 | } | 153 | } |
| 148 | } | 154 | } |
| 149 | }, | 155 | }, |
| 156 | + isRtspProtocol (url) { | ||
| 157 | + const reg = /^rtsp:\/\//g; | ||
| 158 | + return reg.test(url); | ||
| 159 | + }, | ||
| 150 | getPlaySource(items) { | 160 | getPlaySource(items) { |
| 151 | for (let item of items) { | 161 | for (let item of items) { |
| 162 | + // if(item.accessMode === 0) { | ||
| 163 | + // // const {videoUrl} = items || {} | ||
| 164 | + // // if(videoUrl){ | ||
| 165 | + // // const isRTSPPlay = isRtspProtocol(videoUrl) | ||
| 166 | + | ||
| 167 | + // // const | ||
| 168 | + // // } | ||
| 169 | + // item | ||
| 170 | + // } | ||
| 152 | if (item.accessMode === 1) { | 171 | if (item.accessMode === 1) { |
| 153 | api.homeApi.byCameraIdGetDetailApi(item.id).then(res => { | 172 | api.homeApi.byCameraIdGetDetailApi(item.id).then(res => { |
| 154 | item.videoUrl = res.data.url | 173 | item.videoUrl = res.data.url |
| @@ -27,6 +27,11 @@ | @@ -27,6 +27,11 @@ | ||
| 27 | uni.hideTabBar(); | 27 | uni.hideTabBar(); |
| 28 | }, | 28 | }, |
| 29 | onShow() { | 29 | onShow() { |
| 30 | + this.$nextTick(()=>{ | ||
| 31 | + uni.setNavigationBarTitle({ | ||
| 32 | + title:this.$t('menu.configurationDetail') | ||
| 33 | + }) | ||
| 34 | + }) | ||
| 30 | uni.setStorageSync('getConfiguration', { | 35 | uni.setStorageSync('getConfiguration', { |
| 31 | isConfiguration: true | 36 | isConfiguration: true |
| 32 | }); | 37 | }); |
| @@ -4,11 +4,11 @@ | @@ -4,11 +4,11 @@ | ||
| 4 | <view class="header-gap"></view> | 4 | <view class="header-gap"></view> |
| 5 | <view class="search-top"> | 5 | <view class="search-top"> |
| 6 | <view class="search-main"> | 6 | <view class="search-main"> |
| 7 | - <u--input @change="inputChanged" prefixIcon="search" placeholder="请输入组态名称" border="surround" | 7 | + <u--input @change="inputChanged" prefixIcon="search" :placeholder="$t('homePage.pleaseConfigurationname')" border="surround" |
| 8 | shape="circle"></u--input> | 8 | shape="circle"></u--input> |
| 9 | </view> | 9 | </view> |
| 10 | </view> | 10 | </view> |
| 11 | - <header-org @openOrg="openOrg" :total="total" title="组态数:" :imageSrc="imageSrc"></header-org> | 11 | + <header-org @openOrg="openOrg" :total="total" :title="$t('homePage.configurationNum')" :imageSrc="imageSrc"></header-org> |
| 12 | </view> | 12 | </view> |
| 13 | <view style="height:128rpx"></view> | 13 | <view style="height:128rpx"></view> |
| 14 | <!-- 公共组件-每个页面必须引入 --> | 14 | <!-- 公共组件-每个页面必须引入 --> |
| @@ -74,6 +74,12 @@ | @@ -74,6 +74,12 @@ | ||
| 74 | }); | 74 | }); |
| 75 | }, | 75 | }, |
| 76 | onShow() { | 76 | onShow() { |
| 77 | + this.$nextTick(()=>{ | ||
| 78 | + uni.setNavigationBarTitle({ | ||
| 79 | + title:this.$t('menu.viewConfiguration') | ||
| 80 | + }) | ||
| 81 | + }) | ||
| 82 | + | ||
| 77 | if (this.ordId) { | 83 | if (this.ordId) { |
| 78 | this.page.num = 1 | 84 | this.page.num = 1 |
| 79 | this.loadData(1,null, this.ordId); | 85 | this.loadData(1,null, this.ordId); |
| @@ -20,6 +20,13 @@ | @@ -20,6 +20,13 @@ | ||
| 20 | const url = await this.createShareUrl({id:e.id}) | 20 | const url = await this.createShareUrl({id:e.id}) |
| 21 | this.visualBoardUrl = url | 21 | this.visualBoardUrl = url |
| 22 | }, | 22 | }, |
| 23 | + onShow(){ | ||
| 24 | + this.$nextTick(()=>{ | ||
| 25 | + uni.setNavigationBarTitle({ | ||
| 26 | + title:this.$t('menu.boardDetail') | ||
| 27 | + }) | ||
| 28 | + }) | ||
| 29 | + }, | ||
| 23 | methods:{ | 30 | methods:{ |
| 24 | getUrl(id,userId){ | 31 | getUrl(id,userId){ |
| 25 | return `/appPage/${id}/${userId}` | 32 | return `/appPage/${id}/${userId}` |
| @@ -4,11 +4,11 @@ | @@ -4,11 +4,11 @@ | ||
| 4 | <view class="header-gap"></view> | 4 | <view class="header-gap"></view> |
| 5 | <view class="search-top"> | 5 | <view class="search-top"> |
| 6 | <view class="search-main"> | 6 | <view class="search-main"> |
| 7 | - <u--input @change="inputChanged" prefixIcon="search" placeholder="请输入看板名称" border="surround" | 7 | + <u--input @change="inputChanged" prefixIcon="search" :placeholder="$t('homePage.pleaseVisualBoard')" border="surround" |
| 8 | shape="circle"></u--input> | 8 | shape="circle"></u--input> |
| 9 | </view> | 9 | </view> |
| 10 | </view> | 10 | </view> |
| 11 | - <header-org @openOrg="openOrg" :total="total" title="看板数:" :imageSrc="imageSrc"></header-org> | 11 | + <header-org @openOrg="openOrg" :total="total" :title="$t('homePage.bulletionBoard')" :imageSrc="imageSrc"></header-org> |
| 12 | </view> | 12 | </view> |
| 13 | <view style="height:128rpx"></view> | 13 | <view style="height:128rpx"></view> |
| 14 | <!-- 公共组件-每个页面必须引入 --> | 14 | <!-- 公共组件-每个页面必须引入 --> |
| @@ -70,7 +70,10 @@ | @@ -70,7 +70,10 @@ | ||
| 70 | isConfiguration: false | 70 | isConfiguration: false |
| 71 | }); | 71 | }); |
| 72 | }, | 72 | }, |
| 73 | - onShow() { | 73 | + onShow(){ |
| 74 | + uni.setNavigationBarTitle({ | ||
| 75 | + title:this.$t('menu.viewBoard') | ||
| 76 | + }) | ||
| 74 | if (this.ordId) { | 77 | if (this.ordId) { |
| 75 | this.loadData(1,null, this.ordId); | 78 | this.loadData(1,null, this.ordId); |
| 76 | } | 79 | } |
| 1 | const basicGridList = [{ | 1 | const basicGridList = [{ |
| 2 | - event: 'openCamera', | ||
| 3 | - icon: '/static/camer.png', | ||
| 4 | - text: '摄像头管理' | ||
| 5 | - }, | ||
| 6 | - { | ||
| 7 | - event: 'openConfiguration', | ||
| 8 | - icon: '/static/status.png', | ||
| 9 | - text: '组态' | ||
| 10 | - }, | ||
| 11 | - { | ||
| 12 | - event: 'visualBoard', | ||
| 13 | - icon: '/static/visual-board.png', | ||
| 14 | - text: '看板' | ||
| 15 | - }, | 2 | + event: 'openCamera', |
| 3 | + icon: '/static/camer.png', | ||
| 4 | + text: 'homePage.cameraManagement' | ||
| 5 | +}, | ||
| 6 | +{ | ||
| 7 | + event: 'openConfiguration', | ||
| 8 | + icon: '/static/status.png', | ||
| 9 | + text: 'homePage.configuration' | ||
| 10 | +}, | ||
| 11 | +{ | ||
| 12 | + event: 'visualBoard', | ||
| 13 | + icon: '/static/visual-board.png', | ||
| 14 | + text: 'homePage.bulletinBoard' | ||
| 15 | +}, | ||
| 16 | ] | 16 | ] |
| 17 | 17 | ||
| 18 | const basicStatistics = [{ | 18 | const basicStatistics = [{ |
| 19 | - text: '设备统计', | ||
| 20 | - key: 'device', | ||
| 21 | - icon: '/static/device-total.png', | ||
| 22 | - leftParam: 'ONLINE', | ||
| 23 | - centerParam: 'OFFLINE', | ||
| 24 | - rightParam: 'INACTIVE', | ||
| 25 | - value: { | ||
| 26 | - leftValue: 0, | ||
| 27 | - centerValue: 0, | ||
| 28 | - rightValue: 0 | ||
| 29 | - }, | ||
| 30 | - label: { | ||
| 31 | - leftText: "在线", | ||
| 32 | - centerText: "离线", | ||
| 33 | - rightText: "待激活" | ||
| 34 | - } | 19 | + text: 'homePage.deviceStatistics', |
| 20 | + key: 'device', | ||
| 21 | + icon: '/static/device-total.png', | ||
| 22 | + leftParam: 'ONLINE', | ||
| 23 | + centerParam: 'OFFLINE', | ||
| 24 | + rightParam: 'INACTIVE', | ||
| 25 | + value: { | ||
| 26 | + leftValue: 0, | ||
| 27 | + centerValue: 0, | ||
| 28 | + rightValue: 0 | ||
| 35 | }, | 29 | }, |
| 36 | - { | ||
| 37 | - text: '告警统计', | ||
| 38 | - key: 'alarm', | ||
| 39 | - icon: '/static/alert.png', | ||
| 40 | - leftParam: ['ACTIVE_UNACK'], | ||
| 41 | - centerParam: 'CLEARED_ACK', | ||
| 42 | - rightParam: 'CLEARED_UNACK', | ||
| 43 | - value: { | ||
| 44 | - leftValue: 0, | ||
| 45 | - centerValue: 0, | ||
| 46 | - rightValue: 0 | ||
| 47 | - }, | ||
| 48 | - label: { | ||
| 49 | - leftText: "未处理", | ||
| 50 | - centerText: "已处理", | ||
| 51 | - rightText: "误报" | ||
| 52 | - } | 30 | + label: { |
| 31 | + leftText: "homePage.deviceLabel.onLine", | ||
| 32 | + centerText: "homePage.deviceLabel.offLine", | ||
| 33 | + rightText: "homePage.deviceLabel.beActivated" | ||
| 34 | + } | ||
| 35 | +}, | ||
| 36 | +{ | ||
| 37 | + text: 'homePage.alarmStatistics', | ||
| 38 | + key: 'alarm', | ||
| 39 | + icon: '/static/alert.png', | ||
| 40 | + leftParam: ['ACTIVE_UNACK'], | ||
| 41 | + centerParam: 'CLEARED_ACK', | ||
| 42 | + rightParam: 'CLEARED_UNACK', | ||
| 43 | + value: { | ||
| 44 | + leftValue: 0, | ||
| 45 | + centerValue: 0, | ||
| 46 | + rightValue: 0 | ||
| 53 | }, | 47 | }, |
| 48 | + label: { | ||
| 49 | + leftText: "homePage.alarmLabel.untreated", | ||
| 50 | + centerText: "homePage.alarmLabel.processed", | ||
| 51 | + rightText: "homePage.alarmLabel.falseAlarm" | ||
| 52 | + } | ||
| 53 | +}, | ||
| 54 | ] | 54 | ] |
| 55 | 55 | ||
| 56 | export { | 56 | export { |
| @@ -5,34 +5,33 @@ | @@ -5,34 +5,33 @@ | ||
| 5 | <view> | 5 | <view> |
| 6 | <!-- 基础统计 --> | 6 | <!-- 基础统计 --> |
| 7 | <view class="basic-statistics"> | 7 | <view class="basic-statistics"> |
| 8 | - <view class="basic-text"><text class="text text-bold">基础统计</text></view> | 8 | + <view class="basic-text"><text class="text text-bold">{{ $t('homePage.basicstatistics') }}</text></view> |
| 9 | <view class="basic"> | 9 | <view class="basic"> |
| 10 | - <view class="basic-item" v-for="(item,index) in basicStatistics" :key="index"> | 10 | + <view class="basic-item" v-for="(item, index) in basicStatistics" :key="index"> |
| 11 | <view class="item-child-top u-flex"> | 11 | <view class="item-child-top u-flex"> |
| 12 | <image class="item-image" :src="item.icon"></image> | 12 | <image class="item-image" :src="item.icon"></image> |
| 13 | - <text class="item-text home-text-muted">{{item.text}}</text> | 13 | + <text class="item-text home-text-muted">{{ $t(item.text) }}</text> |
| 14 | </view> | 14 | </view> |
| 15 | <view class="item-child-bottom u-flex"> | 15 | <view class="item-child-bottom u-flex"> |
| 16 | - <view @click="navigatorPage(item,item.leftParam)" class="u-flex sigle-child"> | 16 | + <view @click="navigatorPage(item, item.leftParam)" class="u-flex sigle-child"> |
| 17 | <view class="sigle-text"> | 17 | <view class="sigle-text"> |
| 18 | - <text class="home-text-total">{{item.value.leftValue}}</text> | 18 | + <text class="home-text-total">{{ item.value.leftValue }}</text> |
| 19 | </view> | 19 | </view> |
| 20 | - <view class="sigle-value"><text | ||
| 21 | - class="home-text-total-bottom">{{item.label.leftText}}</text></view> | 20 | + <view class="sigle-value"><text class="home-text-total-bottom">{{ $t(item.label.leftText) }}</text></view> |
| 22 | </view> | 21 | </view> |
| 23 | - <view @click="navigatorPage(item,item.centerParam)" class="u-flex sigle-child"> | 22 | + <view @click="navigatorPage(item, item.centerParam)" class="u-flex sigle-child"> |
| 24 | <view class="sigle-text"> | 23 | <view class="sigle-text"> |
| 25 | - <text class="home-text-total">{{item.value.centerValue}}</text> | 24 | + <text class="home-text-total">{{ item.value.centerValue }}</text> |
| 25 | + </view> | ||
| 26 | + <view class="sigle-value"><text class="home-text-total-bottom">{{ $t(item.label.centerText) }}</text> | ||
| 26 | </view> | 27 | </view> |
| 27 | - <view class="sigle-value"><text | ||
| 28 | - class="home-text-total-bottom">{{item.label.centerText}}</text></view> | ||
| 29 | </view> | 28 | </view> |
| 30 | - <view @click="navigatorPage(item,item.rightParam)" class="u-flex sigle-child"> | 29 | + <view @click="navigatorPage(item, item.rightParam)" class="u-flex sigle-child"> |
| 31 | <view class="sigle-text"> | 30 | <view class="sigle-text"> |
| 32 | - <text class="home-text-total">{{item.value.rightValue}}</text> | 31 | + <text class="home-text-total">{{ item.value.rightValue }}</text> |
| 32 | + </view> | ||
| 33 | + <view class="sigle-value"><text class="home-text-total-bottom">{{ $t(item.label.rightText) }}</text> | ||
| 33 | </view> | 34 | </view> |
| 34 | - <view class="sigle-value"><text | ||
| 35 | - class="home-text-total-bottom">{{item.label.rightText}}</text></view> | ||
| 36 | </view> | 35 | </view> |
| 37 | </view> | 36 | </view> |
| 38 | </view> | 37 | </view> |
| @@ -40,13 +39,12 @@ | @@ -40,13 +39,12 @@ | ||
| 40 | </view> | 39 | </view> |
| 41 | <!-- 网格信息 --> | 40 | <!-- 网格信息 --> |
| 42 | <view class="grid-container"> | 41 | <view class="grid-container"> |
| 43 | - <view v-for="(item,index) in basicGridList" :key="index" @click="handleEvent(item.event)" | ||
| 44 | - class="grid-item"> | 42 | + <view v-for="(item, index) in basicGridList" :key="index" @click="handleEvent(item.event)" class="grid-item"> |
| 45 | <view class="item-center"> | 43 | <view class="item-center"> |
| 46 | <view class="center"> | 44 | <view class="center"> |
| 47 | <image class="image" :src="item.icon"></image> | 45 | <image class="image" :src="item.icon"></image> |
| 48 | </view> | 46 | </view> |
| 49 | - <view class="center-text"><text class="text text-muted" style="">{{item.text}}</text></view> | 47 | + <view class="center-text"><text class="text text-muted" style="">{{ $t(item.text) }}</text></view> |
| 50 | </view> | 48 | </view> |
| 51 | </view> | 49 | </view> |
| 52 | </view> | 50 | </view> |
| @@ -56,134 +54,144 @@ | @@ -56,134 +54,144 @@ | ||
| 56 | </template> | 54 | </template> |
| 57 | 55 | ||
| 58 | <script> | 56 | <script> |
| 59 | - import fTabbar from '@/components/module/f-tabbar/f-tabbar'; | ||
| 60 | - import { | ||
| 61 | - mapActions | ||
| 62 | - } from 'vuex'; | ||
| 63 | - import api from '@/api/index.js' | ||
| 64 | - import { | ||
| 65 | - useNavigateTo | ||
| 66 | - } from '@/plugins/utils.js' | ||
| 67 | - import { | ||
| 68 | - basicGridList, | ||
| 69 | - basicStatistics | ||
| 70 | - } from './config/data.js' | 57 | +import fTabbar from '@/components/module/f-tabbar/f-tabbar'; |
| 58 | +import { | ||
| 59 | + mapActions | ||
| 60 | +} from 'vuex'; | ||
| 61 | +import api from '@/api/index.js' | ||
| 62 | +import { | ||
| 63 | + useNavigateTo | ||
| 64 | +} from '@/plugins/utils.js' | ||
| 65 | +import { | ||
| 66 | + basicGridList, | ||
| 67 | + basicStatistics | ||
| 68 | +} from './config/data.js' | ||
| 71 | 69 | ||
| 72 | - export default { | ||
| 73 | - components: { | ||
| 74 | - fTabbar | 70 | +export default { |
| 71 | + components: { | ||
| 72 | + fTabbar | ||
| 73 | + }, | ||
| 74 | + data() { | ||
| 75 | + return { | ||
| 76 | + basicGridList, | ||
| 77 | + basicStatistics, | ||
| 78 | + }; | ||
| 79 | + }, | ||
| 80 | + onReady(){ | ||
| 81 | + console.log(123,'123') | ||
| 82 | + }, | ||
| 83 | + onLoad() { | ||
| 84 | + // 隐藏原生的tabbar | ||
| 85 | + uni.hideTabBar() | ||
| 86 | + }, | ||
| 87 | + onShow() { | ||
| 88 | + this.$nextTick(()=>{ | ||
| 89 | + uni.setNavigationBarTitle({ | ||
| 90 | + title:this.$t('menu.homePage') | ||
| 91 | + }) | ||
| 92 | + }) | ||
| 93 | + | ||
| 94 | + if (getApp().getBindNot()) { | ||
| 95 | + this.basicStatistics.map(item => { | ||
| 96 | + const { key, value } = item | ||
| 97 | + if (key === 'device') { | ||
| 98 | + value.leftValue = 0 | ||
| 99 | + value.centerValue = 0 | ||
| 100 | + value.rightValue = 0 | ||
| 101 | + } else { | ||
| 102 | + value.leftValue = 0 | ||
| 103 | + value.centerValue = 0 | ||
| 104 | + value.rightValue = 0 | ||
| 105 | + } | ||
| 106 | + }) | ||
| 107 | + return | ||
| 108 | + } | ||
| 109 | + this.getDeviceTotalData(); | ||
| 110 | + uni.setStorageSync('getConfiguration', { | ||
| 111 | + isConfiguration: false | ||
| 112 | + }); | ||
| 113 | + uni.removeStorageSync('getConfiguration'); | ||
| 114 | + | ||
| 115 | + }, | ||
| 116 | + onPullDownRefresh() { | ||
| 117 | + if (getApp().getBindNot()) { | ||
| 118 | + return | ||
| 119 | + } | ||
| 120 | + this.getDeviceTotalData(); | ||
| 121 | + setTimeout(function () { | ||
| 122 | + uni.stopPullDownRefresh(); | ||
| 123 | + uni.$u.toast(this.$t('common.refreshSuccess')); | ||
| 124 | + }, 200); | ||
| 125 | + }, | ||
| 126 | + methods: { | ||
| 127 | + ...mapActions(['updateBadgeTotal']), | ||
| 128 | + async getDeviceTotalData() { | ||
| 129 | + const res = await api.homeApi.getHomeStatisticsApi() | ||
| 130 | + if (res) { | ||
| 131 | + const { onLine, offLine, inActive } = res.totalDevice | ||
| 132 | + const { activedAlarm, clearedAck, clearedUnack } = res.totalAlarm | ||
| 133 | + this.basicStatistics.map(item => { | ||
| 134 | + const { key, value } = item | ||
| 135 | + if (key === 'device') { | ||
| 136 | + value.leftValue = onLine | ||
| 137 | + value.centerValue = offLine | ||
| 138 | + value.rightValue = inActive | ||
| 139 | + } else { | ||
| 140 | + value.leftValue = activedAlarm | ||
| 141 | + value.centerValue = clearedAck | ||
| 142 | + value.rightValue = clearedUnack | ||
| 143 | + } | ||
| 144 | + }) | ||
| 145 | + //异步实时更新告警徽标数 | ||
| 146 | + this.updateBadgeTotal(res.totalAlarm?.activedAlarm); | ||
| 147 | + } | ||
| 75 | }, | 148 | }, |
| 76 | - data() { | ||
| 77 | - return { | ||
| 78 | - basicGridList, | ||
| 79 | - basicStatistics, | ||
| 80 | - }; | 149 | + openCamera() { |
| 150 | + useNavigateTo('components/camera/camera') | ||
| 81 | }, | 151 | }, |
| 82 | - onLoad() { | ||
| 83 | - // 隐藏原生的tabbar | ||
| 84 | - uni.hideTabBar(); | 152 | + openConfiguration() { |
| 153 | + useNavigateTo('components/configuration/configuration') | ||
| 85 | }, | 154 | }, |
| 86 | - onShow(){ | ||
| 87 | - if (getApp().getBindNot()) { | ||
| 88 | - this.basicStatistics.map(item=>{ | ||
| 89 | - const { key, value } = item | ||
| 90 | - if(key === 'device'){ | ||
| 91 | - value.leftValue = 0 | ||
| 92 | - value.centerValue =0 | ||
| 93 | - value.rightValue = 0 | ||
| 94 | - }else{ | ||
| 95 | - value.leftValue = 0 | ||
| 96 | - value.centerValue =0 | ||
| 97 | - value.rightValue = 0 | ||
| 98 | - } | ||
| 99 | - }) | ||
| 100 | - return | ||
| 101 | - } | ||
| 102 | - this.getDeviceTotalData(); | ||
| 103 | - uni.setStorageSync('getConfiguration', { | ||
| 104 | - isConfiguration: false | ||
| 105 | - }); | ||
| 106 | - uni.removeStorageSync('getConfiguration'); | 155 | + openVisualBoard() { |
| 156 | + useNavigateTo('components/visualBoard/index') | ||
| 107 | }, | 157 | }, |
| 108 | - onPullDownRefresh() { | 158 | + handleEvent(event) { |
| 109 | if (getApp().getBindNot()) { | 159 | if (getApp().getBindNot()) { |
| 160 | + uni.$u.toast(this.$t('common.pleaseBindAccount')) | ||
| 110 | return | 161 | return |
| 111 | } | 162 | } |
| 112 | - this.getDeviceTotalData(); | ||
| 113 | - setTimeout(function() { | ||
| 114 | - uni.stopPullDownRefresh(); | ||
| 115 | - uni.$u.toast('下拉刷新成功...'); | ||
| 116 | - }, 200); | 163 | + if (event === 'visualBoard') { |
| 164 | + this.openVisualBoard() | ||
| 165 | + } else if (event === 'openCamera') this.openCamera() | ||
| 166 | + else { | ||
| 167 | + this.openConfiguration() | ||
| 168 | + } | ||
| 117 | }, | 169 | }, |
| 118 | - methods: { | ||
| 119 | - ...mapActions(['updateBadgeTotal']), | ||
| 120 | - async getDeviceTotalData() { | ||
| 121 | - const res = await api.homeApi.getHomeStatisticsApi() | ||
| 122 | - if (res) { | ||
| 123 | - const { onLine,offLine,inActive } = res.totalDevice | ||
| 124 | - const { activedAlarm,clearedAck,clearedUnack } = res.totalAlarm | ||
| 125 | - this.basicStatistics.map(item=>{ | ||
| 126 | - const { key, value } = item | ||
| 127 | - if(key === 'device'){ | ||
| 128 | - value.leftValue = onLine | ||
| 129 | - value.centerValue =offLine | ||
| 130 | - value.rightValue = inActive | ||
| 131 | - }else{ | ||
| 132 | - value.leftValue = activedAlarm | ||
| 133 | - value.centerValue =clearedAck | ||
| 134 | - value.rightValue = clearedUnack | ||
| 135 | - } | ||
| 136 | - }) | ||
| 137 | - //异步实时更新告警徽标数 | ||
| 138 | - this.updateBadgeTotal(res.totalAlarm?.activedAlarm); | ||
| 139 | - } | ||
| 140 | - }, | ||
| 141 | - openCamera() { | ||
| 142 | - useNavigateTo('components/camera/camera') | ||
| 143 | - }, | ||
| 144 | - openConfiguration() { | ||
| 145 | - useNavigateTo('components/configuration/configuration') | ||
| 146 | - }, | ||
| 147 | - openVisualBoard() { | ||
| 148 | - useNavigateTo('components/visualBoard/index') | ||
| 149 | - }, | ||
| 150 | - handleEvent(event) { | ||
| 151 | - if (getApp().getBindNot()) { | ||
| 152 | - uni.$u.toast('请进行账号绑定') | ||
| 153 | - return | ||
| 154 | - } | ||
| 155 | - if(event==='visualBoard') { | ||
| 156 | - this.openVisualBoard() | ||
| 157 | - }else if (event === 'openCamera') this.openCamera() | ||
| 158 | - else { | ||
| 159 | - this.openConfiguration() | ||
| 160 | - } | ||
| 161 | - }, | ||
| 162 | - navigatorPage(item, type) { | ||
| 163 | - const { | ||
| 164 | - text | ||
| 165 | - } = item | ||
| 166 | - if (text === '设备统计') this.navigatorDeviceStatus(type) | ||
| 167 | - else { | ||
| 168 | - this.navigatorAlarmStatus(type) | ||
| 169 | - } | ||
| 170 | - }, | ||
| 171 | - //告警状态查询 | ||
| 172 | - navigatorAlarmStatus(e) { | ||
| 173 | - uni.reLaunch({ | ||
| 174 | - url: '../alarm/alarm?type=' + JSON.stringify(e) | ||
| 175 | - }); | ||
| 176 | - }, | ||
| 177 | - //设备状态查询 | ||
| 178 | - navigatorDeviceStatus(e) { | ||
| 179 | - uni.reLaunch({ | ||
| 180 | - url: '../device/device?deviceState=' + JSON.stringify(e) | ||
| 181 | - }); | 170 | + navigatorPage(item, type) { |
| 171 | + const { | ||
| 172 | + text | ||
| 173 | + } = item | ||
| 174 | + if (text === 'homePage.deviceStatistics') this.navigatorDeviceStatus(type) | ||
| 175 | + else { | ||
| 176 | + this.navigatorAlarmStatus(type) | ||
| 182 | } | 177 | } |
| 178 | + }, | ||
| 179 | + //告警状态查询 | ||
| 180 | + navigatorAlarmStatus(e) { | ||
| 181 | + uni.reLaunch({ | ||
| 182 | + url: '../alarm/alarm?type=' + JSON.stringify(e) | ||
| 183 | + }); | ||
| 184 | + }, | ||
| 185 | + //设备状态查询 | ||
| 186 | + navigatorDeviceStatus(e) { | ||
| 187 | + uni.reLaunch({ | ||
| 188 | + url: '../device/device?deviceState=' + JSON.stringify(e) | ||
| 189 | + }); | ||
| 183 | } | 190 | } |
| 184 | - }; | 191 | + } |
| 192 | +}; | ||
| 185 | </script> | 193 | </script> |
| 186 | 194 | ||
| 187 | <style lang="scss" scoped> | 195 | <style lang="scss" scoped> |
| 188 | - @import './static/index.scss'; | 196 | +@import './static/index.scss'; |
| 189 | </style> | 197 | </style> |
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | <view class="splash-container-box"> | 3 | <view class="splash-container-box"> |
| 4 | <image v-if="initConfig.logo" :src="initConfig.logo"></image> | 4 | <image v-if="initConfig.logo" :src="initConfig.logo"></image> |
| 5 | <image v-else :src="staticLogo"></image> | 5 | <image v-else :src="staticLogo"></image> |
| 6 | - <text class="splash-text-muted">连接世界 创造价值</text> | 6 | + <text class="splash-text-muted">{{ $t('spreadTail') }}</text> |
| 7 | </view> | 7 | </view> |
| 8 | </view> | 8 | </view> |
| 9 | </template> | 9 | </template> |
| @@ -60,4 +60,4 @@ | @@ -60,4 +60,4 @@ | ||
| 60 | 60 | ||
| 61 | <style lang="scss" scoped> | 61 | <style lang="scss" scoped> |
| 62 | @import './static/splash.scss'; | 62 | @import './static/splash.scss'; |
| 63 | -</style> | ||
| 63 | +</style> |
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | <!-- 公共组件-每个页面必须引入 --> | 3 | <!-- 公共组件-每个页面必须引入 --> |
| 4 | <public-module></public-module> | 4 | <public-module></public-module> |
| 5 | <view> | 5 | <view> |
| 6 | - <luyj-tree @sendValue="confirm" :is-check="isCheck" search-placeholder="请输入搜索内容" :search-if="true" v-slot:default="{ item }" :max="max" :trees="tree"> | 6 | + <luyj-tree @sendValue="confirm" :is-check="isCheck" :search-placeholder="$t('common.pleaseEnterContent')" :search-if="true" v-slot:default="{ item }" :max="max" :trees="tree"> |
| 7 | <view> | 7 | <view> |
| 8 | <view class="content-item"> | 8 | <view class="content-item"> |
| 9 | <view class="word">{{ item.name }}</view> | 9 | <view class="word">{{ item.name }}</view> |
| @@ -28,6 +28,11 @@ export default { | @@ -28,6 +28,11 @@ export default { | ||
| 28 | id: '' | 28 | id: '' |
| 29 | }; | 29 | }; |
| 30 | }, | 30 | }, |
| 31 | + onShow(){ | ||
| 32 | + uni.setNavigationBarTitle({ | ||
| 33 | + title:this.$t('menu.organizationScreening') | ||
| 34 | + }) | ||
| 35 | + }, | ||
| 31 | onLoad(e) { | 36 | onLoad(e) { |
| 32 | // 隐藏原生的tabbar | 37 | // 隐藏原生的tabbar |
| 33 | uni.hideTabBar(); | 38 | uni.hideTabBar(); |
| 1 | <template> | 1 | <template> |
| 2 | <view> | 2 | <view> |
| 3 | - <u-modal :showConfirmButton="false" :show="show" :title="title"> | 3 | + <u-modal :showConfirmButton="false" :show="show" :title="$t(title)"> |
| 4 | <view v-if="!bindPhone" class="login-phone"> | 4 | <view v-if="!bindPhone" class="login-phone"> |
| 5 | <view class="form-row"> | 5 | <view class="form-row"> |
| 6 | - <u--input shape="circle" class="input" prefixIcon="account-fill" type="text" placeholder="请输入登录账号" | 6 | + <u--input shape="circle" class="input" prefixIcon="account-fill" type="text" :placeholder="$t('login.pleaseEnterAccount')" |
| 7 | v-model="bindAccountForm.appUserKey"></u--input> | 7 | v-model="bindAccountForm.appUserKey"></u--input> |
| 8 | </view> | 8 | </view> |
| 9 | <view class="form-row item-bind"> | 9 | <view class="form-row item-bind"> |
| 10 | <u--input class="input" shape="circle" prefixIcon="lock-fill" suffixIconStyle="color: #909399" | 10 | <u--input class="input" shape="circle" prefixIcon="lock-fill" suffixIconStyle="color: #909399" |
| 11 | - type="password" placeholder="请输入登录密码" v-model="bindAccountForm.appUserSecret"></u--input> | 11 | + type="password" :placeholder="$t('login.pleaseEnterPassword')" v-model="bindAccountForm.appUserSecret"></u--input> |
| 12 | </view> | 12 | </view> |
| 13 | <view class="u-flex item-phone"> | 13 | <view class="u-flex item-phone"> |
| 14 | - <view class="bind-phone-text" @click="openBindPhone">手机绑定</view> | 14 | + <view class="bind-phone-text" @click="openBindPhone">{{ $t('login.phoneBind') }}</view> |
| 15 | </view> | 15 | </view> |
| 16 | </view> | 16 | </view> |
| 17 | <view v-else class="login-phone"> | 17 | <view v-else class="login-phone"> |
| 18 | <view class="form-row"> | 18 | <view class="form-row"> |
| 19 | <u--input shape="circle" class="input" type="text" v-model="bindPhoneForm.appUserKey" | 19 | <u--input shape="circle" class="input" type="text" v-model="bindPhoneForm.appUserKey" |
| 20 | - placeholder="请输入手机号码" placeholder-style="font-weight:normal;color:#bbbbbb;"></u--input> | 20 | + :placeholder="$t('login.PleaseEnterPhone')" placeholder-style="font-weight:normal;color:#bbbbbb;"></u--input> |
| 21 | </view> | 21 | </view> |
| 22 | <view class="form-row row-top"> | 22 | <view class="form-row row-top"> |
| 23 | <u--input shape="circle" class="input" type="text" v-model="bindPhoneForm.appUserSecret" | 23 | <u--input shape="circle" class="input" type="text" v-model="bindPhoneForm.appUserSecret" |
| 24 | - placeholder="请输入验证码" placeholder-style="font-weight:normal;color:#bbbbbb;"></u--input> | 24 | + :placeholder="$t('login.PleaseEnterCode')" placeholder-style="font-weight:normal;color:#bbbbbb;"></u--input> |
| 25 | <view style="color: #377dff" class="verify-code" :class="{ forhidden: readonly }" | 25 | <view style="color: #377dff" class="verify-code" :class="{ forhidden: readonly }" |
| 26 | @click="getVerifyCode"> | 26 | @click="getVerifyCode"> |
| 27 | {{ codeText }} | 27 | {{ codeText }} |
| 28 | </view> | 28 | </view> |
| 29 | </view> | 29 | </view> |
| 30 | <view class="u-flex item-phone"> | 30 | <view class="u-flex item-phone"> |
| 31 | - <view class="bind-phone-text" @click="openBindAccount">账号绑定</view> | 31 | + <view class="bind-phone-text" @click="openBindAccount">{{ $t('login.accountBind') }}</view> |
| 32 | </view> | 32 | </view> |
| 33 | </view> | 33 | </view> |
| 34 | <view class="bottom-content"> | 34 | <view class="bottom-content"> |
| 35 | <view class="u-flex content"> | 35 | <view class="u-flex content"> |
| 36 | <view class="cancel"> | 36 | <view class="cancel"> |
| 37 | - <u-button @click="$emit('cancelAccountModal')" type="info" shape="circle" text="取消"></u-button> | 37 | + <u-button @click="$emit('cancelAccountModal')" type="info" shape="circle" :text="$t('common.cancelText')"></u-button> |
| 38 | </view> | 38 | </view> |
| 39 | <view class="confrim"> | 39 | <view class="confrim"> |
| 40 | - <u-button @click="handleConfirm" type="primary" shape="circle" text="确认"></u-button> | 40 | + <u-button @click="handleConfirm" type="primary" shape="circle" :text="$t('common.confirm')"></u-button> |
| 41 | </view> | 41 | </view> |
| 42 | </view> | 42 | </view> |
| 43 | </view> | 43 | </view> |
| @@ -68,9 +68,9 @@ | @@ -68,9 +68,9 @@ | ||
| 68 | data() { | 68 | data() { |
| 69 | return { | 69 | return { |
| 70 | readonly: false, | 70 | readonly: false, |
| 71 | - codeText: '获取验证码', | 71 | + codeText:'', |
| 72 | bindPhone: false, | 72 | bindPhone: false, |
| 73 | - title: '绑定账号', | 73 | + title: 'login.bindAccount', |
| 74 | bindAccountForm: { | 74 | bindAccountForm: { |
| 75 | appUserKey: '', | 75 | appUserKey: '', |
| 76 | appUserSecret: '' | 76 | appUserSecret: '' |
| @@ -85,6 +85,7 @@ | @@ -85,6 +85,7 @@ | ||
| 85 | // 隐藏原生的tabbar | 85 | // 隐藏原生的tabbar |
| 86 | uni.hideTabBar(); | 86 | uni.hideTabBar(); |
| 87 | this.getOpenId = getApp().globalData.openId; | 87 | this.getOpenId = getApp().globalData.openId; |
| 88 | + this.codeText = this.$t('login.obtainCode') | ||
| 88 | }, | 89 | }, |
| 89 | methods: { | 90 | methods: { |
| 90 | ...mapMutations(["setUserInfo", "setPlateInfo"]), | 91 | ...mapMutations(["setUserInfo", "setPlateInfo"]), |
| @@ -125,21 +126,20 @@ | @@ -125,21 +126,20 @@ | ||
| 125 | //账号绑定 | 126 | //账号绑定 |
| 126 | if (!this.bindPhone) { | 127 | if (!this.bindPhone) { |
| 127 | const validateValue = Object.values(this.bindAccountForm) | 128 | const validateValue = Object.values(this.bindAccountForm) |
| 128 | - if (!validateValue[0]) return uni.$u.toast("请输入登录账号~"); | ||
| 129 | - if (!validateValue[1]) return uni.$u.toast("请输入登录密码~"); | ||
| 130 | - if (!loginPasswordReg.test(validateValue[1])) return useShowModal( | ||
| 131 | - "密码格式不正确(至少一个大写英文字母、至少一个小写英文字母、至少一位数字、至少一个特殊字符、最少八个字符)~", ) | ||
| 132 | - this.handleBindForm('ACCOUNT', this.bindAccountForm, '账号绑定成功~') | 129 | + if (!validateValue[0]) return uni.$u.toast(this.$t('login.pleaseEnterAccount')); |
| 130 | + if (!validateValue[1]) return uni.$u.toast(this.$t('login.pleaseEnterPassword')); | ||
| 131 | + if (!loginPasswordReg.test(validateValue[1])) return useShowModal(this.$t('login.passwordRule')) | ||
| 132 | + this.handleBindForm('ACCOUNT', this.bindAccountForm, this.$t('login.accountBindSuccess')) | ||
| 133 | } else { | 133 | } else { |
| 134 | //手机绑定 | 134 | //手机绑定 |
| 135 | const phoneRegular = /^1\d{10}$/; | 135 | const phoneRegular = /^1\d{10}$/; |
| 136 | const verifyCodeReg = /^\d{6}$/; | 136 | const verifyCodeReg = /^\d{6}$/; |
| 137 | const validateValue = Object.values(this.bindPhoneForm) | 137 | const validateValue = Object.values(this.bindPhoneForm) |
| 138 | - if (!validateValue[0]) return uni.$u.toast("请输入手机号码~"); | ||
| 139 | - if (!validateValue[1]) return uni.$u.toast("请输入验证码~"); | ||
| 140 | - if (!phoneRegular.test(validateValue[0])) return uni.$u.toast("手机号格式不正确~"); | ||
| 141 | - if (!verifyCodeReg.test(validateValue[1])) return uni.$u.toast("验证码格式不正确~"); | ||
| 142 | - this.handleBindForm('PHONE', this.bindPhoneForm, '手机绑定成功~') | 138 | + if (!validateValue[0]) return uni.$u.toast(this.$t('login.PleaseEnterPhone')); |
| 139 | + if (!validateValue[1]) return uni.$u.toast(this.$t('login.PleaseEnterCode')); | ||
| 140 | + if (!phoneRegular.test(validateValue[0])) return uni.$u.toast(this.$t('login.phoneFormatFail')); | ||
| 141 | + if (!verifyCodeReg.test(validateValue[1])) return uni.$u.toast(this.$t('login.codeFormatFail')); | ||
| 142 | + this.handleBindForm('PHONE', this.bindPhoneForm, this.$t('login.phoneBindSuccess')) | ||
| 143 | } | 143 | } |
| 144 | }, | 144 | }, |
| 145 | async saveUserInfo() { | 145 | async saveUserInfo() { |
| @@ -160,14 +160,14 @@ | @@ -160,14 +160,14 @@ | ||
| 160 | verifyCodeCountDown() { | 160 | verifyCodeCountDown() { |
| 161 | const _this = this; | 161 | const _this = this; |
| 162 | this.readonly = true; | 162 | this.readonly = true; |
| 163 | - this.codeText = '60S后重新获取'; | 163 | + this.codeText = this.$t('login.codeAfterSeconds',{number:60}); |
| 164 | var s = 60; | 164 | var s = 60; |
| 165 | clear = setInterval(() => { | 165 | clear = setInterval(() => { |
| 166 | s--; | 166 | s--; |
| 167 | - _this.codeText = s + 'S后重新获取'; | 167 | + _this.codeText =this.$t('login.codeAfterSeconds',{number:s}); |
| 168 | if (s <= 0) { | 168 | if (s <= 0) { |
| 169 | clearInterval(clear); | 169 | clearInterval(clear); |
| 170 | - _this.codeText = '获取验证码'; | 170 | + _this.codeText = this.$t('login.obtainCode'); |
| 171 | _this.readonly = false; | 171 | _this.readonly = false; |
| 172 | } | 172 | } |
| 173 | }, 1000); | 173 | }, 1000); |
| @@ -175,9 +175,9 @@ | @@ -175,9 +175,9 @@ | ||
| 175 | //获取验证码 | 175 | //获取验证码 |
| 176 | async getVerifyCode() { | 176 | async getVerifyCode() { |
| 177 | const phoneRegular = /^1\d{10}$/; | 177 | const phoneRegular = /^1\d{10}$/; |
| 178 | - if (this.readonly) useShowToast('验证码已发送~') | ||
| 179 | - if (!this.bindPhoneForm.appUserKey) return useShowToast('请输入手机号~') | ||
| 180 | - if (!phoneRegular.test(this.bindPhoneForm.appUserKey)) return useShowToast('手机号格式不正确~') | 178 | + if (this.readonly) useShowToast(this.$t('login.codeBeenSend')) |
| 179 | + if (!this.bindPhoneForm.appUserKey) return useShowToast(this.$t('login.PleaseEnterPhone')) | ||
| 180 | + if (!phoneRegular.test(this.bindPhoneForm.appUserKey)) return useShowToast(this.$t('login.phoneFormatFail')) | ||
| 181 | await api.loginApi.postCodeApi(this.bindPhoneForm.appUserKey) | 181 | await api.loginApi.postCodeApi(this.bindPhoneForm.appUserKey) |
| 182 | this.verifyCodeCountDown(); //开始倒计时 | 182 | this.verifyCodeCountDown(); //开始倒计时 |
| 183 | }, | 183 | }, |
| @@ -2,9 +2,9 @@ | @@ -2,9 +2,9 @@ | ||
| 2 | <view> | 2 | <view> |
| 3 | <u-popup bgColor="transparent" :overlay="true" :show="show" mode="bottom"> | 3 | <u-popup bgColor="transparent" :overlay="true" :show="show" mode="bottom"> |
| 4 | <view class="u-flex logout-main"> | 4 | <view class="u-flex logout-main"> |
| 5 | - <view class="main"><text style="color: #999999">您确定要退出当前账号吗?</text></view> | ||
| 6 | - <view @click="$emit('logoutBtn')" class="main"><text style="color: #f95e5a">退出登录</text></view> | ||
| 7 | - <view class="cancel-text"><text @click="$emit('closeLogoutPopup')" style="color: #3478f7">取消</text> | 5 | + <view class="main"><text style="color: #999999">{{ $t('login.isLoginPut') }}</text></view> |
| 6 | + <view @click="$emit('logoutBtn')" class="main"><text style="color: #f95e5a">{{ $t('login.loginOut') }}</text></view> | ||
| 7 | + <view class="cancel-text"><text @click="$emit('closeLogoutPopup')" style="color: #3478f7">{{ $t('common.cancelText') }}</text> | ||
| 8 | </view> | 8 | </view> |
| 9 | </view> | 9 | </view> |
| 10 | </u-popup> | 10 | </u-popup> |
| @@ -24,4 +24,4 @@ | @@ -24,4 +24,4 @@ | ||
| 24 | 24 | ||
| 25 | <style lang="scss" scoped> | 25 | <style lang="scss" scoped> |
| 26 | @import '../static/personal.scss'; | 26 | @import '../static/personal.scss'; |
| 27 | -</style> | ||
| 27 | +</style> |
pages/personal/components/switchLocales.vue
0 → 100644
| 1 | +<template> | ||
| 2 | + <view style="padding:24rpx;background: #f8f9fa;height: 100vh;"> | ||
| 3 | + <view class="center"> | ||
| 4 | + <view v-for="(item, index) in languageData" :key="item.value" class="flex justify-between" | ||
| 5 | + :class="index == 0 ? 'v-label' : ''" @click="handleChange(item.value)"> | ||
| 6 | + <view>{{ item.label }}</view> | ||
| 7 | + <image v-if="language === item.value" class="image" src="/static/languageSelect.png"></image> | ||
| 8 | + </view> | ||
| 9 | + | ||
| 10 | + </view> | ||
| 11 | + </view> | ||
| 12 | +</template> | ||
| 13 | + | ||
| 14 | +<script> | ||
| 15 | +export default { | ||
| 16 | + onLoad() { | ||
| 17 | + this.getLocale() | ||
| 18 | + }, | ||
| 19 | + data() { | ||
| 20 | + return { | ||
| 21 | + language: 'zh-CN', | ||
| 22 | + languageData: [ | ||
| 23 | + { label: '中文简体', value: 'zh-CN' }, | ||
| 24 | + { label: 'English', value: 'en' } | ||
| 25 | + ] | ||
| 26 | + } | ||
| 27 | + }, | ||
| 28 | + onShow() { | ||
| 29 | + this.$nextTick(() => { | ||
| 30 | + uni.setNavigationBarTitle({ | ||
| 31 | + title: this.$t('menu.languageSettings') | ||
| 32 | + }) | ||
| 33 | + }) | ||
| 34 | + }, | ||
| 35 | + methods: { | ||
| 36 | + getLocale() { | ||
| 37 | + const locale = uni.getLocale() | ||
| 38 | + if (locale) { | ||
| 39 | + this.language = locale.includes('zh')?'zh-CN' : locale | ||
| 40 | + } | ||
| 41 | + }, | ||
| 42 | + | ||
| 43 | + handleChange(name) { | ||
| 44 | + //App会重启应用 | ||
| 45 | + // #ifdef APP-PLUS || APP | ||
| 46 | + uni.showModal({ | ||
| 47 | + title:this.$t('userCenter.switchRestLanguage'), | ||
| 48 | + success:(res)=>{ | ||
| 49 | + if(res.confirm){ | ||
| 50 | + this.$i18n.locale = name | ||
| 51 | + this.language = name | ||
| 52 | + uni.setNavigationBarTitle({ | ||
| 53 | + title: this.$t('menu.languageSettings') | ||
| 54 | + }) | ||
| 55 | + // setLocale设置的语言需要对照到uniapp上的默认配置语言来设置 | ||
| 56 | + uni.setLocale(name.includes('zh')?'zh-Hans':'en') | ||
| 57 | + } | ||
| 58 | + } | ||
| 59 | + }) | ||
| 60 | + // #endif | ||
| 61 | + // #ifdef MP-WEIXIN | ||
| 62 | + uni.showLoading({ | ||
| 63 | + title:this.$t('userCenter.switchLanguages') | ||
| 64 | + }) | ||
| 65 | + const timeOut = setTimeout(()=>{ | ||
| 66 | + this.$i18n.locale = name | ||
| 67 | + this.language = name | ||
| 68 | + uni.setNavigationBarTitle({ | ||
| 69 | + title: this.$t('menu.languageSettings') | ||
| 70 | + }) | ||
| 71 | + uni.setLocale(name.includes('zh')?'zh-Hans':'en') | ||
| 72 | + uni.hideLoading() | ||
| 73 | + clearTimeout(timeOut) | ||
| 74 | + },500) | ||
| 75 | + // #endif | ||
| 76 | + | ||
| 77 | + } | ||
| 78 | + } | ||
| 79 | +} | ||
| 80 | +</script> | ||
| 81 | + | ||
| 82 | +<style scoped lang="scss"> | ||
| 83 | +.center { | ||
| 84 | + background: #fff; | ||
| 85 | + padding: 24rpx; | ||
| 86 | + border-radius: 24rpx; | ||
| 87 | + | ||
| 88 | +} | ||
| 89 | + | ||
| 90 | +.flex { | ||
| 91 | + display: flex; | ||
| 92 | +} | ||
| 93 | + | ||
| 94 | +.justify-between { | ||
| 95 | + justify-content: space-between; | ||
| 96 | +} | ||
| 97 | + | ||
| 98 | +.v-label { | ||
| 99 | + border-bottom: 1rpx solid #ecedee; | ||
| 100 | + padding-bottom: 6rpx; | ||
| 101 | + margin-bottom: 8rpx | ||
| 102 | +} | ||
| 103 | + | ||
| 104 | +.image { | ||
| 105 | + width: 44rpx; | ||
| 106 | + height: 44rpx; | ||
| 107 | + // margin-top: 20rpx; | ||
| 108 | + // border-radius: 32rpx; | ||
| 109 | +} | ||
| 110 | +</style> |
| 1 | const systemList = [{ | 1 | const systemList = [{ |
| 2 | - url: '/sysnotify-subpackage/sys-notify/system-notify', | ||
| 3 | - text: '系统通知', | ||
| 4 | - leftIcon: '/static/sys-not.png', | ||
| 5 | - rightIcon: '/static/arrow-right.png' | ||
| 6 | - }, | ||
| 7 | - { | ||
| 8 | - url: '/feedback-subpackage/feedback/feedback', | ||
| 9 | - text: '意见反馈', | ||
| 10 | - leftIcon: '/static/find-sugg.png', | ||
| 11 | - rightIcon: '/static/arrow-right.png' | ||
| 12 | - } | 2 | + url: '/sysnotify-subpackage/sys-notify/system-notify', |
| 3 | + text: 'userCenter.systemNotification', | ||
| 4 | + leftIcon: '/static/sys-not.png', | ||
| 5 | + rightIcon: '/static/arrow-right.png' | ||
| 6 | +}, | ||
| 7 | +{ | ||
| 8 | + url: '/feedback-subpackage/feedback/feedback', | ||
| 9 | + text: 'userCenter.feedback', | ||
| 10 | + leftIcon: '/static/find-sugg.png', | ||
| 11 | + rightIcon: '/static/arrow-right.png' | ||
| 12 | +}, | ||
| 13 | +{ | ||
| 14 | + url: '/pages/personal/components/switchLocales', | ||
| 15 | + text: 'userCenter.languageSettings', | ||
| 16 | + leftIcon: '/static/language.png', | ||
| 17 | + rightIcon: '/static/arrow-right.png' | ||
| 18 | +}, | ||
| 13 | ] | 19 | ] |
| 14 | export { | 20 | export { |
| 15 | systemList | 21 | systemList |
| 16 | -} | ||
| 22 | +} |
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | <text class="nick-name">{{ userInfo.realName || userInfo.nickName }}</text> | 14 | <text class="nick-name">{{ userInfo.realName || userInfo.nickName }}</text> |
| 15 | </view> | 15 | </view> |
| 16 | <view v-if="userInfo.isThirdLogin" @click.stop="openBindAccountModal" class="detail"><text | 16 | <view v-if="userInfo.isThirdLogin" @click.stop="openBindAccountModal" class="detail"><text |
| 17 | - class="text">绑定账号</text></view> | 17 | + class="text">{{ $t('login.bindAccount') }}</text></view> |
| 18 | </view> | 18 | </view> |
| 19 | <view class="phone-number" v-if="userInfo.phoneNumber"> | 19 | <view class="phone-number" v-if="userInfo.phoneNumber"> |
| 20 | {{ handlePhoneFunc(userInfo.phoneNumber || '') }} | 20 | {{ handlePhoneFunc(userInfo.phoneNumber || '') }} |
| @@ -28,7 +28,7 @@ | @@ -28,7 +28,7 @@ | ||
| 28 | </view> | 28 | </view> |
| 29 | </view> | 29 | </view> |
| 30 | <view class="u-flex-1"> | 30 | <view class="u-flex-1"> |
| 31 | - <view @click="navigatorLogin" class="u-font-lg click-login login-btn">请点击登录</view> | 31 | + <view @click="navigatorLogin" class="u-font-lg click-login login-btn">{{ $t('login.pleaseClickLogin') }}</view> |
| 32 | </view> | 32 | </view> |
| 33 | </block> | 33 | </block> |
| 34 | <view v-if="userInfo.isToken" @click="navigatorPersonal"> | 34 | <view v-if="userInfo.isToken" @click="navigatorPersonal"> |
| @@ -42,14 +42,14 @@ | @@ -42,14 +42,14 @@ | ||
| 42 | <view class="nav-image"> | 42 | <view class="nav-image"> |
| 43 | <image class="image" :src="item.leftIcon"></image> | 43 | <image class="image" :src="item.leftIcon"></image> |
| 44 | </view> | 44 | </view> |
| 45 | - <view class="nav-center"><text class="text">{{item.text}}</text></view> | 45 | + <view class="nav-center"><text class="text">{{$t(item.text)}}</text></view> |
| 46 | <view class="nav-right"> | 46 | <view class="nav-right"> |
| 47 | <image class="image" :src="item.rightIcon"></image> | 47 | <image class="image" :src="item.rightIcon"></image> |
| 48 | </view> | 48 | </view> |
| 49 | </view> | 49 | </view> |
| 50 | </view> | 50 | </view> |
| 51 | <view @click="openLogoutPopup" class="u-flex logout-text"> | 51 | <view @click="openLogoutPopup" class="u-flex logout-text"> |
| 52 | - <button class="submit" size="default" @click="openLogoutPopup"><text class="text">退出账号</text></button> | 52 | + <button class="submit" size="default" @click="openLogoutPopup"><text class="text">{{ $t('login.accountOut') }}</text></button> |
| 53 | </view> | 53 | </view> |
| 54 | </view> | 54 | </view> |
| 55 | <!-- 绑定账号 --> | 55 | <!-- 绑定账号 --> |
| @@ -86,6 +86,13 @@ | @@ -86,6 +86,13 @@ | ||
| 86 | // 隐藏原生的tabbar | 86 | // 隐藏原生的tabbar |
| 87 | uni.hideTabBar(); | 87 | uni.hideTabBar(); |
| 88 | }, | 88 | }, |
| 89 | + onShow(){ | ||
| 90 | + this.$nextTick(()=>{ | ||
| 91 | + uni.setNavigationBarTitle({ | ||
| 92 | + title:this.$t('menu.userCenter') | ||
| 93 | + }) | ||
| 94 | + }) | ||
| 95 | + }, | ||
| 89 | computed: { | 96 | computed: { |
| 90 | ...mapState(['userInfo', 'plateInfo']), | 97 | ...mapState(['userInfo', 'plateInfo']), |
| 91 | setHeadImage() { | 98 | setHeadImage() { |
| @@ -133,7 +140,7 @@ | @@ -133,7 +140,7 @@ | ||
| 133 | }, | 140 | }, |
| 134 | logoutBtn() { | 141 | logoutBtn() { |
| 135 | const that = this | 142 | const that = this |
| 136 | - useShowModal('您确定要退出登录吗?', '退出登录', '确定').then(res => { | 143 | + useShowModal(this.$t('login.isLoginPut'), this.$t('login.loginOut'), this.$t('common.confirm'),this.$t('common.cancelText')).then(res => { |
| 137 | if (res.confirm) { | 144 | if (res.confirm) { |
| 138 | that.emptyUserInfo(); | 145 | that.emptyUserInfo(); |
| 139 | that.showLogout = false; | 146 | that.showLogout = false; |
| @@ -151,4 +158,4 @@ | @@ -151,4 +158,4 @@ | ||
| 151 | 158 | ||
| 152 | <style lang="scss" scoped> | 159 | <style lang="scss" scoped> |
| 153 | @import './static/personal.scss'; | 160 | @import './static/personal.scss'; |
| 154 | -</style> | ||
| 161 | +</style> |
| @@ -102,7 +102,7 @@ | @@ -102,7 +102,7 @@ | ||
| 102 | display: flex; | 102 | display: flex; |
| 103 | flex-direction: column; | 103 | flex-direction: column; |
| 104 | justify-content: space-between; | 104 | justify-content: space-between; |
| 105 | - height: 147rpx; | 105 | + height: 220rpx; |
| 106 | } | 106 | } |
| 107 | .logout-text{ | 107 | .logout-text{ |
| 108 | justify-content: center; | 108 | justify-content: center; |
| @@ -3,25 +3,25 @@ import moment from "moment"; | @@ -3,25 +3,25 @@ import moment from "moment"; | ||
| 3 | const DATE_TIME_FORMAT = "YYYY-MM-DD HH:mm:ss"; | 3 | const DATE_TIME_FORMAT = "YYYY-MM-DD HH:mm:ss"; |
| 4 | 4 | ||
| 5 | /** | 5 | /** |
| 6 | - 登录密码正则验证 | ||
| 7 | - 最短8位,最长16位 | ||
| 8 | - 必须包含1个数字 | ||
| 9 | - 必须包含1个小写字母 | ||
| 10 | - 必须包含1个大写字母 | ||
| 11 | - 必须包含1个特殊字符 | 6 | + 登录密码正则验证 |
| 7 | + 最短8位,最长16位 | ||
| 8 | + 必须包含1个数字 | ||
| 9 | + 必须包含1个小写字母 | ||
| 10 | + 必须包含1个大写字母 | ||
| 11 | + 必须包含1个特殊字符 | ||
| 12 | */ | 12 | */ |
| 13 | export const loginPasswordReg = | 13 | export const loginPasswordReg = |
| 14 | /^.*(?=.{6,16})(?=.*\d)(?=.*[A-Z]{1,})(?=.*[a-z]{1,})(?=.*[_!@#$%^&*?\(\)]).*$/; | 14 | /^.*(?=.{6,16})(?=.*\d)(?=.*[A-Z]{1,})(?=.*[a-z]{1,})(?=.*[_!@#$%^&*?\(\)]).*$/; |
| 15 | 15 | ||
| 16 | //手机号中间4位为* | 16 | //手机号中间4位为* |
| 17 | -Vue.filter("phone", function(val) { | 17 | +Vue.filter("phone", function (val) { |
| 18 | var tel = val; | 18 | var tel = val; |
| 19 | tel = "" + tel; | 19 | tel = "" + tel; |
| 20 | var telShort = tel.replace(tel.substring(3, 7), "****"); | 20 | var telShort = tel.replace(tel.substring(3, 7), "****"); |
| 21 | return telShort; | 21 | return telShort; |
| 22 | }); | 22 | }); |
| 23 | //获取系统信息、判断ipX安全距离 | 23 | //获取系统信息、判断ipX安全距离 |
| 24 | -export const getTabbarHeight = function() { | 24 | +export const getTabbarHeight = function () { |
| 25 | var systemInfo = uni.getSystemInfoSync(); | 25 | var systemInfo = uni.getSystemInfoSync(); |
| 26 | var data = { | 26 | var data = { |
| 27 | ...systemInfo, | 27 | ...systemInfo, |
| @@ -58,7 +58,7 @@ export const getTabbarHeight = function() { | @@ -58,7 +58,7 @@ export const getTabbarHeight = function() { | ||
| 58 | }; | 58 | }; |
| 59 | 59 | ||
| 60 | // px转upx | 60 | // px转upx |
| 61 | -export const px2upx = function(n) { | 61 | +export const px2upx = function (n) { |
| 62 | return n / (uni.upx2px(n) / n); | 62 | return n / (uni.upx2px(n) / n); |
| 63 | }; | 63 | }; |
| 64 | 64 | ||
| @@ -101,7 +101,7 @@ function getMpLocation(successCallback, errCallback, isOpenSetting) { | @@ -101,7 +101,7 @@ function getMpLocation(successCallback, errCallback, isOpenSetting) { | ||
| 101 | } | 101 | } |
| 102 | // 获取地址信息 | 102 | // 获取地址信息 |
| 103 | let locationAuthorize = true; | 103 | let locationAuthorize = true; |
| 104 | -export const getAppLatLon = function( | 104 | +export const getAppLatLon = function ( |
| 105 | successCallback, | 105 | successCallback, |
| 106 | errCallback, | 106 | errCallback, |
| 107 | isOpenSetting | 107 | isOpenSetting |
| @@ -192,12 +192,13 @@ export const useShowToast = (title, duration = 500, mask = false) => { | @@ -192,12 +192,13 @@ export const useShowToast = (title, duration = 500, mask = false) => { | ||
| 192 | }; | 192 | }; |
| 193 | 193 | ||
| 194 | //封装uniapp showModal | 194 | //封装uniapp showModal |
| 195 | -export const useShowModal = (content, title = "提示", confirmText = "确定") => { | 195 | +export const useShowModal = (content, title = "提示", confirmText = "确定", cancelText = "取消") => { |
| 196 | return new Promise((resolve, reject) => { | 196 | return new Promise((resolve, reject) => { |
| 197 | uni.showModal({ | 197 | uni.showModal({ |
| 198 | title, | 198 | title, |
| 199 | content: content, | 199 | content: content, |
| 200 | confirmText, | 200 | confirmText, |
| 201 | + cancelText, | ||
| 201 | success: (res) => { | 202 | success: (res) => { |
| 202 | resolve(res); | 203 | resolve(res); |
| 203 | }, | 204 | }, |
| @@ -216,7 +217,7 @@ export const useUploadFile = ( | @@ -216,7 +217,7 @@ export const useUploadFile = ( | ||
| 216 | formData, | 217 | formData, |
| 217 | header | 218 | header |
| 218 | ) => { | 219 | ) => { |
| 219 | - return new Promise(function(resolve, reject) { | 220 | + return new Promise(function (resolve, reject) { |
| 220 | uni.uploadFile({ | 221 | uni.uploadFile({ |
| 221 | url, //请求接口地址 | 222 | url, //请求接口地址 |
| 222 | filePath, //文件地址 | 223 | filePath, //文件地址 |
| @@ -240,7 +241,7 @@ export const useChooseImage = (data) => { | @@ -240,7 +241,7 @@ export const useChooseImage = (data) => { | ||
| 240 | count: data.count || 1, //默认1 | 241 | count: data.count || 1, //默认1 |
| 241 | sizeType: data.sizeType || ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有 | 242 | sizeType: data.sizeType || ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有 |
| 242 | sourceType: data.sourceType || ["album", "camera"], //从相册选择 | 243 | sourceType: data.sourceType || ["album", "camera"], //从相册选择 |
| 243 | - success: function(res) { | 244 | + success: function (res) { |
| 244 | resolve(res.tempFiles); | 245 | resolve(res.tempFiles); |
| 245 | }, | 246 | }, |
| 246 | fail: (err) => { | 247 | fail: (err) => { |
| @@ -281,4 +282,4 @@ export const useNavigateBack = (delta) => { | @@ -281,4 +282,4 @@ export const useNavigateBack = (delta) => { | ||
| 281 | uni.navigateBack({ | 282 | uni.navigateBack({ |
| 282 | delta | 283 | delta |
| 283 | }); | 284 | }); |
| 284 | -}; | ||
| 285 | +}; |
static/language.png
0 → 100644
3.79 KB
static/languageSelect.png
0 → 100644
2.08 KB
| 1 | const actions = [{ | 1 | const actions = [{ |
| 2 | - name: '全部', | ||
| 3 | - value: '' | ||
| 4 | - }, | ||
| 5 | - { | ||
| 6 | - name: '会议', | ||
| 7 | - value: 'MEETING' | ||
| 8 | - }, | ||
| 9 | - { | ||
| 10 | - name: '公告', | ||
| 11 | - value: 'NOTICE' | ||
| 12 | - }, | ||
| 13 | - { | ||
| 14 | - name: '其他', | ||
| 15 | - value: 'OTHER' | ||
| 16 | - } | 2 | + name: 'common.allText', |
| 3 | + value: '' | ||
| 4 | +}, | ||
| 5 | +{ | ||
| 6 | + name: 'userCenter.meeting', | ||
| 7 | + value: 'MEETING' | ||
| 8 | +}, | ||
| 9 | +{ | ||
| 10 | + name: 'userCenter.notice', | ||
| 11 | + value: 'NOTICE' | ||
| 12 | +}, | ||
| 13 | +{ | ||
| 14 | + name: 'userCenter.other', | ||
| 15 | + value: 'OTHER' | ||
| 16 | +} | ||
| 17 | ] | 17 | ] |
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | export { | 20 | export { |
| 21 | actions | 21 | actions |
| 22 | -} | ||
| 22 | +} |
| @@ -36,6 +36,13 @@ export default { | @@ -36,6 +36,13 @@ export default { | ||
| 36 | notifyList: {} | 36 | notifyList: {} |
| 37 | }; | 37 | }; |
| 38 | }, | 38 | }, |
| 39 | + onShow(){ | ||
| 40 | + this.$nextTick(()=>{ | ||
| 41 | + uni.setNavigationBarTitle({ | ||
| 42 | + title:this.$t('menu.notDetails') | ||
| 43 | + }) | ||
| 44 | + }) | ||
| 45 | + }, | ||
| 39 | onLoad(e) { | 46 | onLoad(e) { |
| 40 | // 隐藏原生的tabbar | 47 | // 隐藏原生的tabbar |
| 41 | uni.hideTabBar(); | 48 | uni.hideTabBar(); |
| @@ -5,8 +5,8 @@ | @@ -5,8 +5,8 @@ | ||
| 5 | <view class="notify-page-top-select"> | 5 | <view class="notify-page-top-select"> |
| 6 | <view @click="handleTypeClick" class="top-select"> | 6 | <view @click="handleTypeClick" class="top-select"> |
| 7 | <u--input suffixIcon="arrow-down" shape="circle" disabled v-model="notifyType" | 7 | <u--input suffixIcon="arrow-down" shape="circle" disabled v-model="notifyType" |
| 8 | - placeholder="请选择类型" border="surround"></u--input> | ||
| 9 | - <u-action-sheet safe-area-inset-bottom :show="showType" :actions="actions" title="请选择类型" @close="showType = false" | 8 | + :placeholder="$t('userCenter.pleaseSelectType')" border="surround"></u--input> |
| 9 | + <u-action-sheet safe-area-inset-bottom :show="showType" :actions="actions.map(item=>({...item,name:$t(item.name)}))" :title="$t('userCenter.pleaseSelectType')" @close="showType = false" | ||
| 10 | @select="handleTypeSelect"></u-action-sheet> | 10 | @select="handleTypeSelect"></u-action-sheet> |
| 11 | </view> | 11 | </view> |
| 12 | </view> | 12 | </view> |
| @@ -65,6 +65,13 @@ | @@ -65,6 +65,13 @@ | ||
| 65 | distance: 0, | 65 | distance: 0, |
| 66 | }; | 66 | }; |
| 67 | }, | 67 | }, |
| 68 | + onShow(){ | ||
| 69 | + this.$nextTick(()=>{ | ||
| 70 | + uni.setNavigationBarTitle({ | ||
| 71 | + title:this.$t('menu.systemNot') | ||
| 72 | + }) | ||
| 73 | + }) | ||
| 74 | + }, | ||
| 68 | onLoad(e) { | 75 | onLoad(e) { |
| 69 | // 隐藏原生的tabbar | 76 | // 隐藏原生的tabbar |
| 70 | uni.hideTabBar(); | 77 | uni.hideTabBar(); |
| @@ -73,7 +80,7 @@ | @@ -73,7 +80,7 @@ | ||
| 73 | formatType(e) { | 80 | formatType(e) { |
| 74 | const findName = this.actions.find((item)=>item.value===e && item.value!=='') | 81 | const findName = this.actions.find((item)=>item.value===e && item.value!=='') |
| 75 | if(!findName) return | 82 | if(!findName) return |
| 76 | - return findName.name | 83 | + return this.$t(findName.name) |
| 77 | }, | 84 | }, |
| 78 | handleTypeClick() { | 85 | handleTypeClick() { |
| 79 | this.showType = true; | 86 | this.showType = true; |
| @@ -3,8 +3,8 @@ | @@ -3,8 +3,8 @@ | ||
| 3 | <scroll-view ref="sea" scroll-x style="width: 100%;white-space: nowrap;"> | 3 | <scroll-view ref="sea" scroll-x style="width: 100%;white-space: nowrap;"> |
| 4 | <!-- 全部 --> | 4 | <!-- 全部 --> |
| 5 | <view class="inline-item" @click="clickItem(null,-1)"> | 5 | <view class="inline-item" @click="clickItem(null,-1)"> |
| 6 | - <text v-if="!isre && treeStack.length == 0" class="none">全部</text> | ||
| 7 | - <text v-else class="active">全部</text> | 6 | + <text v-if="!isre && treeStack.length == 0" class="none">{{ $t('common.allText') }}</text> |
| 7 | + <text v-else class="active">{{ $t('common.allText') }}</text> | ||
| 8 | </view> | 8 | </view> |
| 9 | <!-- 全部 --> | 9 | <!-- 全部 --> |
| 10 | <!-- 搜索结果 --> | 10 | <!-- 搜索结果 --> |
| @@ -53,7 +53,7 @@ | @@ -53,7 +53,7 @@ | ||
| 53 | align-items: center; | 53 | align-items: center; |
| 54 | justify-content: center;" | 54 | justify-content: center;" |
| 55 | > | 55 | > |
| 56 | - <button class="sureBtn" type="primary" @click="backConfirm">确认</button> | 56 | + <button class="sureBtn" type="primary" @click="backConfirm">{{ $t('common.confirm') }}</button> |
| 57 | </view> | 57 | </view> |
| 58 | </view> | 58 | </view> |
| 59 | </template> | 59 | </template> |
| @@ -366,6 +366,25 @@ | @@ -366,6 +366,25 @@ | ||
| 366 | if (vm.up && vm.up.toTop && vm.up.toTop.safearea != null) {} else { | 366 | if (vm.up && vm.up.toTop && vm.up.toTop.safearea != null) {} else { |
| 367 | vm.mescroll.optUp.toTop.safearea = vm.safearea; | 367 | vm.mescroll.optUp.toTop.safearea = vm.safearea; |
| 368 | } | 368 | } |
| 369 | + | ||
| 370 | + uni.onLocaleChange((res) => { | ||
| 371 | + let i18nType = mescrollI18n.getType() | ||
| 372 | + let i18nOption = { type: i18nType } | ||
| 373 | + if (res && vm.mescroll.i18n.type != mescrollI18n.getType()) { | ||
| 374 | + vm.mescroll.i18n.type = mescrollI18n.getType() | ||
| 375 | + mescrollI18n.setType(i18nType) | ||
| 376 | + MeScroll.extend(i18nOption, vm.mescroll.i18n[i18nType]) | ||
| 377 | + if (i18nOption.down) { | ||
| 378 | + let down = MeScroll.extend({}, i18nOption.down) | ||
| 379 | + vm.mescroll.optDown = MeScroll.extend(down, vm.mescroll.optDown) | ||
| 380 | + } | ||
| 381 | + if (i18nOption.up) { | ||
| 382 | + let up = MeScroll.extend({}, i18nOption.up) | ||
| 383 | + vm.mescroll.optUp = MeScroll.extend(up, vm.mescroll.optUp) | ||
| 384 | + } | ||
| 385 | + } | ||
| 386 | + | ||
| 387 | + }) | ||
| 369 | 388 | ||
| 370 | // 全局配置监听 | 389 | // 全局配置监听 |
| 371 | uni.$on("setMescrollGlobalOption", options=>{ | 390 | uni.$on("setMescrollGlobalOption", options=>{ |
| @@ -397,4 +416,4 @@ | @@ -397,4 +416,4 @@ | ||
| 397 | @import "../mescroll-body/mescroll-body.css"; | 416 | @import "../mescroll-body/mescroll-body.css"; |
| 398 | @import "../mescroll-uni/components/mescroll-down.css"; | 417 | @import "../mescroll-uni/components/mescroll-down.css"; |
| 399 | @import "../mescroll-uni/components/mescroll-up.css"; | 418 | @import "../mescroll-uni/components/mescroll-up.css"; |
| 400 | -</style> | ||
| 419 | +</style> |
| @@ -3,11 +3,11 @@ const mescrollI18n = { | @@ -3,11 +3,11 @@ const mescrollI18n = { | ||
| 3 | // 默认语言 | 3 | // 默认语言 |
| 4 | def: "zh", | 4 | def: "zh", |
| 5 | // 获取当前语言类型 | 5 | // 获取当前语言类型 |
| 6 | - getType(){ | ||
| 7 | - return uni.getStorageSync("mescroll-i18n") || this.def | 6 | + getType() { |
| 7 | + return uni.getLocale().includes('zh') ? 'zh' : 'en' | ||
| 8 | }, | 8 | }, |
| 9 | // 设置当前语言类型 | 9 | // 设置当前语言类型 |
| 10 | - setType(type){ | 10 | + setType(type) { |
| 11 | uni.setStorageSync("mescroll-i18n", type) | 11 | uni.setStorageSync("mescroll-i18n", type) |
| 12 | } | 12 | } |
| 13 | } | 13 | } |
| @@ -283,7 +283,6 @@ | @@ -283,7 +283,6 @@ | ||
| 283 | watch: { | 283 | watch: { |
| 284 | value(val) { | 284 | value(val) { |
| 285 | if (val) { | 285 | if (val) { |
| 286 | - // console.log(this.visibleSync); | ||
| 287 | if (this.visibleSync) { | 286 | if (this.visibleSync) { |
| 288 | this.visibleSync = false | 287 | this.visibleSync = false |
| 289 | return | 288 | return |
| @@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
| 10 | </view> | 10 | </view> |
| 11 | <picker mode="date" :value="date" fields="month" @change="bindDateChange"> | 11 | <picker mode="date" :value="date" fields="month" @change="bindDateChange"> |
| 12 | <text | 12 | <text |
| 13 | - class="uni-calendar__header-text">{{ (nowDate.year||'') + ' 年 ' + ( nowDate.month||'') +' 月'}}</text> | 13 | + class="uni-calendar__header-text">{{ (nowDate.year||'') + yearText + ( nowDate.month||'') + monthText}}</text> |
| 14 | </picker> | 14 | </picker> |
| 15 | <view v-if="right" class="uni-calendar__header-btn-box" @click.stop="next"> | 15 | <view v-if="right" class="uni-calendar__header-btn-box" @click.stop="next"> |
| 16 | <view class="uni-calendar__header-btn uni-calendar--right"></view> | 16 | <view class="uni-calendar__header-btn uni-calendar--right"></view> |
| @@ -86,7 +86,7 @@ | @@ -86,7 +86,7 @@ | ||
| 86 | <!-- <view class="uni-calendar__header-btn-box"> | 86 | <!-- <view class="uni-calendar__header-btn-box"> |
| 87 | <text class="uni-calendar__button-text uni-calendar--fixed-width">{{okText}}</text> | 87 | <text class="uni-calendar__button-text uni-calendar--fixed-width">{{okText}}</text> |
| 88 | </view> --> | 88 | </view> --> |
| 89 | - <view class="uni-datetime-picker--btn" @click="confirm">确认</view> | 89 | + <view class="uni-datetime-picker--btn" @click="confirm">{{$t('common.confirm')}}</view> |
| 90 | </view> | 90 | </view> |
| 91 | </view> | 91 | </view> |
| 92 | </view> | 92 | </view> |
| @@ -320,6 +320,13 @@ | @@ -320,6 +320,13 @@ | ||
| 320 | /** | 320 | /** |
| 321 | * for i18n | 321 | * for i18n |
| 322 | */ | 322 | */ |
| 323 | + yearText(){ | ||
| 324 | + return t('uni-calender.YEAR') | ||
| 325 | + }, | ||
| 326 | + monthText(){ | ||
| 327 | + return t('uni-calender.MONTH') | ||
| 328 | + }, | ||
| 329 | + | ||
| 323 | selectDateText() { | 330 | selectDateText() { |
| 324 | return t("uni-datetime-picker.selectDate") | 331 | return t("uni-datetime-picker.selectDate") |
| 325 | }, | 332 | }, |
| @@ -332,6 +339,9 @@ | @@ -332,6 +339,9 @@ | ||
| 332 | okText() { | 339 | okText() { |
| 333 | return t("uni-datetime-picker.ok") | 340 | return t("uni-datetime-picker.ok") |
| 334 | }, | 341 | }, |
| 342 | + cancelText() { | ||
| 343 | + return t("uni-datetime-picker.cancel") | ||
| 344 | + }, | ||
| 335 | monText() { | 345 | monText() { |
| 336 | return t("uni-calender.MON") | 346 | return t("uni-calender.MON") |
| 337 | }, | 347 | }, |
| @@ -887,7 +897,7 @@ | @@ -887,7 +897,7 @@ | ||
| 887 | background-color: #007aff; | 897 | background-color: #007aff; |
| 888 | color: #fff; | 898 | color: #fff; |
| 889 | font-size: 16px; | 899 | font-size: 16px; |
| 890 | - letter-spacing: 5px; | 900 | + // letter-spacing: 5px; |
| 891 | } | 901 | } |
| 892 | 902 | ||
| 893 | /* #ifndef APP-NVUE */ | 903 | /* #ifndef APP-NVUE */ |
| @@ -15,5 +15,7 @@ | @@ -15,5 +15,7 @@ | ||
| 15 | "uni-calender.THU": "THU", | 15 | "uni-calender.THU": "THU", |
| 16 | "uni-calender.FRI": "FRI", | 16 | "uni-calender.FRI": "FRI", |
| 17 | "uni-calender.SAT": "SAT", | 17 | "uni-calender.SAT": "SAT", |
| 18 | - "uni-calender.SUN": "SUN" | 18 | + "uni-calender.SUN": "SUN", |
| 19 | + "uni-calender.YEAR":"Year", | ||
| 20 | + "uni-calender.MONTH":"Month" | ||
| 19 | } | 21 | } |
| @@ -15,5 +15,7 @@ | @@ -15,5 +15,7 @@ | ||
| 15 | "uni-calender.WED": "三", | 15 | "uni-calender.WED": "三", |
| 16 | "uni-calender.THU": "四", | 16 | "uni-calender.THU": "四", |
| 17 | "uni-calender.FRI": "五", | 17 | "uni-calender.FRI": "五", |
| 18 | - "uni-calender.SAT": "六" | 18 | + "uni-calender.SAT": "六", |
| 19 | + "uni-calender.YEAR":"年", | ||
| 20 | + "uni-calender.MONTH":"月" | ||
| 19 | } | 21 | } |
| @@ -15,5 +15,7 @@ | @@ -15,5 +15,7 @@ | ||
| 15 | "uni-calender.WED": "三", | 15 | "uni-calender.WED": "三", |
| 16 | "uni-calender.THU": "四", | 16 | "uni-calender.THU": "四", |
| 17 | "uni-calender.FRI": "五", | 17 | "uni-calender.FRI": "五", |
| 18 | - "uni-calender.SAT": "六" | 18 | + "uni-calender.SAT": "六", |
| 19 | + "uni-calender.YEAR":"年", | ||
| 20 | + "uni-calender.MONTH":"月" | ||
| 19 | } | 21 | } |
| @@ -9,13 +9,13 @@ | @@ -9,13 +9,13 @@ | ||
| 9 | v-if="showSubtitle" | 9 | v-if="showSubtitle" |
| 10 | >{{ subtitle }}</text> | 10 | >{{ subtitle }}</text> |
| 11 | <view class="u-calendar-header__weekdays"> | 11 | <view class="u-calendar-header__weekdays"> |
| 12 | - <text class="u-calendar-header__weekdays__weekday">一</text> | ||
| 13 | - <text class="u-calendar-header__weekdays__weekday">二</text> | ||
| 14 | - <text class="u-calendar-header__weekdays__weekday">三</text> | ||
| 15 | - <text class="u-calendar-header__weekdays__weekday">四</text> | ||
| 16 | - <text class="u-calendar-header__weekdays__weekday">五</text> | ||
| 17 | - <text class="u-calendar-header__weekdays__weekday">六</text> | ||
| 18 | - <text class="u-calendar-header__weekdays__weekday">日</text> | 12 | + <text class="u-calendar-header__weekdays__weekday">{{ $t('common.one') }}</text> |
| 13 | + <text class="u-calendar-header__weekdays__weekday">{{ $t('common.two') }}</text> | ||
| 14 | + <text class="u-calendar-header__weekdays__weekday">{{ $t('common.three') }}</text> | ||
| 15 | + <text class="u-calendar-header__weekdays__weekday">{{ $t('common.four') }}</text> | ||
| 16 | + <text class="u-calendar-header__weekdays__weekday">{{ $t('common.five') }}</text> | ||
| 17 | + <text class="u-calendar-header__weekdays__weekday">{{ $t('common.six') }}</text> | ||
| 18 | + <text class="u-calendar-header__weekdays__weekday">{{ $t('common.day') }}</text> | ||
| 19 | </view> | 19 | </view> |
| 20 | </view> | 20 | </view> |
| 21 | </template> | 21 | </template> |
| @@ -165,9 +165,9 @@ export default { | @@ -165,9 +165,9 @@ export default { | ||
| 165 | subtitle() { | 165 | subtitle() { |
| 166 | // 初始化时,this.months为空数组,所以需要特别判断处理 | 166 | // 初始化时,this.months为空数组,所以需要特别判断处理 |
| 167 | if (this.months.length) { | 167 | if (this.months.length) { |
| 168 | - return `${this.months[this.monthIndex].year}年${ | 168 | + return `${this.months[this.monthIndex].year}${this.$t('common.year')}${ |
| 169 | this.months[this.monthIndex].month | 169 | this.months[this.monthIndex].month |
| 170 | - }月` | 170 | + }${this.$t('common.month')}` |
| 171 | } else { | 171 | } else { |
| 172 | return '' | 172 | return '' |
| 173 | } | 173 | } |
| @@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
| 10 | export default { | 10 | export default { |
| 11 | // loading-page组件 | 11 | // loading-page组件 |
| 12 | loadingPage: { | 12 | loadingPage: { |
| 13 | - loadingText: '正在加载', | 13 | + loadingText: 'common.loading', |
| 14 | image: '', | 14 | image: '', |
| 15 | loadingMode: 'circle', | 15 | loadingMode: 'circle', |
| 16 | loading: false, | 16 | loading: false, |