浏览代码

1.故障分类样式【等待接口】
2.性能下降样本库改及新增echarts

mw_666 3 年之前
父节点
当前提交
d912438f15

+ 3 - 2
package.json

@@ -12,12 +12,14 @@
   "dependencies": {
     "@antv/x6": "^1.24.4",
     "@arcgis/core": "^4.19.3",
+    "@open-wc/webpack-import-meta-loader": "git+https://github.com/KmjKoishi/webpack-import-meta-loader-fixed.git",
     "animate.css": "3.5",
     "axios": "^0.21.1",
     "cesium": "^1.78.0",
     "core-js": "^3.6.5",
     "echarts": "^5.1.1",
     "echarts-gl": "^2.0.4",
+    "echarts-stat": "^1.2.0",
     "element-plus": "^1.1.0-beta.4",
     "file-saver": "^2.0.5",
     "font-awesome": "^4.7.0",
@@ -37,8 +39,7 @@
     "vue-axios": "^3.2.4",
     "vue-router": "^4.0.0-0",
     "vuex": "^4.0.0-0",
-    "xlsx": "^0.17.0",
-    "@open-wc/webpack-import-meta-loader": "git+https://github.com/KmjKoishi/webpack-import-meta-loader-fixed.git"
+    "xlsx": "^0.17.0"
   },
   "devDependencies": {
     "@vue/cli-plugin-babel": "~4.5.0",

+ 134 - 0
src/views/malfunctionDiagnose/gzfl.vue

@@ -1,7 +1,141 @@
 <template>
+	<div>
+		<el-row>
+			<el-col :span="14">
+				<panel :title="'日最大风速'" class="radar-panel" :icon="'svg-wind-site'">
+					<div class="wind-info">
+						<div class="legend mg-r-16">
+							<span class="dot"></span>
+							<span>{{ rzdfsStr }}</span>
+						</div>
+						<radar-chart :width="'100%'" :height="'729px'" :value="rzdfsData" />
+					</div>
+				</panel>
+			</el-col>
+			<el-col :span="10">
+				<el-row>
+					<el-col :span="24">
+						<panel :title="'月最大风速'" class="radar-panel" :icon="'svg-wind-site'">
+							<div class="wind-info">
+								<div class="legend mg-r-16">
+									<span class="dot"></span>
+									<span>{{ yzdfsStr }}</span>
+								</div>
+								<radar-chart :width="'100%'" :height="'350px'" :value="yzdfsData" />
+							</div>
+						</panel>
+					</el-col>
+				</el-row>
+				<el-row>
+				 <el-col :span="24">
+						<panel :title="'年最大风速'" class="radar-panel" :icon="'svg-wind-site'">
+							<div class="wind-info">
+								<div class="legend mg-r-16">
+									<span class="dot"></span>
+									<span>{{ nzdfsStr }}</span>
+								</div>
+								<radar-chart :width="'100%'" :height="'350px'" :value="nzdfsData" />
+							</div>
+						</panel>
+					</el-col>
+				</el-row>
+			</el-col>
+		</el-row>
+	</div>
 </template>
 
 <script>
+	import panel from "@/components/coms/panel/panel.vue";
+	import RadarChart from "@/components/chart/radar/radar-chart.vue";
+	export default {
+		components: {
+			panel,
+			RadarChart
+		},
+		data() {
+			return {
+				rzdfsStr: "",
+				yzdfsData: {
+					indicator: ["N0", "N1", "N2", "N3", "N4", "N5"],
+				 data: [{
+						value: [44200, 14200, 20000, 35000, 50000, 38000],
+						name: "",
+					}, ],
+				},
+				yzdfsStr: "",
+				yzdfsData: {
+					indicator: ["N0", "N1", "N2", "N3", "N4", "N5"],
+					data: [{
+						value: [44200, 14200, 20000, 35000, 50000, 38000],
+						name: "",
+					}, ],
+				},
+
+				nzdfsStr: "",
+				nzdfsData: {
+					indicator: ["N0", "N1", "N2", "N3", "N4", "N5"],
+					data: [{
+						value: [44200, 14200, 20000, 35000, 50000, 38000],
+						name: "",
+					}, ],
+				},
+			}
+		},
+		created() {
+
+		},
+		methods: {
+			// getMgt(subUrl, data, dataKey, logFlg) {
+			//   let that = this;
+			//   that.API.requestData({
+			//     method: "POST",
+			//     subUrl,
+			//     data,
+			//     success(res) {
+			//       that[dataKey.split("Data")[0] + "Str"] = res.data.jfpl || "";
+
+			//       let mgtData = {
+			//         indicator: [],
+			//         data: [
+			//           {
+			//             name: "",
+			//             value: [],
+			//           },
+			//         ],
+			//       };
+
+			//       if (res.data.data) {
+			//         mgtData.indicator = [
+			//           "北",
+			//           "北北西",
+			//           "北西",
+			//           "西北西",
+			//           "西",
+			//           "西南西",
+			//           "南西",
+			//           "南南西",
+			//           "南",
+			//           "南南东",
+			//           "东南",
+			//           "东南东",
+			//           "东",
+			//           "东北东",
+			//           "北东",
+			//           "北北东",
+			//         ];
+			//         res.data.data.forEach((ele) => {
+			//           // mgtData.indicator.push(ele.name);
+			//           mgtData.data[0].value.push(ele.data1);
+			//         });
+			//       }
+			//       mgtData.data[0].value.reverse();
+			//       that[dataKey] = mgtData;
+			//     },
+			//   });
+			// },
+		},
+
+	};
 </script>
 
 <style>

+ 17 - 148
src/views/sampleDatabase/performance/index.vue

@@ -51,7 +51,6 @@
 				</div>
 				<div class="query-actions">
 					<button class="btn" @click="list">查询</button>
-					<button class="btn" @click="dbfx">对比</button>
 				</div>
 			</div>
 		</div>
@@ -61,15 +60,14 @@
 		</el-row>
 		<el-dialog title="数据对比" v-model="dialog" width="90%" top="10vh" custom-class="modal"
 			:close-on-click-modal="false" :before-close="onClickDialogClose" class="isvisiable">
-			<scatter-line-chart :lineData="scatterLineData.lineData" :data="scatterLineData.data" xTitle="风速"
-				yTitle="功率" :height="'70vh'" />
+			<scatter-line-chart :data="scatterLineData" :dotName='dotName' :height="'70vh'" />
 		</el-dialog>
 	</el-scrollbar>
 </template>
 
 <script>
 	import ComTable from "@/components/coms/table/table.vue";
-	import ScatterLineChart from "@/components/chart/combination/scatter-line-chart.vue";
+	import ScatterLineChart from "./scatter-line-chart.vue";
 	import BASE from "@tools/basicTool.js";
 	export default {
 		components: {
@@ -79,39 +77,14 @@
 		data() {
 			const that = this;
 			return {
-				scatterLineData: {
-					data: [{
-							title: "1",
-							value: [
-								[14.49, 337.0],
-								[5.78, 368.0],
-								[5.08, 247.0],
-								[4.79, 171.0],
-								[4.05, 120.0],
-							],
-						},
-						{
-							title: "2",
-							value: [
-								[14.49, 37.0],
-								[5.78, 68.0],
-								[5.08, 47.0],
-								[4.79, 71.0],
-								[4.05, 20.0],
-							],
-						},
-					],
-					lineData: {
-						xTitle: "风速",
-						yTitle: "功率",
-						legends: [],
-						data: [
-							[80.67, 48.38, 65, 95.84, 71.84],
-							[93.67, 98.38, 165, 295.84, 471.84],
-						],
-					},
-				},
-				ids: [],
+				scatterLineData: [
+					[1.49, 337.0],
+					[5.78, 368.0],
+					[5.08, 247.0],
+					[4.79, 171.0],
+					[4.05, 120.0]
+				],
+				dotName:'',
 				checkLength: 0, //对标分析只能选择5个
 				yblx: 0,
 				yblxArr: [{
@@ -125,8 +98,6 @@
 				],
 				dialog: false, //传感点组件隐藏或显示
 				ChangZhan: [],
-				fjxh: [],
-				fjxhArr: [],
 				// 模型
 				model: 0,
 				models: [
@@ -164,31 +135,6 @@
 				tableData: {
 					column: [
 						{
-							name: "",
-							field: "check",
-							is_light: false,
-							width: '50px',
-							template: function() {
-								return "<input class='check curCheckBox' type='CheckBox'/>";
-							},
-							click: function(event, data) {
-								let id = data.id;
-								if (event.target.checked == false && that.checkLength <= 5) {
-									that.ids.forEach((item, i) => {
-										if (item == id) {
-											that.ids.splice(i, 1);
-										}
-									});
-									that.checkLength--;
-								} else if (event.target.checked && that.checkLength < 5) {
-									that.ids.push(id);
-									that.checkLength++;
-								} else if (that.checkLength == 5) {
-									event.target.checked = false;
-								}
-							},
-						},
-						{
 							name: "序号",
 							field: "index",
 							is_light: false,
@@ -252,35 +198,6 @@
 						that.station = res.data[0].name
 					},
 				});
-
-				// await that.API.requestData({
-				// 	method: "GET",
-				// 	baseURL: "http://192.168.1.18:9002/",
-				// 	subUrl: "basic/station/all",
-				// 	success(res) {
-				// 		let fjxhArr = [];
-				// 		let model = [],
-				// 			fjxh = [];
-				// 		res.data.forEach(ele => {
-				// 			fjxhArr.push({
-				// 				id: ele.id,
-				// 				value: ele.model.split("/")
-				// 			})
-				// 			if (ele.id == "MHS_FDC") {
-				// 				model = ele.model.split("/");
-				// 				model.forEach(ele => {
-				// 					fjxh.push({
-				// 						label: ele,
-				// 						value: ele
-				// 					})
-				// 				})
-				// 			}
-				// 		})
-				// 		that.fjxhArr = fjxhArr;
-				// 		that.model = model;
-				// 		that.fjxh = fjxh;
-				// 	},
-				// });
 				that.list()
 			},
 			onClickOption(e, row) { // 操作按钮
@@ -293,6 +210,7 @@
 				BASE.showLoading({ text:"加载中..." });
 				that.API.requestData({
 					method: "GET",
+					// baseURL: "http://192.168.10.19:9002/",
 					baseURL: "http://192.168.1.18:9002/",
 					subUrl: "case/performance/scatter",
 					data: {
@@ -301,48 +219,15 @@
 					},
 					success(res) {
 						if (res.code == 200) {
-							let data = res.data,
-								keys = Object.keys(data),
-								fs = [],
-								zs = [],
-								dotData = [];
-							keys.forEach(ele => {
-								let keyId = ele.split('_')[1],
-									dataType = ele.slice(0, 1);
-								ids.forEach(ele2 => {
-									if (ele2 == keyId && dataType == 'C') {
-										data[ele].forEach(ele3 => {
-											fs.push(ele3.fs)
-											zs.push(ele3.zs)
-										})
-									} else if (ele2 == keyId && dataType == 'S') {
-										dotData.push({
-											title: keyId,
-											value: data[ele]
-										})
-									}
-								})
-							})
-							that.scatterLineData.data = dotData;
-							that.scatterLineData.lineData.data = [fs, zs];
+							let key = Object.keys(res.data)[0];
+							that.scatterLineData = res.data[key][1];
+							that.dotName = key;
 							BASE.closeLoading();
 							that.dialog = true;
 						}
 					},
 				});
 			},
-			dbfx() {
-				var that = this;
-				if (that.ids.length <= 5 && that.ids.length != 0) {
-					that.chart(that.ids);
-				} else {
-					this.BASE.showMsg({
-						type: "warning",
-						msg: "请选择测点后再对比",
-					});
-					return
-				}
-			},
 			list() {
 				var that = this;
 				let station = '';
@@ -363,17 +248,18 @@
 					showLoading: true,
 					method: "GET",
 					baseURL: "http://192.168.1.18:9002/",
+					// baseURL: "http://192.168.10.19:9002/",
 					subUrl: "case/performance/list",
 					data: {
 						tag: that.yblx,
 						stationen: station ? station : that.station,
-						model: that.model,
-						interval: that.inverval,
+						interval: that.interval,
 						starttime: that.time[0].valueOf(),
 						endtime: that.time[1].valueOf()
 					},
 					success(res) {
 						if (res.code == 200) {
+							console.log(res.data.length)
 							if (res.data.length) {
 								let data = res.data;
 								that.tableData.data = [];
@@ -397,23 +283,6 @@
 		created() {
 			this.startAjax();
 		},
-		watch: {
-			station(res) {
-				let fjxh = [];
-				this.fjxhArr.forEach(ele => {
-					if (ele.id == res) {
-						ele.value.forEach(ele2 => {
-							fjxh.push({
-								label: ele2,
-								value: ele2
-							})
-						})
-						this.model = ele.value;
-					}
-				})
-				this.fjxh = fjxh;
-			}
-		},
 	};
 </script>
 

+ 170 - 0
src/views/sampleDatabase/performance/scatter-line-chart.vue

@@ -0,0 +1,170 @@
+<template>
+	<div class="chart" :id="id"></div>
+</template>
+
+<script>
+	import util from "@/helper/util.js";
+	import partten from "@/helper/partten.js";
+	import * as echarts from "echarts";
+	import ecStat from 'echarts-stat';
+	export default {
+		components: {
+			ecStat
+		},
+		props: {
+			width: {
+				type: String,
+				default: "100%",
+			},
+			height: {
+				type: String,
+				default: "350px",
+			},
+			// 传入数据
+			data: {
+				type: Array,
+				default: () => [
+					[96.24, 11.35],
+					[33.09, 85.11],
+					[57.6, 36.61],
+					[36.77, 27.26],
+					[20.1, 6.72],
+					[45.53, 36.37],
+					[110.07, 80.13],
+					[72.05, 20.88],
+					[39.82, 37.15],
+					[48.05, 70.5],
+					[0.85, 2.57],
+					[51.66, 63.7],
+					[61.07, 127.13],
+					[64.54, 33.59],
+					[35.5, 25.01],
+					[226.55, 664.02],
+					[188.6, 175.31],
+					[81.31, 108.68]
+				],
+			},
+			dotName: {
+				type: String,
+				default: "",
+			},
+		},
+		data() {
+			return {
+				id: "",
+				chart: null,
+				color: ["#05bb4c", "#f8de5b", "#4b55ae", "#fa8c16"]
+			};
+		},
+		methods: {
+			resize() {},
+			initChart() {
+				const chart = echarts.init(this.$el);
+				echarts.registerTransform(ecStat.transform.regression);
+				let option = {
+					dataset: [{
+							source: this.data
+						},
+						{
+							transform: {
+								type: 'ecStat:regression',
+								config: {
+									method: 'polynomial',
+									order: 3
+								}
+							}
+						}
+					],
+					tooltip: {
+						trigger: "item",
+						showDelay: 0,
+						backgroundColor: "rgba(0,0,0,0.4)",
+						borderColor: partten.getColor("gray"),
+						textStyle: {
+						  fontSize: util.vh(16),
+						  color: "#fff",
+						},
+					},
+					xAxis: {
+						splitLine: {
+							lineStyle: {
+								color: partten.getColor("gray") + 55,
+								type: 'dashed'
+							}
+						},
+						splitNumber: 20
+					},
+					yAxis: {
+						min: -40,
+						splitLine: {
+							lineStyle: {
+								color: partten.getColor("gray") + 55,
+								type: 'dashed'
+							}
+						}
+					},
+					series: [{
+							name: this.dotName,
+							type: 'scatter'
+						},
+						{
+							type: 'line',
+							smooth: true,
+							datasetIndex: 1,
+							symbolSize: 0.1,
+							symbol: 'circle',
+							lineStyle: {
+								normal: {
+									color: '#05bb4c',
+									width: 2,
+								},
+			 			},
+							labelLayout: {
+								dx: -20
+							},
+							encode: {
+								label: 2,
+								tooltip: 1
+							}
+						}
+						
+					]
+				};
+				chart.clear();
+				chart.setOption(option);
+
+				this.resize = function() {
+					chart.resize();
+				};
+
+				window.addEventListener("resize", this.resize);
+			},
+		},
+		created() {
+			this.id = "pie-chart-" + util.newGUID();
+		},
+		mounted() {
+			this.$nextTick(() => {
+				this.$el.style.width = this.width;
+				this.$el.style.height = this.height;
+				this.initChart();
+			});
+		},
+		updated() {
+			this.$nextTick(() => {
+				this.initChart();
+			});
+		},
+		unmounted() {
+			window.removeEventListener("resize", this.resize);
+		},
+	};
+</script>
+
+<style lang="less">
+	.chart {
+		width: 100%;
+		height: 100%;
+		display: inline-block;
+	}
+</style>

+ 0 - 1
src/views/sampleDatabase/warning/index.vue

@@ -117,7 +117,6 @@
 				wpArray: [],
 				wpName: "",
 				wtId: [],
-				// wtIdArr: ['发电机','变桨系统','测风系统','齿轮箱','液压系统','偏航系统','机舱','传动链'],
 				wtIdArr: [],
 				wtidData: [],
 				wtIdNum: false,