feat: 新增模块首页、国际化适配与菜单重载功能
1. 为菜单数据新增remark字段并设置默认值 2. 全量替换硬编码文本为国际化多语言支持 3. 新增生产配置模块首页组件与路由 4. 新增菜单重载action,支持语言切换后重载菜单 5. 补充简体中文、英文、日文、繁体中文语言包
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<d2-icon name="font" style="font-size: 16px;"/>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item v-for="item in options" :key="item.value" :command="item.value">
|
||||
<el-dropdown-item v-for="item in sizeOptions" :key="item.value" :command="item.value">
|
||||
<d2-icon :name="iconName(item.value)" class="d2-mr-5"/>{{item.label}}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
@@ -12,37 +12,32 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapMutations, mapActions } from 'vuex'
|
||||
import { mapState, 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'
|
||||
])
|
||||
]),
|
||||
sizeOptions () {
|
||||
return [
|
||||
{ label: this.$t('page.layout.size.default'), value: 'default' },
|
||||
{ label: this.$t('page.layout.size.medium'), value: 'medium' },
|
||||
{ label: this.$t('page.layout.size.small'), value: 'small' },
|
||||
{ label: this.$t('page.layout.size.mini'), value: 'mini' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations({
|
||||
pageKeepAliveClean: 'd2admin/page/keepAliveClean'
|
||||
}),
|
||||
...mapActions({
|
||||
sizeSet: 'd2admin/size/set'
|
||||
}),
|
||||
handleChange (value) {
|
||||
this.sizeSet(value)
|
||||
this.$notify({
|
||||
title: '提示',
|
||||
title: this.$t('page.layout.size.notification_title'),
|
||||
dangerouslyUseHTMLString: true,
|
||||
message: '已更新页面内 <b>组件</b> 的 <b>默认尺寸</b><br/>例如按钮大小,<b>非字号</b>',
|
||||
message: this.$t('page.layout.size.notification_message'),
|
||||
type: 'success'
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user