| | |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref, watch } from 'vue'; |
| | | import { nextTick, ref, watch } from 'vue'; |
| | | import RecordSet from './RecordSet.vue'; |
| | | import { queryScadaTimeValues } from '/@/api/ai/chat'; |
| | | import { useCompRef } from '/@/utils/types'; |
| | |
| | | import TimeRange from './components/TimeRange.vue'; |
| | | import List from './components/List.vue'; |
| | | |
| | | const props = defineProps(['otype', 'oname']); |
| | | const props = defineProps(['otype', 'oname', 'indexName']); |
| | | |
| | | const isShow = defineModel({ |
| | | type: Boolean, |
| | |
| | | const chartValues = ref(null); |
| | | const setChartData = async (timeRange: string[]) => { |
| | | const res = await queryScadaTimeValues({ |
| | | otype: props.otype, |
| | | oname: props.oname, |
| | | // 设备类型 |
| | | ptype: props.otype, |
| | | // 设备名称 |
| | | pname: props.oname, |
| | | otype: props.indexName, |
| | | start_time: timeRange[0], |
| | | end_time: timeRange[1], |
| | | step_time: stepTime.value, |
| | | }); |
| | | chartValues.value = res.values; |
| | | recordSetRef.value.drawChart(); |
| | | chartValues.value.chart = 'single_line'; |
| | | nextTick(() => { |
| | | setTimeout(() => { |
| | | recordSetRef.value.drawChart(); |
| | | }, 0); |
| | | }); |
| | | }; |
| | | |
| | | watch( |