|
@@ -4,7 +4,150 @@ export default createStore({
|
|
state: {
|
|
state: {
|
|
siteId: 1,//公共api请求参数->siteId
|
|
siteId: 1,//公共api请求参数->siteId
|
|
Time_Data: [],//公共api请求参数->Time_Data
|
|
Time_Data: [],//公共api请求参数->Time_Data
|
|
- queryType: '',//监控设备->数据报表api请求参数->queryType
|
|
|
|
|
|
+ timearr: [],//公共处理开始时间和结束时间中的时间段天数 值存储
|
|
|
|
+ itemStyle: [
|
|
|
|
+ {
|
|
|
|
+ normal: {
|
|
|
|
+ borderColor: "rgba(0,244,253,1)",
|
|
|
|
+ borderWidth: 2,
|
|
|
|
+ color: "rgba(6, 68, 83, 1)",
|
|
|
|
+ lineStyle: {
|
|
|
|
+ width: 2, //折线宽度
|
|
|
|
+ color: "rgba(0,244,253,1)",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ normal: {
|
|
|
|
+ borderColor: "rgba(253,143,0,1)",
|
|
|
|
+ borderWidth: 2,
|
|
|
|
+ color: "rgba(6, 68, 83, 1)",
|
|
|
|
+ lineStyle: {
|
|
|
|
+ width: 2, //折线宽度
|
|
|
|
+ color: "rgba(253,143,0,1)",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ normal: {
|
|
|
|
+ borderColor: "rgba(0,255,18,1)",
|
|
|
|
+ borderWidth: 2,
|
|
|
|
+ color: "rgba(6, 68, 83, 1)",
|
|
|
|
+ lineStyle: {
|
|
|
|
+ width: 2, //折线宽度
|
|
|
|
+ color: "rgba(0,255,18,1)",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ normal: {
|
|
|
|
+ borderColor: "rgba(0,255,230,1)",
|
|
|
|
+ borderWidth: 2,
|
|
|
|
+ color: "rgba(6, 68, 83, 1)",
|
|
|
|
+ lineStyle: {
|
|
|
|
+ width: 2, //折线宽度
|
|
|
|
+ color: "rgba(0,255,230,1)",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ normal: {
|
|
|
|
+ borderColor: "rgba(142,51,255,1)",
|
|
|
|
+ borderWidth: 2,
|
|
|
|
+ color: "rgba(6, 68, 83, 1)",
|
|
|
|
+ lineStyle: {
|
|
|
|
+ width: 2, //折线宽度
|
|
|
|
+ color: "rgba(142,51,255,1)",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ normal: {
|
|
|
|
+ borderColor: "rgba(77,200,120,1)",
|
|
|
|
+ borderWidth: 2,
|
|
|
|
+ color: "rgba(6, 68, 83, 1)",
|
|
|
|
+ lineStyle: {
|
|
|
|
+ width: 2, //折线宽度
|
|
|
|
+ color: "rgba(77,200,120,1)",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ normal: {
|
|
|
|
+ borderColor: "rgba(255,47,47,1)",
|
|
|
|
+ borderWidth: 2,
|
|
|
|
+ color: "rgba(6, 68, 83, 1)",
|
|
|
|
+ lineStyle: {
|
|
|
|
+ width: 2, //折线宽度
|
|
|
|
+ color: "rgba(255,47,47,1)",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ normal: {
|
|
|
|
+ borderColor: "rgba(70,100,255,1)",
|
|
|
|
+ borderWidth: 2,
|
|
|
|
+ color: "rgba(6, 68, 83, 1)",
|
|
|
|
+ lineStyle: {
|
|
|
|
+ width: 2, //折线宽度
|
|
|
|
+ color: "rgba(70,100,255,1)",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ normal: {
|
|
|
|
+ borderColor: "rgba(255,143,53,1)",
|
|
|
|
+ borderWidth: 2,
|
|
|
|
+ color: "rgba(6, 68, 83, 1)",
|
|
|
|
+ lineStyle: {
|
|
|
|
+ width: 2, //折线宽度
|
|
|
|
+ color: "rgba(255,143,53,1)",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ normal: {
|
|
|
|
+ borderColor: "rgba(150,150,50,1)",
|
|
|
|
+ borderWidth: 2,
|
|
|
|
+ color: "rgba(6, 68, 83, 1)",
|
|
|
|
+ lineStyle: {
|
|
|
|
+ width: 2, //折线宽度
|
|
|
|
+ color: "rgba(150,150,50,1)",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ normal: {
|
|
|
|
+ borderColor: "rgba(70,192,255,1)",
|
|
|
|
+ borderWidth: 2,
|
|
|
|
+ color: "rgba(6, 68, 83, 1)",
|
|
|
|
+ lineStyle: {
|
|
|
|
+ width: 2, //折线宽度
|
|
|
|
+ color: "rgba(70,192,255,1)",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ normal: {
|
|
|
|
+ borderColor: "rgba(20,99,100,1)",
|
|
|
|
+ borderWidth: 2,
|
|
|
|
+ color: "rgba(6, 68, 83, 1)",
|
|
|
|
+ lineStyle: {
|
|
|
|
+ width: 2, //折线宽度
|
|
|
|
+ color: "rgba(20,99,100,1)",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ ],//公共echarts图表样式
|
|
|
|
+ Time_All: [],//公共时间 返回数组 -> 年月日时分秒 时间戳
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ queryType: '',//设备监控--->数据报表api请求参数->queryType
|
|
|
|
+ run_off_Status: null,//设备监控--->运行状态统计->echarts->OFF次数分布和运行状态曲线图表 api信息存储
|
|
|
|
+ HistoricalCurve: null,//设备监控--->历史趋势->echarts->曲线图表 api信息存储
|
|
|
|
+ se_defaultTime: [], //设备监控--->历史趋势时间选择器v-model
|
|
|
|
+ th_defaultTime: [], //设备监控--->数据报表时间选择器v-model
|
|
|
|
+ fh_defaultTime: [], //设备监控--->运行状态统计时间选择器v-model
|
|
table_list: [
|
|
table_list: [
|
|
{
|
|
{
|
|
name: "电流",
|
|
name: "电流",
|
|
@@ -92,7 +235,7 @@ export default createStore({
|
|
{ name: "电压中断次数", value: "Ust" },
|
|
{ name: "电压中断次数", value: "Ust" },
|
|
],
|
|
],
|
|
},
|
|
},
|
|
- ],//数据报表->默认tabs数据
|
|
|
|
|
|
+ ],//设备监控--->数据报表->默认tabs数据
|
|
se_tabs: [
|
|
se_tabs: [
|
|
{ label: '电流', name: "I" },
|
|
{ label: '电流', name: "I" },
|
|
{ label: '功率', name: "P" },
|
|
{ label: '功率', name: "P" },
|
|
@@ -104,13 +247,7 @@ export default createStore({
|
|
{ label: '谐波电流有效值', name: "RMS" },
|
|
{ label: '谐波电流有效值', name: "RMS" },
|
|
{ label: '通讯参数', name: "DDB" },
|
|
{ label: '通讯参数', name: "DDB" },
|
|
{ label: '电压突变', name: "VT" },
|
|
{ label: '电压突变', name: "VT" },
|
|
- ],
|
|
|
|
-
|
|
|
|
- run_off_Status: null,//运行状态统计->echarts->OFF次数分布和运行状态曲线图表 api信息存储
|
|
|
|
-
|
|
|
|
- timearr: [],//公共处理开始时间和结束时间中的时间段天数 值存储
|
|
|
|
-
|
|
|
|
- HistoricalCurve:null,//历史趋势->echarts->曲线图表 api信息存储
|
|
|
|
|
|
+ ],//设备监控--->历史趋势->默认tabs数据
|
|
},
|
|
},
|
|
mutations: {
|
|
mutations: {
|
|
/**
|
|
/**
|
|
@@ -158,7 +295,7 @@ export default createStore({
|
|
/**
|
|
/**
|
|
* @历史趋势 -> echarts ->曲线图表 api信息存储
|
|
* @历史趋势 -> echarts ->曲线图表 api信息存储
|
|
*/
|
|
*/
|
|
- HistoricalCurve(state,data){
|
|
|
|
|
|
+ HistoricalCurve(state, data) {
|
|
state.HistoricalCurve = data
|
|
state.HistoricalCurve = data
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
@@ -271,6 +408,49 @@ export default createStore({
|
|
return newtimestamp ? output : "";
|
|
return newtimestamp ? output : "";
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ /**
|
|
|
|
+ * @公共echarts图表下载
|
|
|
|
+ */
|
|
|
|
+ getConnectedDataURL(state, refs) {
|
|
|
|
+ state || refs
|
|
|
|
+ var url = refs[0].getConnectedDataURL({
|
|
|
|
+ pixelRatio: 15,
|
|
|
|
+ backgroundColor: "black",
|
|
|
|
+ excludeComponents: ["toolbox"],
|
|
|
|
+ type: "png",
|
|
|
|
+ });
|
|
|
|
+ var $a = document.createElement("a");
|
|
|
|
+ var type = "png";
|
|
|
|
+ //图片名称
|
|
|
|
+ $a.download = refs[1] + "." + type;
|
|
|
|
+ $a.target = "_blank";
|
|
|
|
+ $a.href = url;
|
|
|
|
+ if (typeof MouseEvent === "function") {
|
|
|
|
+ var evt = new MouseEvent("click", {
|
|
|
|
+ view: window,
|
|
|
|
+ bubbles: true,
|
|
|
|
+ cancelable: false,
|
|
|
|
+ });
|
|
|
|
+ $a.dispatchEvent(evt);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * @公共时间 返回数组 -> 年月日时分秒 时间戳
|
|
|
|
+ */
|
|
|
|
+ getTimeAll(state) {
|
|
|
|
+ const time = new Date();
|
|
|
|
+ const Y = time.getFullYear(); //年
|
|
|
|
+ const M = time.getMonth(); //月
|
|
|
|
+ const D = time.getDate(); //日
|
|
|
|
+ const HH = time.getHours(); //时,
|
|
|
|
+ const MM = time.getMinutes(); //分
|
|
|
|
+ const SS = time.getSeconds(); //秒
|
|
|
|
+ const timestamp = new Date().getTime();//时间戳
|
|
|
|
+ state.Time_All = [Y, M, D, HH, MM, SS, timestamp]
|
|
|
|
+ state.se_defaultTime = [new Date(Y, M, D, 0, 0, 0), new Date()]//设备监控--->历史趋势时间选择器v-model
|
|
|
|
+ state.th_defaultTime = [new Date(Y, M, D, 0, 0, 0), new Date()]//设备监控--->数据报表时间选择器v-model
|
|
|
|
+ state.fh_defaultTime = [new Date(Y, M, 1, 0, 0, 0), new Date()]//设备监控--->运行状态统计时间选择器v-model
|
|
|
|
+ },
|
|
|
|
|
|
}
|
|
}
|
|
})
|
|
})
|