Переглянути джерело

feat: 创建cvs及其修复router-bug

lvkun 2 роки тому
батько
коміт
e85cd35b84

+ 10 - 2
README.md

@@ -66,7 +66,6 @@ npm run build:package  该指令全是将目前已有的模块分别打包
 ## 待做
 
 1. 支持对浏览器标签的信息设置
-2. 打包mac程序
 5. 区域纯净模式
 6. 登录逻辑封装npm包
 7. 当前项目对状态码的错误处理
@@ -84,4 +83,13 @@ npm run build:package  该指令全是将目前已有的模块分别打包
 
 ### cli
 
-​	只保留后台公共功能的逻辑与基本的路由菜单功能
+​	只保留后台公共功能的逻辑与基本的路由菜单功能
+
+## 模块说明
+
+### cvs蛟龙云视
+
+参考地址: https://console.bce.baidu.com/
+
+
+

+ 5 - 0
config/proxy.ts

@@ -19,6 +19,11 @@ module.exports = {
       target: 'http://124.222.113.37:8888',
       changeOrigin: true,
       pathRewrite: { '^/iot': '' }
+    },
+    '/dataSource': {
+      target: 'http://bynt9d.natappfree.cc',
+      changeOrigin: true,
+      pathRewrite: { '^/dataSource': '' }
     }
   }
 }

+ 0 - 0
src/api/cvs/readme.md


+ 0 - 1
src/api/schedule/dataSource.ts

@@ -35,7 +35,6 @@ export function updateDataSource (data: SCHEDULE.SOURCE.Detail) {
 
 export function getDataSourceById (id: string) {
   return request<SCHEDULE.SOURCE.Detail>({
-    url: `/dataSource/${id}`,
     method: 'GET'
   })
 }

+ 0 - 2
src/controller/schedule/dataSource.ts

@@ -2,8 +2,6 @@ import { addDataSource, dataSourceConnect, dataSourceConnectTest, delDataSource,
 import { message } from 'ant-design-vue'
 
 export class DataSourceController {
-  // static dataSourceTypeEnum =
-
   static async page (params: COMMON.API.QueryParams & {label: string, dataSourceType: SCHEDULE.SOURCE.DataSourceType}) {
     return await getDataSourcePage(params)
   }

+ 3 - 0
src/layout/navbar.vue

@@ -91,6 +91,9 @@ const changeRouter = (route: ROUTER.RoutesProps) => {
   //   selectedKeys.value = [route.path]
   //   router.push(route.path)
   // }
+  selectedKeys.value = [route.path]
+  console.log('route:', route, selectedKeys)
+
   appRouter.changeNavbarRoute(route)
 }
 

+ 1 - 3
src/layout/user.vue

@@ -22,15 +22,13 @@
 </template>
 
 <script lang="ts" setup >
+
 import { useUserStore } from '@/store'
-import { storeToRefs } from 'pinia'
 
 const ava = require('@/assets/logo/logo-blue.png')
 
 const userStore = useUserStore()
 
-console.log('userStore.userInfo:', userStore)
-
 </script>
 
 <style lang="less" scoped >

+ 2 - 4
src/pages/Iot/rule/forwardRule.vue

@@ -368,13 +368,13 @@
 </modal-pro>
 
 <modal-pro
-  style="width: 1000px"
+  style="width: 1000px;"
   label="详情"
   :open="state.detailVisible"
   @cancel="state.detailVisible = false"
   @ok="state.detailVisible  = false"
 >
-  <a-form  :label-col="{span: 2}" style="height: 600px;overflow: hidden;overflow-y: scroll;">
+  <a-form  :label-col="{span: 2}" style="height: 400px;overflow: hidden;overflow-y: scroll;">
     <a-form-item label="规则名称"> {{detailForwardRef.ruleLabel}} </a-form-item>
     <a-form-item label="数据来源"> {{RuleController.SubjectResourceMap.get(detailForwardRef.subjectResource)?.name}} </a-form-item>
     <a-form-item label="触发事件"> {{RuleController.SubjectEventMap.get(detailForwardRef.subjectEvent)?.name}} </a-form-item>
@@ -402,7 +402,6 @@
         :data-source="detailMQTTList"
         :pagination="false"
       >
-
       </a-table>
     </a-form-item>
     <a-form-item label="RabbitMQ" v-if="detailRABBITList.length">
@@ -411,7 +410,6 @@
         :data-source="detailRABBITList"
         :pagination="false"
       >
-
       </a-table>
     </a-form-item>
   </a-form>

+ 9 - 0
src/pages/cvs/csys/index.vue

@@ -0,0 +1,9 @@
+<template>
+<a-card>
+  sys
+</a-card>
+</template>
+<script lang='ts' setup >
+</script>
+<style lang='less' scoped >
+</style>

+ 9 - 0
src/pages/cvs/dataServer/car.vue

@@ -0,0 +1,9 @@
+<template>
+<a-card>
+    car
+</a-card>
+</template>
+<script lang='ts' setup >
+</script>
+<style lang='less' scoped >
+</style>

+ 9 - 0
src/pages/cvs/dataServer/face.vue

@@ -0,0 +1,9 @@
+<template>
+<a-card>
+  face
+</a-card>
+</template>
+<script lang='ts' setup >
+</script>
+<style lang='less' scoped >
+</style>

+ 9 - 0
src/pages/cvs/dataServer/frock.vue

@@ -0,0 +1,9 @@
+<template>
+<a-card>
+  frock
+</a-card>
+</template>
+<script lang='ts' setup >
+</script>
+<style lang='less' scoped >
+</style>

+ 9 - 0
src/pages/cvs/edge/task.vue

@@ -0,0 +1,9 @@
+<template>
+<a-card>
+  task
+</a-card>
+</template>
+<script lang='ts' setup >
+</script>
+<style lang='less' scoped >
+</style>

+ 9 - 0
src/pages/cvs/edge/video.vue

@@ -0,0 +1,9 @@
+<template>
+<a-card>
+  video
+</a-card>
+</template>
+<script lang='ts' setup >
+</script>
+<style lang='less' scoped >
+</style>

+ 9 - 0
src/pages/cvs/operator/manage.vue

@@ -0,0 +1,9 @@
+<template>
+<a-card>
+    operator
+</a-card>
+</template>
+<script lang='ts' setup >
+</script>
+<style lang='less' scoped >
+</style>

+ 9 - 0
src/pages/cvs/video/device.vue

@@ -0,0 +1,9 @@
+<template>
+<a-card>
+  device
+</a-card>
+</template>
+<script lang='ts' setup >
+</script>
+<style lang='less' scoped >
+</style>

+ 9 - 0
src/pages/cvs/video/space.vue

@@ -0,0 +1,9 @@
+<template>
+<a-card>
+  space
+</a-card>
+</template>
+<script lang='ts' setup >
+</script>
+<style lang='less' scoped >
+</style>

+ 2 - 1
src/pages/schedule/dataSource/manage/index.vue

@@ -23,6 +23,7 @@
 <script lang='ts' setup >
 import { DataSourceController } from '@/controller'
 import { reactive, onMounted } from 'vue'
+
 const columns = [
   {
     title: '名称',
@@ -61,7 +62,7 @@ const changePage = ({ current }) => {
 
 const getDataSource = async () => {
   state.loading = true
-  const { data } = await DataSourceController.dataSource()
+  const { data } = await DataSourceController.page(queryState)
   state.loading = false
   state.dataSource = data
 }

+ 98 - 2
src/router/index.ts

@@ -380,6 +380,101 @@ const login = {
   component: () => import('@/pages/login/index.vue')
 }
 
+const cvs = {
+  path: '/cvs',
+  name: 'cvs',
+  meta: {
+    title: 'cvs'
+  },
+  component: () => import('@/layout/layout.vue'),
+  redirect: '/cvs/video/space',
+  children: [
+    {
+      path: '/cvs/video',
+      name: '视频接入',
+      icon: '',
+      children: [
+        {
+          path: '/cvs/video/space',
+          name: '空间',
+          icon: '',
+          component: () => import('@/pages/cvs/video/space.vue')
+        },
+        {
+          path: '/cvs/video/device',
+          name: '设备',
+          icon: '',
+          component: () => import('@/pages/cvs/video/device.vue')
+        }
+      ]
+    },
+    {
+      path: '/cvs/operator',
+      name: '算子仓库',
+      icon: '',
+      children: [
+        {
+          path: '/cvs/operator/manage',
+          name: '算子管理',
+          icon: '',
+          component: () => import('@/pages/cvs/operator/manage.vue')
+        }
+      ]
+    },
+    {
+      path: '/cvs/dataSever',
+      name: '数据服务',
+      icon: '',
+      children: [
+        {
+          path: '/cvs/dataSever/car',
+          name: '车辆库',
+          icon: '',
+          component: () => import('@/pages/cvs/dataServer/car.vue')
+        },
+        {
+          path: '/cvs/dataSever/face',
+          name: '人脸库',
+          icon: '',
+          component: () => import('@/pages/cvs/dataServer/face.vue')
+        },
+        {
+          path: '/cvs/dataSever/frock',
+          name: '工装库',
+          icon: '',
+          component: () => import('@/pages/cvs/dataServer/frock.vue')
+        }
+      ]
+    },
+    {
+      path: '/cvs/edge',
+      name: '边缘设备',
+      icon: '',
+      children: [
+        {
+          path: '/cvs/edge/task',
+          name: '任务管理',
+          icon: '',
+          component: () => import('@/pages/cvs/edge/task.vue')
+        },
+        {
+          path: '/cvs/dataSever/video',
+          name: '视频管理',
+          icon: '',
+          component: () => import('@/pages/cvs/edge/video.vue')
+        }
+      ]
+    },
+    {
+      path: '/cvs/csys',
+      name: '系统概览 ',
+      icon: '',
+      component: () => import('@/pages/cvs/csys/index.vue')
+    }
+  ]
+}
+// }HQDZKE6BBJCJB0412
+
 const demo = {
   path: '/demo',
   name: 'demo',
@@ -387,8 +482,7 @@ const demo = {
   component: () => import('@/pages/demo/index.vue')
 }
 
-const _routes = [iot, rts, schedule, view, lowcode, user] as any
-// const _routes = [iot] as any
+const _routes = [iot, rts, schedule, view, lowcode, user, cvs] as any
 
 if (_routes[0].link) {
   window.open(_routes[0].path)
@@ -418,6 +512,8 @@ const router = createRouter({
   })
 })
 
+console.log('router:', router.getRoutes())
+
 // router.push = async function (to: vueRouter.RouteLocationRaw): Promise<void | NavigationFailure | undefined> {
 //   router.push(to)
 // }

+ 1 - 1
src/store/modules/commonStore/routerTravelStore.ts

@@ -44,7 +44,7 @@ export const useRouterTravelStore = defineStore('routerTravelStore', () => {
     }
     currentRoute.value = route
 
-    console.log('父节点:', appRouter.findRootRoute(route.path))
+    console.log('父节点:', route)
   }
 
   const setCurrentRoute = (route: RouteRecordRaw) => {

+ 1 - 0
src/store/modules/user/index.ts

@@ -17,6 +17,7 @@ const initState: USER.Tenant.Detail = {
 
 export const useUserStore = defineStore('userStore', () => {
   const router = useRouter()
+
   const route = useRoute()
 
   let userInfo = reactive<USER.Tenant.Detail>(JSON.parse(window.localStorage.getItem('userInfo') as string) || initState)