lipenghui 3 months ago
parent
commit
2a9cd935b7

+ 1 - 1
src/router/modules/remaining.ts

@@ -168,7 +168,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
           hidden: true,
           hidden: true,
           canTo: true,
           canTo: true,
           icon: 'ep:info',
           icon: 'ep:info',
-          title: '设备台账详情',
+          title: '监控详情',
           activeMenu: '/device/info'
           activeMenu: '/device/info'
         }
         }
       },{
       },{

+ 25 - 20
src/views/pms/device/monitor/TdDeviceInfo.vue

@@ -47,29 +47,29 @@
     <ContentWrap>
     <ContentWrap>
       <el-row>
       <el-row>
         <el-col :span="24">
         <el-col :span="24">
-          <TdDeviceLabel :tags="specs" tag-width="24%" />
+          <TdDeviceLabel :tags="specs" @select="labelSelect" tag-width="24%" />
         </el-col>
         </el-col>
       </el-row>
       </el-row>
     </ContentWrap>
     </ContentWrap>
     <ContentWrap>
     <ContentWrap>
       <div class="chart-container">
       <div class="chart-container">
         <!-- 日期选择区域 -->
         <!-- 日期选择区域 -->
-        <div class="date-controls">
-          <input
-            type="datetime-local"
-            v-model="startTime"
-            :max="endTime"
-            @change="handleDateChange"
-          />
-          <span class="separator">至</span>
-          <input
-            type="datetime-local"
-            v-model="endTime"
-            :min="startTime"
-            @change="handleDateChange"
-          />
-          <button class="query-btn" @click="fetchData">查询</button>
-        </div>
+<!--        <div class="date-controls">-->
+<!--          <input-->
+<!--            type="datetime-local"-->
+<!--            v-model="startTime"-->
+<!--            :max="endTime"-->
+<!--            @change="handleDateChange"-->
+<!--          />-->
+<!--          <span class="separator">至</span>-->
+<!--          <input-->
+<!--            type="datetime-local"-->
+<!--            v-model="endTime"-->
+<!--            :min="startTime"-->
+<!--            @change="handleDateChange"-->
+<!--          />-->
+<!--          <button class="query-btn" @click="fetchData">查询</button>-->
+<!--        </div>-->
 
 
         <!-- 图表容器 -->
         <!-- 图表容器 -->
         <div v-loading="loading" class="chart" ref="chartRef"></div>
         <div v-loading="loading" class="chart" ref="chartRef"></div>
@@ -101,16 +101,17 @@ onMounted(async () => {
   formData.value.deviceName = params.name
   formData.value.deviceName = params.name
   formData.value.lastInlineTime = params.time
   formData.value.lastInlineTime = params.time
   formData.value.ifInline = params.ifInline
   formData.value.ifInline = params.ifInline
-  IotDeviceApi.getIotDeviceTds(id).then(res => {
+  await IotDeviceApi.getIotDeviceTds(id).then(res => {
     specs.value = res
     specs.value = res
     specs.value = specs.value.sort((a, b) => {
     specs.value = specs.value.sort((a, b) => {
       return b.modelOrder - a.modelOrder
       return b.modelOrder - a.modelOrder
     })
     })
     formLoading.value = false
     formLoading.value = false
+    topic.value = specs.value[0].identifier
+    fetchData()
   })
   })
   initDefaultDate()
   initDefaultDate()
   initChart()
   initChart()
-  await fetchData()
 })
 })
 
 
 
 
@@ -127,7 +128,11 @@ const startTime = ref('')
 const endTime = ref('')
 const endTime = ref('')
 const chartData = ref([])
 const chartData = ref([])
 const loading = ref(false)
 const loading = ref(false)
+const topic = ref('')
 
 
+const labelSelect = (row) =>{
+  topic.value = row.identifier
+}
 // 初始化默认时间范围
 // 初始化默认时间范围
 const initDefaultDate = () => {
 const initDefaultDate = () => {
   const now = dayjs()
   const now = dayjs()
@@ -148,7 +153,7 @@ const initChart = () => {
 
 
   const option = {
   const option = {
     title: {
     title: {
-      text: '数据趋势图',
+      text: '近一天数据趋势图',
       left: 'center'
       left: 'center'
     },
     },
     tooltip: {
     tooltip: {

+ 4 - 3
src/views/pms/device/monitor/TdDeviceLabel.vue

@@ -15,7 +15,7 @@
 </template>
 </template>
 
 
 <script setup>
 <script setup>
-import { ref } from 'vue'
+import {defineEmits, ref} from 'vue'
 
 
 const props = defineProps({
 const props = defineProps({
   tags: {
   tags: {
@@ -28,11 +28,12 @@ const props = defineProps({
     default: '220px'
     default: '220px'
   }
   }
 })
 })
-
-const selectedIndex = ref(-1)
+const emit = defineEmits(['select'])
+const selectedIndex = ref(0)
 
 
 const selectTag = (index) => {
 const selectTag = (index) => {
   selectedIndex.value = selectedIndex.value === index ? -1 : index
   selectedIndex.value = selectedIndex.value === index ? -1 : index
+  emit('select', props.tags[selectedIndex.value])
 }
 }
 </script>
 </script>
 
 

+ 7 - 2
src/views/pms/device/monitor/index.vue

@@ -123,13 +123,13 @@
                       </span>
                       </span>
                     </div>
                     </div>
                     <div class="mb-2.5 last:mb-0">
                     <div class="mb-2.5 last:mb-0">
-                      <span class="text-[#717c8e] mr-2.5">设备类型</span>
+                      <span class="text-[#717c8e] mr-2.5">类型</span>
                       <span class="text-[#0070ff]">
                       <span class="text-[#0070ff]">
                         {{ item.assetClassName }}
                         {{ item.assetClassName }}
                       </span>
                       </span>
                     </div>
                     </div>
                     <div class="mb-2.5 last:mb-0">
                     <div class="mb-2.5 last:mb-0">
-                      <span class="text-[#717c8e] mr-2.5">最新数据时间</span>
+                      <span class="text-[#717c8e] mr-2.5">最新时间</span>
                       <span class="text-[#0070ff]">
                       <span class="text-[#0070ff]">
                         {{ item.lastInlineTime }}
                         {{ item.lastInlineTime }}
                       </span>
                       </span>
@@ -327,6 +327,11 @@ const resetQuery = () => {
 /** 打开详情 */
 /** 打开详情 */
 const { push } = useRouter()
 const { push } = useRouter()
 const openDetail = (id: number,ifInline: string, time:string, name:string,code:string) => {
 const openDetail = (id: number,ifInline: string, time:string, name:string,code:string) => {
+  debugger
+  if (time === null||time === undefined) {
+    message.warning("没有数采数据")
+    return
+  }
   push({ name: 'TdDeviceDetail', params: { id,ifInline, time,name,code } })
   push({ name: 'TdDeviceDetail', params: { id,ifInline, time,name,code } })
 }
 }
 
 

+ 2 - 2
src/views/pms/failure/index.vue

@@ -149,8 +149,8 @@
             {{ scope.$index + 1 }}
             {{ scope.$index + 1 }}
           </template>
           </template>
         </el-table-column>
         </el-table-column>
-        <el-table-column label="故障编码" align="center" prop="failureCode" />
-        <el-table-column label="故障名称" align="center" prop="failureName" />
+<!--        <el-table-column label="故障编码" align="center" prop="failureCode" />-->
+        <el-table-column label="故障标题" align="center" prop="failureName" />
         <el-table-column label="设备" align="center" prop="deviceName" />
         <el-table-column label="设备" align="center" prop="deviceName" />
         <el-table-column label="状态" align="center" prop="status" >
         <el-table-column label="状态" align="center" prop="status" >
           <template #default="scope">
           <template #default="scope">