删除多国语言配置,但是保留多国语功能

Former-commit-id: 0bc3afb90e0f6c085a680e39880f975717793b09 [formerly 0bc3afb90e0f6c085a680e39880f975717793b09 [formerly 0bc3afb90e0f6c085a680e39880f975717793b09 [formerly 0bc3afb90e0f6c085a680e39880f975717793b09 [formerly ec04dd1ed71e3ab98007073168daae880ad6bc9a [formerly 27f3e5cbfae961450c4738a9bc7aaa0e87d983bd]]]]]
Former-commit-id: fcfaf06a9d9c9422931b9c6d0e58dcf5f2e0e9fe
Former-commit-id: 1507dac206b02e590a62c343404760c4a10e1163
Former-commit-id: d32f3aa5207b09bcc61530258da7d285a7aca5e8 [formerly 7b9d2763618e82332e7348268bdbec79fd6b324f]
Former-commit-id: 671052ad6a2d10a151f0befa1020be7b21890553
Former-commit-id: 7096b9fa103901dd06b437b5b692cf85ecb35f2f
Former-commit-id: f1a6fbab21e2ecdf9752c8c4116b44c43d568bca
Former-commit-id: 6fa9f1a3a296b50663854ec2c2089fe78b392f29
Former-commit-id: 99e9372f7be157d28e3977584a5281d991a5264c
This commit is contained in:
FairyEver
2019-08-12 22:19:54 +08:00
parent b4e4df3917
commit 1f7c043dc5
23 changed files with 206 additions and 1104 deletions

View File

@@ -1,7 +1,7 @@
<template>
<el-tooltip
effect="dark"
:content="active ? $t('layout.header-aside.header-fullscreen.exit') : $t('layout.header-aside.header-fullscreen.active')"
:content="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.$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 })}`
? '没有日志或异常'
: `${this.logLength} 条日志${this.logLengthError > 0
? ` | 包含 ${this.logLengthError} 个异常`
: ''}`
}
},

View File

@@ -15,18 +15,20 @@
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' }
]
}
])
},
methods: {
...mapMutations({
@@ -38,9 +40,9 @@ export default {
handleChange (value) {
this.sizeSet(value)
this.$notify({
title: this.$t('public.notify.special.component-size.changed.title'),
title: '提示',
dangerouslyUseHTMLString: true,
message: this.$t('public.notify.special.component-size.changed.message'),
message: '已更新页面内 <b>组件</b> 的 <b>默认尺寸</b><br/>例如按钮大小,<b>非字号</b>',
type: 'success'
})
},

View File

@@ -7,8 +7,8 @@
align="center"
width="160"/>
<el-table-column
width="120"
:label="$t('layout.header-aside.header-theme.list.column.label.preview')">
label="预览"
width="120">
<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"
placement="bottom"
:content="$t('layout.header-aside.header-theme.tooltip.content')">
content="主题"
placement="bottom">
<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 ? `${$t('layout.header-aside.header-user.hello')} ${info.name}` : '----'}}</span>
<span class="btn-text">{{info.name ? `你好 ${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

@@ -10,7 +10,7 @@ export function elMenuItem (createElement, menu) {
...menu.iconSvg ? [
createElement('d2-icon-svg', { props: { name: menu.iconSvg } })
] : [],
createElement('span', { slot: 'title' }, menu.title || this.$t('layout.header-aside.menu-item.label-default'))
createElement('span', { slot: 'title' }, menu.title || '未命名菜单')
])
}
@@ -26,7 +26,7 @@ export function elSubmenu (createElement, menu) {
...menu.iconSvg ? [
createElement('d2-icon-svg', { slot: 'title', props: { name: menu.iconSvg } })
] : [],
createElement('span', { slot: 'title' }, menu.title || this.$t('layout.header-aside.menu-item.label-default')),
createElement('span', { slot: 'title' }, menu.title || '未命名菜单'),
...menu.children.map((child, childIndex) => (child.children === undefined ? elMenuItem : elSubmenu).call(this, createElement, child))
])
}

View File

@@ -18,7 +18,7 @@ export default {
...this.aside.length === 0 && !this.asideCollapse ? [
createElement('div', { attrs: { class: 'd2-layout-header-aside-menu-empty', flex: 'dir:top main:center cross:center' } }, [
createElement('d2-icon', { props: { name: 'inbox' } }),
createElement('span', {}, this.$t('layout.header-aside.menu-side.empty'))
createElement('span', {}, '没有侧栏菜单')
])
] : []
])

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.$t('layout.header-aside.message.warning.temporary-menu'))
this.$message.warning('临时菜单')
} 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="$t('layout.header-aside.panel-search.autocomplete-placeholder')"
placeholder="搜索页面"
:fetch-suggestions="querySearch"
:trigger-on-focus="false"
:clearable="true"
@@ -26,7 +26,11 @@
:item="item"/>
</el-autocomplete>
<div class="panel-search__tip">
{{ $t('layout.header-aside.panel-search.tip', { open: hotkey.open, close: hotkey.close }) }}
您可以使用快捷键
<span class="panel-search__key">{{hotkey.open}}</span>
唤醒搜索面板
<span class="panel-search__key">{{hotkey.close}}</span>
关闭
</div>
</div>
<div
@@ -200,6 +204,13 @@ 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 || $t('layout.header-aside.tabs.label-default')"
:label="page.meta.title || '未命名'"
: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,6 +70,15 @@ 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'
}
},
@@ -77,20 +86,7 @@ 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', [
@@ -151,7 +147,7 @@ export default {
this.closeAll()
break
default:
this.$message.error(this.$t('public.message.error.handle.invalid'))
this.$message.error('无效的操作')
break
}
},