菜单关联专题分类,引导页接口对接,右侧菜单增加专题参数。

dianlixunjian
刘妍 2024-06-29 16:49:46 +08:00
parent 63862f13f5
commit e24e0436ff
5 changed files with 76 additions and 65 deletions

View File

@ -68,12 +68,13 @@ enum Api {
DeleteNotice = '/api/DroneCaseinfo/UpdateDelMessage',
UserList = '/api/users/load',
// StatisticalList='/api/DroneCaseinfo/CaseSynthesisCensus',
StatisticalList = "/api/DroneCaseinfo/CaseSynthesisCensusSingle",
StatisticalListExport = "/api/DroneCaseinfo/ExportCaseSynthesisCensusStreet",
LoadNoticeDetail="/api/DroneCaseinfo/LoadMessage",
StatisticalList = '/api/DroneCaseinfo/CaseSynthesisCensusSingle',
StatisticalListExport = '/api/DroneCaseinfo/ExportCaseSynthesisCensusStreet',
LoadNoticeDetail = '/api/DroneCaseinfo/LoadMessage',
getChildrenTree = '/api/Orgs/LoadChildren',
GetUserRoles = '/api/Roles/UserRoles',
GetUserOrgs = '/api/Orgs/UserOrgs',
GetSpecialData = '/api/Specialcolumn/GetDataColName',
}
export const getPositionsTree = (params?: AccountParams) =>
@ -103,7 +104,7 @@ export const loadForRole = (params?: DeptListItem) =>
export const loadByRole = (params?: DeptListItem) =>
defHttp.get<DeptListGetResultModel>({ url: Api.LoadByRole, params });
export const getChildrenTree = (params:{parentId:number}) =>
export const getChildrenTree = (params: { parentId: number }) =>
defHttp.get({ url: Api.getChildrenTree, params });
export function addAccount(params) {
@ -266,81 +267,62 @@ export const getLoadDataBaseLinkTree = () => defHttp.get({ url: Api.LoadDataBase
export const getPosInfo = (params) => defHttp.get({ url: Api.GetPosInfo, params });
export const getUserRoles = (params) => defHttp.get({ url: Api.GetUserRoles, params });
export const getUserOrgs = (params) => defHttp.get({ url: Api.GetUserOrgs, params });
export const getReportList = (params: ReportParams)=>
export const getReportList = (params: ReportParams) =>
defHttp.get<ReportListGetResultModel>({ url: Api.ReportList, params });
export const getStatisticalList = (params: ReportParams)=>
export const getStatisticalList = (params: ReportParams) =>
defHttp.get<StatisticalListGetResultModel>({ url: Api.StatisticalList, params });
export const exportStatisticalList = (params:ReportParams)=>{
return defHttp.post(
{
url: Api.StatisticalListExport,
params,
},
);
}
export const exportStatisticalList = (params: ReportParams) => {
return defHttp.post({
url: Api.StatisticalListExport,
params,
});
};
export const getNoticeList = (params?:Object) =>
defHttp.get<NoticeListGetResultModel>({url:Api.NoticeList,params})
export const getNoticeList = (params?: Object) =>
defHttp.get<NoticeListGetResultModel>({ url: Api.NoticeList, params });
export function addNotice(params) {
return defHttp.post(
{
url: Api.AddNotice,
params,
},
);
return defHttp.post({
url: Api.AddNotice,
params,
});
}
export function updateNotice(params) {
return defHttp.post(
{
url: Api.UpdateNotice,
params,
},
);
return defHttp.post({
url: Api.UpdateNotice,
params,
});
}
export function deleteNotice(params) {
return defHttp.post(
{
url: Api.DeleteNotice,
params,
},
);
return defHttp.post({
url: Api.DeleteNotice,
params,
});
}
export function getNoticeDetail(params) {
return defHttp.get(
{
url: Api.LoadNoticeDetail,
params,
},
);
return defHttp.get({
url: Api.LoadNoticeDetail,
params,
});
}
export function getCaseInfoList(params){
return defHttp.get(
{
url: Api.ReportList,
params,
},
);
export function getCaseInfoList(params) {
return defHttp.get({
url: Api.ReportList,
params,
});
}
export const getUserList = (params: UserListParams)=>
export const getUserList = (params: UserListParams) =>
defHttp.get<UserListGetResultModel>({ url: Api.UserList, params });
export const getSpecialData = () => defHttp.get({ url: Api.GetSpecialData });

View File

@ -314,8 +314,7 @@ export const usePermissionStore = defineStore({
//通过后端获取菜单
const _this = this;
async function buildMenusByServer(list) {
console.log(userStore.getSubject);
const data = await getMenuList({ subject: userStore.getSubject });
const data = await getMenuList({ typeId: userStore.getSubject });
const moduleRoutes = list;
await data.forEach((value) => {
moduleRoutes.push(normalizeMenu(value));

View File

@ -66,7 +66,7 @@ export const useUserStore = defineStore({
async setSubject(subject: string | undefined) {
this.subject = subject;
setAuthCache(SUBJECT_KEY, subject);
if (subject) {
if (subject != undefined) {
const permissionStore = usePermissionStore();
await permissionStore.buildRoutesAction();
await router.replace(PageEnum.BASE_HOME);

View File

@ -2,6 +2,7 @@ import { BasicColumn, FormSchema } from '@/components/Table';
import { h } from 'vue';
import { Tag } from 'ant-design-vue';
import Icon from '@/components/Icon/Icon.vue';
import { getSpecialData } from '@/api/demo/system';
export const columns: BasicColumn[] = [
{
@ -109,6 +110,26 @@ export const formSchema: FormSchema[] = [
required: true,
ifShow: ({ values }) => isButton(values.type),
},
{
field: 'moduleTypeId',
label: '专题',
component: 'ApiSelect',
colProps: {
span: 24,
},
componentProps: () => {
return {
api: getSpecialData,
params: {
code: 'FormSort',
},
resultField: '',
labelField: 'title',
valueField: 'id',
};
},
ifShow: ({ values }) => !isButton(values.type),
},
{
field: 'sortNo',
label: '排序',
@ -139,7 +160,6 @@ export const formSchema: FormSchema[] = [
field: 'url',
label: '路由地址',
component: 'Input',
required: true,
ifShow: ({ values }) => !isButton(values.type),
},
// {

View File

@ -1,16 +1,26 @@
<template>
<div>
<a-button @click="goHome('林业专题')"> </a-button>
<a-button @click="goHome('矿产专题')"> </a-button>
<a-button v-for="item in list" :key="item.id" @click="goHome(item.id)">
{{ item.title }}
</a-button>
<a-button @click="goHome('')"> </a-button>
</div>
</template>
<script setup lang="ts">
import { PageEnum } from '@/enums/pageEnum';
import { router } from '@/router';
import { useUserStore } from '@/store/modules/user';
import { getSpecialData } from '@/api/demo/system';
import { onMounted, ref } from 'vue';
const list: any = ref([]);
const userStore = useUserStore();
async function getData() {
const res = await getSpecialData();
console.log(res);
list.value = res;
}
onMounted(() => {
getData();
});
async function goHome(name) {
console.log(name);
userStore.setSubject(name);