|
@@ -3,31 +3,35 @@
|
|
<n-page-header @back="$router.back">
|
|
<n-page-header @back="$router.back">
|
|
<template #title> 数据编辑 </template>
|
|
<template #title> 数据编辑 </template>
|
|
</n-page-header>
|
|
</n-page-header>
|
|
- <div class="flex-1 grid grid-cols-4 gap-x-3">
|
|
|
|
- <n-card>
|
|
|
|
|
|
+ <div class="flex-1 grid grid-cols-4 gap-x-3" style="display: flex;">
|
|
|
|
+ <n-card style="width: 250px;flex-shrink: 0;">
|
|
<n-tabs display-directive="show">
|
|
<n-tabs display-directive="show">
|
|
<n-tab-pane name="1" tab="设备">
|
|
<n-tab-pane name="1" tab="设备">
|
|
<n-list>
|
|
<n-list>
|
|
<template #header>
|
|
<template #header>
|
|
- <n-checkbox v-model:checked="checked" @update:checked="handleSelectAll">
|
|
|
|
- 全选
|
|
|
|
- </n-checkbox>
|
|
|
|
|
|
+ <div style="display: flex;justify-content: space-between;align-items: center;">
|
|
|
|
+ <n-checkbox v-model:checked="checked" @update:checked="handleSelectAll">
|
|
|
|
+ 全选
|
|
|
|
+ </n-checkbox>
|
|
|
|
+ <n-button type="primary" @click="renderFun()">渲染</n-button>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
<n-scrollbar :style="{ maxHeight: `${height - 310}px` }" trigger="none">
|
|
<n-scrollbar :style="{ maxHeight: `${height - 310}px` }" trigger="none">
|
|
<n-checkbox-group v-model:value="checkValues" @update:value="handleCheckValues">
|
|
<n-checkbox-group v-model:value="checkValues" @update:value="handleCheckValues">
|
|
<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">
|
|
<template #prefix>
|
|
<template #prefix>
|
|
- <n-checkbox :value="item.T_id" />
|
|
|
|
|
|
+ <n-checkbox :value="item" />
|
|
</template>
|
|
</template>
|
|
<template #suffix>
|
|
<template #suffix>
|
|
<n-space :wrap="false">
|
|
<n-space :wrap="false">
|
|
- <EditClass :task="task" :taskClass="item" :getClassList="getClassList" />
|
|
|
|
<DeleteClass :task="task" :taskClass="item" :getClassList="getClassList" />
|
|
<DeleteClass :task="task" :taskClass="item" :getClassList="getClassList" />
|
|
</n-space>
|
|
</n-space>
|
|
</template>
|
|
</template>
|
|
<n-thing>
|
|
<n-thing>
|
|
- <template #header> {{ item.T_id }} </template>
|
|
|
|
|
|
+ <template #header>
|
|
|
|
+ <div @dblclick="dblclickFun(item)">{{ item.T_id }} </div>
|
|
|
|
+ </template>
|
|
<template #description> {{ item.T_sn }} </template>
|
|
<template #description> {{ item.T_sn }} </template>
|
|
</n-thing>
|
|
</n-thing>
|
|
</n-list-item>
|
|
</n-list-item>
|
|
@@ -46,16 +50,16 @@
|
|
</n-tab-pane>
|
|
</n-tab-pane>
|
|
</n-tabs>
|
|
</n-tabs>
|
|
</n-card>
|
|
</n-card>
|
|
- <n-card class="h-full col-span-3">
|
|
|
|
|
|
+ <n-card style="flex: 1;">
|
|
<div class="h-full flex flex-col gap-y-3">
|
|
<div class="h-full flex flex-col gap-y-3">
|
|
<n-space justify="space-between">
|
|
<n-space justify="space-between">
|
|
<n-input-group>
|
|
<n-input-group>
|
|
<n-date-picker format="yyyy-MM-dd HH:mm" :time-picker-props="{ format: 'HH:mm' }" @update:formatted-value="(value) => {
|
|
<n-date-picker format="yyyy-MM-dd HH:mm" :time-picker-props="{ format: 'HH:mm' }" @update:formatted-value="(value) => {
|
|
- queryData.Time_start = value[0];
|
|
|
|
- queryData.Time_end = value[1];
|
|
|
|
- }
|
|
|
|
- " type="datetimerange" clearable />
|
|
|
|
- <n-button type="primary" @click="getDataList">搜索</n-button>
|
|
|
|
|
|
+ queryData.Time_start = value[0];
|
|
|
|
+ queryData.Time_end = value[1];
|
|
|
|
+ }
|
|
|
|
+ " type="datetimerange" />
|
|
|
|
+ <n-button type="primary" @click="renderFun">搜索</n-button>
|
|
</n-input-group>
|
|
</n-input-group>
|
|
<n-space>
|
|
<n-space>
|
|
<ExportVue :task="task" :class-list="classList" />
|
|
<ExportVue :task="task" :class-list="classList" />
|
|
@@ -68,8 +72,9 @@
|
|
</n-space>
|
|
</n-space>
|
|
<n-tabs type="segment" animated v-model:value="tabChart" @update:value="handleTabChange">
|
|
<n-tabs type="segment" animated v-model:value="tabChart" @update:value="handleTabChange">
|
|
<n-tab-pane name="温度" tab="温度">
|
|
<n-tab-pane name="温度" tab="温度">
|
|
- <Chart :style="{ minHeight: `${height - 300}px` }" ref="chart1" constructor-type="stockChart"
|
|
|
|
- :options="chartOptions1"></Chart>
|
|
|
|
|
|
+ <!-- <Chart :style="{ minHeight: `${height - 300}px` }" ref="chart1" constructor-type="stockChart"
|
|
|
|
+ :options="chartOptions1"></Chart> -->
|
|
|
|
+ <highchartsT :dataList="dataList"></highchartsT>
|
|
</n-tab-pane>
|
|
</n-tab-pane>
|
|
<n-tab-pane name="湿度" tab="湿度">
|
|
<n-tab-pane name="湿度" tab="湿度">
|
|
<Chart :style="{ minHeight: `${height - 300}px` }" ref="chart2" constructor-type="stockChart"
|
|
<Chart :style="{ minHeight: `${height - 300}px` }" ref="chart2" constructor-type="stockChart"
|
|
@@ -99,18 +104,33 @@
|
|
是否确认删除?
|
|
是否确认删除?
|
|
</n-popconfirm>
|
|
</n-popconfirm>
|
|
<n-button type="primary" @click="editTask">确定</n-button>
|
|
<n-button type="primary" @click="editTask">确定</n-button>
|
|
-
|
|
|
|
|
|
+
|
|
</n-space>
|
|
</n-space>
|
|
</n-modal>
|
|
</n-modal>
|
|
|
|
+ <!-- 编辑 -->
|
|
|
|
+ <n-modal v-model:show="showModal" preset="dialog" positive-text="确认" negative-text="取消" :show-icon="false"
|
|
|
|
+ @positive-click="handleEdit">
|
|
|
|
+ <n-form :model="formDatas" label-width="auto" show-require-mark>
|
|
|
|
+ <n-form-item label="ID" path="T_id">
|
|
|
|
+ <n-input v-model:value="formDatas.T_id" />
|
|
|
|
+ </n-form-item>
|
|
|
|
+ <n-form-item label="SN" path="T_sn">
|
|
|
|
+ <n-input v-model:value="formDatas.T_sn" disabled="false" />
|
|
|
|
+ </n-form-item>
|
|
|
|
+ </n-form>
|
|
|
|
+ </n-modal>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
|
+
|
|
import { Chart } from 'highcharts-vue';
|
|
import { Chart } from 'highcharts-vue';
|
|
|
|
+import highchartsT from '@/components/highcharts-t.vue'
|
|
import {
|
|
import {
|
|
deleteTaskData,
|
|
deleteTaskData,
|
|
editTaskData,
|
|
editTaskData,
|
|
getTaskDataClassList,
|
|
getTaskDataClassList,
|
|
getTaskDataList,
|
|
getTaskDataList,
|
|
|
|
+ editTaskDataClass
|
|
} from '@/api';
|
|
} from '@/api';
|
|
import AddVue from './AddVue.vue';
|
|
import AddVue from './AddVue.vue';
|
|
import ImportVue from './ImportVue.vue';
|
|
import ImportVue from './ImportVue.vue';
|
|
@@ -122,11 +142,10 @@ import FormList from './FormList.vue';
|
|
|
|
|
|
import { useWindowSize } from '@vueuse/core';
|
|
import { useWindowSize } from '@vueuse/core';
|
|
import { useNow, useDateFormat } from '@vueuse/core';
|
|
import { useNow, useDateFormat } from '@vueuse/core';
|
|
-import EditClass from './EditTaskClass.vue';
|
|
|
|
import DeleteClass from './DeleteTaskClass.vue';
|
|
import DeleteClass from './DeleteTaskClass.vue';
|
|
import { dateFormat } from 'highcharts';
|
|
import { dateFormat } from 'highcharts';
|
|
-import { TimeData } from '@/plugin/timeFun';
|
|
|
|
-
|
|
|
|
|
|
+import { TimeDate } from '@/plugin/timeFun';
|
|
|
|
+import { useMessage } from "naive-ui";
|
|
|
|
|
|
const formatted = useDateFormat(useNow(), 'YYYY-MM-DD HH:mm:ss');
|
|
const formatted = useDateFormat(useNow(), 'YYYY-MM-DD HH:mm:ss');
|
|
|
|
|
|
@@ -149,29 +168,178 @@ const modal = reactive({
|
|
title: '',
|
|
title: '',
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * --------最新写法开始-----------------------------------------------------------------------------------
|
|
|
|
+ */
|
|
|
|
+ const formDatas = reactive({
|
|
|
|
+ T_sn: '',
|
|
|
|
+ T_id: '',
|
|
|
|
+});
|
|
|
|
+const showModal = ref(false);
|
|
|
|
+const dblclickFun = (e) => {
|
|
|
|
+ console.log('双击',e)
|
|
|
|
+ formDatas.T_sn = e.T_sn
|
|
|
|
+ formDatas.T_id = e.T_id
|
|
|
|
+ showModal.value = true;
|
|
|
|
+}
|
|
|
|
+const handleEdit = async () => {
|
|
|
|
+ try {
|
|
|
|
+ const { data: res } = await editTaskDataClass({
|
|
|
|
+ T_task_id: queryData.T_task_id,
|
|
|
|
+ T_sn: formDatas.T_sn,
|
|
|
|
+ T_id: formDatas.T_id,
|
|
|
|
+ });
|
|
|
|
+ if (res.Code === 200) {
|
|
|
|
+ message.success(res.Msg);
|
|
|
|
+ getClassList()
|
|
|
|
+ }
|
|
|
|
+ } catch (e) {
|
|
|
|
+ console.log(e);
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+// 表单数据
|
|
|
|
+const formValue = reactive({
|
|
|
|
+ T_t: null,
|
|
|
|
+ T_rh: null,
|
|
|
|
+});
|
|
// 查询数据
|
|
// 查询数据
|
|
const queryData = reactive({
|
|
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: '2023-02-06 21:00',
|
|
|
|
- // Time_end: '2023-02-06 21:10',
|
|
|
|
- Time_start: '',
|
|
|
|
- Time_end: '',
|
|
|
|
|
|
+ Time_start: '2023-04-18 07:14:00',
|
|
|
|
+ Time_end: '2023-04-18 07:25:00',
|
|
|
|
+ // Time_start: '',
|
|
|
|
+ // Time_end: '',
|
|
page: 1,
|
|
page: 1,
|
|
page_z: 9999,
|
|
page_z: 9999,
|
|
});
|
|
});
|
|
-const goDataEd = ()=>{
|
|
|
|
-
|
|
|
|
|
|
+// 获取导航栏设备列表
|
|
|
|
+const getClassList = async () => {
|
|
|
|
+ const { data: res } = await getTaskDataClassList({
|
|
|
|
+ T_task_id: queryData.T_task_id,
|
|
|
|
+ });
|
|
|
|
+ classList.value = res.Data || [];
|
|
|
|
+};
|
|
|
|
+getClassList();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+//渲染按钮
|
|
|
|
+const renderFun = async () => {
|
|
|
|
+ if(checkValues.value==null){
|
|
|
|
+ message.error("哎呀,请选择设备在查询哟");
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ dataList.value = []
|
|
|
|
+ let arr = []
|
|
|
|
+ for (let i = 0; i < checkValues.value.length; i++) {
|
|
|
|
+ queryData.T_id = checkValues.value[i].T_id;
|
|
|
|
+ queryData.T_sn = checkValues.value[i].T_sn;
|
|
|
|
+ const resIt = await getDataList();
|
|
|
|
+ console.log('/*/*/',resIt)
|
|
|
|
+ arr.push(convertDataFun(resIt.data.Data.List))
|
|
|
|
+ }
|
|
|
|
+ dataList.value = arr
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const tabValue = ref('温度')
|
|
|
|
+
|
|
|
|
+const time = ref('');
|
|
|
|
+const dataInfo = ref({});
|
|
|
|
+// 删除
|
|
|
|
+const deleteTask = async () => {
|
|
|
|
+ const { data: res } = await deleteTaskData({
|
|
|
|
+ T_task_id: queryData.T_task_id,
|
|
|
|
+ Id: dataInfo.value[5],
|
|
|
|
+ });
|
|
|
|
+ if (res.Code === 200) {
|
|
|
|
+ modal.showModal = false;
|
|
|
|
+ message.success(`${res.Msg},点击渲染或搜索更新数据`);
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+// 编辑
|
|
|
|
+const editTask = async () => {
|
|
|
|
+ console.log(tabValue.value, dataInfo.value)
|
|
|
|
+ const { data: res } = await editTaskData({
|
|
|
|
+ T_task_id: queryData.T_task_id,
|
|
|
|
+ Id: dataInfo.value[5],
|
|
|
|
+ T_t: tabValue.value == '温度' ? formValue.T_t : dataInfo.value[2],
|
|
|
|
+ T_rh: tabValue.value == '湿度' ? formValue.T_rh : dataInfo.value[2],
|
|
|
|
+ T_time: TimeDate(dataInfo.value[0]),
|
|
|
|
+ });
|
|
|
|
+ if (res.Code === 200) {
|
|
|
|
+ modal.showModal = false;
|
|
|
|
+ message.success(`${res.Msg},点击渲染或搜索更新数据`);
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+//转换图表所需数据
|
|
|
|
+const convertDataFun = (array) => {
|
|
|
|
+ let objData = {
|
|
|
|
+ name: '',
|
|
|
|
+ data: [],
|
|
|
|
+ events: {
|
|
|
|
+ click(e) {
|
|
|
|
+ formValue.T_t = e.point.y
|
|
|
|
+ modal.showModal = true
|
|
|
|
+ queryData.T_id = e.point.series.name;
|
|
|
|
+ modal.title = '温度';
|
|
|
|
+ let serName = e.point.series.name
|
|
|
|
+ const b = dataList.value.find(item => item.name == serName)
|
|
|
|
+ dataInfo.value = b.data[e.point.index];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (array != null) {
|
|
|
|
+ let arr = array.reverse()
|
|
|
|
+ objData.name = arr[0].T_sn
|
|
|
|
+ arr.forEach(item => {
|
|
|
|
+ objData.data.push([new Date(item.T_time).getTime(), item.T_t, item.T_rh, item.T_sn, item.T_id, item.ID])
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ objData.data = []
|
|
|
|
+ }
|
|
|
|
+ return objData
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+// 获取任务数据列表
|
|
|
|
+const getDataList = () => {
|
|
|
|
+ return new Promise((resolve) => {
|
|
|
|
+ const resIt = getTaskDataList(queryData);
|
|
|
|
+ // console.log('返回',resIt)
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ resolve(resIt)
|
|
|
|
+ }, 500)
|
|
|
|
+ })
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+const checked = ref(false);
|
|
|
|
+
|
|
|
|
+// 全选
|
|
|
|
+const handleSelectAll = async () => {
|
|
|
|
+ checked.value ? checkValues.value = classList.value : checkValues.value = []
|
|
|
|
+};
|
|
|
|
+//单选
|
|
|
|
+const handleCheckValues = () => {
|
|
|
|
+ checkValues.value.length != classList.value.length ? checked.value = false : checked.value = true
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * --------最新写法结束-----------------------------------------------------------------------------------
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+const goDataEd = () => {
|
|
|
|
+
|
|
// window.open(`http://coldverifylocal.coldbaozhida.com/data_edit/?taskId=${queryData.T_task_id}`, '_blank')
|
|
// window.open(`http://coldverifylocal.coldbaozhida.com/data_edit/?taskId=${queryData.T_task_id}`, '_blank')
|
|
window.open(`http://coldverifylocal.coldbaozhida.com/data_edit/?taskId=${queryData.T_task_id}`, '_blank')
|
|
window.open(`http://coldverifylocal.coldbaozhida.com/data_edit/?taskId=${queryData.T_task_id}`, '_blank')
|
|
|
|
|
|
}
|
|
}
|
|
-// 表单数据
|
|
|
|
-const formValue = reactive({
|
|
|
|
- T_t: null,
|
|
|
|
- T_rh: null,
|
|
|
|
-});
|
|
|
|
|
|
+
|
|
|
|
|
|
// 数据源对象
|
|
// 数据源对象
|
|
// const state = reactive({});
|
|
// const state = reactive({});
|
|
@@ -183,7 +351,7 @@ const classList = ref([]);
|
|
const dataList = ref([]);
|
|
const dataList = ref([]);
|
|
|
|
|
|
//
|
|
//
|
|
-const dataInfo = ref({});
|
|
|
|
|
|
+
|
|
|
|
|
|
// 选项组受控模式下的值
|
|
// 选项组受控模式下的值
|
|
const checkValues = ref(null);
|
|
const checkValues = ref(null);
|
|
@@ -192,7 +360,7 @@ const checkValues = ref(null);
|
|
const tabChart = ref('温度');
|
|
const tabChart = ref('温度');
|
|
|
|
|
|
const handleTabChange = (value) => {
|
|
const handleTabChange = (value) => {
|
|
- console.log(value);
|
|
|
|
|
|
+ tabValue.value = value
|
|
checkValues.value = [];
|
|
checkValues.value = [];
|
|
checked.value = false;
|
|
checked.value = false;
|
|
};
|
|
};
|
|
@@ -236,145 +404,10 @@ const handleSet = (data) => {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
-const checked = ref(false);
|
|
|
|
|
|
|
|
-// 全选
|
|
|
|
-const handleSelectAll = async (value) => {
|
|
|
|
- if (value) {
|
|
|
|
- checkValues.value = classList.value.map((item) => item.T_id);
|
|
|
|
- const arr = classList.value.filter(
|
|
|
|
- (item) => !selectedValue.value.includes(item.T_id)
|
|
|
|
- );
|
|
|
|
- for (let item of arr) {
|
|
|
|
- queryData.T_id = item.T_id;
|
|
|
|
- queryData.T_sn = item.T_sn;
|
|
|
|
- await getDataList();
|
|
|
|
- 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({
|
|
|
|
- id: item.T_id,
|
|
|
|
- name: item.T_id,
|
|
|
|
- data: data1,
|
|
|
|
- lineWidth: 1,
|
|
|
|
- cursor: 'pointer',
|
|
|
|
- events: {
|
|
|
|
- click(e) {
|
|
|
|
-
|
|
|
|
- modal.title = '温度';
|
|
|
|
- modal.showModal = true;
|
|
|
|
- time.value = dateFormat('%Y-%m-%d %H:%M:%S', e.point.x);
|
|
|
|
- formValue.T_t = e.point.y;
|
|
|
|
- queryData.T_id = e.point.series.name;
|
|
|
|
- getDataList();
|
|
|
|
- dataInfo.value = dataList.value[e.point.index];
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
- } 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({
|
|
|
|
- id: item.T_id,
|
|
|
|
- name: item.T_id,
|
|
|
|
- data: data2,
|
|
|
|
- lineWidth: 1,
|
|
|
|
- cursor: 'pointer',
|
|
|
|
- events: {
|
|
|
|
- click(e) {
|
|
|
|
- console.log('////',e)
|
|
|
|
- modal.title = '湿度';
|
|
|
|
- modal.showModal = true;
|
|
|
|
- time.value = dateFormat('%Y-%m-%d %H:%M:%S', e.point.x);
|
|
|
|
- formValue.T_rh = e.point.y;
|
|
|
|
- queryData.T_id = e.point.series.name;
|
|
|
|
- getDataList();
|
|
|
|
- dataInfo.value = dataList.value[e.point.index];
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (tabChart.value === '温度') {
|
|
|
|
- classList.value.forEach((item) => {
|
|
|
|
- chart1.value.chart.get(item.T_id).remove();
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- classList.value.forEach((item) => {
|
|
|
|
- chart2.value.chart.get(item.T_id).remove();
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- checkValues.value = [];
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
|
|
|
|
-const time = ref('');
|
|
|
|
const selectedValue = ref([]);
|
|
const selectedValue = ref([]);
|
|
-// 选项组的值改变时的回调
|
|
|
|
-const handleCheckValues = async (values, meta) => {
|
|
|
|
- console.log('单选',values, meta)
|
|
|
|
- selectedValue.value = values;
|
|
|
|
- const classInfo = classList.value.find((item) => item.T_id === meta.value);
|
|
|
|
- queryData.T_id = classInfo.T_id;
|
|
|
|
- queryData.T_sn = classInfo.T_sn;
|
|
|
|
- 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 (meta.actionType === 'check') {
|
|
|
|
- if (tabChart.value === '温度') {
|
|
|
|
- chart1.value.chart.addSeries({
|
|
|
|
- id: meta.value,
|
|
|
|
- name: meta.value,
|
|
|
|
- data: data1,
|
|
|
|
- cursor: 'pointer',
|
|
|
|
- events: {
|
|
|
|
- click(e) {
|
|
|
|
- console.log('/=======================///',e,TimeData(e.point.x))
|
|
|
|
-
|
|
|
|
- modal.title = '温度';
|
|
|
|
- modal.showModal = true;
|
|
|
|
- time.value = TimeData(e.point.x);
|
|
|
|
- formValue.T_t = e.point.y;
|
|
|
|
- queryData.T_id = e.point.series.name;
|
|
|
|
- getDataList();
|
|
|
|
- dataInfo.value = dataList.value[e.point.index];
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- chart2.value.chart.addSeries({
|
|
|
|
- id: meta.value,
|
|
|
|
- name: meta.value,
|
|
|
|
- data: data2,
|
|
|
|
- events: {
|
|
|
|
- click(e) {
|
|
|
|
- console.log('点击11119',e)
|
|
|
|
- modal.title = '湿度';
|
|
|
|
- modal.showModal = true;
|
|
|
|
- time.value = dateFormat('%Y-%m-%d %H:%M:%S', e.point.x);
|
|
|
|
- formValue.T_rh = e.point.y;
|
|
|
|
- queryData.T_id = e.point.series.name;
|
|
|
|
- getDataList();
|
|
|
|
- dataInfo.value = dataList.value[e.point.index];
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (tabChart.value === '温度') {
|
|
|
|
- chart1.value.chart.get(meta.value).remove();
|
|
|
|
- } else {
|
|
|
|
- chart2.value.chart.get(meta.value).remove();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
|
|
+
|
|
|
|
|
|
const temporalInterval = ref('');
|
|
const temporalInterval = ref('');
|
|
|
|
|
|
@@ -396,7 +429,7 @@ const chartOptions1 = {
|
|
xDateFormat: '%Y-%m-%d %H:%M:%S',
|
|
xDateFormat: '%Y-%m-%d %H:%M:%S',
|
|
// headerFormat: '<small class="headerFormat">{.key}:{point.stackTotal}</small><table>',
|
|
// headerFormat: '<small class="headerFormat">{.key}:{point.stackTotal}</small><table>',
|
|
// valueDecimals: 0 //会导致提示框内容显示错误
|
|
// valueDecimals: 0 //会导致提示框内容显示错误
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
yAxis: {
|
|
yAxis: {
|
|
labels: {
|
|
labels: {
|
|
@@ -492,60 +525,9 @@ const chartOptions2 = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-// 删除
|
|
|
|
-const deleteTask = async () => {
|
|
|
|
- const { data: res } = await deleteTaskData({
|
|
|
|
- T_task_id: queryData.T_task_id,
|
|
|
|
- Id: dataInfo.value.ID,
|
|
|
|
- });
|
|
|
|
- if (res.Code === 200) {
|
|
|
|
- modal.showModal = false;
|
|
|
|
- message.success(res.Msg);
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
|
|
|
|
-// 编辑
|
|
|
|
-const editTask = async () => {
|
|
|
|
- console.log('提交',dataInfo,time.value)
|
|
|
|
-
|
|
|
|
- const { data: res } = await editTaskData({
|
|
|
|
- T_task_id: queryData.T_task_id,
|
|
|
|
- Id: dataInfo.value.ID,
|
|
|
|
- T_t: formValue.T_t ? formValue.T_t : dataInfo.value.T_t,
|
|
|
|
- T_rh: formValue.T_rh ? formValue.T_rh : dataInfo.value.T_rh,
|
|
|
|
- T_time: time.value,
|
|
|
|
- });
|
|
|
|
- if (res.Code === 200) {
|
|
|
|
- modal.showModal = false;
|
|
|
|
- message.success(res.Msg);
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-// 获取设备列表
|
|
|
|
-const getClassList = async () => {
|
|
|
|
- const { data: res } = await getTaskDataClassList({
|
|
|
|
- T_task_id: queryData.T_task_id,
|
|
|
|
- });
|
|
|
|
- classList.value = res.Data || [];
|
|
|
|
-};
|
|
|
|
|
|
|
|
-// 获取任务数据列表
|
|
|
|
-const getDataList = async () => {
|
|
|
|
- const { data: res } = await getTaskDataList(queryData);
|
|
|
|
- if (queryData.page_z <= res.Data.Page_size) {
|
|
|
|
- const arr = classList.value.filter((item) =>
|
|
|
|
- checkValues.value.includes(item.T_sn)
|
|
|
|
- );
|
|
|
|
- arr.forEach((item) => {
|
|
|
|
- item.T_sn = queryData.T_sn;
|
|
|
|
- item.T_id = queryData.T_id;
|
|
|
|
- getDataList();
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- dataList.value = res.Data.List || [];
|
|
|
|
-};
|
|
|
|
|
|
|
|
-getClassList();
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
if (task.T_collection_state === 0) {
|
|
if (task.T_collection_state === 0) {
|