diff --git a/src/components/table/table.vue b/src/components/table/table.vue index dc767b2dd41a099168031c4f8c48159bc127df03..fe159139eca829337c2d815ee53a2de1c1973f3a 100644 --- a/src/components/table/table.vue +++ b/src/components/table/table.vue @@ -13,10 +13,10 @@ - 更多查询 + {{ $t('table.moreSearch') }} - 重置 - 查询 + {{ $t('table.reset') }} + {{ $t('table.search') }} @@ -24,7 +24,7 @@ - {{ newBtn.text || '新增' }} + {{ newBtn.text || $t('table.add') }} @@ -42,7 +42,7 @@ > @@ -65,7 +65,7 @@ :width="dWidth" @close="hidden" :maskClosable="false" - :title="title" + :title="drawerTitle" :afterVisibleChange="afterVisibleChange" > @@ -83,8 +83,6 @@ const initQuery = { pageNum: 1, }; -const defaultTitle = '新增'; - export default { props: { url: String, @@ -123,7 +121,7 @@ export default { loading: false, total: 0, visible: false, - title: newBtn.title ?? defaultTitle, + title: null, drawerStyle: { display: 'flex', flexDirection: 'column', @@ -160,7 +158,7 @@ export default { newButtons() { return this.buttons ? Array.isArray(this.buttons) - ? { data: this.buttons, title: '操作' } + ? { data: this.buttons } : this.buttons : null; }, @@ -188,6 +186,9 @@ export default { } : {}; }, + drawerTitle() { + return this.title ?? this.addBtn?.title ?? this.$t('table.add'); + }, }, methods: { @@ -228,7 +229,7 @@ export default { }, afterVisibleChange(visible) { if (!visible) { - this.title = this.addBtn?.title ?? defaultTitle; + this.title = null; this.type = null; this.row = null; this.dWidth = this.drawerWidth; diff --git a/src/components/tool/Drawer.vue b/src/components/tool/Drawer.vue index f3810e98ced004461859934ffbdcbeb8c6057590..8d2ec5f04d33e854442baeac452bc61950fa3057 100644 --- a/src/components/tool/Drawer.vue +++ b/src/components/tool/Drawer.vue @@ -1,64 +1,68 @@ diff --git a/src/local/index.js b/src/local/index.js index 2fd0f73bf1f0b1d80f70e74f9d848cdd277fad87..5cd2aea8a5c3e12acb13f00fe01c87e7427ebb06 100644 --- a/src/local/index.js +++ b/src/local/index.js @@ -1,4 +1,5 @@ import selectLang from './select'; +import TableLang from './table'; const zh_CN = {}; const en_US = {}; @@ -12,5 +13,6 @@ function formatLang(langObject) { } formatLang(selectLang); +formatLang(TableLang); export { en_US, zh_CN }; diff --git a/src/local/table.js b/src/local/table.js new file mode 100644 index 0000000000000000000000000000000000000000..875567c13dfb0fe662c1e528e37a134c3c13f20d --- /dev/null +++ b/src/local/table.js @@ -0,0 +1,7 @@ +export default { + 'table.operation': ['操作', 'Operation'], + 'table.moreSearch': ['更多查询', 'More Search'], + 'table.reset': ['重置', 'Reset'], + 'table.add': ['新增', 'Add'], + 'table.search': ['查询', 'Search'], +}; diff --git a/src/pages/frame/components/setting/Setting.vue b/src/pages/frame/components/setting/Setting.vue index fd5a45d21e8170886e3b51ae391b34b45a8811a0..3825e7c0812eb0b87d7581f2846a6ed6a1c05b4f 100644 --- a/src/pages/frame/components/setting/Setting.vue +++ b/src/pages/frame/components/setting/Setting.vue @@ -8,7 +8,7 @@ - + @@ -113,7 +113,7 @@ item.name == this.animate.name).directions; + return this.animates.find((item) => item.name == this.animate.name).directions; }, ...mapState('settingModule', [ 'theme', @@ -254,7 +254,7 @@ export default { ]), }, watch: { - 'animate.name': function(val) { + 'animate.name': function (val) { this.setAnimate({ name: val, direction: this.directions[0] }); }, }, @@ -282,7 +282,7 @@ export default { let config = {}; let mySetting = this.$store.state.settingModule; let dftSetting = local ? settingConfig : settingConfig; - Object.keys(mySetting).forEach(key => { + Object.keys(mySetting).forEach((key) => { const dftValue = dftSetting[key], myValue = mySetting[key]; if (dftValue != undefined && !fastEqual(dftValue, myValue)) { @@ -309,6 +309,7 @@ export default {