feat(system): 优化菜单管理功能
- 修改菜单查询接口,增加按名称搜索功能 - 更新消息管理相关接口路径 - 优化菜单编辑组件,使用树形结构选择父级菜单 - 移除产品 TSL 组件中的冗余代码
This commit is contained in:
parent
8421ce2836
commit
9f98fe832a
@ -23,8 +23,14 @@ export interface MenuCreateRecord extends MenuRecord{
|
|||||||
type: string;
|
type: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const queryMenuList = () => {
|
export const queryMenuList = (data: string) => {
|
||||||
return axios.get('/api/rest/menu');
|
return axios({
|
||||||
|
url: '/api/rest/menu/tree',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
name: data,
|
||||||
|
},
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const createMenu = (data: MenuCreateRecord) => {
|
export const createMenu = (data: MenuCreateRecord) => {
|
||||||
|
@ -56,27 +56,27 @@ export type MessageListType = MessagesList[];
|
|||||||
|
|
||||||
// 查看详情
|
// 查看详情
|
||||||
export function queryMessage(id: number) {
|
export function queryMessage(id: number) {
|
||||||
return axios.get(`/api/rest/message/self/${id}`);
|
return axios.get(`/api/rest/notice/self/${id}`);
|
||||||
}
|
}
|
||||||
// 分页查询
|
// 分页查询
|
||||||
export function queryMessagesList(data: MessagesRecord) {
|
export function queryMessagesList(data: MessagesRecord) {
|
||||||
return axios({
|
return axios({
|
||||||
url: '/api/rest/message/self',
|
url: '/api/rest/notice/self',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: data,
|
params: data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 未读消息数量
|
// 未读消息数量
|
||||||
export function queryMessagesCount() {
|
export function queryMessagesCount() {
|
||||||
return axios.get('/api/rest/message/count-unread');
|
return axios.get('/api/rest/notice/count-unread');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 已读消息数量
|
// 已读消息数量
|
||||||
export function queryMessagesReadCount() {
|
export function queryMessagesReadCount() {
|
||||||
return axios.get('/api/rest/message/acknowledge');
|
return axios.get('/api/rest/notice/acknowledge');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 批量设置消息已读
|
// 批量设置消息已读
|
||||||
export function setMessageStatus(data: MessageStatus) {
|
export function setMessageStatus(data: MessageStatus) {
|
||||||
return axios.patch<MessageListType>('/api/rest/message/read', data);
|
return axios.patch<MessageListType>('/api/rest/notice/read', data);
|
||||||
}
|
}
|
@ -71,8 +71,6 @@
|
|||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
</a-card>
|
</a-card>
|
||||||
</div>
|
|
||||||
|
|
||||||
<a-modal
|
<a-modal
|
||||||
width="900px"
|
width="900px"
|
||||||
height="500px"
|
height="500px"
|
||||||
@ -319,8 +317,7 @@
|
|||||||
<a-button class="editor-button" type="primary" @click="handleSubmit">确定</a-button>
|
<a-button class="editor-button" type="primary" @click="handleSubmit">确定</a-button>
|
||||||
</template>
|
</template>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
@ -371,7 +368,6 @@
|
|||||||
const propertyData = ref([]);
|
const propertyData = ref([]);
|
||||||
const eventData = ref([]);
|
const eventData = ref([]);
|
||||||
const keyValue = ref('1');
|
const keyValue = ref('1');
|
||||||
const paramsData = ref([]);
|
|
||||||
const dataTypeOptions = computed<SelectOptionData[]>(() => [
|
const dataTypeOptions = computed<SelectOptionData[]>(() => [
|
||||||
{
|
{
|
||||||
label: '整型',
|
label: '整型',
|
||||||
|
@ -26,8 +26,15 @@
|
|||||||
field="pid"
|
field="pid"
|
||||||
label="父级菜单名称"
|
label="父级菜单名称"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-tree-select
|
||||||
v-model="formData.pid"
|
v-model="formData.pid"
|
||||||
|
:data="props.menuData"
|
||||||
|
:field-names="{
|
||||||
|
key: 'id',
|
||||||
|
title: 'name',
|
||||||
|
children: 'children',
|
||||||
|
}"
|
||||||
|
:allow-clear="true"
|
||||||
placeholder='请输入父级菜单名称'
|
placeholder='请输入父级菜单名称'
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@ -144,6 +151,9 @@
|
|||||||
menu: {
|
menu: {
|
||||||
type: Object as PropType<MenuRecord>,
|
type: Object as PropType<MenuRecord>,
|
||||||
},
|
},
|
||||||
|
menuData: {
|
||||||
|
type: Object as PropType<MenuRecord>,
|
||||||
|
},
|
||||||
isCreate: Boolean,
|
isCreate: Boolean,
|
||||||
});
|
});
|
||||||
const modalTitle = computed(() => {
|
const modalTitle = computed(() => {
|
||||||
@ -185,6 +195,8 @@
|
|||||||
// 组件被点击
|
// 组件被点击
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
|
console.log(props.menuData);
|
||||||
|
console.log(props.menu);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 提交
|
// 提交
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<a-row :gutter="16">
|
<a-row :gutter="16">
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
field="title"
|
field="name"
|
||||||
label="菜单名称"
|
label="菜单名称"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
@ -47,7 +47,7 @@
|
|||||||
<a-row style="margin-bottom: 16px">
|
<a-row style="margin-bottom: 16px">
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-space>
|
<a-space>
|
||||||
<MenuEdit ref="createRef" :is-create="true" @refresh="search" />
|
<MenuEdit ref="createRef" :is-create="true" :menuData="renderData" @refresh="search" />
|
||||||
</a-space>
|
</a-space>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col
|
<a-col
|
||||||
@ -132,6 +132,7 @@
|
|||||||
<MenuEdit
|
<MenuEdit
|
||||||
ref="editRef"
|
ref="editRef"
|
||||||
:menu="record"
|
:menu="record"
|
||||||
|
:menuData="renderData"
|
||||||
:is-create="false"
|
:is-create="false"
|
||||||
@refresh="search"
|
@refresh="search"
|
||||||
/>
|
/>
|
||||||
@ -181,7 +182,6 @@
|
|||||||
const generateFormModel = () => {
|
const generateFormModel = () => {
|
||||||
return {
|
return {
|
||||||
name: '',
|
name: '',
|
||||||
type: '',
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -221,7 +221,7 @@
|
|||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const res = await queryMenuList();
|
const res = await queryMenuList(formModel.value.name || 'all');
|
||||||
renderData.value = res.data;
|
renderData.value = res.data;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// you can report use errorHandler or other
|
// you can report use errorHandler or other
|
||||||
|
@ -193,7 +193,7 @@
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// 获取公告列表
|
// 获取消息列表
|
||||||
const fetchData = async (
|
const fetchData = async (
|
||||||
params: BulletinsRecord = { size: 10, current: 1 }
|
params: BulletinsRecord = { size: 10, current: 1 }
|
||||||
) => {
|
) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user