国际化

This commit is contained in:
2025-08-27 11:16:49 +08:00
parent 6a1cac2d13
commit 497ba36cc1
25 changed files with 1487 additions and 724 deletions

View File

@@ -1,10 +1,10 @@
<template>
<div class="page_container">
<div class="page_container" :class="{'enClass': $i18n.locale === 'en-us'}">
<el-row type="flex" class="t_box" justify="space-between">
<el-col :span="20">
<div style="height: calc(100% - 1rem);overflow: hidden;">
<el-tabs v-model="activeName" @tab-click="tabClick" style="height: 100%;">
<el-tab-pane label="自定义" name="zdy">
<el-tab-pane :label="$t('Customize')" name="zdy">
<el-row type="flex" class="r_box">
<el-col class="point_item" v-for="(e, i) in dataList" :key="'zdy' + i">
<el-popover
@@ -13,18 +13,18 @@
trigger="manual"
:ref="`popover-${i}`">
<el-row type="flex" justify="space-between" align="middle" style="margin-bottom: .2rem">
<el-col style="width: calc(100% - .55rem)"><el-input placeholder="修改名称" v-model="stationName" @focus="show" data-layout="normal"></el-input></el-col>
<el-col style="width: calc(100% - .55rem)"><el-input :placeholder="$t('Modifyname')" v-model="stationName"></el-input></el-col>
<el-button type="success" icon="el-icon-check" size="mini" style="width: .5rem; height: .4rem" :disabled="disabled" @click="_updateStation(e, i)"></el-button>
</el-row>
<el-row type="flex" justify="space-between">
<el-button class="task_button" :class="{'task_checked': e.action_type === el.value}" v-for="el in radioOption" :key="el.value" @click="radioInput(e, i, el.value)">{{ el.label }}</el-button>
<el-button class="task_button" :class="{'task_checked': e.action_type === el.value}" v-for="el in radioOption" :key="el.value" @click="radioInput(e, i, el.value)">{{el[$langPre.computedProp('label')]}}</el-button>
</el-row>
<div slot="reference" class="zbox point_item_i" @click="openPopover(i)"><p>{{ e.station_name }}</p></div>
</el-popover>
</el-col>
</el-row>
</el-tab-pane>
<el-tab-pane label="任务链" name="rwl">
<el-tab-pane :label="$t('Taskchain')" name="rwl">
<el-row type="flex" class="r_box">
<el-col class="point_item" v-for="(e, i) in linkData" :key="'rwl' + i">
<div class="zbox point_item_i" @click="handleLinkCheck(e)"><p>{{ e.chain_name }}</p></div>
@@ -36,31 +36,32 @@
<el-row type="flex" class="result_w" justify="start" align="top">
<el-col class="pp_item" v-for="(e, i) in newData" :key="'new' + i">
<el-row type="flex" align="middle">
<i class="el-icon-caret-right icon-caret-right" :style="i === 0 ? 'display: none' : ''"></i>
<div class="point_item point_checked">
<el-row type="flex" align="middle" class="zbox">
<el-col :span="17">
<p style="padding-left: 0.02rem;">{{ e.station_name }}</p>
<p class="point_checked_p1">{{ e.station_name }}</p>
</el-col>
<el-col :span="7" style="border-left: 1px solid #fff;">
<p class="point_checked_p2">{{ radioOption | findByValue(e.action_type) }}</p>
</el-col>
<el-col :span="7" style="border-left: 1px solid #fff;"><p style="font-size: .18rem;font-weight: 700;text-align: center;padding-right: 0.02rem;">{{ radioOption | findByValue(e.action_type) }}</p></el-col>
</el-row>
</div>
<i class="el-icon-caret-right icon-caret-right" :style="i === newData.length - 1 ? 'visibility: hidden' : ''"></i>
</el-row>
</el-col>
</el-row>
</el-col>
<el-col :span="4" style="padding: 0 .1rem;">
<el-row type="flex" justify="center" style="flex-wrap: wrap;height: 100%;align-content: flex-end;">
<el-col v-if="activeName === 'rwl'" :span="24" class="button_box"><button class="button_control" :class="{'button_control_disabled': !chainId}" :disabled="disabled" @click="_deleteTaskChain"><p style="font-size: .28rem">删除任务链</p></button></el-col>
<el-col v-if="activeName === 'zdy'" :span="24" class="button_box"><button class="button_control" :class="{'button_control_disabled': !newData.length}" @click="newData = []"><p>清空</p></button></el-col>
<el-col :span="24" class="button_box"><button class="button_control" :disabled="disabled" @click="_cancelTask"><p>取消任务</p></button></el-col>
<el-col v-if="activeName === 'zdy'" :span="24" class="button_box"><button class="button_control" :class="{'button_control_disabled': !newData.length}" :disabled="disabled" @click="_saveTask"><p>保存任务</p></button></el-col>
<el-col :span="24" class="button_box"><button class="button_control" :class="{'button_control_disabled': !newData.length}" :disabled="disabled" @click="_sendTask"><p>发送任务</p></button></el-col>
<el-col v-if="activeName === 'rwl'" :span="24" class="button_box"><button class="button_control button_control_s" :class="{'button_control_disabled': !chainId}" :disabled="disabled" @click="_deleteTaskChain"><p>{{$t('Deletetaskchain')}}</p></button></el-col>
<el-col v-if="activeName === 'zdy'" :span="24" class="button_box"><button class="button_control" :class="{'button_control_disabled': !newData.length}" @click="newData = []"><p>{{$t('Empty')}}</p></button></el-col>
<el-col :span="24" class="button_box"><button class="button_control" :disabled="disabled" @click="_cancelTask"><p>{{$t('Canceltask')}}</p></button></el-col>
<el-col v-if="activeName === 'zdy'" :span="24" class="button_box"><button class="button_control" :class="{'button_control_disabled': !newData.length}" :disabled="disabled" @click="_saveTask"><p>{{$t('Savetask')}}</p></button></el-col>
<el-col :span="24" class="button_box"><button class="button_control" :class="{'button_control_disabled': !newData.length}" :disabled="disabled" @click="_sendTask"><p>{{$t('SendTask')}}</p></button></el-col>
</el-row>
</el-col>
</el-row>
<save-chain v-if="saveVisible" ref="saveChain" @dataFormSubmit="dataFormSubmit"/>
<!-- <vue-touch-keyboard id="keyboard" :options="options" v-if="visible" :layout="layout" :cancel="hide" :accept="accept" :input="input" :next="next" /> -->
</div>
</template>
@@ -77,20 +78,17 @@ export default {
return {
activeName: 'zdy',
stationName: '',
radioOption: [{label: '取货', text: '取', value: 'Ascend'}, {label: '放货', text: '放', value: 'Descend'}, {label: '移动', text: '移', value: 'Move'}, {label: '返回点', text: '返', value: 'Return'}],
radioOption: [
{zh_label: '取货', en_label: 'Pickup', zh_text: '取', en_text: 'Pick', value: 'Ascend'},
{zh_label: '放货', en_label: 'Drop', zh_text: '放', en_text: 'Drop', value: 'Descend'},
{zh_label: '移动', en_label: 'Move', zh_text: '移', en_text: 'Move', value: 'Move'},
{zh_label: '返回点', en_label: 'Return', zh_text: '返', en_text: 'Return', value: 'Return'}],
dataList: [],
newData: [],
linkData: [],
chainId: null,
disabled: false,
loading: null,
visible: false,
layout: 'normal',
input: null,
options: {
useKbEvents: false,
preventClickEvent: false
},
saveVisible: false
}
},
@@ -168,7 +166,6 @@ export default {
if (this.stationName === '') {
this.disabled = false
this.closePopover(i)
this.visible = false
return
}
try {
@@ -185,13 +182,11 @@ export default {
this.loading.close()
this.disabled = false
this.closePopover(i)
this.visible = false
} catch (e) {
this.$message.error(e)
this.loading.close()
this.disabled = false
this.closePopover(i)
this.visible = false
}
},
// 切换标签
@@ -208,17 +203,17 @@ export default {
radioInput (e, i, value) {
const lastItem = this.newData.length > 0 ? this.newData[this.newData.length - 1].station_code : null
if (lastItem === e.station_code) {
this.$message('相邻的两个站点不能相同')
this.$message(this.$t('Twostationsnotsame'))
this.closePopover(i)
return
}
if (this.newData.length > 4) {
this.$message('最多选取5个站点')
this.$message(this.$t('Select5stations'))
this.closePopover(i)
return
}
if (this.newData.length > 0 && this.newData[this.newData.length - 1].action_type === 'Return') {
this.$message('返回点已选取')
this.$message(this.$t('Returnpointselected'))
return
}
e.action_type = value
@@ -357,40 +352,6 @@ export default {
this.loading.close()
this.disabled = false
}
},
show (e) {
// 关闭中文keyboard
let arr = document.querySelectorAll('.hg-theme-default')
arr.forEach((ele) => {
ele.style.visibility = 'hidden'
})
this.input = e.target
this.layout = e.target.dataset.layout
if (!this.visible) {
this.visible = true
}
},
hide () {
this.visible = false
},
accept () {
this.hide()
},
next () {
let inputs = document.querySelectorAll('input')
let found = false;
[].forEach.call(inputs, (item, i) => {
if (!found && item === this.input && i < inputs.length - 1 && this.input.dataset.next === '1') {
found = true
this.$nextTick(() => {
inputs[i + 1].focus()
})
}
})
if (!found) {
this.input.blur()
this.hide()
}
}
}
}
@@ -409,7 +370,11 @@ export default {
flex-wrap wrap
align-content flex-start
.pp_item
width 33%
width calc((100% - .6rem) / 3 + .3rem)
&:first-child
width calc((100% - .6rem) / 3)
.point_checked
width 100%
.point_item
width 19.6%
height 0.6rem
@@ -423,28 +388,40 @@ export default {
color #B4C1D8
text-align center
-webkit-box-orient: vertical;
-webkit-line-clamp: 3; /* 定义显示的行数 */
-webkit-line-clamp: 2; /* 定义显示的行数 */
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
.point_item_i
display flex
align-items center
justify-content center
.point_checked
width calc(100% - .17rem)
height .4rem
height .43rem
margin-bottom: 0.04rem;
padding 0
background-image url(../../images/new/bg1.png)
background-image none
border: 1px solid #7595d3;
background-color: #162f74;
box-shadow 0px 0px 4px 1px rgba(142, 169, 232, 36%)
p
color #3CC1FF
font-size .2rem
line-height .18rem
.point_checked_p1
font-size .18rem
padding: 0 0.04rem;
.point_checked_p2
font-size: 0.18rem;
font-weight: 700;
text-align: center;
padding-right: 0.02rem;
.result_w
flex-wrap wrap
height 1rem
border 1px solid #1E9FE7
padding .1rem
padding 0.04rem 0.05rem
background-color rgba(10, 73, 164, 80%)
.icon-caret-right
width .3rem
font-size .2rem
@@ -496,4 +473,14 @@ export default {
height 100%
p
font-size .3rem
.button_control_s
p
font-size .27rem
.enClass
.button_control p
line-height .22rem
.button_control_s p
font-size 0.22rem
.point_checked .point_checked_p2
font-size .14rem
</style>