| | |
| | | <template> |
| | | <el-dialog :destroy-on-close="true" v-model="isShow" draggable :close-on-click-modal="false" :title="chartValues?.title"> |
| | | <RecordSet chartHeight="30rem" ref="recordSetRef" :data="chartValues"> |
| | | <el-dialog |
| | | :destroy-on-close="true" |
| | | v-model="isShow" |
| | | draggable |
| | | :close-on-click-modal="false" |
| | | :title="chartValues?.title" |
| | | v-if="computedIsDialog" |
| | | > |
| | | <RecordSet :chartHeight="computedHeight" ref="recordSetRef" :data="chartValues"> |
| | | <TimeRange ref="timeRangeRef" v-model="queryRange" class="flex-0 m-1" @change="timeRangeChange" /> |
| | | <List class="flex-0 m-1" v-model="stepTime" :data="listData" @change="selectStepChange" /> |
| | | </RecordSet> |
| | | </el-dialog> |
| | | <div v-else v-show="isShow"> |
| | | <RecordSet :chartHeight="computedHeight" ref="recordSetRef" :data="chartValues"> |
| | | <TimeRange ref="timeRangeRef" v-model="queryRange" class="flex-0 m-1" @change="timeRangeChange" /> |
| | | <List class="flex-0 m-1" v-model="stepTime" :data="listData" @change="selectStepChange" /> |
| | | </RecordSet> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { nextTick, ref, watch } from 'vue'; |
| | | import { computed, nextTick, ref, watch } from 'vue'; |
| | | import RecordSet from './RecordSet.vue'; |
| | | import List from './components/List.vue'; |
| | | import TimeRange from './components/TimeRange.vue'; |
| | | import { queryScadaTimeValues } from '/@/api/ai/chat'; |
| | | import { formatDate } from '/@/utils/formatTime'; |
| | | import { useCompRef } from '/@/utils/types'; |
| | | import { getRecentDateRange } from '/@/utils/util'; |
| | | import { formatDate } from '/@/utils/formatTime'; |
| | | import TimeRange from './components/TimeRange.vue'; |
| | | import List from './components/List.vue'; |
| | | |
| | | const props = defineProps(['otype', 'oname', 'indexName']); |
| | | const props = defineProps(['otype', 'oname', 'indexName', 'isDialog', 'height']); |
| | | // SDVAL_FULL_FLOW true 25 DEV_FLOW_W |
| | | |
| | | const computedIsDialog = computed(() => props.isDialog ?? true); |
| | | const computedHeight = computed(() => props.height ?? '30rem'); |
| | | |
| | | const isShow = defineModel({ |
| | | type: Boolean, |
| | |
| | | chartValues.value.chart = 'single_line'; |
| | | nextTick(() => { |
| | | setTimeout(() => { |
| | | recordSetRef.value.drawChart(); |
| | | if (recordSetRef.value.isMultiCompare) { |
| | | recordSetRef.value.handleData(); |
| | | recordSetRef.value.handleMultiCompare(); |
| | | } else { |
| | | recordSetRef.value.drawChart(); |
| | | } |
| | | }, 0); |
| | | }); |
| | | }; |
| | |
| | | return; |
| | | } |
| | | queryRange.value = getRecentDateRange(1).map((item) => formatDate(item)); |
| | | nextTick(()=>{ |
| | | nextTick(() => { |
| | | setChartData(); |
| | | |
| | | }) |
| | | }); |
| | | } |
| | | ); |
| | | </script> |