|
@@ -16,11 +16,10 @@
|
|
<n-scrollbar
|
|
<n-scrollbar
|
|
:style="{ maxHeight: `${height - 260}px` }"
|
|
:style="{ maxHeight: `${height - 260}px` }"
|
|
trigger="none"
|
|
trigger="none"
|
|
- @scroll="onScroll"
|
|
|
|
>
|
|
>
|
|
<n-checkbox-group
|
|
<n-checkbox-group
|
|
- @update:value="onUpdateValues"
|
|
|
|
v-model:value="checkValues"
|
|
v-model:value="checkValues"
|
|
|
|
+ @update:value="onUpdateValues"
|
|
>
|
|
>
|
|
<template v-for="item of classList" :key="item.T_id">
|
|
<template v-for="item of classList" :key="item.T_id">
|
|
<n-list-item class="mr-5">
|
|
<n-list-item class="mr-5">
|
|
@@ -60,18 +59,15 @@
|
|
<div class="h-full flex flex-col gap-y-3">
|
|
<div class="h-full flex flex-col gap-y-3">
|
|
<n-space align="center">
|
|
<n-space align="center">
|
|
<n-date-picker
|
|
<n-date-picker
|
|
- v-model:formatted-value="queryData.Time_start"
|
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
- type="datetime"
|
|
|
|
- clearable
|
|
|
|
- placeholder="请选择开始时间"
|
|
|
|
- />
|
|
|
|
- <n-date-picker
|
|
|
|
- v-model:formatted-value="queryData.Time_end"
|
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
- type="datetime"
|
|
|
|
|
|
+ value-format="yyyy-MM-dd HH:mm"
|
|
|
|
+ @update:formatted-value="
|
|
|
|
+ (value) => {
|
|
|
|
+ queryData.Time_start = value[0];
|
|
|
|
+ queryData.Time_end = value[1];
|
|
|
|
+ }
|
|
|
|
+ "
|
|
|
|
+ type="datetimerange"
|
|
clearable
|
|
clearable
|
|
- placeholder="请选择结束时间"
|
|
|
|
/>
|
|
/>
|
|
<n-button type="primary" @click="getDataList">搜索</n-button>
|
|
<n-button type="primary" @click="getDataList">搜索</n-button>
|
|
<ExportVue :task="task" :class-list="classList" />
|
|
<ExportVue :task="task" :class-list="classList" />
|
|
@@ -172,9 +168,6 @@ const task = window.sessionStorage.getItem('task')
|
|
const chart1 = ref(null);
|
|
const chart1 = ref(null);
|
|
const chart2 = ref(null);
|
|
const chart2 = ref(null);
|
|
|
|
|
|
-// const chartData1 = ref([]);
|
|
|
|
-// const chartData2 = ref([]);
|
|
|
|
-
|
|
|
|
// Modal 数据源
|
|
// Modal 数据源
|
|
const modal = reactive({
|
|
const modal = reactive({
|
|
showModal: false,
|
|
showModal: false,
|
|
@@ -186,8 +179,8 @@ const queryData = reactive({
|
|
T_task_id: task.T_task_id,
|
|
T_task_id: task.T_task_id,
|
|
T_sn: '',
|
|
T_sn: '',
|
|
T_id: '',
|
|
T_id: '',
|
|
- Time_start: null,
|
|
|
|
- Time_end: null,
|
|
|
|
|
|
+ Time_start: '',
|
|
|
|
+ Time_end: '',
|
|
page: 1,
|
|
page: 1,
|
|
page_z: 1000,
|
|
page_z: 1000,
|
|
});
|
|
});
|
|
@@ -208,7 +201,7 @@ const dataList = ref([]);
|
|
const dataInfo = ref({});
|
|
const dataInfo = ref({});
|
|
|
|
|
|
// 选项组受控模式下的值
|
|
// 选项组受控模式下的值
|
|
-const checkValues = ref([]);
|
|
|
|
|
|
+const checkValues = ref(null);
|
|
|
|
|
|
// tab
|
|
// tab
|
|
const tabChart = ref('温度');
|
|
const tabChart = ref('温度');
|
|
@@ -222,16 +215,6 @@ const handleTabChange = (value) => {
|
|
};
|
|
};
|
|
|
|
|
|
//
|
|
//
|
|
-const onScroll = (e) => {
|
|
|
|
- const clientHeight = e.target.clientHeight;
|
|
|
|
- const scrollTop = e.target.scrollTop;
|
|
|
|
- const scrollHeight = e.target.scrollHeight;
|
|
|
|
- console.log(clientHeight);
|
|
|
|
- console.log(scrollTop);
|
|
|
|
- console.log(scrollHeight);
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-//
|
|
|
|
const handleSet = (data) => {
|
|
const handleSet = (data) => {
|
|
chart1.value.chart.yAxis[0].addPlotLine({
|
|
chart1.value.chart.yAxis[0].addPlotLine({
|
|
color: 'red',
|
|
color: 'red',
|
|
@@ -268,19 +251,17 @@ const handleSet = (data) => {
|
|
};
|
|
};
|
|
|
|
|
|
// 全选
|
|
// 全选
|
|
-const handleCheckAll = () => {
|
|
|
|
- if (checkValueAll.value) {
|
|
|
|
|
|
+const handleCheckAll = (checked) => {
|
|
|
|
+ checkValues.value = [];
|
|
|
|
+ if (checked) {
|
|
checkValues.value = classList.value.map((item) => item.T_id);
|
|
checkValues.value = classList.value.map((item) => item.T_id);
|
|
checkValues.value.forEach(async (item) => {
|
|
checkValues.value.forEach(async (item) => {
|
|
queryData.T_id = item;
|
|
queryData.T_id = item;
|
|
await getDataList();
|
|
await getDataList();
|
|
- const data1 = dataList.value
|
|
|
|
- .map((item) => [new Date(item.T_time).getTime(), item.T_t])
|
|
|
|
- .sort((a, b) => a[0] - b[0]);
|
|
|
|
- const data2 = dataList.value
|
|
|
|
- .map((item) => [new Date(item.T_time).getTime(), item.T_rh])
|
|
|
|
- .sort((a, b) => a[0] - b[0]);
|
|
|
|
if (tabChart.value === '温度') {
|
|
if (tabChart.value === '温度') {
|
|
|
|
+ const data1 = dataList.value
|
|
|
|
+ .map((item) => [new Date(item.T_time).getTime(), item.T_t])
|
|
|
|
+ .sort((a, b) => a[0] - b[0]);
|
|
chart1.value.chart.addSeries({
|
|
chart1.value.chart.addSeries({
|
|
id: item,
|
|
id: item,
|
|
name: item,
|
|
name: item,
|
|
@@ -299,6 +280,9 @@ const handleCheckAll = () => {
|
|
},
|
|
},
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
|
|
+ const data2 = dataList.value
|
|
|
|
+ .map((item) => [new Date(item.T_time).getTime(), item.T_rh])
|
|
|
|
+ .sort((a, b) => a[0] - b[0]);
|
|
chart2.value.chart.addSeries({
|
|
chart2.value.chart.addSeries({
|
|
id: item,
|
|
id: item,
|
|
name: item,
|
|
name: item,
|
|
@@ -319,17 +303,15 @@ const handleCheckAll = () => {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- const arr = checkValues.value;
|
|
|
|
if (tabChart.value === '温度') {
|
|
if (tabChart.value === '温度') {
|
|
- arr.forEach(async (item) => {
|
|
|
|
- chart1.value.chart.get(item).remove();
|
|
|
|
|
|
+ classList.value.forEach((item) => {
|
|
|
|
+ chart1.value.chart.get(item.T_id).remove();
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- arr.forEach(async (item) => {
|
|
|
|
- chart2.value.chart.get(item).remove();
|
|
|
|
|
|
+ classList.value.forEach((item) => {
|
|
|
|
+ chart2.value.chart.get(item.T_id).remove();
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- checkValues.value = [];
|
|
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -530,13 +512,7 @@ const getClassList = async () => {
|
|
|
|
|
|
// 获取任务数据列表
|
|
// 获取任务数据列表
|
|
const getDataList = async () => {
|
|
const getDataList = async () => {
|
|
- const data = {};
|
|
|
|
- for (const key in queryData) {
|
|
|
|
- if (queryData[key]) {
|
|
|
|
- data[key] = queryData[key];
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- const { data: res } = await getTaskDataList(data);
|
|
|
|
|
|
+ const { data: res } = await getTaskDataList(queryData);
|
|
dataList.value = res.Data.List || [];
|
|
dataList.value = res.Data.List || [];
|
|
if (queryData.page_z <= res.Data.Page_size) {
|
|
if (queryData.page_z <= res.Data.Page_size) {
|
|
const arr = classList.value.filter((item) =>
|
|
const arr = classList.value.filter((item) =>
|
|
@@ -552,39 +528,41 @@ const getDataList = async () => {
|
|
|
|
|
|
getClassList();
|
|
getClassList();
|
|
|
|
|
|
-if (task.T_collection_state === 0) {
|
|
|
|
- notification.info({
|
|
|
|
- closable: false,
|
|
|
|
- title: '未完成',
|
|
|
|
- meta: `当前时间:${formatted.value}`,
|
|
|
|
- duration: 2500,
|
|
|
|
- keepAliveOnHover: true,
|
|
|
|
- });
|
|
|
|
-} else if (task.T_collection_state === 1) {
|
|
|
|
- notification.info({
|
|
|
|
- closable: false,
|
|
|
|
- title: '已完成',
|
|
|
|
- meta: `当前时间:${formatted.value}`,
|
|
|
|
- duration: 2500,
|
|
|
|
- keepAliveOnHover: true,
|
|
|
|
- });
|
|
|
|
-} else if (task.T_collection_state === 2) {
|
|
|
|
- notification.info({
|
|
|
|
- closable: false,
|
|
|
|
- title: '处理中',
|
|
|
|
- meta: `当前时间:${formatted.value}`,
|
|
|
|
- duration: 2500,
|
|
|
|
- keepAliveOnHover: true,
|
|
|
|
- });
|
|
|
|
-} else if (task.T_collection_state === 3) {
|
|
|
|
- notification.info({
|
|
|
|
- closable: false,
|
|
|
|
- title: '已采集-无数据',
|
|
|
|
- meta: `当前时间:${formatted.value}`,
|
|
|
|
- duration: 2500,
|
|
|
|
- keepAliveOnHover: true,
|
|
|
|
- });
|
|
|
|
-}
|
|
|
|
|
|
+onMounted(() => {
|
|
|
|
+ if (task.T_collection_state === 0) {
|
|
|
|
+ notification.info({
|
|
|
|
+ closable: false,
|
|
|
|
+ title: '未完成',
|
|
|
|
+ meta: `当前时间:${formatted.value}`,
|
|
|
|
+ duration: 2500,
|
|
|
|
+ keepAliveOnHover: true,
|
|
|
|
+ });
|
|
|
|
+ } else if (task.T_collection_state === 1) {
|
|
|
|
+ notification.info({
|
|
|
|
+ closable: false,
|
|
|
|
+ title: '已完成',
|
|
|
|
+ meta: `当前时间:${formatted.value}`,
|
|
|
|
+ duration: 2500,
|
|
|
|
+ keepAliveOnHover: true,
|
|
|
|
+ });
|
|
|
|
+ } else if (task.T_collection_state === 2) {
|
|
|
|
+ notification.info({
|
|
|
|
+ closable: false,
|
|
|
|
+ title: '处理中',
|
|
|
|
+ meta: `当前时间:${formatted.value}`,
|
|
|
|
+ duration: 2500,
|
|
|
|
+ keepAliveOnHover: true,
|
|
|
|
+ });
|
|
|
|
+ } else if (task.T_collection_state === 3) {
|
|
|
|
+ notification.info({
|
|
|
|
+ closable: false,
|
|
|
|
+ title: '已采集-无数据',
|
|
|
|
+ meta: `当前时间:${formatted.value}`,
|
|
|
|
+ duration: 2500,
|
|
|
|
+ keepAliveOnHover: true,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+});
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped></style>
|
|
<style lang="scss" scoped></style>
|