From a02877e38ffcc00f113fdbe31cd6639d44595a36 Mon Sep 17 00:00:00 2001 From: MTrun <1262327911@qq.com> Date: Wed, 22 Dec 2021 15:31:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Application/Application.vue | 2 + src/components/LoadingContent/index.ts | 3 + src/components/LoadingContent/index.vue | 12 +++ src/components/UserInfo/index.vue | 3 +- src/i18n/en/index.ts | 28 +++++-- src/i18n/en/project.ts | 15 ++++ src/i18n/zh/index.ts | 18 +++- src/i18n/zh/project.ts | 16 ++++ src/layout/index.vue | 83 +------------------ src/views/login/index.vue | 3 +- .../project/items/components/Card/index.vue | 49 ++++++----- .../items/components/ModalCard/index.vue | 15 ++-- .../Create/components/CreateModal/index.vue | 17 ++-- .../layout/components/Create/index.vue | 4 +- .../project/layout/components/Sider/menu.ts | 13 +-- types/global.d.ts | 10 +-- 16 files changed, 151 insertions(+), 140 deletions(-) create mode 100644 src/components/LoadingContent/index.ts create mode 100644 src/components/LoadingContent/index.vue create mode 100644 src/i18n/en/project.ts create mode 100644 src/i18n/zh/project.ts diff --git a/src/components/Application/Application.vue b/src/components/Application/Application.vue index 8ce52cc5..bceb38aa 100644 --- a/src/components/Application/Application.vue +++ b/src/components/Application/Application.vue @@ -2,6 +2,7 @@ + @@ -22,4 +23,5 @@ import { import { MessageContent } from '@/components/MessageContent' import { DialogContent } from '@/components/DialogContent' +import { LoadingContent } from '@/components/LoadingContent' diff --git a/src/components/LoadingContent/index.ts b/src/components/LoadingContent/index.ts new file mode 100644 index 00000000..d557abc4 --- /dev/null +++ b/src/components/LoadingContent/index.ts @@ -0,0 +1,3 @@ +import LoadingContent from './index.vue'; + +export { LoadingContent }; diff --git a/src/components/LoadingContent/index.vue b/src/components/LoadingContent/index.vue new file mode 100644 index 00000000..323217d0 --- /dev/null +++ b/src/components/LoadingContent/index.vue @@ -0,0 +1,12 @@ + diff --git a/src/components/UserInfo/index.vue b/src/components/UserInfo/index.vue index 03ac354e..66814860 100644 --- a/src/components/UserInfo/index.vue +++ b/src/components/UserInfo/index.vue @@ -24,12 +24,11 @@ import { h, ref, reactive } from 'vue'; import { NAvatar, NText } from 'naive-ui' import { renderIcon } from '@/utils' import { openDoc, logout } from '@/utils' -import { useI18n } from 'vue-i18n' import { icon } from '@/plugins' const { DocumentTextIcon, ChatboxEllipsesIcon, PersonIcon, LogOutOutlineIcon } = icon.ionicons5 -const { t } = useI18n() +const t = window['$t'] const imageUrl = 'https://www.naiveui.com/assets/naivelogo.93278402.svg' diff --git a/src/i18n/en/index.ts b/src/i18n/en/index.ts index a4b387ea..5de7b555 100644 --- a/src/i18n/en/index.ts +++ b/src/i18n/en/index.ts @@ -1,18 +1,30 @@ import login from './login' +import project from './project' const global = { - doc_addr: "Document", - code_addr: "Code address", - form_account: "Please enter your account or email", - form_password: "Please enter your password", + doc_addr: 'Document', + code_addr: 'Code address', + form_account: 'Please enter your account or email', + form_password: 'Please enter your password', // header doc: 'Document', help: 'Help', contact: 'Contact us', - logout: 'Logout' + logout: 'Logout', + // right key + r_edit: 'Edit', + r_preview: 'Preview', + r_copy: 'Copy', + r_rename: 'Rename', + r_publish: 'Publish', + r_unpublish: 'Unpublish', + r_download: 'Download', + r_delete: 'Delete', + r_more: 'More', } export default { - global: global, - login: login -} \ No newline at end of file + global, + login, + project +} diff --git a/src/i18n/en/project.ts b/src/i18n/en/project.ts new file mode 100644 index 00000000..584e80c9 --- /dev/null +++ b/src/i18n/en/project.ts @@ -0,0 +1,15 @@ +export default { + create_btn: 'Creat', + create_tip: 'Please select a content for development', + project: 'Project', + my: 'My', + new_project: 'NewProject', + all_project: 'AllProject', + my_templete: 'MyTemplete', + template_market: 'TemplateMarket', + + // items + release: 'Release', + unreleased: 'Unrelease', + last_edit: 'Last edit time' +} diff --git a/src/i18n/zh/index.ts b/src/i18n/zh/index.ts index 65a20d3e..09c31d7b 100644 --- a/src/i18n/zh/index.ts +++ b/src/i18n/zh/index.ts @@ -1,4 +1,5 @@ import login from './login' +import project from './project' const global = { doc_addr: '文档地址', @@ -9,10 +10,21 @@ const global = { doc: '说明文档', help: '帮助中心', contact: '联系我们', - logout: '退出登录' + logout: '退出登录', + // 功能键 + r_edit: '编辑', + r_preview: '预览', + r_copy: '复制', + r_rename: '重命名', + r_publish: '发布', + r_unpublish: '取消发布', + r_download: '下载', + r_delete: '删除', + r_more: '更多', } export default { - global: global, - login: login + global, + login, + project } diff --git a/src/i18n/zh/project.ts b/src/i18n/zh/project.ts new file mode 100644 index 00000000..49e86567 --- /dev/null +++ b/src/i18n/zh/project.ts @@ -0,0 +1,16 @@ +export default { + // aside + create_btn: '新建', + create_tip: '从哪里出发好呢?', + project: '项目', + my: '我的', + new_project: '新项目', + all_project: '全部项目', + my_templete: '我的模板', + template_market: '模板市场', + + // items + release: '已发布', + unreleased: '未发布', + last_edit: '最后编辑' +} diff --git a/src/layout/index.vue b/src/layout/index.vue index 28c0fcfd..f1bd3a1c 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -3,85 +3,10 @@ +window['$t'] = t - + \ No newline at end of file diff --git a/src/views/login/index.vue b/src/views/login/index.vue index c1436f67..852637e6 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -114,7 +114,6 @@ import { reactive, ref, onMounted } from 'vue' import { useRouter } from 'vue-router' import { useMessage } from 'naive-ui' -import { useI18n } from 'vue-i18n' import { requireUrl } from '@/utils' import { routerTurnByName } from '@/utils' import shuffle from 'lodash/shuffle' @@ -142,7 +141,7 @@ const autoLogin = ref(true) const show = ref(false) const showBg = ref(false) const designStore = useDesignStore() -const { t } = useI18n() +const t = window['$t'] onMounted(() => { setTimeout(() => { diff --git a/src/views/project/items/components/Card/index.vue b/src/views/project/items/components/Card/index.vue index 5edea524..fd2accf4 100644 --- a/src/views/project/items/components/Card/index.vue +++ b/src/views/project/items/components/Card/index.vue @@ -12,7 +12,7 @@ /> -
+
- {{ cardData.release ? '已发布' : '未发布' }} + {{ + cardData.release + ? $t('project.release') + : $t('project.unreleased') + }} - {{ item.label }} + {{ item.label }} @@ -78,11 +82,13 @@