From e550fe67e502aeb0e8f629657cfb0d61ec46f966 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Tue, 31 Jan 2023 11:35:54 +0800 Subject: [PATCH 01/14] =?UTF-8?q?update:=201.=E4=BC=98=E5=8C=96=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/initHome.ts | 2 +- src/main.ts | 11 +-- src/router/index.ts | 21 ++--- src/router/menu.ts | 184 ++++++++++++++++++++++---------------------- src/store/menu.ts | 3 +- src/utils/menu.ts | 20 +++-- src/views/404.vue | 14 ++++ 7 files changed, 134 insertions(+), 121 deletions(-) create mode 100644 src/views/404.vue diff --git a/src/api/initHome.ts b/src/api/initHome.ts index 658a3394..daf6d767 100644 --- a/src/api/initHome.ts +++ b/src/api/initHome.ts @@ -1,7 +1,7 @@ import server from '@/utils/request'; // 更新全部菜单 -export const updateMenus = (data: any) => server.path(`/menu/iot/_all`, data) +export const updateMenus = (data: any) => server.patch(`/menu/iot/_all`, data) // 添加角色 export const addRole = (data: any) => server.post(`/role`, data) diff --git a/src/main.ts b/src/main.ts index c69804cf..1f0b04d5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,17 +1,14 @@ import { createApp } from 'vue' import App from './App.vue' import store from './store' -import router from './router' import components from './components' +import router from './router' import './style.less' import 'ant-design-vue/es/notification/style/css'; -import Antd from 'ant-design-vue/es' const app = createApp(App) -app.use(store) app.use(router) -app.use(components) -app.use(Antd) - -app.mount('#app') + .use(store) + .use(components) + .mount('#app') diff --git a/src/router/index.ts b/src/router/index.ts index 91ae60a0..6b89d003 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -3,6 +3,8 @@ import menus, { LoginPath } from './menu' import { cleanToken, getToken } from '@/utils/comm' import { useUserInfo } from '@/store/userInfo' import { useSystem } from '@/store/system' +import NotFindPage from '@/views/404.vue' +import { useMenuStore } from 'store/menu' const router = createRouter({ history: createWebHashHistory(), @@ -27,22 +29,23 @@ router.beforeEach((to, from, next) => { } else { const userInfo = useUserInfo() const system = useSystem() + const menu = useMenuStore() - if (!userInfo.userInfos.username) { + if (!menu.menuData.length) { userInfo.getUserInfo().then(() => { system.getSystemVersion().then((menuData: any[]) => { menuData.forEach(r => { - router.addRoute('main', r) + router.addRoute('base', r) }) - const redirect = decodeURIComponent((from.query.redirect as string) || to.path) - if(to.path === redirect) { - next({ ...to, replace: true }) - } else { - next({ path: redirect }) - } + + router.addRoute('base',{ + path: '/:pathMatch(.*)*', + component: () => NotFindPage + }) + console.log(to) + next({ ...to, replace: true }) }) }).catch(() => { - console.log('userInfo', userInfo) cleanToken() next({ path: LoginPath }) }) diff --git a/src/router/menu.ts b/src/router/menu.ts index d086ddf5..056aa40d 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -32,10 +32,10 @@ export default [ path: '/account/center/bind', component: () => import('@/views/account/Center/bind/index.vue') }, - { - path: '/iot/home', - component: () => import('@/views/home/index.vue') - }, + // { + // path: '/iot/home', + // component: () => import('@/views/home/index.vue') + // }, { path: '/table', component: () => import('@/views/demo/table/index.vue') @@ -48,107 +48,107 @@ export default [ path: '/search', component: () => import('@/views/demo/Search.vue') }, - { - path: '/notice/Config', - component: () => import('@/views/notice/Config/index.vue') - }, - { - path: '/notice/Config/detail/:id', - component: () => import('@/views/notice/Config/Detail/index.vue') - }, - { - path: '/notice/Template', - component: () => import('@/views/notice/Template/index.vue') - }, - { - path: '/notice/Template/detail/:id', - component: () => import('@/views/notice/Template/Detail/index.vue') - }, + // { + // path: '/notice/Config', + // component: () => import('@/views/notice/Config/index.vue') + // }, + // { + // path: '/notice/Config/detail/:id', + // component: () => import('@/views/notice/Config/Detail/index.vue') + // }, + // { + // path: '/notice/Template', + // component: () => import('@/views/notice/Template/index.vue') + // }, + // { + // path: '/notice/Template/detail/:id', + // component: () => import('@/views/notice/Template/Detail/index.vue') + // }, // end: 测试用, 可删除 // 设备管理 - { - path: '/device/Instance', - component: () => import('@/views/device/Instance/index.vue') - }, + // { + // path: '/device/Instance', + // component: () => import('@/views/device/Instance/index.vue') + // }, // link 运维管理 - { - path: '/link/log', - component: () => import('@/views/link/Log/index.vue') - }, - { - path: '/link/certificate', - component: () => import('@/views/link/Certificate/index.vue') - }, - { - path: '/link/certificate/detail/add', - component: () => import('@/views/link/Certificate/Detail/index.vue') - }, - { - path: '/link/accessConfig', - component: () => import('@/views/link/AccessConfig/index.vue') - }, - { - path: '/link/accessConfig/detail/add', - component: () => import('@/views/link/AccessConfig/Detail/index.vue') - }, + // { + // path: '/link/log', + // component: () => import('@/views/link/Log/index.vue') + // }, + // { + // path: '/link/certificate', + // component: () => import('@/views/link/Certificate/index.vue') + // }, + // { + // path: '/link/certificate/detail/add', + // component: () => import('@/views/link/Certificate/Detail/index.vue') + // }, + // { + // path: '/link/accessConfig', + // component: () => import('@/views/link/AccessConfig/index.vue') + // }, + // { + // path: '/link/accessConfig/detail/add', + // component: () => import('@/views/link/AccessConfig/Detail/index.vue') + // }, // system 系统管理 - { - path:'/system/Basis', - component: ()=>import('@/views/system/Basis/index.vue') - }, - { - path:'/system/api', - component: ()=>import('@/views/system/apiPage/index.vue') - }, - { - path:'/system/Role', - component: ()=>import('@/views/system/Role/index.vue') - }, - { - path:'/system/Role/detail/:id', - component: ()=>import('@/views/system/Role/Detail/index.vue') - }, - { - path:'/system/Permission', - component: ()=>import('@/views/system/Permission/index.vue') - }, + // { + // path:'/system/Basis', + // component: ()=>import('@/views/system/Basis/index.vue') + // }, + // { + // path:'/system/api', + // component: ()=>import('@/views/system/apiPage/index.vue') + // }, + // { + // path:'/system/Role', + // component: ()=>import('@/views/system/Role/index.vue') + // }, + // { + // path:'/system/Role/detail/:id', + // component: ()=>import('@/views/system/Role/Detail/index.vue') + // }, + // { + // path:'/system/Permission', + // component: ()=>import('@/views/system/Permission/index.vue') + // }, // 初始化 { path: '/init-home', component: () => import('@/views/init-home/index.vue') }, // 物联卡 iot-card - { - path: '/iot-card/Home', - component: () => import('@/views/iot-card/Home/index.vue') - }, - { - path: '/iot-card/Dashboard', - component: () => import('@/views/iot-card/Dashboard/index.vue') - }, - { - path: '/iot-card/CardManagement', - component: () => import('@/views/iot-card/CardManagement/index.vue') - }, + // { + // path: '/iot-card/Home', + // component: () => import('@/views/iot-card/Home/index.vue') + // }, + // { + // path: '/iot-card/Dashboard', + // component: () => import('@/views/iot-card/Dashboard/index.vue') + // }, + // { + // path: '/iot-card/CardManagement', + // component: () => import('@/views/iot-card/CardManagement/index.vue') + // }, // 北向输出 - { - path: '/northbound/DuerOS', - component: () => import('@/views/northbound/DuerOS/index.vue') - }, - { - path: '/northbound/AliCloud', - component: () => import('@/views/northbound/AliCloud/index.vue') - }, + // { + // path: '/northbound/DuerOS', + // component: () => import('@/views/northbound/DuerOS/index.vue') + // }, + // { + // path: '/northbound/AliCloud', + // component: () => import('@/views/northbound/AliCloud/index.vue') + // }, // 产品分类 - { - path: '/iot/device/Category', - component: () => import('@/views/device/Category/index.vue') - } , + // { + // path: '/iot/device/Category', + // component: () => import('@/views/device/Category/index.vue') + // } , // 产品 - { - path: '/iot/device/Product', - component: () => import('@/views/device/Product/index.vue') - } + // { + // path: '/iot/device/Product', + // component: () => import('@/views/device/Product/index.vue') + // } ] \ No newline at end of file diff --git a/src/store/menu.ts b/src/store/menu.ts index 42f1946d..70e1ced9 100644 --- a/src/store/menu.ts +++ b/src/store/menu.ts @@ -6,6 +6,7 @@ export const useMenuStore = defineStore({ id: 'menu', state: () => ({ menus: {}, + menuData: [], menusKey: [] }), getters: { @@ -59,7 +60,7 @@ export const useMenuStore = defineStore({ hideInMenu: true } }) - this.menus = menus + this.menuData = menus res(menus) } }) diff --git a/src/utils/menu.ts b/src/utils/menu.ts index 22230e84..e860b162 100644 --- a/src/utils/menu.ts +++ b/src/utils/menu.ts @@ -1,4 +1,4 @@ -const pagesComponent = import.meta.glob('../views/system/**/*.vue', { eager: true }); +const pagesComponent = import.meta.glob('../views/**/*.vue', { eager: true }); import { BlankLayoutPage, BasicLayoutPage } from 'components/Layout' type ExtraRouteItem = { @@ -61,13 +61,11 @@ const extraRouteObj = { const resolveComponent = (name: any) => { // TODO 暂时用system进行测试 const importPage = pagesComponent[`../views/${name}/index.vue`]; - // if (!importPage) { - // throw new Error(`Unknown page ${name}. Is it located under Pages with a .vue extension?`); - // } - + if (!importPage) { + console.warn(`Unknown page ${name}. Is it located under Pages with a .vue extension?`) + } //@ts-ignore - return !importPage ? BlankLayoutPage : importPage.default - // return importPage.default + return !!importPage ? importPage.default : BlankLayoutPage } const findChildrenRoute = (code: string, url: string): ExtraRouteItem[] => { @@ -85,7 +83,7 @@ const findChildrenRoute = (code: string, url: string): ExtraRouteItem[] => { export function filterAsnycRouter(asyncRouterMap: any, parentCode = '', level = 1) { return asyncRouterMap.map((route: any) => { - + console.log(route.name, route) route.path = `${route.url}` route.meta = { icon: route.icon, @@ -93,11 +91,11 @@ export function filterAsnycRouter(asyncRouterMap: any, parentCode = '', level = } // 查看是否有隐藏子路由 - route.children = route.children && route.children.length ? [...route.children, ...findChildrenRoute(route.code, route.url)] : findChildrenRoute(route.code, route.url) + const extraChildren = findChildrenRoute(route.code, route.url) + route.children = route.children && route.children.length ? [...route.children, ...extraChildren] : extraChildren // TODO 查看是否具有详情页 // route.children = [...route.children, ] - if (route.children && route.children.length) { route.component = () => level === 1 ? BasicLayoutPage : BlankLayoutPage route.children = filterAsnycRouter(route.children, `${parentCode}/${route.code}`, level + 1) @@ -105,7 +103,7 @@ export function filterAsnycRouter(asyncRouterMap: any, parentCode = '', level = } else { route.component = resolveComponent(route.code); } - console.log(route.code, route) + return route }) } \ No newline at end of file diff --git a/src/views/404.vue b/src/views/404.vue new file mode 100644 index 00000000..7794d959 --- /dev/null +++ b/src/views/404.vue @@ -0,0 +1,14 @@ + + + + + \ No newline at end of file From 3f8aba0a8c500403ead7fb3fe45430ca59a698ff Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Tue, 31 Jan 2023 16:51:48 +0800 Subject: [PATCH 02/14] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=8D=A1=E7=89=87=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CardBox/index.vue | 7 +++++++ src/router/menu.ts | 4 ++++ src/views/device/Instance/index.vue | 1 + src/views/northbound/DuerOS/Save/index.vue | 3 +++ src/views/northbound/DuerOS/index.vue | 2 +- 5 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/views/northbound/DuerOS/Save/index.vue diff --git a/src/components/CardBox/index.vue b/src/components/CardBox/index.vue index cb958ce7..0915064a 100644 --- a/src/components/CardBox/index.vue +++ b/src/components/CardBox/index.vue @@ -231,6 +231,13 @@ const handleClick = () => { :deep(.card-item-content-title) { cursor: pointer; + font-size: 16px; + font-weight: 700; + color: @primary-color; + width: calc(100% - 100px); + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; } :deep(.card-item-heard-name) { diff --git a/src/router/menu.ts b/src/router/menu.ts index 234bcabf..22aaecec 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -150,6 +150,10 @@ export default [ path: '/northbound/DuerOS', component: () => import('@/views/northbound/DuerOS/index.vue') }, + { + path: '/northbound/DuerOS/detail/:id', + component: () => import('@/views/northbound/DuerOS/Save/index.vue') + }, { path: '/northbound/AliCloud', component: () => import('@/views/northbound/AliCloud/index.vue') diff --git a/src/views/device/Instance/index.vue b/src/views/device/Instance/index.vue index 52fd4ef4..11656160 100644 --- a/src/views/device/Instance/index.vue +++ b/src/views/device/Instance/index.vue @@ -1,4 +1,5 @@ \ No newline at end of file diff --git a/src/views/northbound/DuerOS/index.vue b/src/views/northbound/DuerOS/index.vue index f8ab376f..520d60bd 100644 --- a/src/views/northbound/DuerOS/index.vue +++ b/src/views/northbound/DuerOS/index.vue @@ -148,7 +148,7 @@ const getActions = (data: Partial>): ActionsType[] => { } const add = () => { - message.warn('123') + // router.push(`/northbound/DuerOS/detail/:id`) } \ No newline at end of file From 8e2e0de679520cf8fa27163bb827c2d51aa2d224 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Tue, 31 Jan 2023 17:50:47 +0800 Subject: [PATCH 03/14] =?UTF-8?q?update:=201.=E4=BC=98=E5=8C=96=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E8=B7=AF=E7=94=B1,=E5=A4=84=E7=90=86=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=BC=8F=EF=BC=9B=E4=BC=98?= =?UTF-8?q?=E5=8C=96layout=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Layout/BasicLayoutPage.vue | 3 +- .../Layout/components/Header/index.tsx | 2 +- .../components/SiderMenu/SiderMenu.less | 4 + src/main.ts | 4 +- src/router/index.ts | 6 +- src/router/menu.ts | 2 +- src/store/menu.ts | 7 +- src/utils/menu.ts | 157 +++++++++++++++--- src/views/home/index.vue | 125 +++++++------- 9 files changed, 220 insertions(+), 90 deletions(-) diff --git a/src/components/Layout/BasicLayoutPage.vue b/src/components/Layout/BasicLayoutPage.vue index 054f54ad..ebc3adc4 100644 --- a/src/components/Layout/BasicLayoutPage.vue +++ b/src/components/Layout/BasicLayoutPage.vue @@ -21,6 +21,7 @@ import { ProLayout } from '@/components/Layout' import DefaultSetting from '../../../config/config' import { useMenuStore } from '@/store/menu' +import { clearMenuItem } from 'components/Layout/utils' type StateType = { collapsed: boolean @@ -39,7 +40,7 @@ const layoutConf = reactive({ siderWidth: DefaultSetting.layout.siderWidth, logo: DefaultSetting.layout.logo, title: DefaultSetting.layout.title, - menuData: menu.menus, + menuData: clearMenuItem(menu.siderMenus), }); const state = reactive({ diff --git a/src/components/Layout/components/Header/index.tsx b/src/components/Layout/components/Header/index.tsx index c4bfc014..a804a3a2 100644 --- a/src/components/Layout/components/Header/index.tsx +++ b/src/components/Layout/components/Header/index.tsx @@ -32,7 +32,7 @@ export const HeaderView = defineComponent({ height: `${headerHeight.value}px`, lineHeight: `${headerHeight.value}px`, width: `100%`, - + background: 'transparent' }} /> { menuData.forEach(r => { router.addRoute('base', r) }) - router.addRoute('base',{ - path: '/:pathMatch(.*)*', + path: '/:pathMatch(.*)', + name: 'error', component: () => NotFindPage }) - console.log(to) + next({ ...to, replace: true }) }) }).catch(() => { diff --git a/src/router/menu.ts b/src/router/menu.ts index 056aa40d..7e97e255 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -18,7 +18,7 @@ export default [ // path: '/initsetting', // component: () => import('@/view/Login/initSet.vue') // } - + { path: '/*', redirect: '/'}, // start: 测试用, 可删除 { path: '/login', diff --git a/src/store/menu.ts b/src/store/menu.ts index 70e1ced9..7d1a675e 100644 --- a/src/store/menu.ts +++ b/src/store/menu.ts @@ -1,12 +1,14 @@ import { defineStore } from "pinia"; import { queryOwnThree } from '@/api/system/menu' import { filterAsnycRouter } from '@/utils/menu' +import { cloneDeep } from 'lodash-es' export const useMenuStore = defineStore({ id: 'menu', state: () => ({ menus: {}, menuData: [], + siderMenus: [], menusKey: [] }), getters: { @@ -52,7 +54,8 @@ export const useMenuStore = defineStore({ ]; const resp = await queryOwnThree({ paging: false, terms: params }) if (resp.success) { - const menus = filterAsnycRouter(resp.result) + const silderMenus = filterAsnycRouter(cloneDeep(resp.result)) + const menus = filterAsnycRouter(cloneDeep(resp.result)) menus.push({ path: '/', redirect: menus[0]?.path, @@ -61,6 +64,8 @@ export const useMenuStore = defineStore({ } }) this.menuData = menus + this.siderMenus = silderMenus + console.log('silderMenus', silderMenus) res(menus) } }) diff --git a/src/utils/menu.ts b/src/utils/menu.ts index e860b162..2907f1c2 100644 --- a/src/utils/menu.ts +++ b/src/utils/menu.ts @@ -1,11 +1,99 @@ const pagesComponent = import.meta.glob('../views/**/*.vue', { eager: true }); import { BlankLayoutPage, BasicLayoutPage } from 'components/Layout' -type ExtraRouteItem = { - code: string - name: string - url?: string -} +/** + * 权限信息 + */ +export type PermissionInfo = { + permission: string; + actions: string[]; +}; + +/** + * 按钮信息 + */ +export type MenuButtonInfo = { + id: string; + name: string; + permissions: PermissionInfo; + createTime: number; + describe?: string; + options: Record; +}; + + +export type MenuItem = { + id: string; + /** + * 名称 + */ + name: string; + /** + * 编码 + */ + code: string; + /** + * 所属应用 + */ + application: string; + /** + * 描述 + */ + describe: string; + /** + * url,路由 + */ + url: string; + /** + * 图标 + */ + icon: string; + /** + * 状态, 0为禁用,1为启用 + */ + status: number; + /** + * 绑定权限信息 + */ + permissions: PermissionInfo[]; + /** + * 按钮定义信息 + */ + buttons: MenuButtonInfo[]; + /** + * 其他配置信息 + */ + options: Record; + /** + * 父级ID + */ + parentId: string; + /** + * 树结构路径 + */ + path: string; + /** + * 排序序号 + */ + sortIndex: number; + /** + * 树层级 + */ + level: number; + createTime: number; + redirect?: string; + children?: MenuItem[]; + accessSupport?: { text: string; value: string }; + appId?: string; //应用id + isShow?: boolean; + meta?: { + title?: string + icon?: string + [key: string]: any + }, + component?: any +}; + // 额外子级路由 const extraRouteObj = { 'media/Cascade': { @@ -59,51 +147,82 @@ const extraRouteObj = { const resolveComponent = (name: any) => { - // TODO 暂时用system进行测试 const importPage = pagesComponent[`../views/${name}/index.vue`]; if (!importPage) { console.warn(`Unknown page ${name}. Is it located under Pages with a .vue extension?`) } //@ts-ignore - return !!importPage ? importPage.default : BlankLayoutPage + return !!importPage ? importPage.default : undefined } -const findChildrenRoute = (code: string, url: string): ExtraRouteItem[] => { +const findChildrenRoute = (code: string, url: string): MenuItem[] => { if (extraRouteObj[code]) { - return extraRouteObj[code].children.map((route: ExtraRouteItem) => { + return extraRouteObj[code].children.map((route: MenuItem) => { return { url: `${url}/${route.code}`, code: route.code, - name: route.name + name: route.name, + isShow: false } }) } return [] } +const findDetailRouteItem = (code: string, url: string): Partial | null => { + const detailComponent = resolveComponent(`${code}/Detail`) + if (detailComponent) { + return { + url: `${url}/Detail/:id`, + component: detailComponent, + name: '详情信息', + isShow: false + } + } + return null +} + +const findDetailRoutes = (routes: any[]): any[] => { + const newRoutes: any[] = [] + routes.forEach((route: any) => { + newRoutes.push(route) + const detail = findDetailRouteItem(route.code, route.url) + if (detail) { + newRoutes.push(detail) + } + }) + return newRoutes +} + export function filterAsnycRouter(asyncRouterMap: any, parentCode = '', level = 1) { + return asyncRouterMap.map((route: any) => { - console.log(route.name, route) + route.path = `${route.url}` route.meta = { icon: route.icon, - title: route.name + title: route.name, + hideInMenu: route.isShow === false } // 查看是否有隐藏子路由 const extraChildren = findChildrenRoute(route.code, route.url) route.children = route.children && route.children.length ? [...route.children, ...extraChildren] : extraChildren - - // TODO 查看是否具有详情页 - // route.children = [...route.children, ] + route.children = findDetailRoutes(route.children) if (route.children && route.children.length) { - route.component = () => level === 1 ? BasicLayoutPage : BlankLayoutPage + // TODO 查看是否具有详情页 route.children = filterAsnycRouter(route.children, `${parentCode}/${route.code}`, level + 1) - route.redirect = route.children[0].url + const showChildren = route.children.some((r: any) => !r.meta.hideInMenu) + if (showChildren) { + route.component = () => level === 1 ? BasicLayoutPage : BlankLayoutPage + route.redirect = route.children[0].url + } else { + route.component = resolveComponent(route.code) || BlankLayoutPage; + } } else { - route.component = resolveComponent(route.code); + route.component = resolveComponent(route.code) || BlankLayoutPage; } - + delete route.name return route }) } \ No newline at end of file diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 1327a1eb..d438a522 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -1,79 +1,80 @@ - - From 16c320802e0ff1f9e9f6b707ec483cbd0db6bc26 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Tue, 31 Jan 2023 18:00:00 +0800 Subject: [PATCH 04/14] =?UTF-8?q?update:=201.=E5=88=A0=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E9=9D=99=E6=80=81=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/menu.ts | 117 +-------------------------------------------- 1 file changed, 1 insertion(+), 116 deletions(-) diff --git a/src/router/menu.ts b/src/router/menu.ts index 7e97e255..2a043f4f 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -1,23 +1,6 @@ export const LoginPath = '/login' export default [ - // { - // path: '/', - // redirect: LoginPath - // }, - // { - // path: '/init', - // component: () => import('@/view/InitPage.vue') - // }, - // { - // path: LoginPath, - // name: 'login', - // component: () => import('@/view/Login/index.vue') - // }, - // { - // path: '/initsetting', - // component: () => import('@/view/Login/initSet.vue') - // } { path: '/*', redirect: '/'}, // start: 测试用, 可删除 { @@ -32,10 +15,6 @@ export default [ path: '/account/center/bind', component: () => import('@/views/account/Center/bind/index.vue') }, - // { - // path: '/iot/home', - // component: () => import('@/views/home/index.vue') - // }, { path: '/table', component: () => import('@/views/demo/table/index.vue') @@ -48,107 +27,13 @@ export default [ path: '/search', component: () => import('@/views/demo/Search.vue') }, - // { - // path: '/notice/Config', - // component: () => import('@/views/notice/Config/index.vue') - // }, - // { - // path: '/notice/Config/detail/:id', - // component: () => import('@/views/notice/Config/Detail/index.vue') - // }, - // { - // path: '/notice/Template', - // component: () => import('@/views/notice/Template/index.vue') - // }, - // { - // path: '/notice/Template/detail/:id', - // component: () => import('@/views/notice/Template/Detail/index.vue') - // }, + // end: 测试用, 可删除 - // 设备管理 - // { - // path: '/device/Instance', - // component: () => import('@/views/device/Instance/index.vue') - // }, - // link 运维管理 - // { - // path: '/link/log', - // component: () => import('@/views/link/Log/index.vue') - // }, - // { - // path: '/link/certificate', - // component: () => import('@/views/link/Certificate/index.vue') - // }, - // { - // path: '/link/certificate/detail/add', - // component: () => import('@/views/link/Certificate/Detail/index.vue') - // }, - // { - // path: '/link/accessConfig', - // component: () => import('@/views/link/AccessConfig/index.vue') - // }, - // { - // path: '/link/accessConfig/detail/add', - // component: () => import('@/views/link/AccessConfig/Detail/index.vue') - // }, - // system 系统管理 - // { - // path:'/system/Basis', - // component: ()=>import('@/views/system/Basis/index.vue') - // }, - // { - // path:'/system/api', - // component: ()=>import('@/views/system/apiPage/index.vue') - // }, - // { - // path:'/system/Role', - // component: ()=>import('@/views/system/Role/index.vue') - // }, - // { - // path:'/system/Role/detail/:id', - // component: ()=>import('@/views/system/Role/Detail/index.vue') - // }, - // { - // path:'/system/Permission', - // component: ()=>import('@/views/system/Permission/index.vue') - // }, // 初始化 { path: '/init-home', component: () => import('@/views/init-home/index.vue') }, - // 物联卡 iot-card - // { - // path: '/iot-card/Home', - // component: () => import('@/views/iot-card/Home/index.vue') - // }, - // { - // path: '/iot-card/Dashboard', - // component: () => import('@/views/iot-card/Dashboard/index.vue') - // }, - // { - // path: '/iot-card/CardManagement', - // component: () => import('@/views/iot-card/CardManagement/index.vue') - // }, - // 北向输出 - // { - // path: '/northbound/DuerOS', - // component: () => import('@/views/northbound/DuerOS/index.vue') - // }, - // { - // path: '/northbound/AliCloud', - // component: () => import('@/views/northbound/AliCloud/index.vue') - // }, - // 产品分类 - // { - // path: '/iot/device/Category', - // component: () => import('@/views/device/Category/index.vue') - // } , - // 产品 - // { - // path: '/iot/device/Product', - // component: () => import('@/views/device/Product/index.vue') - // } ] \ No newline at end of file From 4dd78fbd638b9f9bbd6741eadf359087b142d755 Mon Sep 17 00:00:00 2001 From: blp <2962632571@qq.com> Date: Tue, 31 Jan 2023 18:09:23 +0800 Subject: [PATCH 05/14] =?UTF-8?q?feat:=20=E5=85=85=E5=80=BC=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=88=97=E8=A1=A8=E3=80=81=E5=85=85=E5=80=BC=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=EF=BC=8C=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot-card/cardManagement.ts | 14 +- .../iot-card/CardManagement/BindDevice.vue | 1 + src/views/iot-card/Recharge/Save.vue | 191 ++++++++++++++++++ src/views/iot-card/Recharge/index.vue | 168 ++++++++++++++- 4 files changed, 370 insertions(+), 4 deletions(-) create mode 100644 src/views/iot-card/Recharge/Save.vue diff --git a/src/api/iot-card/cardManagement.ts b/src/api/iot-card/cardManagement.ts index 768aba60..0a4f53d5 100644 --- a/src/api/iot-card/cardManagement.ts +++ b/src/api/iot-card/cardManagement.ts @@ -121,4 +121,16 @@ export const edit = (data: any) => server.put(`/network/card/${data.id}`, data); * 根据id查看详情 * @param id */ -export const queryDetail = (id: any) => server.get(`/network/card/${id}`); \ No newline at end of file +export const queryDetail = (id: any) => server.get(`/network/card/${id}`); + +/** + * 查询物联卡充值缴费日志 + * @param data + */ +export const queryRechargeList = (data: any) => server.post(`/network/card/recharge/_log`, data) + +/** + * 充值 + * @param data + */ +export const recharge = (data: any) => server.post(`/network/card/_recharge`, data) \ No newline at end of file diff --git a/src/views/iot-card/CardManagement/BindDevice.vue b/src/views/iot-card/CardManagement/BindDevice.vue index cdf48031..acdba8df 100644 --- a/src/views/iot-card/CardManagement/BindDevice.vue +++ b/src/views/iot-card/CardManagement/BindDevice.vue @@ -19,6 +19,7 @@ ref="bindDeviceRef" :columns="columns" :request="queryUnbounded" + model="TABLE" :defaultParams="{ sorts: [{ name: 'createTime', order: 'desc' }], }" diff --git a/src/views/iot-card/Recharge/Save.vue b/src/views/iot-card/Recharge/Save.vue new file mode 100644 index 00000000..4199d358 --- /dev/null +++ b/src/views/iot-card/Recharge/Save.vue @@ -0,0 +1,191 @@ + + + + + diff --git a/src/views/iot-card/Recharge/index.vue b/src/views/iot-card/Recharge/index.vue index 4f1bbbc0..27fdab16 100644 --- a/src/views/iot-card/Recharge/index.vue +++ b/src/views/iot-card/Recharge/index.vue @@ -1,8 +1,170 @@ - + + + From 6a69661271a35dc0615b12fc572bc0df7b4de026 Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Tue, 31 Jan 2023 18:18:53 +0800 Subject: [PATCH 06/14] =?UTF-8?q?feat:=20=E8=AE=BE=E5=A4=87=E6=8E=A5?= =?UTF-8?q?=E5=85=A5=E7=BD=91=E5=85=B3=20=E5=8D=A1=E7=89=87=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=8A=9F=E8=83=BD=E5=8F=8A=E5=9F=BA=E6=9C=AC=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/link/accessConfig.ts | 2 +- src/router/menu.ts | 2 +- src/views/link/AccessConfig/Detail/index.vue | 164 +++++----- .../AccessConfig/components/Channel/index.vue | 28 +- .../AccessConfig/components/Cloud/Ctwing.vue | 44 ++- .../AccessConfig/components/Cloud/OneNet.vue | 52 ++-- .../AccessConfig/components/Cloud/index.vue | 3 - .../AccessConfig/components/Edge/index.vue | 45 ++- .../AccessConfig/components/Media/GB28181.vue | 55 +++- .../AccessConfig/components/Media/index.vue | 30 +- .../link/AccessConfig/components/Network.vue | 280 ++++++++++++++++-- src/views/link/AccessConfig/index.vue | 112 ++++--- src/views/link/Certificate/Detail/index.vue | 8 +- 13 files changed, 609 insertions(+), 216 deletions(-) diff --git a/src/api/link/accessConfig.ts b/src/api/link/accessConfig.ts index 0aaa1986..869dab76 100644 --- a/src/api/link/accessConfig.ts +++ b/src/api/link/accessConfig.ts @@ -36,7 +36,7 @@ export const undeploy = (id: string) => export const deploy = (id: string) => server.post(`/gateway/device/${id}/_startup`); -export const del = (id: string) => server.remove(`/gateway/device/${id}`); +export const remove = (id: string) => server.remove(`/gateway/device/${id}`); export const getResourcesCurrent = () => server.get(`/network/resources/alive/_current`); diff --git a/src/router/menu.ts b/src/router/menu.ts index 234bcabf..7914c1bb 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -95,7 +95,7 @@ export default [ component: () => import('@/views/link/AccessConfig/index.vue') }, { - path: '/link/accessConfig/detail/add', + path: '/link/accessConfig/detail/:type/:id', component: () => import('@/views/link/AccessConfig/Detail/index.vue') }, // system 系统管理 diff --git a/src/views/link/AccessConfig/Detail/index.vue b/src/views/link/AccessConfig/Detail/index.vue index f84b13fb..3211fd75 100644 --- a/src/views/link/AccessConfig/Detail/index.vue +++ b/src/views/link/AccessConfig/Detail/index.vue @@ -1,7 +1,7 @@ - + diff --git a/src/views/system/Menu/index.vue b/src/views/system/Menu/index.vue index 648b29cc..c218aa80 100644 --- a/src/views/system/Menu/index.vue +++ b/src/views/system/Menu/index.vue @@ -19,7 +19,7 @@ 菜单实例