Selaa lähdekoodia

1.E:\Hbuilder\electronic-map\src\views\sampleDatabase\fault【原故障样本库界面备份】
2.故障样本库完成
3.平罗2期标题跟到平罗1期后面
4.预警分析样本库分类筛选条件改

mw_666 3 vuotta sitten
vanhempi
commit
e6d983cd0c

+ 11 - 8
src/views/WindSite/pages/BoosterStation.vue

@@ -135,16 +135,19 @@ export default {
                 code: ele.id,
               });
             } else {
-              btnGroup[1].btns.push({
-                text: ele.name,
-                code: ele.id,
-              });
+				btnGroup[1].btns.push({
+				  text: ele.name,
+				  code: ele.id,
+				});
+				if(ele.id == 'PL_GDC'){
+					btnGroup[1].btns.push({
+					  text: '平罗二期光伏电站',
+					  code: 'PL2_GDC',
+					});
+				}
             }
           });
-			btnGroup[1].btns.push({
-			  text: '平罗二期光伏电站',
-			  code: 'PL2_GDC',
-			});
+			
 			
 			// 当点击为宋六时
 			btnGroup[0].btns.push({

+ 623 - 0
src/views/sampleDatabase/fault/index - 副本.vue

@@ -0,0 +1,623 @@
+<template>
+	<el-scrollbar height="92vh" v-if="gzCgd == 1">
+		<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="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">
+					<div class="lable">样本类型:</div>
+					<div class="search-input">
+						<el-select v-model="tableTag" placeholder="请选择样本" popper-class="select">
+							<el-option v-for="item in tableTagArr" :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-select v-model="widget" multiple collapse-tags clearable placeholder="请选择"
+							popper-class="select">
+							<el-option v-for="item in BuJian" :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-select v-model="model" multiple collapse-tags clearable placeholder="请选择"
+							popper-class="select">
+							<el-option v-for="item in fjxh" :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="query()">查询</button>
+					<button class="btn" @click="addEdit()">新增</button>
+				</div>
+			</div>
+		</div>
+		<el-row :type="'flex'" class="content">
+			<el-col :span="24">
+				<ComTable :data="tableData" :pageSize="pageSize" @onPagging="onChangePage" height="84vh"
+					v-loading="tableLoading" element-loading-text="拼命加载中"
+					element-loading-background="rgba(0, 0, 0, 0.8)"></ComTable>
+			</el-col>
+		</el-row>
+		<el-dialog :title="isvisiableType == 1 ? '新增' : '编辑'" v-model="isvisiable" width="45%" top="15vh"
+			custom-class="modal" :close-on-click-modal="false" :before-close="onClickDialogClose" class="isvisiable">
+			<!-- 这里是新增或编辑 -->
+			<el-row type="flex" class="mb10">
+				<el-col :span="12">
+					<div>样本类型:</div>
+					<el-select v-model="tableTag" placeholder="请选择样本" popper-class="select" class="w">
+						<el-option v-for="item in tableTagArr" :key="item.value" :value="item.value"
+							:label="item.label">
+						</el-option>
+					</el-select>
+				</el-col>
+				<el-col :span="12">
+					<div>风机型号:</div>
+					<el-select v-model="tableModel" placeholder="请选择风机型号" popper-class="select" class="w">
+						<el-option v-for="item in fjxh" :key="item.value" :value="item.value" :label="item.label">
+						</el-option>
+					</el-select>
+				</el-col>
+			</el-row>
+			<el-row type="flex" class="mb10">
+				<el-col :span="12">
+					<div>故障分类:</div>
+					<el-select v-model="tableFaulttype" placeholder="请选择故障" popper-class="select" class="w">
+						<el-option v-for="item in BuJian" :key="item.value" :value="item.value" :label="item.label">
+						</el-option>
+					</el-select>
+				</el-col>
+				<el-col :span="12">
+					<div>时间:</div>
+					<el-date-picker v-model="tableTime" type="datetimerange" range-separator="至"
+						start-placeholder="开始日期" end-placeholder="结束日期" class="w">
+					</el-date-picker>
+				</el-col>
+			</el-row>
+			<el-row type="flex" class="mb10">
+				<el-col :span="12">
+					<div>故障原因:</div>
+					<el-input placeholder="请输入故障原因" v-model="tableSymptom" :value="tableSymptom">
+					</el-input>
+				</el-col>
+				<el-col :span="12">
+					<div>风机厂商:</div>
+					<el-input placeholder="请输入风机厂商" v-model="tableManufacturer" :value="tableManufacturer">
+					</el-input>
+				</el-col>
+			</el-row>
+			<el-row type="flex" class="mb10">
+				<el-col :span="12">
+					<div>风机编号:</div>
+					<el-input placeholder="请输入风机编号" v-model="tableWindturbineid" :value="tableWindturbineid">
+					</el-input>
+				</el-col>
+			</el-row>
+			<el-row type="flex" justify="end">
+				<div class="query-actions" style="margin-top: 15px">
+					<button class="btn" @click="onClickDialogClose">取消</button>
+					<button class="btn" @click="dialogSave">保存</button>
+				</div>
+			</el-row>
+		</el-dialog>
+	</el-scrollbar>
+	<el-scrollbar height="92vh" v-if="gzCgd == 2">
+		<Point :data="gzCgdData" :st='st' @gzCgdClick="gzCgdClick" />
+	</el-scrollbar>
+</template>
+
+<script>
+	import ComTable from "@/components/coms/table/table.vue";
+	import Point from "./point.vue";
+	export default {
+		components: {
+			ComTable,
+			Point,
+		},
+		data() {
+			const that = this;
+			return {
+				tableTagArr: [{
+						label: '正样本',
+						value: 0
+					},
+					{
+						label: '负样本',
+						value: 1
+					}
+				],
+				queryType: false, //没有改变select时,点击查询无效
+				pageIndex: 1,
+				pageSize: 20,
+				gzCgd: 1, //传感点组件隐藏或显示
+				gzCgdData: [], //传感点参数
+				st:'',
+				BuJian: [],
+				ChangZhan: [],
+				fjxh: [],
+				fjxhArr: [],
+				widget: [],
+				model: [],
+				time: [],
+				station: '',
+				tableFaulttype: "",
+				tableTag: "",
+				tableModel: "",
+				tableTime: "",
+				tableSymptom: "",
+				tableManufacturer: "",
+				tableWindturbineid: "",
+				tableCategory: "", //隐藏保存部分
+				tableRemark: "",
+				tableFaultcode: "",
+				tableId: "",
+				tableSymptomcode: "",
+				tableStationen: "",
+				isvisiable: false,
+				isvisiableType: 1, //新增为1,编辑为2
+				tableData: {
+					column: [{
+							name: "序号",
+							field: "index",
+							is_light: false,
+							width: '50px',
+						},
+						{
+							name: "样本类型",
+							field: "tableTag",
+							is_light: false,
+							width: '100px',
+						},
+						{
+							name: "风机编号",
+							field: "tableWindturbineid",
+							is_light: false,
+							width: '150px',
+						},
+						{
+							name: "故障分类",
+							field: "tableFaulttype",
+							is_light: false,
+							width: '150px',
+						},
+						{
+							name: "故障原因",
+							field: "tableSymptom",
+							is_light: false,
+							width: '350px',
+						},
+						{
+							name: "时间",
+							field: "tableTime",
+							is_light: false,
+							width: '350px',
+						},
+						{
+							name: "风机厂商",
+							field: "tableManufacturer",
+							is_light: false,
+							width: '150px',
+						},
+						{
+							name: "风机型号",
+							field: "tableModel",
+							is_light: false,
+							width: '150px',
+						},
+						{
+							name: "操作",
+							is_light: false,
+							width: '200px',
+							template: () => {
+								return (
+									"<el-button type='text' style='cursor: pointer;' value='edit'>编辑</el-button>&nbsp" +
+									"<el-button type='text' style='cursor: pointer;' value='delete'>删除</el-button>&nbsp" +
+									"<el-button type='text' style='cursor: pointer;' value='config'>传感点</el-button>&nbsp"
+								);
+							},
+							click(e, row) {
+								that.onClickOption(e, row);
+							},
+						},
+					],
+					data: [],
+				}
+			};
+		},
+		methods: {
+			getTable() {
+				let that = this;
+				this.tableLoading = true;
+				that.API.requestData({
+					method: "GET",
+					baseURL: "http://192.168.10.4:9002/",
+					subUrl: "benchmarking/wplist",
+					data: {
+						wpId: that.stationId,
+						startTs: that.startDate,
+						endTs: that.endDate,
+						pageNum: that.pageIndex,
+						pageSize: that.pageSize,
+					},
+					success(res) {
+						var dataTab = [];
+						if (res.data) {
+							res.data.list.forEach(item => {
+								dataTab.push({ //表格
+									recodedata: that.formatTime(item.recodedata),
+									region: item.region,
+								})
+							})
+							that.tableData.data = dataTab;
+							that.tableData.total = res.data.total;
+						} else {
+							that.tableData.data = [];
+							that.tableData.total = 0;
+						}
+						that.tableLoading = false;
+					},
+				});
+			},
+			onChangePage(params) {
+				this.pageIndex = params.pageIndex;
+				this.pageSize = params.pageSize;
+				this.getTable();
+			},
+			startAjax() {
+				var that = this;
+				// that.time = [new Date((new Date() - 3600 * 1000 * 24 * 30)).formatDate("yyyy-MM-dd"), new Date().formatDate("yyyy-MM-dd")];
+				that.time = [new Date((new Date() - 3600 * 1000 * 24 * 360)).formatDate("yyyy-MM-dd"), new Date()
+					.formatDate("yyyy-MM-dd")
+				];
+				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
+						that.station = res.data[1].name
+					},
+				});
+
+				that.API.requestData({
+					method: "GET",
+					baseURL: "http://192.168.1.18:9002/",
+					subUrl: "basic/widget/condition",
+					success(res) {
+						let keys = Object.keys(res.data[0]);
+						let bujian = [],
+							widget = [];
+						keys.forEach((ele, index) => {
+							bujian.push({
+								label: res.data[0].ele,
+								value: ele
+							})
+							widget.push(ele)
+						})
+
+						that.widget = widget;
+						that.BuJian = bujian;
+					},
+				});
+
+				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;
+					},
+				});
+			},
+			query() {
+				if (this.queryType) {
+					this.list();
+				}
+			},
+			addEdit() {
+				this.isvisiableType = 1;
+				this.tableFaulttype = '';
+				this.tableModel = '';
+				this.tableTime = '';
+				this.tableSymptom = '';
+				this.tableManufacturer = '';
+				this.tableWindturbineid = '';
+
+				// this.tableCategory: data[i].category,
+				// this.tableRemark: data[i].remark,
+				// this.tableFaultcode: data[i].faultcode,
+				// this.tableId: data[i].id,
+				// this.tableSymptomcode:data[i].Symptomcode,
+				// this.tableStationen:data[i].stationen
+
+				this.isvisiable = true;
+			},
+			onClickOption(e, row) { // 操作按钮
+				let that = this;
+				if ("delete" == e.target.getAttribute("value")) {
+					that
+						.$confirm("确认删除此条样本数据?", "提示", {
+							confirmButtonText: "删除",
+							cancelButtonText: "取消"
+						})
+						.then((_) => {
+							console.log('ok')
+							// that.requestDelete(row);
+						})
+						.catch((_) => {});
+				}
+				if ("edit" == e.target.getAttribute("value")) {
+					that.isvisiableType = 2;
+					that.$nextTick(() => {
+						let tableTime = row.tableTime.split(" - ");
+						that.tableTag = row.tableTag;
+						that.BuJian.forEach(ele => {
+							if (ele.value == row.tableFaultcode) {
+								that.tableFaulttype = ele.label
+							}
+						})
+						that.tableModel = row.tableModel;
+						that.tableTime = [Date.parse(new Date(tableTime[0])), Date.parse(new Date(tableTime[1]))];
+						that.tableSymptom = row.tableSymptom;
+						that.tableManufacturer = row.tableManufacturer;
+						that.tableWindturbineid = row.tableWindturbineid;
+
+						that.tableCategory = row.tableCategory;
+						that.tableRemark = row.tableRemark;
+						that.tableFaultcode = row.tableFaultcode;
+						that.tableId = row.tableId;
+						that.tableSymptomcode = row.tableSymptomcode;
+						that.tableStationen = row.tableStationen;
+					});
+					that.isvisiable = true;
+				}
+				if ("config" == e.target.getAttribute("value")) { //传感点
+					that.API.requestData({
+						method: "GET",
+						baseURL: "http://192.168.1.18:9002/",
+						subUrl: "point/all",
+						data: {
+							wtId: row.tableWindturbineid,
+							widget: row.tableFaultcode
+						},
+						success(res) {
+							console.log(res)
+							if (res.code == 200) {
+								that.gzCgdData = res.data;
+								that.st = Date.parse(new Date(row.tableTime.split(" - ")[0]));
+								that.gzCgd = 2;
+							}
+						},
+					});
+				}
+			},
+			onClickDialogClose() { // 弹窗右上角关闭按钮
+				this.isvisiable = false;
+				this.isvisiableType = 1;
+			},
+			dialogSave() {
+				let that = this;
+				that.tableTime[0] = that.formatDate(that.tableTime[0].valueOf());
+				that.tableTime[1] = that.formatDate(that.tableTime[1].valueOf());
+				console.log(that.tableTime)
+				that.API.requestData({
+					method: "POST",
+					baseURL: "http://192.168.1.18:9002/",
+					headers: {
+						'Content-Type': 'application/json;charset=utf-8',
+					},
+					subUrl: "case/item/edit",
+					body: {
+						category: that.tableCategory,
+						endtime: that.tableTime[1],
+						faultcode: that.tableFaultcode,
+						faulttype: that.tableFaulttype,
+						id: that.tableId,
+						manufacturer: that.tableManufacturer,
+						model: that.tableModel,
+						remark: that.tableRemark,
+						starttime: that.tableTime[0],
+						stationen: that.tableStationen,
+						symptom: that.tableSymptom,
+						symptomcode: that.tableSymptomcode,
+						tag: that.tableTag == "正样本" ? 0 : 1,
+						windturbineid: that.tableWindturbineid
+					},
+					success(res) {
+						if (res.code == 200) {
+							that.BASE.showMsg({
+								type: "success",
+								msg: "保存成功",
+							});
+							that.onClickDialogClose();
+							that.list();
+						}
+					},
+				});
+			},
+			gzCgdClick(data) {
+				this.gzCgd = data;
+			},
+			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());
+				var hh = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+				var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
+				var ss = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
+				return YY + MM + DD + " " + hh + mm + ss;
+			},
+			list() {
+				var that = this;
+				let station = '',
+					widget = ''
+				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
+						}
+					})
+				}
+				if (typeof that.widget.valueOf() == 'string') {
+					that.BuJian.forEach(ele => {
+						if (ele.label == that.widget) {
+							widget = ele.value
+						}
+					})
+				}
+				if (that.model.length == 0) {
+					that.BASE.showMsg({
+						type: "warning",
+						msg: "请选择风机型号",
+					});
+					return
+				}
+				if (that.widget.length == 0) {
+					that.BASE.showMsg({
+						type: "warning",
+						msg: "请选择部件",
+					});
+					return
+				}
+				that.API.requestData({
+					showLoading: true,
+					method: "GET",
+					baseURL: "http://192.168.1.18:9002/",
+					subUrl: "case/fault/all",
+					data: {
+						widget: widget ? widget : that.widget,
+						station: station ? station : that.station,
+						model: that.model,
+						st: that.time[0].valueOf(),
+						et: that.time[1].valueOf()
+					},
+					success(res) {
+						if (res.code == 200) {
+							console.log(res)
+							that.tableData.data = [];
+							if (res.data.length) {
+								let data = res.data;
+								for (var i = 0; i < data.length; i++) {
+									let obj = {
+										index: i + 1,
+										tableTag: data[i].tag == 0 ? '正样本' : '负样本',
+										tableFaulttype: data[i].faulttype,
+										tableModel: data[i].model,
+										tableTime: data[i].starttime + ' - ' + data[i].endtime,
+										tableSymptom: data[i].symptom,
+										tableManufacturer: data[i].manufacturer,
+										tableWindturbineid: data[i].windturbineid,
+
+										tableCategory: data[i].category,
+										tableRemark: data[i].remark,
+										tableFaultcode: data[i].faultcode,
+										tableId: data[i].id,
+										tableSymptomcode: data[i].symptomcode,
+										tableStationen: data[i].stationen
+									};
+									that.tableData.data.push(obj);
+								}
+							}
+						}
+					},
+				});
+			},
+		},
+		created() {
+			let that = this;
+			that.startAjax();
+			setTimeout(function() {
+				that.list()
+			}, 500)
+		},
+		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;
+				this.queryType = true;
+			},
+			widget() {
+				this.queryType = true;
+			},
+			model() {
+				this.queryType = true;
+			},
+			time() {
+				this.queryType = true;
+			},
+		},
+	};
+</script>
+
+<style lang="less" scoped>
+	.mb10 {
+		margin-bottom: 10px;
+	}
+
+	.el-select.w {
+		width: 100%;
+	}
+
+	// .el-range-editor.w{width: 100%;}
+</style>

+ 209 - 330
src/views/sampleDatabase/fault/index.vue

@@ -1,42 +1,44 @@
 <template>
-	<el-scrollbar height="92vh" v-if="gzCgd == 1">
+	<el-scrollbar height="92vh">
 		<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="station" placeholder="请选择" popper-class="select">
-							<el-option v-for="item in ChangZhan" :key="item.id" :value="item.id" :label="item.name">
-							</el-option>
+							<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">
-					<div class="lable">样本类型:</div>
+					<div class="lable">故障类型:</div>
 					<div class="search-input">
-						<el-select v-model="tableTag" placeholder="请选择样本" popper-class="select">
-							<el-option v-for="item in tableTagArr" :key="item.value" :value="item.value" :label="item.label">
+						<el-select v-model="widget" multiple collapse-tags clearable placeholder="请选择" popper-class="select">
+							<el-row>
+								<div class="query-actions" style="margin-left: 15px;">
+									<button class="btn" :class="active?'green':''" @click="checkAll">全选</button>
+								</div>
+							</el-row>
+							<el-option v-for="item in widgetArr" :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="lable">风机型号:</div>
 					<div class="search-input">
-						<el-select v-model="widget" multiple collapse-tags clearable placeholder="请选择"
-							popper-class="select">
-							<el-option v-for="item in BuJian" :key="item.value" :value="item.value" :label="item.label">
+						<el-select v-model="model" multiple collapse-tags clearable placeholder="请选择" popper-class="select">
+							<el-option v-for="item in fjxh" :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="lable">模型:</div>
 					<div class="search-input">
-						<el-select v-model="model" multiple collapse-tags clearable placeholder="请选择"
-							popper-class="select">
-							<el-option v-for="item in fjxh" :key="item.value" :value="item.value" :label="item.label">
-							</el-option>
+						<el-select v-model="mx" collapse-tags clearable placeholder="请选择" popper-class="select">
+							<el-option key="1" value="list" label="模型1"></el-option>
+							<el-option key="2" value="alg" label="模型2"></el-option>
 						</el-select>
 					</div>
 				</div>
@@ -49,83 +51,24 @@
 					</div>
 				</div>
 				<div class="query-actions">
-					<button class="btn" @click="query()">查询</button>
-					<button class="btn" @click="addEdit()">新增</button>
+					<button class="btn" @click="list">查询</button>
+					<button class="btn" @click="query()">导入</button>
+					<button class="btn" @click="export">导出</button>
 				</div>
 			</div>
 		</div>
 		<el-row :type="'flex'" class="content">
-			<el-col :span="24">
-				<ComTable :data="tableData" :pageSize="pageSize" @onPagging="onChangePage" height="84vh"
-					v-loading="tableLoading" element-loading-text="拼命加载中"
-					element-loading-background="rgba(0, 0, 0, 0.8)"></ComTable>
-			</el-col>
+			<ComTable :data="tableData" :pageSize="pageSize" @onPagging="onChangePage" height="84vh"
+				v-loading="tableLoading" element-loading-text="拼命加载中"
+				element-loading-background="rgba(0, 0, 0, 0.8)" v-if="mx=='list'"></ComTable>
+			<ComTable :data="tableData2" :pageSize="pageSize" @onPagging="onChangePage" height="84vh"
+				v-loading="tableLoading" element-loading-text="拼命加载中"
+				element-loading-background="rgba(0, 0, 0, 0.8)" v-else></ComTable>	
 		</el-row>
-		<el-dialog :title="isvisiableType == 1 ? '新增' : '编辑'" v-model="isvisiable" width="45%" top="15vh"
-			custom-class="modal" :close-on-click-modal="false" :before-close="onClickDialogClose" class="isvisiable">
-			<!-- 这里是新增或编辑 -->
-			<el-row type="flex" class="mb10">
-				<el-col :span="12">
-					<div>样本类型:</div>
-					<el-select v-model="tableTag" placeholder="请选择样本" popper-class="select" class="w">
-						<el-option v-for="item in tableTagArr" :key="item.value" :value="item.value"
-							:label="item.label">
-						</el-option>
-					</el-select>
-				</el-col>
-				<el-col :span="12">
-					<div>风机型号:</div>
-					<el-select v-model="tableModel" placeholder="请选择风机型号" popper-class="select" class="w">
-						<el-option v-for="item in fjxh" :key="item.value" :value="item.value" :label="item.label">
-						</el-option>
-					</el-select>
-				</el-col>
-			</el-row>
-			<el-row type="flex" class="mb10">
-				<el-col :span="12">
-					<div>故障分类:</div>
-					<el-select v-model="tableFaulttype" placeholder="请选择故障" popper-class="select" class="w">
-						<el-option v-for="item in BuJian" :key="item.value" :value="item.value" :label="item.label">
-						</el-option>
-					</el-select>
-				</el-col>
-				<el-col :span="12">
-					<div>时间:</div>
-					<el-date-picker v-model="tableTime" type="datetimerange" range-separator="至"
-						start-placeholder="开始日期" end-placeholder="结束日期" class="w">
-					</el-date-picker>
-				</el-col>
-			</el-row>
-			<el-row type="flex" class="mb10">
-				<el-col :span="12">
-					<div>故障原因:</div>
-					<el-input placeholder="请输入故障原因" v-model="tableSymptom" :value="tableSymptom">
-					</el-input>
-				</el-col>
-				<el-col :span="12">
-					<div>风机厂商:</div>
-					<el-input placeholder="请输入风机厂商" v-model="tableManufacturer" :value="tableManufacturer">
-					</el-input>
-				</el-col>
-			</el-row>
-			<el-row type="flex" class="mb10">
-				<el-col :span="12">
-					<div>风机编号:</div>
-					<el-input placeholder="请输入风机编号" v-model="tableWindturbineid" :value="tableWindturbineid">
-					</el-input>
-				</el-col>
-			</el-row>
-			<el-row type="flex" justify="end">
-				<div class="query-actions" style="margin-top: 15px">
-					<button class="btn" @click="onClickDialogClose">取消</button>
-					<button class="btn" @click="dialogSave">保存</button>
-				</div>
-			</el-row>
+		<el-dialog title="原始数据对比" v-model="gzCgd" width="80%" top="5vh" custom-class="modal" :close-on-click-modal="false" :before-close="onClickDialogClose" class="isvisiable">
+			<Point :data="gzCgdData" :st='st' v-if='gzCgd'/>
 		</el-dialog>
 	</el-scrollbar>
-	<el-scrollbar height="92vh" v-if="gzCgd == 2">
-		<Point :data="gzCgdData" :st='st' @gzCgdClick="gzCgdClick" />
-	</el-scrollbar>
 </template>
 
 <script>
@@ -139,44 +82,24 @@
 		data() {
 			const that = this;
 			return {
-				tableTagArr: [{
-						label: '正样本',
-						value: 0
-					},
-					{
-						label: '负样本',
-						value: 1
-					}
-				],
-				queryType: false, //没有改变select时,点击查询无效
+				keyNum:0,
+				active: true,
+				selectAll: true,
+				
 				pageIndex: 1,
 				pageSize: 20,
-				gzCgd: 1, //传感点组件隐藏或显示
+				gzCgd: false, //传感点组件隐藏或显示
 				gzCgdData: [], //传感点参数
 				st:'',
-				BuJian: [],
+				widgetArr: [],
 				ChangZhan: [],
 				fjxh: [],
 				fjxhArr: [],
 				widget: [],
 				model: [],
+				mx:'list',
 				time: [],
 				station: '',
-				tableFaulttype: "",
-				tableTag: "",
-				tableModel: "",
-				tableTime: "",
-				tableSymptom: "",
-				tableManufacturer: "",
-				tableWindturbineid: "",
-				tableCategory: "", //隐藏保存部分
-				tableRemark: "",
-				tableFaultcode: "",
-				tableId: "",
-				tableSymptomcode: "",
-				tableStationen: "",
-				isvisiable: false,
-				isvisiableType: 1, //新增为1,编辑为2
 				tableData: {
 					column: [{
 							name: "序号",
@@ -185,55 +108,96 @@
 							width: '50px',
 						},
 						{
-							name: "样本类型",
+							name: "风机编号",
+							field: "wtId",
+							is_light: false,
+							width: '150px',
+						},
+						{
+							name: "故障类型",
 							field: "tableTag",
 							is_light: false,
 							width: '100px',
 						},
 						{
-							name: "风机编号",
-							field: "tableWindturbineid",
+							name: "时间",
+							field: "tableTime",
+							is_light: false,
+							width: '350px',
+						},
+						{
+							name: "风机型号",
+							field: "tableModel",
 							is_light: false,
 							width: '150px',
 						},
 						{
-							name: "故障分类",
-							field: "tableFaulttype",
+							name: "厂商",
+							field: "tableManufacturer",
 							is_light: false,
 							width: '150px',
 						},
 						{
-							name: "故障原因",
-							field: "tableSymptom",
+							name: "操作",
+							field: "cz",
 							is_light: false,
-							width: '350px',
+							width: '200px',
+							template: () => {
+								return (
+									"<el-button type='text' style='cursor: pointer;' value='config'>传感点</el-button>&nbsp"
+								);
+							},
+							click(e, row) {
+								that.onClickOption(e, row);
+							},
+						},
+					],
+					data: [],
+				},
+				tableData2: {
+					column: [{
+							name: "序号",
+							field: "index",
+							is_light: false,
+							width: '50px',
 						},
 						{
-							name: "时间",
-							field: "tableTime",
+							name: "风机编号",
+							field: "wtId",
+							is_light: false,
+							width: '150px',
+						},
+						{
+							name: "故障描述",
+							field: "alertText",
+							is_light: false,
+							width: '100px',
+						},
+						{
+							name: "风机型号",
+							field: "modelId",
 							is_light: false,
 							width: '350px',
 						},
 						{
-							name: "风机厂商",
-							field: "tableManufacturer",
+							name: "故障时间",
+							field: "faultTime",
 							is_light: false,
 							width: '150px',
 						},
 						{
-							name: "风机型号",
-							field: "tableModel",
+							name: "故障解除时间",
+							field: "lastUpdateTime",
 							is_light: false,
 							width: '150px',
 						},
 						{
 							name: "操作",
+							field: "cz",
 							is_light: false,
 							width: '200px',
 							template: () => {
 								return (
-									"<el-button type='text' style='cursor: pointer;' value='edit'>编辑</el-button>&nbsp" +
-									"<el-button type='text' style='cursor: pointer;' value='delete'>删除</el-button>&nbsp" +
 									"<el-button type='text' style='cursor: pointer;' value='config'>传感点</el-button>&nbsp"
 								);
 							},
@@ -243,87 +207,64 @@
 						},
 					],
 					data: [],
-				}
+				},
 			};
 		},
 		methods: {
-			getTable() {
-				let that = this;
-				this.tableLoading = true;
-				that.API.requestData({
-					method: "GET",
-					baseURL: "http://192.168.10.4:9002/",
-					subUrl: "benchmarking/wplist",
-					data: {
-						wpId: that.stationId,
-						startTs: that.startDate,
-						endTs: that.endDate,
-						pageNum: that.pageIndex,
-						pageSize: that.pageSize,
-					},
-					success(res) {
-						var dataTab = [];
-						if (res.data) {
-							res.data.list.forEach(item => {
-								dataTab.push({ //表格
-									recodedata: that.formatTime(item.recodedata),
-									region: item.region,
-								})
-							})
-							that.tableData.data = dataTab;
-							that.tableData.total = res.data.total;
-						} else {
-							that.tableData.data = [];
-							that.tableData.total = 0;
-						}
-						that.tableLoading = false;
-					},
-				});
+			checkAll() {
+				this.selectAll = !this.selectAll
+				if (this.selectAll) {
+					let widget = [];
+					this.widgetArr.forEach(ele=>{
+						widget.push(ele.value)
+					})
+					this.widget = widget;
+					this.active = true;
+				} else {
+					this.active = false;
+					this.widget = [];
+				}
 			},
 			onChangePage(params) {
 				this.pageIndex = params.pageIndex;
 				this.pageSize = params.pageSize;
-				this.getTable();
+				this.list();
 			},
-			startAjax() {
+			async startAjax() {
 				var that = this;
-				// that.time = [new Date((new Date() - 3600 * 1000 * 24 * 30)).formatDate("yyyy-MM-dd"), new Date().formatDate("yyyy-MM-dd")];
-				that.time = [new Date((new Date() - 3600 * 1000 * 24 * 360)).formatDate("yyyy-MM-dd"), new Date()
-					.formatDate("yyyy-MM-dd")
+				that.time = [new Date((new Date() - 3600 * 1000 * 24 * 360)).formatDate("yyyy-MM-dd hh:mm:ss"), new Date()
+					.formatDate("yyyy-MM-dd hh:mm:ss")
 				];
-				that.API.requestData({
+				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
 						that.station = res.data[1].name
 					},
 				});
 
-				that.API.requestData({
+				await that.API.requestData({
 					method: "GET",
 					baseURL: "http://192.168.1.18:9002/",
 					subUrl: "basic/widget/condition",
 					success(res) {
-						let keys = Object.keys(res.data[0]);
-						let bujian = [],
+						let widgetArr = [],
 							widget = [];
-						keys.forEach((ele, index) => {
-							bujian.push({
-								label: res.data[0].ele,
-								value: ele
+						res.data.forEach((ele, index) => {
+							widgetArr.push({
+								label: ele.faulttype,
+								value: ele.faultcode
 							})
-							widget.push(ele)
+							widget.push(ele.faultcode)
 						})
-
 						that.widget = widget;
-						that.BuJian = bujian;
+						that.widgetArr = widgetArr;
 					},
 				});
 
-				that.API.requestData({
+				await that.API.requestData({
 					method: "GET",
 					baseURL: "http://192.168.1.18:9002/",
 					subUrl: "basic/station/all",
@@ -351,135 +292,42 @@
 						that.fjxh = fjxh;
 					},
 				});
-			},
-			query() {
-				if (this.queryType) {
-					this.list();
-				}
-			},
-			addEdit() {
-				this.isvisiableType = 1;
-				this.tableFaulttype = '';
-				this.tableModel = '';
-				this.tableTime = '';
-				this.tableSymptom = '';
-				this.tableManufacturer = '';
-				this.tableWindturbineid = '';
-
-				// this.tableCategory: data[i].category,
-				// this.tableRemark: data[i].remark,
-				// this.tableFaultcode: data[i].faultcode,
-				// this.tableId: data[i].id,
-				// this.tableSymptomcode:data[i].Symptomcode,
-				// this.tableStationen:data[i].stationen
-
-				this.isvisiable = true;
+				that.list()
 			},
 			onClickOption(e, row) { // 操作按钮
 				let that = this;
-				if ("delete" == e.target.getAttribute("value")) {
-					that
-						.$confirm("确认删除此条样本数据?", "提示", {
-							confirmButtonText: "删除",
-							cancelButtonText: "取消"
-						})
-						.then((_) => {
-							console.log('ok')
-							// that.requestDelete(row);
-						})
-						.catch((_) => {});
-				}
-				if ("edit" == e.target.getAttribute("value")) {
-					that.isvisiableType = 2;
-					that.$nextTick(() => {
-						let tableTime = row.tableTime.split(" - ");
-						that.tableTag = row.tableTag;
-						that.BuJian.forEach(ele => {
-							if (ele.value == row.tableFaultcode) {
-								that.tableFaulttype = ele.label
-							}
-						})
-						that.tableModel = row.tableModel;
-						that.tableTime = [Date.parse(new Date(tableTime[0])), Date.parse(new Date(tableTime[1]))];
-						that.tableSymptom = row.tableSymptom;
-						that.tableManufacturer = row.tableManufacturer;
-						that.tableWindturbineid = row.tableWindturbineid;
-
-						that.tableCategory = row.tableCategory;
-						that.tableRemark = row.tableRemark;
-						that.tableFaultcode = row.tableFaultcode;
-						that.tableId = row.tableId;
-						that.tableSymptomcode = row.tableSymptomcode;
-						that.tableStationen = row.tableStationen;
-					});
-					that.isvisiable = true;
-				}
 				if ("config" == e.target.getAttribute("value")) { //传感点
 					that.API.requestData({
 						method: "GET",
 						baseURL: "http://192.168.1.18:9002/",
-						subUrl: "point/all",
+						subUrl: "point/list",
 						data: {
-							wtId: row.tableWindturbineid,
-							widget: row.tableFaultcode
+							wtId: row.wtId,
+							widget: row.widget
 						},
 						success(res) {
-							console.log(res)
 							if (res.code == 200) {
-								that.gzCgdData = res.data;
-								that.st = Date.parse(new Date(row.tableTime.split(" - ")[0]));
-								that.gzCgd = 2;
+								if(res.data.length){
+									that.gzCgdData = res.data;
+									if(that.mx == 'list'){
+										that.st = Date.parse(new Date(row.tableTime.split(" - ")[0]));
+									}else{
+										that.st = Date.parse(new Date(row.faultTime));
+									}
+									that.gzCgd = true;
+								}else{
+									that.BASE.showMsg({
+										msg: "暂无数据"
+									});
+								}
 							}
 						},
 					});
 				}
 			},
 			onClickDialogClose() { // 弹窗右上角关闭按钮
-				this.isvisiable = false;
-				this.isvisiableType = 1;
-			},
-			dialogSave() {
-				let that = this;
-				that.tableTime[0] = that.formatDate(that.tableTime[0].valueOf());
-				that.tableTime[1] = that.formatDate(that.tableTime[1].valueOf());
-				console.log(that.tableTime)
-				that.API.requestData({
-					method: "POST",
-					baseURL: "http://192.168.1.18:9002/",
-					headers: {
-						'Content-Type': 'application/json;charset=utf-8',
-					},
-					subUrl: "case/item/edit",
-					body: {
-						category: that.tableCategory,
-						endtime: that.tableTime[1],
-						faultcode: that.tableFaultcode,
-						faulttype: that.tableFaulttype,
-						id: that.tableId,
-						manufacturer: that.tableManufacturer,
-						model: that.tableModel,
-						remark: that.tableRemark,
-						starttime: that.tableTime[0],
-						stationen: that.tableStationen,
-						symptom: that.tableSymptom,
-						symptomcode: that.tableSymptomcode,
-						tag: that.tableTag == "正样本" ? 0 : 1,
-						windturbineid: that.tableWindturbineid
-					},
-					success(res) {
-						if (res.code == 200) {
-							that.BASE.showMsg({
-								type: "success",
-								msg: "保存成功",
-							});
-							that.onClickDialogClose();
-							that.list();
-						}
-					},
-				});
-			},
-			gzCgdClick(data) {
-				this.gzCgd = data;
+				++this.keyNum;
+				this.gzCgd = false;
 			},
 			formatDate(dates) {
 				var date = new Date(dates);
@@ -509,13 +357,13 @@
 					})
 				}
 				if (typeof that.widget.valueOf() == 'string') {
-					that.BuJian.forEach(ele => {
+					that.widgetArr.forEach(ele => {
 						if (ele.label == that.widget) {
 							widget = ele.value
 						}
 					})
 				}
-				if (that.model.length == 0) {
+				if (that.model.length== 0) {
 					that.BASE.showMsg({
 						type: "warning",
 						msg: "请选择风机型号",
@@ -533,7 +381,7 @@
 					showLoading: true,
 					method: "GET",
 					baseURL: "http://192.168.1.18:9002/",
-					subUrl: "case/fault/all",
+					subUrl: "case/" + (that.mx=='list'?'fault/list':'faultalg/list'),
 					data: {
 						widget: widget ? widget : that.widget,
 						station: station ? station : that.station,
@@ -543,42 +391,80 @@
 					},
 					success(res) {
 						if (res.code == 200) {
-							console.log(res)
-							that.tableData.data = [];
+							// if (res.data) {
+							// 	res.data.list.forEach(item => {
+							// 		dataTab.push({ //表格
+							// 			recodedata: that.formatTime(item.recodedata),
+							// 			region: item.region,
+							// 		})
+							// 	})
+							// 	that.tableData.data = dataTab;
+							// 	that.tableData.total = res.data.total;
+							// } else {
+							// 	that.tableData.data = [];
+							// 	that.tableData.total = 0;
+							// }
+							// that.tableLoading = false;
+							
+							
 							if (res.data.length) {
 								let data = res.data;
-								for (var i = 0; i < data.length; i++) {
-									let obj = {
-										index: i + 1,
-										tableTag: data[i].tag == 0 ? '正样本' : '负样本',
-										tableFaulttype: data[i].faulttype,
-										tableModel: data[i].model,
-										tableTime: data[i].starttime + ' - ' + data[i].endtime,
-										tableSymptom: data[i].symptom,
-										tableManufacturer: data[i].manufacturer,
-										tableWindturbineid: data[i].windturbineid,
-
-										tableCategory: data[i].category,
-										tableRemark: data[i].remark,
-										tableFaultcode: data[i].faultcode,
-										tableId: data[i].id,
-										tableSymptomcode: data[i].symptomcode,
-										tableStationen: data[i].stationen
-									};
-									that.tableData.data.push(obj);
+								if(that.mx == 'list'){
+									that.tableData.data = [];
+									for (var i = 0; i < data.length; i++) {
+											let obj = {
+												index: i + 1,
+												tableTag: data[i].faulttype,
+												tableModel: data[i].model,
+												tableTime: data[i].starttime + ' - ' + data[i].endtime,
+												tableManufacturer: data[i].manufacturer,
+												wtId: data[i].windturbineid,
+												widget:data[i].faultcode
+											};
+											that.tableData.data.push(obj);
+										}
+								}else{
+									that.tableData2.data = [];
+									for (var i = 0; i < data.length; i++) {
+										let obj = {
+											index: i + 1,
+											wtId: data[i].windturbineId,
+											alertText: data[i].alertText,
+											modelId: data[i].modelId,
+											faultTime: data[i].faultTime,
+											lastUpdateTime: data[i].lastUpdateTime,
+											widget:data[i].labels
+										};
+										that.tableData2.data.push(obj);
+									}
 								}
+								
 							}
 						}
 					},
 				});
 			},
+			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, '故障样本库'); // 最后一个是表名字
+			},
 		},
 		created() {
-			let that = this;
-			that.startAjax();
-			setTimeout(function() {
-				that.list()
-			}, 500)
+			this.startAjax();
 		},
 		watch: {
 			station(res) {
@@ -595,17 +481,10 @@
 					}
 				})
 				this.fjxh = fjxh;
-				this.queryType = true;
-			},
-			widget() {
-				this.queryType = true;
-			},
-			model() {
-				this.queryType = true;
-			},
-			time() {
-				this.queryType = true;
 			},
+			mx(){
+				this.list();
+			}
 		},
 	};
 </script>

+ 799 - 0
src/views/sampleDatabase/fault/point - 副本.vue

@@ -0,0 +1,799 @@
+<template>
+	<el-row type="flex">
+		<div class="query-actions">
+			<button class="btn" @click="addEdit">新增</button>
+			<button class="btn" @click="dbfx">原始数据对标</button>
+			<button class="btn" @click="back">返回</button>
+		</div>
+	</el-row>
+	<el-row :type="'flex'" class="content">
+		<el-col :span="24">
+			<ComTable :data="tableData" :pageSize="pageSize" @onPagging="onChangePage" height="84vh"
+				v-loading="tableLoading" ref="curRef" element-loading-text="拼命加载中"
+				element-loading-background="rgba(0, 0, 0, 0.8)"></ComTable>
+		</el-col>
+	</el-row>
+		
+		
+	<el-dialog :title="isvisiableType == 1 ? '新增' : '编辑'" v-model="isvisiable" width="45%" top="15vh"
+		custom-class="modal" :close-on-click-modal="false" :before-close="onClickDialogClose" class="isvisiable">
+		<!-- 这里是新增或编辑 -->
+		<el-row type="flex" class="mb10">
+			<el-col :span="12">
+				<div>样本类型:</div>
+				<el-select v-model="widget" placeholder="请选择样本" popper-class="select" class="w">
+					<el-option v-for="item in widgetArr" :key="item.value" :value="item.value"
+						:label="item.label">
+					</el-option>
+				</el-select>
+			</el-col>
+			<el-col :span="12">
+				<div>风机型号:</div>
+				<el-select v-model="tableModel" placeholder="请选择风机型号" popper-class="select" class="w">
+					<el-option v-for="item in fjxh" :key="item.value" :value="item.value" :label="item.label">
+					</el-option>
+				</el-select>
+			</el-col>
+		</el-row>
+		<el-row type="flex" class="mb10">
+			<el-col :span="12">
+				<div>故障分类:</div>
+				<el-select v-model="windturbinename" placeholder="请选择故障" popper-class="select" class="w">
+					<el-option v-for="item in BuJian" :key="item.value" :value="item.value" :label="item.label">
+					</el-option>
+				</el-select>
+			</el-col>
+			<el-col :span="12">
+				<div>时间:</div>
+				<el-date-picker v-model="tableTime" type="datetimerange" range-separator="至"
+					start-placeholder="开始日期" end-placeholder="结束日期" class="w">
+				</el-date-picker>
+			</el-col>
+		</el-row>
+		<el-row type="flex" class="mb10">
+			<el-col :span="12">
+				<div>故障原因:</div>
+				<el-input placeholder="请输入故障原因" v-model="tableSymptom" :value="tableSymptom">
+				</el-input>
+			</el-col>
+			<el-col :span="12">
+				<div>风机厂商:</div>
+				<el-input placeholder="请输入风机厂商" v-model="tableManufacturer" :value="tableManufacturer">
+				</el-input>
+			</el-col>
+		</el-row>
+		<el-row type="flex" class="mb10">
+			<el-col :span="12">
+				<div>风机编号:</div>
+				<el-input placeholder="请输入风机编号" v-model="stationcn" :value="stationcn">
+				</el-input>
+			</el-col>
+		</el-row>
+		<el-row type="flex" justify="end">
+			<div class="query-actions" style="margin-top: 15px">
+				<button class="btn" @click="onClickDialogClose">取消</button>
+				<button class="btn" @click="dialogSave">保存</button>
+			</div>
+		</el-row>
+	</el-dialog>
+	<!-- 原始数据start -->
+	<el-dialog title="原始数据" 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-date-picker v-model="time" type="datetimerange" range-separator="至" start-placeholder="开始日期"
+							end-placeholder="结束日期">
+						</el-date-picker>
+					</div>
+				</div>
+				<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"
+			  :yAxises="PowertrendYAxises"
+			  :showLegend="true"
+			/>
+		</el-row>
+	</el-dialog>
+			<!-- 原始数据end -->
+</template>
+
+<script>
+	import ComTable from "@/components/coms/table/table.vue";
+		import MultipleYLineChartNormal from "../../NewPages/multiple-y-line-chart-normal.vue";
+		import Tab from "@/components/coms/tabs/tab.vue";
+	export default {
+		components: {
+			ComTable,MultipleYLineChartNormal,Tab
+		},
+		data() {
+			const that = this;
+			return {
+				Powertrend: [
+				  {
+				    title: "",
+				    yAxisIndex: 0, // 使用单位
+				    value: [],
+				  },
+				],
+				PowertrendYAxises: [
+				  {
+				    name: "功率",
+				    min: 0,
+				    max: null,
+				    unit: "(万kWh)",
+				    position: "left",
+				  },
+				  {
+				    name: "风速",
+				    min: 0,
+				    max: 25,
+				    unit: "(m/s)",
+				    position: "right",
+				  },
+				],
+				selectValue: "60",
+				timeoptions: [
+				  {
+				    value: "60",
+				    label: "一分钟",
+				  },
+				  {
+				    value: "300",
+				    label: "五分钟",
+				  },
+				  {
+				    value: "600",
+				    label: "十分钟",
+				  },
+				  {
+				    value: "1800",
+				    label: "三十分钟",
+				  },
+				  {
+				    value: "3600",
+				    label: "一小时",
+				  },
+				  {
+				    value: "86400",
+				    label: "一天",
+				  },
+				],
+				time: [],
+				yssjDialog:false,
+				point:[],
+				pointdes:[],
+				
+				widgetArr: [{label: '正样本',value: 0},{label: '负样本',value: 1}],
+				queryType: false, //没有改变select时,点击查询无效
+				pageIndex: 1,
+				pageSize: 20,
+				BuJian: [{
+					label: '部件1',
+					value: '1'
+				}, {
+					label: '部件2',
+					value: '2'
+				}],
+				ChangZhan: [{
+					label: '麻黄山风电场',
+					value: 'MHS_FDC'
+				}],
+				fjxh: [{
+					label: '类型1',
+					value: '1'
+				}],
+				fjxhArr: [{
+					id: "MHS_FDC",
+					value: ['UP77', 'UP82', 'UP105']
+				}],
+				widget: [],
+				model: [],
+				station: '',
+				windturbinename: "",
+				widget: "",
+				tableModel: "",
+				tableTime: "",
+				tableSymptom: "",
+				tableManufacturer: "",
+				stationcn: "",
+				tableCategory: "", //隐藏保存部分
+				tableRemark: "",
+				tableFaultcode: "",
+				tableId: "",
+				tableSymptomcode: "",
+				tableStationen: "",
+				isvisiable: false,
+				isvisiableType: 1, //新增为1,编辑为2
+				checkLength: 0, //对标分析只能选择5个
+				tableData: {
+					column: [{
+							name: "序号",
+							field: "index",
+							is_light: false,
+							width: '50px',
+						},
+						{
+						  name: "",
+						  field: "check",
+						  is_light: false,
+						  width: '50px',
+						  template: function () {
+						    return "<input class='check curCheckBox' type='CheckBox'/>";
+						  },
+						  click: function (event, data) {
+						    let point = data.point,
+								pointdes = data.pointdes;
+						    if (event.target.checked == false && that.checkLength <= 5) {
+						      that.point.forEach((item, i) => {
+						        if (item == point) {
+						          that.point.splice(i, 1);
+						          that.pointdes.splice(i, 1);
+						        }
+						      });
+						      that.checkLength--;
+						    } else if (event.target.checked && that.checkLength < 5) {
+						      that.point.push(point);
+						      that.pointdes.push(pointdes);
+						      that.checkLength++;
+						    } else if (that.checkLength == 5) {
+						      event.target.checked = false;
+						    }
+						  },
+						},
+						{
+							name: "风机",
+							field: "windturbineid",
+							is_light: false,
+							width: '100px',
+						},
+						{
+							name: "部件",
+							field: "widget",
+							is_light: false,
+							width: '100px',
+						},
+						{
+							name: "测点",
+							field: "point",
+							is_light: false,
+							width: '250px',
+						},
+						{
+							name: "测点描述",
+							field: "pointdes",
+							is_light: false,
+							width: '150px',
+						},
+						{
+							name: "风机型号",
+							field: "model",
+							is_light: false,
+							width: '150px',
+						},
+						{
+							name: "场站",
+							field: "stationcn",
+							is_light: false,
+							width: '150px',
+						},
+						{
+							name: "操作",
+							is_light: false,
+							width: '200px',
+							template: () => {
+								return (
+									"<el-button type='text' style='cursor: pointer;' value='edit'>编辑</el-button>&nbsp" +
+									"<el-button type='text' style='cursor: pointer;' value='delete'>删除</el-button>&nbsp" +
+									"<el-button type='text' style='cursor: pointer;' value='config'>原始数据</el-button>&nbsp"
+								);
+							},
+							click(e, row) {
+								that.onClickOption(e, row);
+							},
+						},
+					],
+					data: [{
+						index: 1,
+						windturbineid: 0,
+						widget: "MG01-01",
+						point: "0.1000",
+						pointdes: "0.1000",
+						model: "0.1000",
+						stationcn: "0.1000",
+						is_light: false,
+					}],
+				}
+			};
+		},
+		props: {
+			data: {
+				type: Array
+			},
+			st:{
+				type: String
+			}
+		},
+		methods: {
+			getTable() {
+				let that = this;
+				this.tableLoading = true;
+				that.API.requestData({
+					method: "GET",
+					baseURL: "http://192.168.10.4:9002/",
+					subUrl: "benchmarking/wplist",
+					data: {
+						wpId: that.stationId,
+						startTs: that.startDate,
+						endTs: that.endDate,
+						pageNum: that.pageIndex,
+						pageSize: that.pageSize,
+					},
+					success(res) {
+						var dataTab = [];
+						if (res.data) {
+							res.data.list.forEach(item => {
+								dataTab.push({ //表格
+									recodedata: that.formatTime(item.recodedata),
+									region: item.region,
+								})
+							})
+							that.tableData.data = dataTab;
+							that.tableData.total = res.data.total;
+						} else {
+							that.tableData.data = [];
+							that.tableData.total = 0;
+						}
+						that.tableLoading = false;
+					},
+				});
+			},
+			onChangePage(params) {
+				this.pageIndex = params.pageIndex;
+				this.pageSize = params.pageSize;
+				this.getTable();
+			},
+			startAjax() {
+				var that = this;
+				// that.time = [new Date((new Date() - 3600 * 1000 * 24 * 30)).formatDate("yyyy-MM-dd"), new Date().formatDate("yyyy-MM-dd")];
+				that.time = [new Date((new Date() - 3600 * 1000 * 24 * 360)).formatDate("yyyy-MM-dd"), new Date()
+					.formatDate("yyyy-MM-dd")
+				];
+				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
+						that.station = res.data[1].name
+					},
+				});
+
+				that.API.requestData({
+					method: "GET",
+					baseURL: "http://192.168.1.18:9002/",
+					subUrl: "basic/widget/condition",
+					success(res) {
+						let keys = Object.keys(res.data[0]);
+						let bujian = [],
+							widget = [];
+						keys.forEach((ele, index) => {
+							bujian.push({
+								label: res.data[0].ele,
+								value: ele
+							})
+							widget.push(ele)
+						})
+
+						that.widget = widget;
+						that.BuJian = bujian;
+					},
+				});
+
+				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;
+					},
+				});
+			},
+			query() {
+				if (this.queryType) {
+					this.list();
+				}
+			},
+			addEdit() {
+				this.isvisiableType = 1;
+				this.windturbinename = '';
+				this.tableModel = '';
+				this.tableTime = '';
+				this.tableSymptom = '';
+				this.tableManufacturer = '';
+				this.stationcn = '';
+
+				// this.tableCategory: data[i].category,
+				// this.tableRemark: data[i].remark,
+				// this.tableFaultcode: data[i].faultcode,
+				// this.tableId: data[i].id,
+				// this.tableSymptomcode:data[i].Symptomcode,
+				// this.tableStationen:data[i].stationen
+
+				this.isvisiable = true;
+			},
+			onClickOption(e, row) { // 操作按钮
+				let that = this;
+				if ("delete" == e.target.getAttribute("value")) {
+					that
+						.$confirm("确认删除此条样本数据?", "提示", {
+							confirmButtonText: "删除",
+							cancelButtonText: "取消"
+						})
+						.then((_) => {
+							console.log('ok')
+							// that.requestDelete(row);
+						})
+						.catch((_) => {});
+				}
+				if ("edit" == e.target.getAttribute("value")) {
+					that.isvisiableType = 2;
+					that.$nextTick(() => {
+						let tableTime = row.tableTime.split(" - ");
+						that.widget = row.widget;
+						that.BuJian.forEach(ele => {
+							if (ele.value == row.tableFaultcode) {
+								that.windturbinename = ele.label
+							}
+						})
+						that.tableModel = row.tableModel;
+						that.tableTime = [Date.parse(new Date(tableTime[0])), Date.parse(new Date(tableTime[1]))];
+						that.tableSymptom = row.tableSymptom;
+						that.tableManufacturer = row.tableManufacturer;
+						that.stationcn = row.stationcn;
+
+						that.tableCategory = row.tableCategory;
+						that.tableRemark = row.tableRemark;
+						that.tableFaultcode = row.tableFaultcode;
+						that.tableId = row.tableId;
+						that.tableSymptomcode = row.tableSymptomcode;
+						that.tableStationen = row.tableStationen;
+					});
+					that.isvisiable = true;
+				}
+				if ("config" == e.target.getAttribute("value")) { //传感点
+					that.time = [that.st - (3600 * 1000), that.st];
+					that.point =[row.point];
+					that.pointdes = [row.pointdes];
+					that.requestDetailData(that.point,that.pointdes,that.time,that.selectValue);
+					that.yssjDialog=true;
+				}
+			},
+			onClickDialogClose() { // 弹窗右上角关闭按钮
+				this.isvisiable = false;
+				this.isvisiableType = 1;
+			},
+			dialogSave() {
+				let that = this;
+				that.tableTime[0] = that.formatDate(that.tableTime[0].valueOf());
+				that.tableTime[1] = that.formatDate(that.tableTime[1].valueOf());
+				console.log(that.tableTime)
+				that.API.requestData({
+					method: "POST",
+					baseURL: "http://192.168.1.18:9002/",
+					headers: {
+						'Content-Type': 'application/json;charset=utf-8',
+					},
+					subUrl: "case/item/edit",
+					body: {
+						category: that.tableCategory,
+						endtime: that.tableTime[1],
+						faultcode: that.tableFaultcode,
+						faulttype: that.windturbinename,
+						id: that.tableId,
+						manufacturer: that.tableManufacturer,
+						model: that.tableModel,
+						remark: that.tableRemark,
+						starttime: that.tableTime[0],
+						stationen: that.tableStationen,
+						symptom: that.tableSymptom,
+						symptomcode: that.tableSymptomcode,
+						tag: that.widget == "正样本" ? 0 : 1,
+						windturbineid: that.stationcn
+					},
+					success(res) {
+						if (res.code == 200) {
+							that.BASE.showMsg({
+								type: "success",
+								msg: "保存成功",
+							});
+							that.onClickDialogClose();
+							that.list();
+						}
+					},
+				});
+			},
+			gzCgdClick(data) {
+				this.gzCgd = data;
+			},
+			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());
+				var hh = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
+				var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
+				var ss = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
+				return YY + MM + DD + " " + hh + mm + ss;
+			},
+			list(data) {
+				console.log(data)
+				var that = this;
+				that.tableData.data = [];
+				if (data.length) {
+					for (var i = 0; i < data.length; i++) {
+						let obj = {
+							index: i + 1,
+							windturbineid: data[i].windturbineid,
+							widget: data[i].widget,
+							point: data[i].point,
+							pointdes: data[i].pointdes,
+							model: data[i].model,
+							stationcn: data[i].stationcn,
+							
+						};
+						that.tableData.data.push(obj);
+					}
+				}
+				
+				
+				// let station = '',
+				// 	widget = ''
+				// 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
+				// 		}
+				// 	})
+				// }
+				// if (typeof that.widget.valueOf() == 'string') {
+				// 	that.BuJian.forEach(ele => {
+				// 		if (ele.label == that.widget) {
+				// 			widget = ele.value
+				// 		}
+				// 	})
+				// }
+				// if (that.model.length == 0) {
+				// 	that.BASE.showMsg({
+				// 		type: "warning",
+				// 		msg: "请选择风机型号",
+				// 	});
+				// 	return
+				// }
+				// if (that.widget.length == 0) {
+				// 	that.BASE.showMsg({
+				// 		type: "warning",
+				// 		msg: "请选择部件",
+				// 	});
+				// 	return
+				// }
+				// that.API.requestData({
+				// 	showLoading: true,
+				// 	method: "GET",
+				// 	baseURL: "http://192.168.1.18:9002/",
+				// 	subUrl: "case/fault/all",
+				// 	data: {
+				// 		widget: widget ? widget : that.widget,
+				// 		station: station ? station : that.station,
+				// 		model: that.model,
+				// 		st: that.time[0].valueOf(),
+				// 		et: that.time[1].valueOf()
+				// 	},
+				// 	success(res) {
+				// 		if (res.code == 200) {
+				// 			console.log(res)
+				// 			that.tableData.data = [];
+				// 			if (res.data.length) {
+				// 				let data = res.data;
+				// 				for (var i = 0; i < data.length; i++) {
+				// 					let obj = {
+				// 						index: i + 1,
+				// 						widget: data[i].tag == 0 ? '正样本' : '负样本',
+				// 						windturbinename: data[i].faulttype,
+				// 						tableModel: data[i].model,
+				// 						tableTime: data[i].starttime + ' - ' + data[i].endtime,
+				// 						tableSymptom: data[i].symptom,
+				// 						tableManufacturer: data[i].manufacturer,
+				// 						stationcn: data[i].windturbineid,
+
+				// 						tableCategory: data[i].category,
+				// 						tableRemark: data[i].remark,
+				// 						tableFaultcode: data[i].faultcode,
+				// 						tableId: data[i].id,
+				// 						tableSymptomcode: data[i].symptomcode,
+				// 						tableStationen: data[i].stationen
+				// 					};
+				// 					that.tableData.data.push(obj);
+				// 				}
+				// 			}
+				// 		}
+				// 	},
+				// });
+			},
+			back() {
+				this.clearDb();
+				this.$emit('gzCgdClick', 1);
+			},
+			switchChange(interval,status) {
+			  if(status === 'interval') {
+			    this.chooseStatus = false
+			    this.selectValue = '60'
+			  }else if(status === 'original'){
+			    this.chooseStatus = true
+			  }
+			  // this.requestDetailData(
+			  //     this.wpvalue,
+			  //     this.startdate,
+			  //     this.enddate,
+			  //     interval,
+			  //     this.wtId,
+			  //     this.descName
+			  //   );
+			},
+			requestDetailData(point, pointdes, time,interval) {
+			    let that = this;
+				let Powertrend = [];
+				pointdes.forEach((ele,index)=>{
+					Powertrend.push({
+						title:ele,
+						smooth: true,
+						value: [],
+					})
+				})
+				point.forEach((ele,index)=>{
+					that.API.requestData({
+						method: "GET",
+						baseURL: "http://192.168.1.18:9002/",
+						subUrl: "point/item",
+						data:{
+							point:ele,
+							startTs:time[0],
+							endTs:time[1],
+							interval:interval
+						},
+						success(res) {
+							if(res.data){
+							  res.data.forEach((cEle) => {
+								Powertrend[index].value.push({
+								  text: new Date(cEle.ts).formatDate("hh:mm"),
+								  value: cEle.doubleValue,
+								});
+							  });
+							  if((point.length - 1) == index){
+								that.Powertrend = Powertrend;
+							  }
+							}
+						},
+					});
+				})
+				
+			},
+			queryYssj(){
+				this.requestDetailData(this.point,this.pointdes,[Date.parse(new Date(this.time[0])), Date.parse(new Date(this.time[1]))],this.selectValue);
+			},
+			dbfx() {
+			  var that = this;
+			  if (that.point.length <=5) {
+				  that.Powertrend = [];
+				  that.time = [that.st - (3600 * 1000), that.st];
+				  that.requestDetailData(that.point,that.pointdes,[Date.parse(new Date(that.time[0])), Date.parse(new Date(that.time[1]))],that.selectValue);
+			    that.yssjDialog = true;
+			    that.clearDb();
+			  }
+			},
+			clearDb() {
+			  //清空对标状态
+			  this.$refs.curRef.clearCheckBox();
+			  this.point = [];
+			  this.pointdes = [];
+			  this.checkLength = 0;
+			},
+		},
+		created() {
+			this.list(this.data)
+		},
+		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;
+				this.queryType = true;
+			},
+			widget() {
+				this.queryType = true;
+			},
+			model() {
+				this.queryType = true;
+			},
+			time() {
+				this.queryType = true;
+			},
+		},
+	};
+</script>
+
+<style lang="less" scoped>
+	.mb10 {
+		margin-bottom: 10px;
+	}
+
+	.el-select.w {
+		width: 100%;
+	}
+</style>

+ 179 - 657
src/views/sampleDatabase/fault/point.vue

@@ -1,84 +1,5 @@
 <template>
 	<el-row type="flex">
-		<div class="query-actions">
-			<button class="btn" @click="addEdit">新增</button>
-			<button class="btn" @click="dbfx">原始数据对标</button>
-			<button class="btn" @click="back">返回</button>
-		</div>
-	</el-row>
-	<el-row :type="'flex'" class="content">
-		<el-col :span="24">
-			<ComTable :data="tableData" :pageSize="pageSize" @onPagging="onChangePage" height="84vh"
-				v-loading="tableLoading" ref="curRef" element-loading-text="拼命加载中"
-				element-loading-background="rgba(0, 0, 0, 0.8)"></ComTable>
-		</el-col>
-	</el-row>
-		
-		
-	<el-dialog :title="isvisiableType == 1 ? '新增' : '编辑'" v-model="isvisiable" width="45%" top="15vh"
-		custom-class="modal" :close-on-click-modal="false" :before-close="onClickDialogClose" class="isvisiable">
-		<!-- 这里是新增或编辑 -->
-		<el-row type="flex" class="mb10">
-			<el-col :span="12">
-				<div>样本类型:</div>
-				<el-select v-model="widget" placeholder="请选择样本" popper-class="select" class="w">
-					<el-option v-for="item in widgetArr" :key="item.value" :value="item.value"
-						:label="item.label">
-					</el-option>
-				</el-select>
-			</el-col>
-			<el-col :span="12">
-				<div>风机型号:</div>
-				<el-select v-model="tableModel" placeholder="请选择风机型号" popper-class="select" class="w">
-					<el-option v-for="item in fjxh" :key="item.value" :value="item.value" :label="item.label">
-					</el-option>
-				</el-select>
-			</el-col>
-		</el-row>
-		<el-row type="flex" class="mb10">
-			<el-col :span="12">
-				<div>故障分类:</div>
-				<el-select v-model="windturbinename" placeholder="请选择故障" popper-class="select" class="w">
-					<el-option v-for="item in BuJian" :key="item.value" :value="item.value" :label="item.label">
-					</el-option>
-				</el-select>
-			</el-col>
-			<el-col :span="12">
-				<div>时间:</div>
-				<el-date-picker v-model="tableTime" type="datetimerange" range-separator="至"
-					start-placeholder="开始日期" end-placeholder="结束日期" class="w">
-				</el-date-picker>
-			</el-col>
-		</el-row>
-		<el-row type="flex" class="mb10">
-			<el-col :span="12">
-				<div>故障原因:</div>
-				<el-input placeholder="请输入故障原因" v-model="tableSymptom" :value="tableSymptom">
-				</el-input>
-			</el-col>
-			<el-col :span="12">
-				<div>风机厂商:</div>
-				<el-input placeholder="请输入风机厂商" v-model="tableManufacturer" :value="tableManufacturer">
-				</el-input>
-			</el-col>
-		</el-row>
-		<el-row type="flex" class="mb10">
-			<el-col :span="12">
-				<div>风机编号:</div>
-				<el-input placeholder="请输入风机编号" v-model="stationcn" :value="stationcn">
-				</el-input>
-			</el-col>
-		</el-row>
-		<el-row type="flex" justify="end">
-			<div class="query-actions" style="margin-top: 15px">
-				<button class="btn" @click="onClickDialogClose">取消</button>
-				<button class="btn" @click="dialogSave">保存</button>
-			</div>
-		</el-row>
-	</el-dialog>
-	<!-- 原始数据start -->
-	<el-dialog title="原始数据" 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">
@@ -92,148 +13,99 @@
 				<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 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>
+					<!-- <button class="btn" @click="clearDb">重置对标选项</button> -->
+					<button class="btn" @click="dbfx">原始数据对标</button>
 				</div>
 			</div>
 		</div>
-		
-		<el-row type="flex">
-			<multiple-y-line-chart-normal
-			  height="500px"
-			  :list="Powertrend"
-			  :yAxises="PowertrendYAxises"
-			  :showLegend="true"
-			/>
-		</el-row>
-	</el-dialog>
-			<!-- 原始数据end -->
+	</el-row>
+	<el-row :type="'flex'" class="content mg-b-8">
+		<ComTable :data="tableData" :height="'30vh'" v-loading="tableLoading" ref="curRef" element-loading-text="拼命加载中"
+			element-loading-background="rgba(0, 0, 0, 0.8)"></ComTable>
+	</el-row>
+	<el-row :type="'flex'" class="content" :style="{height:'44vh'}">
+		 <el-col :span="24">
+		 	<multiple-y-line-chart-normal height="45vh" :list="Powertrend" :yAxises="PowertrendYAxises"
+		 		:showLegend="true" />	 
+		 </el-col>
+	</el-row>
 </template>
 
 <script>
 	import ComTable from "@/components/coms/table/table.vue";
-		import MultipleYLineChartNormal from "../../NewPages/multiple-y-line-chart-normal.vue";
-		import Tab from "@/components/coms/tabs/tab.vue";
+	import MultipleYLineChartNormal from "../../NewPages/multiple-y-line-chart-normal.vue";
 	export default {
 		components: {
-			ComTable,MultipleYLineChartNormal,Tab
+			ComTable,
+			MultipleYLineChartNormal
 		},
 		data() {
 			const that = this;
 			return {
-				Powertrend: [
-				  {
-				    title: "",
-				    yAxisIndex: 0, // 使用单位
-				    value: [],
-				  },
-				],
-				PowertrendYAxises: [
-				  {
-				    name: "功率",
-				    min: 0,
-				    max: null,
-				    unit: "(万kWh)",
-				    position: "left",
-				  },
-				  {
-				    name: "风速",
-				    min: 0,
-				    max: 25,
-				    unit: "(m/s)",
-				    position: "right",
-				  },
+				Powertrend: [{
+					title: "",
+					yAxisIndex: 0, // 使用单位
+					value: [],
+				}, ],
+				PowertrendYAxises: [{
+						name: "",
+						min: 0,
+						max: null,
+						unit: "",
+						position: "left",
+					},
+					{
+						name: "",
+						min: 0,
+						max: 25,
+						unit: "",
+						position: "right",
+					},
 				],
 				selectValue: "60",
-				timeoptions: [
-				  {
-				    value: "60",
-				    label: "一分钟",
-				  },
-				  {
-				    value: "300",
-				    label: "五分钟",
-				  },
-				  {
-				    value: "600",
-				    label: "十分钟",
-				  },
-				  {
-				    value: "1800",
-				    label: "三十分钟",
-				  },
-				  {
-				    value: "3600",
-				    label: "一小时",
-				  },
-				  {
-				    value: "86400",
-				    label: "一天",
-				  },
+				timeoptions: [{
+						value: "60",
+						label: "一分钟",
+					},
+					{
+						value: "300",
+						label: "五分钟",
+					},
+					{
+						value: "600",
+						label: "十分钟",
+					},
+					{
+						value: "1800",
+						label: "三十分钟",
+					},
+					{
+						value: "3600",
+						label: "一小时",
+					},
+					{
+						value: "86400",
+						label: "一天",
+					},
 				],
-				time: [],
-				yssjDialog:false,
-				point:[],
-				pointdes:[],
-				
-				widgetArr: [{label: '正样本',value: 0},{label: '负样本',value: 1}],
-				queryType: false, //没有改变select时,点击查询无效
-				pageIndex: 1,
+				time: [that.st - (3600 * 1000*24), that.st + (1000*10*60)],
+				point: [],
+				pointdes: [],
+
 				pageSize: 20,
-				BuJian: [{
-					label: '部件1',
-					value: '1'
-				}, {
-					label: '部件2',
-					value: '2'
-				}],
-				ChangZhan: [{
-					label: '麻黄山风电场',
-					value: 'MHS_FDC'
-				}],
-				fjxh: [{
-					label: '类型1',
-					value: '1'
-				}],
-				fjxhArr: [{
-					id: "MHS_FDC",
-					value: ['UP77', 'UP82', 'UP105']
-				}],
-				widget: [],
 				model: [],
 				station: '',
 				windturbinename: "",
-				widget: "",
-				tableModel: "",
-				tableTime: "",
-				tableSymptom: "",
-				tableManufacturer: "",
-				stationcn: "",
-				tableCategory: "", //隐藏保存部分
-				tableRemark: "",
-				tableFaultcode: "",
-				tableId: "",
-				tableSymptomcode: "",
-				tableStationen: "",
 				isvisiable: false,
-				isvisiableType: 1, //新增为1,编辑为2
 				checkLength: 0, //对标分析只能选择5个
 				tableData: {
 					column: [{
@@ -243,77 +115,57 @@
 							width: '50px',
 						},
 						{
-						  name: "",
-						  field: "check",
-						  is_light: false,
-						  width: '50px',
-						  template: function () {
-						    return "<input class='check curCheckBox' type='CheckBox'/>";
-						  },
-						  click: function (event, data) {
-						    let point = data.point,
-								pointdes = data.pointdes;
-						    if (event.target.checked == false && that.checkLength <= 5) {
-						      that.point.forEach((item, i) => {
-						        if (item == point) {
-						          that.point.splice(i, 1);
-						          that.pointdes.splice(i, 1);
-						        }
-						      });
-						      that.checkLength--;
-						    } else if (event.target.checked && that.checkLength < 5) {
-						      that.point.push(point);
-						      that.pointdes.push(pointdes);
-						      that.checkLength++;
-						    } else if (that.checkLength == 5) {
-						      event.target.checked = false;
-						    }
-						  },
-						},
-						{
-							name: "风机",
-							field: "windturbineid",
-							is_light: false,
-							width: '100px',
-						},
-						{
-							name: "部件",
-							field: "widget",
+							name: "",
+							field: "check",
 							is_light: false,
-							width: '100px',
+							width: '50px',
+							template: function() {
+								return "<input class='check curCheckBox' type='CheckBox'/>";
+							},
+							click: function(event, data) {
+								let point = data.point,
+									pointdes = data.pointdes;
+								if (event.target.checked == false && that.checkLength <= 5) {
+									that.point.forEach((item, i) => {
+										if (item == point) {
+											that.point.splice(i, 1);
+											that.pointdes.splice(i, 1);
+										}
+									});
+									that.checkLength--;
+								} else if (event.target.checked && that.checkLength < 5) {
+									that.point.push(point);
+									that.pointdes.push(pointdes);
+									that.checkLength++;
+								} else if (that.checkLength == 5) {
+									event.target.checked = false;
+								}
+							},
 						},
 						{
-							name: "测点",
+							name: "测点名称",
 							field: "point",
 							is_light: false,
-							width: '250px',
+							width: '350px',
 						},
 						{
 							name: "测点描述",
 							field: "pointdes",
 							is_light: false,
-							width: '150px',
+							width: '250px',
 						},
 						{
-							name: "风机型号",
+							name: "风机型",
 							field: "model",
 							is_light: false,
-							width: '150px',
-						},
-						{
-							name: "场站",
-							field: "stationcn",
-							is_light: false,
-							width: '150px',
+							width: '100px',
 						},
 						{
 							name: "操作",
 							is_light: false,
-							width: '200px',
+							width: '250px',
 							template: () => {
 								return (
-									"<el-button type='text' style='cursor: pointer;' value='edit'>编辑</el-button>&nbsp" +
-									"<el-button type='text' style='cursor: pointer;' value='delete'>删除</el-button>&nbsp" +
 									"<el-button type='text' style='cursor: pointer;' value='config'>原始数据</el-button>&nbsp"
 								);
 							},
@@ -322,16 +174,7 @@
 							},
 						},
 					],
-					data: [{
-						index: 1,
-						windturbineid: 0,
-						widget: "MG01-01",
-						point: "0.1000",
-						pointdes: "0.1000",
-						model: "0.1000",
-						stationcn: "0.1000",
-						is_light: false,
-					}],
+					data: [],
 				}
 			};
 		},
@@ -339,245 +182,21 @@
 			data: {
 				type: Array
 			},
-			st:{
+			st: {
 				type: String
-			}
+			},
 		},
 		methods: {
-			getTable() {
-				let that = this;
-				this.tableLoading = true;
-				that.API.requestData({
-					method: "GET",
-					baseURL: "http://192.168.10.4:9002/",
-					subUrl: "benchmarking/wplist",
-					data: {
-						wpId: that.stationId,
-						startTs: that.startDate,
-						endTs: that.endDate,
-						pageNum: that.pageIndex,
-						pageSize: that.pageSize,
-					},
-					success(res) {
-						var dataTab = [];
-						if (res.data) {
-							res.data.list.forEach(item => {
-								dataTab.push({ //表格
-									recodedata: that.formatTime(item.recodedata),
-									region: item.region,
-								})
-							})
-							that.tableData.data = dataTab;
-							that.tableData.total = res.data.total;
-						} else {
-							that.tableData.data = [];
-							that.tableData.total = 0;
-						}
-						that.tableLoading = false;
-					},
-				});
-			},
-			onChangePage(params) {
-				this.pageIndex = params.pageIndex;
-				this.pageSize = params.pageSize;
-				this.getTable();
-			},
-			startAjax() {
-				var that = this;
-				// that.time = [new Date((new Date() - 3600 * 1000 * 24 * 30)).formatDate("yyyy-MM-dd"), new Date().formatDate("yyyy-MM-dd")];
-				that.time = [new Date((new Date() - 3600 * 1000 * 24 * 360)).formatDate("yyyy-MM-dd"), new Date()
-					.formatDate("yyyy-MM-dd")
-				];
-				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
-						that.station = res.data[1].name
-					},
-				});
-
-				that.API.requestData({
-					method: "GET",
-					baseURL: "http://192.168.1.18:9002/",
-					subUrl: "basic/widget/condition",
-					success(res) {
-						let keys = Object.keys(res.data[0]);
-						let bujian = [],
-							widget = [];
-						keys.forEach((ele, index) => {
-							bujian.push({
-								label: res.data[0].ele,
-								value: ele
-							})
-							widget.push(ele)
-						})
-
-						that.widget = widget;
-						that.BuJian = bujian;
-					},
-				});
-
-				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;
-					},
-				});
-			},
-			query() {
-				if (this.queryType) {
-					this.list();
-				}
-			},
-			addEdit() {
-				this.isvisiableType = 1;
-				this.windturbinename = '';
-				this.tableModel = '';
-				this.tableTime = '';
-				this.tableSymptom = '';
-				this.tableManufacturer = '';
-				this.stationcn = '';
-
-				// this.tableCategory: data[i].category,
-				// this.tableRemark: data[i].remark,
-				// this.tableFaultcode: data[i].faultcode,
-				// this.tableId: data[i].id,
-				// this.tableSymptomcode:data[i].Symptomcode,
-				// this.tableStationen:data[i].stationen
-
-				this.isvisiable = true;
-			},
 			onClickOption(e, row) { // 操作按钮
 				let that = this;
-				if ("delete" == e.target.getAttribute("value")) {
-					that
-						.$confirm("确认删除此条样本数据?", "提示", {
-							confirmButtonText: "删除",
-							cancelButtonText: "取消"
-						})
-						.then((_) => {
-							console.log('ok')
-							// that.requestDelete(row);
-						})
-						.catch((_) => {});
-				}
-				if ("edit" == e.target.getAttribute("value")) {
-					that.isvisiableType = 2;
-					that.$nextTick(() => {
-						let tableTime = row.tableTime.split(" - ");
-						that.widget = row.widget;
-						that.BuJian.forEach(ele => {
-							if (ele.value == row.tableFaultcode) {
-								that.windturbinename = ele.label
-							}
-						})
-						that.tableModel = row.tableModel;
-						that.tableTime = [Date.parse(new Date(tableTime[0])), Date.parse(new Date(tableTime[1]))];
-						that.tableSymptom = row.tableSymptom;
-						that.tableManufacturer = row.tableManufacturer;
-						that.stationcn = row.stationcn;
-
-						that.tableCategory = row.tableCategory;
-						that.tableRemark = row.tableRemark;
-						that.tableFaultcode = row.tableFaultcode;
-						that.tableId = row.tableId;
-						that.tableSymptomcode = row.tableSymptomcode;
-						that.tableStationen = row.tableStationen;
-					});
-					that.isvisiable = true;
-				}
-				if ("config" == e.target.getAttribute("value")) { //传感点
+				if ("config" == e.target.getAttribute("value")) { //原始数据
 					that.time = [that.st - (3600 * 1000), that.st];
-					that.point =[row.point];
+					that.point = [row.point];
 					that.pointdes = [row.pointdes];
-					that.requestDetailData(that.point,that.pointdes,that.time,that.selectValue);
-					that.yssjDialog=true;
+					that.requestDetailData(that.point, that.pointdes, that.time, that.selectValue);
 				}
 			},
-			onClickDialogClose() { // 弹窗右上角关闭按钮
-				this.isvisiable = false;
-				this.isvisiableType = 1;
-			},
-			dialogSave() {
-				let that = this;
-				that.tableTime[0] = that.formatDate(that.tableTime[0].valueOf());
-				that.tableTime[1] = that.formatDate(that.tableTime[1].valueOf());
-				console.log(that.tableTime)
-				that.API.requestData({
-					method: "POST",
-					baseURL: "http://192.168.1.18:9002/",
-					headers: {
-						'Content-Type': 'application/json;charset=utf-8',
-					},
-					subUrl: "case/item/edit",
-					body: {
-						category: that.tableCategory,
-						endtime: that.tableTime[1],
-						faultcode: that.tableFaultcode,
-						faulttype: that.windturbinename,
-						id: that.tableId,
-						manufacturer: that.tableManufacturer,
-						model: that.tableModel,
-						remark: that.tableRemark,
-						starttime: that.tableTime[0],
-						stationen: that.tableStationen,
-						symptom: that.tableSymptom,
-						symptomcode: that.tableSymptomcode,
-						tag: that.widget == "正样本" ? 0 : 1,
-						windturbineid: that.stationcn
-					},
-					success(res) {
-						if (res.code == 200) {
-							that.BASE.showMsg({
-								type: "success",
-								msg: "保存成功",
-							});
-							that.onClickDialogClose();
-							that.list();
-						}
-					},
-				});
-			},
-			gzCgdClick(data) {
-				this.gzCgd = data;
-			},
-			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());
-				var hh = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
-				var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
-				var ss = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
-				return YY + MM + DD + " " + hh + mm + ss;
-			},
 			list(data) {
-				console.log(data)
 				var that = this;
 				that.tableData.data = [];
 				if (data.length) {
@@ -590,199 +209,102 @@
 							pointdes: data[i].pointdes,
 							model: data[i].model,
 							stationcn: data[i].stationcn,
-							
 						};
 						that.tableData.data.push(obj);
 					}
+					that.point = [data[0].point];
+					that.pointdes = [data[0].pointdes];
+					that.requestDetailData([data[0].point], 
+					[data[0].pointdes], 
+					[Date.parse(new Date(that.time[0])), Date.parse(new Date(that.time[1]))], 
+					that.selectValue);
 				}
-				
-				
-				// let station = '',
-				// 	widget = ''
-				// 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
-				// 		}
-				// 	})
-				// }
-				// if (typeof that.widget.valueOf() == 'string') {
-				// 	that.BuJian.forEach(ele => {
-				// 		if (ele.label == that.widget) {
-				// 			widget = ele.value
-				// 		}
-				// 	})
-				// }
-				// if (that.model.length == 0) {
-				// 	that.BASE.showMsg({
-				// 		type: "warning",
-				// 		msg: "请选择风机型号",
-				// 	});
-				// 	return
-				// }
-				// if (that.widget.length == 0) {
-				// 	that.BASE.showMsg({
-				// 		type: "warning",
-				// 		msg: "请选择部件",
-				// 	});
-				// 	return
-				// }
-				// that.API.requestData({
-				// 	showLoading: true,
-				// 	method: "GET",
-				// 	baseURL: "http://192.168.1.18:9002/",
-				// 	subUrl: "case/fault/all",
-				// 	data: {
-				// 		widget: widget ? widget : that.widget,
-				// 		station: station ? station : that.station,
-				// 		model: that.model,
-				// 		st: that.time[0].valueOf(),
-				// 		et: that.time[1].valueOf()
-				// 	},
-				// 	success(res) {
-				// 		if (res.code == 200) {
-				// 			console.log(res)
-				// 			that.tableData.data = [];
-				// 			if (res.data.length) {
-				// 				let data = res.data;
-				// 				for (var i = 0; i < data.length; i++) {
-				// 					let obj = {
-				// 						index: i + 1,
-				// 						widget: data[i].tag == 0 ? '正样本' : '负样本',
-				// 						windturbinename: data[i].faulttype,
-				// 						tableModel: data[i].model,
-				// 						tableTime: data[i].starttime + ' - ' + data[i].endtime,
-				// 						tableSymptom: data[i].symptom,
-				// 						tableManufacturer: data[i].manufacturer,
-				// 						stationcn: data[i].windturbineid,
-
-				// 						tableCategory: data[i].category,
-				// 						tableRemark: data[i].remark,
-				// 						tableFaultcode: data[i].faultcode,
-				// 						tableId: data[i].id,
-				// 						tableSymptomcode: data[i].symptomcode,
-				// 						tableStationen: data[i].stationen
-				// 					};
-				// 					that.tableData.data.push(obj);
-				// 				}
-				// 			}
-				// 		}
-				// 	},
-				// });
 			},
-			back() {
-				this.clearDb();
-				this.$emit('gzCgdClick', 1);
-			},
-			switchChange(interval,status) {
-			  if(status === 'interval') {
-			    this.chooseStatus = false
-			    this.selectValue = '60'
-			  }else if(status === 'original'){
-			    this.chooseStatus = true
-			  }
-			  // this.requestDetailData(
-			  //     this.wpvalue,
-			  //     this.startdate,
-			  //     this.enddate,
-			  //     interval,
-			  //     this.wtId,
-			  //     this.descName
-			  //   );
+			switchChange(interval, status) {
+				if (status === 'interval') {
+					this.chooseStatus = false
+					this.selectValue = '60'
+				} else if (status === 'original') {
+					this.chooseStatus = true
+				}
 			},
-			requestDetailData(point, pointdes, time,interval) {
-			    let that = this;
+			requestDetailData(point, pointdes, time, interval) {
+				let that = this;
 				let Powertrend = [];
-				pointdes.forEach((ele,index)=>{
+				let dataPoint = '';
+				pointdes.forEach((ele, index) => {
 					Powertrend.push({
-						title:ele,
+						title: ele,
 						smooth: true,
 						value: [],
 					})
 				})
-				point.forEach((ele,index)=>{
-					that.API.requestData({
-						method: "GET",
-						baseURL: "http://192.168.1.18:9002/",
-						subUrl: "point/item",
-						data:{
-							point:ele,
-							startTs:time[0],
-							endTs:time[1],
-							interval:interval
-						},
-						success(res) {
-							if(res.data){
-							  res.data.forEach((cEle) => {
-								Powertrend[index].value.push({
-								  text: new Date(cEle.ts).formatDate("hh:mm"),
-								  value: cEle.doubleValue,
-								});
-							  });
-							  if((point.length - 1) == index){
-								that.Powertrend = Powertrend;
-							  }
-							}
-						},
-					});
+				point.forEach((ele, index) => {
+					dataPoint += ele + ','
 				})
-				
-			},
-			queryYssj(){
-				this.requestDetailData(this.point,this.pointdes,[Date.parse(new Date(this.time[0])), Date.parse(new Date(this.time[1]))],this.selectValue);
+				dataPoint = dataPoint.slice(0, dataPoint.length - 1)
+				that.API.requestData({
+					showLoading: true,
+					method: "GET",
+					baseURL: "http://192.168.1.18:9002/",
+					subUrl: "point/item",
+					data: {
+						point: dataPoint,
+						startTs: time[0],
+						endTs: time[1],
+						interval: interval
+					},
+					success(res) {
+						if (res.data) {
+							res.data.forEach((ele, index) => {
+								ele.list.forEach(cEle => {
+									Powertrend[index].value.push({
+										text: new Date(cEle.ts).formatDate("hh:mm"),
+										value: cEle.doubleValue,
+									});
+								})
+							});
+							that.Powertrend = Powertrend;
+						}
+					},
+				});
+
 			},
 			dbfx() {
-			  var that = this;
-			  if (that.point.length <=5) {
-				  that.Powertrend = [];
-				  that.time = [that.st - (3600 * 1000), that.st];
-				  that.requestDetailData(that.point,that.pointdes,[Date.parse(new Date(that.time[0])), Date.parse(new Date(that.time[1]))],that.selectValue);
-			    that.yssjDialog = true;
-			    that.clearDb();
-			  }
+				var that = this;
+				if (that.point.length <= 5) {
+					that.Powertrend = [];
+					that.requestDetailData(that.point, that.pointdes, [Date.parse(new Date(that.time[0])), Date.parse(
+						new Date(that.time[1]))], that.selectValue);
+				}
 			},
-			clearDb() {
-			  //清空对标状态
-			  this.$refs.curRef.clearCheckBox();
-			  this.point = [];
-			  this.pointdes = [];
-			  this.checkLength = 0;
+			clearDb() { //清空对标状态
+				this.$refs.curRef.clearCheckBox();
+				this.point = [];
+				this.pointdes = [];
+				this.checkLength = 0;
 			},
 		},
 		created() {
-			this.list(this.data)
+			this.list(this.data);
 		},
 		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;
-				this.queryType = true;
-			},
-			widget() {
-				this.queryType = true;
+			selectValue() {
+				this.requestDetailData(this.point, this.pointdes, [Date.parse(new Date(this.time[0])), Date.parse(new Date(
+					this.time[1]))], this.selectValue);
 			},
-			model() {
-				this.queryType = true;
-			},
-			time() {
-				this.queryType = true;
+			time(e) {
+				let st = Date.parse(new Date(e[0])),
+					et = Date.parse(new Date(e[1]));
+				if((et - st) > (86400000 * 7)){//判断选择日期区间大于一周则重新选择
+					this.BASE.showMsg({
+						type: "warning",
+						msg: "请选择小于7天的日期区间",
+					});
+					return
+				}
+				this.requestDetailData(this.point, this.pointdes, [Date.parse(new Date(this.time[0])), Date.parse(new Date(
+					this.time[1]))], this.selectValue);
 			},
 		},
 	};

+ 6 - 11
src/views/sampleDatabase/warning/index.vue

@@ -34,7 +34,7 @@
 				</div>
 				<div class="query-actions">
 					<button class="btn" @click="query">查询</button>
-					<button class="btn green" @click="">导入</button>
+					<button class="btn" @click="">导入</button>
 					<button class="btn" @click="export">导出</button>
 				</div>
 			</div>
@@ -122,7 +122,7 @@
 				wpArray: [],
 				wpName: "",
 				wtId: [],
-				wtIdArr: [],
+				wtIdArr: ['发电机','变桨系统','测风系统','齿轮箱','液压系统','偏航系统','机舱','传动链'],
 				wtidData: [],
 				wtIdNum: false,
 				tableDataArr: {},
@@ -184,6 +184,7 @@
 			this.getWp();
 			this.value1 = new Date();
 			this.month = [new Date((new Date() - 3600 * 1000 * 24 * 30)), new Date()];
+			this.wtId = this.wtIdArr;
 			this.requestSafeList();
 		},
 		methods: {
@@ -299,14 +300,11 @@
 								let data = res.data;
 								let tabData = [];
 								let index = 1;
-								let wtIdArr = [];
+								// let wtIdArr = [];
 								data.forEach((ele, idx) => {
 									let key = Object.keys(ele);
 									ele[key].forEach((ele2, idx2) => {
 										if (ele2.time != 0 && ele2.count >= 10) { //过滤条件
-
-											wtIdArr.push(ele2.alertText);
-
 											let obj = {
 												index: index++,
 												fjbh: ele2.windturbineId,
@@ -318,10 +316,6 @@
 										}
 									})
 								})
-								let set = new Set();
-								wtIdArr.forEach(item => set.add(item));
-								that.wtIdArr = Array.from(set);
-								that.wtId = that.wtIdArr;
 								that.tableData.data = tabData;
 								that.tableDataArr = {
 									column: that.tableData.column,
@@ -375,8 +369,9 @@
 					let index = 1;
 					let tableDataArr = this.tableDataArr;
 					tableDataArr.data.forEach(ele => {
+						
 						e.forEach(ele2 => {
-							if (ele.yjms == ele2) {
+							if (ele.yjms.slice(0,2) == ele2.slice(0,2)) {
 								let obj = {
 									index: index++,
 									fjbh: ele.fjbh,