Commit 244d72cb authored by 王亚晖's avatar 王亚晖

修改趋势图页面

parent 256422fa
{
"hash": "3b6ce058",
"configHash": "ba30d74e",
"hash": "884ac110",
"configHash": "2effb732",
"lockfileHash": "f9d7b6f4",
"browserHash": "72416dc8",
"browserHash": "b2ff66b8",
"optimized": {
"@element-plus/icons-vue": {
"src": "../../@element-plus/icons-vue/dist/index.js",
"file": "@element-plus_icons-vue.js",
"fileHash": "09a3dfe5",
"fileHash": "a93cd445",
"needsInterop": false
},
"@kyvg/vue3-notification": {
"src": "../../@kyvg/vue3-notification/dist/index.es.js",
"file": "@kyvg_vue3-notification.js",
"fileHash": "35fce3df",
"needsInterop": false
},
"@vue/reactivity": {
"src": "../../@vue/reactivity/dist/reactivity.esm-bundler.js",
"file": "@vue_reactivity.js",
"fileHash": "b80afd48",
"fileHash": "ad88cf6f",
"needsInterop": false
},
"axios": {
"src": "../../axios/index.js",
"file": "axios.js",
"fileHash": "834ff7c9",
"fileHash": "4ddd2c08",
"needsInterop": false
},
"echarts": {
"src": "../../echarts/index.js",
"file": "echarts.js",
"fileHash": "6b6616e7",
"fileHash": "de1e348a",
"needsInterop": false
},
"element-plus": {
"src": "../../element-plus/es/index.mjs",
"file": "element-plus.js",
"fileHash": "f510e90d",
"fileHash": "768dfb47",
"needsInterop": false
},
"element-plus/dist/locale/zh-cn.mjs": {
"src": "../../element-plus/dist/locale/zh-cn.mjs",
"file": "element-plus_dist_locale_zh-cn__mjs.js",
"fileHash": "b05253e4",
"fileHash": "ff1d4de8",
"needsInterop": false
},
"file-saver": {
"src": "../../file-saver/dist/FileSaver.min.js",
"file": "file-saver.js",
"fileHash": "072a1652",
"needsInterop": true
},
"mitt": {
"src": "../../mitt/dist/mitt.mjs",
"file": "mitt.js",
"fileHash": "e68dab6e",
"fileHash": "e64d0fd9",
"needsInterop": false
},
"vue": {
"src": "../../vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "6fbec957",
"fileHash": "a8e2e9c3",
"needsInterop": false
},
"vue-router": {
"src": "../../vue-router/dist/vue-router.mjs",
"file": "vue-router.js",
"fileHash": "3fc22ba2",
"fileHash": "2585d35c",
"needsInterop": false
},
"vue3-smooth-scroll": {
"src": "../../vue3-smooth-scroll/dist/vue-smooth-scroll.min.js",
"file": "vue3-smooth-scroll.js",
"fileHash": "90f779c1",
"fileHash": "1accd912",
"needsInterop": true
},
"vuex": {
"src": "../../vuex/dist/vuex.esm-bundler.js",
"file": "vuex.js",
"fileHash": "84b29248",
"needsInterop": false
},
"xlsx": {
"src": "../../xlsx/xlsx.mjs",
"file": "xlsx.js",
"fileHash": "fdf92cf4",
"needsInterop": false
},
"@kyvg/vue3-notification": {
"src": "../../@kyvg/vue3-notification/dist/index.es.js",
"file": "@kyvg_vue3-notification.js",
"fileHash": "850ebeef",
"fileHash": "788f213e",
"needsInterop": false
}
},
......
import {
__commonJS
} from "./chunk-ZS7NZCD4.js";
// node_modules/file-saver/dist/FileSaver.min.js
var require_FileSaver_min = __commonJS({
"node_modules/file-saver/dist/FileSaver.min.js"(exports, module) {
(function(a, b) {
if ("function" == typeof define && define.amd)
define([], b);
else if ("undefined" != typeof exports)
b();
else {
b(), a.FileSaver = { exports: {} }.exports;
}
})(exports, function() {
"use strict";
function b(a2, b2) {
return "undefined" == typeof b2 ? b2 = { autoBom: false } : "object" != typeof b2 && (console.warn("Deprecated: Expected third argument to be a object"), b2 = { autoBom: !b2 }), b2.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a2.type) ? new Blob(["\uFEFF", a2], { type: a2.type }) : a2;
}
function c(a2, b2, c2) {
var d2 = new XMLHttpRequest();
d2.open("GET", a2), d2.responseType = "blob", d2.onload = function() {
g(d2.response, b2, c2);
}, d2.onerror = function() {
console.error("could not download file");
}, d2.send();
}
function d(a2) {
var b2 = new XMLHttpRequest();
b2.open("HEAD", a2, false);
try {
b2.send();
} catch (a3) {
}
return 200 <= b2.status && 299 >= b2.status;
}
function e(a2) {
try {
a2.dispatchEvent(new MouseEvent("click"));
} catch (c2) {
var b2 = document.createEvent("MouseEvents");
b2.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null), a2.dispatchEvent(b2);
}
}
var f = "object" == typeof window && window.window === window ? window : "object" == typeof self && self.self === self ? self : "object" == typeof global && global.global === global ? global : void 0, a = f.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), g = f.saveAs || ("object" != typeof window || window !== f ? function() {
} : "download" in HTMLAnchorElement.prototype && !a ? function(b2, g2, h) {
var i = f.URL || f.webkitURL, j = document.createElement("a");
g2 = g2 || b2.name || "download", j.download = g2, j.rel = "noopener", "string" == typeof b2 ? (j.href = b2, j.origin === location.origin ? e(j) : d(j.href) ? c(b2, g2, h) : e(j, j.target = "_blank")) : (j.href = i.createObjectURL(b2), setTimeout(function() {
i.revokeObjectURL(j.href);
}, 4e4), setTimeout(function() {
e(j);
}, 0));
} : "msSaveOrOpenBlob" in navigator ? function(f2, g2, h) {
if (g2 = g2 || f2.name || "download", "string" != typeof f2)
navigator.msSaveOrOpenBlob(b(f2, h), g2);
else if (d(f2))
c(f2, g2, h);
else {
var i = document.createElement("a");
i.href = f2, i.target = "_blank", setTimeout(function() {
e(i);
});
}
} : function(b2, d2, e2, g2) {
if (g2 = g2 || open("", "_blank"), g2 && (g2.document.title = g2.document.body.innerText = "downloading..."), "string" == typeof b2)
return c(b2, d2, e2);
var h = "application/octet-stream" === b2.type, i = /constructor/i.test(f.HTMLElement) || f.safari, j = /CriOS\/[\d]+/.test(navigator.userAgent);
if ((j || h && i || a) && "undefined" != typeof FileReader) {
var k = new FileReader();
k.onloadend = function() {
var a2 = k.result;
a2 = j ? a2 : a2.replace(/^data:[^;]*;/, "data:attachment/file;"), g2 ? g2.location.href = a2 : location = a2, g2 = null;
}, k.readAsDataURL(b2);
} else {
var l = f.URL || f.webkitURL, m = l.createObjectURL(b2);
g2 ? g2.location = m : location.href = m, g2 = null, setTimeout(function() {
l.revokeObjectURL(m);
}, 4e4);
}
});
f.saveAs = g.saveAs = g, "undefined" != typeof module && (module.exports = g);
});
}
});
export default require_FileSaver_min();
//# sourceMappingURL=file-saver.js.map
{
"version": 3,
"sources": ["../../file-saver/src/FileSaver.js"],
"sourcesContent": ["/*\n* FileSaver.js\n* A saveAs() FileSaver implementation.\n*\n* By Eli Grey, http://eligrey.com\n*\n* License : https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md (MIT)\n* source : http://purl.eligrey.com/github/FileSaver.js\n*/\n\n// The one and only way of getting global scope in all environments\n// https://stackoverflow.com/q/3277182/1008999\nvar _global = typeof window === 'object' && window.window === window\n ? window : typeof self === 'object' && self.self === self\n ? self : typeof global === 'object' && global.global === global\n ? global\n : this\n\nfunction bom (blob, opts) {\n if (typeof opts === 'undefined') opts = { autoBom: false }\n else if (typeof opts !== 'object') {\n console.warn('Deprecated: Expected third argument to be a object')\n opts = { autoBom: !opts }\n }\n\n // prepend BOM for UTF-8 XML and text/* types (including HTML)\n // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF\n if (opts.autoBom && /^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(blob.type)) {\n return new Blob([String.fromCharCode(0xFEFF), blob], { type: blob.type })\n }\n return blob\n}\n\nfunction download (url, name, opts) {\n var xhr = new XMLHttpRequest()\n xhr.open('GET', url)\n xhr.responseType = 'blob'\n xhr.onload = function () {\n saveAs(xhr.response, name, opts)\n }\n xhr.onerror = function () {\n console.error('could not download file')\n }\n xhr.send()\n}\n\nfunction corsEnabled (url) {\n var xhr = new XMLHttpRequest()\n // use sync to avoid popup blocker\n xhr.open('HEAD', url, false)\n try {\n xhr.send()\n } catch (e) {}\n return xhr.status >= 200 && xhr.status <= 299\n}\n\n// `a.click()` doesn't work for all browsers (#465)\nfunction click (node) {\n try {\n node.dispatchEvent(new MouseEvent('click'))\n } catch (e) {\n var evt = document.createEvent('MouseEvents')\n evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80,\n 20, false, false, false, false, 0, null)\n node.dispatchEvent(evt)\n }\n}\n\n// Detect WebView inside a native macOS app by ruling out all browsers\n// We just need to check for 'Safari' because all other browsers (besides Firefox) include that too\n// https://www.whatismybrowser.com/guides/the-latest-user-agent/macos\nvar isMacOSWebView = _global.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent)\n\nvar saveAs = _global.saveAs || (\n // probably in some web worker\n (typeof window !== 'object' || window !== _global)\n ? function saveAs () { /* noop */ }\n\n // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView\n : ('download' in HTMLAnchorElement.prototype && !isMacOSWebView)\n ? function saveAs (blob, name, opts) {\n var URL = _global.URL || _global.webkitURL\n var a = document.createElement('a')\n name = name || blob.name || 'download'\n\n a.download = name\n a.rel = 'noopener' // tabnabbing\n\n // TODO: detect chrome extensions & packaged apps\n // a.target = '_blank'\n\n if (typeof blob === 'string') {\n // Support regular links\n a.href = blob\n if (a.origin !== location.origin) {\n corsEnabled(a.href)\n ? download(blob, name, opts)\n : click(a, a.target = '_blank')\n } else {\n click(a)\n }\n } else {\n // Support blobs\n a.href = URL.createObjectURL(blob)\n setTimeout(function () { URL.revokeObjectURL(a.href) }, 4E4) // 40s\n setTimeout(function () { click(a) }, 0)\n }\n }\n\n // Use msSaveOrOpenBlob as a second approach\n : 'msSaveOrOpenBlob' in navigator\n ? function saveAs (blob, name, opts) {\n name = name || blob.name || 'download'\n\n if (typeof blob === 'string') {\n if (corsEnabled(blob)) {\n download(blob, name, opts)\n } else {\n var a = document.createElement('a')\n a.href = blob\n a.target = '_blank'\n setTimeout(function () { click(a) })\n }\n } else {\n navigator.msSaveOrOpenBlob(bom(blob, opts), name)\n }\n }\n\n // Fallback to using FileReader and a popup\n : function saveAs (blob, name, opts, popup) {\n // Open a popup immediately do go around popup blocker\n // Mostly only available on user interaction and the fileReader is async so...\n popup = popup || open('', '_blank')\n if (popup) {\n popup.document.title =\n popup.document.body.innerText = 'downloading...'\n }\n\n if (typeof blob === 'string') return download(blob, name, opts)\n\n var force = blob.type === 'application/octet-stream'\n var isSafari = /constructor/i.test(_global.HTMLElement) || _global.safari\n var isChromeIOS = /CriOS\\/[\\d]+/.test(navigator.userAgent)\n\n if ((isChromeIOS || (force && isSafari) || isMacOSWebView) && typeof FileReader !== 'undefined') {\n // Safari doesn't allow downloading of blob URLs\n var reader = new FileReader()\n reader.onloadend = function () {\n var url = reader.result\n url = isChromeIOS ? url : url.replace(/^data:[^;]*;/, 'data:attachment/file;')\n if (popup) popup.location.href = url\n else location = url\n popup = null // reverse-tabnabbing #460\n }\n reader.readAsDataURL(blob)\n } else {\n var URL = _global.URL || _global.webkitURL\n var url = URL.createObjectURL(blob)\n if (popup) popup.location = url\n else location.href = url\n popup = null // reverse-tabnabbing #460\n setTimeout(function () { URL.revokeObjectURL(url) }, 4E4) // 40s\n }\n }\n)\n\n_global.saveAs = saveAs.saveAs = saveAs\n\nif (typeof module !== 'undefined') {\n module.exports = saveAs;\n}\n"],
"mappings": ";;;;;;;;;;;;;;;;;AAkBA,eAAS,EAAKA,IAAMC,IAAM;AAAA,eACJ,eAAhB,OAAOA,KAAsBA,KAAO,EAAE,SAAO,MAAT,IACf,YAAhB,OAAOA,OACd,QAAQ,KAAK,oDAAb,GACAA,KAAO,EAAE,SAAS,CAACA,GAAZ,IAKLA,GAAK,WAAW,6EAA6E,KAAKD,GAAK,IAAvF,IACX,IAAI,KAAK,CAAA,UAA8BA,EAA9B,GAAqC,EAAE,MAAMA,GAAK,KAAb,CAA9C,IAEFA;MACR;AAED,eAAS,EAAUA,IAAKC,IAAMC,IAAM;AAClC,YAAIC,KAAM,IAAI;AACd,QAAAA,GAAI,KAAK,OAAOH,EAAhB,GACAG,GAAI,eAAe,QACnBA,GAAI,SAAS,WAA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,IAChBI,KAAQ;UACT,GACD,EAAO,cAAcH,EAArB;QACD,OAAM;AAAA,cACD,IAAM,EAAQ,OAAO,EAAQ,WAC7B,IAAM,EAAI,gBAAgBA,EAApB;AACN,UAAAG,KAAOA,GAAM,WAAW,IACvB,SAAS,OAAO,GACrBA,KAAQ,MACR,WAAW,WAAY;AAAE,cAAI,gBAAgB,CAApB;UAA0B,GAAE,GAA3C;QACX;MACF;AAGH,QAAQ,SAAS,EAAO,SAAS,GAEX,eAAlB,OAAO,WACT,OAAO,UAAU;IAAA,CAAA;;;",
"names": ["a", "b", "c", "d", "g", "f", "e"]
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -119,4 +119,33 @@ export function getOneImgUrl(id){
else{
return ''
}
}
// 定义时间格式化函数 yyyy-MM-dd HH:mm:ss
export function formatTime(date) {
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
const hours = date.getHours().toString().padStart(2, '0');
const minutes = date.getMinutes().toString().padStart(2, '0');
const seconds = date.getSeconds().toString().padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
// 定义时间格式化函数 yyyy-MM-dd HH
export function formatDateHour(date) {
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
const hours = date.getHours().toString().padStart(2, '0');
return `${year}-${month}-${day} ${hours}`;
}
// 定义时间格式化函数 yyyy-MM-dd
export function formatDate(date) {
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
return `${year}-${month}-${day}`;
}
\ No newline at end of file
<template>
<img src="../../assets/imgs/transferTemp.png" :style="{width: curwidth +'px', height: curheight+'px'}"/>
<!-- 条件筛选卡片 -->
<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="getdata" />
</el-form-item>
<el-form-item label="换热机组:">
<el-cascader :options="options" v-model="AnatransferInfo.idList" :props="props" collapse-tags clearable :show-all-levels="false"
placeholder="请选择" style="width: 220px;" />
</el-form-item>
<el-form-item label="开始时间:">
<el-config-provider :locale="zhCn">
<el-date-picker v-model="AnatransferInfo.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="AnatransferInfo.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="AnatransferInfo.interval" placeholder="小时" style="min-width: 80px" clearable>
<el-option label="小时" :value=0 />
<el-option label="日" :value=1 />
<el-option label="周" :value=2 />
<el-option label="月" :value=3 />
<el-option label="年" :value=4 />
</el-select>
</el-form-item>
<el-form-item label="能耗类型:">
<el-select v-model="AnatransferInfo.energyType" placeholder="热" style="min-width: 80px" clearable>
<el-option label="热" :value=3 />
<el-option label="水" :value=2 />
<el-option label="电" :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" @click="exportExcel" style="min-width: 70px;">导出</el-button>
</el-form-item>
</div>
</el-card>
<!-- <el-card v-show="value" 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.title" :width="item.width"
:sortable="(item.field === 'name' || item.field === 'gatherTime') ? true : false"
fixed />
<template v-for="(item, i) in otherList">
<el-table-column :prop="item.enName" :label="item.alias" :width="item.width"></el-table-column>
</template>
</el-table>
</el-card>
<el-footer style="height: 8px;" v-show="value">
<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"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="getdata" @current-change="getdata"
class="pagination" />
</el-config-provider>
</el-footer> -->
<el-card v-show="(value === false)" :height="tableHeight">
<div id="h-chart" style="width: 99%; background: white; flex: 1;padding-top:15px; height: 800px;" ></div>
</el-card>
</template>
<script setup>
import { ref,onMounted,onUnmounted} from 'vue'
const curwidth=ref(1700);
const curheight = ref(1000);
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'
import store from "../../store/index";
const tableData = ref([]);//表格数据
const value = ref(false);//控制表格和图表的开关
const options = reactive([]);//换热机组
//const curwidth=ref(1700);
const tableHeight = ref(1000);//页面显示高度
const enterpriseId = store.getters.getEnterpriseId();
const loading = ref(true);
var frozenList = reactive([]);
var otherList = reactive([]);
const props = { multiple: true, emitPath: false }
var $chart;
const chartTitle = ref("换热站耗热量环比(GJ)");
const legendTitles = ref([]);
const xAxisData = ref([]);
const seriesData = reactive([]);
var chartData = {
title: {
text: chartTitle.value,
x: '10px',
// y 设置垂直安放位置,默认全图顶端,可选值:'top' ¦ 'bottom' ¦ 'center' ¦ {number}(y坐标,单位px)
y: '0px',
// itemGap设置主副标题纵向间隔,单位px,默认为10,
itemGap: 10,
backgroundColor: '#EEE',
// 主标题文本样式设置
textStyle: {
fontSize: 16,
fontWeight:'500',
color: '#000000'
},
},
legend: {
data: legendTitles.value,// ['福合园', '福锦园', '福满园'],
x: 'right',
// y 设置垂直安放位置,默认全图顶端,可选值:'top' ¦ 'bottom' ¦ 'center' ¦ {number}(y坐标,单位px)
y: 'top',
textStyle: {
color: '#666' // 图例文字颜色
},
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
axisLine: {
show: false
},
data: xAxisData.value// ['2024-01-01 01', '2024-01-01 02', '2024-01-01 03', '2024-01-01 04', '2024-01-01 05', '2024-01-01 06', '2024-01-01 07','2024-01-01 08', '2024-01-01 09', '2024-01-01 10', '2024-01-01 11', '2024-01-01 12']
},
yAxis: {
type: 'value',
axisLine: {
show: false
},
},
series: seriesData.value,
color:['#0379FF', '#FEA501', '#13E1E1']
}
onMounted(() => {
setContentHeight();
window.addEventListener('resize', setContentHeight);
//$chart = echarts.init(document.getElementById('h-chart'));
//$chart.setOption(chartData);
})
onUnmounted(()=>{
window.removeEventListener('resize', setContentHeight);
//if ($chart) {
// $chart.dispose();
//}
})
function setContentHeight(){
curheight.value = window.innerHeight - 160;
curwidth.value = window.innerWidth - 260;
//curheight.value = window.innerHeight - 160;
//curwidth.value = window.innerWidth - 260;
tableHeight.value = window.innerHeight - 232;
console.log(tableHeight.value);
}
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++) {
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 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){
endTime = year + "-" + dateArr[0] + "-" + dateArr[1] + " " + dateArr[2] + ":" + dateArr[3] + ":" + dateArr[4];
sessionStorage.setItem("DeviceQueryEnd", endTime);
}
const AnatransferInfo = reactive({
"supplyIdList": [],
"energyType": 3,
"idList": [],
"startTime": startTime,
"endTime": endTime,
"interval": 0
})
getSupplys();
getdata();
function getdata() {
loading.value = true;
sessionStorage.setItem("DeviceQueryStart", AnatransferInfo.startTime);
sessionStorage.setItem("DeviceQueryEnd", AnatransferInfo.endTime);
if (value.value === false) {
getchart();
}else{
//getcolumn();
//gettransfer();
}
}
//获取换热机组列表
function getSupplys(){
var result = store.getters.getEnterprise();
if (result) {
result.forEach(element=>{
if(element.enterpriseId.toLowerCase()=== enterpriseId.toLowerCase()){
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});
});
options.push({children: c, label: center.serviceCenterName});
})
}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});
})
}
}
});
}
AnatransferInfo.idList.push(options[0].children[0].children[0].value);
}
function getchart() {
try{
//chartTitle
//const series = reactive([]);
//const title = ref();
http.post("/api/analysis/external/QOQ", AnatransferInfo).then((result) => {
console.log(result);
// uniqueItems.value = [...new Set(items.value.map(item => item.id))];
result.data.forEach(item =>{
legendTitles.value.push(item.transferName);
xAxisData.value.push(item.gatherTime);
seriesData.push({
name: item.transferName,
value: item.record,
type: 'line',
smooth:true,
symbol:'none'});
})
var myChart = echarts.init(document.getElementById('h-chart'));
myChart.clear();
myChart.setOption(chartData);
//$chart.setOption(chartData);
// console.log(legendData);
// curveTitleData.value = result.data.title;
// 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();
// })
})
}catch(error){
console.log(error.message);
}
}
</script>
\ No newline at end of file
<style lang="less" scoped>
.moduleCard {
width: auto;
overflow: auto;
//max-height: 540px;
padding: 0px;
::v-deep .el-card__body {
padding: 0px;
}
}
.pagination {
padding: 4px;
margin-left: 20px;
height: 30px;
//background-color: #8939cf;
vertical-align: middle;
}
//鼠标所在行的颜色
::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 {
background-color: #92cbf1 !important;
}
.card-contianer {
width: auto;
height: 70px;
.div-header {
width: 100%;
display: flex;
margin: 20px;
}
}
.el-form-item {
margin-top: -20px;
margin-right: 30px;
}
.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