diff --git a/src/components/setting/Setting.vue b/src/components/setting/Setting.vue index 2da169b..bf84f28 100644 --- a/src/components/setting/Setting.vue +++ b/src/components/setting/Setting.vue @@ -1,60 +1,60 @@ @@ -85,13 +85,14 @@ import ColorCheckbox from '../checkbox/ColorCheckbox' import ImgCheckbox from '../checkbox/ImgCheckbox' import Clipboard from 'clipboard' import themeUtil from '../../utils/themeUtil' -import { mapState } from 'vuex' +import { mapState, mapMutations } from 'vuex' const ColorCheckboxGroup = ColorCheckbox.Group const ImgCheckboxGroup = ImgCheckbox.Group const colors = ['#f5222d', '#fa541c', '#faad14', '#13c2c2', '#52c41a', '#1890ff', '#2f54eb', '#722ed1'] export default { name: 'Setting', + i18n: require('./i18n'), components: {ImgCheckboxGroup, ImgCheckbox, ColorCheckboxGroup, ColorCheckbox, SettingItem}, data() { return { @@ -105,7 +106,7 @@ export default { directions() { return this.animates.find(item => item.name == this.animate).directions }, - ...mapState('setting', ['animates', 'multiPage', 'weekMode', 'fixedHeader', 'fixedSider']) + ...mapState('setting', ['animates', 'multiPage', 'weekMode', 'fixedHeader', 'fixedSideBar']) }, methods: { onColorChange (values, colors) { @@ -118,12 +119,6 @@ export default { }) } }, - setTheme (values) { - this.$store.commit('setting/setTheme', values[0]) - }, - setLayout (values) { - this.$store.commit('setting/setLayout', values[0]) - }, copyCode () { let clipboard = new Clipboard('#copyBtn') const _this = this @@ -132,24 +127,13 @@ export default { clipboard.destroy() }) }, - setMultiPage (checked) { - this.$store.commit('setting/setMultiPage', checked) - }, - setWeekMode(checked) { - this.$store.commit('setting/setWeekMode', checked) - }, setAnimate(animate, direction) { if (direction == undefined) { this.direction = this.directions[0] } this.$store.commit('setting/setAnimate', {name: this.animate, direction: this.direction}) }, - setFixedHeader(checked) { - this.$store.commit('setting/setFixedHeader', checked) - }, - setFixedSider(checked) { - this.$store.commit('setting/setFixedSider', checked) - } + ...mapMutations('setting', ['setTheme', 'setLayout', 'setMultiPage', 'setWeekMode', 'setFixedSideBar', 'setFixedHeader']) } } diff --git a/src/components/setting/i18n.js b/src/components/setting/i18n.js new file mode 100644 index 0000000..bb15608 --- /dev/null +++ b/src/components/setting/i18n.js @@ -0,0 +1,97 @@ +module.exports = { + messages: { + CN: { + theme: { + title: '整体风格设置', + light: '亮色菜单风格', + dark: '暗色菜单风格', + color: '主题色' + }, + navigate: { + title: '导航设置', + side: '侧边导航', + head: '顶部导航', + content: { + title: '内容区域宽度', + fluid: '流式', + fixed: '定宽' + }, + fixedHeader: '固定Header', + fixedSideBar: '固定侧边栏', + }, + other: { + title: '其他设置', + weekMode: '色弱模式', + multiPages: '多页签模式' + }, + animate: { + title: '页面切换动画', + effect: '动画效果', + direction: '动画方向' + }, + copy: '拷贝配置' + }, + HK: { + theme: { + title: '整體風格設置', + light: '亮色菜單風格', + dark: '暗色菜單風格', + color: '主題色' + }, + navigate: { + title: '導航設置', + side: '側邊導航', + head: '頂部導航', + content: { + title: '內容區域寬度', + fluid: '流式', + fixed: '定寬' + }, + fixedHeader: '固定Header', + fixedSideBar: '固定側邊欄', + }, + other: { + title: '其他設置', + weekMode: '色弱模式', + multiPages: '多頁簽模式' + }, + animate: { + title: '頁面切換動畫', + effect: '動畫效果', + direction: '動畫方向' + }, + copy: '拷貝配置' + }, + US: { + theme: { + title: 'Page Style Setting', + light: 'Light Style', + dark: 'Dark Style', + color: 'Theme Color' + }, + navigate: { + title: 'Navigation Mode', + side: 'Side Menu Layout', + head: 'Top Menu Layout', + content: { + title: 'Content Width', + fluid: 'Fluid', + fixed: 'Fixed' + }, + fixedHeader: 'Fixed Header', + fixedSideBar: 'Fixed SideBar', + }, + other: { + title: 'Other Setting', + weekMode: 'Week Mode', + multiPages: 'Multi Pages' + }, + animate: { + title: 'Page Toggle Animation', + effect: 'Effect', + direction: 'Direction' + }, + copy: 'Copy Setting' + } + } +} diff --git a/src/config/index.js b/src/config/index.js index a3414fb..6f88948 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -5,7 +5,7 @@ module.exports = { theme: 'dark', layout: 'side', fixedHeader: false, - fixedSider: true, + fixedSideBar: true, weekMode: false, multiPage: false, systemName: 'Vue Antd Admin', diff --git a/src/layouts/GlobalLayout.vue b/src/layouts/GlobalLayout.vue index d8c3b45..ca5d0e7 100644 --- a/src/layouts/GlobalLayout.vue +++ b/src/layouts/GlobalLayout.vue @@ -1,5 +1,5 @@