|
@@ -47,29 +47,29 @@
|
|
|
<ContentWrap>
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
- <TdDeviceLabel :tags="specs" tag-width="24%" />
|
|
|
+ <TdDeviceLabel :tags="specs" @select="labelSelect" tag-width="24%" />
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</ContentWrap>
|
|
|
<ContentWrap>
|
|
|
<div class="chart-container">
|
|
|
<!-- 日期选择区域 -->
|
|
|
- <div class="date-controls">
|
|
|
- <input
|
|
|
- type="datetime-local"
|
|
|
- v-model="startTime"
|
|
|
- :max="endTime"
|
|
|
- @change="handleDateChange"
|
|
|
- />
|
|
|
- <span class="separator">至</span>
|
|
|
- <input
|
|
|
- type="datetime-local"
|
|
|
- v-model="endTime"
|
|
|
- :min="startTime"
|
|
|
- @change="handleDateChange"
|
|
|
- />
|
|
|
- <button class="query-btn" @click="fetchData">查询</button>
|
|
|
- </div>
|
|
|
+<!-- <div class="date-controls">-->
|
|
|
+<!-- <input-->
|
|
|
+<!-- type="datetime-local"-->
|
|
|
+<!-- v-model="startTime"-->
|
|
|
+<!-- :max="endTime"-->
|
|
|
+<!-- @change="handleDateChange"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- <span class="separator">至</span>-->
|
|
|
+<!-- <input-->
|
|
|
+<!-- type="datetime-local"-->
|
|
|
+<!-- v-model="endTime"-->
|
|
|
+<!-- :min="startTime"-->
|
|
|
+<!-- @change="handleDateChange"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- <button class="query-btn" @click="fetchData">查询</button>-->
|
|
|
+<!-- </div>-->
|
|
|
|
|
|
<!-- 图表容器 -->
|
|
|
<div v-loading="loading" class="chart" ref="chartRef"></div>
|
|
@@ -101,16 +101,17 @@ onMounted(async () => {
|
|
|
formData.value.deviceName = params.name
|
|
|
formData.value.lastInlineTime = params.time
|
|
|
formData.value.ifInline = params.ifInline
|
|
|
- IotDeviceApi.getIotDeviceTds(id).then(res => {
|
|
|
+ await IotDeviceApi.getIotDeviceTds(id).then(res => {
|
|
|
specs.value = res
|
|
|
specs.value = specs.value.sort((a, b) => {
|
|
|
return b.modelOrder - a.modelOrder
|
|
|
})
|
|
|
formLoading.value = false
|
|
|
+ topic.value = specs.value[0].identifier
|
|
|
+ fetchData()
|
|
|
})
|
|
|
initDefaultDate()
|
|
|
initChart()
|
|
|
- await fetchData()
|
|
|
})
|
|
|
|
|
|
|
|
@@ -127,7 +128,11 @@ const startTime = ref('')
|
|
|
const endTime = ref('')
|
|
|
const chartData = ref([])
|
|
|
const loading = ref(false)
|
|
|
+const topic = ref('')
|
|
|
|
|
|
+const labelSelect = (row) =>{
|
|
|
+ topic.value = row.identifier
|
|
|
+}
|
|
|
// 初始化默认时间范围
|
|
|
const initDefaultDate = () => {
|
|
|
const now = dayjs()
|
|
@@ -148,7 +153,7 @@ const initChart = () => {
|
|
|
|
|
|
const option = {
|
|
|
title: {
|
|
|
- text: '数据趋势图',
|
|
|
+ text: '近一天数据趋势图',
|
|
|
left: 'center'
|
|
|
},
|
|
|
tooltip: {
|