| | |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import _ from 'lodash'; |
| | | import { computed, onActivated, onMounted, ref } from 'vue'; |
| | | import { computed, onMounted, ref } from 'vue'; |
| | | import MonitorContent from './MonitorContent.vue'; |
| | | import { debounce, getTextWidth } from '/@/utils/util'; |
| | | |
| | | import { chatComProps } from '../../../common'; |
| | | import RecordSetDialog from '../recordSet/RecordSetDialog.vue'; |
| | | import { |
| | | BORDER_COLOR, |
| | | CELL_HEIGHT, |
| | |
| | | THIN_BORDER_WIDTH, |
| | | } from './constants'; |
| | | import type { Monitor, MonitorValue } from './types'; |
| | | import RecordSetDialog from '../recordSet/RecordSetDialog.vue'; |
| | | import { isSharePage } from '/@/stores/chatRoom'; |
| | | import { chunk, fill } from 'lodash-es'; |
| | | |
| | | const props = defineProps(chatComProps) as { |
| | | data: Monitor; |
| | |
| | | const firstRow = computed(() => props.data?.rows?.[0]); |
| | | const restRows = computed(() => props.data?.rows?.slice(1)); |
| | | const pageChunkList = computed(() => { |
| | | const chunkResult = _.chunk(props.data.values ?? [], pageSize.value); |
| | | const chunkResult = chunk(props.data.values ?? [], pageSize.value); |
| | | const last = chunkResult.at(-1); |
| | | if (last) { |
| | | const restNum = pageSize.value - last.length; |
| | | const emptyData = _.fill(Array(restNum), { |
| | | const emptyData = fill(Array(restNum), { |
| | | ONAME: '', |
| | | OTIME: '', |
| | | OTITLE: '', |
| | |
| | | |
| | | const currentRowChunkList = computed(() => { |
| | | if (!currentPageChunk.value || currentPageChunk.value.length === 0) return []; |
| | | const chunkResult = _.chunk(currentPageChunk.value, maxColsNum.value - 1); |
| | | const chunkResult = chunk(currentPageChunk.value, maxColsNum.value - 1); |
| | | return chunkResult; |
| | | }); |
| | | |