fix(menu模块以及各模块bug): 修复各模块bug
This commit is contained in:
parent
9604bca0ea
commit
18f563ce42
@ -14,7 +14,7 @@ export interface MenuRecord {
|
|||||||
order: number;
|
order: number;
|
||||||
permissions: string[];
|
permissions: string[];
|
||||||
showInMenu?: boolean;
|
showInMenu?: boolean;
|
||||||
menuOrder?: string;
|
menuOrder?: number;
|
||||||
};
|
};
|
||||||
children?: MenuRecord[] ;
|
children?: MenuRecord[] ;
|
||||||
};
|
};
|
||||||
@ -22,6 +22,30 @@ export interface MenuRecord {
|
|||||||
export interface MenuCreateRecord extends MenuRecord{
|
export interface MenuCreateRecord extends MenuRecord{
|
||||||
type: string;
|
type: string;
|
||||||
}
|
}
|
||||||
|
export interface MenuUpdateRecord {
|
||||||
|
pid?: number;
|
||||||
|
name: string;
|
||||||
|
path: string;
|
||||||
|
locale?: string;
|
||||||
|
icon?: string;
|
||||||
|
createTime?: string;
|
||||||
|
createBy?: string;
|
||||||
|
type: string;
|
||||||
|
requiresAuth?: boolean;
|
||||||
|
hideInMenu?: boolean;
|
||||||
|
menuOrder?: number;
|
||||||
|
permissions: string;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取详情
|
||||||
|
export const queryMenuDetail = (id: string | number) => {
|
||||||
|
return axios.get(`/api/rest/menu/${id}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
export const queryMenuList = (data: string) => {
|
export const queryMenuList = (data: string) => {
|
||||||
return axios({
|
return axios({
|
||||||
|
@ -3,10 +3,6 @@ import axios from 'axios';
|
|||||||
export interface MessageRecord {
|
export interface MessageRecord {
|
||||||
userId?: string;
|
userId?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
type?: string;
|
|
||||||
name?: string;
|
|
||||||
system?: boolean;
|
|
||||||
isRead?: boolean;
|
|
||||||
createAtBegin?: string;
|
createAtBegin?: string;
|
||||||
createAtEnd?: string;
|
createAtEnd?: string;
|
||||||
current: number;
|
current: number;
|
||||||
@ -21,7 +17,6 @@ export interface MessageCreateRecord {
|
|||||||
html: string;
|
html: string;
|
||||||
title: string;
|
title: string;
|
||||||
content: string;
|
content: string;
|
||||||
attachmentIds?: string[];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查看详情
|
// 查看详情
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
|
|
||||||
export default function usePagination(initValue = false) {
|
export default function usePagination(initValue = false) {
|
||||||
const pagination: any = {
|
const pagination: any = {
|
||||||
pages: 1,
|
page: 1,
|
||||||
size: 10,
|
size: 10,
|
||||||
current: 1,
|
current: 1,
|
||||||
total: 0,
|
total: 0,
|
||||||
};
|
};
|
||||||
const setPagination = (value: any) => {
|
const setPagination = (value: any) => {
|
||||||
pagination.pages = value.page;
|
pagination.page = value.page;
|
||||||
pagination.size = value.size;
|
pagination.size = value.size;
|
||||||
pagination.current = value.current;
|
pagination.current = value.current;
|
||||||
pagination.total = value.total;
|
pagination.total = value.total;
|
||||||
|
@ -64,7 +64,7 @@ const SYSTEM: AppRouteRecordRaw = {
|
|||||||
locale: '权限管理',
|
locale: '权限管理',
|
||||||
title: '权限管理',
|
title: '权限管理',
|
||||||
requiresAuth: true,
|
requiresAuth: true,
|
||||||
permissions: ['system:authority'],
|
permissions: ['system:authorityHidden'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -252,7 +252,7 @@
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}, 2000);
|
}, 1000);
|
||||||
} else {
|
} else {
|
||||||
options.value = [];
|
options.value = [];
|
||||||
}
|
}
|
||||||
|
@ -92,53 +92,6 @@
|
|||||||
field="params"
|
field="params"
|
||||||
label="参数"
|
label="参数"
|
||||||
>
|
>
|
||||||
<!-- <a-table-->
|
|
||||||
<!-- :columns="columns"-->
|
|
||||||
<!-- :data="paramsData"-->
|
|
||||||
<!-- :bordered="false"-->
|
|
||||||
<!-- :pagination="false"-->
|
|
||||||
<!-- :table-layout-fixed="true"-->
|
|
||||||
<!-- :show-header="false"-->
|
|
||||||
<!-- :hoverable="false"-->
|
|
||||||
<!-- :column-resizable="true"-->
|
|
||||||
<!-- :filter-icon-align-left="true"-->
|
|
||||||
<!-- :body-cell-class="{ padding: '0px',marginLeft: '-10px' }"-->
|
|
||||||
<!-- >-->
|
|
||||||
<!-- <template #name="{ record }">-->
|
|
||||||
<!-- <a-input-->
|
|
||||||
<!-- v-model="record.name"-->
|
|
||||||
<!-- placeholder="名称"-->
|
|
||||||
<!-- />-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- <template #identifier="{ record }">-->
|
|
||||||
<!-- <a-input-->
|
|
||||||
<!-- v-model="record.identifier"-->
|
|
||||||
<!-- placeholder="标识"-->
|
|
||||||
<!-- />-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- <template #dataType="{ record }">-->
|
|
||||||
<!-- <a-select-->
|
|
||||||
<!-- v-model="record.dataType"-->
|
|
||||||
<!-- :options="dataTypeOptions"-->
|
|
||||||
<!-- allow-search-->
|
|
||||||
<!-- />-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- <template #type="{ record }">-->
|
|
||||||
<!-- <a-select-->
|
|
||||||
<!-- v-model="record.type"-->
|
|
||||||
<!-- :options="typeOptions"-->
|
|
||||||
<!-- allow-search-->
|
|
||||||
<!-- />-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- <template #operation="{ record }">-->
|
|
||||||
<!-- <a-button type="text" @click="handleDeleteParams(record)"><icon-minus-circle /></a-button>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- <template #footer>-->
|
|
||||||
<!-- <a-button @click="handleAddParams" style="width: 100%" >-->
|
|
||||||
<!-- <icon-plus />-->
|
|
||||||
<!-- </a-button>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </a-table>-->
|
|
||||||
<div style="width: 100%">
|
<div style="width: 100%">
|
||||||
<div style="width: 100%;margin-bottom: 5px; ">
|
<div style="width: 100%;margin-bottom: 5px; ">
|
||||||
<a-space v-for="(param,index) in paramsData" :key="index" style="margin-bottom: 5px">
|
<a-space v-for="(param,index) in paramsData" :key="index" style="margin-bottom: 5px">
|
||||||
@ -162,75 +115,75 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
|
|
||||||
<a-modal
|
<!-- <a-modal-->
|
||||||
width="900px"
|
<!-- width="900px"-->
|
||||||
:visible="paramsVisible"
|
<!-- :visible="paramsVisible"-->
|
||||||
@cancel="paramsCancel"
|
<!-- @cancel="paramsCancel"-->
|
||||||
>
|
<!-- >-->
|
||||||
<template #title>添加参数</template>
|
<!-- <template #title>添加参数</template>-->
|
||||||
<a-form
|
<!-- <a-form-->
|
||||||
ref="CreateRef"
|
<!-- ref="CreateRef"-->
|
||||||
:model="paramsData"
|
<!-- :model="paramsData"-->
|
||||||
:style="{ width: '650px' }"
|
<!-- :style="{ width: '650px' }"-->
|
||||||
>
|
<!-- >-->
|
||||||
<!-- 添加参数 -->
|
<!-- <!– 添加参数 –>-->
|
||||||
<a-form-item
|
<!-- <a-form-item-->
|
||||||
field="name"
|
<!-- field="name"-->
|
||||||
label="参数名称"
|
<!-- label="参数名称"-->
|
||||||
:rules="[{ required: true, message: '参数名称不能为空' }]"
|
<!-- :rules="[{ required: true, message: '参数名称不能为空' }]"-->
|
||||||
:validate-trigger="['change']"
|
<!-- :validate-trigger="['change']"-->
|
||||||
>
|
<!-- >-->
|
||||||
<a-input
|
<!-- <a-input-->
|
||||||
v-model="paramsData.name"
|
<!-- v-model="paramsData.name"-->
|
||||||
placeholder='请选择参数名称'
|
<!-- placeholder='请选择参数名称'-->
|
||||||
/>
|
<!-- />-->
|
||||||
</a-form-item>
|
<!-- </a-form-item>-->
|
||||||
<!-- 参数标识 -->
|
<!-- <!– 参数标识 –>-->
|
||||||
<a-form-item
|
<!-- <a-form-item-->
|
||||||
field="identifier"
|
<!-- field="identifier"-->
|
||||||
label="参数标识"
|
<!-- label="参数标识"-->
|
||||||
:rules="[{ required: true, message: '参数标识不能为空' }]"
|
<!-- :rules="[{ required: true, message: '参数标识不能为空' }]"-->
|
||||||
:validate-trigger="['change']"
|
<!-- :validate-trigger="['change']"-->
|
||||||
>
|
<!-- >-->
|
||||||
<a-input
|
<!-- <a-input-->
|
||||||
v-model="paramsData.identifier"
|
<!-- v-model="paramsData.identifier"-->
|
||||||
placeholder='请选择参数标识'
|
<!-- placeholder='请选择参数标识'-->
|
||||||
/>
|
<!-- />-->
|
||||||
</a-form-item>
|
<!-- </a-form-item>-->
|
||||||
|
|
||||||
<a-form-item
|
<!-- <a-form-item-->
|
||||||
field="dataType"
|
<!-- field="dataType"-->
|
||||||
label="数据类型"
|
<!-- label="数据类型"-->
|
||||||
:rules="[{ required: true, message: '数据类型不能为空' }]"
|
<!-- :rules="[{ required: true, message: '数据类型不能为空' }]"-->
|
||||||
:validate-trigger="['change']"
|
<!-- :validate-trigger="['change']"-->
|
||||||
>
|
<!-- >-->
|
||||||
<a-select
|
<!-- <a-select-->
|
||||||
v-model="paramsData.dataType"
|
<!-- v-model="paramsData.dataType"-->
|
||||||
placeholder='请输入数据类型'
|
<!-- placeholder='请输入数据类型'-->
|
||||||
:options="dataTypeOptions"
|
<!-- :options="dataTypeOptions"-->
|
||||||
allow-search
|
<!-- allow-search-->
|
||||||
/>
|
<!-- />-->
|
||||||
</a-form-item>
|
<!-- </a-form-item>-->
|
||||||
<a-form-item
|
<!-- <a-form-item-->
|
||||||
field="type"
|
<!-- field="type"-->
|
||||||
label="参数类型"
|
<!-- label="参数类型"-->
|
||||||
:rules="[{ required: true, message: '参数类型不能为空' }]"
|
<!-- :rules="[{ required: true, message: '参数类型不能为空' }]"-->
|
||||||
:validate-trigger="['change']"
|
<!-- :validate-trigger="['change']"-->
|
||||||
>
|
<!-- >-->
|
||||||
<a-select
|
<!-- <a-select-->
|
||||||
v-model="paramsData.type"
|
<!-- v-model="paramsData.type"-->
|
||||||
placeholder='请输入参数类型'
|
<!-- placeholder='请输入参数类型'-->
|
||||||
:options="typeOptions"
|
<!-- :options="typeOptions"-->
|
||||||
allow-search
|
<!-- allow-search-->
|
||||||
/>
|
<!-- />-->
|
||||||
</a-form-item>
|
<!-- </a-form-item>-->
|
||||||
</a-form>
|
<!-- </a-form>-->
|
||||||
|
|
||||||
<template #footer>
|
<!-- <template #footer>-->
|
||||||
<a-button class="editor-button" @click="paramsCancel">取消</a-button>
|
<!-- <a-button class="editor-button" @click="paramsCancel">取消</a-button>-->
|
||||||
<a-button class="editor-button" type="primary" @click="paramsSubmit">确定</a-button>
|
<!-- <a-button class="editor-button" type="primary" @click="paramsSubmit">确定</a-button>-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
</a-modal>
|
<!-- </a-modal>-->
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -256,45 +209,7 @@
|
|||||||
});
|
});
|
||||||
const { visible, setVisible } = useVisible(false);
|
const { visible, setVisible } = useVisible(false);
|
||||||
const CreateRef = ref<FormInstance>();
|
const CreateRef = ref<FormInstance>();
|
||||||
const formData = ref<any>({
|
const formData = ref<any>({});
|
||||||
// params: [],
|
|
||||||
// ...props.prem,
|
|
||||||
});
|
|
||||||
const columns=[
|
|
||||||
{
|
|
||||||
title: '参数名称',
|
|
||||||
dataIndex: 'name',
|
|
||||||
slotName: 'name',
|
|
||||||
width: '120',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '参数标识',
|
|
||||||
dataIndex: 'identifier',
|
|
||||||
slotName: 'identifier',
|
|
||||||
width: '120',
|
|
||||||
align: 'left'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '数据类型',
|
|
||||||
dataIndex: 'dataType',
|
|
||||||
slotName: 'dataType',
|
|
||||||
width: '150',
|
|
||||||
align: 'left'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '参数类型',
|
|
||||||
dataIndex: 'type',
|
|
||||||
slotName: 'type',
|
|
||||||
width: '180',
|
|
||||||
align: 'left'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '操作',
|
|
||||||
dataIndex: 'operation',
|
|
||||||
slotName: 'operation',
|
|
||||||
align: 'left'
|
|
||||||
}
|
|
||||||
];
|
|
||||||
const paramsData = ref([
|
const paramsData = ref([
|
||||||
{
|
{
|
||||||
name: '',
|
name: '',
|
||||||
@ -362,7 +277,7 @@
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const paramsVisible = ref(false);
|
const paramsVisible = ref(false);
|
||||||
const paramsName = ref([]);
|
// const paramsName = ref([]);
|
||||||
const fetchData = async (Id: number | undefined) => {
|
const fetchData = async (Id: number | undefined) => {
|
||||||
const res = await queryProductDetail(Id);
|
const res = await queryProductDetail(Id);
|
||||||
formData.value = res.data;
|
formData.value = res.data;
|
||||||
@ -378,6 +293,7 @@
|
|||||||
// 提交
|
// 提交
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
const valid = await CreateRef.value?.validate();
|
const valid = await CreateRef.value?.validate();
|
||||||
|
console.log(valid);
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
// 新增
|
// 新增
|
||||||
if (props.isCreate) {
|
if (props.isCreate) {
|
||||||
@ -431,8 +347,8 @@
|
|||||||
// 参数模态框提交
|
// 参数模态框提交
|
||||||
const paramsSubmit = () => {
|
const paramsSubmit = () => {
|
||||||
paramsVisible.value = false;
|
paramsVisible.value = false;
|
||||||
formData.value.params.push(paramsData.value);
|
formData.value.params?.push(paramsData.value);
|
||||||
paramsName.value.push(paramsData.value.name);
|
// paramsName.value.push(paramsData.value.name);
|
||||||
}
|
}
|
||||||
// 关闭
|
// 关闭
|
||||||
const handleCancel = async () => {
|
const handleCancel = async () => {
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
>
|
>
|
||||||
<!-- v-if="isCreate"-->
|
<!-- v-if="isCreate"-->
|
||||||
<a-input
|
<a-input
|
||||||
v-model="formData.attachment"
|
v-model="formData.remark"
|
||||||
placeholder='请输入备注'
|
placeholder='请输入备注'
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@ -393,7 +393,6 @@
|
|||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
const valid = await CreateRef.value?.validate();
|
const valid = await CreateRef.value?.validate();
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
formData.value.permissionIds = checkKeys.value;
|
|
||||||
// 新增
|
// 新增
|
||||||
if (props.isCreate) {
|
if (props.isCreate) {
|
||||||
// formData.value.username = formData.value.email;
|
// formData.value.username = formData.value.email;
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="10">
|
<a-col :span="12">
|
||||||
<a-form-item field="Time" label='时间'>
|
<a-form-item field="Time" label='时间'>
|
||||||
<a-range-picker
|
<a-range-picker
|
||||||
show-time
|
show-time
|
||||||
@ -32,27 +32,15 @@
|
|||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="9">
|
|
||||||
<a-form-item
|
|
||||||
field="name"
|
|
||||||
label='名称'
|
|
||||||
>
|
|
||||||
<a-input
|
|
||||||
v-model="formModel.name"
|
|
||||||
style="width: 360px"
|
|
||||||
placeholder='请输入名称'
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-divider style="height: 84px" direction="vertical" />
|
<!-- <a-divider style="height: 84px" direction="vertical" />-->
|
||||||
<a-col :flex="'86px'" style="text-align: right">
|
<a-col :flex="'86px'" style="text-align: right">
|
||||||
<a-space direction="vertical" :size="18">
|
<a-space :size="18">
|
||||||
<a-button type="primary" @click="search">
|
<a-button type="primary" @click="search">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<icon-search />
|
<icon-search />
|
||||||
@ -193,12 +181,7 @@
|
|||||||
|
|
||||||
const generateFormModel = () => {
|
const generateFormModel = () => {
|
||||||
return {
|
return {
|
||||||
userId: '',
|
|
||||||
title: '',
|
title: '',
|
||||||
type: '',
|
|
||||||
name: '',
|
|
||||||
system: '',
|
|
||||||
isRead: '',
|
|
||||||
createAtBegin: '',
|
createAtBegin: '',
|
||||||
createAtEnd: '',
|
createAtEnd: '',
|
||||||
};
|
};
|
||||||
@ -243,12 +226,9 @@
|
|||||||
// dataIndex: 'username',
|
// dataIndex: 'username',
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '备注',
|
||||||
dataIndex: 'isRead',
|
dataIndex: 'remark',
|
||||||
slotName: 'isRead',
|
slotName: 'remark',
|
||||||
sortable: {
|
|
||||||
sortDirections: ['ascend', 'descend'],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
]);
|
]);
|
||||||
@ -258,7 +238,7 @@
|
|||||||
) => {
|
) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const res: any = await messageStore.queryMessageList(params);
|
const res = await messageStore.queryMessageList(params);
|
||||||
renderData.value = res.data.records;
|
renderData.value = res.data.records;
|
||||||
setPagination(res.data);
|
setPagination(res.data);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@ -279,8 +259,9 @@
|
|||||||
|
|
||||||
// 分页发生改变
|
// 分页发生改变
|
||||||
const onPageChange = (current: number) => {
|
const onPageChange = (current: number) => {
|
||||||
pagination.pages = current;
|
setPagination({
|
||||||
pagination.current = current;
|
current,
|
||||||
|
});
|
||||||
search();
|
search();
|
||||||
};
|
};
|
||||||
// 时间范围
|
// 时间范围
|
||||||
@ -292,8 +273,10 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 数据条数改变
|
// 数据条数改变
|
||||||
const onSizeChange = (Size: number) => {
|
const onSizeChange = (size: number) => {
|
||||||
pagination.size = Size;
|
setPagination({
|
||||||
|
size,
|
||||||
|
})
|
||||||
search();
|
search();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -73,66 +73,66 @@
|
|||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
field="meta.icon"
|
field="icon"
|
||||||
label="图标"
|
label="图标"
|
||||||
:validate-trigger="['change', 'input']"
|
:validate-trigger="['change', 'input']"
|
||||||
:rules="[{ required: true, message: '请输入图标' }]"
|
:rules="[{ required: true, message: '请输入图标' }]"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
v-model="formData.meta.icon"
|
v-model="formData.icon"
|
||||||
placeholder='请输入图标'
|
placeholder='请输入图标'
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
field="meta.locale"
|
field="locale"
|
||||||
label="应用区域"
|
label="应用区域"
|
||||||
:validate-trigger="['change', 'input']"
|
:validate-trigger="['change', 'input']"
|
||||||
:rules="[{ required: true, message: '应用区域' }]"
|
:rules="[{ required: true, message: '应用区域' }]"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
v-model="formData.meta.locale"
|
v-model="formData.locale"
|
||||||
placeholder='请输入应用区域'
|
placeholder='请输入应用区域'
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
field="meta.requiresAuth"
|
field="requiresAuth"
|
||||||
label="认证"
|
label="认证"
|
||||||
>
|
>
|
||||||
<a-switch
|
<a-switch
|
||||||
v-model="formData.meta.requiresAuth"
|
v-model="formData.requiresAuth"
|
||||||
:checked-value="true"
|
:checked-value="true"
|
||||||
:unchecked-value="false"
|
:unchecked-value="false"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
field="meta.hideInMenu"
|
field="hideInMenu"
|
||||||
label="隐藏"
|
label="隐藏"
|
||||||
>
|
>
|
||||||
<a-switch
|
<a-switch
|
||||||
v-model="formData.meta.hideInMenu"
|
v-model="formData.hideInMenu"
|
||||||
:checked-value="true"
|
:checked-value="true"
|
||||||
:unchecked-value="false"
|
:unchecked-value="false"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
field="meta.menuOrder"
|
field="menuOrder"
|
||||||
label="菜单排序"
|
label="菜单排序"
|
||||||
:validate-trigger="['change', 'input']"
|
:validate-trigger="['change', 'input']"
|
||||||
:rules="[{ required: true, message: '请选择菜单排序' }]"
|
:rules="[{ required: true, message: '请选择菜单排序' }]"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
v-model="formData.meta.menuOrder"
|
v-model="formData.menuOrder"
|
||||||
placeholder='请选择菜单排序'
|
placeholder='请输入菜单排序'
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
field="meta.permissions"
|
field="permissions"
|
||||||
label="权限"
|
label="权限"
|
||||||
:validate-trigger="['change', 'input']"
|
:validate-trigger="['change', 'input']"
|
||||||
:rules="[{ required: true, message: '请输入权限' }]"
|
:rules="[{ required: true, message: '请输入权限' }]"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
v-model="formData.meta.permissions[0]"
|
v-model="formData.permissions"
|
||||||
placeholder='请输入权限'
|
placeholder='请输入权限'
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@ -145,16 +145,17 @@
|
|||||||
import { computed, PropType, ref } from 'vue';
|
import { computed, PropType, ref } from 'vue';
|
||||||
import { FormInstance } from '@arco-design/web-vue/es/form';
|
import { FormInstance } from '@arco-design/web-vue/es/form';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import { createMenu, MenuCreateRecord, MenuRecord, updateMenu } from '@/api/menu';
|
import { createMenu, MenuRecord, MenuUpdateRecord, queryMenuDetail, updateMenu } from '@/api/menu';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
menu: {
|
|
||||||
type: Object as PropType<MenuRecord>,
|
|
||||||
},
|
|
||||||
menuData: {
|
menuData: {
|
||||||
type: Object as PropType<MenuRecord>,
|
type: Object as PropType<MenuRecord>,
|
||||||
},
|
},
|
||||||
isCreate: Boolean,
|
isCreate: Boolean,
|
||||||
|
id: {
|
||||||
|
type: Number,
|
||||||
|
default: -1
|
||||||
|
}
|
||||||
});
|
});
|
||||||
const modalTitle = computed(() => {
|
const modalTitle = computed(() => {
|
||||||
return props.isCreate ? '新建菜单' : '编辑菜单';
|
return props.isCreate ? '新建菜单' : '编辑菜单';
|
||||||
@ -162,31 +163,25 @@
|
|||||||
const { visible, setVisible } = useVisible(false);
|
const { visible, setVisible } = useVisible(false);
|
||||||
const createEditRef = ref<FormInstance>();
|
const createEditRef = ref<FormInstance>();
|
||||||
|
|
||||||
const formData = ref<MenuCreateRecord>({
|
const formData = ref<MenuUpdateRecord>({
|
||||||
type: '',
|
type: '',
|
||||||
name: '',
|
name: '',
|
||||||
path: '',
|
path: '',
|
||||||
meta: {
|
locale: '',
|
||||||
icon: '',
|
icon: '',
|
||||||
locale: '',
|
requiresAuth: true,
|
||||||
requiresAuth: false,
|
hideInMenu: false,
|
||||||
hideInMenu: false,
|
menuOrder: 0,
|
||||||
menuOrder: '0',
|
permissions:''
|
||||||
permissions: [],
|
});
|
||||||
order: 0,
|
|
||||||
showInMenu: false
|
|
||||||
},
|
|
||||||
...props.menu,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
const typeOptions = computed(() => [
|
const typeOptions = computed(() => [
|
||||||
{
|
{
|
||||||
label: '菜单',
|
label: '页面',
|
||||||
value: 1,
|
value: 'PAGE',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '权限',
|
label: '操作',
|
||||||
value: 2,
|
value: "OPERATION",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -195,6 +190,11 @@
|
|||||||
// 组件被点击
|
// 组件被点击
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
|
if(!props.isCreate){
|
||||||
|
queryMenuDetail(props.id).then(res => {
|
||||||
|
formData.value = res.data;
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 提交
|
// 提交
|
||||||
|
@ -132,6 +132,7 @@
|
|||||||
<MenuEdit
|
<MenuEdit
|
||||||
ref="editRef"
|
ref="editRef"
|
||||||
:menu="record"
|
:menu="record"
|
||||||
|
:id="record.id"
|
||||||
:menuData="renderData"
|
:menuData="renderData"
|
||||||
:is-create="false"
|
:is-create="false"
|
||||||
@refresh="search"
|
@refresh="search"
|
||||||
|
@ -52,35 +52,12 @@
|
|||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="9">
|
|
||||||
<a-form-item
|
|
||||||
field="email"
|
|
||||||
label="Email"
|
|
||||||
>
|
|
||||||
<a-input
|
|
||||||
v-model="formModel.email"
|
|
||||||
placeholder="请输入Email"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="9">
|
|
||||||
<a-form-item
|
|
||||||
field="enableState"
|
|
||||||
label="请选择状态"
|
|
||||||
>
|
|
||||||
<a-select
|
|
||||||
v-model="formModel.enableState"
|
|
||||||
:options="statusOptions"
|
|
||||||
placeholder="请选择状态"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-divider style="height: 84px" direction="vertical" />
|
<!-- <a-divider style="height: 84px" direction="vertical" />-->
|
||||||
<a-col :flex="'86px'" style="text-align: right">
|
<a-col :flex="'86px'" style="text-align: right">
|
||||||
<a-space direction="vertical" :size="18">
|
<a-space :size="18">
|
||||||
<a-button type="primary" @click="search">
|
<a-button type="primary" @click="search">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<icon-search />
|
<icon-search />
|
||||||
@ -188,7 +165,6 @@
|
|||||||
:size="size"
|
:size="size"
|
||||||
style="margin-bottom: 40px"
|
style="margin-bottom: 40px"
|
||||||
:filter-icon-align-left="alignLeft"
|
:filter-icon-align-left="alignLeft"
|
||||||
@change="handleSortChange"
|
|
||||||
@page-change="onPageChange"
|
@page-change="onPageChange"
|
||||||
>
|
>
|
||||||
<template #index="{ rowIndex }">
|
<template #index="{ rowIndex }">
|
||||||
@ -247,9 +223,7 @@
|
|||||||
import { computed, onMounted, ref, watch } from 'vue';
|
import { computed, onMounted, ref, watch } from 'vue';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { UserRecord, UserParams } from '@/api/user';
|
import { UserRecord, UserParams } from '@/api/user';
|
||||||
// import { getAllDeptTree } from '@/api/dept';
|
|
||||||
import { Pagination } from '@/types/global';
|
import { Pagination } from '@/types/global';
|
||||||
import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
|
|
||||||
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
|
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
|
||||||
import { useUserStore } from '@/store';
|
import { useUserStore } from '@/store';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
@ -345,17 +319,7 @@ const columns = computed<TableColumnData[]>(() => [
|
|||||||
slotName: 'operations',
|
slotName: 'operations',
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const statusOptions = computed<SelectOptionData[]>(() => [
|
|
||||||
{
|
|
||||||
label: '启用',
|
|
||||||
value: 'true',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '停用',
|
|
||||||
value: 'false',
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
// const deptTreeData = ref<any[]>([]);
|
|
||||||
|
|
||||||
// 获取用户列表
|
// 获取用户列表
|
||||||
const fetchData = async (
|
const fetchData = async (
|
||||||
@ -435,7 +399,6 @@ const reset = () => {
|
|||||||
|
|
||||||
// 表格内部排序
|
// 表格内部排序
|
||||||
const alignLeft = ref(false);
|
const alignLeft = ref(false);
|
||||||
const handleSortChange = (data: any, extra: any, currentDataSource: any) => {};
|
|
||||||
|
|
||||||
// 是否启用
|
// 是否启用
|
||||||
const enabledStatus = async (record: any) => {
|
const enabledStatus = async (record: any) => {
|
||||||
|
@ -179,9 +179,7 @@
|
|||||||
|
|
||||||
// 数据条数改变
|
// 数据条数改变
|
||||||
const onSizeChange = (total: number) => {
|
const onSizeChange = (total: number) => {
|
||||||
setPagination({
|
pagination.total = total;
|
||||||
total,
|
|
||||||
})
|
|
||||||
search();
|
search();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@
|
|||||||
|
|
||||||
// 分页发生改变
|
// 分页发生改变
|
||||||
const onPageChange = (current: number) => {
|
const onPageChange = (current: number) => {
|
||||||
pagination.pages = current;
|
pagination.page = current;
|
||||||
pagination.current = current;
|
pagination.current = current;
|
||||||
search();
|
search();
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user