Browse Source

无故障学习【未完成】

wangmengwei@gyee-china.com 3 years ago
parent
commit
1e749b6f77

+ 120 - 170
src/views/MalfunctionWarning/components/detectionRecord.vue

@@ -1,176 +1,126 @@
 <template>
-  <el-dialog
-    width="50%"
-    top="10vh"
-    custom-class="modal"
-    title="检测记录"
-    :close-on-click-modal="false"
-    @opened="opened()"
-  >
-    <div style="height: 70vh; overflow-y: auto">
-      <div class="titleBar">
-        <div class="titleName">测试级</div>
-      </div>
-      <el-table
-        ref="multipleTable"
-        empty-text="暂无数据"
-        :data="allData"
-        :header-cell-style="{
-          height: '40px',
-          background: 'rgba(83, 98, 104, 0.2)',
-          color: '#b2bdc0',
-          'border-bottom': '0px solid red',
-        }"
-        :cell-style="{
-          height: '40px',
-          'border-bottom': 'solid 0px #242424',
-        }"
-        stripe
-        style="width: 100%; margin-bottom: 10px"
-      >
-        <el-table-column
-          prop="starttime"
-          label="故障时间"
-          width="160"
-          align="center"
-        ></el-table-column>
-        <el-table-column
-          prop="stationen"
-          label="风场"
-          width="80"
-          align="center"
-        ></el-table-column>
-        <el-table-column
-          prop="stationcn"
-          label="场站名称"
-          width="120"
-          align="center"
-        ></el-table-column>
-        <el-table-column
-          prop="windturbineid"
-          label="风机编号"
-          width="100"
-          align="center"
-        ></el-table-column>
-        <el-table-column
-          prop="model"
-          label="风机型号"
-          width="80"
-          align="center"
-        ></el-table-column>
-        <el-table-column width="200" label="故障标签">
-          <template #default="scope">
-            <span>
-              <el-select
-                v-model="scope.row.faultcode"
-                @change="selectChange(scope.row)"
-                clearable
-                placeholder="请选择"
-                popper-class="select"
-                style="width: 130px; margin-left: 30px"
-              >
-                <el-option
-                  v-for="item in faultLists"
-                  :key="item.faultcode"
-                  :label="item.faulttype"
-                  :value="item.faultcode"
-                >
-                </el-option>
-              </el-select>
-            </span>
-          </template>
-        </el-table-column>
-        <el-table-column width="120" label="操作">
-          <button class="btn" @click="getReports()">查看检测报告</button>
-        </el-table-column>
-      </el-table>
-    </div>
-    <TestReport v-model="reportDisplay"></TestReport>
-  </el-dialog>
+	<el-dialog width="50%" top="10vh" custom-class="modal" title="检测记录" :close-on-click-modal="false"
+		@opened="opened()">
+		<div style="height: 70vh; overflow-y: auto">
+			<div class="titleBar">
+				<div class="titleName">测试级</div>
+			</div>
+			<el-table ref="multipleTable" empty-text="暂无数据" :data="allData" :header-cell-style="{ height: '40px', background: 'rgba(83, 98, 104, 0.2)', color: '#b2bdc0', 'border-bottom': '0px solid red', }" :cell-style="{ height: '40px', 'border-bottom': 'solid 0px #242424', }" stripe style="width: 100%; margin-bottom: 10px">
+				<el-table-column prop="starttime" label="故障时间" width="160" align="center"></el-table-column>
+				<el-table-column prop="stationen" label="风场" width="80" align="center"></el-table-column>
+				<el-table-column prop="stationcn" label="场站名称" width="120" align="center"></el-table-column>
+				<el-table-column prop="windturbineid" label="风机编号" width="100" align="center"></el-table-column>
+				<el-table-column prop="model" label="风机型号" width="80" align="center"></el-table-column>
+				<el-table-column width="200" label="故障标签">
+					<template #default="scope">
+						<span>
+							<el-select v-model="scope.row.faultcode" @change="selectChange(scope.row)" clearable
+								placeholder="请选择" popper-class="select" style="width: 130px; margin-left: 30px">
+								<el-option v-for="item in faultLists" :key="item.faultcode" :label="item.faulttype"
+									:value="item.faultcode">
+								</el-option>
+							</el-select>
+						</span>
+					</template>
+				</el-table-column>
+				<el-table-column width="120" label="操作">
+					<template #default="btn">
+						<button class="btn" @click="getReports(btn.row.faultid)">查看检测报告</button>
+					</template>
+				</el-table-column>
+			</el-table>
+		</div>
+		<TestReport v-model="reportDisplay" :faultid='faultid'></TestReport>
+	</el-dialog>
 </template>
 <script>
-import TestReport from "./testReport.vue";
-import axios from "axios";
-export default {
-  components: {
-    TestReport,
-  },
-  props: {},
-  data() {
-    return {
-      faultLists: [],
-      allData: [],
-      reportDisplay: false,
-    };
-  },
-  created() {
-    this.getfaultLables();
-  },
-  methods: {
-    opened() {
-      this.getData();
-    },
-    getData() {
-      let that = this;
-      this.API.requestData({
-        method: "GET",
-        subUrl: "http://192.168.1.18:9002/case/fault/list",
-        data: {
-          //   station: this.selectValue,
-          //   model: this.selectMoudle,
-          st: new Date(new Date().getTime() - 86400000).formatDate("yyyy-MM-dd hh:mm:ss"),
-          et: new Date().formatDate("yyyy-MM-dd hh:mm:ss"),
-        },
-        success(res) {
-          if (res) {
-            that.allData = res.data;
-          }
-        },
-      });
-    },
-    getfaultLables() {
-      let that = this;
-      this.API.requestData({
-        method: "GET",
-        subUrl: "http://192.168.1.18:9002/know/fault/type/all",
-        success(res) {
-          if (res) {
-            that.faultLists = res.data;
-          }
-        },
-      });
-    },
+	import TestReport from "./testReport.vue";
+	import axios from "axios";
+	export default {
+		components: {
+			TestReport,
+		},
+		props: {
+			myData: {}
+		},
+		data() {
+			return {
+				faultLists: [],
+				allData: [],
+				reportDisplay: false,
+				faultid:''
+			};
+		},
+		created() {
+			this.getfaultLables();
+		},
+		methods: {
+			opened() {
+				this.getData();
+			},
+			getData() {
+				let that = this;
+				that.API.requestData({
+					method: "GET",
+					subUrl: "http://192.168.1.18:9002/case/fault/list",
+					data: {
+						station: that.myData.station,
+						model: that.myData.model,
+						st: that.myData.st,
+						et: that.myData.et,
+						category: 3
+					},
+					success(res) {
+						if (res) {
+							that.allData = res.data;
+						}
+					},
+				});
+			},
+			getfaultLables() {
+				let that = this;
+				this.API.requestData({
+					method: "GET",
+					subUrl: "http://192.168.1.18:9002/know/fault/type/all",
+					success(res) {
+						if (res) {
+							that.faultLists = res.data;
+						}
+					},
+				});
+			},
 
-    selectChange(data) {
-      let params = [];
-      (data.faulttype = this.faultLists.filter(
-        (item) => item.faultcode === data.faultcode
-      )[0]?.faulttype),
-        params.push(data);
-      axios({
-        method: "post",
-        url: "http://192.168.10.19:9002/case/fault/insert",
-        data: params,
-        header: {
-          "Content-Type": "application/json",
-        },
-      }).then((res) => {
-        if (res.data.code !== 200) {
-          this.BASE.showMsg({
-            type: "error",
-            msg: "标签修改失败",
-          });
-        }
-      });
-    },
-    getReports() {
-      this.reportDisplay = true;
-    },
-  },
-};
+			selectChange(data) {
+				let params = [];
+				(data.faulttype = this.faultLists.filter(
+					(item) => item.faultcode === data.faultcode
+				)[0]?.faulttype),
+				params.push(data);
+				axios({
+					method: "post",
+					url: "http://192.168.10.19:9002/case/fault/insert",
+					data: params,
+					header: {
+						"Content-Type": "application/json",
+					},
+				}).then((res) => {
+					if (res.data.code !== 200) {
+						this.BASE.showMsg({
+							type: "error",
+							msg: "标签修改失败",
+						});
+					}
+				});
+			},
+			getReports(id) {
+				this.faultid = id;
+				this.reportDisplay = true;
+			},
+		},
+	};
 </script>
 <style lang="less" scoped>
-.btn {
-  width: 106px !important;
-}
-</style>
+	.btn {
+		width: 106px !important;
+	}
+</style>

File diff suppressed because it is too large
+ 211 - 266
src/views/MalfunctionWarning/components/testReport.vue


+ 8 - 1
src/views/MalfunctionWarning/supervised.vue

@@ -179,7 +179,7 @@
     ></ChartDetails>
     <DetectionRecord
       v-model="detectionDisplay"
-      :allData="allData"
+      :myData="myData"
     ></DetectionRecord>
   </div>
 </template>
@@ -216,6 +216,7 @@ export default {
   },
   data() {
     return {
+		myData:{},
       dataList: [],
       faultLists: [],
       lossList: {},
@@ -362,6 +363,12 @@ export default {
         this.showBarList.push(this.ceshiList);
         this.recordsDisplay = true;
       } else if (btnType === "jcjl") {
+		  this.myData = {
+			  station: this.selectValue,
+			  model: this.selectMoudle,
+			  st: new Date(this.timeValue[0]).formatDate("yyyy-MM-dd hh:mm:ss"),
+			  et: new Date(this.timeValue[1]).formatDate("yyyy-MM-dd hh:mm:ss"),
+		  };
         this.detectionDisplay = true;
       }
     },