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

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', neId: 'Internal identification',
neIdPlease: 'Please select the corresponding network element', 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: { neUser: {
auth: { auth: {
@@ -1073,14 +1097,14 @@ export default {
email:'Mail', email:'Mail',
}, },
post:{ post:{
positionInfo:'Position information', positionInfo:' Position Information',
positionId:'Position number', positionId:'Position Number',
positionCode:'Position code', positionCode:'Position Code',
positionName:'Position name', positionName:'Position Name',
positionSort:'Position sorting', positionSort:'Position Sorting',
positionStatus:'Position status', positionStatus:'Position Status',
positionMark:'Position description', positionMark:'Position Description',
createTime:'Creation time', createTime:'Creation Time',
codeTip:'Please enter the position code correctly', codeTip:'Please enter the position code correctly',
nameTip:'Please enter the position name correctly', nameTip:'Please enter the position name correctly',
delSure:'Confirm to delete the data item with post number [{postId}]?', delSure:'Confirm to delete the data item with post number [{postId}]?',
@@ -1126,8 +1150,57 @@ export default {
unlock:'Unlock', unlock:'Unlock',
unlockSuss:'{userName} unlocked successfully', unlockSuss:'{userName} unlocked successfully',
unlockSure:'Confirm to unlock user [{username}] data item?', 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: { mmlManage: {
operationtitle: "Interface Settings", operationtitle: "Interface Settings",

View File

@@ -404,6 +404,30 @@ export default {
neId: '网元内部标识', neId: '网元内部标识',
neIdPlease: '请选择对应网元', 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: { neUser: {
auth: { auth: {
@@ -1126,8 +1150,57 @@ export default {
unlock:'解锁', unlock:'解锁',
unlockSuss:'{userName} 解锁成功', unlockSuss:'{userName} 解锁成功',
unlockSure:'确认解锁用户 【{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: { mmlManage: {
cmdTitle: "命令导航", cmdTitle: "命令导航",
@@ -1158,7 +1231,7 @@ export default {
ipadd: "侦听IP地址", ipadd: "侦听IP地址",
ipaddPlease: "请输入侦听IP地址", ipaddPlease: "请输入侦听IP地址",
port: "侦听端口", port: "侦听端口",
portPlease: "请输入远程端口0~65535", portPlease: "请输入远程端口,0~65535",
okChange: "接口设置保存成功", okChange: "接口设置保存成功",
noChange: "接口设置无变更", noChange: "接口设置无变更",
}, },

View File

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

View File

@@ -468,7 +468,7 @@ onBeforeUnmount(() => {
nfInfo.obj nfInfo.obj
}}</a-descriptions-item> }}</a-descriptions-item>
<template v-if="nfInfo.obj === 'OMC'"> <template v-if="nfInfo.obj === 'OMC'">
<a-descriptions-item :label="t('views.index.veisonNum')">{{ <a-descriptions-item :label="t('views.index.versionNum')">{{
nfInfo.version nfInfo.version
}}</a-descriptions-item> }}</a-descriptions-item>
<a-descriptions-item :label="t('views.index.systemStatus')">{{ <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'); t('common.viewText') + t('views.neUser.auth.authInfo');
modalState.visibleByView = true; modalState.visibleByView = true;
} else { } else {
message.error(`获取鉴权信息失败`, 2); message.error(t('common.getInfoFail'), 2);
} }
}) })
.finally(() => { .finally(() => {
@@ -320,7 +320,7 @@ function fnModalVisibleByEdit(row?: Record<string, any>) {
t('common.editText') + t('views.neUser.auth.authInfo'); t('common.editText') + t('views.neUser.auth.authInfo');
modalState.visibleByEdit = true; modalState.visibleByEdit = true;
} else { } else {
message.error(`获取鉴权信息失败`, 2); message.error(t('common.getInfoFail'), 2);
} }
}) })
.finally(() => { .finally(() => {

View File

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

View File

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

View File

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