From e4e92ce9eee6d39ae6bddaeca8f212d9b3b52ecc Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Fri, 23 Sep 2022 14:25:51 +0800
Subject: [PATCH] 事件管理、巡检计划、维修管理添加时间查询

---
 src/views/taskinfo/taskinfo.vue |   52 +++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 43 insertions(+), 9 deletions(-)

diff --git a/src/views/taskinfo/taskinfo.vue b/src/views/taskinfo/taskinfo.vue
index f642956..a142d93 100644
--- a/src/views/taskinfo/taskinfo.vue
+++ b/src/views/taskinfo/taskinfo.vue
@@ -1,6 +1,6 @@
 <template>
   <basic-container>
-    <avue-crud :option="option"
+    <avue-crud v-show="!detailVisible" :option="option"
                :table-loading="loading"
                :data="data"
                :page.sync="page"
@@ -12,6 +12,7 @@
                @row-update="rowUpdate"
                @row-save="rowSave"
                @row-del="rowDel"
+               @row-dblclick="rowClick"
                @search-change="searchChange"
                @search-reset="searchReset"
                @selection-change="selectionChange"
@@ -28,16 +29,34 @@
                    @click="handleDelete">删 除
         </el-button>
       </template>
+      <template slot-scope="{ type, size, row }" slot="menu">
+        <el-button
+          icon="el-icon-view"
+          type="text"
+          size="mini"
+          @click="goTaskinfoDetail(row)"
+        >查看</el-button>
+      </template>
+      <template slot="routeRangeForm">
+        <open-layers-map ref="OpenLayersMap" @toData="toData" :routeRange="form.routeRange"></open-layers-map>
+      </template>
+
     </avue-crud>
+
+    <taskinfo-detail v-if="detailVisible" ref="detailVisible" :detailInfo="detailInfo" @isDetail="isDetail"></taskinfo-detail>
   </basic-container>
 </template>
 
 <script>
-  import {getList, getDetail, add, update, remove} from "@/api/taskinfo/taskinfo";
+
+  import {getList, add, update, remove} from "@/api/taskinfo/taskinfo";
   import option from "@/const/taskinfo/taskinfo";
   import {mapGetters} from "vuex";
+  import OpenLayersMap from "@/components/OpenLayersMap";
+  import TaskinfoDetail from "@/views/taskinfo/taskinfoDetail";
 
   export default {
+    components: {TaskinfoDetail, OpenLayersMap },
     data() {
       return {
         form: {},
@@ -50,7 +69,9 @@
         },
         selectionList: [],
         option: option,
-        data: []
+        data: [],
+        detailVisible:false,
+        detailInfo:{},
       };
     },
     created() {
@@ -146,17 +167,15 @@
           });
       },
       beforeOpen(done, type) {
-        if (["edit", "view"].includes(type)) {
-          getDetail(this.form.id).then(res => {
-            this.form = res.data.data;
-          });
-        } else {
+        if (["add"].includes(type)) {
           const date = new Date()
           const year = date.getFullYear()
           const month = date.getMonth() + 1
           const strDate = date.getDate()
           this.form.startTime = `${year}-${month}-${strDate} 00:00:00`
           this.form.endTime = `${year}-${month}-${strDate} 23:59:59`
+          this.form.source = 'SYSTEMNEW'
+          this.form.state = '0'
         }
         done();
       },
@@ -165,7 +184,6 @@
         this.onLoad(this.page);
       },
       searchChange(params, done) {
-        params
         this.query = params;
         this.page.currentPage = 1;
         this.onLoad(this.page, params);
@@ -196,6 +214,22 @@
           this.loading = false;
           this.selectionClear();
         });
+      },
+      toData(toData) {
+        this.form.routeRange = toData
+      },
+      goTaskinfoDetail(row){
+        // this.$router.push({ path: "/taskinfo/taskinfoDetail", query: row });
+        this.rowClick(row)
+      },
+      //点击当前行事件
+      rowClick(val){
+        // this.$router.push({ path: "/taskinfo/taskinfoDetail", query: val });
+        this.detailInfo = val
+        this.isDetail();
+      },
+      isDetail(){
+        this.detailVisible = !this.detailVisible
       }
     }
   };

--
Gitblit v1.9.3