Commit 0cd56232 authored by qjeslks's avatar qjeslks

7.25.1

parent 5564b5f8
export const ExternalSERVEICE='http://218.69.97.198:8001'
export const WithinSERVEICE='http://192.168.1.252:8001'
//export const ExternalSERVEICE='http://localhost:5013'
//export const WithinSERVEICE='http://localhost:5013'
// export const ExternalSERVEICE='http://218.69.97.198:8001'
// export const WithinSERVEICE='http://192.168.1.252:8001'
export const ExternalSERVEICE='http://localhost:5013'
export const WithinSERVEICE='http://localhost:5013'
export const CURRLOGO="LOGO_gangyi.png"
......@@ -2,62 +2,48 @@
<!-- 条件筛选卡片 -->
<el-card class="card-contianer">
<div class="div-header">
<!-- 控制表格和图表的开关 -->
<el-form-item>
<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-select v-model="HisPipeInfo.id" multiple="true" collapse-tags placeholder="请选择" style="min-width: 170px"
@change="checkAge">
<el-option v-for="item in options" :label="item.label" :value="item.value"
:disabled="item.disabled" />
<el-form-item label="查询类型:">
<el-select v-model="type" placeholder="请选择" style="width: 150px" @change="getoptions" >
<el-option label="换热机组" value="GetTransAlarmData" />
<el-option label="锅炉" value="GetBoilerAlarmData" />
<el-option label="总管" value="GetPipeAlarmData" />
</el-select>
</el-form-item>
<el-form-item label="换热机组:">
<el-cascader :options="options" v-model="AlarmInfo.Id" :props="props" collapse-tags clearable :show-all-levels="false"
placeholder="请选择" style="min-width: 210px;" />
</el-form-item>
<el-form-item label="开始时间:">
<el-config-provider :locale="zhCn">
<el-date-picker v-model="HisPipeInfo.startTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
placeholder="选择开始时间" style="min-width: 180px;" /> <!-- 日期时间格式 2024-1-1 00:00:00-->
<el-date-picker v-model="AlarmInfo.startTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
placeholder="选择开始时间" style="min-width: 180px;" /> <!-- 日期时间格式 2024-01-01 00:00:00-->
</el-config-provider>
</el-form-item>
<el-form-item label="结束时间:">
<el-config-provider :locale="zhCn">
<el-date-picker v-model="HisPipeInfo.endTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
<el-date-picker v-model="AlarmInfo.endTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
placeholder="选择结束时间" style="min-width: 180px;" />
</el-config-provider>
</el-form-item>
<el-form-item label="时间间隔">
<el-select v-model="HisPipeInfo.interval" placeholder="1小时/次" style="min-width: 105px" clearable>
<el-option label="全部" :value=0 />
<el-option label="1分钟/次" :value=1 />
<el-option label="1小时/次" :value=2 />
<el-option label="1天/次" :value=3 />
<el-option label="1周/次" :value=4 />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getdata" style="min-width: 70px;">查询</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" style="min-width: 70px;" @click="autoColBoxShow = !autoColBoxShow">自定义列</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="exportExcel" style="min-width: 70px;">导出表格</el-button>
</el-form-item>
</div>
</el-card>
<el-card v-show="value" class="moduleCard" :height="tableHeight">
<el-card class="moduleCard" :height="tableHeight">
<el-table :data="tableData" :height="tableHeight" v-loading="loading" :cell-style="setCellStyle" id="out-table"
border highlight-current-row :header-cell-style="setHeaderCellStyle" @sort-change="sortMethod" :header-cell-class-name="handleHeadAddClass">
<el-table-column v-for="(item, i) in frozenList" :prop="item.field" :label="item.alias" :width="item.width" :sortable="(item.field === 'name' || item.field === 'gatherTime') ? true : false"
fixed />
<template v-for="(item, i) in otherList">
<el-table-column v-if="item.isVisible" :prop="item.enName" :label="item.alias" :width="item.width"></el-table-column>
</template>
border highlight-current-row :header-cell-style="setHeaderCellStyle" @sort-change="sortMethod" :header-cell-class-name="handleHeadAddClass" >
<el-table-column prop="name" label="设施名称" :sortable="true" width="200px" fixed />
<el-table-column prop="cnName" label="报警类型" :sortable="false" width="200px" fixed />
<el-table-column prop="alarmDate" label="报警时间" :sortable="true" width="200px" fixed />
<el-table-column prop="alarmMessage" label="报警信息" :sortable="false" width="700px" fixed />
<el-table-column prop="alarmPlan" label="报警预案" :sortable="false" fixed />
</el-table>
</el-card>
<el-footer style="height: 8px;" v-show="value">
<el-footer style="height: 8px;">
<el-config-provider :locale="zhCn">
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize"
:page-sizes="[30, 40, 50, 100, 200, 300]" :small="true" :disabled="disabled" :background="background"
......@@ -65,69 +51,46 @@
class="pagination" />
</el-config-provider>
</el-footer>
<el-card v-show="(value === false)">
<div id="chart" style="width: 99%; height: 690px" ></div>
</el-card>
<CfgSupply v-model="autoColBoxShow" @onChangeDialog="onChangeDialog" :titleData="value? titleData:curveTitleData" :height="500" :width="950" :deviceType="HisPipeInfo.deviceType" :title="title" :cfgType="value?0:1"/>
</template>
<script lang="ts" setup>
import { ref, reactive, onMounted, onUnmounted } from 'vue';
import * as echarts from 'echarts';//引入echarts核心模块
import http from '../../api/http';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
// // 引入导出Excel表格依赖
// import * as XLSX from "xlsx";
import store from "../../store/index";
import { getFileName } from '../../utils/utils';
import CfgSupply from '../../components/CfgSupply.vue';
//分页设置
const currentPage = ref(1)
var pageSize = ref(30)
const disabled = ref(false)
const background = ref(false)
const total = ref()
const options = reactive([]);
var frozenList = reactive([]);
var otherList = reactive([]);
const tableData = ref([]);
const timeList = reactive([]);
const option = ref([]);
const value = ref(true);//控制表格和图表的开关
const loading = ref(true);
const tableHeight = ref(500);
const enterpriseId = ref();
const sortField = reactive({});
const titleData = ref([]);//自定义标题
const autoColBoxShow = ref(false);//显示自定义列
const curveTitleData = ref([]);//曲线图自定义标题
const title = ref('总管历史数据自定义列');
const onChangeDialog = (val) => {
// console.log('onclick',val);
autoColBoxShow.value = false;
if(value){
getPipe();
}else{
getchart();
}
}
getEnterprise();
function getEnterprise(){
</template>
<script lang="ts" setup>
import { ref, reactive, onMounted, onUnmounted } from 'vue';
import http from '../../api/http';
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 { column } from 'element-plus/es/components/table-v2/src/common.mjs';
//分页设置
const currentPage = ref(1)
var pageSize = ref(30)
const disabled = ref(false)
const background = ref(false)
const total = ref()
const options = reactive([]);
const tableData = ref([]);
const tableHeight = ref(500);
const enterpriseId = ref();
const loading = ref(true);
const sortField = reactive({});
const type = ref('GetTransAlarmData');
getEnterprise();
function getEnterprise(){
var result = store.getters.getEnterprise();
if (result) {
enterpriseId.value = result[0].enterpriseId;
}
}
}
const props = { multiple: true, emitPath: false }
function setContentHeight() {
tableHeight.value = window.innerHeight - 240;
}
function setContentHeight() {
tableHeight.value = window.innerHeight - 232;
}
//获取排序的方法
function sortMethod({ order, prop }){
//获取排序的方法
function sortMethod({ order, prop }){
// 触发的排序和缓存的排序相同时,取消该字段的排序
if (!order || sortField[prop] === order) {
sortField[prop] = null
......@@ -145,9 +108,9 @@
direction = 'DESC'
}
if(i === "name"){
sortname = "PipeName";
}else if(i === "gatherTime"){
sortname = "GatherTime";
sortname = "name";
}else if(i === "alartDate"){
sortname = "alartDate";
}
// console.log(sortname)
if(sortnames===""){
......@@ -155,443 +118,293 @@
}else{
sortnames = sortnames + "," + sortname + " " + direction;
}
HisPipeInfo.sort = sortnames;
AlarmInfo.sort = sortnames;
}
console.log(AlarmInfo.sort)
getdata() //调用后端查询接口
}
}
function handleHeadAddClass({ column }) {
function handleHeadAddClass({ column }) {
if (sortField[column.property]) {
column.order = sortField[column.property]
}
}
}
var date = new Date();
var year = date.getFullYear();
var day = 0;
var dateArr = [
var date = new Date();
var year = date.getFullYear();
var day = 0;
var dateArr = [
date.getMonth() + 1, //月份从0~11,所以加一
date.getDate(),
date.getHours(),
date.getMinutes(),
date.getSeconds(),
];
for (var i = 0; i < dateArr.length; i++) {
];
for (var i = 0; i < dateArr.length; i++) {
if (dateArr[i] >= 1 && dateArr[i] <= 9) {
dateArr[i] = "0" + dateArr[i];
}
}
day = dateArr[1] - 1;
if (day >= 1 && day <= 9) {
day = "0" + day;
}
}
// var endTime = year + "-" + dateArr[0] + "-" + dateArr[1] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4];
// var startTime = year + "-" + dateArr[0] + "-" + day + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4];
var startTime = sessionStorage.getItem("DeviceQueryStart");
if(!startTime){
startTime = year + "-" + dateArr[0] + "-" + day + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4];
day = dateArr[1] - 1;
if (day >= 1 && day <= 9) {
day = "0" + day;
}
var startTime = sessionStorage.getItem("DeviceQueryStart");
if(!startTime){
startTime = year + "-" + dateArr[0] + '-' + day + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4];
sessionStorage.setItem("DeviceQueryStart", startTime);
}
var endTime = sessionStorage.getItem("DeviceQueryEnd");
if(!endTime){
}
var endTime = sessionStorage.getItem("DeviceQueryEnd");
if(!endTime){
endTime = year + "-" + dateArr[0] + "-" + dateArr[1] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4];
sessionStorage.setItem("DeviceQueryEnd", endTime);
}
}
const HisPipeInfo = reactive({
"enterpriseId": enterpriseId.value,
"supplyId": [],
"deviceType": 8,
"id": [],
const AlarmInfo = reactive({
"Id": [],
"startTime": startTime,
"endTime": endTime,
"interval": 2,
"sort": "",
"pageIndex": 0,
"pageCount": 30
})
"start": 0,
"count": 30,
"sort": ""
})
getSupplys();
getdata();
function getdata() {
sessionStorage.setItem("DeviceQueryStart", AlarmInfo.startTime);
sessionStorage.setItem("DeviceQueryEnd", AlarmInfo.endTime);
gettransfer();
}
//获取选择列表
function getoptions(){
if(type.value === "GetPipeAlarmData"){
getPipes();
}else if(type.value === "GetBoilerAlarmData"){
getBoilers();
}else{
getSupplys();
}
gettransfer();
}
//获取下拉列表
function getoptions(){
//获取锅炉列表
function getBoilers(){
loading.value = true;
tableData.value.length = 0;
AlarmInfo.Id.length = 0;
options.length = 0;
var result = store.getters.getEnterprise();
if (result) {
console.log(result)
result.forEach(element=>{
if(element.enterpriseId === enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
element.serviceCenterList.forEach(center=>{
center.supplyList.forEach(supply => {
options.push({ value: supply.pipeInfo.pipeId, label: supply.pipeInfo.pipeName,pipeType: (supply.pipeInfo.pipeType === 1 ? 8 : 1),disabled: true });
supply.boilerList.forEach(boiler => {
options.push({ value: boiler.boilerId, label: boiler.description });
})
});
})
}else{
element.supplyList.forEach(supply => {
options.push({ value: supply.pipeInfo.pipeId, label: supply.pipeInfo.pipeName,pipeType: (supply.pipeInfo.pipeType === 1 ? 8 : 1),disabled: true });
supply.boilerList.forEach(boiler => {
options.push({ value: boiler.boilerId, label: boiler.description });
})
})
}
}
});
}
options.forEach(element =>{
if(element.pipeType === 8){
HisPipeInfo.id.push(element.value);
}
AlarmInfo.Id.push(element.value);
})
}
}
function checkAge() {
options.forEach(element => {
if(element.value === HisPipeInfo.id[0]){
HisPipeInfo.deviceType = element.pipeType;
}
//获取总管列表
function getPipes(){
loading.value = true;
tableData.value.length = 0;
AlarmInfo.Id.length = 0;
var result = store.getters.getEnterprise();
if (result) {
options.length = 0;
result.forEach(element=>{
if(element.enterpriseId === enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
element.serviceCenterList.forEach(center=>{
center.supplyList.forEach(supply => {
options.push({ value: supply.pipeInfo.pipeId, label: supply.pipeInfo.pipeName});
});
if (HisPipeInfo.id.length === 0) {
options.forEach(element => {
element.disabled = false;
})
} else {
options.forEach(element => {
if(element.value === HisPipeInfo.id[0]){
options.forEach(opt =>{
if(opt.pipeType !== element.pipeType){
opt.disabled = true;
}else{
opt.disabled = false;
}
element.supplyList.forEach(supply => {
options.push({ value: supply.pipeInfo.pipeId, label: supply.pipeInfo.pipeName});
})
}
})
}
};
getdata();
getoptions();
checkAge();
getcolumn();
function getdata() {
loading.value = true;
sessionStorage.setItem("DeviceQueryStart", HisPipeInfo.startTime);
sessionStorage.setItem("DeviceQueryEnd", HisPipeInfo.endTime);
getcolumn();
getPipe();
getchart();
});
}
console.log(options);
options.forEach(element =>{
AlarmInfo.Id.push(element.value);
})
console.log(AlarmInfo.Id);
}
function getcolumn() {
http.post("/api/pipe/Title", { enterpriseId: enterpriseId.value, deviceType: HisPipeInfo.deviceType }).then((result) => {
if(result.success){
titleData.value = result.data.otherList;
frozenList.length = 0;
result.data.frozenList.forEach((element) => {
//生成固定表头
frozenList.push({
field: element.field[0].toLowerCase() + element.field.substring(1),
alias: element.title,
sortable: element.sortable,
width: element.width,
filter: element.filter,
color: element.color,
isVisible: true
//获取换热机组列表
function getSupplys(){
loading.value = true;
tableData.value.length = 0;
options.length = 0;
AlarmInfo.Id.length = 0;
var result = store.getters.getEnterprise();
if (result) {
result.forEach(element=>{
if(element.enterpriseId=== enterpriseId.value){
if(element.enterpriseId === "9BCA54BC-8F27-4849-8D7D-50C5099E1949".toLowerCase()){
element.serviceCenterList.forEach(center=>{
let c = [];
center.supplyList.forEach(supply => {
let chi = [];
supply.transferList.forEach(unit => {
chi.push({ value: unit.unitId, label: unit.unitName });
});
c.push({ children: chi, label: supply.supplyName});
});
let i = 0;
otherList.length = 0;
result.data.otherList.forEach((element) => {
//生成非固定表头
otherList.push({
alias: element.alias,
backColor: element.backColor,
baseId: element.baseId,
decimalPoint: element.decimalPoint,
enName: element.enName[0].toLowerCase() + element.enName.substring(1),
orderNum: element.orderNum,
width: element.width,
isVisible: element.isVisible
options.push({children: c, label: center.serviceCenterName});
})
i++;
}else{
element.supplyList.forEach(element => {
let chi = [];
element.transferList.forEach(unit => {
chi.push({ value: unit.unitId, label: unit.unitName });
})
}
options.push({ children: chi, label: element.supplyName});
})
}
//获取数据列表
function getPipe() {
console.log(HisPipeInfo.startTime);
}
});
}
AlarmInfo.Id.push(options[0].children[0].children[0].value);
}
//获取数据列表
function gettransfer() {
loading.value = true;
if (currentPage.value == 1) {
HisPipeInfo.pageIndex = 0;
HisPipeInfo.pageCount = pageSize.value;
AlarmInfo.start = 0;
AlarmInfo.count = pageSize.value;
} else {
HisPipeInfo.pageIndex = ((currentPage.value - 1) * pageSize.value) + 1;
HisPipeInfo.pageCount = pageSize.value - 1;
}
if (HisPipeInfo.interval === undefined) {
HisPipeInfo.interval = 2;
AlarmInfo.start = ((currentPage.value - 1) * pageSize.value) + 1;
AlarmInfo.count = pageSize.value - 1;
}
http.post("/api/pipe/History", HisPipeInfo).then((result) => {
http.post("/api/alarm/" + type.value, AlarmInfo).then((result) => {
console.log(result.data);
if(result.data !== null){
tableData.value = result.data.dataInfoList;
total.value = result.data.rowCount;
if(result.data === null || HisPipeInfo.id.length < 1){
}
if(result.data === null || AlarmInfo.Id.length < 1){
tableData.value = null;
total.value = 0;
}
loading.value = false;
});
}
}
function setCellStyle({ row, column, rowIndex, columnIndex }) {
function setCellStyle({ row, column, rowIndex, columnIndex }) {
let css_color = {};
css_color['padding-left'] = '0px';
css_color['padding-right'] = '0px';
css_color['borderColor'] = '#97d5fd';
css_color['padding'] = '0px';
frozenList.forEach(element => {
if (element.field === column.property) {
css_color['background-color'] = '#' + element.color;
}
})
otherList.forEach(element => {
if (element.enName === column.property) {
css_color['background-color'] = '#' + element.backColor;
}
})
return css_color;
}
function setHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
}
function setHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
let css_color;
frozenList.forEach(element => {
if (element.field === column.property) {
var backcolor = (element.color == 'FFFFFF') ? 'd9f1ff' : element.color;
var backcolor = 'd9f1ff';
css_color = { 'background-color': '#' + backcolor, 'padding-left': '0px', 'padding-right': '0px', 'borderColor': '#97d5fd', 'color': '#000', 'text-align': 'center', 'vertical-align': 'top' };
}
})
otherList.forEach(element => {
if (element.enName === column.property) {
var backcolor = (element.backColor == 'FFFFFF') ? 'd9f1ff' : element.backColor;
var backcolor = 'd9f1ff';
css_color = { 'background-color': '#' + backcolor, 'padding-left': '0px', 'padding-right': '0px', 'borderColor': '#97d5fd', 'color': '#000', 'text-align': 'center', 'vertical-align': 'top' };
}
})
return css_color;
}
/**
* 获取当前时间
*/
// function currentTime() {
// var date = new Date();
// var year = date.getFullYear(); //月份从0~11,所以加一
// let month = date.getMonth();
// console.log("month", month);
// var dateArr = [
// date.getMonth() + 1,
// date.getDate(),
// date.getHours(),
// date.getMinutes(),
// date.getSeconds(),
// ];
// //如果格式是MM则需要此步骤,如果是M格式则此循环注释掉
// for (var i = 0; i < dateArr.length; i++) {
// if (dateArr[i] >= 1 && dateArr[i] <= 9) {
// dateArr[i] = "0" + dateArr[i];
// }
// }
// var strDate = year + dateArr[0] + dateArr[1] + dateArr[2] + dateArr[3] + dateArr[4];
// //此处可以拿外部的变量接收 strDate:2022-05-01 13:25:30
// //this.date = strDate;
// return strDate;
// }
// 导出表格 按钮点击后触发事件
async function exportExcel() {
sessionStorage.setItem("DeviceQueryStart", HisPipeInfo.startTime);
sessionStorage.setItem("DeviceQueryEnd", HisPipeInfo.endTime);
HisPipeInfo.pageIndex = 0;
HisPipeInfo.pageCount = 100000;
if (HisPipeInfo.interval === undefined) {
HisPipeInfo.interval = 2;
}
var fileName = getFileName("总管历史数据");
await http.post("/api/pipe/hisExport", HisPipeInfo, '正在导出数据....', { responseType: 'blob' }).then((content) => {
try{
const blob = new Blob([content]);
if ('download' in document.createElement('a')) {
// 非IE下载
const elink = document.createElement('a');
elink.download = fileName;
elink.style.display = 'none';
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
URL.revokeObjectURL(elink.href);
document.body.removeChild(elink);
} else {
// IE10+下载
navigator.msSaveBlob(blob, fileName);
}
}catch(error){
console.log(error);
}
});
// const enNameToCnName = {};
// HisPipeInfo.pageCount = 999999;
// frozenList.forEach(element => {
// enNameToCnName[element.field] = element.alias;
// })
// otherList.forEach(element => {
// enNameToCnName[element.enName] = element.alias;
// })
// console.log(enNameToCnName);
// http.post("/api/pipe/History", HisPipeInfo).then((result) => {
// console.log(result);
// let excelData = result.data.dataInfoList.map(n => {
// // console.log(Object.keys(n))
// let newItem = [];
// Object.keys(n).forEach(k => {
// // console.log(n[k])
// newItem[enNameToCnName[k]] = n[k]
// })
// return newItem
// });
// const xlsx0bj = {
// SheetNames: ['sheet1'],//指定有序 sheet 的 name
// Sheets: {
// // 表格数据内容
// ['sheet1']: XLSX.utils.json_to_sheet(excelData)
// }
// }
// XLSX.writeFile(xlsx0bj, '123.xlsx');
// });
}
onMounted(() => {
}
// // 导出表格 按钮点击后触发事件
// async function exportExcel () {
// sessionStorage.setItem("DeviceQueryStart", AlarmInfo.startTime);
// sessionStorage.setItem("DeviceQueryEnd", AlarmInfo.endTime);
// AlarmInfo.pageIndex = 0;
// AlarmInfo.pageCount = 100000;
// if (AlarmInfo.interval === undefined) {
// AlarmInfo.interval = 2;
// }
// var fileName = getFileName("换热站历史数据");
// await http.post("/api/transfer/hisExport", AlarmInfo, '正在导出数据....', { responseType: 'blob' }).then((content) => {
// try{
// const blob = new Blob([content]);
// if ('download' in document.createElement('a')) {
// // 非IE下载
// const elink = document.createElement('a');
// elink.download = fileName;
// elink.style.display = 'none';
// elink.href = URL.createObjectURL(blob);
// document.body.appendChild(elink);
// elink.click();
// URL.revokeObjectURL(elink.href);
// document.body.removeChild(elink);
// } else {
// // IE10+下载
// navigator.msSaveBlob(blob, fileName);
// }
// }catch(error){
// console.log(error);
// }
// });
// }
onMounted(() => {
setContentHeight();
window.addEventListener('resize', setContentHeight);
})
onUnmounted(() => {
})
onUnmounted(() => {
window.removeEventListener('resize', setContentHeight);
})
//获取折线图
function getchart() {
if (value.value === false) {
const series = reactive([]);
const titles = reactive([]);
const title = ref();
let id = "";
id = HisPipeInfo.id[0];
HisPipeInfo.id = [];
HisPipeInfo.id.push(id);
HisPipeInfo.pageCount = 999999;
options.forEach(element =>{
if(element.value === id){
title.value = element.label;
}
})
http.post("/api/pipe/Curve", HisPipeInfo).then((result) => {
curveTitleData.value = result.data.title;
console.log(result);
result.data.title.forEach(element => {
titles.push(element.alias);
let da = new Array();
result.data.data.forEach(elements => {
da.push(elements[element.enName[0].toLowerCase() + element.enName.substring(1)])
})
timeList.length = 0;
result.data.data.forEach(ele => {
timeList.push(ele.gatherTime)
})
series.push({
name: element.alias,
type: 'line',
data: da
})
})
option.value = {
title: {
text: title.value + '历史数据'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: titles
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: timeList
},
yAxis: {
type: 'value',
axisLabel: {
formatter:'{value} ℃'
}
},
series: series
};
console.log(option.value);
var myChart = echarts.init(document.getElementById('chart'));
myChart.setOption(option.value);
//图表响应式
window.addEventListener('resize', () => {
myChart.resize();
})
})
}
}
</script>
<style lang="less" scoped>
.moduleCard {
})
</script>
<style lang="less" scoped>
.moduleCard {
width: auto;
overflow: auto;
//max-height: 540px;
padding: 2px;
padding: 0px;
::v-deep .el-card__body {
padding: 0px;
}
}
}
.pagination {
.pagination {
padding: 4px;
margin-left: 20px;
height: 30px;
//background-color: #8939cf;
vertical-align: middle;
}
}
//鼠标所在行的颜色
::v-deep .el-table__body tr:hover>td {
//鼠标所在行的颜色
::v-deep .el-table__body tr:hover>td {
background: linear-gradient(to top, rgb(0, 198, 255), rgb(255, 255, 255)) !important;
}
}
::v-deep .el-table__body tr.current-row>td {
::v-deep .el-table__body tr.current-row>td {
background-color: #92cbf1 !important;
}
}
.card-contianer {
.card-contianer {
width: auto;
height: 70px;
......@@ -600,25 +413,21 @@
display: flex;
margin: 20px;
}
}
}
.el-form-item {
.el-form-item {
margin-top: -20px;
margin-right: 30px;
}
.search-box {
background: #fefefe;
margin-top: 0px;
border: 1px solid #eae8e8;
position: absolute;
z-index: 999;
//left: 15px;
// right: 15px;
padding: 25px 20px;
padding-bottom: 0;
border-top: 0;
box-shadow: 0 7px 18px -12px #bdc0bb;
width: 100%;
height: 160px;
}
</style>
\ No newline at end of file
}
.el-tag--mini {
height: 21px !important
}
.el-cascader .el-input .el-input__inner:focus, .el-cascader .el-input.is-focus .el-input__inner{
height: 33px; //这里高度根据需求自己设定
}
.el-cascader__tags {
display: inline-flex;
margin-right: 10px;
flex-wrap: nowrap;
}
</style>
\ No newline at end of file
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