---新增参数配置,字典配置国家化

This commit is contained in:
lai
2023-11-11 16:31:42 +08:00
parent cca9973b28
commit 7a93768fd0
8 changed files with 582 additions and 290 deletions

View File

@@ -404,6 +404,30 @@ export default {
neId: 'Internal identification',
neIdPlease: 'Please select the corresponding network element',
},
configParam:{
dataNull:'No configuration item data yet',
editSuss:'Modification successful',
editFail:'Edit failed',
Unable:'Illegal operation of attribute value',
delSure:'Confirm to delete the data item with Index [{value}]?',
addSuss:'Add successfully',
addFail:'Add failed',
delArraySure:'Confirm to delete the data item with {arrayChildTitle} Index as [{value}]?',
parUnable:'The parameter value is not within the reasonable range',
ipv4Tip:'Not a legal IPV4 address',
ipv6Tip:'Not a legal IPV6 address',
enumTip:'Not a reasonable enumeration value',
boolTip:'Not a reasonable Boolean value',
default:'The input value is of unknown type',
reloadSuss:'Network element reloading completed',
reloadFail:'Network element reloading failed',
neNUll:'No network element list data yet',
reload:'Reload',
post:'Submit',
editSure:'Are you sure you want to update this attribute value? ',
arraryEdit:'Are you sure to submit the record whose updated Index is [{value}]? ',
addSure:'Are you sure to submit the new record of Index: [{value}]? '
}
},
neUser: {
auth: {
@@ -1073,14 +1097,14 @@ export default {
email:'Mail',
},
post:{
positionInfo:'Position information',
positionId:'Position number',
positionCode:'Position code',
positionName:'Position name',
positionSort:'Position sorting',
positionStatus:'Position status',
positionMark:'Position description',
createTime:'Creation time',
positionInfo:' Position Information',
positionId:'Position Number',
positionCode:'Position Code',
positionName:'Position Name',
positionSort:'Position Sorting',
positionStatus:'Position Status',
positionMark:'Position Description',
createTime:'Creation Time',
codeTip:'Please enter the position code correctly',
nameTip:'Please enter the position name correctly',
delSure:'Confirm to delete the data item with post number [{postId}]?',
@@ -1126,8 +1150,57 @@ export default {
unlock:'Unlock',
unlockSuss:'{userName} unlocked successfully',
unlockSure:'Confirm to unlock user [{username}] data item?',
}
},
},
menu:{
menuInfo:' Menu Information',
menuName:'Menu Name',
menuId:'Menu Number',
menuSort:'Menu Sort',
menuTitle:'Menu Icon',
perId:'Permission ID',
formLoc:'Component Path',
status:'Display Status',
menuStatus:'Menu Status',
menuType:'Menu Type',
createTime:'Creation Time',
highMenu:'Superior Menu',
routerAdrr:'Routing Address',
delSure:'Confirm to delete the data item with menu number [{menuId}]?',
addSon:'Add Submenu',
hidden:'Hidden',
show:'Show',
root:'Directory',
menu:'Menu',
button:'Button',
yes:'Yes',
no:'No',
cache:'Cache',
noCache:'Not cache',
pageCache:'Page cache',
local:'Internal Address',
mark:'Menu Description',
pathTip:`The accessed routing address, such as: user, /auth 1. If the network address requires internal access, start with http(s):// Menu behavior (root node): The current window opens the menu behavior, (non-root node) :Embedded window. 2. If the network address requires external access, set the internal address option to No. Menu behavior: Open a new tab 3. If the embedded subpage needs to hide the page, set the display status option to Hide address splicing to embed routing. address`,
sonPage:'Subpage address',
componentTip:' The component path accessed by views in the page component directory, such as: system/user/index Note: The routing address without the .vue file suffix is the network address and can be filled in as a link',
perms:`Permission identification example: monitor:server:query Permission identification is used in the back-end controller, such as: @PreAuthorize({ hasPermissions: ['monitor:server:query'] }) Permission identification is used in the front-end Vue page, such as: v-perms:has="['monitor:server:query']"`
},
dict:{
dictInfo:'Dictionary Type Information',
dictId:'Dictionary Number',
dictName:'Dictionary Name',
dictType:'Dictionary Type',
dictSatus:'Dictionary Status',
createTime:'Creation Time',
realDictName:'Please enter the dictionary name correctly',
realDictType:'Please enter the dictionary type correctly',
delSure:'Confirm to delete the data item with parameter number [{dictId}]?',
reloadSure:'Are you sure you want to refresh the dictionary data cache?',
reloadSuss:'Refresh cache successfully',
dictData:'Dictionary Data',
reload:'Refresh Cache',
mark:'Dictionary Description',
}
},
mmlManage: {
operationtitle: "Interface Settings",

View File

@@ -404,6 +404,30 @@ export default {
neId: '网元内部标识',
neIdPlease: '请选择对应网元',
},
configParam:{
dataNull:'暂无配置项数据',
editSuss:'修改成功',
editFail:'修改失败',
unable:'非法操作属性值',
delSure:'确认删除Index为 【{value}】 的数据项?',
addSuss:'新增成功',
addFail:'新增失败',
delArraySure:'确认删除{arrayChildTitle} Index 为 【{value}】 的数据项?',
parUnable:'参数值不在合理范围',
ipv4Tip:'不是合法的IPV4地址',
ipv6Tip:'不是合法的IPV6地址',
enumTip:'不是合理的枚举值',
boolTip:'不是合理的布尔类型的值',
default:'输入值是未知类型',
reloadSuss:'网元重新加载完成',
reloadFail:'网元重新加载失败',
neNUll:'暂无网元列表数据',
reload:'重载',
post:'提交',
editSure:'确认更新该属性值吗?',
arraryEdit:'确认提交更新 Index 为 【{value}】 的记录吗?',
addSure:'确认提交新增 Index :【{value}】 的记录吗?'
}
},
neUser: {
auth: {
@@ -1126,8 +1150,57 @@ export default {
unlock:'解锁',
unlockSuss:'{userName} 解锁成功',
unlockSure:'确认解锁用户 【{username}】 数据项?',
}
},
},
menu:{
menuInfo:'菜单信息',
menuName:'菜单名称',
menuId:'菜单编号',
menuSort:'菜单排序',
menuTitle:'菜单图标',
perId:'权限标识',
formLoc:'组件路径',
status:'显示状态',
menuStatus:'菜单状态',
menuType:'菜单类型',
createTime:'创建时间',
highMenu:'上级菜单',
routerAdrr:'路由地址',
delSure:'确认删除菜单编号为 【{menuId}】 的数据项?',
addSon:'新增子菜单',
hidden:'隐藏',
show:'显示',
root:'目录',
menu:'菜单',
button:'按钮',
yes:'是',
no:'否',
cache:'缓存',
noCache:'不缓存',
pageCache:'页面缓存',
local:'内部地址',
mark:'菜单说明',
pathTip:`访问的路由地址,如:user、/auth 1. 如网络地址需内部访问 则以 http(s):// 开头菜单行为(根节点):当前窗口打开 菜单行为,(非根节点):内嵌窗口.2. 如网络地址需外部访问则将内部地址选项设为否菜单行为:打开新标签3. 如内嵌子页面需要隐藏页面则将显示状态选项设为隐藏地址拼接以内嵌路由地址`,
sonPage:'子页面地址',
componentTip:' 页面组件目录 views 访问的组件路径,如:system/user/index 注意:不带 .vue 文件后缀路由地址是网络地址可填入链接',
perms:`权限标识示例:monitor:server:query 后端控制器中使用权限标识,如:@PreAuthorize({ hasPermissions: ['monitor:server:query'] }) 前端vue页面中使用权限标识,如:v-perms:has="['monitor:server:query']"`
},
dict:{
dictInfo:'字典类型信息',
dictId:'字典编号',
dictName:'字典名称',
dictType:'字典类型',
dictSatus:'字典状态',
createTime:'创建时间',
realDictName:'请正确输入字典名称',
realDictType:'请正确输入字典类型',
delSure:'确认删除参数编号为 【{dictId}】 的数据项?',
reloadSure:'确定要刷新字典数据缓存吗?',
reloadSuss:'刷新缓存成功',
dictData:'字典数据',
reload:'刷新缓存',
mark:'字典说明',
}
},
mmlManage: {
cmdTitle: "命令导航",
@@ -1158,7 +1231,7 @@ export default {
ipadd: "侦听IP地址",
ipaddPlease: "请输入侦听IP地址",
port: "侦听端口",
portPlease: "请输入远程端口0~65535",
portPlease: "请输入远程端口,0~65535",
okChange: "接口设置保存成功",
noChange: "接口设置无变更",
},

View File

@@ -75,7 +75,7 @@ function fnTabActiveTopTag(key: string | number) {
}
} else {
message.warning({
content: `暂无配置项数据`,
content: t('views.configManage.configParam.dataNull'),
duration: 3,
});
}
@@ -94,7 +94,7 @@ function fnGetParamConfigTopTab() {
const neType = neTypeSelect.value[0];
if (!neType) {
message.warning({
content: `请选择网元类型`,
content: t('views.configManage.softwareManage.neTypePlease'),
duration: 3,
});
return;
@@ -110,7 +110,7 @@ function fnGetParamConfigTopTab() {
}
} else {
message.warning({
content: `暂无配置项数据`,
content: t('views.configManage.configParam.dataNull'),
duration: 3,
});
}
@@ -226,7 +226,9 @@ function listEditOk() {
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `${from['display']} 属性值修改成功`,
content:
`${from['display']} ` +
t('views.configManage.configParam.editSuss'),
duration: 3,
});
// 改变表格数据
@@ -238,7 +240,7 @@ function listEditOk() {
}
} else {
message.warning({
content: `属性值修改失败`,
content: t('views.configManage.configParam.editFail'),
duration: 3,
});
}
@@ -246,7 +248,7 @@ function listEditOk() {
.catch(err => {
console.error(err);
message.error({
content: `非法操作属性值`,
content: t('views.configManage.configParam.unable'),
duration: 3,
});
})
@@ -315,7 +317,9 @@ function arrayEditOk() {
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `Index 为 ${from['index']['value']} 记录修改成功`,
content:
`Index : ${from['index']['value']} ` +
t('views.configManage.configParam.editSuss'),
duration: 3,
});
// 改变表格数据
@@ -328,7 +332,7 @@ function arrayEditOk() {
}
} else {
message.warning({
content: `记录修改失败`,
content: t('views.configManage.configParam.editFail'),
duration: 3,
});
}
@@ -336,7 +340,7 @@ function arrayEditOk() {
.catch(err => {
console.error(err);
message.error({
content: `非法操作记录参数`,
content: t('views.configManage.configParam.unable'),
duration: 3,
});
})
@@ -354,7 +358,9 @@ function arrayDelete(row: Record<string, any>) {
Modal.confirm({
title: t('common.tipTitle'),
content: `确认删除Index为 【${from['index']['value']}】 的数据项?`,
content: t('views.configManage.configParam.delSure', {
value: from['index']['value'],
}),
onOk() {
const hide = message.loading({ content: t('common.loading') });
delParamConfigInfo({
@@ -366,7 +372,7 @@ function arrayDelete(row: Record<string, any>) {
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `删除成功`,
content: t('common.msgSuccess', { msg: t('common.deleteText') }),
duration: 2,
});
} else {
@@ -510,13 +516,15 @@ function arrayAddOk() {
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `Index 为 ${from['index']['value']} 记录新增成功`,
content:
`Index : ${from['index']['value']} ` +
t('views.configManage.configParam.addSuss'),
duration: 3,
});
} else {
tableState.arrayData.pop();
message.warning({
content: `新增失败`,
content: t('views.configManage.configParam.addFail'),
duration: 3,
});
}
@@ -524,7 +532,7 @@ function arrayAddOk() {
.catch(err => {
console.error(err);
message.error({
content: `非法操作记录参数`,
content: t('views.configManage.configParam.unable'),
duration: 3,
});
})
@@ -670,13 +678,15 @@ function arrayChildEditOk() {
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `Index 为 ${from['index']['value']} 记录修改成功`,
content:
`Index : ${from['index']['value']} ` +
t('views.configManage.configParam.editSuss'),
duration: 3,
});
fnTabActiveTopTag('#');
} else {
message.warning({
content: `记录修改失败`,
content: t('views.configManage.configParam.editFail'),
duration: 3,
});
}
@@ -684,7 +694,7 @@ function arrayChildEditOk() {
.catch(err => {
console.error(err);
message.error({
content: `非法操作记录参数`,
content: t('views.configManage.configParam.unable'),
duration: 3,
});
})
@@ -702,7 +712,10 @@ function arrayChildDelete(row: Record<string, any>) {
Modal.confirm({
title: t('common.tipTitle'),
content: `确认删除${tableState.arrayChildTitle} Index 为 【${from['index']['value']}】 的数据项?`,
content: t('views.configManage.configParam.unable', {
arrayChildTitle: tableState.arrayChildTitle,
value: from['index']['value'],
}),
onOk() {
const hide = message.loading({ content: t('common.loading') });
delParamConfigInfo({
@@ -714,7 +727,7 @@ function arrayChildDelete(row: Record<string, any>) {
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `删除成功`,
content: t('common.msgSuccess', { msg: t('common.deleteText') }),
duration: 2,
});
} else {
@@ -858,14 +871,16 @@ function arrayChildAddOk() {
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `Index 为 ${from['index']['value']} 记录新增成功`,
content:
`Index :${from['index']['value']} ` +
t('views.configManage.configParam.addSuss'),
duration: 3,
});
fnTabActiveTopTag('#');
} else {
tableState.arrayChildData.pop();
message.warning({
content: `新增失败`,
content: t('views.configManage.configParam.addFail'),
duration: 3,
});
}
@@ -873,7 +888,7 @@ function arrayChildAddOk() {
.catch(err => {
console.error(err);
message.error({
content: `非法操作记录参数`,
content: t('views.configManage.configParam.unable'),
duration: 3,
});
})
@@ -910,18 +925,29 @@ function ruleVerification(row: Record<string, any>): (string | boolean)[] {
const maxInt = parseInt(filterArr[1]);
const valueInt = parseInt(value);
if (valueInt < minInt || valueInt > maxInt) {
return [false, `${display} 参数值不在合理范围 ${filter}`];
return [
false,
`${display} ${t(
'views.configManage.configParam.parUnable'
)} ${filter}`,
];
}
}
break;
case 'ipv4':
if (!regExpIPv4.test(value)) {
return [false, `${display} 不是合法的IPV4地址`];
return [
false,
`${display} ${t('views.configManage.configParam.ipv4Tip')}`,
];
}
break;
case 'ipv6':
if (!regExpIPv6.test(value)) {
return [false, `${display} 不是合法的IPV6地址`];
return [
false,
`${display} ${t('views.configManage.configParam.ipv6Tip')}`,
];
}
break;
case 'enum':
@@ -934,7 +960,10 @@ function ruleVerification(row: Record<string, any>): (string | boolean)[] {
}
if (!Object.keys(filterJson).includes(`${value}`)) {
return [false, `${display} 不是合理的枚举值`];
return [
false,
`${display} ${t('views.configManage.configParam.enumTip')}`,
];
}
}
break;
@@ -948,7 +977,10 @@ function ruleVerification(row: Record<string, any>): (string | boolean)[] {
}
if (!Object.values(filterJson).includes(`${value}`)) {
return [false, `${display} 不是合理的布尔类型的值`];
return [
false,
`${display} ${t('views.configManage.configParam.boolTip')}`,
];
}
}
break;
@@ -960,7 +992,10 @@ function ruleVerification(row: Record<string, any>): (string | boolean)[] {
'^\\S{' + filterArr[0] + ',' + filterArr[1] + '}$'
);
if (!rule.test(value)) {
return [false, `${display} 参数值不合理`];
return [
false,
`${display} ${t('views.configManage.configParam.parUnable')}`,
];
}
} catch (error) {
console.error(error);
@@ -973,7 +1008,10 @@ function ruleVerification(row: Record<string, any>): (string | boolean)[] {
try {
let regex = new RegExp(filter);
if (!regex.test(value)) {
return [false, `${display} 参数值不合理`];
return [
false,
`${display} ${t('views.configManage.configParam.parUnable')}`,
];
}
} catch (error) {
console.error(error);
@@ -982,7 +1020,10 @@ function ruleVerification(row: Record<string, any>): (string | boolean)[] {
break;
default:
return [false, `${display} 输入值是未知类型`];
return [
false,
`${display} ${t('views.configManage.configParam.default')}`,
];
}
return result;
}
@@ -1000,12 +1041,12 @@ function fnNeReload() {
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `网元重新加载完成`,
content: t('views.configManage.configParam.reloadSuss'),
duration: 3,
});
} else {
message.error({
content: `网元重新加载失败`,
content: t('views.configManage.configParam.reloadFail'),
duration: 3,
});
}
@@ -1038,7 +1079,7 @@ onMounted(() => {
}
} else {
message.warning({
content: `暂无网元列表数据`,
content: t('views.configManage.configParam.neNUll'),
duration: 2,
});
}
@@ -1056,12 +1097,14 @@ onMounted(() => {
<a-form name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.traceManage.task.neType')" name="neTypeSelect">
<a-form-item
:label="t('views.traceManage.task.neType')"
name="neTypeSelect"
>
<a-cascader
v-model:value="neTypeSelect"
:options="neCascaderOtions"
:allow-clear="false"
placeholder="请选择网元"
@change="fnGetParamConfigTopTab"
/>
</a-form-item>
@@ -1089,7 +1132,6 @@ onMounted(() => {
<a-space :size="8" align="center" v-if="false">
<a-popconfirm
placement="topLeft"
title="网元配置重新载入"
:ok-text="t('common.ok')"
:cancel-text="t('common.cancel')"
:disabled="neReloadLoading"
@@ -1097,7 +1139,7 @@ onMounted(() => {
>
<a-button type="dashed" danger :loading="neReloadLoading">
<template #icon><SyncOutlined /></template>
重新载入
{{ t('views.configManage.configParam.reload') }}
</a-button>
</a-popconfirm>
</a-space>
@@ -1188,7 +1230,7 @@ onMounted(() => {
<a-space :size="16" align="center">
<a-popconfirm
title="确认更新该属性值吗?"
:title="t('views.configManage.configParam.editSure')"
placement="top"
@confirm="listEditOk()"
>
@@ -1253,14 +1295,18 @@ onMounted(() => {
"
>
<a-tooltip>
<template #title>提交</template>
<template #title>{{
t('views.configManage.configParam.post')
}}</template>
<a-popconfirm
v-if="
tableState.arrayNewIndex === text[column.key]?.value
"
:title="`确认提交新增 Index 为 【${
text[column.key]?.value
}】 的记录吗?`"
:title="
t('views.configManage.configParam.addSure', {
value: text[column.key]?.value,
})
"
placement="left"
@confirm="arrayAddOk()"
>
@@ -1268,9 +1314,11 @@ onMounted(() => {
</a-popconfirm>
<a-popconfirm
v-else
:title="`确认提交更新 Index 为 【${
text[column.key]?.value
}】 的记录吗?`"
:title="
t('views.configManage.configParam.arraryEdit', {
value: text[column.key]?.value,
})
"
placement="left"
@confirm="arrayEditOk()"
>
@@ -1280,7 +1328,7 @@ onMounted(() => {
</a-popconfirm>
</a-tooltip>
<a-tooltip>
<template #title>取消</template>
<template #title>{{ t('common.cancel') }}</template>
<a-button
type="text"
class="editable-cell__icon-edit"
@@ -1372,7 +1420,8 @@ onMounted(() => {
@click.prevent="arrayChildExpand(record['index'], text)"
v-else-if="Array.isArray(text.array)"
>
详情
{{ t('common.viewText') }}
</a-button>
<div v-else class="editable-cell__text-wrapper">
{{ `${text.value}` }}
@@ -1416,15 +1465,17 @@ onMounted(() => {
"
>
<a-tooltip>
<template #title>提交</template>
<template #title>{{t('views.configManage.configParam.post')}}</template>
<a-popconfirm
v-if="
tableState.arrayChildNewIndex ===
text[column.key]?.value
"
:title="`确认提交新增 Index 为 【${
text[column.key]?.value
}】 的记录吗?`"
:title="
t('views.configManage.configParam.addSure', {
value: text[column.key]?.value,
})
"
placement="left"
@confirm="arrayChildAddOk()"
>
@@ -1432,9 +1483,11 @@ onMounted(() => {
</a-popconfirm>
<a-popconfirm
v-else
:title="`确认提交更新 Index 为 【${
text[column.key]?.value
}】 的记录吗?`"
:title="
t('views.configManage.configParam.arraryEdit', {
value: text[column.key]?.value,
})
"
placement="left"
@confirm="arrayChildEditOk()"
>
@@ -1447,7 +1500,7 @@ onMounted(() => {
</a-popconfirm>
</a-tooltip>
<a-tooltip>
<template #title>取消</template>
<template #title> {{ t('common.cancel') }} </template>
<a-button
type="text"
class="editable-cell__icon-edit"
@@ -1556,7 +1609,7 @@ onMounted(() => {
"
v-else-if="Array.isArray(text.array)"
>
详情
{{ t('common.viewText') }}
</a-button>
<div v-else class="editable-cell__text-wrapper">
{{ `${text.value}` }}

View File

@@ -468,7 +468,7 @@ onBeforeUnmount(() => {
nfInfo.obj
}}</a-descriptions-item>
<template v-if="nfInfo.obj === 'OMC'">
<a-descriptions-item :label="t('views.index.veisonNum')">{{
<a-descriptions-item :label="t('views.index.versionNum')">{{
nfInfo.version
}}</a-descriptions-item>
<a-descriptions-item :label="t('views.index.systemStatus')">{{

View File

@@ -289,7 +289,7 @@ function fnModalVisibleByVive(imsi: string) {
t('common.viewText') + t('views.neUser.auth.authInfo');
modalState.visibleByView = true;
} else {
message.error(`获取鉴权信息失败`, 2);
message.error(t('common.getInfoFail'), 2);
}
})
.finally(() => {
@@ -320,7 +320,7 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
t('common.editText') + t('views.neUser.auth.authInfo');
modalState.visibleByEdit = true;
} else {
message.error(`获取鉴权信息失败`, 2);
message.error(t('common.getInfoFail'), 2);
}
})
.finally(() => {

View File

@@ -102,28 +102,28 @@ let tableState: TabeStateType = reactive({
/**表格字段列 */
let tableColumns: ColumnsType = [
{
title: '字典编号',
title: t('views.system.dict.dictId'),
dataIndex: 'dictId',
align: 'center',
},
{
title: '字典名称',
title: t('views.system.dict.dictName'),
dataIndex: 'dictName',
align: 'center',
},
{
title: '字典类型',
title: t('views.system.dict.dictType'),
dataIndex: 'dictType',
align: 'center',
},
{
title: '字典状态',
title: t('views.system.dict.dictSatus'),
dataIndex: 'status',
key: 'status',
align: 'center',
},
{
title: '创建时间',
title: t('views.system.dict.createTime'),
dataIndex: 'createTime',
align: 'center',
customRender(opt) {
@@ -132,7 +132,7 @@ let tableColumns: ColumnsType = [
},
},
{
title: '操作',
title: t('common.operate'),
key: 'dictId',
align: 'center',
},
@@ -156,7 +156,7 @@ let tablePagination = reactive({
showSizeChanger: true,
/**数据总数 */
total: 0,
showTotal: (total: number) => `总共 ${total}`,
showTotal: (total: number) => t('common.tablePaginationTotal', { total }),
onChange: (page: number, pageSize: number) => {
tablePagination.current = page;
tablePagination.pageSize = pageSize;
@@ -215,10 +215,20 @@ const modalStateFrom = Form.useForm(
modalState.from,
reactive({
dictName: [
{ required: true, min: 1, max: 50, message: '请正确输入字典名称' },
{
required: true,
min: 1,
max: 50,
message: t('views.system.dict.realDictName'),
},
],
dictType: [
{ required: true, min: 1, max: 50, message: '请正确输入字典类型' },
{
required: true,
min: 1,
max: 50,
message: t('views.system.dict.realDictType'),
},
],
})
);
@@ -229,7 +239,7 @@ const modalStateFrom = Form.useForm(
*/
function fnModalVisibleByVive(dictId: string | number) {
if (!dictId) {
message.error(`字典类型记录存在错误`, 2);
message.error(t('common.getInfoFail'), 2);
return;
}
if (modalState.confirmLoading) return;
@@ -240,10 +250,10 @@ function fnModalVisibleByVive(dictId: string | number) {
hide();
if (res.code === RESULT_CODE_SUCCESS && res.data) {
modalState.from = Object.assign(modalState.from, res.data);
modalState.title = '字典类型信息';
modalState.title = t('views.system.dict.dictInfo');
modalState.visibleByView = true;
} else {
message.error(`获取字典类型信息失败`, 2);
message.error(t('common.getInfoFail'), 2);
}
});
}
@@ -255,7 +265,7 @@ function fnModalVisibleByVive(dictId: string | number) {
function fnModalVisibleByEdit(dictId?: string | number) {
if (!dictId) {
modalStateFrom.resetFields();
modalState.title = '添加字典类型';
modalState.title = t('common.addText') + t('views.system.dict.dictType');
modalState.visibleByEdit = true;
} else {
if (modalState.confirmLoading) return;
@@ -266,10 +276,11 @@ function fnModalVisibleByEdit(dictId?: string | number) {
hide();
if (res.code === RESULT_CODE_SUCCESS && res.data) {
modalState.from = Object.assign(modalState.from, res.data);
modalState.title = '修改字典类型';
modalState.title =
t('common.editText') + t('views.system.dict.dictType');
modalState.visibleByEdit = true;
} else {
message.error(`获取字典类型信息失败`, 2);
message.error(t('common.getInfoFail'), 2);
}
});
}
@@ -292,7 +303,7 @@ function fnModalOk() {
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `${modalState.title}成功`,
content: t('common.msgSuccess', { msg: modalState.title }),
key,
duration: 2,
});
@@ -312,7 +323,7 @@ function fnModalOk() {
});
})
.catch(e => {
message.error(`请正确填写 ${e.errorFields.length} 处必填信息!`, 2);
message.error(t('common.errorFields', { num: e.errorFields.length }), 2);
});
}
@@ -336,14 +347,14 @@ function fnRecordDelete(dictId: string = '0') {
}
Modal.confirm({
title: t('common.tipTitle'),
content: `确认删除参数编号为 【${dictId}】 的数据项?`,
content: t('views.system.dict.dictType', { dictId }),
onOk() {
const key = 'delType';
message.loading({ content: t('common.loading'), key });
delType(dictId).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `删除成功`,
content: t('common.msgSuccess', { msg: t('common.deleteText') }),
key,
duration: 2,
});
@@ -364,14 +375,16 @@ function fnRecordDelete(dictId: string = '0') {
function fnExportList() {
Modal.confirm({
title: t('common.tipTitle'),
content: `确认根据搜索条件导出xlsx表格文件吗?`,
content: t('views.system.user.exportSure'),
onOk() {
const key = 'exportType';
message.loading({ content: t('common.loading'), key });
exportType(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `已完成导出`,
content: t('common.msgSuccess', {
msg: t('views.system.user.export'),
}),
key,
duration: 2,
});
@@ -394,14 +407,14 @@ function fnExportList() {
function fnRefreshCache() {
Modal.confirm({
title: t('common.tipTitle'),
content: `确定要刷新字典数据缓存吗?`,
content: t('views.system.dict.reloadSure'),
onOk() {
const key = 'refreshCache';
message.loading({ content: t('common.loading'), key });
refreshCache().then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `刷新缓存成功`,
content: t('views.system.dict.reloadSuss'),
key,
duration: 2,
});
@@ -426,7 +439,7 @@ function fnDataView(dictId: string | number = '0') {
function fnGetList(pageNum?: number) {
if (tableState.loading) return;
tableState.loading = true;
if(pageNum){
if (pageNum) {
queryParams.pageNum = pageNum;
}
if (!queryRangePicker.value) {
@@ -470,42 +483,50 @@ onMounted(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="字典名称" name="dictName">
<a-form-item
:label="t('views.system.dict.dictName')"
name="dictName"
>
<a-input
v-model:value="queryParams.dictName"
allow-clear
placeholder="请输入字典名称"
></a-input>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="字典类型" name="dictType">
<a-form-item
:label="t('views.system.dict.dictType')"
name="dictType"
>
<a-input
v-model:value="queryParams.dictType"
allow-clear
placeholder="请输入字典类型"
></a-input>
</a-form-item>
</a-col>
<a-col :lg="4" :md="12" :xs="24">
<a-form-item label="字典状态" name="status">
<a-form-item
:label="t('views.system.dict.dictSatus')"
name="status"
>
<a-select
v-model:value="queryParams.status"
allow-clear
placeholder="请选择"
:options="dict.sysNormalDisable"
>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="8" :md="12" :xs="24">
<a-form-item label="创建时间" name="queryRangePicker">
<a-form-item
:label="t('views.system.dict.createTime')"
name="queryRangePicker"
>
<a-range-picker
v-model:value="queryRangePicker"
allow-clear
bordered
value-format="YYYY-MM-DD"
:placeholder="['创建开始', '创建结束']"
style="width: 100%"
></a-range-picker>
</a-form-item>
@@ -515,11 +536,11 @@ onMounted(() => {
<a-space :size="8">
<a-button type="primary" @click.prevent="fnGetList(1)">
<template #icon><SearchOutlined /></template>
搜索</a-button
>
{{ t('common.search') }}
</a-button>
<a-button type="default" @click.prevent="fnQueryReset">
<template #icon><ClearOutlined /></template>
重置</a-button
{{ t('common.reset') }}</a-button
>
</a-space>
</a-form-item>
@@ -538,7 +559,7 @@ onMounted(() => {
v-perms:has="['system:dict:add']"
>
<template #icon><PlusOutlined /></template>
新建
{{ t('common.addText') }}
</a-button>
<a-button
type="default"
@@ -548,7 +569,7 @@ onMounted(() => {
v-perms:has="['system:dict:remove']"
>
<template #icon><DeleteOutlined /></template>
删除
{{ t('common.deleteText') }}
</a-button>
<a-button
type="default"
@@ -556,7 +577,7 @@ onMounted(() => {
v-perms:has="['system:dict:data']"
>
<template #icon><ContainerOutlined /></template>
字典数据
{{ t('views.system.dict.dictData') }}
</a-button>
<a-button
type="dashed"
@@ -565,7 +586,7 @@ onMounted(() => {
v-perms:has="['system:dict:remove']"
>
<template #icon><SyncOutlined /></template>
刷新缓存
{{ t('views.system.dict.reload') }}
</a-button>
<a-button
type="dashed"
@@ -573,7 +594,7 @@ onMounted(() => {
v-perms:has="['system:dict:export']"
>
<template #icon><ExportOutlined /></template>
导出
{{ t('common.export') }}
</a-button>
</a-space>
</template>
@@ -582,31 +603,31 @@ onMounted(() => {
<template #extra>
<a-space :size="8" align="center">
<a-tooltip>
<template #title>搜索栏</template>
<template #title>{{ t('common.searchBarText') }}</template>
<a-switch
v-model:checked="tableState.seached"
checked-children=""
un-checked-children=""
:checked-children="t('common.switch.show')"
:un-checked-children="t('common.switch.hide')"
size="small"
/>
</a-tooltip>
<a-tooltip>
<template #title>表格斑马纹</template>
<template #title>{{ t('common.zebra') }}</template>
<a-switch
v-model:checked="tableState.striped"
checked-children=""
un-checked-children=""
:checked-children="t('common.switch.show')"
:un-checked-children="t('common.switch.hide')"
size="small"
/>
</a-tooltip>
<a-tooltip>
<template #title>刷新</template>
<template #title>{{ t('common.reloadText') }}</template>
<a-button type="text" @click.prevent="fnGetList()">
<template #icon><ReloadOutlined /></template>
</a-button>
</a-tooltip>
<a-tooltip placement="topRight">
<template #title>密度</template>
<template #title>{{ t('common.sizeText') }}</template>
<a-dropdown placement="bottomRight" trigger="click">
<a-button type="text">
<template #icon><ColumnHeightOutlined /></template>
@@ -616,9 +637,15 @@ onMounted(() => {
:selected-keys="[tableState.size as string]"
@click="fnTableSize"
>
<a-menu-item key="default">默认</a-menu-item>
<a-menu-item key="middle">中等</a-menu-item>
<a-menu-item key="small">紧凑</a-menu-item>
<a-menu-item key="default"
>{{ t('common.size.default') }}
</a-menu-item>
<a-menu-item key="middle"
>{{ t('common.size.middle') }}
</a-menu-item>
<a-menu-item key="small"
>{{ t('common.size.small') }}
</a-menu-item>
</a-menu>
</template>
</a-dropdown>
@@ -650,7 +677,7 @@ onMounted(() => {
<template v-if="column.key === 'dictId'">
<a-space :size="8" align="center">
<a-tooltip>
<template #title>查看详情</template>
<template #title>{{ t('common.viewText') }}</template>
<a-button
type="link"
@click.prevent="fnModalVisibleByVive(record.dictId)"
@@ -660,7 +687,7 @@ onMounted(() => {
</a-button>
</a-tooltip>
<a-tooltip>
<template #title>编辑</template>
<template #title>{{ t('common.editText') }}</template>
<a-button
type="link"
@click.prevent="fnModalVisibleByEdit(record.dictId)"
@@ -670,7 +697,7 @@ onMounted(() => {
</a-button>
</a-tooltip>
<a-tooltip>
<template #title>删除</template>
<template #title>{{ t('common.deleteText') }}</template>
<a-button
type="link"
@click.prevent="fnRecordDelete(record.dictId)"
@@ -680,7 +707,9 @@ onMounted(() => {
</a-button>
</a-tooltip>
<a-tooltip>
<template #title>字典数据</template>
<template #title>
{{ t('views.system.dict.dictData') }}
</template>
<a-button
type="link"
@click.prevent="fnDataView(record.dictId)"
@@ -705,12 +734,15 @@ onMounted(() => {
<a-form layout="horizontal">
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="字典编号" name="dictId">
<a-form-item :label="t('views.system.dict.dictId')" name="dictId">
{{ modalState.from.dictId }}
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="字典状态" name="status">
<a-form-item
:label="t('views.system.dict.dictSatus')"
name="status"
>
<DictTag
:options="dict.sysNormalDisable"
:value="modalState.from.status"
@@ -718,19 +750,20 @@ onMounted(() => {
</a-form-item>
</a-col>
</a-row>
<a-form-item label="字典名称" name="dictName">
<a-form-item :label="t('views.system.dict.dictName')" name="dictName">
{{ modalState.from.dictName }}
</a-form-item>
<a-form-item label="字典类型" name="dictType">
<a-form-item :label="t('views.system.dict.dictType')" name="dictType">
{{ modalState.from.dictType }}
</a-form-item>
<a-form-item label="字典说明" name="remark">
<a-form-item :label="t('views.system.dict.mark')" name="remark">
{{ modalState.from.remark }}
</a-form-item>
</a-form>
<template #footer>
<a-button key="cancel" @click="fnModalCancel">关闭</a-button>
<a-button key="cancel" @click="fnModalCancel">{{
t('common.cancel')
}}</a-button>
</template>
</a-modal>
@@ -749,23 +782,24 @@ onMounted(() => {
<a-row :gutter="16">
<a-col :lg="18" :md="18" :xs="24">
<a-form-item
label="字典名称"
:label="t('views.system.dict.dictName')"
name="dictName"
v-bind="modalStateFrom.validateInfos.dictName"
>
<a-input
v-model:value="modalState.from.dictName"
allow-clear
placeholder="请输入字典名称"
></a-input>
</a-form-item>
</a-col>
<a-col :lg="6" :md="6" :xs="24">
<a-form-item label="字典状态" name="status">
<a-form-item
:label="t('views.system.dict.dictStatus')"
name="status"
>
<a-select
v-model:value="modalState.from.status"
default-value="0"
placeholder="字典状态"
:options="dict.sysNormalDisable"
>
</a-select>
@@ -773,26 +807,24 @@ onMounted(() => {
</a-col>
<a-col :lg="18" :md="18" :xs="24">
<a-form-item
label="字典类型"
:label="t('views.system.dict.dictType')"
name="dictType"
v-bind="modalStateFrom.validateInfos.dictType"
>
<a-input
v-model:value="modalState.from.dictType"
allow-clear
placeholder="请输入字典类型"
></a-input>
</a-form-item>
</a-col>
</a-row>
<a-form-item label="字典说明" name="remark">
<a-form-item :label="t('views.system.dict.mark')" name="remark">
<a-textarea
v-model:value="modalState.from.remark"
:auto-size="{ minRows: 4, maxRows: 6 }"
:maxlength="450"
:show-count="true"
placeholder="请输入参数说明"
/>
</a-form-item>
</a-form>

View File

@@ -94,50 +94,50 @@ let tableState: TabeStateType = reactive({
/**表格字段列 */
let tableColumns: ColumnsType = [
{
title: '菜单名称',
title: t('views.system.menu.menuName'),
dataIndex: 'menuName',
align: 'center',
},
{
title: '菜单编号',
title: t('views.system.menu.menuId'),
dataIndex: 'menuId',
align: 'center',
},
{
title: '菜单排序',
title: t('views.system.menu.menuSort'),
dataIndex: 'menuSort',
align: 'center',
},
{
title: '菜单图标',
title: t('views.system.menu.menuTitle'),
dataIndex: 'icon',
key: 'icon',
align: 'center',
},
{
title: '权限标识',
title: t('views.system.menu.perId'),
dataIndex: 'perms',
align: 'center',
},
{
title: '组件路径',
title: t('views.system.menu.formLoc'),
dataIndex: 'component',
align: 'center',
},
{
title: '显示状态',
title: t('views.system.menu.status'),
dataIndex: 'visible',
key: 'visible',
align: 'center',
},
{
title: '菜单状态',
title: t('views.system.menu.menuStatus'),
dataIndex: 'status',
key: 'status',
align: 'center',
},
{
title: '创建时间',
title: t('views.system.menu.createTime'),
dataIndex: 'createTime',
align: 'center',
customRender(opt) {
@@ -146,7 +146,7 @@ let tableColumns: ColumnsType = [
},
},
{
title: '操作',
title: t('common.operate'),
key: 'menuId',
align: 'center',
},
@@ -243,16 +243,43 @@ let modalState: ModalStateType = reactive({
const modalStateFrom = Form.useForm(
modalState.from,
reactive({
parentId: [{ required: true, message: '上级菜单不能为空' }],
parentId: [
{
required: true,
message: t('views.system.menu.highMenu') + t('common.unableNull'),
},
],
menuName: [
{ required: true, min: 1, max: 50, message: '请正确输入菜单名称' },
{
required: true,
min: 1,
max: 50,
message: t('views.system.menu.menuName') + t('common.unableNull'),
},
],
component: [
{ required: true, min: 1, max: 200, message: '请正确输入组件路径' },
{
required: true,
min: 1,
max: 200,
message: t('views.system.menu.formLoc') + t('common.unableNull'),
},
],
path: [
{
required: true,
min: 1,
max: 200,
message: t('views.system.menu.routerAdrr') + t('common.unableNull'),
},
],
path: [{ required: true, min: 1, max: 200, message: '请正确输入路由地址' }],
perms: [
{ required: true, min: 1, max: 100, message: '请正确输入权限标识' },
{
required: true,
min: 1,
max: 100,
message: t('views.system.menu.perId') + t('common.unableNull'),
},
],
})
);
@@ -263,7 +290,7 @@ const modalStateFrom = Form.useForm(
*/
function fnModalVisibleByVive(menuId: string | number) {
if (!menuId) {
message.error(`菜单记录存在错误`, 2);
message.error(t('common.getInfoFail'), 2);
return;
}
if (modalState.confirmLoading) return;
@@ -275,10 +302,10 @@ function fnModalVisibleByVive(menuId: string | number) {
hide();
if (res.code === RESULT_CODE_SUCCESS && res.data) {
modalState.from = Object.assign(modalState.from, res.data);
modalState.title = '菜单信息';
modalState.title = t('views.system.menu.menuInfo');
modalState.visibleByView = true;
} else {
message.error(`获取菜单信息失败`, 2);
message.error(t('common.getInfoFail'), 2);
}
});
}
@@ -300,7 +327,7 @@ function fnModalVisibleByEdit(
modalState.from.parentId = parentId;
modalState.from.parentType = parentType;
}
modalState.title = '添加菜单信息';
modalState.title = t('common.addText') + t('views.system.menu.menuInfo');
modalState.visibleByEdit = true;
} else {
if (modalState.confirmLoading) return;
@@ -311,10 +338,11 @@ function fnModalVisibleByEdit(
hide();
if (res.code === RESULT_CODE_SUCCESS && res.data) {
modalState.from = Object.assign(modalState.from, res.data);
modalState.title = '修改菜单信息';
modalState.title =
t('common.editText') + t('views.system.menu.menuInfo');
modalState.visibleByEdit = true;
} else {
message.error(`获取菜单信息失败`, 2);
message.error(t('common.getInfoFail'), 2);
}
});
}
@@ -349,7 +377,7 @@ function fnModalOk() {
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `${modalState.title}成功`,
content: t('common.msgSuccess', { msg: modalState.title }),
key,
duration: 2,
});
@@ -370,7 +398,7 @@ function fnModalOk() {
});
})
.catch(e => {
message.error(`请正确填写 ${e.errorFields.length} 处必填信息!`, 2);
message.error(t('common.errorFields', { num: e.errorFields.length }), 2);
});
}
@@ -391,14 +419,14 @@ function fnModalCancel() {
function fnRecordDelete(menuId: string | number) {
Modal.confirm({
title: t('common.tipTitle'),
content: `确认删除菜单编号为 【${menuId}】 的数据项?`,
content: t('views.system.menu.menuInfo', { menuId }),
onOk() {
const key = 'delMenu';
message.loading({ content: t('common.loading'), key });
delMenu(menuId).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: `删除成功`,
content: t('common.msgSuccess', { msg: t('common.deleteText') }),
key,
duration: 2,
});
@@ -434,7 +462,7 @@ function fnGetList() {
treeDataAll = [
{
menuId: '0',
menuName: '根节点',
menuName: t('views.system.dept.node'),
children: parseDataToTreeExclude(
data,
'menuType',
@@ -477,20 +505,24 @@ onMounted(() => {
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="菜单名称" name="menuName">
<a-form-item
:label="t('views.system.menu.menuName')"
name="menuName"
>
<a-input
v-model:value="queryParams.menuName"
allow-clear
placeholder="请输入菜单名称"
></a-input>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="状态" name="status">
<a-form-item
:label="t('views.system.menu.menuStatus')"
name="status"
>
<a-select
v-model:value="queryParams.status"
allow-clear
placeholder="请选择菜单状态"
:options="dict.sysNormalDisable"
>
</a-select>
@@ -501,11 +533,11 @@ onMounted(() => {
<a-space :size="8">
<a-button type="primary" @click.prevent="fnGetList">
<template #icon><SearchOutlined /></template>
搜索</a-button
>
{{ t('common.search') }}
</a-button>
<a-button type="default" @click.prevent="fnQueryReset">
<template #icon><ClearOutlined /></template>
重置</a-button
{{ t('common.reset') }}</a-button
>
</a-space>
</a-form-item>
@@ -524,7 +556,7 @@ onMounted(() => {
v-perms:has="['system:menu:add']"
>
<template #icon><PlusOutlined /></template>
新建
{{ t('common.addText') }}
</a-button>
</a-space>
</template>
@@ -533,41 +565,41 @@ onMounted(() => {
<template #extra>
<a-space :size="8" align="center">
<a-tooltip>
<template #title>展开/折叠</template>
<template #title>{{ t('views.system.role.openSwitch') }}</template>
<a-switch
v-model:checked="tableState.expandedRowAll"
checked-children=""
un-checked-children=""
:checked-children="t('views.system.dept.open')"
:un-checked-children="t('views.system.dept.open')"
size="small"
@change="fnTableExpandedRowsAll"
/>
</a-tooltip>
<a-tooltip>
<template #title>搜索栏</template>
<template #title>{{ t('common.searchBarText') }}</template>
<a-switch
v-model:checked="tableState.seached"
checked-children=""
un-checked-children=""
:checked-children="t('common.switch.show')"
:un-checked-children="t('common.switch.hide')"
size="small"
/>
</a-tooltip>
<a-tooltip>
<template #title>表格斑马纹</template>
<template #title>{{ t('common.zebra') }}</template>
<a-switch
v-model:checked="tableState.striped"
checked-children=""
un-checked-children=""
:checked-children="t('common.switch.show')"
:un-checked-children="t('common.switch.hide')"
size="small"
/>
</a-tooltip>
<a-tooltip>
<template #title>刷新</template>
<template #title>{{ t('common.reloadText') }}</template>
<a-button type="text" @click.prevent="fnGetList">
<template #icon><ReloadOutlined /></template>
</a-button>
</a-tooltip>
<a-tooltip placement="topRight">
<template #title>密度</template>
<template #title>{{ t('common.sizeText') }}</template>
<a-dropdown placement="bottomRight" trigger="click">
<a-button type="text">
<template #icon><ColumnHeightOutlined /></template>
@@ -577,9 +609,15 @@ onMounted(() => {
:selected-keys="[tableState.size as string]"
@click="fnTableSize"
>
<a-menu-item key="default">默认</a-menu-item>
<a-menu-item key="middle">中等</a-menu-item>
<a-menu-item key="small">紧凑</a-menu-item>
<a-menu-item key="default"
>{{ t('common.size.default') }}
</a-menu-item>
<a-menu-item key="middle"
>{{ t('common.size.middle') }}
</a-menu-item>
<a-menu-item key="small"
>{{ t('common.size.small') }}
</a-menu-item>
</a-menu>
</template>
</a-dropdown>
@@ -607,7 +645,11 @@ onMounted(() => {
</template>
<template v-if="column.key === 'visible'">
<a-tag :color="+record.visible ? 'processing' : 'warning'">
{{ ['隐藏', '显示'][+record.visible] }}
{{
[t('views.system.menu.hidden'), t('views.system.menu.show')][
+record.visible
]
}}
</a-tag>
</template>
<template v-if="column.key === 'status'">
@@ -616,7 +658,7 @@ onMounted(() => {
<template v-if="column.key === 'menuId'">
<a-space :size="8" align="center">
<a-tooltip>
<template #title>查看详情</template>
<template #title>{{ t('common.viewText') }}</template>
<a-button
type="link"
@click.prevent="fnModalVisibleByVive(record.menuId)"
@@ -626,7 +668,7 @@ onMounted(() => {
</a-button>
</a-tooltip>
<a-tooltip>
<template #title>编辑</template>
<template #title>{{ t('common.editText') }}</template>
<a-button
type="link"
@click.prevent="fnModalVisibleByEdit(record.menuId)"
@@ -636,7 +678,7 @@ onMounted(() => {
</a-button>
</a-tooltip>
<a-tooltip>
<template #title>删除</template>
<template #title>{{ t('common.deleteText') }}</template>
<a-button
type="link"
@click.prevent="fnRecordDelete(record.menuId)"
@@ -646,7 +688,7 @@ onMounted(() => {
</a-button>
</a-tooltip>
<a-tooltip v-if="record.menuType !== MENU_TYPE_BUTTON">
<template #title>新增子菜单</template>
<template #title>{{t('views.system.menu.addSon')}}</template>
<a-button
type="link"
@click.prevent="
@@ -677,10 +719,12 @@ onMounted(() => {
<a-form layout="horizontal">
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="上级菜单" name="parentId">
<a-form-item
:label="t('views.system.menu.highMenu')"
name="parentId"
>
<a-tree-select
:value="modalState.from.parentId"
placeholder="上级菜单"
disabled
:tree-data="modalState.treeData"
:field-names="{
@@ -695,46 +739,55 @@ onMounted(() => {
</a-form-item>
</a-col>
<a-col :lg="6" :md="6" :xs="24">
<a-form-item label="菜单编号" name="menuId">
<a-form-item :label="t('views.system.menu.menuId')" name="menuId">
{{ modalState.from.menuId }}
</a-form-item>
</a-col>
<a-col :lg="6" :md="6" :xs="24">
<a-form-item label="菜单排序" name="menuSort">
<a-form-item
:label="t('views.system.menu.menuSort')"
name="menuSort"
>
{{ modalState.from.menuSort }}
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="菜单名称" name="menuName">
<a-form-item
:label="t('views.system.menu.menuName')"
name="menuName"
>
{{ modalState.from.menuName }}
</a-form-item>
</a-col>
<a-col :lg="6" :md="6" :xs="24">
<a-form-item label="菜单类型" name="menuType">
<a-form-item
:label="t('views.system.menu.menuType')"
name="menuType"
>
<a-tag
v-if="modalState.from.menuType === MENU_TYPE_DIR"
color="purple"
>
目录
{{ t('views.system.menu.root') }}
</a-tag>
<a-tag
v-if="modalState.from.menuType === MENU_TYPE_MENU"
color="cyan"
>
菜单
{{ t('views.system.menu.menu') }}
</a-tag>
<a-tag
v-if="modalState.from.menuType === MENU_TYPE_BUTTON"
color="orange"
>
按钮
{{ t('views.system.menu.button') }}
</a-tag>
</a-form-item>
</a-col>
<a-col :lg="6" :md="6" :xs="24">
<a-form-item label="菜单图标" name="icon">
<a-form-item :label="t('views.system.menu.menuTitle')" name="icon">
<IconFont
:type="modalState.from.icon || '#'"
style="font-size: 18px"
@@ -750,7 +803,7 @@ onMounted(() => {
:xs="24"
v-if="modalState.from.menuType !== MENU_TYPE_BUTTON"
>
<a-form-item label="路由地址" name="path">
<a-form-item :label="t('views.system.menu.routerAdrr')" name="path">
{{ modalState.from.path }}
</a-form-item>
</a-col>
@@ -760,7 +813,10 @@ onMounted(() => {
:xs="24"
v-if="modalState.from.menuType === MENU_TYPE_MENU"
>
<a-form-item label="组件路径" name="component">
<a-form-item
:label="t('views.system.menu.formLoc')"
name="component"
>
{{ modalState.from.component }}
</a-form-item>
</a-col>
@@ -771,28 +827,47 @@ onMounted(() => {
v-if="modalState.from.menuType !== MENU_TYPE_BUTTON"
>
<a-col :lg="6" :md="6" :xs="24">
<a-form-item label="内部地址" name="isFrame">
<a-form-item :label="t('views.system.menu.local')" name="isFrame">
<a-tag color="default">
{{ ['否', '是'][+modalState.from.isFrame] }}
{{
[t('views.system.menu.no'), t('views.system.menu.yes')][
+modalState.from.isFrame
]
}}
</a-tag>
</a-form-item>
</a-col>
<a-col :lg="6" :md="6" :xs="24">
<a-form-item label="页面缓存" name="isCache">
<a-form-item
:label="t('views.system.menu.pageCache')"
name="isCache"
>
<a-tag color="default">
{{ ['不缓存', '缓存'][+modalState.from.isCache] }}
{{
[
t('views.system.menu.noCache'),
t('views.system.menu.cache'),
][+modalState.from.isCache]
}}
</a-tag>
</a-form-item>
</a-col>
<a-col :lg="6" :md="6" :xs="24">
<a-form-item label="显示状态" name="visible">
<a-form-item :label="t('views.system.menu.status')" name="visible">
<a-tag color="default">
{{ ['隐藏', '显示'][+modalState.from.visible] }}
{{
[t('views.system.menu.hidden'), t('views.system.menu.show')][
+modalState.from.visible
]
}}
</a-tag>
</a-form-item>
</a-col>
<a-col :lg="6" :md="6" :xs="24">
<a-form-item label="菜单状态" name="status">
<a-form-item
:label="t('views.system.menu.menuStatus')"
name="status"
>
<DictTag
:options="dict.sysNormalDisable"
:value="modalState.from.status"
@@ -802,19 +877,21 @@ onMounted(() => {
</a-row>
<a-form-item
label="权限标识"
:label="t('views.system.menu.perId')"
name="perms"
v-if="modalState.from.menuType !== MENU_TYPE_DIR"
>
{{ modalState.from.perms }}
</a-form-item>
<a-form-item label="菜单说明" name="remark">
<a-form-item :label="t('views.system.menu.mark')" name="remark">
{{ modalState.from.remark }}
</a-form-item>
</a-form>
<template #footer>
<a-button key="cancel" @click="fnModalCancel">关闭</a-button>
<a-button key="cancel" @click="fnModalCancel">{{
t('common.cancel')
}}</a-button>
</template>
</a-modal>
@@ -831,13 +908,12 @@ onMounted(() => {
>
<a-form name="modalStateFrom" layout="horizontal">
<a-form-item
label="上级菜单"
:label="t('views.system.menu.highMenu')"
name="parentId"
v-bind="modalStateFrom.validateInfos.parentId"
>
<a-tree-select
v-model:value="modalState.from.parentId"
placeholder="上级菜单"
show-search
tree-default-expand-all
:tree-data="modalState.treeData"
@@ -858,48 +934,49 @@ onMounted(() => {
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
label="菜单名称"
:label="t('views.system.menu.menuName')"
name="menuName"
v-bind="modalStateFrom.validateInfos.menuName"
>
<a-input
v-model:value="modalState.from.menuName"
allow-clear
placeholder="请输入菜单名称"
></a-input>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="菜单排序" name="menuSort">
<a-form-item
:label="t('views.system.menu.menuSort')"
name="menuSort"
>
<a-input-number
v-model:value="modalState.from.menuSort"
:min="0"
:max="9999"
:step="1"
placeholder="排序值"
></a-input-number>
</a-form-item>
</a-col>
</a-row>
<a-form-item label="菜单类型" name="menuType">
<a-form-item :label="t('views.system.menu.menuType')" name="menuType">
<a-radio-group v-model:value="modalState.from.menuType">
<a-radio
:key="MENU_TYPE_DIR"
:value="MENU_TYPE_DIR"
:disabled="modalState.from.parentType === MENU_TYPE_MENU"
>
目录
{{ t('views.system.menu.root') }}
</a-radio>
<a-radio
:key="MENU_TYPE_MENU"
:value="MENU_TYPE_MENU"
:disabled="modalState.from.parentType === MENU_TYPE_MENU"
>
菜单
{{ t('views.system.menu.menu') }}
</a-radio>
<a-radio :key="MENU_TYPE_BUTTON" :value="MENU_TYPE_BUTTON">
按钮
{{ t('views.system.menu.button') }}
</a-radio>
</a-radio-group>
</a-form-item>
@@ -909,10 +986,9 @@ onMounted(() => {
v-if="modalState.from.menuType !== MENU_TYPE_BUTTON"
>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="菜单图标" name="icon">
<a-form-item :label="t('views.system.menu.menuTitle')" name="icon">
<a-select
v-model:value="modalState.from.icon"
placeholder="请选择菜单图标"
show-search
option-filter-prop="label"
option-label-prop="label"
@@ -932,31 +1008,19 @@ onMounted(() => {
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
label="路由地址"
:label="t('views.system.menu.routerAdrr')"
name="path"
v-bind="modalStateFrom.validateInfos.path"
>
<a-input
v-model:value="modalState.from.path"
allow-clear
placeholder="请输入路由地址"
>
<a-input v-model:value="modalState.from.path" allow-clear>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
<div>
访问的路由地址user/auth
<br />
1. 如网络地址需内部访问<br />则以 http(s):// 开头
<br />菜单行为根节点当前窗口打开
<br />菜单行为非根节点内嵌窗口
<br />
2. 如网络地址需外部访问<br />则将内部地址选项设为否
<br />菜单行为打开新标签
<br />
3. 如内嵌子页面需要隐藏页面<br />则将显示状态选项设为隐藏
<br />地址拼接以内嵌路由地址
{{ MENU_PATH_INLINE }}/子页面地址
{{ t('views.system.menu.pathTip') }}
{{ MENU_PATH_INLINE }}/{{
t('views.system.menu.sonPage')
}}
</div>
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
@@ -971,48 +1035,62 @@ onMounted(() => {
:gutter="16"
v-if="modalState.from.menuType !== MENU_TYPE_BUTTON"
>
<a-col :lg="6" :md="6" :xs="24">
<a-form-item label="内部地址" name="isFrame">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.system.menu.local')" name="isFrame">
<a-select
v-model:value="modalState.from.isFrame"
default-value="0"
placeholder="内部地址"
>
<a-select-option key="0" value="0"></a-select-option>
<a-select-option key="1" value="1"></a-select-option>
<a-select-option key="0" value="0">{{
t('views.system.menu.no')
}}</a-select-option>
<a-select-option key="1" value="1">{{
t('views.system.menu.yes')
}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="6" :xs="24">
<a-form-item label="页面缓存" name="isCache">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.system.menu.pageCache')"
name="isCache"
>
<a-select
v-model:value="modalState.from.isCache"
default-value="0"
placeholder="页面缓存"
>
<a-select-option key="0" value="0">不缓存</a-select-option>
<a-select-option key="1" value="1">缓存</a-select-option>
<a-select-option key="0" value="0">{{
t('views.system.menu.noCache')
}}</a-select-option>
<a-select-option key="1" value="1">{{
t('views.system.menu.cache')
}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="6" :xs="24">
<a-form-item label="显示状态" name="visible">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.system.menu.status')" name="visible">
<a-select
v-model:value="modalState.from.visible"
default-value="0"
placeholder="显示状态"
>
<a-select-option key="0" value="0">隐藏</a-select-option>
<a-select-option key="1" value="1">显示</a-select-option>
<a-select-option key="0" value="0">{{
t('views.system.menu.hidden')
}}</a-select-option>
<a-select-option key="1" value="1">{{
t('views.system.menu.show')
}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6" :md="6" :xs="24">
<a-form-item label="菜单状态" name="status">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.system.menu.menuStatus')"
name="status"
>
<a-select
v-model:value="modalState.from.status"
default-value="0"
placeholder="菜单状态"
:options="dict.sysNormalDisable"
>
</a-select>
@@ -1021,24 +1099,17 @@ onMounted(() => {
</a-row>
<a-form-item
label="组件路径"
:label="t('views.system.menu.formLoc')"
name="component"
v-bind="modalStateFrom.validateInfos.component"
v-if="modalState.from.menuType === MENU_TYPE_MENU"
>
<a-input
v-model:value="modalState.from.component"
allow-clear
placeholder="请输入组件路径"
>
<a-input v-model:value="modalState.from.component" allow-clear>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
<div>
页面组件目录 views <br />
访问的组件路径,system/user/index <br />
注意不带 .vue 文件后缀 <br />
路由地址是网络地址可填入链接
{{ t('views.system.menu.componentTip') }}
</div>
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
@@ -1048,26 +1119,17 @@ onMounted(() => {
</a-form-item>
<a-form-item
label="权限标识"
:label="t('views.system.menu.perId')"
name="perms"
v-if="modalState.from.menuType !== MENU_TYPE_DIR"
v-bind="modalStateFrom.validateInfos.perms"
>
<a-input
v-model:value="modalState.from.perms"
allow-clear
placeholder="请输入权限标识"
>
<a-input v-model:value="modalState.from.perms" allow-clear>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
<div>
权限标识示例monitor:server:query <br />
后端控制器中使用权限标识 <br />
@PreAuthorize({ hasPermissions: ['monitor:server:query'] })
<br />
前端vue页面中使用权限标识 <br />
v-perms:has="['monitor:server:query']"
{{t('views.system.menu.perms')}}
</div>
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
@@ -1076,13 +1138,12 @@ onMounted(() => {
</a-input>
</a-form-item>
<a-form-item label="菜单说明" name="remark">
<a-form-item :label="t('views.system.menu.mark')" name="remark">
<a-textarea
v-model:value="modalState.from.remark"
:auto-size="{ minRows: 4, maxRows: 6 }"
:maxlength="450"
:show-count="true"
placeholder="请输入菜单说明"
/>
</a-form-item>
</a-form>

View File

@@ -437,7 +437,7 @@ onMounted(() => {
<a-row :gutter="16">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item
:label="t('views.system.post. positionId')"
:label="t('views.system.post.positionId')"
name="postCode"
>
<a-input
@@ -448,7 +448,7 @@ onMounted(() => {
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item
:label="t('views.system.post. positionName')"
:label="t('views.system.post.positionName')"
name="postName"
>
<a-input
@@ -459,7 +459,7 @@ onMounted(() => {
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item
:label="t('views.system.post. positionStatus')"
:label="t('views.system.post.positionStatus')"
name="status"
>
<a-select