diff --git a/src/api/demo/system.ts b/src/api/demo/system.ts index b055b1d2..8f976942 100644 --- a/src/api/demo/system.ts +++ b/src/api/demo/system.ts @@ -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({ 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({ url: Api.ReportList, params }); - - -export const getStatisticalList = (params: ReportParams)=> +export const getStatisticalList = (params: ReportParams) => defHttp.get({ 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({url:Api.NoticeList,params}) +export const getNoticeList = (params?: Object) => + defHttp.get({ 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({ url: Api.UserList, params }); +export const getSpecialData = () => defHttp.get({ url: Api.GetSpecialData }); diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index 403f9352..d95bb69c 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -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)); diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 3f6c5935..a6964f0e 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -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); diff --git a/src/views/demo/system/menu/menu.data.ts b/src/views/demo/system/menu/menu.data.ts index fe36fd3f..2238d352 100644 --- a/src/views/demo/system/menu/menu.data.ts +++ b/src/views/demo/system/menu/menu.data.ts @@ -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), }, // { diff --git a/src/views/subject/index.vue b/src/views/subject/index.vue index 38825777..07c4dc9d 100644 --- a/src/views/subject/index.vue +++ b/src/views/subject/index.vue @@ -1,16 +1,26 @@