layout i18n

Former-commit-id: e761056ea154aedf2ae927936fff49ba5b9fcb66 [formerly e761056ea154aedf2ae927936fff49ba5b9fcb66 [formerly e761056ea154aedf2ae927936fff49ba5b9fcb66 [formerly e761056ea154aedf2ae927936fff49ba5b9fcb66 [formerly 3cc73e4d679f97554d2c1f8f253bc4d6447694c1 [formerly a05de779fd7fb56b722cdb448baee6b1d44208ed]]]]]
Former-commit-id: 02aa23fd3e50eb0780d75b3bc9c5209dbf1f0e67
Former-commit-id: b21e3fe71b527439904a1a574e3d3a3032bcef09
Former-commit-id: bba111d14373493a4ef35318bfb7f41c8c388914 [formerly c1dd1cdbe86b65faff26c35db32d1ee942a97054]
Former-commit-id: d2c677083ddb6e285ea033ce8e62432ca2a89907
Former-commit-id: 8fa9b2196bc47bf6bf97b1355630eb443c4d2564
Former-commit-id: ec58dc5a2aff6a11fa31144035ca0bd250acbe63
Former-commit-id: 27ef4661fcb60de5968ce0b75d7d006774f88f0c
Former-commit-id: 352e82ebff5f22931fae48cb2525ad9867a98fa6
This commit is contained in:
liyang
2019-05-24 10:09:05 +08:00
parent 4bc1bcc6a3
commit 6c6fe66350
18 changed files with 441 additions and 89 deletions

View File

@@ -3,7 +3,7 @@
<i v-if="menu.icon" :class="`fa fa-${menu.icon}`"></i>
<i v-if="menu.icon === undefined & !menu.iconSvg" class="fa fa-file-o"></i>
<d2-icon-svg v-if="menu.iconSvg" :name="menu.iconSvg"/>
<span slot="title">{{menu.title || '未命名菜单'}}</span>
<span slot="title">{{menu.title || $t('layout.header-aside.menu-item.label-default')}}</span>
</el-menu-item>
</template>

View File

@@ -1,7 +1,7 @@
<template>
<el-tooltip
effect="dark"
:content="active ? '退出全屏' : '全屏'"
:content="active ? $t('layout.header-aside.header-fullscreen.exit') : $t('layout.header-aside.header-fullscreen.active')"
placement="bottom">
<el-button class="d2-mr btn-text can-hover" type="text" @click="toggle">
<d2-icon v-if="active" name="compress"/>

View File

@@ -34,9 +34,9 @@ export default {
}),
tooltipContent () {
return this.logLength === 0
? '没有日志或异常'
: `${this.logLength} 条日志${this.logLengthError > 0
? ` | 包含 ${this.logLengthError} 个异常`
? this.$t('layout.header-aside.header-log.empty')
: `${this.$t('layout.header-aside.header-log.log-length', { length: this.logLength })}${this.logLengthError > 0
? ` | ${this.$t('layout.header-aside.header-log.error-length', { length: this.logLengthError })}`
: ''}`
}
},

View File

@@ -15,20 +15,18 @@
import { mapState, mapMutations, mapActions } from 'vuex'
export default {
name: 'd2-header-size',
data () {
return {
options: [
{ label: '默认', value: 'default' },
{ label: '中', value: 'medium' },
{ label: '小', value: 'small' },
{ label: '最小', value: 'mini' }
]
}
},
computed: {
...mapState('d2admin/size', [
'value'
])
]),
options () {
return [
{ label: this.$t('layout.header-aside.header-size.options.default'), value: 'default' },
{ label: this.$t('layout.header-aside.header-size.options.medium'), value: 'medium' },
{ label: this.$t('layout.header-aside.header-size.options.small'), value: 'small' },
{ label: this.$t('layout.header-aside.header-size.options.mini'), value: 'mini' }
]
}
},
watch: {
// 注意 这里是关键
@@ -61,9 +59,9 @@ export default {
handleChange (value) {
this.sizeSet(value)
this.$notify({
title: '提示',
title: this.$t('public.notify.special.component-size.changed.title'),
dangerouslyUseHTMLString: true,
message: '已更新页面内 <b>组件</b> 的 <b>默认尺寸</b><br/>例如按钮大小,<b>非字号</b>',
message: this.$t('public.notify.special.component-size.changed.message'),
type: 'success'
})
},

View File

@@ -7,8 +7,8 @@
align="center"
width="160"/>
<el-table-column
label="预览"
width="120">
width="120"
:label="$t('layout.header-aside.header-theme.list.column.label.preview')">
<div
slot-scope="scope"
class="theme-preview"
@@ -26,13 +26,13 @@
type="success"
icon="el-icon-check"
round>
已激活
{{ $t('layout.header-aside.header-theme.list.button.is-active') }}
</el-button>
<el-button
v-else
round
@click="handleSelectTheme(scope.row.name)">
使用
{{ $t('layout.header-aside.header-theme.list.button.select') }}
</el-button>
</template>
</el-table-column>

View File

@@ -2,8 +2,8 @@
<div>
<el-tooltip
effect="dark"
content="主题"
placement="bottom">
placement="bottom"
:content="$t('layout.header-aside.header-theme.tooltip.content')">
<el-button
class="d2-ml-0 d2-mr btn-text can-hover"
type="text"
@@ -14,8 +14,8 @@
</el-button>
</el-tooltip>
<el-dialog
title="主题"
width="600px"
:title="$t('layout.header-aside.header-theme.dialog.title')"
:visible.sync="dialogVisible"
:append-to-body="true">
<d2-theme-list style="margin-top: -25px;"/>

View File

@@ -1,10 +1,10 @@
<template>
<el-dropdown size="small" class="d2-mr">
<span class="btn-text">{{info.name ? `你好 ${info.name}` : '未登录'}}</span>
<span class="btn-text">{{info.name ? `${$t('layout.header-aside.header-user.hello')} ${info.name}` : '----'}}</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="logOff">
<d2-icon name="power-off" class="d2-mr-5"/>
注销
{{ $t('layout.header-aside.header-user.log-off') }}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>

View File

@@ -13,7 +13,7 @@
</el-menu>
<div v-if="aside.length === 0 && !asideCollapse" class="d2-layout-header-aside-menu-empty" flex="dir:top main:center cross:center">
<d2-icon name="inbox"/>
<span>没有侧栏菜单</span>
<span>{{ $t('layout.header-aside.menu-side.empty') }}</span>
</div>
</div>
</template>

View File

@@ -4,7 +4,7 @@ export default {
methods: {
handleMenuSelect (index, indexPath) {
if (/^d2-menu-empty-\d+$/.test(index) || index === undefined) {
this.$message.warning('临时菜单')
this.$message.warning(this.$t('layout.header-aside.message.warning.temporary-menu'))
} else if (/^https:\/\/|http:\/\//.test(index)) {
util.open(index)
} else {

View File

@@ -15,7 +15,7 @@
ref="input"
v-model="searchText"
suffix-icon="el-icon-search"
placeholder="搜索页面"
:placeholder="$t('layout.header-aside.panel-search.autocomplete-placeholder')"
:fetch-suggestions="querySearch"
:trigger-on-focus="false"
:clearable="true"
@@ -26,11 +26,7 @@
:item="item"/>
</el-autocomplete>
<div class="panel-search__tip">
您可以使用快捷键
<span class="panel-search__key">{{hotkey.open}}</span>
唤醒搜索面板
<span class="panel-search__key">{{hotkey.close}}</span>
关闭
{{ $t('layout.header-aside.panel-search.tip', { open: hotkey.open, close: hotkey.close }) }}
</div>
</div>
<div
@@ -204,13 +200,6 @@ export default {
margin-bottom: 40px;
font-size: 12px;
color: $color-text-sub;
.panel-search__key {
padding: 1px 5px;
margin: 0px 2px;
border-radius: 2px;
background-color: $color-text-normal;
color: $color-bg;
}
}
}
.panel-search__results-group {

View File

@@ -21,7 +21,7 @@
<el-tab-pane
v-for="page in opened"
:key="page.fullPath"
:label="page.meta.title || '未命名'"
:label="page.meta.title || $t('layout.header-aside.tabs.label-default')"
:name="page.fullPath"/>
</el-tabs>
</div>
@@ -38,19 +38,19 @@
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="left">
<d2-icon name="arrow-left" class="d2-mr-10"/>
关闭左侧
{{ $t('layout.header-aside.tabs.close-left') }}
</el-dropdown-item>
<el-dropdown-item command="right">
<d2-icon name="arrow-right" class="d2-mr-10"/>
关闭右侧
{{ $t('layout.header-aside.tabs.close-right') }}
</el-dropdown-item>
<el-dropdown-item command="other">
<d2-icon name="times" class="d2-mr-10"/>
关闭其它
{{ $t('layout.header-aside.tabs.close-other') }}
</el-dropdown-item>
<el-dropdown-item command="all">
<d2-icon name="times-circle" class="d2-mr-10"/>
全部关闭
{{ $t('layout.header-aside.tabs.close-all') }}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@@ -70,15 +70,6 @@ export default {
contextmenuFlag: false,
contentmenuX: 0,
contentmenuY: 0,
contextmenuListIndex: [
{ icon: 'times-circle', title: '关闭全部', value: 'all' }
],
contextmenuList: [
{ icon: 'arrow-left', title: '关闭左侧', value: 'left' },
{ icon: 'arrow-right', title: '关闭右侧', value: 'right' },
{ icon: 'times', title: '关闭其它', value: 'other' },
{ icon: 'times-circle', title: '关闭全部', value: 'all' }
],
tagName: '/index'
}
},
@@ -86,7 +77,20 @@ export default {
...mapState('d2admin/page', [
'opened',
'current'
])
]),
contextmenuListIndex () {
return [
{ icon: 'times-circle', title: this.$t('layout.header-aside.tabs.close-all'), value: 'all' }
]
},
contextmenuList () {
return [
{ icon: 'arrow-left', title: this.$t('layout.header-aside.tabs.close-left'), value: 'left' },
{ icon: 'arrow-right', title: this.$t('layout.header-aside.tabs.close-right'), value: 'right' },
{ icon: 'times', title: this.$t('layout.header-aside.tabs.close-other'), value: 'other' },
{ icon: 'times-circle', title: this.$t('layout.header-aside.tabs.close-all'), value: 'all' }
]
}
},
methods: {
...mapActions('d2admin/page', [
@@ -147,7 +151,7 @@ export default {
this.closeAll()
break
default:
this.$message.error('无效的操作')
this.$message.error(this.$t('public.message.error.handle.invalid'))
break
}
},