Ver código fonte

🦄 refactor(设备监控): 调整默认时间1天

Zimo 2 dias atrás
pai
commit
62ffcccb06

+ 17 - 13
src/api/pms/device/index.ts

@@ -7,8 +7,8 @@ export interface IotDeviceVO {
   deviceName: string // 设备名称
   brand: number // 品牌
   model: number // 规格型号
-  deptId: number    // 所在部门id
-  deptName: string  // 所在部门名称
+  deptId: number // 所在部门id
+  deptName: string // 所在部门名称
   deviceStatus: string // 设备状态
   deviceStatusName: string // 设备状态名称
   assetProperty: string // 资产性质
@@ -46,20 +46,20 @@ export interface IotDeviceVO {
 
 // 设备台账 API
 export const IotDeviceApi = {
-  getCompany: async (params:any) => {
-    return await request.get({ url: `/rq/iot-device/company?id=`+params})
+  getCompany: async (params: any) => {
+    return await request.get({ url: `/rq/iot-device/company?id=` + params })
   },
-  getCompanyByDevice: async (params:any) => {
-    return await request.get({ url: `/rq/iot-device/company/`+params})
+  getCompanyByDevice: async (params: any) => {
+    return await request.get({ url: `/rq/iot-device/company/` + params })
   },
-  getMaxCode: async (params:any) => {
-    return await request.get({ url: `/rq/iot-device/max?yfCode=`+params})
+  getMaxCode: async (params: any) => {
+    return await request.get({ url: `/rq/iot-device/max?yfCode=` + params })
   },
-  getMapDevice: async (params:any) => {
-    return await request.get({ url: `/rq/iot-device/map`, params})
+  getMapDevice: async (params: any) => {
+    return await request.get({ url: `/rq/iot-device/map`, params })
   },
-  getAllDeviceParams: async (params:any) => {
-    return await request.get({ url: `/rq/iot-device/all/params`, params})
+  getAllDeviceParams: async (params: any) => {
+    return await request.get({ url: `/rq/iot-device/all/params`, params })
   },
   // 查询设备台账分页
   getIotDevicePage: async (params: any) => {
@@ -116,9 +116,13 @@ export const IotDeviceApi = {
   getIotDevice: async (id: number) => {
     return await request.get({ url: `/rq/iot-device/get?id=` + id })
   },
+
   getIotDeviceTds: async (id: number) => {
     return await request.get({ url: `/rq/iot-device/get/td?id=` + id })
   },
+  getIotDeviceZHBDTds: async (id: number) => {
+    return await request.get({ url: `/rq/iot-device/get/zhbd/td?id=` + id })
+  },
   // 新增设备台账
   createIotDevice: async (data: IotDeviceVO) => {
     return await request.post({ url: `/rq/iot-device/create`, data })
@@ -155,5 +159,5 @@ export const IotDeviceApi = {
   // 新增时根据部门id获取设备列表
   getIotDeviceSetOptions: async (id: any) => {
     return await request.get({ url: `/rq/iot-device/dept/${id}` })
-  },
+  }
 }

+ 5 - 5
src/views/pms/device/monitor/TdDeviceInfo.vue

@@ -141,7 +141,7 @@ async function updateDimensionValues() {
 }
 
 const selectedDate = ref<string[]>([
-  ...rangeShortcuts[2].value().map((v) => dayjs(v).format('YYYY-MM-DD HH:mm:ss'))
+  ...rangeShortcuts[0].value().map((v) => dayjs(v).format('YYYY-MM-DD HH:mm:ss'))
 ])
 
 interface ChartData {
@@ -578,10 +578,10 @@ onUnmounted(() => {
         @click="handleClickSpec(item.name)"
       >
         <span class="text-sm text-[var(--el-text-color-regular)] flex items-center gap-2 relative">
-          <i
+          <!-- <i
             v-show="disabledDimension(item.identifier).loading"
             class="i-line-md:loading-loop size-5 absolute -left-6"
-          ></i>
+          ></i> -->
           {{ item.name }}
         </span>
         <span class="text-lg font-medium ms-a">{{ item.value }}</span>
@@ -603,10 +603,10 @@ onUnmounted(() => {
         @click="handleClickSpec(item.name)"
       >
         <span class="text-sm text-[var(--el-text-color-regular)] flex items-center gap-2">
-          <i
+          <!-- <i
             v-show="disabledDimension(item.identifier).loading"
             class="i-line-md:loading-loop size-5"
-          ></i>
+          ></i> -->
           {{ item.name }}
         </span>
         <span class="text-lg font-medium ms-a">{{ item.value }}</span>