diff --git a/src/api/system/menu.ts b/src/api/system/menu.ts index 09c9ca8c..554b2502 100644 --- a/src/api/system/menu.ts +++ b/src/api/system/menu.ts @@ -1,3 +1,13 @@ -import server from '@/utils/request' +import server from '@/utils/request'; -export const queryOwnThree = (data: any) => server.post('/menu/user-own/tree', data) \ No newline at end of file +// 获取当前用户可访问菜单 +export const getMenuTree_api = (data: object) => server.post(`/menu/_all/tree`, data); + +export const queryOwnThree = (data: any) => server.post('/menu/user-own/tree', data) + + + +// 获取资产类型 +export const getAssetsType_api = () => server.get(`/asset/types`); +// 获取菜单详情 +export const getMenuDetail_api = (id:string) => server.get(`/menu/${id}`); diff --git a/src/router/menu.ts b/src/router/menu.ts index a61802b3..d878838b 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -117,6 +117,14 @@ export default [ path:'/system/Permission', component: ()=>import('@/views/system/Permission/index.vue') }, + { + path:'/system/Menu', + component: ()=>import('@/views/system/Menu/index.vue') + }, + { + path:'/system/Menu/detail/:id', + component: ()=>import('@/views/system/Menu/Detail/index.vue') + }, // 初始化 { path: '/init-home', diff --git a/src/utils/comm.ts b/src/utils/comm.ts index 52fed207..e7b4363f 100644 --- a/src/utils/comm.ts +++ b/src/utils/comm.ts @@ -76,30 +76,3 @@ export function getSlotVNode(slots: Slots, props: Record, pr } return (props[prop] || slots[prop]?.()) as T; } - -/** - * 时间转换为'2022-01-02 14:03:05' - * @param date 时间对象 - * @returns - */ -export const dateFormat = (dateSouce:any):string|Error => { - let date = null - try { - date = new Date(dateSouce) - } catch (error) { - return new Error('请传入日期格式数据') - } - let year = date.getFullYear(); - let month: number | string = date.getMonth() + 1; - let day: number | string = date.getDate(); - let hour: number | string = date.getHours(); - let minutes: number | string = date.getMinutes(); - let seconds: number | string = date.getSeconds(); - month = (month < 10) ? '0' + month : month; - day = (day < 10) ? '0' + day : day; - hour = (hour < 10) ? '0' + hour : hour; - minutes = (minutes < 10) ? '0' + minutes : minutes; - seconds = (seconds < 10) ? '0' + seconds : seconds; - return year + "-" + month + "-" + day - + " " + hour + ":" + minutes + ":" + seconds; -} diff --git a/src/views/home/components/dialogs/DeviceChooseDialog.vue b/src/views/home/components/dialogs/DeviceChooseDialog.vue index 18a03947..ecb16650 100644 --- a/src/views/home/components/dialogs/DeviceChooseDialog.vue +++ b/src/views/home/components/dialogs/DeviceChooseDialog.vue @@ -22,7 +22,9 @@ }" > + + + + diff --git a/src/views/system/Menu/Detail/ButtonMange.vue b/src/views/system/Menu/Detail/ButtonMange.vue new file mode 100644 index 00000000..6c55ec8d --- /dev/null +++ b/src/views/system/Menu/Detail/ButtonMange.vue @@ -0,0 +1,18 @@ + + + + + \ No newline at end of file diff --git a/src/views/system/Menu/Detail/index.vue b/src/views/system/Menu/Detail/index.vue new file mode 100644 index 00000000..08de6fd6 --- /dev/null +++ b/src/views/system/Menu/Detail/index.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/src/views/system/Menu/index.d.ts b/src/views/system/Menu/index.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/src/views/system/Menu/index.vue b/src/views/system/Menu/index.vue new file mode 100644 index 00000000..7ff407f3 --- /dev/null +++ b/src/views/system/Menu/index.vue @@ -0,0 +1,247 @@ + + + + +