|
|
|
@ -30,8 +30,12 @@ |
|
|
|
:percentage="progress" |
|
|
|
:percentage="progress" |
|
|
|
status="success" |
|
|
|
status="success" |
|
|
|
/> |
|
|
|
/> |
|
|
|
<div class="text-xl"> |
|
|
|
<div class="text-center text-gray-700 text-lg leading-relaxed"> |
|
|
|
<div>当前加载数据量较大请稍等。。。</div> |
|
|
|
正在加载数据,请稍等。<br> |
|
|
|
|
|
|
|
当前已查询 |
|
|
|
|
|
|
|
<span class="font-semibold text-green-600">{{ reqPointCount }}</span> / |
|
|
|
|
|
|
|
<span class="font-semibold text-blue-600">{{ pointCount }}</span> 个点位,剩余 |
|
|
|
|
|
|
|
<span class="font-semibold text-red-500">{{ remainingPointCount }}</span> 个点位。 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -49,8 +53,11 @@ |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-button type="primary" @click="loadChardData">查询数据</el-button> |
|
|
|
<el-button type="primary" @click="loadChardData">查询数据</el-button> |
|
|
|
|
|
|
|
查询最近 |
|
|
|
|
|
|
|
<el-input-number :key="refreshKey" v-model="num" :min="1" :max="diffHours" |
|
|
|
|
|
|
|
@input="handleInput"/> |
|
|
|
|
|
|
|
小时 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<NewDataChart v-if="isShowChart" :chart-datas="chartData" :legends="legends" |
|
|
|
<NewDataChart v-if="isShowChart" :chart-datas="chartData" :legends="legends" |
|
|
|
:axis-data="Array.from(axisData)" ref="chartRef"/> |
|
|
|
:axis-data="Array.from(axisData)" ref="chartRef"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -78,11 +85,36 @@ import dayjs from 'dayjs' |
|
|
|
import { nextTick } from "vue"; |
|
|
|
import { nextTick } from "vue"; |
|
|
|
import EdfsWrap from "@/components/Edfs-wrap.vue"; |
|
|
|
import EdfsWrap from "@/components/Edfs-wrap.vue"; |
|
|
|
import { bms_cellRewriteName } from "@/views/stationData/utils"; |
|
|
|
import { bms_cellRewriteName } from "@/views/stationData/utils"; |
|
|
|
|
|
|
|
import { debounce } from 'lodash-es' |
|
|
|
|
|
|
|
|
|
|
|
const time = ref<[string, string]>() |
|
|
|
const time = ref<[string, string]>() |
|
|
|
|
|
|
|
|
|
|
|
const env = import.meta.env |
|
|
|
const env = import.meta.env |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const num = ref<number>() |
|
|
|
|
|
|
|
const diffHours = ref<number>() |
|
|
|
|
|
|
|
const refreshKey = ref(0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleInput = debounce(async (val: number) => { |
|
|
|
|
|
|
|
if (diffHours.value && val > diffHours.value) { |
|
|
|
|
|
|
|
num.value = diffHours.value |
|
|
|
|
|
|
|
refreshKey.value++ |
|
|
|
|
|
|
|
await nextTick() |
|
|
|
|
|
|
|
} else if (val < 1) { |
|
|
|
|
|
|
|
num.value = 1 |
|
|
|
|
|
|
|
refreshKey.value++ |
|
|
|
|
|
|
|
await nextTick() |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
num.value = val |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const endTime = |
|
|
|
|
|
|
|
curDevice.value!.end_time ? |
|
|
|
|
|
|
|
dayjs(curDevice.value!.end_time).valueOf() : dayjs().valueOf() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const startTime = dayjs(endTime).subtract(num.value, 'hour').valueOf() |
|
|
|
|
|
|
|
time.value = [dayjs(startTime).format('YYYY-MM-DD HH:mm:ss'), dayjs(endTime).format('YYYY-MM-DD HH:mm:ss')] |
|
|
|
|
|
|
|
}, 300) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isShowDrawer = defineModel<boolean>() |
|
|
|
const isShowDrawer = defineModel<boolean>() |
|
|
|
const title = computed(() => |
|
|
|
const title = computed(() => |
|
|
|
@ -117,6 +149,14 @@ async function open(device: IOfflineDevice | IOnlineDevice) { |
|
|
|
message.error('获取点位组数据失败') |
|
|
|
message.error('获取点位组数据失败') |
|
|
|
fullscreenLoading.value?.close() |
|
|
|
fullscreenLoading.value?.close() |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
const deviceOff = curDevice.value as IOfflineDevice |
|
|
|
|
|
|
|
if (!deviceOff.start_time || !deviceOff.end_time) { |
|
|
|
|
|
|
|
diffHours.value = 168 // 默认一周时间 |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const start = dayjs(deviceOff.start_time) |
|
|
|
|
|
|
|
const end = dayjs(deviceOff.end_time) |
|
|
|
|
|
|
|
diffHours.value = end.diff(start, "hour") + 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -187,6 +227,12 @@ const chartLimit = ref(1000) |
|
|
|
const chartOffset = ref(0) |
|
|
|
const chartOffset = ref(0) |
|
|
|
const progress = ref(0) |
|
|
|
const progress = ref(0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const pointCount = computed(() => chartAllTotal.value * checkPointList.value.length) |
|
|
|
|
|
|
|
const reqPointCount = ref(0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 剩余点位数 |
|
|
|
|
|
|
|
const remainingPointCount = computed(() => pointCount.value - reqPointCount.value) |
|
|
|
|
|
|
|
|
|
|
|
async function loadChardData() { |
|
|
|
async function loadChardData() { |
|
|
|
if (!time.value || time.value.length !== 2) { |
|
|
|
if (!time.value || time.value.length !== 2) { |
|
|
|
message.error('请选择时间范围') |
|
|
|
message.error('请选择时间范围') |
|
|
|
@ -260,11 +306,11 @@ async function loadChardData() { |
|
|
|
message.error('获取设备数据失败') |
|
|
|
message.error('获取设备数据失败') |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
reqPointCount.value += res?.data?.results?.length || 0 |
|
|
|
const pointData = Array.isArray(res.data.results) ? res.data.results : [] |
|
|
|
const pointData = Array.isArray(res.data.results) ? res.data.results : [] |
|
|
|
setChartData(pointData) |
|
|
|
setChartData(pointData) |
|
|
|
progress.value = Math.min(100, Math.floor(((i + 1) / pageCount) * 100)) |
|
|
|
progress.value = Math.min(100, Math.floor(((i + 1) / pageCount) * 100)) - 1 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
resetChartStatus() |
|
|
|
resetChartStatus() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -315,6 +361,7 @@ function clearData() { |
|
|
|
legends.value = [] |
|
|
|
legends.value = [] |
|
|
|
chartData.clear() |
|
|
|
chartData.clear() |
|
|
|
axisData.clear() |
|
|
|
axisData.clear() |
|
|
|
|
|
|
|
reqPointCount.value = 0 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function resetChartStatus() { |
|
|
|
function resetChartStatus() { |
|
|
|
|