Browse Source

将消缺历史功能提出来

mw_666 3 years ago
parent
commit
054811a93a

+ 0 - 8
src/views/HealthControl/HealthMonth.vue

@@ -1,8 +0,0 @@
-<template>
-</template>
-
-<script>
-</script>
-
-<style>
-</style>

+ 28 - 5
src/views/HealthControl/HealthTab4.vue

@@ -84,23 +84,35 @@
         custom-class="modal"
         :close-on-click-modal="false"
       >
-        <info-history :formdata="trackDate" />
+        <info-history :formdata="trackDate"/>
       </el-dialog>
     </div>
+	<el-dialog
+	  title="消缺历史"
+	  v-model="history"
+	  width="1400px"
+	  height="800px"
+	  custom-class="modal"
+	  :close-on-click-modal="false"
+	>
+	<History :formdata="trackDate"/>
+	</el-dialog>
   </div>
 </template>
 
 <script>
 import InfoHistory from "./infotrack2.vue";
+import History from "./healthTab4History.vue";
 import ComTable from "@com/coms/table/table.vue";
 import SvgIcon from "../../components/coms/icon/svg-icon.vue";
 import { warn } from "@vue/runtime-core";
 
 export default {
-  components: { InfoHistory, ComTable, SvgIcon },
+  components: { InfoHistory, ComTable, SvgIcon ,History},
   data() {
     const that = this;
     return {
+	  history:false,
       stations: [], // 场站
       windturbines: [], // 风机
       station: "",
@@ -111,21 +123,25 @@ export default {
         column: [
           {
             name: "场站",
+			width:'120px',
             field: "wfname",
             is_light: false,
           },
           {
             name: "风机编号",
+			width:'100px',
             field: "wtid",
             is_light: false,
           },
           {
             name: "任务开始时间",
+			width:'150px',
             field: "operationdate",
             is_light: false,
           },
           {
             name: "任务接受时间",
+			width:'150px',
             field: "departuretime",
             is_light: false,
           },
@@ -141,14 +157,21 @@ export default {
           },
           {
             name: "操作",
+			width:'170px',
             field: "",
             is_num: false,
             is_light: false,
             template() {
-              return "<el-button type='text' style='cursor: pointer;'>消缺跟踪</el-button>";
+              return "<el-button type='text' style='cursor: pointer;' value='gz'>消缺跟踪</el-button>&nbsp;&nbsp;<el-button type='text' style='cursor: pointer;' value='ls'>消缺历史</el-button>";
             },
             click(e, row) {
-              that.onClickTrack(row);
+				if('gz' == event.target.getAttribute("value")){
+					that.onClickTrack(row);
+				}
+				if('ls' == event.target.getAttribute("value")){
+					that.requestTrack(row);
+					that.history = true;
+				}
             },
           },
         ],
@@ -171,6 +194,7 @@ export default {
     // 消缺跟踪
     onClickTrack(row) {
       this.requestTrack(row);
+	  this.dialogVisible = true;
     },
     // 历史查询
     onClickHistory(row) {
@@ -255,7 +279,6 @@ export default {
         success(res) {
           if (res.code == 200) {
             that.trackDate = res.data;
-            that.dialogVisible = true;
           }
         },
       });

+ 0 - 8
src/views/HealthControl/HealthYear.vue

@@ -1,8 +0,0 @@
-<template>
-</template>
-
-<script>
-</script>
-
-<style>
-</style>

+ 131 - 0
src/views/HealthControl/healthTab4History.vue

@@ -0,0 +1,131 @@
+<template>
+	<div>
+		<div class="diamain">
+			<div class="left">
+				<el-tree :data="data" :props="defaultProps" node-key="id" :default-expand-all="true"
+					custom-class="modal" @node-click="handleNodeClick"></el-tree>
+			</div>
+			<div class="right">
+				<div class="table-box">
+					<ComTable :data="tableData" height="700px"></ComTable>
+				</div>
+			</div>
+		</div>
+	</div>
+</template>
+
+<script>
+	import ComTable from "@com/coms/table/table.vue";
+	export default {
+		components: {
+			ComTable
+		},
+		props: {
+			gridDatas: {},
+			chartDatas: {},
+			formdata: Object,
+		},
+		data() {
+			return {
+				form: {
+					wtId: "",
+					wpId: ""
+				},
+				tableData: {
+					column: [{
+							name: "消缺描述",
+							field: "xqms",
+							width:'400px',
+							is_light: false,
+						},
+						{
+							name: "消缺人员",
+							field: "xqry",
+							is_light: false,
+						},
+						{
+							name: "消缺时间",
+							field: "xqsj",
+							is_light: false,
+						},
+						{
+							name: "更换部件",
+							field: "ghbj",
+							is_light: false,
+						},
+						{
+							name: "更换原因",
+							field: "ghyy",
+							is_light: false,
+						},
+						{
+							name: "更换数量",
+							field: "ghsl",
+							is_light: false,
+						},
+					],
+					data: [],
+				},
+				data: [],
+				defaultProps: {
+					children: "children",
+					label: "label",
+				},
+			};
+		},
+		methods: {
+			async searchH() {
+				var that = this;
+				const {
+					data
+				} = await that.API.requestData({
+					method: "POST",
+					subUrl: "/recommen/findLocationTreeByWtId",
+					data: {
+						wtId: that.form.wtId,
+					},
+				});
+				that.dialogVisible = true;
+				console.log(data.data)
+				that.data = data.data;
+				that.location = data.data[0].id;
+				that.searchTab();
+			},
+			async searchTab() {
+				var that = this;
+				const {
+					data
+				} = await that.API.requestData({
+					method: "POST",
+					subUrl: "/recommen/findWobugeqByLocation",
+					data: {
+						tablepar: {
+							pageNum: 1,
+							pageSize: 10,
+						},
+						location: that.location,
+					},
+				});
+				if(data.data && data.data[0] && data.data[0].xqsj){
+					data.data[0].xqsj = new Date(data.data[0].xqsj).formatDate("yyyy-MM-dd hh:mm:ss");
+				}
+				that.tableData.data = data.data;
+			},
+			handleNodeClick(data) {
+				this.location = data.id;
+			},
+		},
+		watch: {
+			formdata(res) {
+				if (res) {
+					this.form = this.formdata;
+					this.searchH();
+				}
+			}
+		}
+	};
+</script>
+
+<style lang="less">
+
+</style>

+ 0 - 163
src/views/HealthControl/infotrack2.vue

@@ -319,34 +319,6 @@
       :show="false"
       :formdata="formdata"
     ></defect-elimination-tracking>
-    <div class="dialog-box">
-      <el-dialog
-        title="消缺历史"
-        v-model="dialogVisible"
-        width="1200px"
-        height="800px"
-        custom-class="modal"
-        :close-on-click-modal="false"
-      >
-        <div class="diamain">
-          <div class="left">
-            <el-tree
-              :data="data"
-              :props="defaultProps"
-              node-key="id"
-              :default-expand-all="true"
-              custom-class="modal"
-              @node-click="handleNodeClick"
-            ></el-tree>
-          </div>
-          <div class="right">
-            <div class="table-box">
-              <ComTable :data="tableData" height="700px"></ComTable>
-            </div>
-          </div>
-        </div>
-      </el-dialog>
-    </div>
     <el-dialog
       title="查看监控视频"
       v-model="videoBoxShow"
@@ -400,103 +372,6 @@ export default {
       gisBoxShow: false,
       videoBoxShow: false,
       location: "",
-      tableData: {
-        column: [
-          {
-            name: "消缺描述",
-            field: "xqms",
-            is_light: false,
-          },
-          {
-            name: "消缺人员",
-            field: "xqry",
-            is_light: false,
-          },
-          {
-            name: "消缺时间",
-            field: "xqsj",
-            is_light: false,
-          },
-          {
-            name: "更换部件",
-            field: "ghbj",
-            is_light: false,
-          },
-          {
-            name: "更换原因",
-            field: "ghyy",
-            is_light: false,
-          },
-          {
-            name: "更换数量",
-            field: "ghsl",
-            is_light: false,
-          },
-        ],
-        data: [],
-      },
-      data: [
-        {
-          label: "一级 1",
-          children: [
-            {
-              label: "二级 1-1",
-              children: [
-                {
-                  label: "三级 1-1-1",
-                },
-              ],
-            },
-          ],
-        },
-        {
-          label: "一级 2",
-          children: [
-            {
-              label: "二级 2-1",
-              children: [
-                {
-                  label: "三级 2-1-1",
-                },
-              ],
-            },
-            {
-              label: "二级 2-2",
-              children: [
-                {
-                  label: "三级 2-2-1",
-                },
-              ],
-            },
-          ],
-        },
-        {
-          label: "一级 3",
-          children: [
-            {
-              label: "二级 3-1",
-              children: [
-                {
-                  label: "三级 3-1-1",
-                },
-              ],
-            },
-            {
-              label: "二级 3-2",
-              children: [
-                {
-                  label: "三级 3-2-1",
-                },
-              ],
-            },
-          ],
-        },
-      ],
-      defaultProps: {
-        children: "children",
-        label: "label",
-      },
-      dialogVisible: false,
       tabs: [
         {
           icon: "svg-gis",
@@ -510,10 +385,6 @@ export default {
           icon: "svg-jk",
           text: "监控视频",
         },
-        {
-          icon: "svg-jk",
-          text: "消缺历史",
-        },
       ],
       activeTab: 0,
       svgarr: [
@@ -610,10 +481,6 @@ export default {
         ? new Date(this.form.checktime).formatDate("yyyy-MM-dd hh:mm:ss")
         : null;
     },
-    handleNodeClick(data) {
-      this.location = data.id;
-      this.searchTab(data.id);
-    },
     DateformatDate(val) {
       return new Date(val).formatDate("yyyy-MM-dd hh:mm:ss");
     },
@@ -646,33 +513,6 @@ export default {
         return "流程未启动";
       }
     },
-    async searchH() {
-      const { data } = await this.API.requestData({
-        method: "POST",
-        subUrl: "/recommen/findLocationTreeByWtId",
-        data: {
-          wtId: this.form.wtId,
-        },
-      });
-      this.dialogVisible = true;
-      this.data = data.data;
-      this.location = data.data[0].id;
-      this.searchTab();
-    },
-    async searchTab() {
-      const { data } = await this.API.requestData({
-        method: "POST",
-        subUrl: "/recommen/findWobugeqByLocation",
-        data: {
-          tablepar: {
-            pageNum: 1,
-            pageSize: 10,
-          },
-          location: this.location,
-        },
-      });
-      this.tableData.data = data.data;
-    },
 
     showVideoBox() {
       this.videoBoxShow = true;
@@ -687,9 +527,6 @@ export default {
       } else if (index === 2) {
         this.showVideoBox();
       }
-      if (tab.text == "消缺历史") {
-        this.searchH();
-      }
     },
   },
 };