|
|
|
@ -2,16 +2,7 @@ |
|
|
|
<div class="pda-container"> |
|
|
|
<!-- 状态栏 --> |
|
|
|
<div class="status-bar"> |
|
|
|
<el-dropdown> |
|
|
|
<span class="el-dropdown-link" style="color: #ffffff;font-size: 15px"> |
|
|
|
{{ $t('home.locale') }}<i class="el-icon-arrow-down el-icon--right"></i> |
|
|
|
</span> |
|
|
|
<el-dropdown-menu slot="default"> |
|
|
|
<el-dropdown-item style="font-size: 16px" index="2-1-1" :key="index" :value="item.languageCode" v-for="(item,index) in languageList " |
|
|
|
@click.native="switch_the_language(item.languageCode)">{{ item.languageName }} |
|
|
|
</el-dropdown-item> |
|
|
|
</el-dropdown-menu> |
|
|
|
</el-dropdown> |
|
|
|
<div style="font-size: 18px">{{username}}</div> |
|
|
|
<div class="logout-button" @click="logoutHandle()"> |
|
|
|
<i class="el-icon-close"></i> |
|
|
|
<span class="logout-text">{{ $t('home.logout') }}</span> |
|
|
|
@ -41,7 +32,7 @@ import {searchSysLanguage} from "@/api/sysLanguage.js" |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
languageList: [{languageName: '中文', languageCode: 'zh'}, {languageName: '英文', languageCode: 'en'}], |
|
|
|
username: localStorage.getItem('userName'), |
|
|
|
currentTime: new Date().toTimeString().substr(0, 5), |
|
|
|
buttons: [ |
|
|
|
{ icon: 'shopping-cart-o', label: this.$t('home.stockIn'), iconClass: 'purchase', to: 'porecv' }, |
|
|
|
@ -59,7 +50,6 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getLanguageList(); |
|
|
|
let menuList = JSON.parse(sessionStorage.getItem('menuList') || '[]').filter(item => item.menuId != 999) |
|
|
|
/*for (let i = 0; i < menuList.length; i++) { |
|
|
|
this.buttons.push({ |
|
|
|
@ -80,17 +70,6 @@ export default { |
|
|
|
window.removeEventListener('resize', this.adjustLayout); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 获取多语言列表 |
|
|
|
getLanguageList() { |
|
|
|
searchSysLanguage({languageCode: this.$i18n.locale}).then(({data}) => { |
|
|
|
this.languageList = data.rows |
|
|
|
}) |
|
|
|
}, |
|
|
|
switch_the_language(val) { |
|
|
|
localStorage.setItem('locale', val) |
|
|
|
this.$i18n.locale = val; // 修改当前语言 |
|
|
|
location.reload() |
|
|
|
}, |
|
|
|
updateTime() { |
|
|
|
this.timeInterval = setInterval(() => { |
|
|
|
this.currentTime = new Date().toTimeString().substr(0, 5); |
|
|
|
@ -161,11 +140,11 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
.logout-button { |
|
|
|
background: linear-gradient(135deg, #ff4d4f, #ff7875); |
|
|
|
background: linear-gradient(135deg, #fd5659, #ff9c91); |
|
|
|
color: #fff; |
|
|
|
font-size: 15px; |
|
|
|
font-weight: bold; |
|
|
|
padding: 6px 16px; |
|
|
|
padding: 2px 16px; |
|
|
|
border-radius: 20px; |
|
|
|
cursor: pointer; |
|
|
|
box-shadow: 0 2px 6px rgba(255, 77, 79, 0.4); |
|
|
|
@ -173,7 +152,7 @@ export default { |
|
|
|
display: inline-flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
height: 44px; /* 保证可点击性 */ |
|
|
|
height: 34px; /* 保证可点击性 */ |
|
|
|
} |
|
|
|
|
|
|
|
.logout-button:hover { |
|
|
|
@ -183,7 +162,7 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
.logout-button i { |
|
|
|
font-size: 18px; |
|
|
|
font-size: 14px; |
|
|
|
margin-right: 8px; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
@ -197,10 +176,10 @@ export default { |
|
|
|
/* === 小屏优化 === */ |
|
|
|
@media screen and (max-width: 480px) { |
|
|
|
.logout-button { |
|
|
|
font-size: 13px; |
|
|
|
padding: 4px 12px; |
|
|
|
font-size: 14px; |
|
|
|
padding: 2px 12px; |
|
|
|
border-radius: 16px; |
|
|
|
height: 40px; |
|
|
|
height: 34px; |
|
|
|
} |
|
|
|
|
|
|
|
.logout-button i { |
|
|
|
|