From d6f369f6cd9a12aff52febefcbdf2cd76754c366 Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Tue, 16 Jan 2024 14:53:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 12 +++-- src/views/datav/copyV.vue | 88 ++++++++++++++++++++++++++++++---- src/views/datav/dataV.vue | 34 +++++++++---- src/views/datav/taskdetail.vue | 75 +++++++++++++++++++++++++++++ src/views/index.vue | 58 +++++++++++----------- 5 files changed, 219 insertions(+), 48 deletions(-) create mode 100644 src/views/datav/taskdetail.vue diff --git a/src/router/index.js b/src/router/index.js index d61ca47..b5f13e5 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -9,6 +9,7 @@ import config from "../config/config"; import {refreshAccessToken} from "../api/common/common"; import dataV from "@/views/datav/dataV"; import copyV from "@/views/datav/copyV"; +import taskdetail from "@/views/datav/taskdetail"; let HOME_PAGE = config.HOME_PAGE; const currentOrganization = getStore('currentOrganization', true); @@ -78,7 +79,13 @@ const router = new Router({ { name: 'copysv', path: '/copysv', - component: copyV + component: copyV, + children: [{ + name: 'copytaskdetail', + path: '/detail/:taskCode', + component: taskdetail, + meta: {model: 122, info: {show_slider: false, is_inner: true}}, + }] }, // { // name: 'login', @@ -170,8 +177,7 @@ router.beforeEach((to, from, next) => { } } - if (to.name === 'datasv' || to.path === '/datasv' || to.name === 'copysv' || to.path === '/copysv') { - console.log('跳转', to); + if (to.name === 'datasv' || to.path === '/datasv' || to.name === 'copysv' || to.path.includes('/copysv') ) { next(); return false; } diff --git a/src/views/datav/copyV.vue b/src/views/datav/copyV.vue index cbcd0b5..2dc8c20 100644 --- a/src/views/datav/copyV.vue +++ b/src/views/datav/copyV.vue @@ -22,7 +22,7 @@ >
+
+
+
+ 消息 + +
+
+ +
+ +
+ + +
+
+
+
{{ item.title }}
+
{{ item.create_time }}
+
+
任务: {{ item.content }}
+
+
+
查看更多
+
没有更多了
+
+
+
+
+ +
@@ -988,6 +1051,7 @@ import { formatTaskTime } from "@/assets/js/dateTime"; import { collect } from "@/api/projectCollect"; import { notice } from "@/assets/js/notice"; + import {list as getNotifyList, del} from '@/api/notify'; export default { name: "copyV", @@ -1025,6 +1089,7 @@ nextTaskCode: "", taskSearchParams: {}, + noticeList: [], stageKeys: [], stageModal: { @@ -1035,7 +1100,7 @@ confirmLoading: false, modalTitle: "编辑列表", }, - pages: [1,1,1], + pages: [1,1,1,1], slideMenuKey: "", showInviteMember: false, @@ -1210,6 +1275,7 @@ this.getProject(); this.getProjectMembers(); this.init(); + this.getNotifyList(); }, directives: { dragscroll2: function (el) { @@ -1710,13 +1776,8 @@ }, taskDetail(code, stageIndex) { this.$router.push( - `${this.$route.path}/detail/${code}?from=${stageIndex}` + `/project/space/task/qfbyovzhd9sj31u8ln602rwk/detail/${code}?from=${stageIndex}` ); - this.$nextTick(() => { - setTimeout(() => { - this.showTaskCard(stageIndex, false); - }, 700); - }); }, stageSort(event) { const list = this.getPreAndNextCode(event); @@ -1869,6 +1930,17 @@ }, loadMoreStage(stage, index=1){ this.getTasks(stage, index, true) + }, + getNotifyList(){ + getNotifyList({ + page: this.pages[3], + pageSize: 25, + type: 'system' + }).then(res=>{ + this.noticeList = [...this.noticeList, ...res.data.list]; + if(res.data.list.length<25)this.pages[3] = -1; + else this.pages[3]++; + }) } }, }; diff --git a/src/views/datav/dataV.vue b/src/views/datav/dataV.vue index 43f561d..442804a 100644 --- a/src/views/datav/dataV.vue +++ b/src/views/datav/dataV.vue @@ -9,7 +9,7 @@ @@ -61,6 +61,8 @@ export default { member_list: [], markers: [], polyline: null, + timerM: null, + timerP: null, }; }, created() { @@ -70,6 +72,10 @@ export default { mounted() { this.initMap(); }, + destroyed(){ + clearInterval(this.timerM); + clearInterval(this.timerP); + }, methods: { getMembers() { getMembers().then((res) => { @@ -100,8 +106,12 @@ export default { center: [105.433211, 28.913861], // 初始化地图中心点位置 mapStyle: "amap://styles/darkblue", }); - + this.initMaker(); + this.timerM = setInterval(()=>{ + this.initMaker(); + }, 1000*10) + }) .catch((e) => { console.log(e); @@ -109,14 +119,23 @@ export default { }, handleMenuClick(e) { this.now_user = this.member_list[e.key]; + if(!this.now_user.member_code||!this.now_date) return; + clearInterval(this.timerM); + clearInterval(this.timerP); this.initList(); + this.timerP = setInterval(this.initList, 1000*10) }, changeTime(e) { - console.log(this.now_date); + if(!this.now_user.member_code||!this.now_date) return; + clearInterval(this.timerM); + clearInterval(this.timerP); this.initList(); + this.timerP = setInterval(this.initList, 1000*10) }, initMaker() { + if(this.polyline) this.polyline.setMap(null); positioningList().then((res) => { + if(this.markers) this.map.remove(this.markers); // 添加标记点 res.data.forEach((item) => { if (item.positioning) { @@ -133,6 +152,7 @@ export default {
${item.name}
更新时间:${item.date}
停留时间:${item.date}
+
停留时长:${item.stop_time}
`, @@ -144,9 +164,7 @@ export default { }); }, initList() { - if(!this.now_user.member_code||!this.now_date) return; - this.map.remove(this.markers); - if(this.polyline)this.polyline.setMap(null); + if(this.markers) this.map.remove(this.markers); positioningMember({ code: this.now_user.member_code, date: this.formatDate(new Date(this.now_date||Date.now())), @@ -154,7 +172,7 @@ export default { let path = res.data.map((item) => { return item.split(","); })||[]; - + if(this.polyline) this.polyline.setMap(null); if(path.length==0) return notice({title: '该成员当日无轨迹信息'}, 'error', 3000); // 绘制轨迹 this.polyline = new AMap.Polyline({ @@ -175,7 +193,7 @@ export default { }; - diff --git a/src/views/index.vue b/src/views/index.vue index c19b44c..7855cc9 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -327,35 +327,35 @@ menuModelClick(event) { //点击顶部导航跳转页面 console.log('event', event); - // if(event.key==175){ // 跳转大屏 - // return this.$router.push('/datasv'); - // } - // if(event.key==180){ // 跳转大屏 - // return this.$router.push('/copysv'); - // } - let that = this; - that.menus = that.menu.find(v=>v.id == event.key).children; - let turnPath = '/'; - if (!that.menus) { - turnPath += v.fullUrl; - } else if (!that.menus[0].children) { - turnPath += that.menus[0].fullUrl; - } else { - turnPath += that.menus[0].children[0].fullUrl; - } - if(turnPath.includes('datasv')){ - return that.$router.push('/datasv'); - } - if(turnPath.includes('copysv')){ - return that.$router.push('/copysv'); - } - if (turnPath == '/home') { - that.toHome(); - return false; - } - if (turnPath != '/#') { - that.$router.push(turnPath); - } + + //点击顶部导航跳转页面 + let that = this; + that.menu.forEach(function (v, k) { + if (v.id == event.key) { + that.menus = v.children; + let turnPath = '/'; + if (!v.children) { + turnPath += v.fullUrl; + } else if (!v.children[0].children) { + turnPath += v.children[0].fullUrl; + } else { + turnPath += v.children[0].children[0].fullUrl; + } + if(turnPath.includes('datasv')){ + return that.$router.push('/datasv'); + } + if(turnPath.includes('copysv')){ + return that.$router.push('/copysv'); + } + if (turnPath == '/home') { + that.toHome(); + return false; + } + if (turnPath != '/#') { + that.$router.push(turnPath); + } + } + }); }, onModelOpenChange(openKeys) { },