diff --git a/hb_client/src/api/workflow.js b/hb_client/src/api/workflow.js index 001df7e..1b6189c 100644 --- a/hb_client/src/api/workflow.js +++ b/hb_client/src/api/workflow.js @@ -240,3 +240,10 @@ export function getCodes() { method: 'get' }) } +//工单详情 +export function getWorkflowInit(id) { + return request({ + url: `/wf/workflow/${id}/init/`, + method: 'get' + }) +} diff --git a/hb_client/src/components/Gantt/index.vue b/hb_client/src/components/Gantt/index.vue index 68c38fd..a972888 100644 --- a/hb_client/src/components/Gantt/index.vue +++ b/hb_client/src/components/Gantt/index.vue @@ -201,14 +201,6 @@ width: item.widthMe + 'px', top: item.top + 'px' }" - @mouseover=" - lineMouseover( - `line${item.id}`, - $event, - item.id, - item.parentId, - index - )" @mouseleave="lineMouseleave" @mouseenter=" lineMouseenter( @@ -303,6 +295,8 @@ }, data() { return { + windowWidth:0, + windowHeight:0, leftYear:2021, timeRange: [], disable: true, @@ -374,6 +368,13 @@ }; }, mounted(){ + if(window.innerHeight){ + this.windowWidth = window.innerWidth; + this.windowHeight = window.innerHeight; + }else{ + this.windowHeight=document.body.clientHeight?document.body.clientHeight:document.documentElement.clientHeight; + this.windowWidth=document.body.clientWidth?document.body.clientWidth:document.documentElement.clientWidth; + } let currentYear = new Date().getFullYear(); this.timeRange = [currentYear+'-01',currentYear+'-12']; this.list = [...this.proList]; @@ -518,10 +519,8 @@ }, //修改后续高度 resetTop(zindex, reduce, isexpand) { - // console.log(zindex, reduce, isexpand); let num = reduce ? -40 : 40; if (!reduce && !isexpand) { - // console.log(2); this.list.forEach((item, index) => { if (index > zindex) { item.top = item.top + 40; @@ -533,7 +532,6 @@ } }); } else { - // console.log(1); this.list.forEach((item, index) => { if (index > zindex) { item.top = item.top + num * this.list[zindex].children.length; @@ -584,7 +582,6 @@ let widthMe = width - left; parent.widthMe = parent.widthChild = widthMe; parent.left = left; - // return parent; }, // 转为分组 handlerGroup(row) { @@ -658,10 +655,8 @@ let index = this.list.findIndex(k => { return k.id == parentId; }); - // console.log(parentId); this.list.forEach(item => { if (item.id == parentId) { - // console.log(item, this.list); item.children.forEach(k => { if (k.id == id) { k.per = per; @@ -813,6 +808,17 @@ Math.round(end / this.currentDaySize.value) * this.currentDaySize.value - this.currentDaySize.value; + let infoDomX=0,infoDomY = 0; + if(this.windowWidth-e.clientX>230){ + infoDomX = e.clientX; + }else{ + infoDomX = this.windowWidth-230; + } + if(this.windowHeight-e.clientY>200){ + infoDomY = e.clientY; + }else{ + infoDomY = this.windowHeight-200; + } this.currentProjectMsg = { name: this.computedList[index].name, allTime: (end - start) / this.currentDaySize.value + 1, @@ -820,8 +826,8 @@ per1: this.computedList[index].per1, startTime: this.computedWithTime(start), endTime: this.computedWithTime(end), - left: e.clientX, - top: e.clientY + 20 + left:infoDomX , + top: infoDomY }; /* * left: @@ -848,7 +854,6 @@ left: 0, top: 0 }; - // this.handlerSelect(); return; } this.currentLineDay = { @@ -1029,7 +1034,6 @@ }); } }, - beforeDestroy() { window.removeEventListener("scroll", this.handleScroll); document.onmousemove = document.onmouseup = null; @@ -1107,6 +1111,7 @@ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); border-radius: 4px; border: 1px solid #ebeef5; + pointer-events: none; .lineMsg { margin-bottom: 10px; diff --git a/hb_client/src/router/index.js b/hb_client/src/router/index.js index 3ac6882..7f13757 100644 --- a/hb_client/src/router/index.js +++ b/hb_client/src/router/index.js @@ -185,14 +185,6 @@ export const asyncRoutes = [ component: () => import('@/views/pm/management'), meta: { title: '生产任务管理', icon: 'example', perms: ['pm_resources'] } } - , - { - path: 'gantt', - name: 'gantt', - component: () => import('@/views/pm/gantt'), - meta: { title: '甘特图', icon: 'example',perms: ['vendor_manage'] }, - // hidden: true - } ] } , diff --git a/hb_client/src/views/pm/gantt.vue b/hb_client/src/views/pm/gantt.vue index 6c2b376..079d0a4 100644 --- a/hb_client/src/views/pm/gantt.vue +++ b/hb_client/src/views/pm/gantt.vue @@ -300,6 +300,8 @@ }, data() { return { + windowWidth:0, + windowHeight:0, timeRange:[], disable: true, //当前项是否是子集 @@ -499,11 +501,6 @@ TableScrollTop(val) { let lineBG = this.$refs.lineBG; lineBG.scrollTo(0, val); - // lineBG.scrollTo({ - // top: val, - // left: 0, - // behavior: "smooth" - // }); }, handlerBGScroll(e) { this.BGScrollTop = this.$refs.chart.scrollTop; @@ -862,15 +859,9 @@ ) * this.currentDaySize.value + this.currentDaySize.value; - let end = - parseInt(this.$refs[dom][0].style.left) + - parseInt(this.$refs[dom][0].style.width); - end = - Math.round(end / this.currentDaySize.value) * this.currentDaySize.value; - this.currentLineDay = { - start, - end - }; + let end = parseInt(this.$refs[dom][0].style.left) + parseInt(this.$refs[dom][0].style.width); + end = Math.round(end / this.currentDaySize.value) * this.currentDaySize.value; + this.currentLineDay = { start, end }; this.isHover = true; this.handlerSelect(this.computedList[index]); this.lineMouseenter(dom, e, id, parentId, index); @@ -888,13 +879,21 @@ Math.round( parseInt(this.$refs[dom][0].style.left) / this.currentDaySize.value ) * this.currentDaySize.value; - let end = - parseInt(this.$refs[dom][0].style.left) + - parseInt(this.$refs[dom][0].style.width); - end = - Math.round(end / this.currentDaySize.value) * - this.currentDaySize.value - - this.currentDaySize.value; + let end = parseInt(this.$refs[dom][0].style.left) + parseInt(this.$refs[dom][0].style.width); + end = Math.round(end / this.currentDaySize.value) * this.currentDaySize.value - this.currentDaySize.value; + debugger; + let infoDomX=0,infoDomY = 0; + if(this.windowWidth-e.clientX>230){ + infoDomX = e.clientX; + }else{ + infoDomX = this.windowWidth-230; + } + if(this.windowHeight-e.clientY>200){ + infoDomY = e.clientY; + }else{ + infoDomY = this.windowHeight-200; + } + // if(){}else{} this.currentProjectMsg = { name: this.computedList[index].name, allTime: (end - start) / this.currentDaySize.value + 1, @@ -902,8 +901,8 @@ per1: this.computedList[index].per1, startTime: this.computedWithTime(start), endTime: this.computedWithTime(end), - left: e.clientX , - top: e.clientY + 20 + left:infoDomX , + top: infoDomY }; /* * left: @@ -1095,6 +1094,10 @@ } }, watch: { + detailInfo(e,data) { + showDiv.style.left = (event.pageX - 300) + 'px'; + showDiv.style.top = (event.pageY - 120) + 'px'; + }, currentDaySize(newValue, oldValue) { this.list.forEach(item => { item.left = (item.left / oldValue.value) * newValue.value; @@ -1111,6 +1114,13 @@ } }, mounted() { + if(window.innerHeight){ + this.windowWidth = window.innerWidth; + this.windowHeight = window.innerHeight; + }else{ + this.windowHeight=document.body.clientHeight?document.body.clientHeight:document.documentElement.clientHeight; + this.windowWidth=document.body.clientWidth?document.body.clientWidth:document.documentElement.clientWidth; + } document.addEventListener("scroll", this.handleScroll); this.getDay(); this.setStoneLine(); diff --git a/hb_client/src/views/workflow/ticketHandle.vue b/hb_client/src/views/workflow/ticketHandle.vue index 8aed872..85ef7ae 100644 --- a/hb_client/src/views/workflow/ticketHandle.vue +++ b/hb_client/src/views/workflow/ticketHandle.vue @@ -35,7 +35,7 @@ - + {{ticketDetail.ticket_data[item.field_key]}} @@ -73,9 +73,9 @@ @@ -84,9 +84,9 @@ @@ -205,6 +205,7 @@