Skip to content

Commit

Permalink
Merge pull request SonicCloudOrg#263 from Joycezhouktz/AddLanguageEn
Browse files Browse the repository at this point in the history
feat: Add English for Step details
  • Loading branch information
ZhouYixun committed Aug 25, 2023
2 parents dbd9bdf + f9f5fc1 commit de0e96c
Show file tree
Hide file tree
Showing 8 changed files with 3,620 additions and 701 deletions.
39 changes: 21 additions & 18 deletions src/components/HubSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import ColorImg from '@/components/ColorImg.vue';
import axios from '../http/axios';
import RenderStatus from './RenderStatus.vue';
import RenderDeviceName from './RenderDeviceName.vue';
import { useI18n } from 'vue-i18n';
const { t: $t } = useI18n();
const props = defineProps({
agentId: Number,
Expand Down Expand Up @@ -130,7 +133,7 @@ onMounted(() => {
class="device-form"
style="margin: 0 0 15px 10px"
>
<el-form-item label="电量">
<el-form-item :label="$t('agent.hub.voltage')">
<div
:style="{
position: 'relative',
Expand Down Expand Up @@ -188,7 +191,7 @@ onMounted(() => {
}}
</div>
</el-form-item>
<el-form-item label="温度">
<el-form-item :label="$t('agent.hub.temperature')">
<div
:style="{
position: 'relative',
Expand Down Expand Up @@ -237,7 +240,7 @@ onMounted(() => {
}}
</div>
</el-form-item>
<el-form-item label="电压">
<el-form-item :label="$t('agent.hub.voltage')">
<div
:style="{
position: 'relative',
Expand Down Expand Up @@ -281,7 +284,7 @@ onMounted(() => {
<div style="text-align: center">
<el-popover :width="400" trigger="click">
<el-table border :data="devices">
<el-table-column header-align="center" label="设备信息">
<el-table-column header-align="center" :label="$t('agent.hub.info')">
<template #default="scope">
<RenderDeviceName :device="scope.row" />
</template>
Expand All @@ -293,47 +296,47 @@ onMounted(() => {
property="udId"
label="udId"
/>
<el-table-column align="center" width="100" label="操作">
<el-table-column align="center" width="100" :label="$t('agent.hub.action')">
<template #default="scope">
<el-button
type="primary"
size="mini"
:disabled="scope.row.id === device.id"
@click="updatePosition(scope.row.id, i + 1 + j * 5)"
>关联
>{{$t('agent.hub.relate')}}
</el-button>
</template>
</el-table-column>
</el-table>
<template #reference>
<el-button size="mini"> 切换 </el-button>
<el-button size="mini"> {{$t('agent.hub.switch')}} </el-button>
</template>
</el-popover>
<el-button
type="primary"
size="mini"
@click="hubControl(i + 1 + j * 5, 'up')"
>
通电
{{$t('agent.hub.poweron')}}
</el-button>
<el-button
type="danger"
size="mini"
@click="hubControl(i + 1 + j * 5, 'down')"
>
断电
{{$t('agent.hub.poweroff')}}
</el-button>
</div>
</el-card>
<el-card v-else>
<el-empty
:image-size="30"
:description="i + 1 + j * 5 + '号USB口未接入设备'"
:description="i + 1 + j * 5 + $t('agent.hub.status')"
/>
<div style="text-align: center">
<el-popover :width="400" trigger="click">
<el-table border :data="devices">
<el-table-column header-align="center" label="设备信息">
<el-table-column header-align="center" :label="$t('agent.hub.info')">
<template #default="scope">
<RenderDeviceName :device="scope.row" />
</template>
Expand All @@ -345,34 +348,34 @@ onMounted(() => {
property="udId"
label="udId"
/>
<el-table-column align="center" width="100" label="操作">
<el-table-column align="center" width="100" :label="$t('agent.hub.action')">
<template #default="scope">
<el-button
type="primary"
size="mini"
@click="updatePosition(scope.row.id, i + 1 + j * 5)"
>关联
>{{$t('agent.hub.relate')}}
</el-button>
</template>
</el-table-column>
</el-table>
<template #reference>
<el-button size="mini"> 关联 </el-button>
<el-button size="mini"> {{$t('agent.hub.relate')}} </el-button>
</template>
</el-popover>
<el-button
type="primary"
size="mini"
@click="hubControl(i + 1 + j * 5, 'up')"
>
通电
{{$t('agent.hub.poweron')}}
</el-button>
<el-button
type="danger"
size="mini"
@click="hubControl(i + 1 + j * 5, 'down')"
>
断电
{{$t('agent.hub.poweroff')}}
</el-button>
</div>
</el-card>
Expand All @@ -381,10 +384,10 @@ onMounted(() => {
</div>
<div style="text-align: center; margin-top: 20px">
<el-button type="primary" size="mini" @click="hubControl(11, 'up')">
全部通电
{{$t('agent.hub.allpoweron')}}
</el-button>
<el-button type="danger" size="mini" @click="hubControl(11, 'down')">
全部断电
{{$t('agent.hub.allpoweroff')}}
</el-button>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/RemotePageHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ const close = () => {
<div style="display: flex; align-items: center">
{{ $t('routes.remoteControl') + ' - ' }}
<span style="font-size: 12px; margin-left: 10px">
<div>已使用 {{ parseTimeout(ticker) }}</div>
<div>已闲置 {{ parseTimeout(idleCount) }}</div>
<div>{{ $t('common.inuse') }} {{ parseTimeout(ticker) }}</div>
<div>{{ $t('common.inidle') }} {{ parseTimeout(idleCount) }}</div>
</span>
<el-popover placement="bottom" width="270" trigger="hover">
<div>
Expand Down
Loading

0 comments on commit de0e96c

Please sign in to comment.