Pārlūkot izejas kodu

perf(views): 优化“设备工况”页面

1. 将设备分组 id 由硬编码的值改为动态的参数
2. 修正设备详情页跳转路径
3. 修复参数曲线对话框被遮挡的问题
wangcong 1 mēnesi atpakaļ
vecāks
revīzija
89f33443b4

+ 4 - 0
src/types/index.ts

@@ -84,6 +84,10 @@ export interface DictValue {
   isDefault: boolean | null;
 }
 
+export interface DevGroupTabCompProps {
+  deviceGroupId: number;
+}
+
 export interface UseGuideStepItem extends StepProps {
   title: string;
   stepTitle?: string;

+ 1 - 0
src/views/device-work-status/DevWorkParamData.vue

@@ -249,6 +249,7 @@ defineExpose({
     wrap-class-name="dev-work-param-data-modal"
     :title="$t('deviceWorkStatus.viewData')"
     :width="920"
+    :z-index="1100"
     centered
     :footer="null"
     :after-close="handleClose"

+ 5 - 3
src/views/device-work-status/DeviceWorkStatus.vue

@@ -13,7 +13,9 @@ import { deviceCardData, DeviceType } from './device-card';
 import DeviceWorkParams from './DeviceWorkParams.vue';
 import DevWorkParamData from './DevWorkParamData.vue';
 
-import type { DevicesListItem, DeviceTypeCount, PageParams } from '@/types';
+import type { DevGroupTabCompProps, DevicesListItem, DeviceTypeCount, PageParams } from '@/types';
+
+const props = defineProps<DevGroupTabCompProps>();
 
 const router = useRouter();
 const { isLoading, handleRequest } = useRequest();
@@ -23,7 +25,7 @@ const activeDeviceStatus = ref<DeviceStatusQuery>(DeviceStatusQuery.All);
 
 onMounted(() => {
   handleRequest(async () => {
-    deviceTypes.value = await getDevWorkTypeCount(7, [
+    deviceTypes.value = await getDevWorkTypeCount(props.deviceGroupId, [
       DeviceType.冷水主机,
       DeviceType.控制柜,
       DeviceType.冷却塔,
@@ -162,7 +164,7 @@ const handleDevCardClick = (devId: number, e: Event) => {
     currentDevId.value = devId;
     viewHistoryData(paramCode);
   } else {
-    router.push(`/device-manage/equipment-details/${devId}`);
+    router.push(`/device-manage/device-list/equipment-details/${devId}`);
   }
 };
 </script>