This commit is contained in:
weipengfei 2024-01-16 14:53:01 +08:00
parent 6443174f14
commit d6f369f6cd
5 changed files with 219 additions and 48 deletions

View File

@ -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;
}

View File

@ -22,7 +22,7 @@
>
<div
class="scrum-stage"
style="width: 32vw; min-width: 400px;"
style="width: 24vw; min-width: 300px;"
v-for="(stage, index) in taskStages"
:key="index"
:id="stage.code"
@ -625,6 +625,69 @@
</div>
<!--</a-spin>-->
</div>
<div
class="scrum-stage"
style="width: 24vw; min-width: 300px;"
>
<header
class="scrum-stage-header ui-sortable-handle"
v-show="true"
>
<div class="stage-name hinted">
消息
<!-- <span class="task-count" v-if="noti.length > 0">
· {{ stage.tasks.length }}</span
> -->
</div>
</header>
<!--</a-tooltip>-->
<div
class="scrum-stage-wrap ui-sortable"
:class="{ 'hidden-creator-bottom': true }"
>
<vue-scroll :ref="3 + '-stage'" :ops="scrollOps">
<section
:id="3"
:task-type-index="3"
class="scrum-stage-content thin-scroll"
>
<a-spin
wrapperClassName="tasks-loading"
:spinning="false"
>
<!--未完成列表 v-model="stage.unDoneTasks" 拖动 -->
<div
:options="{
group: 'task',
ghostClass: 'task-ghost',
dragClass: 'task-drag',
fallbackClass: 'task-drag',
forceFallback: false,
}"
@end="taskSort"
class="scrum-stage-tasks"
>
<div
class="task task-card ui-sortable-handle"
v-for="(item, index) in noticeList"
:key="index"
style="padding: 10px;flex-direction: column;"
>
<div style="display: flex;justify-content: space-between;width: 100%;">
<div>{{ item.title }}</div>
<div>{{ item.create_time }}</div>
</div>
<div style="color: #fff;font-size: 13px;background-color: #1890ff;border-radius: 5px;padding: 1px 3px;">任务: {{ item.content }}</div>
</div>
</div>
<div style="color: #888;text-align: center;cursor: pointer;" v-if="pages[3]>=0" @click="getNotifyList">查看更多</div>
<div style="color: #888;text-align: center;cursor: pointer;" v-else>没有更多了</div>
</a-spin>
</section>
</vue-scroll>
</div>
</div>
<div class="scrum-stage undraggable create-stage" v-if="false">
<header class="scrum-stage-header">
<div class="stage-name hinted" style="width: 100%">
@ -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]++;
})
}
},
};

View File

@ -9,7 +9,7 @@
<div class="menu-item-d">
<a-avatar :src="item.avatar" icon="user" size="small" />
<a class="muted name">{{ item.name }}</a>
<span v-if="index%3!=0" class="line_on"> 在线</span>
<span v-if="item.is_owner" class="line_on"> 在线</span>
<span v-else class="line_off"> 离线</span>
</div>
</a-menu-item>
@ -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 {
<div>${item.name}</div>
<div>更新时间:${item.date}</div>
<div>停留时间:${item.date}</div>
<div>停留时长:${item.stop_time}</div>
</div>
</div>
`,
@ -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 {
};
</script>
<style lang="less" scoped>
<style lang="less">
.marker-d {
width: 260px;
img {

View File

@ -0,0 +1,75 @@
<template>
<a-modal
class="task-detail-modal"
width="min-content"
:closable="false"
visible
title=""
:footer="null"
@cancel="detailClose"
>
<task-detail :taskCode="code" @close="detailClose"></task-detail>
<div>sss</div>
</a-modal>
</template>
<script>
import taskDetail from '@/components/project/taskDetail'
export default {
name: "task-detail-modal",
components: {
taskDetail
},
data() {
return {
loading: false,
code: this.$route.params.taskCode,
projectCode: this.$route.params.code,
}
},
created() {
console.log('加载');
this.init();
},
methods: {
init() {
this.loading = true;
},
detailClose() {
const stageIndex = this.$route.query.from;
let url = '';
if (stageIndex) {
url = `?from=${stageIndex}`;
}
this.$router.push(`/copysv`);
},
}
}
</script>
<style lang="less">
.task-detail-modal {
/*display: flex;*/
/*justify-content: center;*/
/*flex: 1;*/
/*min-height: 1px;*/
/*min-width: 1px;*/
width: 1200px;
&.ant-modal {
padding-bottom: 0;
}
.ant-modal-content {
/*width: 1200px;*/
/*overflow: hidden;*/
.ant-modal-body {
padding: 0;
}
}
}
</style>

View File

@ -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) {
},