From 3909a52d26dca085a6ead5d0fbaca0ce512e27f7 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Fri, 23 Sep 2022 09:39:31 +0800
Subject: [PATCH] 数据统计人员统计

---
 src/views/taskinfo/taskinfo.vue |   36 ++++++++++++++++++++++++++++++------
 1 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/src/views/taskinfo/taskinfo.vue b/src/views/taskinfo/taskinfo.vue
index f642956..e7bc2fe 100644
--- a/src/views/taskinfo/taskinfo.vue
+++ b/src/views/taskinfo/taskinfo.vue
@@ -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,32 @@
                    @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>
+
   </basic-container>
 </template>
 
 <script>
+
   import {getList, getDetail, add, update, remove} from "@/api/taskinfo/taskinfo";
   import option from "@/const/taskinfo/taskinfo";
   import {mapGetters} from "vuex";
+  import OpenLayersMap from "@/components/OpenLayersMap";
 
   export default {
+    components: { OpenLayersMap },
     data() {
       return {
         form: {},
@@ -146,17 +163,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 +180,6 @@
         this.onLoad(this.page);
       },
       searchChange(params, done) {
-        params
         this.query = params;
         this.page.currentPage = 1;
         this.onLoad(this.page, params);
@@ -196,6 +210,16 @@
           this.loading = false;
           this.selectionClear();
         });
+      },
+      toData(toData) {
+        this.form.routeRange = toData
+      },
+      goTaskinfoDetail(row){
+        this.$router.push({ path: "/taskinfo/taskinfoDetail", query: row });
+      },
+      //点击当前行事件
+      rowClick(val){
+        this.$router.push({ path: "/taskinfo/taskinfoDetail", query: val });
       }
     }
   };

--
Gitblit v1.9.3