Commit 618283e4 authored by huanghaoting's avatar huanghaoting

历史数据

parent d11947f5
This diff is collapsed.
......@@ -80,6 +80,7 @@ import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import store from "../../store/index";
import { getFileName } from '../../utils/utils';
import CfgSupply from '../../components/CfgSupply.vue';
import {boilerTitle , boilerHistory } from '../../dataJson/history/mock.js'; //导入模拟数据
//分页设置
const currentPage = ref(1)
......@@ -256,7 +257,9 @@ function getdata() {
}
function getcolumn() {
http.post("/api/boiler/Title", { enterpriseId: enterpriseId.value, deviceType: 2 }).then((result) => {
//模拟的title数据
var result = boilerTitle;
// http.post("/api/boiler/Title", { enterpriseId: enterpriseId.value, deviceType: 2 }).then((result) => {
titleData.value = result.data.otherList;
var dataRows = new Array();
result.data.frozenList.forEach((element) => {
......@@ -290,7 +293,7 @@ function getcolumn() {
i++;
})
otherList = othrows;
})
// })
}
// 获取数据列表
......@@ -303,7 +306,10 @@ function getBoiler() {
HisBoilerInfo.pageCount = pageSize.value - 1;
}
console.log(HisBoilerInfo);
http.post("/api/boiler/History", HisBoilerInfo).then((result) => {
//模拟的静态数据列表
var result = boilerHistory;
// http.post("/api/boiler/History", HisBoilerInfo).then((result) => {
console.log(result);
tableData.value = null;
if(result.data !== null){
......@@ -317,7 +323,7 @@ function getBoiler() {
total.value = 0;
}
loading.value = false;
});
// });
}
function setCellStyle({ row, column, rowIndex, columnIndex }) {
......
......@@ -7,7 +7,7 @@
<el-switch v-model="value" active-text="表格" inactive-text="曲线图"
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949;min-width: 130px;" @change="getchart" />
</el-form-item>
<el-form-item label="选择设备:">
<el-form-item label="选择设备111:">
<el-select v-model="HisdeviceInfo.id" multiple="true" collapse-tags placeholder="请选择" style="min-width: 170px" >
<el-option v-for="item in options" :label="item.label" :value="item.value" />
</el-select>
......@@ -96,6 +96,7 @@ import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import store from "../../store/index";
import { getFileName } from '../../utils/utils';
import CfgSupply from '../../components/CfgSupply.vue';
import {deviceTitle3, deviceHistory3} from '../../dataJson/history/mock.js'; //导入模拟数据
//分页设置
const currentPage = ref(1)
......@@ -272,7 +273,9 @@ function getdata() {
}
function getcolumn() {
http.post("/api/device/Title", { enterpriseId: enterpriseId.value, deviceType: 7 }).then((result) => {
// http.post("/api/device/Title", { enterpriseId: enterpriseId.value, deviceType: 7 }).then((result) => {
// 模拟静态title数据
var result = deviceTitle3
titleData.value = result.data.otherList;
var dataRows = new Array();
result.data.frozenList.forEach((element) => {
......@@ -285,7 +288,7 @@ function getcolumn() {
filter: element.filter,
color: element.color,
isVisible: true
});
// });
})
frozenList = dataRows;
......@@ -318,7 +321,9 @@ function getdevice() {
HisdeviceInfo.pageIndex = ((currentPage.value - 1) * pageSize.value) + 1;
HisdeviceInfo.pageCount = pageSize.value - 1;
}
http.post("/api/device/History", HisdeviceInfo).then((result) => {
// http.post("/api/device/History", HisdeviceInfo).then((result) => {
// 模拟后端数据
var result = deviceHistory3;
console.log(result);
tableData.value = null;
if(result.data !== null){
......@@ -332,7 +337,7 @@ function getdevice() {
total.value = 0;
}
loading.value = false;
});
// });
}
function setCellStyle({ row, column, rowIndex, columnIndex }) {
......
......@@ -80,6 +80,7 @@ import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import store from "../../store/index";
import { getFileName } from '../../utils/utils';
import CfgSupply from '../../components/CfgSupply.vue';
import {deviceTitle2, deviceHistory2} from '../../dataJson/history/mock.js'; //导入模拟数据
//分页设置
const currentPage = ref(1)
......@@ -256,7 +257,10 @@ function getdata() {
}
function getcolumn() {
http.post("/api/device/Title", { enterpriseId: enterpriseId.value, deviceType: 4 }).then((result) => {
// http.post("/api/device/Title", { enterpriseId: enterpriseId.value, deviceType: 4 }).then((result) => {
// 模拟静态title数据
var result = deviceTitle2
titleData.value = result.data.otherList;
var dataRows = new Array();
result.data.frozenList.forEach((element) => {
......@@ -290,7 +294,7 @@ function getcolumn() {
i++;
})
otherList = othrows;
})
// })
}
//获取数据列表
......@@ -303,7 +307,8 @@ function getdevice() {
HisdeviceInfo.pageCount = pageSize.value - 1;
}
console.log(HisdeviceInfo.interval);
http.post("/api/device/History", HisdeviceInfo).then((result) => {
// http.post("/api/device/History", HisdeviceInfo).then((result) => {
var result = deviceHistory2
console.log(result);
tableData.value = null;
if(result.data !== null){
......@@ -317,7 +322,7 @@ function getdevice() {
total.value = 0;
}
loading.value = false;
});
// });
}
function setCellStyle({ row, column, rowIndex, columnIndex }) {
......
......@@ -79,6 +79,7 @@ import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import store from "../../store/index";
import { getFileName } from '../../utils/utils';
import CfgSupply from '../../components/CfgSupply.vue';
import {deviceTitle1, deviceHistory1} from '../../dataJson/history/mock.js'; //导入模拟数据
//分页设置
const currentPage = ref(1)
......@@ -255,7 +256,9 @@ function getdata() {
}
function getcolumn() {
http.post("/api/device/Title", { enterpriseId: enterpriseId.value, deviceType: 6 }).then((result) => {
// http.post("/api/device/Title", { enterpriseId: enterpriseId.value, deviceType: 6 }).then((result) => {
//模拟静态title数据
var result = deviceTitle1
titleData.value = result.data.otherList;
var dataRows = new Array();
result.data.frozenList.forEach((element) => {
......@@ -289,7 +292,7 @@ function getcolumn() {
i++;
})
otherList = othrows;
})
// })
}
//获取数据列表
......@@ -302,7 +305,10 @@ function getdevice() {
HisdeviceInfo.pageCount = pageSize.value - 1;
}
console.log(HisdeviceInfo.interval);
http.post("/api/device/History", HisdeviceInfo).then((result) => {
// http.post("/api/device/History", HisdeviceInfo).then((result) => {
//模拟静态的数据
const result = deviceHistory1
console.log(result);
tableData.value = null;
if(result.data !== null){
......@@ -316,7 +322,7 @@ function getdevice() {
total.value = 0;
}
loading.value = false;
});
// });
}
function setCellStyle({ row, column, rowIndex, columnIndex }) {
......
......@@ -81,6 +81,10 @@ import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import store from "../../store/index";
import { getFileName } from '../../utils/utils';
import CfgSupply from '../../components/CfgSupply.vue';
import { pipeTitle,pipeHistory} from '../../dataJson/history/mock.js'; //导入模拟数据
console.log("sss")
console.log(pipeHistory)
//分页设置
const currentPage = ref(1)
......@@ -281,7 +285,9 @@ function getdata() {
}
function getcolumn() {
http.post("/api/pipe/Title", { enterpriseId: enterpriseId.value, deviceType: HisPipeInfo.deviceType }).then((result) => {
//自己定义的静态数据
var result = pipeTitle
// http.post("/api/pipe/Title", { enterpriseId: enterpriseId.value, deviceType: HisPipeInfo.deviceType }).then((result) => {
if(result.success){
titleData.value = result.data.otherList;
frozenList.length = 0;
......@@ -315,10 +321,11 @@ function getcolumn() {
i++;
})
}
})
// })
}
//获取数据列表
function getPipe() {
console.log(HisPipeInfo.startTime);
if (currentPage.value == 1) {
......@@ -328,18 +335,21 @@ function getPipe() {
HisPipeInfo.pageIndex = ((currentPage.value - 1) * pageSize.value) + 1;
HisPipeInfo.pageCount = pageSize.value - 1;
}
if (HisPipeInfo.interval === undefined) {
HisPipeInfo.interval = 2;
}
http.post("/api/pipe/History", HisPipeInfo).then((result) => {
// if (HisPipeInfo.interval === undefined) {
// HisPipeInfo.interval = 2;
// }
//模拟的数据
var result = pipeHistory
// http.post("/api/pipe/History", HisPipeInfo).then((result) => {
tableData.value = result.data.dataInfoList;
total.value = result.data.rowCount;
if(result.data === null || HisPipeInfo.id.length < 1){
// if(result.data === null || HisPipeInfo.id.length < 1) 由于是模拟数据,修改一下判断条件
if(result.data === null || HisPipeInfo.id.length === 1){
tableData.value = null;
total.value = 0;
}
loading.value = false;
});
// });
}
function setCellStyle({ row, column, rowIndex, columnIndex }) {
......
......@@ -101,6 +101,7 @@ import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import store from "../../store/index";
import { getFileName } from '../../utils/utils';
import CfgSupply from '../../components/CfgSupply.vue';
import { transferHisTitle,transferHistory} from '../../dataJson/history/mock.js'; //导入模拟数据
//分页设置
const currentPage = ref(1)
......@@ -282,7 +283,9 @@ function getSupplys(){
}
function getcolumn() {
http.post("/api/transfer/HisTitle", enterpriseId.value).then((result) => {
//模拟静态title数据
var result = transferHisTitle
// http.post("/api/transfer/HisTitle", enterpriseId.value).then((result) => {
titleData.value = result.data.otherList;
var dataRows = new Array();
result.data.frozenList.forEach((element) => {
......@@ -316,7 +319,7 @@ function getcolumn() {
i++;
})
otherList = othrows;
})
// })
}
//获取数据列表
......@@ -328,7 +331,9 @@ function gettransfer() {
HistransferInfo.pageIndex = ((currentPage.value - 1) * pageSize.value) + 1;
HistransferInfo.pageCount = pageSize.value - 1;
}
http.post("/api/transfer/History", HistransferInfo).then((result) => {
//模拟静态数据列表
var result = transferHistory
// http.post("/api/transfer/History", HistransferInfo).then((result) => {
console.log(HistransferInfo);
tableData.value = null;
if(result.data !== null){
......@@ -340,7 +345,7 @@ function gettransfer() {
total.value = 0;
}
loading.value = false;
});
// });
}
function setCellStyle({ row, column, rowIndex, columnIndex }) {
......
......@@ -79,6 +79,7 @@ import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import store from "../../store/index";
import { getFileName } from '../../utils/utils';
import CfgSupply from '../../components/CfgSupply.vue';
import { deviceTitle,deviceHistory} from '../../dataJson/history/mock.js'; ////导入模拟数据
//分页设置
const currentPage = ref(1)
......@@ -255,7 +256,9 @@ function getdata() {
}
function getcolumn() {
http.post("/api/device/Title", { enterpriseId: enterpriseId.value, deviceType: 5 }).then((result) => {
//模拟静态title数据
var result = deviceTitle;
// http.post("/api/device/Title", { enterpriseId: enterpriseId.value, deviceType: 5 }).then((result) => {
titleData.value = result.data.otherList;
var dataRows = new Array();
result.data.frozenList.forEach((element) => {
......@@ -289,21 +292,42 @@ function getcolumn() {
i++;
})
otherList = othrows;
})
// })
}
//获取数据列表
function getdevice() {
// if (currentPage.value == 1 ) {
// HisdeviceInfo.pageIndex = 0;
// HisdeviceInfo.pageCount = pageSize.value;
// } else {
// HisdeviceInfo.pageIndex = ((currentPage.value - 1) * pageSize.value) + 1;
// HisdeviceInfo.pageCount = pageSize.value - 1;
// }
// 初始化分页参数
let startIndex = 0;
let endIndex = 0;
if (currentPage.value == 1) {
HisdeviceInfo.pageIndex = 0;
HisdeviceInfo.pageCount = pageSize.value;
startIndex = 0;
endIndex = 30; // 第一页显示 30 条数据
} else if (currentPage.value == 2) {
startIndex = 30;
endIndex = 50; // 第二页显示剩余的 20 条数据
} else {
HisdeviceInfo.pageIndex = ((currentPage.value - 1) * pageSize.value) + 1;
HisdeviceInfo.pageCount = pageSize.value - 1;
// 如果页码超出范围,可以设置为空数据或其他处理
tableData.value = null;
total.value = 0;
loading.value = false;
return;
}
//console.log(HisdeviceInfo.interval);
http.post("/api/device/History", HisdeviceInfo).then((result) => {
// http.post("/api/device/History", HisdeviceInfo).then((result) => {
//模拟的数据
var result = deviceHistory
console.log(result);
tableData.value = null;
if(result.data !== null){
......@@ -312,12 +336,14 @@ function getdevice() {
console.log(tableData.value);
}
if(result.data === null || HisdeviceInfo.id.length < 1){
// if(result.data === null || HisdeviceInfo.id.length < 1)
if(result.data === null || HisdeviceInfo.id.length ===1) {
tableData.value = null;
total.value = 0;
}
loading.value = false;
});
// });
}
function setCellStyle({ row, column, rowIndex, columnIndex }) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment