|
|
|
|
@ -7,12 +7,16 @@
@@ -7,12 +7,16 @@
|
|
|
|
|
size="100%" |
|
|
|
|
modal-class="model-dev-opn" |
|
|
|
|
:before-close="handleBeforeClose" |
|
|
|
|
@opened="onDrawerOpened"> |
|
|
|
|
@opened="onDrawerOpened" |
|
|
|
|
> |
|
|
|
|
<main class="wh-full flex"> |
|
|
|
|
|
|
|
|
|
<EdfsWrap title="点位选择" |
|
|
|
|
isCollapse :collapsed="collapsed" @collapse="onCollapse" |
|
|
|
|
:style="{width: `${collapsed ? 0 : 340}px`}"> |
|
|
|
|
<EdfsWrap |
|
|
|
|
title="点位选择" |
|
|
|
|
isCollapse |
|
|
|
|
:collapsed="collapsed" |
|
|
|
|
@collapse="onCollapse" |
|
|
|
|
:style="{ width: `${collapsed ? 0 : 340}px` }" |
|
|
|
|
> |
|
|
|
|
<el-select |
|
|
|
|
v-if="currentGroup?.customNode" |
|
|
|
|
v-model="selectValue" |
|
|
|
|
@ -35,8 +39,7 @@
@@ -35,8 +39,7 @@
|
|
|
|
|
> |
|
|
|
|
</PointCheckbox> |
|
|
|
|
</EdfsWrap> |
|
|
|
|
<div class="flex-1 p-4 h-full overflow-hidden relative" |
|
|
|
|
> |
|
|
|
|
<div class="flex-1 p-4 h-full overflow-hidden relative"> |
|
|
|
|
<div class="absolute w-full h-full bg-[#ffffffe5] z-99" v-if="loadingChart"> |
|
|
|
|
<div class="w-full h-full flex flex-col justify-center items-center"> |
|
|
|
|
<el-progress |
|
|
|
|
@ -47,11 +50,13 @@
@@ -47,11 +50,13 @@
|
|
|
|
|
status="success" |
|
|
|
|
/> |
|
|
|
|
<div class="text-center text-gray-700 text-lg leading-relaxed"> |
|
|
|
|
正在加载数据,请稍等。<br> |
|
|
|
|
正在加载数据,请稍等。<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> 个点位。 |
|
|
|
|
<span class="font-semibold text-blue-600">{{ pointCount }}</span> |
|
|
|
|
个点位,剩余 |
|
|
|
|
<span class="font-semibold text-red-500">{{ remainingPointCount }}</span> |
|
|
|
|
个点位。 |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
@ -70,8 +75,13 @@
@@ -70,8 +75,13 @@
|
|
|
|
|
</div> |
|
|
|
|
<el-button type="primary" @click="loadChardData">查询数据</el-button> |
|
|
|
|
查询最近 |
|
|
|
|
<el-input-number :key="refreshKey" v-model="num" :min="1" :max="diffHours" |
|
|
|
|
@input="handleInput"/> |
|
|
|
|
<el-input-number |
|
|
|
|
:key="refreshKey" |
|
|
|
|
v-model="num" |
|
|
|
|
:min="1" |
|
|
|
|
:max="diffHours" |
|
|
|
|
@input="handleInput" |
|
|
|
|
/> |
|
|
|
|
小时 |
|
|
|
|
</div> |
|
|
|
|
<NewDataChart |
|
|
|
|
@ -100,15 +110,13 @@ import {
@@ -100,15 +110,13 @@ import {
|
|
|
|
|
} from '@/api/module/transfer' |
|
|
|
|
import { useMessage } from '@/composables/useMessage' |
|
|
|
|
import dayjs from 'dayjs' |
|
|
|
|
import { nextTick } from "vue"; |
|
|
|
|
import EdfsWrap from "@/components/Edfs-wrap.vue"; |
|
|
|
|
import PointCheckbox from "@/views/stationData/component/pointCheckbox.vue"; |
|
|
|
|
import { nextTick } from 'vue' |
|
|
|
|
import EdfsWrap from '@/components/Edfs-wrap.vue' |
|
|
|
|
import PointCheckbox from '@/views/stationData/component/pointCheckbox.vue' |
|
|
|
|
import { debounce } from 'lodash-es' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const env = import.meta.env |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const num = ref<number>() |
|
|
|
|
const diffHours = ref<number>() |
|
|
|
|
const refreshKey = ref(0) |
|
|
|
|
@ -125,34 +133,39 @@ const handleInput = debounce(async (val: number) => {
@@ -125,34 +133,39 @@ const handleInput = debounce(async (val: number) => {
|
|
|
|
|
} else { |
|
|
|
|
num.value = val |
|
|
|
|
} |
|
|
|
|
const endTime = |
|
|
|
|
curDevice.value!.end_time ? |
|
|
|
|
dayjs(curDevice.value!.end_time).valueOf() : dayjs().valueOf() |
|
|
|
|
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')] |
|
|
|
|
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 title = computed(() => |
|
|
|
|
( |
|
|
|
|
curDevice.value?.isonLine ? |
|
|
|
|
'数据详情' : env.VITE_APP_ENV === 'local' |
|
|
|
|
? `已导出数据详情` : '已导入数据详情' |
|
|
|
|
) |
|
|
|
|
curDevice.value?.isonLine |
|
|
|
|
? '数据详情' |
|
|
|
|
: env.VITE_APP_ENV === 'local' |
|
|
|
|
? `已导出数据详情` |
|
|
|
|
: '已导入数据详情' |
|
|
|
|
) |
|
|
|
|
const message = useMessage() |
|
|
|
|
const PointCheckboxRef = ref<InstanceType<typeof PointCheckbox>>() |
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['on-save']) |
|
|
|
|
const pointList = ref<IMyPoint[]>([]) |
|
|
|
|
const curDevice = ref<IDevice & { isonLine: boolean, siteName: string }>() |
|
|
|
|
const curDevice = ref<IDevice & { isonLine: boolean; siteName: string }>() |
|
|
|
|
|
|
|
|
|
async function open(device: IDevice & { |
|
|
|
|
isonLine: boolean, |
|
|
|
|
async function open( |
|
|
|
|
device: IDevice & { |
|
|
|
|
isonLine: boolean |
|
|
|
|
siteName: string |
|
|
|
|
}, group: IPointGroupOV) { |
|
|
|
|
}, |
|
|
|
|
group: IPointGroupOV |
|
|
|
|
) { |
|
|
|
|
curDevice.value = device |
|
|
|
|
currentGroup.value = group |
|
|
|
|
onCollapse(false) |
|
|
|
|
@ -179,7 +192,7 @@ async function open(device: IDevice & {
@@ -179,7 +192,7 @@ async function open(device: IDevice & {
|
|
|
|
|
} |
|
|
|
|
const start = dayjs(deviceOff.start_time) |
|
|
|
|
const end = dayjs(deviceOff.end_time) |
|
|
|
|
diffHours.value = end.diff(start, "hour") + 1; |
|
|
|
|
diffHours.value = end.diff(start, 'hour') + 1 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const selectValue = ref() |
|
|
|
|
@ -188,14 +201,15 @@ function onchangeSelect(value: string) {
@@ -188,14 +201,15 @@ function onchangeSelect(value: string) {
|
|
|
|
|
PointCheckboxRef.value?.clearCheck() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const loadingPoints = ref(false) |
|
|
|
|
const columParams = computed(() => ['ts', ...checkPointList.value.map(i => i.addr)]) |
|
|
|
|
|
|
|
|
|
const currentGroup = ref<IPointGroupOV & { |
|
|
|
|
const currentGroup = ref< |
|
|
|
|
IPointGroupOV & { |
|
|
|
|
customNode?: boolean |
|
|
|
|
brother?: Array<any> |
|
|
|
|
}>() |
|
|
|
|
} |
|
|
|
|
>() |
|
|
|
|
|
|
|
|
|
async function loadPoints() { |
|
|
|
|
if (!currentGroup.value) { |
|
|
|
|
@ -251,25 +265,19 @@ async function loadDeviceDetails() {
@@ -251,25 +265,19 @@ async function loadDeviceDetails() {
|
|
|
|
|
|
|
|
|
|
const chartData = reactive(new Map<string, any[]>()) |
|
|
|
|
const axisData = new Set<string>() |
|
|
|
|
const legends = ref<{ |
|
|
|
|
addr: string; label: string, unit: string, coefficient?: string | number |
|
|
|
|
operator?: string |
|
|
|
|
}[]>([]) |
|
|
|
|
|
|
|
|
|
function onChangeCoefficient( |
|
|
|
|
const legends = ref< |
|
|
|
|
{ |
|
|
|
|
id, |
|
|
|
|
coefficient, |
|
|
|
|
operator, |
|
|
|
|
}: { |
|
|
|
|
id: string |
|
|
|
|
coefficient: string |
|
|
|
|
operator: string |
|
|
|
|
}) { |
|
|
|
|
addr: string |
|
|
|
|
label: string |
|
|
|
|
unit: string |
|
|
|
|
coefficient?: string | number |
|
|
|
|
}[] |
|
|
|
|
>([]) |
|
|
|
|
|
|
|
|
|
function onChangeCoefficient({ id, coefficient }: { id: string; coefficient: string }) { |
|
|
|
|
const find = legends.value.findIndex(r => r.addr === id) |
|
|
|
|
if (find !== -1) { |
|
|
|
|
legends.value[find].coefficient = coefficient |
|
|
|
|
legends.value[find].operator = operator |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -279,7 +287,6 @@ const chartLimit = ref(1000)
@@ -279,7 +287,6 @@ const chartLimit = ref(1000)
|
|
|
|
|
const chartOffset = ref(0) |
|
|
|
|
const progress = ref(0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const pointCount = computed(() => chartAllTotal.value * checkPointList.value.length) |
|
|
|
|
const reqPointCount = ref(0) |
|
|
|
|
|
|
|
|
|
@ -303,7 +310,9 @@ async function loadChardData() {
@@ -303,7 +310,9 @@ async function loadChardData() {
|
|
|
|
|
columns: columParams.value, |
|
|
|
|
isLocal: !curDevice.value?.isonLine, |
|
|
|
|
host: curDevice.value?.isonLine ? (curDevice.value as IOnlineDevice).clientIp : '', |
|
|
|
|
name: currentGroup.value?.customNode ? selectValue.value : currentGroup.value?.name as string, |
|
|
|
|
name: currentGroup.value?.customNode |
|
|
|
|
? selectValue.value |
|
|
|
|
: (currentGroup.value?.name as string), |
|
|
|
|
startTime: time.value[0], |
|
|
|
|
endTime: time.value[1], |
|
|
|
|
} |
|
|
|
|
@ -316,7 +325,7 @@ async function loadChardData() {
@@ -316,7 +325,7 @@ async function loadChardData() {
|
|
|
|
|
const params: IGetDeviceDataParams = { |
|
|
|
|
...options, |
|
|
|
|
limit, |
|
|
|
|
offset |
|
|
|
|
offset, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
loadingChart.value = true |
|
|
|
|
@ -352,7 +361,7 @@ async function loadChardData() {
@@ -352,7 +361,7 @@ async function loadChardData() {
|
|
|
|
|
const params: IGetDeviceDataParams = { |
|
|
|
|
...options, |
|
|
|
|
limit, |
|
|
|
|
offset: i * Number(limit) |
|
|
|
|
offset: i * Number(limit), |
|
|
|
|
} |
|
|
|
|
const res = await getDeviceDetails(params) |
|
|
|
|
chartAllTotal.value = res?.data?.total ?? 0 |
|
|
|
|
@ -370,7 +379,6 @@ async function loadChardData() {
@@ -370,7 +379,6 @@ async function loadChardData() {
|
|
|
|
|
resetChartStatus() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function setChartData(pointData: any[]) { |
|
|
|
|
for (const addr of columParams.value.filter(i => i !== 'ts')) { |
|
|
|
|
const label = pointList.value.find(i => i.addr === addr)?.label || addr |
|
|
|
|
@ -399,10 +407,8 @@ function setChartData(pointData: any[]) {
@@ -399,10 +407,8 @@ function setChartData(pointData: any[]) {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function handleBeforeClose(done: () => void) { |
|
|
|
|
time.value = undefined |
|
|
|
|
isShowDrawer.value = false |
|
|
|
|
@ -470,9 +476,12 @@ const disabledDate = (time: any) => {
@@ -470,9 +476,12 @@ const disabledDate = (time: any) => {
|
|
|
|
|
console.log('disableDate error', e) |
|
|
|
|
return current.isAfter(dayjs(), 'day') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
const getBeforeMonth = dayjs().startOf('month').subtract(1, 'month').startOf('month').toDate() |
|
|
|
|
const getBeforeMonth = dayjs() |
|
|
|
|
.startOf('month') |
|
|
|
|
.subtract(1, 'month') |
|
|
|
|
.startOf('month') |
|
|
|
|
.toDate() |
|
|
|
|
const collapsed = ref(false) |
|
|
|
|
|
|
|
|
|
function onCollapse(value?: boolean) { |
|
|
|
|
|