Browse Source

Merge branch 'yx' of http://61.161.152.110:10101/r/electronic-map into yx

Koishi 4 years ago
parent
commit
c6459d164e

+ 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",

+ 6 - 6
src/views/layout/Menu.vue

@@ -977,7 +977,7 @@ export default {
               path: "/others/fault",
               children: [
                 {
-                  text: "故障样本库",
+                  text: "故障训练样本库",
                   icon: "svg-matrix",
                   path: "/others/fault",
                 },
@@ -991,11 +991,11 @@ export default {
                   icon: "svg-matrix",
                   path: "/others/warning",
                 },
-                {
-                  text: "风电营销样本库",
-                  icon: "svg-matrix",
-                  path: "/others/market",
-                }
+                // {
+                //   text: "风电营销样本库",
+                //   icon: "svg-matrix",
+                //   path: "/others/market",
+                // }
               ],
             },
           ],

+ 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>

+ 7 - 6
src/views/sampleDatabase/fault/point.vue

@@ -109,12 +109,7 @@
 				isvisiable: false,
 				checkLength: 0, //对标分析只能选择5个
 				tableData: {
-					column: [{
-							name: "序号",
-							field: "index",
-							is_light: false,
-							width: '50px',
-						},
+					column: [
 						{
 							name: "",
 							field: "check",
@@ -144,6 +139,12 @@
 							},
 						},
 						{
+							name: "序号",
+							field: "index",
+							is_light: false,
+							width: '30px',
+						},
+						{
 							name: "测点名称",
 							field: "point",
 							is_light: false,

+ 344 - 415
src/views/sampleDatabase/performance/index.vue

@@ -1,424 +1,353 @@
 <template>
-	<el-scrollbar height="92vh">
-		<div class="query mg-b-8">
-			<div class="query-items">
-				<div class="query-item" style="width:200px">
-					<div class="lable">场站:</div>
-					<div class="search-input">
-						<el-select v-model="station" placeholder="请选择" popper-class="select">
-							<el-option v-for="item in ChangZhan" :key="item.id" :value="item.id" :label="item.name">
-							</el-option>
-						</el-select>
-					</div>
-				</div>
-				<div class="query-item" style="width:200px">
-					<div class="lable">样本类型:</div>
-					<div class="search-input">
-						<el-select v-model="yblx" placeholder="请选择样本" popper-class="select">
-							<el-option v-for="item in yblxArr" :key="item.value" :value="item.value"
-								:label="item.label">
-							</el-option>
-						</el-select>
-					</div>
-				</div>
-				<div class="query-item" style="width:200px">
-					<div class="lable">模型:</div>
-					<div class="search-input">
-						<el-select v-model="model" collapse-tags placeholder="请选择"
-							popper-class="select">
-							<el-option v-for="item in models" :key="item.value" :value="item.value" :label="item.label">
-							</el-option>
-						</el-select>
-					</div>
-				</div>
-				<div class="query-item" style="width:250px">
-					<div class="lable">时间间隔:</div>
-					<div class="search-input">
-						<el-select v-model="interval" collapse-tags clearable placeholder="请选择"
-							popper-class="select">
-							<el-option v-for="item in intervals" :key="item.value" :value="item.value" :label="item.label">
-							</el-option>
-						</el-select>
-					</div>
-				</div>
-				<div class="query-item">
-					<div class="lable">时间:</div>
-					<div class="search-input">
-						<el-date-picker v-model="time" type="datetimerange" range-separator="至" start-placeholder="开始日期"
-							end-placeholder="结束日期">
-						</el-date-picker>
-					</div>
-				</div>
-				<div class="query-actions">
-					<button class="btn" @click="list">查询</button>
-					<button class="btn" @click="dbfx">对比</button>
-				</div>
-			</div>
-		</div>
-		<el-row :type="'flex'" class="content">
-			<ComTable :data="tableData" height="70vh" v-loading="tableLoading" element-loading-text="拼命加载中"
-				element-loading-background="rgba(0, 0, 0, 0.8)"></ComTable>
-		</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'" />
-		</el-dialog>
-	</el-scrollbar>
+  <el-scrollbar height="92vh">
+    <div class="query mg-b-8">
+      <div class="query-items">
+        <div class="query-item" style="width: 200px">
+          <div class="lable">场站:</div>
+          <div class="search-input">
+            <el-select
+              v-model="station"
+              placeholder="请选择"
+              popper-class="select"
+            >
+              <el-option
+                v-for="item in ChangZhan"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </div>
+        <div class="query-item" style="width: 200px">
+          <div class="lable">样本类型:</div>
+          <div class="search-input">
+            <el-select
+              v-model="yblx"
+              placeholder="请选择样本"
+              popper-class="select"
+            >
+              <el-option
+                v-for="item in yblxArr"
+                :key="item.value"
+                :value="item.value"
+                :label="item.label"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </div>
+        <div class="query-item" style="width: 200px">
+          <div class="lable">模型:</div>
+          <div class="search-input">
+            <el-select
+              v-model="model"
+              collapse-tags
+              placeholder="请选择"
+              popper-class="select"
+            >
+              <el-option
+                v-for="item in models"
+                :key="item.value"
+                :value="item.value"
+                :label="item.label"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </div>
+        <div class="query-item" style="width: 250px">
+          <div class="lable">时间间隔:</div>
+          <div class="search-input">
+            <el-select
+              v-model="interval"
+              collapse-tags
+              placeholder="请选择"
+              popper-class="select"
+            >
+              <el-option
+                v-for="item in intervals"
+                :key="item.value"
+                :value="item.value"
+                :label="item.label"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </div>
+        <div class="query-item">
+          <div class="lable">时间:</div>
+          <div class="search-input">
+            <el-date-picker
+              v-model="time"
+              type="datetimerange"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+            >
+            </el-date-picker>
+          </div>
+        </div>
+        <div class="query-actions">
+          <button class="btn" @click="list">查询</button>
+        </div>
+      </div>
+    </div>
+    <el-row :type="'flex'" class="content">
+      <ComTable
+        :data="tableData"
+        height="80vh"
+        v-loading="tableLoading"
+        element-loading-text="拼命加载中"
+        element-loading-background="rgba(0, 0, 0, 0.8)"
+      ></ComTable>
+    </el-row>
+    <el-dialog
+      title="数据对比"
+      v-model="dialog"
+      width="70%"
+      top="10vh"
+      custom-class="modal"
+      :close-on-click-modal="false"
+      :before-close="onClickDialogClose"
+      class="isvisiable"
+    >
+      <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 BASE from "@tools/basicTool.js";
-	export default {
-		components: {
-			ComTable,
-			ScatterLineChart,
-		},
-		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: [],
-				checkLength: 0, //对标分析只能选择5个
-				yblx: 0,
-				yblxArr: [{
-						label: '正样本',
-						value: 0
-					},
-					{
-						label: '负样本',
-						value: 1
-					}
-				],
-				dialog: false, //传感点组件隐藏或显示
-				ChangZhan: [],
-				fjxh: [],
-				fjxhArr: [],
-				// 模型
-				model: 0,
-				models: [
-					{
-						label: '欠发矩阵模型',
-						value: 0
-					}
-				],
-				// 时间间隔
-				interval: "0-0.5",
-				intervals: [//和明华有约定,必须这么写
-					{
-						label: '小于30分钟',
-						value: "0-0.5"
-					},
-					{
-						label: '30分钟-1小时',
-						value: "0.5-1"
-					},
-					{
-						label: '1小时-2小时',
-						value: "1-2"
-					},
-					{
-						label: '2小时-5小时',
-						value: "2-5"
-					},
-					{//42天
-						label: '大于5小时',
-						value: "5-1008"
-					}
-				],
-				time: [],
-				station: '',
-				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,
-							width: '100px',
-						},
-						{
-							name: "样本类型",
-							field: "tag",
-							is_light: false,
-							width: '150px',
-						},
-						{
-							name: "风机编号",
-							field: "windturbineid",
-							is_light: false,
-							width: '250px',
-						},
-						{
-							name: "开始时间",
-							field: "starttime",
-							is_light: false,
-							width: '350px',
-						},
-						{
-							name: "结束时间",
-							field: "endtime",
-							is_light: false,
-							width: '350px',
-						},
-						{
-							name: "操作",
-							field: "cz",
-							is_light: false,
-							width: '200px',
-							template: () => {
-								return (
-									"<el-button type='text' style='cursor: pointer;' value='config'>查看</el-button>&nbsp"
-								);
-							},
-							click(e, row) {
-								that.onClickOption(e, row);
-							},
-						},
-					],
-					data: [],
-				},
-			};
-		},
-		methods: {
-			async startAjax() {
-				var that = this;
-				that.time = [new Date((new Date() - (3600 * 24 * 1000 * 30))).formatDate("yyyy-MM-dd hh:mm:ss"),
-					new Date().formatDate("yyyy-MM-dd hh:mm:ss")
-				];
-				await that.API.requestData({
-					method: "GET",
-					baseURL: "http://10.155.32.4:9001/",
-					subUrl: "benchmarking/wplist",
-					success(res) {
-						that.ChangZhan = res.data;
-						that.station = res.data[0].name
-					},
-				});
+import ComTable from "@/components/coms/table/table.vue";
+import ScatterLineChart from "./scatter-line-chart.vue";
+import BASE from "@tools/basicTool.js";
+export default {
+  components: {
+    ComTable,
+    ScatterLineChart,
+  },
+  data() {
+    const that = this;
+    return {
+      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: [
+        {
+          label: "正样本",
+          value: 0,
+        },
+        {
+          label: "负样本",
+          value: 1,
+        },
+      ],
+      dialog: false, //传感点组件隐藏或显示
+      ChangZhan: [],
+      // 模型
+      model: 0,
+      models: [
+        {
+          label: "欠发矩阵模型",
+          value: 0,
+        },
+      ],
+      // 时间间隔
+      interval: "1-2",
+      intervals: [
+        //和明华有约定,必须这么写
+        {
+          label: "小于30分钟",
+          value: "0-0.5",
+        },
+        {
+          label: "30分钟-1小时",
+          value: "0.5-1",
+        },
+        {
+          label: "1小时-2小时",
+          value: "1-2",
+        },
+        {
+          label: "2小时-5小时",
+          value: "2-5",
+        },
+        {
+          //42天
+          label: "大于5小时",
+          value: "5-1008",
+        },
+      ],
+      time: [],
+      station: "",
+      tableData: {
+        column: [
+          {
+            name: "序号",
+            field: "index",
+            is_light: false,
+            width: "100px",
+          },
+          {
+            name: "样本类型",
+            field: "tag",
+            is_light: false,
+            width: "150px",
+          },
+          {
+            name: "风机编号",
+            field: "windturbineid",
+            is_light: false,
+            width: "250px",
+          },
+          {
+            name: "开始时间",
+            field: "starttime",
+            is_light: false,
+            width: "350px",
+          },
+          {
+            name: "结束时间",
+            field: "endtime",
+            is_light: false,
+            width: "350px",
+          },
+          {
+            name: "操作",
+            field: "cz",
+            is_light: false,
+            width: "200px",
+            template: () => {
+              return "<el-button type='text' style='cursor: pointer;' value='config'>详情</el-button>&nbsp";
+            },
+            click(e, row) {
+              that.onClickOption(e, row);
+            },
+          },
+        ],
+        data: [],
+      },
+    };
+  },
+  methods: {
+    async startAjax() {
+      var that = this;
+      that.time = [
+        new Date(new Date() - 3600 * 24 * 1000 * 15).formatDate(
+          "yyyy-MM-dd hh:mm:ss"
+        ),
+        new Date().formatDate("yyyy-MM-dd hh:mm:ss"),
+      ];
+      await that.API.requestData({
+        method: "GET",
+        baseURL: "http://10.155.32.4:9001/",
+        subUrl: "benchmarking/wplist",
+        success(res) {
+          that.ChangZhan = res.data;
+          that.station = res.data[1].id;
+        },
+      });
+      that.list();
+    },
+    onClickOption(e, row) {
+      // 操作按钮
+      if ("config" == e.target.getAttribute("value")) {
+        //查看
+        this.chart([row.id]);
+      }
+    },
+    chart(ids) {
+      const that = this;
+      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: {
+          id: ids,
+          interval: 30,
+        },
+        success(res) {
+          if (res.code == 200) {
+            let key = Object.keys(res.data)[0];
+            that.scatterLineData = res.data[key][1];
+            that.dotName = key;
+            BASE.closeLoading();
+            that.dialog = true;
+          }
+        },
+      });
+    },
+    list() {
+      var that = this;
+      if (that.time == undefined) {
+        that.BASE.showMsg({
+          type: "warning",
+          msg: "请选择起始时间",
+        });
+        return;
+      }
 
-				// 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) { // 操作按钮
-				if ("config" == e.target.getAttribute("value")) { //查看
-					this.chart([row.id]);
-				}
-			},
-			chart(ids) {
-				const that = this;
-				BASE.showLoading({ text:"加载中..." });
-				that.API.requestData({
-					method: "GET",
-					baseURL: "http://192.168.1.18:9002/",
-					subUrl: "case/performance/scatter",
-					data: {
-						id: ids,
-						interval: 30
-					},
-					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];
-							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 = '';
-				if (typeof that.time[0].valueOf() != 'string') {
-					that.time[0] = that.formatDate(that.time[0].valueOf())
-				}
-				if (typeof that.time[1].valueOf() != 'string') {
-					that.time[1] = that.formatDate(that.time[1].valueOf())
-				}
-				if (typeof that.station.valueOf() == 'string') {
-					that.ChangZhan.forEach(ele => {
-						if (ele.name == that.station) {
-							station = ele.id
-						}
-					})
-				}
-				that.API.requestData({
-					showLoading: true,
-					method: "GET",
-					baseURL: "http://192.168.1.18:9002/",
-					subUrl: "case/performance/list",
-					data: {
-						tag: that.yblx,
-						stationen: station ? station : that.station,
-						model: that.model,
-						interval: that.inverval,
-						starttime: that.time[0].valueOf(),
-						endtime: that.time[1].valueOf()
-					},
-					success(res) {
-						if (res.code == 200) {
-							if (res.data.length) {
-								let data = res.data;
-								that.tableData.data = [];
-								for (var i = 0; i < data.length; i++) {
-									let obj = {
-										index: i + 1,
-										tag: data[i].tag == 0 ? '正样本' : '负样本',
-										windturbineid: data[i].windturbineid,
-										starttime: data[i].starttime,
-										endtime: data[i].endtime,
-										id: data[i].id
-									};
-									that.tableData.data.push(obj);
-								}
-							}
-						}
-					},
-				});
-			},
-		},
-		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;
-			}
-		},
-	};
+      that.API.requestData({
+        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,
+          station: that.station,
+          interval: that.interval,
+          st: that.time[0].valueOf(),
+          et: that.time[1].valueOf(),
+        },
+        success(res) {
+          if (res.code == 200) {
+            that.tableData.data = [];
+            if (res.data.length) {
+              let data = res.data;
+              for (var i = 0; i < data.length; i++) {
+                let obj = {
+                  index: i + 1,
+                  tag: data[i].tag == 0 ? "正样本" : "负样本",
+                  windturbineid: data[i].windturbineid,
+                  starttime: data[i].starttime,
+                  endtime: data[i].endtime,
+                  id: data[i].id,
+                };
+                that.tableData.data.push(obj);
+              }
+            } else {
+              that.BASE.showMsg({
+                msg: "所选日期暂无数据",
+              });
+            }
+          }
+        },
+      });
+    },
+  },
+  created() {
+    this.startAjax();
+  },
+};
 </script>
 
 <style lang="less" scoped>
-	.el-select.w {
-		width: 100%;
-	}
+.el-select.w {
+  width: 100%;
+}
 </style>

+ 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: -10,
+						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>

+ 687 - 459
src/views/sampleDatabase/warning/index.vue

@@ -1,483 +1,711 @@
 <template>
-	<div class="knowledge-2">
-		<div class="query mg-b-8">
-			<div class="query-items">
-				<div class="query-item">
-					<div class="lable">场站:</div>
-					<div class="search-input">
-						<el-select v-model="wpId" clearable placeholder="请选择" popper-class="select">
-							<el-option v-for="item in wpArray" :key="item.id" :value="item.id" :label="item.name" />
-						</el-select>
-					</div>
-				</div>
-				<div class="query-item">
-					<div class="lable">预警分类:</div>
-					<div class="search-input">
-						<el-select v-model="wtId" clearable collapse-tags multiple placeholder="请选择"
-							popper-class="select">
-							<el-option label="全选" :class="active?'selected':''" @click="checkAll"/>
-							<el-option v-for="(item ,index) in wtIdArr" :key="index" :value="item" :label="item" />
-						</el-select>
-					</div>
-				</div>
-				<div class="query-item" style="width: 445px;">
-					<div class="lable">日期:</div>
-					<div class="search-input">
-						<el-date-picker v-model="month" type="datetimerange" range-separator="至" start-placeholder="开始日期"
-							end-placeholder="结束日期">
-						</el-date-picker>
-					</div>
-				</div>
-				<div class="query-actions">
-					<button class="btn" @click="query">查询</button>
-					<button class="btn" @click="">导入</button>
-					<button class="btn" @click="export">导出</button>
-				</div>
-			</div>
-		</div>
-		<el-row :type="'flex'" class="content">
-			<el-col :span="24">
-				<ComTable :data="tableData" height="85vh"></ComTable>
-			</el-col>
-		</el-row>
+  <div class="knowledge-2">
+    <div class="query mg-b-8">
+      <div class="query-items">
+        <div class="query-item">
+          <div class="lable">场站:</div>
+          <div class="search-input">
+            <el-select
+              v-model="wpId"
+              clearable
+              placeholder="请选择"
+              popper-class="select"
+            >
+              <el-option
+                v-for="item in wpArray"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              />
+            </el-select>
+          </div>
+        </div>
+        <div class="query-item">
+          <div class="lable">预警分类:</div>
+          <div class="search-input">
+            <el-select
+              v-model="wtId"
+              clearable
+              collapse-tags
+              multiple
+              placeholder="请选择"
+              popper-class="select"
+            >
+              <el-option
+                label="全选"
+                :class="active ? 'selected' : ''"
+                @click="checkAll"
+              />
+              <el-option
+                v-for="(item, index) in wtIdArr"
+                :key="index"
+                :value="item"
+                :label="item"
+              />
+            </el-select>
+          </div>
+        </div>
+        <div class="query-item" style="width: 445px">
+          <div class="lable">日期:</div>
+          <div class="search-input">
+            <el-date-picker
+              v-model="month"
+              type="datetimerange"
+              range-separator="至"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+            >
+            </el-date-picker>
+          </div>
+        </div>
+        <div class="query-actions">
+          <button class="btn" @click="query">查询</button>
+          <!-- <button class="btn" @click="">导入</button> -->
+          <button class="btn" @click="export">导出</button>
+        </div>
+      </div>
+    </div>
+    <el-row :type="'flex'" class="content">
+      <el-col :span="24">
+        <ComTable :data="tableData" height="85vh"></ComTable>
+      </el-col>
+    </el-row>
 
-		<el-dialog :title="yssjTitle" v-model="yssjDialog" width="70%" top="15vh" custom-class="modal"
-			:close-on-click-modal="false" :before-close="yssjDialogClose">
-			<div class="query mg-b-8">
-				<div class="query-items">
-					<div class="query-item">
-						<div class="lable">等间隔:</div>
-						<div class="search-input">
-							<el-select v-if="!chooseStatus" @change="switchChange(selectValue)" class="inputs"
-								v-model="selectValue" placeholder="请选择">
-								<el-option v-for="item in timeoptions" :key="item.value" :label="item.label"
-									:value="item.value">
-								</el-option>
-							</el-select>
-						</div>
-					</div>
-					<div class="query-actions">
-						<button class="btn" @click="queryYssj">查询</button>
-					</div>
-				</div>
-			</div>
+    <el-dialog
+      :title="yssjTitle"
+      v-model="yssjDialog"
+      width="70%"
+      top="15vh"
+      custom-class="modal"
+      :close-on-click-modal="false"
+      :before-close="yssjDialogClose"
+    >
+      <div class="query mg-b-8">
+        <div class="query-items">
+          <div class="query-item">
+            <div class="lable">等间隔:</div>
+            <div class="search-input">
+              <el-select
+                v-if="!chooseStatus"
+                @change="switchChange(selectValue)"
+                class="inputs"
+                v-model="selectValue"
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in timeoptions"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
+            </div>
+          </div>
+          <div class="query-actions">
+            <button class="btn" @click="queryYssj">查询</button>
+          </div>
+        </div>
+      </div>
 
-			<el-row type="flex">
-				<multiple-y-line-chart-normal height="500px" :list="Powertrend" :showLegend="true" />
-			</el-row>
-		</el-dialog>
-	</div>
+      <el-row type="flex">
+        <multiple-y-line-chart-normal
+          height="500px"
+          :list="Analysis"
+          :yAxises="AnalysisYAxises"
+          :showLegend="true"
+        />
+      </el-row>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
-	import ComTable from "@com/coms/table/table.vue";
-	import MultipleYLineChartNormal from "../../NewPages/multiple-y-line-chart-normal.vue";
-	import BASE from "@tools/basicTool.js";
-	export default {
-		components: {
-			ComTable,
-			MultipleYLineChartNormal
-		},
-		data() {
-			let that = this;
-			return {
-				active: true,
-				selectAll: true,
-				Powertrend: [],
-				selectValue: "60",
-				timeoptions: [{
-						value: "60",
-						label: "一分钟",
-					},
-					{
-						value: "300",
-						label: "五分钟",
-					},
-					{
-						value: "600",
-						label: "十分钟",
-					},
-					{
-						value: "1800",
-						label: "三十分钟",
-					},
-					{
-						value: "3600",
-						label: "一小时",
-					},
-					{
-						value: "86400",
-						label: "一天",
-					},
-				],
-				yssjDialog: false,
-				yssjData:{},
-				month: [],
-				wpId: "MHS_FDC",
-				wpArray: [],
-				wpName: "",
-				wtId: [],
-				// wtIdArr: ['发电机','变桨系统','测风系统','齿轮箱','液压系统','偏航系统','机舱','传动链'],
-				wtIdArr: [],
-				wtidData: [],
-				wtIdNum: false,
-				tableDataArr: {},
-				tableData: {
-					column: [{
-							name: "序号",
-							field: "index",
-							is_num: false,
-							is_light: false,
-							width: "60px"
-						},
-						{
-							name: "风机编号",
-							field: "fjbh",
-							is_num: false,
-							is_light: false,
-							width: "150px"
-						},
-						{
-							name: "预警分类",
-							field: "yjfl",
-							is_num: false,
-							is_light: false,
-						},
-						{
-							name: "预警描述",
-							field: "yjms",
-							is_num: false,
-							is_light: false,
-						},
-						{
-							name: "预警次数(次)",
-							field: "yjcs",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-							width: "150px"
-						}, {
-							name: "预警时长(分钟)",
-							field: "yjsc",
-							is_num: false,
-							is_light: false,
-							sortable: true,
-							width: "150px"
-						}, {
-							name: "操作",
-							field: "cz",
-							is_num: false,
-							is_light: false,
-							width: "150px",
-							template: function() {
-								return "<a class='action'>原始数据</a>";
-							},
-							click: function(event, data) {
-								that.yssjTitle = data.yjms;
-								that.requestDetailData(that.wpId, data.fjbh, data.yjms, that.month);
-							},
-						},
-					],
-					data: [],
-				},
-			};
-		},
-		created() {
-			this.getWp();
-			this.month = [new Date((new Date() - 3600 * 1000 * 24 * 30)), new Date()];
-			this.requestSafeList();
-		},
-		methods: {
-			requestDetailData(wpId, fjbh, yjms, time) {
-				let that = this;
-				that.yssjData = {
-					wpId:wpId, 
-					fjbh:fjbh, 
-					yjms:yjms, 
-					time:time
-				};
-				BASE.showLoading();
-				that.API.requestData({
-					method: "GET",
-					subUrl: "/analysis/detail",
-					data: {
-						station: wpId,
-						startTs: new Date(new Date(time[0]).formatDate("yyyy/MM/dd")).getTime(),
-						endTs: new Date(new Date(time[1]).formatDate("yyyy/MM/dd")).getTime(),
-						interval: that.selectValue,
-						wtId: fjbh,
-						name: yjms
-					},
-					success(res) {
-						if (res.data.length != 0) {
-							let Powertrend = [];
-							res.data.forEach((cEle, index) => {
-								Powertrend.push({
-									title: cEle.name,
-									smooth: true,
-									value: [],
-								})
-								cEle.data.forEach((rEle) => {
-									Powertrend[index].value.push({
-										text: new Date(rEle.ts).formatDate("hh:mm"),
-										value: rEle.doubleValue
-									});
-								});
-							});
-							if (Powertrend.length != 0) {
-								that.Powertrend = Powertrend;
-								BASE.closeLoading();
-								that.yssjDialog = true;
-							}
-						} else {
-							BASE.closeLoading();
-							that.BASE.showMsg({
-								msg: "暂无数据"
-							});
-						}
-					},
-				});
-			},
-			queryYssj() {
-				let data = this.yssjData;
-				this.requestDetailData(data.wpId, data.fjbh, data.yjms, data.time)
-			},
-			switchChange(interval, status) {
-				if (status === 'interval') {
-					this.chooseStatus = false
-					this.selectValue = '60'
-				} else if (status === 'original') {
-					this.chooseStatus = true
-				}
-			},
-			formatDate(date) {
-				var date = new Date(date);
-				var YY = date.getFullYear() + '-';
-				var MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
-				var DD = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());
-				return YY + MM + DD;
-			},
-			// 获取风场
-			getWp() {
-				let that = this;
-				that.API.requestData({
-					baseURL: "http://10.155.32.4:8082/",
-					subUrl: "powercompare/windfarmAjax",
-					success(res) {
-						that.wpArray = res.data;
-						that.wpId = res.data[0].id;
-						that.wpName = res.data[0].wpName;
-					}
-				});
-			},
-			// 获取停机事件
-			requestSafeList() {
-				let that = this;
-				// if (wtIdData) {
-				// 	that.tableData.data = wtIdData;
-				// 	that.wtIdData = [];
-				// 	return;
-				// }
-				// if (wpId) {
-				// 	that.wpId = wpId;
-				// }
-				that.month[0] = that.formatDate(that.month[0].valueOf())
-				that.month[1] = that.formatDate(that.month[1].valueOf())
-				let data = {
-					stationid: that.wpId,
-					startdate: that.month[0].valueOf(),
-					enddate: that.month[1].valueOf(),
-				};
-				that.API.requestData({
-					showLoading: true,
-					baseURL: "http://192.168.1.18:8075/",
-					subUrl: "alarm/count/query/new",
-					data,
-					success(res) {
-						if (res.code == 200) {
-							that.tableData.data = [];
-							if (res.data.length) {
-								let data = res.data;
-								let tabData = [];
-								let index = 1;
-								let wtIdArr = [];
-								data.forEach((ele, idx) => {
-									let key = Object.keys(ele);
-									ele[key].forEach((ele2, idx2) => {
-										if (ele2.time != 0 && ele2.count >= 10) { //过滤条件
-											let obj = {
-												index: index++,
-												fjbh: ele2.windturbineId,
-												yjfl: ele2.relatePartsText,
-												yjms: ele2.alertText,
-												yjcs: ele2.count,
-												yjsc: ele2.time,
-											};
-											tabData.push(obj);
-											let result = wtIdArr.some(ele4=>{
-												return ele2.relatePartsText === ele4
-											})
-											if(result == false){
-												wtIdArr.push(ele2.relatePartsText)
-											}
-										}
-									})
-								})
-								that.wtIdArr = wtIdArr;
-								that.wtId = wtIdArr;
-								that.tableData.data = tabData;
-								that.tableDataArr = {
-									column: that.tableData.column,
-									data: tabData
-								};
-							}
-						}
-					},
-				});
-			},
-			query() {
-				this.requestSafeList();
-			},
-			checkAll() {
-				this.selectAll = !this.selectAll
-				if (this.selectAll) {
-					this.wtId = this.wtIdArr;
-					this.active = true;
-				} else {
-					this.active = false;
-					this.wtId = [];
-				}
-			},
-			formatJson(filterVal, jsonData) {
-				return jsonData.map(v => filterVal.map(j => v[j]));
-			},
-			export() {
-				let that = this;
-				const {export_json_to_excel} = require('@tools/excel/Export2Excel.js'); // 注意这个Export2Excel路径      
-				let tHeader = []; // 上面设置Excel的表格第一行的标题       
-				let filterVal = []; // 上面的index、nickName、name是tableData里对象的属性key值
-			
-				that.tableData.column.forEach(ele => {
-					if(ele.field != 'cz'){
-						tHeader.push(ele.name);
-						filterVal.push(ele.field);
-					}
-				});
-				const data = that.formatJson(filterVal, that.tableData.data);
-				export_json_to_excel(tHeader, data, '预警分析'); // 最后一个是表名字
-			},
-		},
-		watch: {
-			wpId() {
-				this.wtidData = undefined;
-				this.wtIdNum = false;
-			},
-			wtId(e) {
-				if (this.wtIdNum) {
-					let data = [];
-					let index = 1;
-					let tableDataArr = this.tableDataArr;
-					tableDataArr.data.forEach(ele => {
-						e.forEach(ele2 => {
-							if (ele.yjfl == ele2) {
-								let obj = {
-									index: index++,
-									fjbh: ele.fjbh,
-									yjfl: ele.yjfl,
-									yjms: ele.yjms,
-									yjcs: ele.yjcs,
-									yjsc: ele.yjsc,
-								};
-								data.push(obj)
-							}
-						})
-					})
-					if (data) {
-						this.tableData.data = data;
-						// this.wtidData = data;
-					}
-				}
-				this.wtIdNum = true;
-			},
-			// month(e) {
-			// 	this.month = [new Date((e - 3600 * 1000 * 24 * 30)), e];
-			// }
-		}
-	};
+import ComTable from "@com/coms/table/table.vue";
+import MultipleYLineChartNormal from "../../NewPages/multiple-y-line-chart-normal.vue";
+import BASE from "@tools/basicTool.js";
+export default {
+  components: {
+    ComTable,
+    MultipleYLineChartNormal,
+  },
+  data() {
+    let that = this;
+    return {
+      active: true,
+      selectAll: true,
+      AnalysisName: "",
+      AnalysisUnit: "",
+      Analysis: [
+        {
+          title: "",
+          yAxisIndex: 0, // 使用单位
+          value: [],
+        },
+      ],
+      AnalysisYAxises: [
+        {
+          name: "",
+          min: "",
+          max: "",
+          unit: "",
+          position: "left",
+        },
+        {
+          name: "",
+          min: "",
+          max: "",
+          unit: "",
+          position: "right",
+        },
+      ],
+      selectValue: "60",
+      timeoptions: [
+        {
+          value: "60",
+          label: "一分钟",
+        },
+        {
+          value: "300",
+          label: "五分钟",
+        },
+        {
+          value: "600",
+          label: "十分钟",
+        },
+        {
+          value: "1800",
+          label: "三十分钟",
+        },
+        {
+          value: "3600",
+          label: "一小时",
+        },
+        {
+          value: "86400",
+          label: "一天",
+        },
+      ],
+      yssjDialog: false,
+      yssjData: {},
+      month: [],
+      wpId: "MHS_FDC",
+      wpArray: [],
+      wpName: "",
+      wtId: [],
+      wtIdArr: [],
+      wtidData: [],
+      wtIdNum: false,
+      tableDataArr: {},
+      tableData: {
+        column: [
+          {
+            name: "序号",
+            field: "index",
+            is_num: false,
+            is_light: false,
+            width: "60px",
+          },
+          {
+            name: "风机编号",
+            field: "fjbh",
+            is_num: false,
+            is_light: false,
+            width: "150px",
+          },
+          {
+            name: "预警分类",
+            field: "yjfl",
+            is_num: false,
+            is_light: false,
+            width: "300px",
+          },
+          {
+            name: "预警描述",
+            field: "yjms",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "预警次数(次)",
+            field: "yjcs",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            width: "300px",
+          },
+          {
+            name: "预警时长(分钟)",
+            field: "yjsc",
+            is_num: false,
+            is_light: false,
+            sortable: true,
+            width: "300px",
+          },
+          {
+            name: "操作",
+            field: "cz",
+            is_num: false,
+            is_light: false,
+            width: "200px",
+            template: function () {
+              return ("<el-button type='text' style='cursor: pointer;' value='config'>原始数据</el-button>&nbsp");
+            },
+            click: function (event, data) {
+              that.yssjTitle = data.yjms;
+              that.requestDetailData(
+                that.wpId,
+                data.fjbh,
+                data.yjms,
+                that.month
+              );
+            },
+          },
+        ],
+        data: [],
+      },
+    };
+  },
+  created() {
+    this.getWp();
+    this.month = [new Date(new Date() - 3600 * 1000 * 24 * 1), new Date()];
+    this.requestSafeList();
+  },
+  methods: {
+    requestDetailData(wpId, fjbh, yjms, time) {
+      let that = this;
+      that.yssjData = {
+        wpId: wpId,
+        fjbh: fjbh,
+        yjms: yjms,
+        time: time,
+      };
+      BASE.showLoading();
+      that.API.requestData({
+        method: "GET",
+        subUrl: "/analysis/detail",
+        data: {
+          station: wpId,
+          startTs: new Date(new Date(time[0]).formatDate("yyyy/MM/dd")).getTime(),
+          endTs: new Date(new Date(time[1]).formatDate("yyyy/MM/dd")).getTime(),
+          interval: that.selectValue,
+          wtId: fjbh,
+          name: yjms,
+        },
+        success(res) {
+          if (res.data.length == 1) {
+            that.yssjDialog = true;
+            BASE.closeLoading();
+            let yaxises = [
+              {
+                name: "",
+                min: 0,
+                max: null,
+                unit: "",
+                position: "left",
+              },
+            ];
+            // yaxises.name = res.data[0].name;
+            yaxises.unit = res.data[0].unit;
+            that.AnalysisYAxises = yaxises;
+            let aKey1 = ["doubleValue"];
+            let aList1 = [
+              {
+                title: "",
+                // yAxisIndex:"",
+                smooth: true,
+                value: [],
+              },
+            ];
+            aKey1.forEach((keyEle, keyIndex) => {
+              aList1[keyIndex].title = res.data[keyIndex].name;
+              res.data[keyIndex].data.forEach((rEle) => {
+                aList1[keyIndex].value.push({
+                  text: new Date(rEle.ts).formatDate("hh:mm"),
+                  value: rEle.doubleValue,
+                });
+              });
+            });
+            that.Analysis = aList1;
+          } else if (res.data.length == 2) {
+            that.yssjDialog = true;
+            BASE.closeLoading();
+            let aKey2 = ["doubleValue", "doubleValue"];
+            let aList2 = [
+              {
+                title: "",
+                //  yAxisIndex:"",
+                smooth: true,
+                value: [],
+              },
+              {
+                title: "",
+                // yAxisIndex:"",
+                smooth: true,
+                value: [],
+              },
+            ];
+            let yaxises1 = [
+              {
+                name: "",
+                min: 0,
+                max: null,
+                unit: "",
+                position: "left",
+              },
+              {
+                name: "",
+                min: 0,
+                max: null,
+                unit: "",
+                position: "right",
+              },
+            ];
+            yaxises1.forEach((aEle, aIndex) => {
+              res.data.forEach((rEle) => {
+                // aEle.name = rEle.name;
+                aEle.unit = rEle.unit;
+              });
+            });
+            that.AnalysisYAxises = yaxises1;
+            aKey2.forEach((keyEle, keyIndex) => {
+              aList2[keyIndex].title = res.data[keyIndex].name;
+              res.data[keyIndex].data.forEach((rEle) => {
+                aList2[keyIndex].value.push({
+                  text: new Date(rEle.ts).formatDate("hh:mm"),
+                  value: rEle.doubleValue,
+                });
+              });
+            });
+            that.Analysis = aList2;
+          } else if (res.data.length == 4) {
+            that.yssjDialog = true;
+            BASE.closeLoading();
+            let aKey4 = [
+              "doubleValue",
+              "doubleValue",
+              "doubleValue",
+              "doubleValue",
+            ];
+            let aList4 = [
+              {
+                title: "",
+                // yAxisIndex:"",
+                smooth: true,
+                value: [],
+              },
+              {
+                title: "",
+                // yAxisIndex:"",
+                smooth: true,
+                value: [],
+              },
+              {
+                title: "",
+                // yAxisIndex:"",
+                smooth: true,
+                value: [],
+              },
+              {
+                title: "",
+                // yAxisIndex:"",
+                smooth: true,
+                value: [],
+              },
+            ];
+            let yaxises2 = [
+              {
+                name: "",
+                min: 0,
+                max: null,
+                unit: "",
+                position: "left",
+              },
+              {
+                name: "",
+                min: 0,
+                max: null,
+                unit: "",
+                position: "right",
+              },
+            ];
+            yaxises2.forEach((aEle, aIndex) => {
+              res.data.forEach((rEle) => {
+                // aEle.name = rEle.name;
+                aEle.unit = rEle.unit;
+              });
+            });
+            that.AnalysisYAxises = yaxises2;
+            aKey4.forEach((keyEle, keyIndex) => {
+              aList4[keyIndex].title = res.data[keyIndex].name;
+              res.data[keyIndex].data.forEach((rEle) => {
+                aList4[keyIndex].value.push({
+                  text: new Date(rEle.ts).formatDate("hh:mm"),
+                  value: rEle.doubleValue,
+                });
+              });
+            });
+            that.Analysis = aList4;
+          } else if (res.data.length == 0) {
+            that.yssjDialog = false;
+            BASE.closeLoading();
+            that.BASE.showMsg({
+              type: "warning",
+              msg: "暂无数据",
+            });
+          } else {
+            BASE.closeLoading();
+            that.BASE.showMsg({
+              msg: "暂无数据",
+            });
+          }
+        },
+      });
+    },
+    queryYssj() {
+      let data = this.yssjData;
+      this.requestDetailData(data.wpId, data.fjbh, data.yjms, data.time);
+    },
+    switchChange(interval, status) {
+      if (status === "interval") {
+        this.chooseStatus = false;
+        this.selectValue = "60";
+      } else if (status === "original") {
+        this.chooseStatus = true;
+      }
+    },
+    formatDate(dates) {
+      var date = new Date(dates);
+      var YY = date.getFullYear() + "-";
+      var MM =
+        (date.getMonth() + 1 < 10
+          ? "0" + (date.getMonth() + 1)
+          : date.getMonth() + 1) + "-";
+      var DD = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
+      return YY + MM + DD;
+    },
+    // 获取风场
+    getWp() {
+      let that = this;
+      that.API.requestData({
+        baseURL: "http://10.155.32.4:8082/",
+        subUrl: "powercompare/windfarmAjax",
+        success(res) {
+          that.wpArray = res.data;
+          that.wpId = res.data[0].id;
+          that.wpName = res.data[0].wpName;
+        },
+      });
+    },
+    // 获取停机事件
+    requestSafeList() {
+      let that = this;
+      // if (wtIdData) {
+      // 	that.tableData.data = wtIdData;
+      // 	that.wtIdData = [];
+      // 	return;
+      // }
+      // if (wpId) {
+      // 	that.wpId = wpId;
+      // }
+      that.month[0] = that.formatDate(that.month[0].valueOf());
+      that.month[1] = that.formatDate(that.month[1].valueOf());
+      let data = {
+        stationid: that.wpId,
+        startdate: that.month[0].valueOf(),
+        enddate: that.month[1].valueOf(),
+      };
+      that.API.requestData({
+        showLoading: true,
+        baseURL: "http://192.168.1.18:8075/",
+        subUrl: "alarm/count/query/new",
+        data,
+        success(res) {
+          if (res.code == 200) {
+            that.tableData.data = [];
+            if (res.data.length) {
+              let data = res.data;
+              let tabData = [];
+              let index = 1;
+              let wtIdArr = [];
+              data.forEach((ele, idx) => {
+                let key = Object.keys(ele);
+                ele[key].forEach((ele2, idx2) => {
+                  if (ele2.time != 0 && ele2.count >= 10) {
+                    //过滤条件
+                    let obj = {
+                      index: index++,
+                      fjbh: ele2.windturbineId,
+                      yjfl: ele2.relatePartsText,
+                      yjms: ele2.alertText,
+                      yjcs: ele2.count,
+                      yjsc: ele2.time,
+                    };
+                    tabData.push(obj);
+                    let result = wtIdArr.some((ele4) => {
+                      return ele2.relatePartsText === ele4;
+                    });
+                    if (result == false) {
+                      wtIdArr.push(ele2.relatePartsText);
+                    }
+                  }
+                });
+              });
+              that.wtIdArr = wtIdArr;
+              that.wtId = wtIdArr;
+              that.tableData.data = tabData;
+              that.tableDataArr = {
+                column: that.tableData.column,
+                data: tabData,
+              };
+            }
+          }
+        },
+      });
+    },
+    query() {
+      this.requestSafeList();
+    },
+    checkAll() {
+      this.selectAll = !this.selectAll;
+      if (this.selectAll) {
+        this.wtId = this.wtIdArr;
+        this.active = true;
+      } else {
+        this.active = false;
+        this.wtId = [];
+      }
+    },
+    formatJson(filterVal, jsonData) {
+      return jsonData.map((v) => filterVal.map((j) => v[j]));
+    },
+    export() {
+      let that = this;
+      const { export_json_to_excel } = require("@tools/excel/Export2Excel.js"); // 注意这个Export2Excel路径
+      let tHeader = []; // 上面设置Excel的表格第一行的标题
+      let filterVal = []; // 上面的index、nickName、name是tableData里对象的属性key值
+
+      that.tableData.column.forEach((ele) => {
+        if (ele.field != "cz") {
+          tHeader.push(ele.name);
+          filterVal.push(ele.field);
+        }
+      });
+      const data = that.formatJson(filterVal, that.tableData.data);
+      export_json_to_excel(tHeader, data, "预警分析"); // 最后一个是表名字
+    },
+  },
+  watch: {
+    wpId() {
+      this.wtidData = undefined;
+      this.wtIdNum = false;
+    },
+    wtId(e) {
+      if (this.wtIdNum) {
+        let data = [];
+        let index = 1;
+        let tableDataArr = this.tableDataArr;
+        tableDataArr.data.forEach((ele) => {
+          e.forEach((ele2) => {
+            if (ele.yjfl == ele2) {
+              let obj = {
+                index: index++,
+                fjbh: ele.fjbh,
+                yjfl: ele.yjfl,
+                yjms: ele.yjms,
+                yjcs: ele.yjcs,
+                yjsc: ele.yjsc,
+              };
+              data.push(obj);
+            }
+          });
+        });
+        if (data) {
+          this.tableData.data = data;
+          // this.wtidData = data;
+        }
+      }
+      this.wtIdNum = true;
+    },
+    // month(e) {
+    // 	this.month = [new Date((e - 3600 * 1000 * 24 * 30)), e];
+    // }
+  },
+};
 </script>
 
 <style lang="less" scope>
-	@titleGray: #9ca5a8;
-	@rowGray: #606769;
-	@darkBack: #536268;
+@titleGray: #9ca5a8;
+@rowGray: #606769;
+@darkBack: #536268;
 
-	.knowledge-2 {
-		.el-select {
-			width: 200px;
-		}
+.knowledge-2 {
+  .el-select {
+    width: 200px;
+  }
 
-		.action {
-			text-decoration: underline;
-			color: @green;
-			cursor: pointer;
-		}
+  .action {
+    text-decoration: underline;
+    color: @green;
+    cursor: pointer;
+  }
 
-		.el-input {
-			width: 200px;
-		}
-	}
+  .el-input {
+    width: 200px;
+  }
+}
 </style>
 <style type="text/css">
-	.el-month-table td.today .cell {
-		color: #05bb4c;
-	}
+.el-month-table td.today .cell {
+  color: #05bb4c;
+}
 
-	.el-month-table td.end-date .cell,
-	.el-month-table td.start-date .cell {
-		background-color: #05bb4c;
-	}
+.el-month-table td.end-date .cell,
+.el-month-table td.start-date .cell {
+  background-color: #05bb4c;
+}
 
-	.el-month-table td.in-range div,
-	.el-month-table td.in-range div:hover {
-		background: rgba(96, 103, 105, 0.4);
-	}
+.el-month-table td.in-range div,
+.el-month-table td.in-range div:hover {
+  background: rgba(96, 103, 105, 0.4);
+}
 
-	.el-date-editor.el-date-editor--monthrange {
-		border: 1px solid rgba(96, 103, 105, 0.2);
-		height: 33px;
-		padding: 0 8px;
-		width: 369px;
-	}
+.el-date-editor.el-date-editor--monthrange {
+  border: 1px solid rgba(96, 103, 105, 0.2);
+  height: 33px;
+  padding: 0 8px;
+  width: 369px;
+}
 
-	.el-date-editor.el-date-editor--monthrange .el-range-separator {
-		color: #B3BDC0;
-		line-height: 33px;
-	}
+.el-date-editor.el-date-editor--monthrange .el-range-separator {
+  color: #b3bdc0;
+  line-height: 33px;
+}
 
-	.el-date-editor.el-date-editor--monthrange .el-range-input {
-		flex-basis: 145px;
-		line-height: 33px;
-		background: transparent;
-		color: #B3BDC0;
-	}
+.el-date-editor.el-date-editor--monthrange .el-range-input {
+  flex-basis: 145px;
+  line-height: 33px;
+  background: transparent;
+  color: #b3bdc0;
+}
 
-	.el-picker-panel.el-date-picker {
-		background: transparent;
-		color: #B3BDC0;
-	}
+.el-picker-panel.el-date-picker {
+  background: transparent;
+  color: #b3bdc0;
+}
 
-	.el-picker-panel.el-date-picker td.current .cell {
-		background-color: #05bb4c;
-		color: white;
-	}
+.el-picker-panel.el-date-picker td.current .cell {
+  background-color: #05bb4c;
+  color: white;
+}
 
-	.el-picker-panel.el-date-picker td .cell:hover {
-		color: #05bb4c;
-	}
+.el-picker-panel.el-date-picker td .cell:hover {
+  color: #05bb4c;
+}
 
-	.el-picker-panel.el-date-picker td.current div,
-	.el-picker-panel.el-date-picker td.current div:hover {
-		background: rgba(96, 103, 105, 0.4);
-		border-radius: 50px;
-	}
+.el-picker-panel.el-date-picker td.current div,
+.el-picker-panel.el-date-picker td.current div:hover {
+  background: rgba(96, 103, 105, 0.4);
+  border-radius: 50px;
+}
 </style>