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 | 41 +++++++++++++++++++++++++++++++----------
1 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/src/views/taskinfo/taskinfo.vue b/src/views/taskinfo/taskinfo.vue
index 75d1311..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,24 +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: { OpenLayersMap },
+ components: {TaskinfoDetail, OpenLayersMap },
data() {
return {
form: {},
@@ -58,7 +69,9 @@
},
selectionList: [],
option: option,
- data: []
+ data: [],
+ detailVisible:false,
+ detailInfo:{},
};
},
created() {
@@ -154,12 +167,7 @@
});
},
beforeOpen(done, type) {
- if (["edit", "view"].includes(type)) {
- getDetail(this.form.id).then(res => {
- this.form = res.data.data;
- this.form.routeRange = '\'' + this.form.routeRange + '\''
- });
- } else {
+ if (["add"].includes(type)) {
const date = new Date()
const year = date.getFullYear()
const month = date.getMonth() + 1
@@ -209,6 +217,19 @@
},
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