fix(i18n模块): 修改部分i18n代码

This commit is contained in:
Kven 2024-12-26 11:14:48 +08:00
parent 7386ea2a94
commit fba0fe8b77
18 changed files with 120 additions and 113 deletions

View File

@ -33,6 +33,7 @@
"dependencies": {
"@arco-design/web-vue": "^2.44.7",
"@vueuse/core": "^9.3.0",
"@wangeditor/editor-for-vue": "^5.1.12",
"arco-design-pro-vue": "^2.7.2",
"axios": "^0.24.0",
"dayjs": "^1.11.5",
@ -49,6 +50,7 @@
"vue": "^3.2.40",
"vue-echarts": "^6.2.3",
"vue-i18n": "^9.2.2",
"vue-quill-editor": "^3.0.6",
"vue-router": "^4.0.14",
"xlsx": "^0.18.5"
},

View File

@ -4,7 +4,7 @@
<icon-apps />
</a-breadcrumb-item>
<a-breadcrumb-item v-for="item in items" :key="item">
{{ $t(item) }}
{{ item }}
</a-breadcrumb-item>
</a-breadcrumb>
</template>

View File

@ -25,6 +25,7 @@ export default {
'menu.exception': '异常页',
'menu.user': '个人中心',
'menu.system': '系统管理',
'menu.iot': '物联网管理',
'menu.role': '角色中心',
'menu.customer': '用户中心',
'menu.ticket': '票据中心',

View File

@ -7,6 +7,7 @@ const DASHBOARD: AppRouteRecordRaw = {
component: DEFAULT_LAYOUT,
meta: {
locale: 'menu.dashboard',
title: '首页',
requiresAuth: true,
icon: 'icon-dashboard', // 设置图标
order: 0, // 排序路由菜单项。如果设置该值,值越高,越靠前
@ -17,7 +18,7 @@ const DASHBOARD: AppRouteRecordRaw = {
name: 'Workplace',
component: () => import('@/views/dashboard/workplace/index.vue'),
meta: {
locale: 'menu.dashboard.workplace',
title: '工作台',
requiresAuth: true,
permissions: ['*'],
},

View File

@ -27,11 +27,42 @@ const USER: AppRouteRecordRaw = {
name: 'Setting',
component: () => import('@/views/user/setting/index.vue'),
meta: {
locale: 'menu.user.setting',
title: '个人设置',
requiresAuth: true,
permissions: ['*'],
},
},
{
path: 'bulletins',
name: 'Bulletins',
component: () => import('@/views/user/bulletins/index.vue'),
meta: {
title: '公告通知',
requiresAuth: true,
permissions: ['*'],
},
},
{
path: 'messages',
name: 'Messages',
component: () => import('@/views/user/messages/index.vue'),
meta: {
title: '消息通知',
requiresAuth: true,
permissions: ['*'],
},
},
{
path: 'details/:id',
name: 'Details',
component: () => import('@/views/user/bulletins/components/detail.vue'),
meta: {
title: '公告详情',
requiresAuth: true,
showInMenu: false,
permissions: ['*'],
},
},
],
};

View File

@ -35,11 +35,4 @@ export default {
'workplace.popularContent.video': 'video',
'workplace.categoriesPercent': 'Categories Percent',
'workplace.pecs': 'pecs',
'workplace.pass': 'pass',
'workplace.notPass': 'notPass',
'workplace.notAudit': 'notAudit',
'workplace.notFiled': 'notFiled',
'workplace.total': 'total',
'workplace.chart':' Ticket Chart'
};

View File

@ -34,10 +34,4 @@ export default {
'workplace.popularContent.video': '视频',
'workplace.categoriesPercent': '内容类型占比',
'workplace.pecs': '个',
'workplace.pass': '审核通过',
'workplace.notPass': '审核不通过',
'workplace.notAudit': '待审核',
'workplace.notFiled': '待提交',
'workplace.total': '票据总数',
'workplace.chart':'票据分析图'
};

View File

@ -1,6 +1,6 @@
<template>
<div class="container">
<Breadcrumb :items="['menu.exception', 'menu.exception.403']" />
<Breadcrumb :items="['403', '403']" />
<div class="content">
<a-result
class="result"

View File

@ -1,6 +1,6 @@
<template>
<div class="container">
<Breadcrumb :items="['menu.exception', 'menu.exception.404']" />
<Breadcrumb :items="['404', '404']" />
<div class="content">
<a-result
class="result"

View File

@ -1,6 +1,6 @@
<template>
<div class="container">
<Breadcrumb :items="['menu.exception', 'menu.exception.500']" />
<Breadcrumb :items="['500', '500']" />
<div class="content">
<a-result
class="result"

View File

@ -1,7 +1,7 @@
<template>
<div class="container">
<div class="logo">
<div class="logo-text">Hello Ticket!</div>
<div class="logo-text">Hello!</div>
</div>
<LoginBanner />
<div class="content">

View File

@ -1,6 +1,6 @@
<template>
<div class="container">
<Breadcrumb :items="['menu.system', 'menu.system.dept']" />
<Breadcrumb :items="['系统管理', '部门管理']" />
<a-card class="general-card" title=" ">
<a-row>
<a-col :flex="1">
@ -175,7 +175,7 @@
</template>
<script lang="ts" setup>
import { computed, ref, watch } from 'vue';
import { computed, onMounted, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import useLoading from '@/hooks/loading';
import useTableOption from '@/hooks/table-option';
@ -287,7 +287,9 @@ const search = () => {
} as unknown as any);
};
search();
onMounted(() => {
search();
})
//
const onPageChange = (current: number) => {

View File

@ -1,6 +1,6 @@
<template>
<div class="container">
<Breadcrumb :items="['menu.system', 'menu.system.permission']" />
<Breadcrumb :items="['系统管理', '权限管理']" />
<a-card class="general-card" :title="$t('menu.list.searchTable')">
<a-row>
<a-col :flex="1">

View File

@ -1,7 +1,7 @@
<template>
<div class="container">
<!-- 面包屑 -->
<Breadcrumb :items="['menu.system', 'menu.system.role']" />
<Breadcrumb :items="['系统管理', '角色管理']" />
<a-card class="general-card" title=" ">
<a-row>
<a-col :flex="1">
@ -9,8 +9,8 @@
label-align="right">
<a-row :gutter="16">
<a-col :span="12">
<a-form-item field="title" :label="$t('searchTable.form.name')">
<a-input v-model="formModel.name" :placeholder="$t('searchTable.form.name.placeholder')"></a-input>
<a-form-item field="title" label="名称角色">
<a-input v-model="formModel.name" placeholder="请输入角色名称"></a-input>
</a-form-item>
</a-col>
</a-row>
@ -23,13 +23,13 @@
<template #icon>
<icon-search />
</template>
{{ $t('searchTable.form.search') }}
查询
</a-button>
<a-button @click="reset">
<template #icon>
<icon-refresh />
</template>
{{ $t('searchTable.form.reset') }}
重置
</a-button>
</a-space>
</a-col>
@ -42,13 +42,13 @@
</a-space>
</a-col>
<a-col :span="12" style="display: flex; align-items: center; justify-content: end">
<a-tooltip :content="$t('searchTable.actions.refresh')">
<a-tooltip content='刷新'>
<div class="action-icon" @click="fetchData">
<icon-refresh size="18" />
</div>
</a-tooltip>
<a-dropdown @select="handleSelectDensity">
<a-tooltip :content="$t('searchTable.actions.density')">
<a-tooltip content="密度">
<div class="action-icon"><icon-line-height size="18" /></div>
</a-tooltip>
<template #content>
@ -58,7 +58,7 @@
</a-doption>
</template>
</a-dropdown>
<a-tooltip :content="$t('searchTable.actions.columnSetting')">
<a-tooltip content="列设置">
<a-popover trigger="click" position="bl" @popup-visible-change="popupVisibleChange">
<div class="action-icon"><icon-settings size="18" /></div>
<template #content>
@ -83,7 +83,7 @@
</a-tooltip>
</a-col>
</a-row>
<!-- <a-table row-key="id" :loading="loading" :pagination="false" :columns="(cloneColumns as TableColumnData[])"
<a-table row-key="id" :loading="loading" :pagination="false" :columns="(cloneColumns as TableColumnData[])"
:data="renderData" :bordered="false" :size="size" style="margin-bottom: 40px" @page-change="onPageChange">
<template #index="{ rowIndex }">
{{ rowIndex + 1 }}
@ -97,16 +97,14 @@
</template>
<template #operations="{ record }">
<RoleEdit ref="editRef" :prem="record" :is-create="false" @refresh="fetchData" />
<a-popconfirm :content="t('Confirm the deletion of this role')" type="error" @ok="handleDelete(record)">
<a-button type="primary" size="small" status="danger" style="padding: 7px">
<a-popconfirm content='确认删除此角色?' type="error" @ok="handleDelete(record)">
<a-button type="outline" size="small" status="danger" style="padding: 7px">
<template #icon><icon-delete /></template>
{{ $t('delete') }}
删除
</a-button>
</a-popconfirm>
</template>
</a-table> -->
<RoleTable :data="renderData" :pagination="pagination" :loading="loading" @pageChange="onPageChange"
:columns="(cloneColumns as TableColumnData[])" @search="search" />
</a-table>
<a-pagination style="float: right; position: relative; right: 1px; bottom: 25px" :total="pagination.total"
:size="size" show-total show-jumper show-page-size @page-size-change="onSizeChange" @change="onPageChange" />
</a-card>
@ -114,21 +112,18 @@
</template>
<script lang="ts" setup>
import { computed, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { computed, onMounted, ref, watch } from 'vue';
import useLoading from '@/hooks/loading';
import { Pagination } from '@/types/global';
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
import { Message } from '@arco-design/web-vue';
import useTableOption from '@/hooks/table-option';
// import dayjs from 'dayjs';
import dayjs from 'dayjs';
import { useRoleStore } from '@/store';
import { RoleRecord } from '@/api/role';
import { Message } from '@arco-design/web-vue';
import RoleEdit from './components/role-edit.vue';
import RoleTable from './components/role-table.vue';
const { loading, setLoading } = useLoading(true);
const { t } = useI18n();
const renderData = ref<RoleRecord[]>([]);
const {
cloneColumns,
@ -158,23 +153,23 @@ const pagination: Pagination = {
//
const columns = computed<TableColumnData[]>(() => [
{
title: t('roleTable.columns.index'),
title: '序号',
dataIndex: 'index',
slotName: 'index',
},
{
title: t('roleTable.columns.name'),
title: '名称',
dataIndex: 'name',
sortable: {
sortDirections: ['ascend', 'descend'],
},
},
{
title: t('roleTable.columns.remark'),
title: '备注',
dataIndex: 'remark',
},
{
title: t('roleTable.columns.createTime'),
title: '创建时间',
dataIndex: 'createTime',
slotName: 'createTime',
sortable: {
@ -182,12 +177,12 @@ const columns = computed<TableColumnData[]>(() => [
},
},
{
title: t('roleTable.columns.enabled'),
title: '是否启用',
dataIndex: 'enabled',
slotName: 'enabled',
},
{
title: t('searchTable.columns.operations'),
title: '操作',
dataIndex: 'operations',
slotName: 'operations',
},
@ -217,7 +212,9 @@ const search = () => {
} as unknown as any);
};
search();
onMounted(() => {
search();
})
//
const onPageChange = (current: number) => {
@ -238,38 +235,38 @@ const reset = () => {
};
//
// const enabledStatus = async (record: string) => {
// record.enabled = !record.enabled;
// const res = await roleStore.enabledRole(record.id);
// if (res.status === 200) {
// Message.success({
// content: t('modify.status.sucess'),
// duration: 3 * 1000,
// });
// } else {
// Message.error({
// content: t('modify.status.fail'),
// duration: 3 * 1000,
// });
// }
// };
const enabledStatus = async (record: string) => {
record.enabled = !record.enabled;
const res = await roleStore.enabledRole(record.id);
if (res.status === 200) {
Message.success({
content: '修改成功',
duration: 3 * 1000,
});
} else {
Message.error({
content: '修改失败',
duration: 3 * 1000,
});
}
};
//
// const handleDelete = async (record: RoleRecord) => {
// const res = await roleStore.removeRole(record.id);
// if (res.status === 200) {
// Message.success({
// content: t('delete.role.sucess'),
// duration: 5 * 1000,
// });
// search();
// } else {
// Message.error({
// content: t('delete.role.fail'),
// duration: 3 * 1000,
// });
// }
// };
const handleDelete = async (record: RoleRecord) => {
const res = await roleStore.removeRole(record.id);
if (res.status === 200) {
Message.success({
content: '删除成功',
duration: 5 * 1000,
});
search();
} else {
Message.error({
content: '删除失败',
duration: 3 * 1000,
});
}
};
watch(() => columns.value, deepClone, { deep: true, immediate: true });
</script>

View File

@ -1,6 +1,6 @@
<template>
<div class="container">
<Breadcrumb :items="['menu.system', 'menu.system.user']" />
<Breadcrumb :items="['系统管理', '用户管理']" />
<a-card class="general-card" title=" ">
<a-row>
<a-col :flex="1">
@ -191,12 +191,12 @@
:is-create="false"
@refresh="fetchData"
/>
<Userc
ref="editUserRef"
:user="record"
:is-create="false"
@refresh="search"
/>
<!-- <Userc-->
<!-- ref="editUserRef"-->
<!-- :user="record"-->
<!-- :is-create="false"-->
<!-- @refresh="search"-->
<!-- />-->
<!-- <a-popconfirm
content="确认删除此用户?"
type="error"
@ -223,7 +223,7 @@
</template>
<script lang="ts" setup>
import { computed, ref, watch } from 'vue';
import { computed, onMounted, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import useLoading from '@/hooks/loading';
import { UserRecord, UserParams } from '@/api/user';
@ -269,7 +269,7 @@ const pagination: Pagination = {
page: 1,
size: 10,
current: 1,
total: null,
total: 0,
};
const columns = computed<TableColumnData[]>(() => [
@ -392,7 +392,9 @@ const onSizeChange = (size: number) => {
search();
};
search();
onMounted(() => {
search();
})
//
const reset = () => {

View File

@ -43,13 +43,13 @@
:rules="[
{
required: true,
message: $t('userSetting.form.error.nickname.required'),
message: '请输入昵称',
},
]"
>
<a-input
v-model="formData.nickName"
:placeholder="$t('userSetting.basicInfo.placeholder.nickname')"
placeholder='请输入昵称'
/>
</a-form-item>
<a-form-item

View File

@ -49,7 +49,7 @@
import { useI18n } from 'vue-i18n';
import { ref } from 'vue';
import type { FileItem } from '@arco-design/web-vue/es/upload/interfaces';
import { useUserStore, useTicketStore } from '@/store';
import { useUserStore} from '@/store';
import userIcon from '@/assets/images/user-circle.png';
import type { DescData } from '@arco-design/web-vue/es/descriptions/interface';
import dayjs from 'dayjs';
@ -58,7 +58,7 @@ import { selfUpdate } from '@/api/user';
const userStore = useUserStore();
const { t } = useI18n();
const ticketStore = useTicketStore();
// const ticketStore = useTicketStore();
const file = {
uid: '-2',
@ -89,22 +89,6 @@ const fileList = ref<FileItem[]>([file]);
const Onchange = async (option: any) => {
const FormDatas = new FormData();
FormDatas.append('file', option.fileItem.file);
const res = await ticketStore.uploadFile(FormDatas);
if (res.status === 200) {
Message.success({
content: t('upload.sucess'),
duration: 3 * 1000,
});
res.data.name = res.data.fileName;
fileList.value.push(res.data);
await selfUpdate({ avatar: res.data.id });
await userStore.info();
} else {
Message.error({
content: t('upload.fail'),
duration: 3 * 1000,
});
}
};
</script>

View File

@ -1,6 +1,6 @@
<template>
<div class="container">
<Breadcrumb :items="['menu.user', 'menu.user.setting']" />
<Breadcrumb :items="['个人中心', '个人设置']" />
<a-row style="margin-bottom: 16px">
<a-col :span="24">
<UserPanel />