---新增参数配置,字典配置国家化
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user