Преглед изворни кода

fix: 修改数据中台与iot下数据服务路由名冲突的问题

lvkun пре 2 година
родитељ
комит
6454569038

+ 1 - 1
src/pages/Iot/dataServer/history.vue

@@ -42,7 +42,7 @@
   </a-table>
 </a-card>
 </template>
-<script lang='ts' setup name="aaa" >
+<script lang='ts' setup >
 import { DeviceContriller, ModelController } from '@/controller'
 import { DataController } from '@/controller/iot/data'
 import { onMounted, reactive, ref, watch } from 'vue'

+ 9 - 4
src/pages/Iot/device/components/overview.vue

@@ -22,7 +22,7 @@
       :contentStyle="{fontSize: '12px'}"
       style="margin-top: 20px;"
     >
-        <a-descriptions-item label="设备标识码">{{state.deviceDetail?.deviceStatus}}</a-descriptions-item>
+        <a-descriptions-item label="设备标识码">{{state.deviceDetail?.deviceCode}}</a-descriptions-item>
         <a-descriptions-item label="设备ID">
           <a-space>
             <span>  {{state.deviceDetail?.id}}</span>
@@ -68,7 +68,7 @@
             <div>{{item.keyLabel}}</div>
             <a-tooltip>
             <template #title><span> {{item[CommonController.dataTypeByKeyMap.get(item.dataType)]}}</span> <span v-if='item.dataUnit'>{{item.dataUnit}}</span></template>
-            <div> <span>{{'<'}} {{item[CommonController.dataTypeByKeyMap.get(item.dataType)]}}</span> <span v-if='item.dataUnit'>{{item.dataUnit}}</span> {{'>'}}</div>
+            <span class="data-type" >{{'<'}}  <div class='elip' >{{item[CommonController.dataTypeByKeyMap.get(item.dataType)]}}</div> <span v-if='item.dataUnit'>{{item.dataUnit}}</span> {{'>'}}</span>
           </a-tooltip>
 
             <div>{{dayjs(item.ts).format('YYYY/MM/DD HH:MM:ss')}}</div>
@@ -168,10 +168,15 @@ onMounted(async () => {
   height: 100px;
   margin-bottom: 10px;
   font-weight: 500;
-  div {
+  .data-type {
+    display: flex;
+    justify-content: center;
+
+    width: 200px;
+  }
+  .elip {
     white-space: nowrap;
     overflow: hidden;
-    width: 200px;
     text-overflow: ellipsis;
     text-align: center;
   }

+ 2 - 2
src/pages/Iot/model/detail.vue

@@ -4,9 +4,9 @@
     <a-row :gutter="[8, 8]" align="middle" >
       <a-col> <h1>{{state.model?.modelLabel}}</h1> </a-col>
       <a-col>
-          <span class="subtitle" >ID: {{state.model?.id}}</span>
+          <span class="subtitle" >ID: {{modelType === 'model' ? state.model?.id : modelId}}</span>
           <a-divider type="vertical" style="height: 10px; width: 6px; border-color: #7cb305"  />
-          <span>注册设备数: <a>{{state.deviceCount}}</a> </span>
+          <span v-if="modelType === 'model'" > 注册设备数: <a>{{state.deviceCount}}</a> </span>
         </a-col>
     </a-row>
   </template>

+ 10 - 14
src/router/index.ts

@@ -127,7 +127,6 @@ const iot = {
     {
       path: '/dataServer',
       name: '数据服务',
-      redirect: '/dataServer/history',
       icon: 'DatabaseOutlined',
       children: [
         {
@@ -311,20 +310,15 @@ const schedule = {
           component: () => import('@/pages/schedule/dataLake/dataTool/index.vue')
         }
       ]
-    },
-    {
-      path: '/dataService',
-      name: '数据服务',
-      icon: 'ApiOutlined',
-      // redirect: '/dataLake/dataTool',
-      children: [
-        // {
-        //   path: '/dataLake/dataTool',
-        //   name: '数据湖工具',
-        //   component: () => import('@/pages/schedule/dataLake/dataTool/index.vue')
-        // }
-      ]
     }
+    // {
+    //   path: '/dataService',
+    //   name: '数据服务',
+    //   icon: 'ApiOutlined',
+    //   children: [
+
+    //   ]
+    // }
   ]
 }
 
@@ -409,4 +403,6 @@ const router = createRouter({
   })
 })
 
+console.log(router.getRoutes())
+
 export default router