fix: 菜单功能国际化
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<!-- @author zhengjie -->
|
||||
<template>
|
||||
<div class="icon-body">
|
||||
<el-input v-model="name" style="position: relative;" clearable placeholder="请输入图标名称" @clear="filterIcons" @input.native="filterIcons">
|
||||
<el-input v-model="name" style="position: relative;" clearable :placeholder="$t('common.Tip15')" @clear="filterIcons" @input.native="filterIcons">
|
||||
<i slot="suffix" class="el-icon-search el-input__icon" />
|
||||
</el-input>
|
||||
<div class="icon-list">
|
||||
@@ -43,26 +43,26 @@ export default {
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.icon-body {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
.icon-list {
|
||||
height: 200px;
|
||||
overflow-y: scroll;
|
||||
div {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
margin-bottom: -5px;
|
||||
cursor: pointer;
|
||||
width: 33%;
|
||||
float: left;
|
||||
}
|
||||
span {
|
||||
display: inline-block;
|
||||
vertical-align: -0.15em;
|
||||
fill: currentColor;
|
||||
overflow: hidden;
|
||||
}
|
||||
.icon-body {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
.icon-list {
|
||||
height: 200px;
|
||||
overflow-y: scroll;
|
||||
div {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
margin-bottom: -5px;
|
||||
cursor: pointer;
|
||||
width: 33%;
|
||||
float: left;
|
||||
}
|
||||
span {
|
||||
display: inline-block;
|
||||
vertical-align: -0.15em;
|
||||
fill: currentColor;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -79,6 +79,7 @@ export default {
|
||||
'Tip12': '6 to 20 characters in length',
|
||||
'Tip13': 'Are you sure to log out and exit the system?',
|
||||
'Tip14': 'WebSocket connection error',
|
||||
'Tip15': 'Please enter an icon name',
|
||||
'loading': 'loading...'
|
||||
},
|
||||
'WorkOrder': {
|
||||
|
||||
@@ -79,6 +79,7 @@ export default {
|
||||
'Tip12': 'Antara 6 dan 20 karakter dalam panjang',
|
||||
'Tip13': 'Apakah Anda yakin untuk log keluar dan keluar dari sistem?',
|
||||
'Tip14': 'Koneksi WebSocket error',
|
||||
'Tip15': 'Silakan masukkan nama ikon',
|
||||
'loading': 'Memuatkan Data...'
|
||||
},
|
||||
'WorkOrder': {
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
export default {
|
||||
'menu': {
|
||||
'title': 'Menu',
|
||||
'placeholder': {
|
||||
'fuzzy_search': 'fuzzy search',
|
||||
'owning_system': 'system'
|
||||
'owning_system': 'system',
|
||||
'choose_icon': 'choose icon',
|
||||
'component_tip': 'match the Name field within the component',
|
||||
'choose_superior_category': 'choose superior category'
|
||||
},
|
||||
'table_title': {
|
||||
'menu_title': 'title',
|
||||
@@ -16,6 +20,27 @@ export default {
|
||||
'visible': 'visible',
|
||||
'create_time': 'create time'
|
||||
},
|
||||
'dialog': {
|
||||
'menu_type': 'Menu Type',
|
||||
'system': 'System',
|
||||
'catalogue': 'Catalogue',
|
||||
'menu': 'Menu',
|
||||
'button': 'Button',
|
||||
'button_name': 'Button Name',
|
||||
'menu_icon': 'Menu Icon',
|
||||
'menu_chain': 'Menu Chain',
|
||||
'menu_cache': 'Menu Cache',
|
||||
'menu_visible': 'Menu Visible',
|
||||
'default_title': 'Default Title',
|
||||
'zh_title': 'ZH-Title',
|
||||
'en_title': 'EN-Title',
|
||||
'id_title': 'ID-Title',
|
||||
'router_path': 'Router Path',
|
||||
'menu_sort': 'Menu Sort',
|
||||
'component_name': 'Component Name',
|
||||
'component_path': 'Component Path',
|
||||
'superior_class': 'Superior Class'
|
||||
},
|
||||
'msg': {
|
||||
'delete_msg': 'Are you sure to delete it? If there are subordinate nodes, they will be deleted together. This operation cannot be undone!'
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
export default {
|
||||
'menu': {
|
||||
'title': 'Menu',
|
||||
'placeholder': {
|
||||
'fuzzy_search': 'pencarian kabur',
|
||||
'owning_system': 'sistem terkait'
|
||||
'owning_system': 'sistem terkait',
|
||||
'choose_icon': 'Klik pada ikon pemilihan',
|
||||
'component_tip': 'Cocok medan Nama dalam komponen',
|
||||
'choose_superior_category': 'Pilih kategori superior'
|
||||
},
|
||||
'table_title': {
|
||||
'menu_title': 'title',
|
||||
@@ -16,6 +20,27 @@ export default {
|
||||
'visible': 'terlihat',
|
||||
'create_time': 'tarikh penciptaan'
|
||||
},
|
||||
'dialog': {
|
||||
'menu_type': 'Jenis Menu',
|
||||
'system': 'Sistem',
|
||||
'catalogue': 'Katalog',
|
||||
'menu': 'Menu',
|
||||
'button': 'Tombol',
|
||||
'button_name': 'Nama Tombol',
|
||||
'menu_icon': 'Ikon Menu',
|
||||
'menu_chain': 'Menu Link',
|
||||
'menu_cache': 'Cache Menu',
|
||||
'menu_visible': 'Menu Terlihat',
|
||||
'default_title': 'Tajuk Default',
|
||||
'zh_title': 'ZH-Title',
|
||||
'en_title': 'EN-Title',
|
||||
'id_title': 'ID-Title',
|
||||
'router_path': 'Alamat Perjalanan',
|
||||
'menu_sort': 'Pengurusan Menu',
|
||||
'component_name': 'Nama Komponen',
|
||||
'component_path': 'Laluan komponen',
|
||||
'superior_class': 'Kategori Tertinggi'
|
||||
},
|
||||
'msg': {
|
||||
'delete_msg': 'Apakah Anda yakin untuk menghapusnya? Jika ada nod subordinat, mereka akan dihapus bersama. Operasi ini tidak dapat dibatalkan!'
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
export default {
|
||||
'menu': {
|
||||
'title': '菜单',
|
||||
'placeholder': {
|
||||
'fuzzy_search': '模糊搜索',
|
||||
'owning_system': '所属系统'
|
||||
'owning_system': '所属系统',
|
||||
'choose_icon': '点击选择图标',
|
||||
'component_tip': '匹配组件内Name字段',
|
||||
'choose_superior_category': '选择上级类目'
|
||||
},
|
||||
'table_title': {
|
||||
'menu_title': '菜单标题',
|
||||
@@ -16,6 +20,27 @@ export default {
|
||||
'visible': '可见',
|
||||
'create_time': '创建日期'
|
||||
},
|
||||
'dialog': {
|
||||
'menu_type': '菜单类型',
|
||||
'system': '系统',
|
||||
'catalogue': '目录',
|
||||
'menu': '菜单',
|
||||
'button': '按钮',
|
||||
'button_name': '按钮名称',
|
||||
'menu_icon': '菜单图标',
|
||||
'menu_chain': '外链菜单',
|
||||
'menu_cache': '菜单缓存',
|
||||
'menu_visible': '菜单可见',
|
||||
'default_title': '默认标题',
|
||||
'zh_title': '中文标题',
|
||||
'en_title': '英文标题',
|
||||
'id_title': '印尼标题',
|
||||
'router_path': '路由地址',
|
||||
'menu_sort': '菜单排序',
|
||||
'component_name': '组件名称',
|
||||
'component_path': '组件路径',
|
||||
'superior_class': '上级类目'
|
||||
},
|
||||
'msg': {
|
||||
'delete_msg': '确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!'
|
||||
}
|
||||
|
||||
@@ -79,6 +79,7 @@ export default {
|
||||
'Tip12': '长度在 6 到 20 个字符',
|
||||
'Tip13': '确定注销并退出系统吗?',
|
||||
'Tip14': 'WebSocket连接发生错误',
|
||||
'Tip15': '请输入图标名称',
|
||||
'loading': '数据加载中...'
|
||||
},
|
||||
'WorkOrder': {
|
||||
|
||||
@@ -38,16 +38,16 @@
|
||||
:title="crud.status.title"
|
||||
width="650px"
|
||||
>
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="菜单类型" prop="type">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||
<el-form-item :label="$t('menu.dialog.menu_type')" prop="type">
|
||||
<el-radio-group v-model="form.type" size="mini">
|
||||
<el-radio-button label="1">系统</el-radio-button>
|
||||
<el-radio-button label="2">目录</el-radio-button>
|
||||
<el-radio-button label="3">菜单</el-radio-button>
|
||||
<el-radio-button label="4">按钮</el-radio-button>
|
||||
<el-radio-button label="1">{{ $t('menu.dialog.system') }}</el-radio-button>
|
||||
<el-radio-button label="2">{{ $t('menu.dialog.catalogue') }}</el-radio-button>
|
||||
<el-radio-button label="3">{{ $t('menu.dialog.menu') }}</el-radio-button>
|
||||
<el-radio-button label="4">{{ $t('menu.dialog.button') }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '1' && form.type.toString() !== '4' " label="菜单图标" prop="icon">
|
||||
<el-form-item v-show="form.type.toString() !== '1' && form.type.toString() !== '4' " :label="$t('menu.dialog.menu_icon')" prop="icon">
|
||||
<el-popover
|
||||
placement="bottom-start"
|
||||
width="450"
|
||||
@@ -55,7 +55,7 @@
|
||||
@show="$refs['iconSelect'].reset()"
|
||||
>
|
||||
<IconSelect ref="iconSelect" @selected="selected" />
|
||||
<el-input slot="reference" v-model="form.icon" style="width: 450px;" placeholder="点击选择图标" readonly>
|
||||
<el-input slot="reference" v-model="form.icon" style="width: 450px;" :placeholder="$t('menu.placeholder.choose_icon')" readonly>
|
||||
<svg-icon
|
||||
v-if="form.icon"
|
||||
slot="prefix"
|
||||
@@ -67,62 +67,62 @@
|
||||
</el-input>
|
||||
</el-popover>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '2' && form.type.toString() !== '1'" label="外链菜单" prop="iframe">
|
||||
<el-form-item v-show="form.type.toString() !== '2' && form.type.toString() !== '1'" :label="$t('menu.dialog.menu_chain')" prop="iframe">
|
||||
<el-radio-group v-model="form.iframe" size="mini">
|
||||
<el-radio-button label="true">是</el-radio-button>
|
||||
<el-radio-button label="false">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() === '2'" label="菜单缓存" prop="cache">
|
||||
<el-form-item v-show="form.type.toString() === '2'" :label="$t('menu.dialog.menu_cache')" prop="cache">
|
||||
<el-radio-group v-model="form.cache" size="mini">
|
||||
<el-radio-button label="true">是</el-radio-button>
|
||||
<el-radio-button label="false">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '2' && form.type.toString() !== '1' " label="菜单可见" prop="hidden">
|
||||
<el-form-item v-show="form.type.toString() !== '2' && form.type.toString() !== '1' " :label="$t('menu.dialog.menu_visible')" prop="hidden">
|
||||
<el-radio-group v-model="form.hidden" size="mini">
|
||||
<el-radio-button label="false">是</el-radio-button>
|
||||
<el-radio-button label="true">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '2'" label="默认标题" prop="title">
|
||||
<el-form-item v-if="form.type.toString() !== '2'" :label="$t('menu.dialog.default_title')" prop="title">
|
||||
<el-input
|
||||
v-model="form.title"
|
||||
:style=" form.type.toString() === '0' ? 'width: 450px' : 'width: 190px'"
|
||||
placeholder="默认标题"
|
||||
:placeholder="$t('menu.dialog.default_title')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '2'" label="中文标题" prop="zh_title">
|
||||
<el-form-item v-if="form.type.toString() !== '2'" :label="$t('menu.dialog.zh_title')" prop="zh_title">
|
||||
<el-input
|
||||
v-model="form.zh_title"
|
||||
:style=" form.type.toString() === '0' ? 'width: 450px' : 'width: 190px'"
|
||||
placeholder="中文标题"
|
||||
:placeholder="$t('menu.dialog.zh_title')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '2'" label="英文标题" prop="en_title">
|
||||
<el-form-item v-if="form.type.toString() !== '2'" :label="$t('menu.dialog.en_title')" prop="en_title">
|
||||
<el-input
|
||||
v-model="form.en_title"
|
||||
:style=" form.type.toString() === '0' ? 'width: 450px' : 'width: 190px'"
|
||||
placeholder="英文标题"
|
||||
:placeholder="$t('menu.dialog.en_title')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '2'" label="印尼标题" prop="in_title">
|
||||
<el-form-item v-if="form.type.toString() !== '2'" :label="$t('menu.dialog.id_title')" prop="in_title">
|
||||
<el-input
|
||||
v-model="form.in_title"
|
||||
:style=" form.type.toString() === '0' ? 'width: 450px' : 'width: 190px'"
|
||||
placeholder="印尼标题"
|
||||
:placeholder="$t('menu.dialog.id_title')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() === '2'" label="按钮名称" prop="title">
|
||||
<el-input v-model="form.title" placeholder="按钮名称" style="width: 190px;" />
|
||||
<el-form-item v-if="form.type.toString() === '2'" :label="$t('menu.dialog.button_name')" prop="title">
|
||||
<el-input v-model="form.title" :placeholder="$t('menu.dialog.button_name')" style="width: 190px;" />
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '1' " label="权限标识" prop="permission">
|
||||
<el-input v-model="form.permission" :disabled="form.iframe" placeholder="权限标识" style="width: 190px;" />
|
||||
<el-form-item v-show="form.type.toString() !== '1' " :label="$t('menu.table_title.permission_ident')" prop="permission">
|
||||
<el-input v-model="form.permission" :disabled="form.iframe" :placeholder="$t('menu.table_title.permission_ident')" style="width: 190px;" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '1' && form.type.toString() !== '2'" label="路由地址" prop="path">
|
||||
<el-input v-model="form.path" placeholder="路由地址" style="width: 190px;" />
|
||||
<el-form-item v-if="form.type.toString() !== '1' && form.type.toString() !== '2'" :label="$t('menu.dialog.router_path')" prop="path">
|
||||
<el-input v-model="form.path" :placeholder="$t('menu.dialog.router_path')" style="width: 190px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单排序" prop="menu_sort">
|
||||
<el-form-item :label="$t('menu.dialog.menu_sort')" prop="menu_sort">
|
||||
<el-input-number
|
||||
v-model.number="form.menu_sort"
|
||||
:min="0"
|
||||
@@ -131,13 +131,13 @@
|
||||
style="width: 190px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="!form.iframe && form.type.toString() === '3' " label="组件名称" prop="component_name">
|
||||
<el-input v-model="form.component_name" style="width: 190px;" placeholder="匹配组件内Name字段" />
|
||||
<el-form-item v-show="!form.iframe && form.type.toString() === '3' " :label="$t('menu.dialog.component_name')" prop="component_name">
|
||||
<el-input v-model="form.component_name" style="width: 190px;" :placeholder="$t('menu.placeholder.component_tip')" />
|
||||
</el-form-item>
|
||||
<el-form-item v-show="!form.iframe && (form.type.toString() === '2' ||form.type.toString() === '3' ) " label="组件路径" prop="component">
|
||||
<el-input v-model="form.component" style="width: 190px;" placeholder="组件路径" />
|
||||
<el-form-item v-show="!form.iframe && (form.type.toString() === '2' ||form.type.toString() === '3' ) " :label="$t('menu.dialog.component_path')" prop="component">
|
||||
<el-input v-model="form.component" style="width: 190px;" :placeholder="$t('menu.dialog.component_path')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="上级类目" prop="pid">
|
||||
<el-form-item :label="$t('menu.dialog.superior_class')" prop="pid">
|
||||
<!-- normalizer转换- loadMenus 点击扩展的时候会调用该方法-->
|
||||
<treeselect
|
||||
v-model="form.pid"
|
||||
@@ -145,13 +145,13 @@
|
||||
:load-options="loadMenus"
|
||||
:normalizer="normalizer"
|
||||
style="width: 450px;"
|
||||
placeholder="选择上级类目"
|
||||
:placeholder="$t('menu.placeholder.choose_superior_category')"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button type="text" @click="crud.cancelCU">{{ $t('common.Cancel') }}</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">{{ $t('common.Confirm') }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
@@ -190,20 +190,20 @@
|
||||
<el-table-column prop="component" :label="$t('menu.table_title.path')" min-width="120" />
|
||||
<el-table-column prop="iframe" :label="$t('menu.table_title.outside_chain')" :formatter="crud.formatIsOrNot" :min-width="flexWidth('iframe',crud.data,$t('menu.table_title.outside_chain'))">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.iframe">是</span>
|
||||
<span v-else>否</span>
|
||||
<span v-if="scope.row.iframe">YES</span>
|
||||
<span v-else>NO</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="cache" :label="$t('menu.table_title.cache')" :formatter="crud.formatIsOrNot" :min-width="flexWidth('cache',crud.data,$t('menu.table_title.cache'))">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.cache">是</span>
|
||||
<span v-else>否</span>
|
||||
<span v-if="scope.row.cache">YES</span>
|
||||
<span v-else>NO</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="hidden" :label="$t('menu.table_title.visible')" :formatter="crud.formatIsOrNot" :min-width="flexWidth('hidden',crud.data,$t('menu.table_title.visible'))">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.hidden">否</span>
|
||||
<span v-else>是</span>
|
||||
<span v-if="scope.row.hidden">NO</span>
|
||||
<span v-else>YES</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" :label="$t('menu.table_title.create_time')" :min-width="flexWidth('create_time',crud.data,$t('menu.table_title.create_time'))" />
|
||||
@@ -238,6 +238,7 @@ import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import Dict from '../../../components/Dict/Dict'
|
||||
import i18n from '@/i18n'
|
||||
|
||||
// crud交由presenter持有
|
||||
const defaultForm = {
|
||||
@@ -265,7 +266,7 @@ export default {
|
||||
name: 'Menu',
|
||||
components: { Treeselect, IconSelect, crudOperation, rrOperation, udOperation, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({ title: '菜单', idField: 'menu_id', url: 'api/sysMenu', crudMethod: { ...crudMenu }})
|
||||
return CRUD({ title: i18n.t('menu.title'), idField: 'menu_id', url: 'api/sysMenu', crudMethod: { ...crudMenu }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
dicts: ['system_type'],
|
||||
|
||||
Reference in New Issue
Block a user