增加页面翻译

This commit is contained in:
不做码农 2022-05-22 19:34:04 +08:00
parent d24546faf7
commit 2a1425d749
11 changed files with 195 additions and 83 deletions

View File

@ -13,6 +13,10 @@ import pageLangSetCn from './pages/langSet/zh-cn'
import pageLangSetEn from './pages/langSet/en' import pageLangSetEn from './pages/langSet/en'
import pageLangSetTw from './pages/langSet/zh-tw' import pageLangSetTw from './pages/langSet/zh-tw'
import pagemenuCn from './pages/menu/zh-cn'
import pagemenuEn from './pages/menu/en'
import pagemenuTw from './pages/menu/zh-tw'
const i18n = createI18n({ const i18n = createI18n({
// 全局注入 $t 函数 // 全局注入 $t 函数
globalInjection: true, globalInjection: true,
@ -20,9 +24,9 @@ const i18n = createI18n({
locale: store.getters.language, //默认选择的语言 locale: store.getters.language, //默认选择的语言
legacy: false, // 使用 Composition API 模式则需要将其设置为false legacy: false, // 使用 Composition API 模式则需要将其设置为false
messages: { messages: {
'zh-cn': { ...zhCn, ...pageLoginCn, ...pageLangSetCn }, 'zh-cn': { ...zhCn, ...pageLoginCn, ...pageLangSetCn, ...pagemenuCn },
'zh-tw': { ...zhTw, ...pageLoginTw, ...pageLangSetTw }, 'zh-tw': { ...zhTw, ...pageLoginTw, ...pageLangSetTw, ...pagemenuTw },
'en': { ...en, ...pageLoginEn, ...pageLangSetEn } 'en': { ...en, ...pageLoginEn, ...pageLangSetEn, ...pagemenuEn }
} }
}) })
console.log('lang=' + store.getters.language) console.log('lang=' + store.getters.language)

View File

@ -6,7 +6,7 @@ export default {
system: 'System', system: 'System',
monitoring: 'Monitoring', monitoring: 'Monitoring',
systemTools: 'Tools', systemTools: 'Tools',
externalOpen: 'ExternalOpen', externalOpen: 'External open',
icon: 'Icon', icon: 'Icon',
systemMenu: 'Menu', systemMenu: 'Menu',
systemRole: 'Role', systemRole: 'Role',
@ -20,33 +20,34 @@ export default {
loginLog: 'Login log', loginLog: 'Login log',
systemNotice: 'Notice', systemNotice: 'Notice',
systemLang: 'Language set', systemLang: 'Language set',
timedTask: 'TimedTask', timedTask: 'Timed task',
serviceMonitor: 'ServiceMonitor', serviceMonitor: 'Service monitoring',
codeGeneration: 'CodeGeneration', codeGeneration: 'Code generation',
systemInterface: 'SystemInterface', systemInterface: 'System interface',
sendEmail: 'Email', sendEmail: 'Email',
systemArticle: 'Article', systemArticle: 'Article',
articleList: 'Article list', articleList: 'Article list',
formBuild: 'Form building', formBuild: 'Form building',
officialWebsite: 'Official website', officialWebsite: 'Official website',
fileStorage: 'File Storage', fileStorage: 'File storage',
personalCenter: 'Personal', personalCenter: 'Personal',
menuPermi: 'Menu permi', menuPermi: 'Menu permissions',
assignUsers: 'Assign users', assignUsers: 'Authorized user',
cacheMonitor: 'Cache monitor', cacheMonitor: 'Cache monitoring',
}, },
tagsView: { tagsView: {
refresh: 'refresh', refresh: 'refresh',
close: 'close', close: 'close',
closeOther: 'closeOther', closeOther: 'close other',
closeLeft: 'closeLeft', closeLeft: 'close left',
closeRight: 'closeRight', closeRight: 'close right',
closeAll: 'closeAll', closeAll: 'close all',
fullscreen: 'fullscreen', fullscreen: 'fullscreen',
closeFullscreen: 'closeFullscreen', closeFullscreen: 'close fullscreen',
}, },
layout: { layout: {
tip1: 'If you feel good, welcome to ⭐ Star ⭐ Collect it so that the author can continue to be free. Thank you!', tip1: 'If you feel good, welcome to ⭐ Star ⭐ Collect it so that the author can continue to be free. Thank you!',
rewardUser: 'Reward the author with a cup of coffee to express encouragement',
contactUs: 'contact us', contactUs: 'contact us',
donationSupport: 'donation support', donationSupport: 'donation support',
officialWebsite: 'Official website', officialWebsite: 'Official website',
@ -73,7 +74,17 @@ export default {
logOutConfirm: 'Are you sure you want to exit the current login?', logOutConfirm: 'Are you sure you want to exit the current login?',
large: 'Large', large: 'Large',
default: 'Default', default: 'Default',
small: 'Small' small: 'Small',
myWorkbench: 'My workbench',
onlineUsers: 'Online user',
message: 'Message',
amount: 'Amount',
order: 'Order',
modifyInformation: 'Modify information',
technicalSelection: 'Technical selection',
frontendTechnology: 'Front-end technology',
backendTechnology: 'Backend technology',
BackstageManagement: 'Backstage management',
}, },
common: { common: {
ok: 'Ok', ok: 'Ok',
@ -84,7 +95,11 @@ export default {
traditionalChinese: 'TraditionalChinese', traditionalChinese: 'TraditionalChinese',
name: 'Name', name: 'Name',
content: 'Content', content: 'Content',
addTime: 'AddTime' addTime: 'AddTime',
nickName: 'NickName',
time: 'Time',
yes: '是',
no: '否',
}, },
btn: { btn: {
add: 'Add', add: 'Add',

View File

@ -47,6 +47,7 @@ export default {
}, },
layout: { layout: {
tip1: '如果觉得不错欢迎给个⭐Star⭐收藏一下这样作者才有继续免费下去的动力谢谢', tip1: '如果觉得不错欢迎给个⭐Star⭐收藏一下这样作者才有继续免费下去的动力谢谢',
rewardUser: '打赏作者喝杯咖啡表示鼓励',
contactUs: '联系信息', contactUs: '联系信息',
donationSupport: '捐贈支持', donationSupport: '捐贈支持',
officialWebsite: '官网', officialWebsite: '官网',
@ -73,7 +74,17 @@ export default {
logOutConfirm: '你確定要退出当前登录吗?', logOutConfirm: '你確定要退出当前登录吗?',
large: '较大', large: '较大',
default: '默认', default: '默认',
small: '较小' small: '较小',
myWorkbench: '我的工作台',
onlineUsers: '在线用户',
message: '消息',
amount: '金额',
order: '订单',
modifyInformation: '修改信息',
technicalSelection: '技术选型',
frontendTechnology: '前端技术',
backendTechnology: '后端技术',
BackstageManagement: '后台管理',
}, },
common: { common: {
ok: '确定', ok: '确定',
@ -84,7 +95,11 @@ export default {
traditionalChinese: '繁体', traditionalChinese: '繁体',
name: '名称', name: '名称',
content: '内容', content: '内容',
addTime: '添加时间' addTime: '添加时间',
nickName: '昵称',
time: '时间',
yes: '是',
no: '否',
}, },
btn: { btn: {
add: '新增', add: '新增',

View File

@ -73,7 +73,17 @@ export default {
logOutConfirm: '你確定要退出当前登录吗?', logOutConfirm: '你確定要退出当前登录吗?',
large: '較大', large: '較大',
default: '默認', default: '默認',
small: '較小' small: '較小',
myWorkbench: '我的工作台',
onlineUsers: '在線用戶',
message: '消息',
amount: '金額',
order: '訂單',
modifyInformation: '修改信息',
technicalSelection: '技術選型',
frontendTechnology: '前端技術',
backendTechnology: '後端技術',
BackstageManagement: '後台管理',
}, },
common: { common: {
ok: '確定', ok: '確定',
@ -84,7 +94,11 @@ export default {
traditionalChinese: '繁體', traditionalChinese: '繁體',
name: '名稱', name: '名稱',
content: '內容', content: '內容',
addTime: '添加時間' addTime: '添加時間',
nickName: '暱稱',
time: '時間',
yes: '是',
no: '否',
}, },
btn: { btn: {
add: '新增', add: '新增',

22
src/i18n/pages/menu/en.js Normal file
View File

@ -0,0 +1,22 @@
export default {
m: {
menuName: 'menuName',
menuState: 'menuState',
icon: 'icon',
menuid: 'menuid',
menuType: 'menuType',
sort: 'sort',
authorityID: 'authorityID',
componentPath: 'componentPath',
isShow: 'isShow',
parentMenu: 'parentMenu',
directory: 'directory',
menu: 'menu',
button: 'button',
link: 'link',
isFrame: 'isFrame',
routePath: 'routePath',
permissionStr: 'permission',
isCache: 'isCache',
}
}

View File

@ -0,0 +1,22 @@
export default {
m: {
menuName: '菜单名称',
menuState: '菜单状态',
icon: '图标',
menuid: '菜单id',
menuType: '菜单类型',
sort: '排序',
authorityID: '权限标识',
componentPath: '组件路径',
isShow: '是否显示',
parentMenu: '上级菜单',
directory: '目录',
menu: '菜单',
button: '按钮',
link: '链接',
isFrame: '是否外链',
routePath: '路由地址',
permissionStr: '权限字符',
isCache: '是否缓存',
}
}

View File

@ -0,0 +1,22 @@
export default {
m: {
menuName: '菜單名稱',
menuState: '菜單狀態',
icon: '圖標',
menuid: '菜單id',
menuType: '菜單類型',
sort: '排序',
authorityID: '權限標識',
componentPath: '組件路徑',
isShow: '是否顯示',
parentMenu: '上級菜單',
directory: '目錄',
menu: '菜單',
button: '按鈕',
link: '鏈接',
isFrame: '是否外鏈',
routePath: '路由地址',
permissionStr: '權限字符',
isCache: '是否緩存',
}
}

View File

@ -6,7 +6,7 @@
<svg-icon name="peoples" class-name="card-panel-icon" /> <svg-icon name="peoples" class-name="card-panel-icon" />
</div> </div>
<div class="card-panel-description"> <div class="card-panel-description">
<div class="card-panel-text" v-waves>在线用户</div> <div class="card-panel-text" v-waves>{{$t('layout.onlineUsers')}}</div>
<div id="onlineNum" class="card-panel-num">{{ state.onlineUserNum }}</div> <div id="onlineNum" class="card-panel-num">{{ state.onlineUserNum }}</div>
</div> </div>
</div> </div>
@ -17,7 +17,7 @@
<svg-icon name="message" class-name="card-panel-icon" /> <svg-icon name="message" class-name="card-panel-icon" />
</div> </div>
<div class="card-panel-description"> <div class="card-panel-description">
<div class="card-panel-text" v-waves>消息</div> <div class="card-panel-text" v-waves>{{$t('layout.message')}}</div>
<div class="card-panel-num" id="messageNum">{{ state.chatNum }}</div> <div class="card-panel-num" id="messageNum">{{ state.chatNum }}</div>
</div> </div>
</div> </div>
@ -28,7 +28,7 @@
<svg-icon name="money" class-name="card-panel-icon" /> <svg-icon name="money" class-name="card-panel-icon" />
</div> </div>
<div class="card-panel-description"> <div class="card-panel-description">
<div class="card-panel-text" v-waves>金额</div> <div class="card-panel-text" v-waves>{{$t('layout.amount')}}</div>
<div id="amount" class="card-panel-num">{{ state.amount }}</div> <div id="amount" class="card-panel-num">{{ state.amount }}</div>
</div> </div>
</div> </div>
@ -39,7 +39,7 @@
<svg-icon name="shopping" class-name="card-panel-icon" /> <svg-icon name="shopping" class-name="card-panel-icon" />
</div> </div>
<div class="card-panel-description"> <div class="card-panel-description">
<div class="card-panel-text" v-waves>订单</div> <div class="card-panel-text" v-waves>{{$t('layout.order')}}</div>
<div id="order" class="card-panel-num">{{ state.order }}</div> <div id="order" class="card-panel-num">{{ state.order }}</div>
</div> </div>
</div> </div>

View File

@ -34,7 +34,7 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :lg="16" :sm="24"> <el-col :lg="16" :sm="24">
<h2>ZRAdmin.NET后台管理框架</h2> <h2>ZRAdmin.NET {{ $t('layout.BackstageManagement') }}</h2>
<p> <p>
ZRAdmin.NET借鉴了很多开源项目的优点让你开发Web管理系统更简单所以我也把它给开源了前端 ZRAdmin.NET借鉴了很多开源项目的优点让你开发Web管理系统更简单所以我也把它给开源了前端
<code>vue页面</code>主要参考若依在此表示感谢.) <code>vue页面</code>主要参考若依在此表示感谢.)
@ -53,9 +53,7 @@
</el-link> </el-link>
</p> </p>
<p> <p>
<el-button type="primary" size="small" icon="Cloudy" plain @click="goTarget('https://gitee.com/izory/ZrAdminNetCore')" <el-button type="primary" size="small" icon="Cloudy" plain @click="goTarget('https://gitee.com/izory/ZrAdminNetCore')">Gitee </el-button>
>访问码云
</el-button>
<el-button type="primary" size="small" icon="Cloudy" plain @click="goTarget('https://github.com/izhaorui/ZrAdmin.NET')" <el-button type="primary" size="small" icon="Cloudy" plain @click="goTarget('https://github.com/izhaorui/ZrAdmin.NET')"
>Github >Github
</el-button> </el-button>
@ -64,9 +62,9 @@
<h3>{{ $t('layout.tip1') }}</h3> <h3>{{ $t('layout.tip1') }}</h3>
</el-col> </el-col>
<el-col :lg="8" :sm="24"> <el-col :lg="8" :sm="24">
<h2>技术选型</h2> <h2>{{ $t('layout.technicalSelection') }}</h2>
<el-col :span="10"> <el-col :span="10">
<h4>后端技术</h4> <h4>{{ $t('layout.backendTechnology') }}</h4>
<ul> <ul>
<li>NET6</li> <li>NET6</li>
<li>JWT</li> <li>JWT</li>
@ -81,7 +79,7 @@
</ul> </ul>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<h4>前端技术</h4> <h4>{{ $t('layout.frontendTechnology') }}</h4>
<ul> <ul>
<li>Vue3</li> <li>Vue3</li>
<li>Vuex</li> <li>Vuex</li>
@ -106,7 +104,7 @@
</template> </template>
<div class="body"> <div class="body">
<div style="color: red">打赏作者喝杯咖啡表示鼓励</div> <div style="color: red">{{ $t('layout.rewardUser') }}</div>
<img src="@/assets/images/reward.jpg" alt="donate" style="width: 100%" /> <img src="@/assets/images/reward.jpg" alt="donate" style="width: 100%" />
</div> </div>
</el-card> </el-card>
@ -122,7 +120,7 @@
<el-link href="http://www.izhaorui.cn/doc" target="_blank"> http://www.izhaorui.cn/doc </el-link> <el-link href="http://www.izhaorui.cn/doc" target="_blank"> http://www.izhaorui.cn/doc </el-link>
</p> </p>
<p> <p>
<el-icon> <UserFilled /> </el-icon>QQ群 <el-icon> <UserFilled /> </el-icon>{{ $t('layout.qqGroup') }}
<el-link <el-link
target="_black" target="_black"
href="https://qm.qq.com/cgi-bin/qm/qr?k=Y__-fTGo_K2UIo3nWz7QnvS8LoRfPWKm&authKey=/ldXxiuolv80PF4yC8VtLk/TvAYbIhm2LKP8YVHCxAk+x2I+iqPAM1H/IsxQ+0gC&noverify=0"> href="https://qm.qq.com/cgi-bin/qm/qr?k=Y__-fTGo_K2UIo3nWz7QnvS8LoRfPWKm&authKey=/ldXxiuolv80PF4yC8VtLk/TvAYbIhm2LKP8YVHCxAk+x2I+iqPAM1H/IsxQ+0gC&noverify=0">

View File

@ -5,7 +5,7 @@
<el-col :md="24" :lg="16" :xl="16" class="mb10"> <el-col :md="24" :lg="16" :xl="16" class="mb10">
<el-card shadow="hover"> <el-card shadow="hover">
<template #header> <template #header>
<span>我的工作台</span> <span>{{$t('layout.myWorkbench')}}</span>
</template> </template>
<div class="user-item"> <div class="user-item">
<div class="user-item-left"> <div class="user-item-left">
@ -20,7 +20,7 @@
<el-col :xs="24" :sm="24" :md="24"> <el-col :xs="24" :sm="24" :md="24">
<el-row> <el-row>
<el-col :xs="24" :lg="8" class="right-l-v"> <el-col :xs="24" :lg="8" class="right-l-v">
<div class="right-label">昵称</div> <div class="right-label">{{$t('common.nickName')}}</div>
<div class="right-value">{{ userInfo.nickName }}</div> <div class="right-value">{{ userInfo.nickName }}</div>
</el-col> </el-col>
<el-col :xs="24" :lg="16" class="right-l-v"> <el-col :xs="24" :lg="16" class="right-l-v">
@ -42,7 +42,7 @@
</div> </div>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="16" class="right-l-v"> <el-col :xs="24" :sm="12" :md="16" class="right-l-v">
<div class="right-label one-text-overflow">时间</div> <div class="right-label one-text-overflow">{{$t('common.time')}}</div>
<div class="right-value one-text-overflow"> <div class="right-value one-text-overflow">
{{ currentTime }} {{ currentTime }}
</div> </div>
@ -51,7 +51,7 @@
</el-col> </el-col>
<el-col :lg="24" class="mt10"> <el-col :lg="24" class="mt10">
<el-button size="small" icon="edit"> <el-button size="small" icon="edit">
<router-link to="/user/profile">修改信息</router-link> <router-link to="/user/profile">{{$t('layout.modifyInformation')}}</router-link>
</el-button> </el-button>
<!-- <el-button size="small" icon="el-icon-position" type="primary">发布活动</el-button> --> <!-- <el-button size="small" icon="el-icon-position" type="primary">发布活动</el-button> -->
</el-col> </el-col>
@ -64,8 +64,8 @@
<el-card shadow="hover"> <el-card shadow="hover">
<template #header> <template #header>
<div> <div>
<span>在线用户</span> <span>{{$t('layout.onlineUsers')}}</span>
<el-button class="home-card-more" text @click="onOpenGitee">更多</el-button> <el-button class="home-card-more" text @click="onOpenGitee">{{$t('btn.more')}}</el-button>
</div> </div>
</template> </template>
<div class="info"> <div class="info">
@ -75,6 +75,7 @@
<ul class="info-ul"> <ul class="info-ul">
<li v-for="(v, k) in onlineUsers" :key="k" class="info-item"> <li v-for="(v, k) in onlineUsers" :key="k" class="info-item">
<div class="info-item-left" v-text="v.name"></div> <div class="info-item-left" v-text="v.name"></div>
<div>{{v.userIP}}</div>
<div class="info-item-right" v-text="dayjs(v.loginTime).format('HH:mm:ss')"></div> <div class="info-item-right" v-text="dayjs(v.loginTime).format('HH:mm:ss')"></div>
</li> </li>
</ul></div </ul></div
@ -165,7 +166,6 @@ function onOpenGitee() {}
<style lang="scss" scoped> <style lang="scss" scoped>
.home { .home {
width: 97%;
overflow: hidden; overflow: hidden;
.home-card-more { .home-card-more {
float: right; float: right;
@ -198,7 +198,7 @@ function onOpenGitee() {}
display: flex; display: flex;
.right-label { .right-label {
color: gray; color: gray;
width: 40px; width: 75px;
} }
.right-value { .right-value {
flex: 1; flex: 1;

View File

@ -1,10 +1,10 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"> <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
<el-form-item label="菜单名称" prop="menuName"> <el-form-item :label="$t('m.menuName')" prop="menuName">
<el-input v-model="queryParams.menuName" placeholder="请输入菜单名称" clearable @keyup.enter="handleQuery" /> <el-input v-model="queryParams.menuName" placeholder="请输入菜单名称" clearable @keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item :label="$t('m.menuState')" prop="status">
<el-select v-model="queryParams.status" placeholder="菜单状态" clearable> <el-select v-model="queryParams.status" placeholder="菜单状态" clearable>
<el-option v-for="dict in sys_normal_disable" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" /> <el-option v-for="dict in sys_normal_disable" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
</el-select> </el-select>
@ -33,23 +33,23 @@
:default-expand-all="isExpandAll" :default-expand-all="isExpandAll"
border border
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
<el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column> <el-table-column prop="menuName" :label="$t('m.menuName')" :show-overflow-tooltip="true" width="160"></el-table-column>
<el-table-column prop="icon" label="图标" align="center" width="60"> <el-table-column prop="icon" :label="$t('m.icon')" align="center" width="60">
<template #default="scope"> <template #default="scope">
<svg-icon :name="scope.row.icon" /> <svg-icon :name="scope.row.icon" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="menuId" label="菜单id" :show-overflow-tooltip="true" width="80" align="center"></el-table-column> <el-table-column prop="menuId" :label="$t('m.menuid')" :show-overflow-tooltip="true" width="80" align="center"></el-table-column>
<el-table-column prop="menuType" label="类型" align="center" width="80"> <el-table-column prop="menuType" :label="$t('m.menuType')" align="center" width="80">
<template #default="scope"> <template #default="scope">
<el-tag type="danger" v-if="scope.row.menuType == 'M' && scope.row.isFrame == 1">链接</el-tag> <el-tag type="danger" v-if="scope.row.menuType == 'M' && scope.row.isFrame == 1">{{ $t('m.link') }}</el-tag>
<el-tag v-else-if="scope.row.menuType == 'C'">菜单</el-tag> <el-tag v-else-if="scope.row.menuType == 'C'">{{ $t('m.menu') }}</el-tag>
<el-tag type="success" v-else-if="scope.row.menuType == 'M'">目录</el-tag> <el-tag type="success" v-else-if="scope.row.menuType == 'M'">{{ $t('m.directory') }}</el-tag>
<el-tag type="warning" v-else-if="scope.row.menuType == 'F'">按钮</el-tag> <el-tag type="warning" v-else-if="scope.row.menuType == 'F'">{{ $t('m.button') }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="orderNum" label="排序" width="60" align="center"></el-table-column> --> <!-- <el-table-column prop="orderNum" label="排序" width="60" align="center"></el-table-column> -->
<el-table-column prop="orderNum" label="排序" width="90" sortable align="center"> <el-table-column prop="orderNum" :label="$t('m.sort')" width="90" sortable align="center">
<template #default="scope"> <template #default="scope">
<span v-show="editIndex != scope.$index" @click="editCurrRow(scope.$index)">{{ scope.row.orderNum }}</span> <span v-show="editIndex != scope.$index" @click="editCurrRow(scope.$index)">{{ scope.row.orderNum }}</span>
<el-input <el-input
@ -59,24 +59,24 @@
@blur="handleChangeSort(scope.row)"></el-input> @blur="handleChangeSort(scope.row)"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="perms" label="权限标识" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="perms" :label="$t('m.authorityID')" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="component" :label="$t('m.componentPath')" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="visible" label="显示" width="70" align="center"> <el-table-column prop="visible" :label="$t('m.isShow')" width="70" align="center">
<template #default="scope"> <template #default="scope">
<dict-tag :options="sys_show_hide" :value="scope.row.visible" /> <dict-tag :options="sys_show_hide" :value="scope.row.visible" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="status" label="状态" width="80" align="center"> <el-table-column prop="status" :label="$t('m.menuState')" width="80" align="center">
<template #default="scope"> <template #default="scope">
<dict-tag :options="sys_normal_disable" :value="scope.row.status" /> <dict-tag :options="sys_normal_disable" :value="scope.row.status" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime"> <el-table-column :label="$t('common.addTime')" align="center" prop="createTime">
<template #default="scope"> <template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="170" class-name="small-padding fixed-width"> <el-table-column :label="$t('btn.operate')" align="center" width="170" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<el-button text size="small" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:menu:edit']"></el-button> <el-button text size="small" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:menu:edit']"></el-button>
<el-button text size="small" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['system:menu:add']"></el-button> <el-button text size="small" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['system:menu:add']"></el-button>
@ -90,7 +90,7 @@
<el-form ref="menuRef" :model="form" :rules="rules" label-width="100px"> <el-form ref="menuRef" :model="form" :rules="rules" label-width="100px">
<el-row> <el-row>
<el-col :lg="24"> <el-col :lg="24">
<el-form-item label="上级菜单"> <el-form-item :label="$t('m.parentMenu')">
<el-cascader <el-cascader
class="w100" class="w100"
:options="menuOptions" :options="menuOptions"
@ -106,16 +106,16 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :lg="24"> <el-col :lg="24">
<el-form-item label="菜单类型" prop="menuType"> <el-form-item :label="$t('m.menuType')" prop="menuType">
<el-radio-group v-model="form.menuType"> <el-radio-group v-model="form.menuType">
<el-radio label="M">目录</el-radio> <el-radio label="M">{{ $t('m.directory') }}</el-radio>
<el-radio label="C">菜单</el-radio> <el-radio label="C">{{ $t('m.menu') }}</el-radio>
<el-radio label="F">按钮</el-radio> <el-radio label="F">{{ $t('m.button') }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :lg="12"> <el-col :lg="12">
<el-form-item label="菜单名称" prop="menuName"> <el-form-item :label="$t('m.menuName')" prop="menuName">
<el-input v-model="form.menuName" placeholder="请输入菜单名称" /> <el-input v-model="form.menuName" placeholder="请输入菜单名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -127,18 +127,18 @@
<questionFilled /> <questionFilled />
</el-icon> </el-icon>
</el-tooltip> </el-tooltip>
多语言key {{ $t('languageKey') }}
</template> </template>
<el-input v-model="form.menuNameKey" placeholder="请输入多语言菜单key" /> <el-input v-model="form.menuNameKey" placeholder="请输入多语言菜单key" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :lg="12"> <el-col :lg="12">
<el-form-item label="显示排序" prop="orderNum"> <el-form-item :label="$t('m.sort')" prop="orderNum">
<el-input-number v-model="form.orderNum" controls-position="right" :min="0" /> <el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :lg="24" v-if="form.menuType != 'F'"> <el-col :lg="24" v-if="form.menuType != 'F'">
<el-form-item label="菜单图标" prop="icon"> <el-form-item :label="$t('m.icon')" prop="icon">
<el-popover placement="bottom-start" :width="540" v-model:visible="showChooseIcon" trigger="click" @show="showSelectIcon"> <el-popover placement="bottom-start" :width="540" v-model:visible="showChooseIcon" trigger="click" @show="showSelectIcon">
<template #reference> <template #reference>
<el-input v-model="form.icon" placeholder="点击选择图标" @click="showSelectIcon" readonly> <el-input v-model="form.icon" placeholder="点击选择图标" @click="showSelectIcon" readonly>
@ -162,11 +162,11 @@
<questionFilled /> <questionFilled />
</el-icon> </el-icon>
</el-tooltip> </el-tooltip>
是否外链 {{ $t('m.isFrame') }}
</template> </template>
<el-radio-group v-model="form.isFrame"> <el-radio-group v-model="form.isFrame">
<el-radio label="1"></el-radio> <el-radio label="1">{{ $t('common.yes') }}</el-radio>
<el-radio label="0"></el-radio> <el-radio label="0">{{ $t('common.no') }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -178,7 +178,7 @@
<questionFilled /> <questionFilled />
</el-icon> </el-icon>
</el-tooltip> </el-tooltip>
路由地址 {{ $t('m.routePath') }}
</template> </template>
<el-input v-model="form.path" placeholder="请输入路由地址" /> <el-input v-model="form.path" placeholder="请输入路由地址" />
</el-form-item> </el-form-item>
@ -191,7 +191,7 @@
<questionFilled /> <questionFilled />
</el-icon> </el-icon>
</el-tooltip> </el-tooltip>
组件路径 {{ $t('m.componentPath') }}
</template> </template>
<el-input v-model="form.component" placeholder="请输入组件路径" /> <el-input v-model="form.component" placeholder="请输入组件路径" />
</el-form-item> </el-form-item>
@ -205,7 +205,7 @@
<questionFilled /> <questionFilled />
</el-icon> </el-icon>
</el-tooltip> </el-tooltip>
权限字符 {{ $t('m.permissionStr') }}
</template> </template>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -230,11 +230,11 @@
<questionFilled /> <questionFilled />
</el-icon> </el-icon>
</el-tooltip> </el-tooltip>
是否缓存 {{ $t('m.isCache') }}
</template> </template>
<el-radio-group v-model="form.isCache"> <el-radio-group v-model="form.isCache">
<el-radio label="0">缓存</el-radio> <el-radio label="0">{{ $t('common.yes') }}</el-radio>
<el-radio label="1">不缓存</el-radio> <el-radio label="1">{{ $t('common.no') }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -246,7 +246,7 @@
<questionFilled /> <questionFilled />
</el-icon> </el-icon>
</el-tooltip> </el-tooltip>
显示状态 {{ $t('m.isShow') }}
</template> </template>
<el-radio-group v-model="form.visible"> <el-radio-group v-model="form.visible">
<el-radio v-for="dict in sys_show_hide" :key="dict.dictValue" :label="dict.dictValue">{{ dict.dictLabel }}</el-radio> <el-radio v-for="dict in sys_show_hide" :key="dict.dictValue" :label="dict.dictValue">{{ dict.dictLabel }}</el-radio>
@ -261,7 +261,7 @@
<questionFilled /> <questionFilled />
</el-icon> </el-icon>
</el-tooltip> </el-tooltip>
菜单状态 {{ $t('m.menuState') }}
</template> </template>
<el-radio-group v-model="form.status"> <el-radio-group v-model="form.status">
<el-radio v-for="dict in sys_normal_disable" :key="dict.dictValue" :label="dict.dictValue">{{ dict.dictLabel }}</el-radio> <el-radio v-for="dict in sys_normal_disable" :key="dict.dictValue" :label="dict.dictValue">{{ dict.dictLabel }}</el-radio>
@ -393,7 +393,7 @@ function handleAdd(row) {
form.value.parentId = 0 form.value.parentId = 0
} }
open.value = true open.value = true
title.value = '添加菜单' title.value = proxy.$t('btn.add')
} }
/** 展开/折叠操作 */ /** 展开/折叠操作 */
function toggleExpandAll() { function toggleExpandAll() {
@ -410,7 +410,7 @@ async function handleUpdate(row) {
getMenu(row.menuId).then((response) => { getMenu(row.menuId).then((response) => {
form.value = response.data form.value = response.data
open.value = true open.value = true
title.value = '修改菜单' title.value = proxy.$t('btn.edit')
}) })
} }
/** 提交按钮 */ /** 提交按钮 */