From d00a9f035aec50c37c8e0a1363a1968672fb875f Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期二, 16 七月 2024 16:58:39 +0800 Subject: [PATCH] 2024.7.16 --- src/views/inspection/WorkStream.vue | 36 ++++++++++++++++++++---------------- 1 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/views/inspection/WorkStream.vue b/src/views/inspection/WorkStream.vue index 0fbe9be..fb2ecdb 100644 --- a/src/views/inspection/WorkStream.vue +++ b/src/views/inspection/WorkStream.vue @@ -1,6 +1,7 @@ <template> - <div class="border-r-small m-h-2 p-h-4"> - <el-scrollbar ref="scrollbarRef" height="calc(var(--fy-body-height) / 3 * 1 - 30px)"> + <!-- <div class="border-r-small m-h-2 p-h-4"> --> + <BaseCard> + <el-scrollbar ref="scrollbarRef" :height="height"> <div ref="scrollContentRef"> <div v-for="item in streams" :key="item.index"> <el-text type="primary">[{{ item.time }}]: </el-text> @@ -12,11 +13,17 @@ </div> </div> </el-scrollbar> - </div> + </BaseCard> + <!-- </div> --> </template> <script setup> -import { reactive, ref, onMounted } from 'vue' +import { reactive, ref, onMounted, inject } from 'vue' import dayjs from 'dayjs' + +import { unCalc } from '@/utils/css-util' + +const excludeMapHeight = inject('excludeMapHeight') +const height = `calc(${unCalc(excludeMapHeight)} - 36px)` const streams = reactive([]) const scrollContentRef = ref() @@ -53,17 +60,14 @@ } onMounted(() => { - // var index = 0 - setInterval(() => { - streams.push({ - // index: index, - time: dayjs().format('YYYY-MM-DD HH:mm:ss'), - user: users[parseInt(Math.random() * users.length)], - obj: objs[parseInt(Math.random() * objs.length)], - event: events[parseInt(Math.random() * events.length)] - }) - scrollToBottom() - // index++ - }, 10000) + // setInterval(() => { + // streams.push({ + // time: dayjs().format('YYYY-MM-DD HH:mm:ss'), + // user: users[parseInt(Math.random() * users.length)], + // obj: objs[parseInt(Math.random() * objs.length)], + // event: events[parseInt(Math.random() * events.length)] + // }) + // scrollToBottom() + // }, 10000) }) </script> -- Gitblit v1.9.3