From 85516fee32a60da175e88a9bea5e0d1935bc050f Mon Sep 17 00:00:00 2001
From: xiebin <123456>
Date: Sun, 09 Oct 2022 09:44:23 +0800
Subject: [PATCH] 代码优化
---
src/views/taskinfo/taskinfo.vue | 37 +++++++++++++++++++++++++------------
1 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/src/views/taskinfo/taskinfo.vue b/src/views/taskinfo/taskinfo.vue
index e7bc2fe..47fdf65 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"
@@ -43,18 +43,20 @@
</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: {},
@@ -67,16 +69,19 @@
},
selectionList: [],
option: option,
- data: []
+ data: [],
+ detailVisible:false,
+ detailInfo:{},
};
},
created() {
- const date = new Date()
- const year = date.getFullYear()
- const month = date.getMonth() + 1
- const strDate = date.getDate()
- this.query.startTime = `${year}-${month}-${strDate} 00:00:00`
- this.query.endTime = `${year}-${month}-${strDate} 23:59:59`
+ // 默认时间查询
+ // const date = new Date()
+ // const year = date.getFullYear()
+ // const month = date.getMonth() + 1
+ // const strDate = date.getDate()
+ // this.query.startTime = `${year}-${month}-${strDate} 00:00:00`
+ // this.query.endTime = `${year}-${month}-${strDate} 23:59:59`
},
computed: {
...mapGetters(["permission"]),
@@ -172,6 +177,8 @@
this.form.endTime = `${year}-${month}-${strDate} 23:59:59`
this.form.source = 'SYSTEMNEW'
this.form.state = '0'
+ } else if (["edit"].includes(type)) {
+ this.form.routeRange = '\'' + this.form.routeRange + '\''
}
done();
},
@@ -215,11 +222,17 @@
this.form.routeRange = toData
},
goTaskinfoDetail(row){
- this.$router.push({ path: "/taskinfo/taskinfoDetail", query: row });
+ // this.$router.push({ path: "/taskinfo/taskinfoDetail", query: row });
+ this.rowClick(row)
},
//点击当前行事件
rowClick(val){
- this.$router.push({ path: "/taskinfo/taskinfoDetail", query: val });
+ // this.$router.push({ path: "/taskinfo/taskinfoDetail", query: val });
+ this.detailInfo = val
+ this.isDetail();
+ },
+ isDetail(){
+ this.detailVisible = !this.detailVisible
}
}
};
--
Gitblit v1.9.3